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
a6f2fd26
Commit
a6f2fd26
authored
Mar 17, 2025
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
d42d44ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
115 deletions
+108
-115
YHActivityDetailViewController.swift
...y(社区)/Activity(活动)/C/YHActivityDetailViewController.swift
+44
-49
YHActivityListViewController.swift
...ity(社区)/Activity(活动)/C/YHActivityListViewController.swift
+53
-58
YHActivityTravelViewController.swift
...y(社区)/Activity(活动)/C/YHActivityTravelViewController.swift
+2
-1
YHMyGoodFriendsVC.swift
...y/Classes/Modules/Community(社区)/C/YHMyGoodFriendsVC.swift
+3
-2
YHNameCardViewController.swift
...es/Modules/Community(社区)/C/YHNameCardViewController.swift
+6
-5
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/C/YHActivityDetailViewController.swift
View file @
a6f2fd26
...
@@ -15,7 +15,7 @@ class YHActivityDetailViewController: YHBaseViewController {
...
@@ -15,7 +15,7 @@ class YHActivityDetailViewController: YHBaseViewController {
let
vm
=
YHActivityViewModel
()
let
vm
=
YHActivityViewModel
()
return
vm
return
vm
}()
}()
lazy
var
tableView
:
UITableView
=
{
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
showsVerticalScrollIndicator
=
false
...
@@ -25,40 +25,41 @@ class YHActivityDetailViewController: YHBaseViewController {
...
@@ -25,40 +25,41 @@ class YHActivityDetailViewController: YHBaseViewController {
tableView
.
backgroundColor
=
UIColor
.
clear
tableView
.
backgroundColor
=
UIColor
.
clear
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHActivityDetailCell
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell0
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell0
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell0
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell0
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell1
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell1
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell1
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell1
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell2
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell2
.
cellReuseIdentifier
)
tableView
.
register
(
YHActivityDetailCell2
.
self
,
forCellReuseIdentifier
:
YHActivityDetailCell2
.
cellReuseIdentifier
)
// tableView.register(YHActivityDetailInfoCell.self, forCellReuseIdentifier: YHActivityDetailInfoCell.cellReuseIdentifier)
// tableView.register(YHActivityDetailInfoCell.self, forCellReuseIdentifier: YHActivityDetailInfoCell.cellReuseIdentifier)
tableView
.
tableHeaderView
=
nil
tableView
.
tableHeaderView
=
nil
tableView
.
tableFooterView
=
nil
tableView
.
tableFooterView
=
nil
tableView
.
estimatedSectionHeaderHeight
=
0
tableView
.
estimatedSectionHeaderHeight
=
0
tableView
.
estimatedSectionFooterHeight
=
0
tableView
.
estimatedSectionFooterHeight
=
0
return
tableView
return
tableView
}()
}()
lazy
var
topView
:
UIImageView
=
{
lazy
var
topView
:
UIImageView
=
{
let
view
=
UIImageView
()
let
view
=
UIImageView
()
view
.
contentMode
=
.
scaleAspectFill
view
.
contentMode
=
.
scaleAspectFill
view
.
image
=
UIImage
(
named
:
"activity_detail_top_bkg"
)
view
.
image
=
UIImage
(
named
:
"activity_detail_top_bkg"
)
return
view
return
view
}()
}()
lazy
var
bottomView
:
YHActivityDetailBottomView
=
{
lazy
var
bottomView
:
YHActivityDetailBottomView
=
{
let
view
=
YHActivityDetailBottomView
()
let
view
=
YHActivityDetailBottomView
()
return
view
return
view
}()
}()
// MARK: - 生命周期方法
// MARK: - 生命周期方法
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
setupUI
()
setupUI
()
}
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
super
.
viewWillAppear
(
animated
)
loadData
()
loadData
()
...
@@ -67,10 +68,10 @@ class YHActivityDetailViewController: YHBaseViewController {
...
@@ -67,10 +68,10 @@ class YHActivityDetailViewController: YHBaseViewController {
extension
YHActivityDetailViewController
{
extension
YHActivityDetailViewController
{
func
gotoTheRightVcForStatus
()
{
func
gotoTheRightVcForStatus
()
{
guard
let
model
=
self
.
viewModel
.
activityDetailModel
else
{
guard
let
model
=
viewModel
.
activityDetailModel
else
{
return
return
}
}
if
let
status
=
YHActivityStatus
(
rawValue
:
model
.
status
.
int
??
0
)
{
if
let
status
=
YHActivityStatus
(
rawValue
:
model
.
status
.
int
??
0
)
{
switch
status
{
switch
status
{
case
.
notApply
:
case
.
notApply
:
...
@@ -91,37 +92,35 @@ extension YHActivityDetailViewController {
...
@@ -91,37 +92,35 @@ extension YHActivityDetailViewController {
printLog
(
""
)
printLog
(
""
)
}
}
}
}
}
}
func
gotoActivityTravelVC
()
{
func
gotoActivityTravelVC
()
{
if
let
nav
=
self
.
navigationController
{
if
let
nav
=
navigationController
{
let
rrr
=
nav
.
viewControllers
.
contains
{
$0
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
}
let
rrr
=
nav
.
viewControllers
.
contains
{
$0
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
}
if
rrr
{
if
rrr
{
var
targetVc
:
UIViewController
?
var
targetVc
:
UIViewController
?
for
(
_
,
value
)
in
nav
.
viewControllers
.
enumerated
()
{
for
(
_
,
value
)
in
nav
.
viewControllers
.
enumerated
()
{
if
value
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
{
if
value
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
{
targetVc
=
value
targetVc
=
value
break
break
}
}
}
}
if
let
vc
=
targetVc
{
if
let
vc
=
targetVc
{
navigationController
?
.
popToViewController
(
vc
,
animated
:
true
)
navigationController
?
.
popToViewController
(
vc
,
animated
:
true
)
}
}
return
return
}
}
}
}
// 行程单详情
// 行程单详情
let
vc
=
YHActivityTravelViewController
()
let
vc
=
YHActivityTravelViewController
()
vc
.
travelId
=
viewModel
.
activityDetailModel
?
.
checkId
??
""
vc
.
travelId
=
viewModel
.
activityDetailModel
?
.
checkId
??
""
navigationController
?
.
pushViewController
(
vc
)
navigationController
?
.
pushViewController
(
vc
)
}
}
func
showApplyUI
()
{
func
showApplyUI
()
{
YHApplyActivityAlert
.
showApplyActivityAlertView
(
name
:
self
.
viewModel
.
activityDetailModel
?
.
businessCardName
??
""
)
{
(
tag
,
name
,
number
,
phone
)
in
YHApplyActivityAlert
.
showApplyActivityAlertView
(
name
:
viewModel
.
activityDetailModel
?
.
businessCardName
??
""
)
{
tag
,
name
,
number
,
phone
in
if
tag
{
if
tag
{
printLog
(
tag
)
printLog
(
tag
)
printLog
(
name
)
printLog
(
name
)
...
@@ -137,52 +136,53 @@ extension YHActivityDetailViewController {
...
@@ -137,52 +136,53 @@ extension YHActivityDetailViewController {
}
}
}
}
}
}
func
setupUI
()
{
func
setupUI
()
{
gk_navigationBar
.
isHidden
=
false
gk_navigationBar
.
isHidden
=
false
gk_navigationBar
.
backgroundColor
=
.
clear
gk_navigationBar
.
backgroundColor
=
.
clear
gk_backImage
=
UIImage
(
named
:
"activity_nav_back"
)
gk_backImage
=
UIImage
(
named
:
"activity_nav_back"
)
view
.
backgroundColor
=
.
white
view
.
backgroundColor
=
.
white
// 1.
// 1.
view
.
addSubview
(
tableView
)
view
.
addSubview
(
tableView
)
view
.
addSubview
(
bottomView
)
view
.
addSubview
(
bottomView
)
view
.
addSubview
(
topView
)
view
.
addSubview
(
topView
)
// 2.
// 2.
tableView
.
contentInsetAdjustmentBehavior
=
.
never
tableView
.
contentInsetAdjustmentBehavior
=
.
never
tableView
.
snp
.
makeConstraints
{
make
in
tableView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
left
.
right
.
top
.
equalToSuperview
()
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
}
}
// 3.
// 3.
bottomView
.
snp
.
makeConstraints
{
make
in
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
YHActivityDetailBottomView
.
viewH
)
make
.
height
.
equalTo
(
YHActivityDetailBottomView
.
viewH
)
}
}
bottomView
.
block
=
{
[
weak
self
]
_
in
bottomView
.
block
=
{
[
weak
self
]
_
in
// 判断是否登录成功
// 判断是否登录成功
if
YHLoginManager
.
shared
.
isLogin
()
{
if
YHLoginManager
.
shared
.
isLogin
()
{
self
?
.
gotoTheRightVcForStatus
()
self
?
.
gotoTheRightVcForStatus
()
}
else
{
}
else
{
YHOneKeyLoginManager
.
shared
.
oneKeyLogin
()
YHOneKeyLoginManager
.
shared
.
oneKeyLogin
()
YHLoginManager
.
shared
.
loginSuccessActionBlock
=
{[
weak
self
]
in
YHLoginManager
.
shared
.
loginSuccessActionBlock
=
{
[
weak
self
]
in
guard
self
!=
nil
else
{
return
}
guard
self
!=
nil
else
{
return
}
self
?
.
loadData
()
self
?
.
loadData
()
YHLoginManager
.
shared
.
loginSuccessActionBlock
=
nil
YHLoginManager
.
shared
.
loginSuccessActionBlock
=
nil
}
}
}
}
}
}
// 4.
// 4.
topView
.
snp
.
makeConstraints
{
make
in
topView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
114
)
make
.
height
.
equalTo
(
114
)
}
}
}
}
func
loadData
()
{
func
loadData
()
{
if
!
activityId
.
isEmpty
{
if
!
activityId
.
isEmpty
{
viewModel
.
getActivityDetailData
(
activityID
:
activityId
)
{
success
,
error
in
viewModel
.
getActivityDetailData
(
activityID
:
activityId
)
{
success
,
error
in
...
@@ -195,7 +195,7 @@ extension YHActivityDetailViewController {
...
@@ -195,7 +195,7 @@ extension YHActivityDetailViewController {
YHHUD
.
flash
(
message
:
msg
)
YHHUD
.
flash
(
message
:
msg
)
self
.
navigationController
?
.
popViewController
()
self
.
navigationController
?
.
popViewController
()
}
}
// tableView
// tableView
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
}
}
...
@@ -204,9 +204,9 @@ extension YHActivityDetailViewController {
...
@@ -204,9 +204,9 @@ extension YHActivityDetailViewController {
navigationController
?
.
popViewController
()
navigationController
?
.
popViewController
()
}
}
}
}
func
requestImages
()
{
func
requestImages
()
{
guard
let
detailModel
=
self
.
viewModel
.
activityDetailModel
else
{
guard
let
detailModel
=
viewModel
.
activityDetailModel
else
{
return
return
}
}
let
ossGroup
=
DispatchGroup
()
let
ossGroup
=
DispatchGroup
()
...
@@ -214,13 +214,13 @@ extension YHActivityDetailViewController {
...
@@ -214,13 +214,13 @@ extension YHActivityDetailViewController {
ossGroup
.
enter
()
ossGroup
.
enter
()
item
.
imgView
.
kf
.
setImage
(
with
:
URL
(
string
:
item
.
url
))
{
result
in
item
.
imgView
.
kf
.
setImage
(
with
:
URL
(
string
:
item
.
url
))
{
result
in
switch
result
{
switch
result
{
case
.
success
(
let
value
):
case
let
.
success
(
value
):
let
size
=
value
.
image
.
size
let
size
=
value
.
image
.
size
let
scale
=
size
.
width
>
0
?
Double
(
size
.
height
/
size
.
width
)
:
0.0
let
scale
=
size
.
width
>
0
?
Double
(
size
.
height
/
size
.
width
)
:
0.0
if
scale
>
0
{
if
scale
>
0
{
item
.
height
=
scale
*
item
.
width
item
.
height
=
scale
*
item
.
width
}
}
case
.
failure
(
let
error
):
case
let
.
failure
(
error
):
print
(
"Job failed:
\(
error
.
localizedDescription
)
"
)
print
(
"Job failed:
\(
error
.
localizedDescription
)
"
)
}
}
ossGroup
.
leave
()
ossGroup
.
leave
()
...
@@ -230,9 +230,8 @@ extension YHActivityDetailViewController {
...
@@ -230,9 +230,8 @@ extension YHActivityDetailViewController {
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
}
}
}
}
func
applyActivity
(
param
:
[
String
:
Any
])
{
func
applyActivity
(
param
:
[
String
:
Any
])
{
viewModel
.
applyActivity
(
param
:
param
)
{
success
,
error
in
viewModel
.
applyActivity
(
param
:
param
)
{
success
,
error
in
if
success
{
if
success
{
YHHUD
.
flash
(
message
:
"报名成功"
)
YHHUD
.
flash
(
message
:
"报名成功"
)
...
@@ -264,41 +263,37 @@ extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSo
...
@@ -264,41 +263,37 @@ extension YHActivityDetailViewController: UITableViewDelegate, UITableViewDataSo
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
1
return
1
}
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
viewModel
.
arrActivityDetail
.
count
return
viewModel
.
arrActivityDetail
.
count
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell
cell
.
dataModel
=
viewModel
.
activityDetailModel
cell
.
dataModel
=
viewModel
.
activityDetailModel
if
indexPath
.
row
<
viewModel
.
arrActivityDetail
.
count
{
if
indexPath
.
row
<
viewModel
.
arrActivityDetail
.
count
{
let
model
=
viewModel
.
arrActivityDetail
[
indexPath
.
row
]
let
model
=
viewModel
.
arrActivityDetail
[
indexPath
.
row
]
if
model
.
type
==
0
{
if
model
.
type
==
0
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell0
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell0
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell0
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell0
cell
.
dataModel
=
model
.
activityDetailModel
??
YHActivityDetailModel
()
cell
.
dataModel
=
model
.
activityDetailModel
??
YHActivityDetailModel
()
return
cell
return
cell
}
else
if
model
.
type
==
1
{
}
else
if
model
.
type
==
1
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell1
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell1
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell1
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell1
cell
.
dataModel
=
model
.
activityDetailModel
??
YHActivityDetailModel
()
cell
.
dataModel
=
model
.
activityDetailModel
??
YHActivityDetailModel
()
return
cell
return
cell
}
else
if
model
.
type
==
2
{
}
else
if
model
.
type
==
2
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell2
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell2
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityDetailCell2
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityDetailCell2
cell
.
dataModel
=
model
.
activityDetailModel
??
YHActivityDetailModel
()
cell
.
dataModel
=
model
.
activityDetailModel
??
YHActivityDetailModel
()
return
cell
return
cell
}
}
}
}
return
cell
return
cell
}
}
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(社区)/Activity(活动)/C/YHActivityListViewController.swift
View file @
a6f2fd26
...
@@ -6,20 +6,19 @@
...
@@ -6,20 +6,19 @@
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
//
import
UIKit
import
JXSegmentedView
import
JXSegmentedView
import
UIKit
enum
YHActivityStatus
:
Int
{
enum
YHActivityStatus
:
Int
{
// 活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名
// 活动的状态 1:立即报名 2:已报名 3:活动结束 4:已取消报名
case
unknow
=
0
// 未知
case
unknow
=
0
// 未知
case
notApply
=
1
// 立即报名
case
notApply
=
1
// 立即报名
case
applied
=
2
// 已报名
case
applied
=
2
// 已报名
case
end
=
3
// 活动结束
case
end
=
3
// 活动结束
case
canceled
=
4
// 已取消报名
case
canceled
=
4
// 已取消报名
case
soldout
=
5
// 活动下架
case
soldout
=
5
// 活动下架
var
titleForList
:
String
{
var
titleForList
:
String
{
switch
self
{
switch
self
{
case
.
notApply
:
case
.
notApply
:
...
@@ -36,7 +35,7 @@ enum YHActivityStatus: Int {
...
@@ -36,7 +35,7 @@ enum YHActivityStatus: Int {
return
""
return
""
}
}
}
}
var
titleForMyApplyList
:
String
{
var
titleForMyApplyList
:
String
{
switch
self
{
switch
self
{
case
.
notApply
:
case
.
notApply
:
...
@@ -53,7 +52,7 @@ enum YHActivityStatus: Int {
...
@@ -53,7 +52,7 @@ enum YHActivityStatus: Int {
return
""
return
""
}
}
}
}
var
titleForDetail
:
String
{
var
titleForDetail
:
String
{
switch
self
{
switch
self
{
case
.
notApply
:
case
.
notApply
:
...
@@ -70,7 +69,7 @@ enum YHActivityStatus: Int {
...
@@ -70,7 +69,7 @@ enum YHActivityStatus: Int {
return
""
return
""
}
}
}
}
var
activityColor
:
UIColor
{
var
activityColor
:
UIColor
{
switch
self
{
switch
self
{
case
.
notApply
:
case
.
notApply
:
...
@@ -87,7 +86,7 @@ enum YHActivityStatus: Int {
...
@@ -87,7 +86,7 @@ enum YHActivityStatus: Int {
return
UIColor
.
clear
return
UIColor
.
clear
}
}
}
}
var
activityColorForMyApplyList
:
UIColor
{
var
activityColorForMyApplyList
:
UIColor
{
switch
self
{
switch
self
{
case
.
notApply
:
case
.
notApply
:
...
@@ -110,14 +109,13 @@ enum YHActivityStatus: Int {
...
@@ -110,14 +109,13 @@ enum YHActivityStatus: Int {
活动列表 或 我的报名活动
活动列表 或 我的报名活动
*/
*/
class
YHActivityListViewController
:
YHBaseViewController
{
class
YHActivityListViewController
:
YHBaseViewController
{
var
type
:
Int
=
0
// 0-活动列表 1-我的报名活动
var
type
:
Int
=
0
// 0-活动列表 1-我的报名活动
lazy
var
viewModel
:
YHActivityViewModel
=
{
lazy
var
viewModel
:
YHActivityViewModel
=
{
let
vm
=
YHActivityViewModel
()
let
vm
=
YHActivityViewModel
()
return
vm
return
vm
}()
}()
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
...
@@ -130,29 +128,30 @@ class YHActivityListViewController: YHBaseViewController {
...
@@ -130,29 +128,30 @@ class YHActivityListViewController: YHBaseViewController {
tableView
.
backgroundView
=
self
.
emptyDataTipsView
tableView
.
backgroundView
=
self
.
emptyDataTipsView
return
tableView
return
tableView
}()
}()
lazy
var
emptyDataTipsView
:
YHEmptyDataView
=
{
lazy
var
emptyDataTipsView
:
YHEmptyDataView
=
{
let
view
=
YHEmptyDataView
.
createView
(
"暂无活动"
,
kEmptyCommonBgName
)
let
view
=
YHEmptyDataView
.
createView
(
"暂无活动"
,
kEmptyCommonBgName
)
view
.
topMargin
=
222
view
.
topMargin
=
222
view
.
isHidden
=
true
view
.
isHidden
=
true
return
view
return
view
}()
}()
// MARK: - 生命周期方法
// MARK: - 生命周期方法
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
white
view
.
backgroundColor
=
.
white
gk_navigationBar
.
isHidden
=
true
gk_navigationBar
.
isHidden
=
true
gk_navigationBar
.
backgroundColor
=
.
white
gk_navigationBar
.
backgroundColor
=
.
white
view
.
addSubview
(
tableView
)
view
.
addSubview
(
tableView
)
if
type
==
1
{
if
type
==
1
{
gk_navTitle
=
"我的活动"
gk_navTitle
=
"我的活动"
gk_navigationBar
.
isHidden
=
false
gk_navigationBar
.
isHidden
=
false
gk_navigationBar
.
backgroundColor
=
.
clear
gk_navigationBar
.
backgroundColor
=
.
clear
tableView
.
snp
.
makeConstraints
{
make
in
tableView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
20
)
make
.
left
.
equalTo
(
20
)
make
.
right
.
equalTo
(
-
20
)
make
.
right
.
equalTo
(
-
20
)
...
@@ -167,7 +166,7 @@ class YHActivityListViewController: YHBaseViewController {
...
@@ -167,7 +166,7 @@ class YHActivityListViewController: YHBaseViewController {
make
.
top
.
equalToSuperview
()
make
.
top
.
equalToSuperview
()
}
}
}
}
tableView
.
es
.
addYHPullToRefresh
{
tableView
.
es
.
addYHPullToRefresh
{
self
.
loadFirstData
()
self
.
loadFirstData
()
}
}
...
@@ -175,11 +174,10 @@ class YHActivityListViewController: YHBaseViewController {
...
@@ -175,11 +174,10 @@ class YHActivityListViewController: YHBaseViewController {
tableView
.
es
.
addInfiniteScrolling
{
tableView
.
es
.
addInfiniteScrolling
{
self
.
loadMoreData
()
self
.
loadMoreData
()
}
}
emptyDataTipsView
.
isHidden
=
viewModel
.
arrActivityListData
.
count
>
0
?
true
:
false
emptyDataTipsView
.
isHidden
=
viewModel
.
arrActivityListData
.
count
>
0
?
true
:
false
}
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
super
.
viewWillAppear
(
animated
)
loadFirstData
()
loadFirstData
()
...
@@ -188,29 +186,29 @@ class YHActivityListViewController: YHBaseViewController {
...
@@ -188,29 +186,29 @@ class YHActivityListViewController: YHBaseViewController {
extension
YHActivityListViewController
{
extension
YHActivityListViewController
{
func
loadMoreData
()
{
func
loadMoreData
()
{
self
.
viewModel
.
getActivityList
(
firstFlag
:
false
,
type
:
type
)
{
[
weak
self
]
_
,
_
in
viewModel
.
getActivityList
(
firstFlag
:
false
,
type
:
type
)
{
[
weak
self
]
_
,
_
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
self
.
emptyDataTipsView
.
isHidden
=
self
.
viewModel
.
arrActivityListData
.
count
>
0
?
true
:
false
self
.
emptyDataTipsView
.
isHidden
=
self
.
viewModel
.
arrActivityListData
.
count
>
0
?
true
:
false
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.35, execute: {
self
.
tableView
.
es
.
stopLoadingMore
()
self
.
tableView
.
es
.
stopLoadingMore
()
if
self
.
viewModel
.
hasMoreForActivityList
==
false
{
if
self
.
viewModel
.
hasMoreForActivityList
==
false
{
self
.
tableView
.
es
.
noticeNoMoreData
()
self
.
tableView
.
es
.
noticeNoMoreData
()
self
.
tableView
.
footer
?
.
alpha
=
1
self
.
tableView
.
footer
?
.
alpha
=
1
}
}
// })
// })
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
}
}
}
}
func
loadFirstData
()
{
func
loadFirstData
()
{
self
.
viewModel
.
getActivityList
(
firstFlag
:
true
,
type
:
type
)
{
[
weak
self
]
_
,
_
in
viewModel
.
getActivityList
(
firstFlag
:
true
,
type
:
type
)
{
[
weak
self
]
_
,
_
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
tableView
.
es
.
stopPullToRefresh
()
self
.
tableView
.
es
.
stopPullToRefresh
()
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
self
.
emptyDataTipsView
.
isHidden
=
self
.
viewModel
.
arrActivityListData
.
count
>
0
?
true
:
false
self
.
emptyDataTipsView
.
isHidden
=
self
.
viewModel
.
arrActivityListData
.
count
>
0
?
true
:
false
self
.
tableView
.
es
.
stopPullToRefresh
()
self
.
tableView
.
es
.
stopPullToRefresh
()
...
@@ -229,37 +227,36 @@ extension YHActivityListViewController {
...
@@ -229,37 +227,36 @@ extension YHActivityListViewController {
}
}
extension
YHActivityListViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
extension
YHActivityListViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
if
viewModel
.
arrActivityListData
.
count
>
0
{
if
viewModel
.
arrActivityListData
.
count
>
0
{
return
viewModel
.
arrActivityListData
.
count
return
viewModel
.
arrActivityListData
.
count
}
}
return
0
return
0
}
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
1
return
1
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityListCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityListCell
guard
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityListCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHActivityListCell
else
{
return
UITableViewCell
()
}
cell
.
sessionIndex
=
indexPath
.
section
cell
.
sessionIndex
=
indexPath
.
section
cell
.
type
=
type
cell
.
type
=
type
if
indexPath
.
section
<
viewModel
.
arrActivityListData
.
count
{
if
indexPath
.
section
<
viewModel
.
arrActivityListData
.
count
{
cell
.
dataModel
=
viewModel
.
arrActivityListData
[
indexPath
.
section
]
cell
.
dataModel
=
viewModel
.
arrActivityListData
[
indexPath
.
section
]
}
}
return
cell
return
cell
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
185.0
return
185.0
}
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
<
viewModel
.
arrActivityListData
.
count
{
if
indexPath
.
section
<
viewModel
.
arrActivityListData
.
count
{
let
model
=
viewModel
.
arrActivityListData
[
indexPath
.
section
]
let
model
=
viewModel
.
arrActivityListData
[
indexPath
.
section
]
if
type
==
1
{
if
type
==
1
{
if
model
.
status
.
int
==
2
{
if
model
.
status
.
int
==
2
{
gotoActivityTravelVC
(
checkId
:
model
.
checkId
)
gotoActivityTravelVC
(
checkId
:
model
.
checkId
)
...
@@ -269,40 +266,39 @@ extension YHActivityListViewController: UITableViewDelegate, UITableViewDataSour
...
@@ -269,40 +266,39 @@ extension YHActivityListViewController: UITableViewDelegate, UITableViewDataSour
return
return
}
}
}
}
let
vc
=
YHActivityDetailViewController
()
let
vc
=
YHActivityDetailViewController
()
vc
.
activityId
=
String
(
model
.
id
)
vc
.
activityId
=
String
(
model
.
id
)
vc
.
activityName
=
model
.
name
vc
.
activityName
=
model
.
name
navigationController
?
.
pushViewController
(
vc
)
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
func
gotoActivityTravelVC
(
checkId
:
String
=
""
)
{
func
gotoActivityTravelVC
(
checkId
:
String
=
""
)
{
if
let
nav
=
self
.
navigationController
{
if
let
nav
=
navigationController
{
let
rrr
=
nav
.
viewControllers
.
contains
{
$0
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
}
let
rrr
=
nav
.
viewControllers
.
contains
{
$0
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
}
if
rrr
{
if
rrr
{
var
targetVc
:
UIViewController
?
var
targetVc
:
UIViewController
?
for
(
_
,
value
)
in
nav
.
viewControllers
.
enumerated
()
{
for
(
_
,
value
)
in
nav
.
viewControllers
.
enumerated
()
{
if
value
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
{
if
value
.
isKind
(
of
:
YHActivityTravelViewController
.
self
)
{
targetVc
=
value
targetVc
=
value
break
break
}
}
}
}
if
let
vc
=
targetVc
{
if
let
vc
=
targetVc
{
navigationController
?
.
popToViewController
(
vc
,
animated
:
true
)
navigationController
?
.
popToViewController
(
vc
,
animated
:
true
)
}
}
return
return
}
}
}
}
// 行程单详情
// 行程单详情
let
vc
=
YHActivityTravelViewController
()
let
vc
=
YHActivityTravelViewController
()
vc
.
travelId
=
checkId
vc
.
travelId
=
checkId
navigationController
?
.
pushViewController
(
vc
)
navigationController
?
.
pushViewController
(
vc
)
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
var
height
:
CGFloat
=
16.0
var
height
:
CGFloat
=
16.0
if
section
!=
0
{
if
section
!=
0
{
...
@@ -310,25 +306,24 @@ extension YHActivityListViewController: UITableViewDelegate, UITableViewDataSour
...
@@ -310,25 +306,24 @@ extension YHActivityListViewController: UITableViewDelegate, UITableViewDataSour
}
}
return
height
return
height
}
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
var
height
:
CGFloat
=
16.0
var
height
:
CGFloat
=
16.0
if
section
!=
0
{
if
section
!=
0
{
height
=
20.0
height
=
20.0
}
}
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
-
16.0
*
2
,
height
:
height
))
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
-
16.0
*
2
,
height
:
height
))
view
.
backgroundColor
=
.
clear
view
.
backgroundColor
=
.
clear
return
view
return
view
}
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
-
16.0
*
2
,
height
:
0.001
))
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
-
16.0
*
2
,
height
:
0.001
))
view
.
backgroundColor
=
.
clear
view
.
backgroundColor
=
.
clear
return
view
return
view
}
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
0.001
return
0.001
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/C/YHActivityTravelViewController.swift
View file @
a6f2fd26
...
@@ -233,7 +233,8 @@ extension YHActivityTravelViewController: UITableViewDelegate, UITableViewDataSo
...
@@ -233,7 +233,8 @@ extension YHActivityTravelViewController: UITableViewDelegate, UITableViewDataSo
}
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityTravelCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHActivityTravelCell
guard
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHActivityTravelCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHActivityTravelCell
else
{
return
UITableViewCell
()
}
cell
.
dataModel
=
viewModel
.
activityTravelModel
cell
.
dataModel
=
viewModel
.
activityTravelModel
cell
.
block
=
{[
weak
self
]
in
cell
.
block
=
{[
weak
self
]
in
self
?
.
clickBottomButton
()
self
?
.
clickBottomButton
()
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHMyGoodFriendsVC.swift
View file @
a6f2fd26
...
@@ -88,7 +88,8 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
...
@@ -88,7 +88,8 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
==
0
{
if
indexPath
.
section
==
0
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHAddFriendCardCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHAddFriendCardCell
guard
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHAddFriendCardCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHAddFriendCardCell
else
{
return
UITableViewCell
()
}
cell
.
cardCount
=
self
.
friendRequestArr
.
count
cell
.
cardCount
=
self
.
friendRequestArr
.
count
if
self
.
friendRequestArr
.
count
>
0
{
if
self
.
friendRequestArr
.
count
>
0
{
cell
.
friendModel
=
self
.
friendRequestArr
[
0
]
cell
.
friendModel
=
self
.
friendRequestArr
[
0
]
...
@@ -118,7 +119,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
...
@@ -118,7 +119,7 @@ extension YHMyGoodFriendsVC: UITableViewDelegate, UITableViewDataSource {
return
cell
return
cell
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyFriendsCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyFriendsCell
guard
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyFriendsCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHMyFriendsCell
else
{
return
UITableViewCell
()
}
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
friendsArr
.
count
{
if
0
<=
indexPath
.
row
&&
indexPath
.
row
<
friendsArr
.
count
{
let
friend
=
self
.
friendsArr
[
indexPath
.
row
]
let
friend
=
self
.
friendsArr
[
indexPath
.
row
]
cell
.
friendModel
=
friend
cell
.
friendModel
=
friend
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHNameCardViewController.swift
View file @
a6f2fd26
...
@@ -127,7 +127,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -127,7 +127,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
let
cardInfo
=
self
.
cardInfoArr
[
indexPath
.
section
]
let
cardInfo
=
self
.
cardInfoArr
[
indexPath
.
section
]
if
cardInfo
.
type
==
.
avatar
{
if
cardInfo
.
type
==
.
avatar
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyNameCardAvatarInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyNameCardAvatarInfoCell
guard
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyNameCardAvatarInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHMyNameCardAvatarInfoCell
else
{
return
UITableViewCell
()
}
cell
.
userModel
=
cardInfo
cell
.
userModel
=
cardInfo
cell
.
editBlock
=
{
[
weak
self
]
in
cell
.
editBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -139,7 +139,8 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -139,7 +139,8 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
}
}
if
cardInfo
.
type
==
.
honor
||
cardInfo
.
type
==
.
introduce
{
if
cardInfo
.
type
==
.
honor
||
cardInfo
.
type
==
.
introduce
{
let
introCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyIntroductionCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyIntroductionCell
guard
let
introCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyIntroductionCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHMyIntroductionCell
else
{
return
UITableViewCell
()
}
introCell
.
userModel
=
cardInfo
introCell
.
userModel
=
cardInfo
introCell
.
editBlock
=
{
[
weak
self
]
in
introCell
.
editBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
@@ -157,7 +158,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -157,7 +158,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
}
}
if
cardInfo
.
type
==
.
education
{
if
cardInfo
.
type
==
.
education
{
let
eduCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyEducationCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyEducationCell
guard
let
eduCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyEducationCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHMyEducationCell
else
{
return
UITableViewCell
()
}
eduCell
.
userModel
=
cardInfo
eduCell
.
userModel
=
cardInfo
eduCell
.
hiddenBtnBlock
=
{
eduCell
.
hiddenBtnBlock
=
{
[
weak
self
]
in
[
weak
self
]
in
...
@@ -174,7 +175,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -174,7 +175,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
}
}
if
cardInfo
.
type
==
.
workExperience
{
if
cardInfo
.
type
==
.
workExperience
{
let
workCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyWorkExperienceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyWorkExperienceCell
guard
let
workCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyWorkExperienceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHMyWorkExperienceCell
else
{
return
UITableViewCell
()
}
workCell
.
userModel
=
cardInfo
workCell
.
userModel
=
cardInfo
workCell
.
hiddenBtnBlock
=
{
workCell
.
hiddenBtnBlock
=
{
[
weak
self
]
in
[
weak
self
]
in
...
@@ -191,7 +192,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
...
@@ -191,7 +192,7 @@ extension YHNameCardViewController: UITableViewDelegate, UITableViewDataSource {
}
}
if
cardInfo
.
type
==
.
topics
{
if
cardInfo
.
type
==
.
topics
{
let
topicCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyInterestTopicCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHMyInterestTopicCell
guard
let
topicCell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHMyInterestTopicCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as?
YHMyInterestTopicCell
else
{
return
UITableViewCell
()
}
topicCell
.
userModel
=
cardInfo
topicCell
.
userModel
=
cardInfo
topicCell
.
editBlock
=
{
[
weak
self
]
in
topicCell
.
editBlock
=
{
[
weak
self
]
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