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
48923549
Commit
48923549
authored
Jun 25, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 人脉
parent
ef34a84a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
26 deletions
+74
-26
YHMyNameCardViewController.swift
.../Modules/Community(社区)/C/YHMyNameCardViewController.swift
+7
-0
YHMatchUserInfo.swift
...axy/Classes/Modules/Community(社区)/M/YHMatchUserInfo.swift
+2
-0
YHMyNameCardAvatarInfoCell.swift
.../Modules/Community(社区)/V/YHMyNameCardAvatarInfoCell.swift
+65
-26
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMyNameCardViewController.swift
View file @
48923549
...
...
@@ -13,6 +13,7 @@ class YHMyNameCardViewController: YHBaseViewController {
var
userId
:
String
=
""
var
cardInfoArr
:[
YHUserNameCardInfo
]
=
[]
let
viewModel
=
YHMatchUserViewModel
()
let
authorModel
=
YHInformationAuthorizeViewModel
()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
tableView
.
estimatedSectionHeaderHeight
=
100
...
...
@@ -200,6 +201,12 @@ extension YHMyNameCardViewController: UITableViewDelegate, UITableViewDataSource
extension
YHMyNameCardViewController
{
func
requestAuthorization
()
{
self
.
authorModel
.
requestUserAuthorization
{
success
,
error
in
self
.
requestNameCardInfo
()
}
}
func
requestNameCardInfo
()
{
self
.
viewModel
.
getUserNameCardInfo
(
uid
:
self
.
userId
)
{
success
,
error
in
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/M/YHMatchUserInfo.swift
View file @
48923549
...
...
@@ -79,6 +79,8 @@ class YHUserNameCardInfo: SmartCodable {
// 自定义属性
var
type
:
YHNameCardInfoType
=
.
unknown
var
isHiddenEducation
=
false
var
isHiddenWorkExperience
=
false
required
init
()
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHMyNameCardAvatarInfoCell.swift
View file @
48923549
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
AttributedString
class
YHMyNameCardAvatarInfoCell
:
UITableViewCell
{
typealias
EditBlock
=
()
->
()
...
...
@@ -19,7 +20,31 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
if
let
url
=
URL
(
string
:
self
.
userModel
.
avatar
)
{
self
.
headImgV
.
kf
.
setImage
(
with
:
url
,
placeholder
:
UIImage
(
named
:
"people_head_default"
))
}
self
.
nameLabel
.
text
=
self
.
userModel
.
username
let
city
=
self
.
userModel
.
address
.
city
+
"市"
self
.
cityLabel
.
text
=
city
let
cityWidth
=
self
.
getWith
(
font
:
self
.
cityLabel
.
font
,
height
:
20
,
string
:
city
)
self
.
cityLabel
.
frame
=
CGRectMake
(
0
,
0
,
cityWidth
+
8
,
20
)
self
.
zodiacLabel
.
text
=
self
.
userModel
.
zodiac
if
self
.
userModel
.
address
.
city
.
isEmpty
&&
self
.
userModel
.
zodiac
.
isEmpty
{
self
.
nameTextView
.
attributed
.
text
=
"""
\(
self
.
userModel
.
username
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
18
))
)
"""
}
else
if
self
.
userModel
.
zodiac
.
isEmpty
{
self
.
nameTextView
.
attributed
.
text
=
"""
\(
self
.
userModel
.
username
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
18
))
)
\(
.
view
(
self
.
cityLabel
,
.
original
(
.
center
))
)
"""
}
else
if
self
.
userModel
.
address
.
city
.
isEmpty
{
self
.
nameTextView
.
attributed
.
text
=
"""
\(
self
.
userModel
.
username
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
18
))
)
\(
.
view
(
self
.
zodiacLabel
,
.
original
(
.
center
))
)
"""
}
else
{
self
.
nameTextView
.
attributed
.
text
=
"""
\(
self
.
userModel
.
username
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
18
))
)
\(
.
view
(
self
.
cityLabel
,
.
original
(
.
center
))
)
\(
.
view
(
self
.
zodiacLabel
,
.
original
(
.
center
))
)
"""
}
self
.
professionalLabel
.
text
=
self
.
userModel
.
position
self
.
detailLabel
.
text
=
self
.
userModel
.
signature
self
.
signImgV
.
isHidden
=
!
self
.
userModel
.
isSigned
...
...
@@ -60,12 +85,15 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
return
btn
}()
lazy
var
nameLabel
:
UILabel
=
{
let
nameLabel
=
UILabel
()
nameLabel
.
textColor
=
UIColor
.
mainTextColor
nameLabel
.
textAlignment
=
.
left
nameLabel
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
18
)
return
nameLabel
lazy
var
nameTextView
:
UITextView
=
{
let
textView
=
UITextView
()
textView
.
textColor
=
UIColor
.
mainTextColor
textView
.
backgroundColor
=
.
clear
textView
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
18
)
textView
.
isScrollEnabled
=
false
textView
.
isEditable
=
false
textView
.
isSelectable
=
false
return
textView
}()
lazy
var
cityLabel
:
UILabel
=
{
...
...
@@ -76,7 +104,18 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
label
.
backgroundColor
=
.
brandMainColor8
label
.
layer
.
cornerRadius
=
3.0
label
.
clipsToBounds
=
true
label
.
text
=
"上海市"
return
label
}()
lazy
var
zodiacLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
brandMainColor
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
12
)
label
.
backgroundColor
=
.
brandMainColor8
label
.
layer
.
cornerRadius
=
3.0
label
.
clipsToBounds
=
true
label
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
46
,
height
:
20
)
return
label
}()
...
...
@@ -117,15 +156,11 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
self
.
contentView
.
addSubview
(
self
.
headImgV
)
self
.
contentView
.
addSubview
(
self
.
signImgV
)
cardView
.
addSubview
(
self
.
name
Label
)
cardView
.
addSubview
(
self
.
name
TextView
)
cardView
.
addSubview
(
self
.
cityLabel
)
cardView
.
addSubview
(
self
.
professionalLabel
)
cardView
.
addSubview
(
self
.
detailLabel
)
cardView
.
addSubview
(
self
.
editBtn
)
self
.
nameLabel
.
text
=
"啊防守打法胜多负少"
self
.
professionalLabel
.
text
=
"阿迪发沙发沙发撒发生大发三大发沙发沙发上1阿斯顿发双法防"
self
.
detailLabel
.
text
=
"阿凡达所发生的发顺丰大沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发沙发发沙发"
self
.
cardView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
...
...
@@ -151,34 +186,38 @@ class YHMyNameCardAvatarInfoCell: UITableViewCell {
make
.
centerX
.
equalTo
(
self
.
headImgV
)
}
self
.
name
Label
.
snp
.
makeConstraints
{
make
in
self
.
name
TextView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
top
.
equalTo
(
headWidth
/
2.0
+
10.0
)
make
.
height
.
equalTo
(
25
)
}
self
.
cityLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
self
.
nameLabel
.
snp
.
right
)
.
offset
(
10
)
make
.
centerY
.
equalTo
(
self
.
nameLabel
)
make
.
height
.
equalTo
(
21
)
make
.
width
.
equalTo
(
44
)
}
self
.
professionalLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
right
.
equalTo
(
-
16
)
make
.
top
.
equalTo
(
self
.
nameLabel
.
snp
.
bottom
)
.
offset
(
8
)
make
.
height
.
greaterThanOrEqualTo
(
20
)
make
.
height
.
equalTo
(
20
)
make
.
top
.
equalTo
(
self
.
nameTextView
.
snp
.
bottom
)
.
offset
(
8
)
}
self
.
detailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
16
)
make
.
right
.
equalTo
(
-
16
)
make
.
top
.
equalTo
(
self
.
professionalLabel
.
snp
.
bottom
)
.
offset
(
8
)
make
.
height
.
greaterThanOrE
qualTo
(
18
)
make
.
height
.
e
qualTo
(
18
)
make
.
bottom
.
equalTo
(
-
16
)
}
self
.
professionalLabel
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
vertical
)
self
.
professionalLabel
.
setContentHuggingPriority
(
.
required
,
for
:
.
vertical
)
self
.
detailLabel
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
vertical
)
self
.
detailLabel
.
setContentHuggingPriority
(
.
required
,
for
:
.
vertical
)
}
func
getWith
(
font
:
UIFont
,
height
:
CGFloat
,
string
:
String
)
->
CGFloat
{
let
size
=
CGSize
.
init
(
width
:
CGFloat
(
MAXFLOAT
),
height
:
height
)
let
dic
=
[
NSAttributedString
.
Key
.
font
:
font
]
// swift 4.2
var
strSize
=
string
.
boundingRect
(
with
:
size
,
options
:
[
.
usesLineFragmentOrigin
],
attributes
:
dic
,
context
:
nil
)
.
size
return
CGSizeMake
(
ceil
(
strSize
.
width
),
strSize
.
height
)
.
width
}
@objc
func
edit
()
{
...
...
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