Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
699e6eb9
Commit
699e6eb9
authored
Oct 13, 2025
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源页列表UI调整
parent
7aa435b9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
44 deletions
+43
-44
YHResourceTableViewCell.swift
...ommunity(社区)/Resource(资源)/V/YHResourceTableViewCell.swift
+21
-44
Contents.json
...nity/Resource/company_detail_vline.imageset/Contents.json
+22
-0
company_detail_vline@2x.png
...company_detail_vline.imageset/company_detail_vline@2x.png
+0
-0
company_detail_vline@3x.png
...company_detail_vline.imageset/company_detail_vline@3x.png
+0
-0
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/Resource(资源)/V/YHResourceTableViewCell.swift
View file @
699e6eb9
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
import
UIKit
import
UIKit
import
Kingfisher
import
Kingfisher
import
AttributedString
class
YHResourceTableViewCell
:
UITableViewCell
{
class
YHResourceTableViewCell
:
UITableViewCell
{
static
let
labelFont
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
static
let
labelFont
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
...
@@ -38,12 +39,6 @@ class YHResourceTableViewCell: UITableViewCell {
...
@@ -38,12 +39,6 @@ class YHResourceTableViewCell: UITableViewCell {
return
view
return
view
}()
}()
lazy
var
vSeparatorLine
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
.
brandGrayColor3
return
view
}()
// 左侧LOGO
// 左侧LOGO
lazy
var
logoImageView
:
UIImageView
=
{
lazy
var
logoImageView
:
UIImageView
=
{
let
imageView
=
UIImageView
()
let
imageView
=
UIImageView
()
...
@@ -76,21 +71,13 @@ class YHResourceTableViewCell: UITableViewCell {
...
@@ -76,21 +71,13 @@ class YHResourceTableViewCell: UITableViewCell {
return
label
return
label
}()
}()
// 公司名称
// 公司名称&行业复合显示
lazy
var
companyLabel
:
UILabel
=
{
lazy
var
companyDetailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
UIColor
.
brandGrayColor7
label
.
numberOfLines
=
1
return
label
}()
// 行业标签
lazy
var
industryLabel
:
UILabel
=
{
let
label
=
UILabel
()
let
label
=
UILabel
()
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
UIColor
.
brandGrayColor7
label
.
textColor
=
UIColor
.
brandGrayColor7
label
.
numberOfLines
=
1
label
.
numberOfLines
=
2
label
.
textAlignment
=
.
left
return
label
return
label
}()
}()
...
@@ -115,10 +102,8 @@ extension YHResourceTableViewCell {
...
@@ -115,10 +102,8 @@ extension YHResourceTableViewCell {
contentView
.
addSubview
(
rightArrow
)
contentView
.
addSubview
(
rightArrow
)
contentView
.
addSubview
(
typeTagIcon
)
contentView
.
addSubview
(
typeTagIcon
)
contentView
.
addSubview
(
titleLabel
)
contentView
.
addSubview
(
titleLabel
)
contentView
.
addSubview
(
companyLabel
)
contentView
.
addSubview
(
industryLabel
)
contentView
.
addSubview
(
separatorLine
)
contentView
.
addSubview
(
separatorLine
)
contentView
.
addSubview
(
vSeparatorLine
)
contentView
.
addSubview
(
companyDetailLabel
)
setupConstraints
()
setupConstraints
()
}
}
...
@@ -129,6 +114,7 @@ extension YHResourceTableViewCell {
...
@@ -129,6 +114,7 @@ extension YHResourceTableViewCell {
make
.
left
.
equalToSuperview
()
.
offset
(
YHResourceTableViewCell
.
marginX
)
make
.
left
.
equalToSuperview
()
.
offset
(
YHResourceTableViewCell
.
marginX
)
make
.
top
.
equalToSuperview
()
.
offset
(
24
)
make
.
top
.
equalToSuperview
()
.
offset
(
24
)
make
.
width
.
height
.
equalTo
(
YHResourceTableViewCell
.
logoWidth
)
make
.
width
.
height
.
equalTo
(
YHResourceTableViewCell
.
logoWidth
)
make
.
bottom
.
lessThanOrEqualToSuperview
()
.
offset
(
-
32
)
}
}
// 右上角标签约束
// 右上角标签约束
...
@@ -139,6 +125,12 @@ extension YHResourceTableViewCell {
...
@@ -139,6 +125,12 @@ extension YHResourceTableViewCell {
make
.
width
.
equalTo
(
52
)
make
.
width
.
equalTo
(
52
)
}
}
rightArrow
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
YHResourceTableViewCell
.
marginX
)
make
.
width
.
height
.
equalTo
(
YHResourceTableViewCell
.
arrowWidth
)
make
.
top
.
equalTo
(
typeTagIcon
.
snp
.
bottom
)
.
offset
(
4
)
}
// 主标题约束
// 主标题约束
titleLabel
.
snp
.
makeConstraints
{
make
in
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
logoImageView
.
snp
.
right
)
.
offset
(
YHResourceTableViewCell
.
logoToRight
)
make
.
left
.
equalTo
(
logoImageView
.
snp
.
right
)
.
offset
(
YHResourceTableViewCell
.
logoToRight
)
...
@@ -146,32 +138,14 @@ extension YHResourceTableViewCell {
...
@@ -146,32 +138,14 @@ extension YHResourceTableViewCell {
make
.
top
.
equalTo
(
typeTagIcon
.
snp
.
bottom
)
.
offset
(
4
)
make
.
top
.
equalTo
(
typeTagIcon
.
snp
.
bottom
)
.
offset
(
4
)
}
}
rightArrow
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
YHResourceTableViewCell
.
marginX
)
make
.
width
.
height
.
equalTo
(
YHResourceTableViewCell
.
arrowWidth
)
make
.
top
.
equalTo
(
titleLabel
)
}
// 公司名称约束
// 公司名称约束
companyLabel
.
snp
.
makeConstraints
{
make
in
company
Detail
Label
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
titleLabel
)
make
.
left
.
equalTo
(
titleLabel
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
4
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
4
)
make
.
bottom
.
lessThanOrEqualToSuperview
()
.
offset
(
-
32
)
make
.
right
.
equalTo
(
rightArrow
.
snp
.
left
)
}
}
vSeparatorLine
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
companyLabel
.
snp
.
right
)
.
offset
(
YHResourceTableViewCell
.
marginBetweenVLine
)
make
.
centerY
.
equalTo
(
companyLabel
)
make
.
width
.
equalTo
(
1
)
make
.
height
.
equalTo
(
8
)
}
// 行业标签约束
industryLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
vSeparatorLine
.
snp
.
right
)
.
offset
(
YHResourceTableViewCell
.
marginBetweenVLine
)
make
.
right
.
lessThanOrEqualTo
(
rightArrow
.
snp
.
left
)
make
.
top
.
equalTo
(
companyLabel
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
32
)
}
let
pixelOne
=
1.0
/
UIScreen
.
main
.
scale
let
pixelOne
=
1.0
/
UIScreen
.
main
.
scale
// 分割线约束
// 分割线约束
separatorLine
.
snp
.
makeConstraints
{
make
in
separatorLine
.
snp
.
makeConstraints
{
make
in
...
@@ -192,9 +166,12 @@ extension YHResourceTableViewCell {
...
@@ -192,9 +166,12 @@ extension YHResourceTableViewCell {
// 设置基本信息 - 使用新的API字段
// 设置基本信息 - 使用新的API字段
titleLabel
.
text
=
getServiceOrDemandText
(
model
:
model
)
// 显示服务或需求信息
titleLabel
.
text
=
getServiceOrDemandText
(
model
:
model
)
// 显示服务或需求信息
companyLabel
.
text
=
model
.
displayName
// 使用 company_n
ame
let
companyName
=
model
.
displayName
.
count
>
20
?
model
.
displayName
.
prefix
(
20
)
+
"..."
:
model
.
displayN
ame
industryLabel
.
text
=
model
.
industryDisplayText
// 使用 industry_type_str
let
industry
=
model
.
industryDisplayText
.
count
>
20
?
model
.
industryDisplayText
.
prefix
(
20
)
+
"..."
:
model
.
industryDisplayText
let
tipsIcon
=
ASAttributedString
.
init
(
.
image
(
UIImage
(
named
:
"company_detail_vline"
)
??
UIImage
(),
.
custom
(
.
offset
(
CGPoint
(
x
:
0
,
y
:
-
2.0
)),
size
:
.
init
(
width
:
1
,
height
:
8
))))
let
contentAtt
=
(
ASAttributedString
(
string
:
"
\(
companyName
)
"
,
.
foreground
(
UIColor
.
brandGrayColor7
),
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
12
)))
+
tipsIcon
+
ASAttributedString
(
string
:
"
\(
industry
)
"
,
.
foreground
(
UIColor
.
brandGrayColor7
),
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
12
))))
companyDetailLabel
.
attributed
.
text
=
contentAtt
// 设置Logo - 使用新的API字段
// 设置Logo - 使用新的API字段
if
!
model
.
companyLogoUrl
.
isEmpty
{
if
!
model
.
companyLogoUrl
.
isEmpty
{
logoImageView
.
kf
.
setImage
(
logoImageView
.
kf
.
setImage
(
...
...
galaxy/galaxy/Res/Assets.xcassets/Community/Resource/company_detail_vline.imageset/Contents.json
0 → 100644
View file @
699e6eb9
{
"images"
:
[
{
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"company_detail_vline@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"company_detail_vline@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Community/Resource/company_detail_vline.imageset/company_detail_vline@2x.png
0 → 100644
View file @
699e6eb9
143 Bytes
galaxy/galaxy/Res/Assets.xcassets/Community/Resource/company_detail_vline.imageset/company_detail_vline@3x.png
0 → 100644
View file @
699e6eb9
149 Bytes
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment