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
48e8d997
Commit
48e8d997
authored
Sep 29, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 人脉
parent
2acd8a02
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
11 deletions
+79
-11
YHConnectListViewController.swift
...y(社区)/Connections(人脉)/C/YHConnectListViewController.swift
+37
-1
YHContact.swift
...s/Modules/Community(社区)/Connections(人脉)/M/YHContact.swift
+3
-3
YHConnectListCell.swift
...s/Community(社区)/Connections(人脉)/V/YHConnectListCell.swift
+32
-3
YHAddFriendCardCell.swift
...Classes/Modules/Community(社区)/V/YHAddFriendCardCell.swift
+3
-1
YHFriendRequestView.swift
...Classes/Modules/Community(社区)/V/YHFriendRequestView.swift
+3
-2
YHNameCardInfoView.swift
.../Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
+1
-1
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/Connections(人脉)/C/YHConnectListViewController.swift
View file @
48e8d997
...
@@ -11,15 +11,24 @@ import UIKit
...
@@ -11,15 +11,24 @@ import UIKit
class
YHConnectListViewController
:
YHBaseViewController
{
class
YHConnectListViewController
:
YHBaseViewController
{
let
viewModel
=
YHContactViewModel
()
let
viewModel
=
YHContactViewModel
()
let
matchViewModel
=
YHMatchUserViewModel
()
var
arr
:
[
YHContact
]
=
[]
var
arr
:
[
YHContact
]
=
[]
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
contentInsetAdjustmentBehavior
=
.
never
tableView
.
estimatedSectionHeaderHeight
=
1.0
tableView
.
estimatedSectionFooterHeight
=
1.0
tableView
.
separatorStyle
=
.
none
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
dataSource
=
self
tableView
.
backgroundColor
=
UIColor
.
white
tableView
.
register
(
YHConnectListCell
.
self
,
forCellReuseIdentifier
:
YHConnectListCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHConnectListCell
.
self
,
forCellReuseIdentifier
:
YHConnectListCell
.
cellReuseIdentifier
)
tableView
.
es
.
addYHPullToRefresh
{
self
.
reguestData
(
true
)
}
tableView
.
es
.
addInfiniteScrolling
{
tableView
.
es
.
addInfiniteScrolling
{
self
.
reguestData
(
false
)
self
.
reguestData
(
false
)
}
}
...
@@ -57,7 +66,7 @@ class YHConnectListViewController: YHBaseViewController {
...
@@ -57,7 +66,7 @@ class YHConnectListViewController: YHBaseViewController {
self
.
arr
.
append
(
contentsOf
:
(
self
.
viewModel
.
contacts
))
self
.
arr
.
append
(
contentsOf
:
(
self
.
viewModel
.
contacts
))
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
self
.
tableView
.
es
.
stopLoadingMore
()
self
.
tableView
.
es
.
stopLoadingMore
()
self
.
tableView
.
es
.
stopPullToRefresh
()
if
!
self
.
viewModel
.
hasMore
{
if
!
self
.
viewModel
.
hasMore
{
self
.
tableView
.
es
.
noticeNoMoreData
()
self
.
tableView
.
es
.
noticeNoMoreData
()
}
}
...
@@ -75,9 +84,36 @@ extension YHConnectListViewController: UITableViewDelegate, UITableViewDataSourc
...
@@ -75,9 +84,36 @@ extension YHConnectListViewController: UITableViewDelegate, UITableViewDataSourc
if
0
<=
indexPath
.
row
,
indexPath
.
row
<
arr
.
count
{
if
0
<=
indexPath
.
row
,
indexPath
.
row
<
arr
.
count
{
let
model
=
arr
[
indexPath
.
row
]
let
model
=
arr
[
indexPath
.
row
]
cell
.
updateModel
(
model
)
cell
.
updateModel
(
model
)
cell
.
addFriendBlock
=
{[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
self
.
matchViewModel
.
addFriendWithText
(
text
!
,
yhId
:
model
.
yh_id
)
{
success
,
error
in
YHHUD
.
hide
()
if
success
{
model
.
type
=
YHContactRelation
.
unvalidate
.
rawValue
self
.
tableView
.
reloadData
()
}
else
{
var
msg
=
"申请失败"
if
let
errMsg
=
error
?
.
errorMsg
,
!
errMsg
.
isEmpty
{
msg
=
errMsg
}
YHHUD
.
flash
(
message
:
msg
)
}
}
}
}
}
return
cell
return
cell
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
1.0
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
UITableView
.
automaticDimension
return
UITableView
.
automaticDimension
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Connections(人脉)/M/YHContact.swift
View file @
48e8d997
...
@@ -19,9 +19,9 @@ class YHContactListModel: SmartCodable {
...
@@ -19,9 +19,9 @@ class YHContactListModel: SmartCodable {
}
}
enum
YHContactRelation
:
Int
{
enum
YHContactRelation
:
Int
{
case
stranger
=
1
case
stranger
=
1
// 陌生人
case
unvalidate
=
3
case
unvalidate
=
3
// 待验证
case
friend
=
5
case
friend
=
5
// 好友
}
}
// 联系人数据模型
// 联系人数据模型
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Connections(人脉)/V/YHConnectListCell.swift
View file @
48e8d997
...
@@ -12,6 +12,9 @@ class YHConnectListCell: UITableViewCell {
...
@@ -12,6 +12,9 @@ class YHConnectListCell: UITableViewCell {
static
let
cellReuseIdentifier
=
"YHConnectListCell"
static
let
cellReuseIdentifier
=
"YHConnectListCell"
var
addFriendBlock
:
((
String
?)
->
Void
)
=
{
(
_
:
String
?)
in
}
var
contact
:
YHContact
=
YHContact
()
private
lazy
var
avatarImageView
:
UIImageView
=
{
private
lazy
var
avatarImageView
:
UIImageView
=
{
let
imageView
=
UIImageView
()
let
imageView
=
UIImageView
()
imageView
.
layer
.
cornerRadius
=
22
imageView
.
layer
.
cornerRadius
=
22
...
@@ -50,6 +53,7 @@ class YHConnectListCell: UITableViewCell {
...
@@ -50,6 +53,7 @@ class YHConnectListCell: UITableViewCell {
button
.
setTitleColor
(
UIColor
.
brandGrayColor8
,
for
:
.
normal
)
button
.
setTitleColor
(
UIColor
.
brandGrayColor8
,
for
:
.
normal
)
button
.
layer
.
borderWidth
=
1
button
.
layer
.
borderWidth
=
1
button
.
layer
.
borderColor
=
UIColor
.
brandGrayColor5
.
cgColor
button
.
layer
.
borderColor
=
UIColor
.
brandGrayColor5
.
cgColor
button
.
addTarget
(
self
,
action
:
#selector(
didAddFriendBtnClicked
)
,
for
:
.
touchUpInside
)
return
button
return
button
}()
}()
...
@@ -75,6 +79,18 @@ class YHConnectListCell: UITableViewCell {
...
@@ -75,6 +79,18 @@ class YHConnectListCell: UITableViewCell {
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
setupUI
()
}
}
@objc
func
didAddFriendBtnClicked
()
{
let
view
=
YHFriendRequestView
.
createView
()
view
.
userModel
=
self
.
contact
view
.
sendBlock
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
self
.
addFriendBlock
(
text
)
}
view
.
show
()
}
private
func
setupUI
()
{
private
func
setupUI
()
{
selectionStyle
=
.
none
selectionStyle
=
.
none
...
@@ -118,12 +134,14 @@ class YHConnectListCell: UITableViewCell {
...
@@ -118,12 +134,14 @@ class YHConnectListCell: UITableViewCell {
make
.
left
.
equalTo
(
avatarImageView
.
snp
.
right
)
.
offset
(
10
)
make
.
left
.
equalTo
(
avatarImageView
.
snp
.
right
)
.
offset
(
10
)
make
.
top
.
equalTo
(
nameLabel
.
snp
.
bottom
)
.
offset
(
3
)
make
.
top
.
equalTo
(
nameLabel
.
snp
.
bottom
)
.
offset
(
3
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
height
.
equalTo
(
18
)
}
}
signatureLabel
.
snp
.
makeConstraints
{
make
in
signatureLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
avatarImageView
.
snp
.
right
)
.
offset
(
10
)
make
.
left
.
equalTo
(
avatarImageView
.
snp
.
right
)
.
offset
(
10
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
4
)
make
.
top
.
equalTo
(
titleLabel
.
snp
.
bottom
)
.
offset
(
4
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
make
.
height
.
equalTo
(
15
)
make
.
bottom
.
equalTo
(
-
20
)
make
.
bottom
.
equalTo
(
-
20
)
}
}
...
@@ -136,12 +154,24 @@ class YHConnectListCell: UITableViewCell {
...
@@ -136,12 +154,24 @@ class YHConnectListCell: UITableViewCell {
}
}
func
updateModel
(
_
contact
:
YHContact
)
{
func
updateModel
(
_
contact
:
YHContact
)
{
self
.
contact
=
contact
avatarImageView
.
sd_setImage
(
with
:
URL
(
string
:
contact
.
avatar
),
placeholderImage
:
UIImage
(
named
:
""
))
avatarImageView
.
sd_setImage
(
with
:
URL
(
string
:
contact
.
avatar
),
placeholderImage
:
UIImage
(
named
:
""
))
nameLabel
.
text
=
contact
.
username
nameLabel
.
text
=
contact
.
username
titleLabel
.
text
=
"
\(
contact
.
position
)
•
\(
contact
.
industry
)
"
signatureLabel
.
text
=
contact
.
signature
signatureLabel
.
text
=
contact
.
signature
var
text1
=
""
var
text1Arr
:
[
String
]
=
[]
if
!
self
.
contact
.
position
.
isEmpty
{
text1Arr
.
append
(
self
.
contact
.
position
)
}
if
!
self
.
contact
.
industry
.
isEmpty
{
text1Arr
.
append
(
self
.
contact
.
industry
)
}
if
text1Arr
.
count
>
0
{
text1
=
text1Arr
.
joined
(
separator
:
" | "
)
}
titleLabel
.
text
=
text1
if
contact
.
type
==
YHContactRelation
.
stranger
.
rawValue
{
if
contact
.
type
==
YHContactRelation
.
stranger
.
rawValue
{
addFriendButton
.
isHidden
=
false
addFriendButton
.
isHidden
=
false
statusLabel
.
isHidden
=
true
statusLabel
.
isHidden
=
true
...
@@ -159,6 +189,5 @@ class YHConnectListCell: UITableViewCell {
...
@@ -159,6 +189,5 @@ class YHConnectListCell: UITableViewCell {
statusLabel
.
text
=
""
statusLabel
.
text
=
""
}
}
}
}
}
}
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHAddFriendCardCell.swift
View file @
48e8d997
...
@@ -47,7 +47,7 @@ class YHAddFriendCardCell: UITableViewCell {
...
@@ -47,7 +47,7 @@ class YHAddFriendCardCell: UITableViewCell {
}
}
self
.
nameLabel
.
text
=
self
.
friendModel
.
username
self
.
nameLabel
.
text
=
self
.
friendModel
.
username
self
.
msgLabel
.
text
=
self
.
friendModel
.
verifyInfo
self
.
msgLabel
.
text
=
self
.
friendModel
.
verifyInfo
self
.
signImgV
.
isHidden
=
!
self
.
friendModel
.
isSign
//
self.signImgV.isHidden = !self.friendModel.isSign
var
text1
=
""
var
text1
=
""
var
text1Arr
:
[
String
]
=
[]
var
text1Arr
:
[
String
]
=
[]
...
@@ -80,6 +80,7 @@ class YHAddFriendCardCell: UITableViewCell {
...
@@ -80,6 +80,7 @@ class YHAddFriendCardCell: UITableViewCell {
lazy
var
bgImageView
:
UIImageView
=
{
lazy
var
bgImageView
:
UIImageView
=
{
let
bgImgView
=
UIImageView
(
image
:
UIImage
(
named
:
"people_add_friend_bg"
))
let
bgImgView
=
UIImageView
(
image
:
UIImage
(
named
:
"people_add_friend_bg"
))
bgImgView
.
isHidden
=
true
return
bgImgView
return
bgImgView
}()
}()
...
@@ -102,6 +103,7 @@ class YHAddFriendCardCell: UITableViewCell {
...
@@ -102,6 +103,7 @@ class YHAddFriendCardCell: UITableViewCell {
lazy
var
signImgV
:
UIImageView
=
{
lazy
var
signImgV
:
UIImageView
=
{
let
view
=
UIImageView
()
let
view
=
UIImageView
()
view
.
image
=
UIImage
(
named
:
"people_sign"
)
view
.
image
=
UIImage
(
named
:
"people_sign"
)
view
.
isHidden
=
true
return
view
return
view
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHFriendRequestView.swift
View file @
48e8d997
...
@@ -14,7 +14,7 @@ class YHFriendRequestView: UIView {
...
@@ -14,7 +14,7 @@ class YHFriendRequestView: UIView {
static
let
cardHeight
=
313.0
static
let
cardHeight
=
313.0
let
textMaxCount
=
200
let
textMaxCount
=
200
let
defaultStr
=
"在银河相遇,期待与你共话未来,互学互鉴,盼成为好友,谢谢~"
let
defaultStr
=
"在银河相遇,期待与你共话未来,互学互鉴,盼成为好友,谢谢~"
var
userModel
:
YH
MatchUserInfo
=
YHMatchUserInfo
()
{
var
userModel
:
YH
Contact
=
YHContact
()
{
didSet
{
didSet
{
if
let
url
=
URL
(
string
:
self
.
userModel
.
avatar
)
{
if
let
url
=
URL
(
string
:
self
.
userModel
.
avatar
)
{
self
.
headImgV
.
kf
.
setImage
(
with
:
url
,
placeholder
:
UIImage
(
named
:
"people_head_default"
))
self
.
headImgV
.
kf
.
setImage
(
with
:
url
,
placeholder
:
UIImage
(
named
:
"people_head_default"
))
...
@@ -22,7 +22,7 @@ class YHFriendRequestView: UIView {
...
@@ -22,7 +22,7 @@ class YHFriendRequestView: UIView {
self
.
headImgV
.
image
=
UIImage
(
named
:
"people_head_default"
)
self
.
headImgV
.
image
=
UIImage
(
named
:
"people_head_default"
)
}
}
self
.
nameLabel
.
text
=
self
.
userModel
.
username
self
.
nameLabel
.
text
=
self
.
userModel
.
username
self
.
signImgV
.
isHidden
=
!
self
.
userModel
.
isSign
//
self.signImgV.isHidden = !self.userModel.isSign
var
text1
=
""
var
text1
=
""
var
text1Arr
:
[
String
]
=
[]
var
text1Arr
:
[
String
]
=
[]
...
@@ -75,6 +75,7 @@ class YHFriendRequestView: UIView {
...
@@ -75,6 +75,7 @@ class YHFriendRequestView: UIView {
lazy
var
signImgV
:
UIImageView
=
{
lazy
var
signImgV
:
UIImageView
=
{
let
view
=
UIImageView
()
let
view
=
UIImageView
()
view
.
image
=
UIImage
(
named
:
"people_sign"
)
view
.
image
=
UIImage
(
named
:
"people_sign"
)
view
.
isHidden
=
true
return
view
return
view
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
View file @
48e8d997
...
@@ -166,7 +166,7 @@ class YHNameCardInfoView: DragCardView {
...
@@ -166,7 +166,7 @@ class YHNameCardInfoView: DragCardView {
@objc
func
didBottomBtnClicked
()
{
@objc
func
didBottomBtnClicked
()
{
let
view
=
YHFriendRequestView
.
createView
()
let
view
=
YHFriendRequestView
.
createView
()
view
.
userModel
=
self
.
userModel
//
view.userModel = self.userModel
view
.
sendBlock
=
{
view
.
sendBlock
=
{
[
weak
self
]
text
in
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
...
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