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
c3ded75c
Commit
c3ded75c
authored
Jun 28, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签保存
parent
e75bf975
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
YHEditInterestViewController.swift
...ine(我的)/MyCard(我的名片)/C/YHEditInterestViewController.swift
+15
-4
YHEditViewModel.swift
...es/Modules/Mine(我的)/MyCard(我的名片)/VM/YHEditViewModel.swift
+2
-2
No files found.
galaxy/galaxy/Classes/Modules/Mine(我的)/MyCard(我的名片)/C/YHEditInterestViewController.swift
View file @
c3ded75c
...
...
@@ -38,14 +38,20 @@ class YHEditInterestViewController: YHBaseViewController {
func
getData
()
{
viewModel
.
model
=
model
for
item
in
model
.
draftTopics
{
let
model
=
YHInterestModel
(
name
:
item
,
isNormal
:
false
,
isSelect
:
false
)
self
.
likeItems
.
insert
(
model
,
at
:
likeItems
.
count
-
1
)
}
for
item
in
model
.
topics
{
if
let
index
=
normalItems
.
firstIndex
(
where
:
{
$0
.
name
==
item
})
{
normalItems
[
index
]
.
isSelect
=
!
normalItems
[
index
]
.
isSelect
}
else
{
let
model
=
YHInterestModel
(
name
:
item
,
isNormal
:
false
,
isSelect
:
true
)
self
.
likeItems
.
insert
(
model
,
at
:
likeItems
.
count
-
1
)
}
if
let
index
=
likeItems
.
firstIndex
(
where
:
{
$0
.
name
==
item
})
{
likeItems
[
index
]
.
isSelect
=
!
likeItems
[
index
]
.
isSelect
}
}
collectionView
.
reloadData
()
}
...
...
@@ -121,6 +127,7 @@ class YHEditInterestViewController: YHBaseViewController {
@objc
func
nextStep
()
{
var
topics
:
[
String
]
=
[]
var
draftTopics
:
[
String
]
=
[]
for
item
in
normalItems
{
if
item
.
isSelect
{
topics
.
append
(
item
.
name
)
...
...
@@ -130,8 +137,12 @@ class YHEditInterestViewController: YHBaseViewController {
if
like
.
isSelect
&&
like
.
name
!=
"+自定义"
{
topics
.
append
(
like
.
name
)
}
if
like
.
name
!=
"+自定义"
{
draftTopics
.
append
(
like
.
name
)
}
}
viewModel
.
requestSaveTopics
(
topics
:
topics
)
{[
weak
self
]
success
,
error
in
viewModel
.
requestSaveTopics
(
topics
:
topics
,
draft_topics
:
draftTopics
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
success
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
...
...
galaxy/galaxy/Classes/Modules/Mine(我的)/MyCard(我的名片)/VM/YHEditViewModel.swift
View file @
c3ded75c
...
...
@@ -204,8 +204,8 @@ class YHEditViewModel: YHBaseViewModel {
}
}
func
requestSaveTopics
(
topics
:
[
String
],
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
interest
:
[
String
:
Any
]
=
[
"topics"
:
topics
,
"is_update"
:
true
]
func
requestSaveTopics
(
topics
:
[
String
],
draft_topics
:
[
String
],
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
interest
:
[
String
:
Any
]
=
[
"topics"
:
topics
,
"is_update"
:
true
,
"draft_topics"
:
draft_topics
]
let
params
:
[
String
:
Any
]
=
[
"interest"
:
interest
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
People
.
cardSave
let
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
...
...
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