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
417a6256
Commit
417a6256
authored
Jun 24, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 人脉接口
parent
a5f83945
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
8 deletions
+50
-8
YHMatchPeopleViewController.swift
...Modules/Community(社区)/C/YHMatchPeopleViewController.swift
+16
-1
YHFriendRequestView.swift
...Classes/Modules/Community(社区)/V/YHFriendRequestView.swift
+4
-0
YHNameCardInfoView.swift
.../Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
+2
-5
YHMatchUserViewModel.swift
...asses/Modules/Community(社区)/VM/YHMatchUserViewModel.swift
+23
-1
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+5
-1
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMatchPeopleViewController.swift
View file @
417a6256
...
...
@@ -12,6 +12,7 @@ import DragCardContainer
class
YHMatchPeopleViewController
:
YHBaseViewController
{
let
viewModel
=
YHMatchUserViewModel
()
var
matchUsersArr
:[
YHMatchUserInfo
?]
=
[]
lazy
var
bgImgV
:
UIImageView
=
{
...
...
@@ -310,7 +311,21 @@ extension YHMatchPeopleViewController: DragCardDataSource {
if
let
userModel
=
self
.
matchUsersArr
[
index
]
{
cardView
.
userModel
=
userModel
cardView
.
sendBlock
=
{
userModel
.
isSendRequest
=
true
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
self
.
viewModel
.
addFriendWithText
(
text
!
,
yhId
:
userModel
.
yhId
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
hide
()
YHHUD
.
flash
(
message
:
"已发送好友申请"
)
cardView
.
bottomBtn
.
setTitle
(
"已发送好友申请"
,
for
:
.
normal
)
cardView
.
bottomBtn
.
backgroundColor
=
.
brandMainColor30
cardView
.
bottomBtn
.
isUserInteractionEnabled
=
false
userModel
.
isSendRequest
=
true
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHFriendRequestView.swift
View file @
417a6256
...
...
@@ -134,6 +134,10 @@ class YHFriendRequestView: UIView {
}
@objc
func
didSendBtnClicked
()
{
if
isEmptyString
(
self
.
textView
.
text
)
{
YHHUD
.
flash
(
message
:
"请输入好友申请信息"
)
return
}
self
.
sendBlock
?(
self
.
textView
.
text
)
dismiss
()
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
View file @
417a6256
...
...
@@ -13,7 +13,7 @@ class YHNameCardInfoView: DragCardView {
static
let
height
=
456.0
static
let
width
=
KScreenWidth
-
36.0
*
2
var
sendBlock
:(()
->
())?
var
sendBlock
:((
String
?
)
->
())?
var
userModel
:
YHMatchUserInfo
=
YHMatchUserInfo
()
{
didSet
{
...
...
@@ -114,10 +114,7 @@ class YHNameCardInfoView: DragCardView {
view
.
sendBlock
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
self
.
bottomBtn
.
setTitle
(
"已发送好友申请"
,
for
:
.
normal
)
self
.
bottomBtn
.
backgroundColor
=
.
brandMainColor30
self
.
bottomBtn
.
isUserInteractionEnabled
=
false
self
.
sendBlock
?()
self
.
sendBlock
?(
text
)
}
view
.
show
()
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/VM/YHMatchUserViewModel.swift
View file @
417a6256
...
...
@@ -14,7 +14,7 @@ class YHMatchUserViewModel: NSObject {
func
getMatchUserlist
(
_
callBack
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
=
[
"page_size"
:
5
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
matchUserList
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
matchUserList
Api
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
...
...
@@ -43,4 +43,26 @@ class YHMatchUserViewModel: NSObject {
callBack
(
false
,
err
)
}
}
func
addFriendWithText
(
_
text
:
String
,
yhId
:
String
,
callBack
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
=
[
"verify_info"
:
text
,
"yh_id"
:
yhId
]
as
[
String
:
Any
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
addFriendApi
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
self
=
self
else
{
return
}
printLog
(
json
)
if
json
.
code
==
200
{
callBack
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBack
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBack
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
417a6256
...
...
@@ -309,6 +309,10 @@ class YHAllApiName {
struct
People
{
// 匹配用户
static
let
matchUserList
=
"super-app/radar/list"
static
let
matchUserListApi
=
"super-app/radar/list"
// 添加好友
static
let
addFriendApi
=
"super-app/community/friend-application"
// 接收好友请求
static
let
receiveFriendRequestApi
=
"super-app/community/process-friend-requests"
}
}
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