|
@@ -68,8 +68,8 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
followButton.snp_makeConstraints { (make) in
|
|
|
make.centerY.equalToSuperview()
|
|
|
make.right.equalTo(-14)
|
|
|
- make.height.equalTo(26)
|
|
|
- make.width.equalTo(64)
|
|
|
+ make.height.equalTo(28)
|
|
|
+ make.width.equalTo(60)
|
|
|
}
|
|
|
lineLabel.snp_makeConstraints { (make) in
|
|
|
make.bottom.equalToSuperview()
|
|
@@ -115,11 +115,11 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
var followButtonClosure : FollowButtonClosure?
|
|
|
private lazy var followButton: UIButton = {
|
|
|
let followButton = UIButton(type: UIButton.ButtonType.custom)
|
|
|
- followButton.titleLabel?.font = kBoldFont13
|
|
|
- followButton.layer.cornerRadius = 13
|
|
|
+ followButton.titleLabel?.font = kRegularFont13
|
|
|
+ followButton.layer.cornerRadius = 14
|
|
|
followButton.layer.masksToBounds = true
|
|
|
- followButton.layer.borderWidth = 1
|
|
|
followButton.rx.tap.subscribe(onNext: {[weak self] (data) in
|
|
|
+ followButton.isEnabled = false
|
|
|
if let followButtonClosure = self?.followButtonClosure {
|
|
|
followButtonClosure()
|
|
|
}
|
|
@@ -135,7 +135,9 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
|
|
|
var userFollowModel: UserFollowModel? {
|
|
|
didSet {
|
|
|
- followType = FollowType(rawValue: userFollowModel?.isFollowStatus ?? 0)
|
|
|
+
|
|
|
+ CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: userFollowModel?.isFollowStatus ?? 0))
|
|
|
+
|
|
|
avatarButton.kf.setImage(with: kURLImage(name: userFollowModel?.followAvatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
|
|
|
titleButton.setTitle(userFollowModel?.followUsername, for: UIControl.State.normal)
|
|
|
var followTopic = Array<String>()
|
|
@@ -156,7 +158,8 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
|
|
|
var userFanModel: UserFanModel? {
|
|
|
didSet {
|
|
|
- followType = FollowType(rawValue: userFanModel?.isFollowStatus ?? 0)
|
|
|
+ CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: userFanModel?.isFollowStatus ?? 0))
|
|
|
+
|
|
|
avatarButton.kf.setImage(with: kURLImage(name: userFanModel?.fanAvatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
|
|
|
titleButton.setTitle(userFanModel?.fanUsername, for: UIControl.State.normal)
|
|
|
var followTopic = Array<String>()
|
|
@@ -177,7 +180,8 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
|
|
|
var cmsMemberModel: CMSMemberModel? {
|
|
|
didSet {
|
|
|
- followType = FollowType(rawValue: cmsMemberModel?.followStatus ?? 0)
|
|
|
+ CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: cmsMemberModel?.followStatus ?? 0))
|
|
|
+
|
|
|
avatarButton.kf.setImage(with: kURLImage(name: cmsMemberModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
|
|
|
titleButton.setTitle(cmsMemberModel?.username, for: UIControl.State.normal)
|
|
|
var followTopic = Array<String>()
|
|
@@ -199,7 +203,8 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
|
|
|
var searchMemberModel: SearchMemberModel? {
|
|
|
didSet {
|
|
|
- followType = FollowType(rawValue: searchMemberModel?.followStatus ?? 0)
|
|
|
+ CommunityFollowUserViewModel.setFollowFeedType(followButton: followButton, followType: FollowType(rawValue: searchMemberModel?.followStatus ?? 0))
|
|
|
+
|
|
|
avatarButton.kf.setImage(with: kURLImage(name: searchMemberModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
|
|
|
titleButton.setTitle(searchMemberModel?.username, for: UIControl.State.normal)
|
|
|
var followTopic = Array<String>()
|
|
@@ -218,40 +223,5 @@ class SearchUserLitTableViewCell: UITableViewCell {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- var followType: FollowType! {
|
|
|
- didSet {
|
|
|
- switch followType {
|
|
|
- case .futureFollow?:
|
|
|
- followButton.setTitle("关注", for: UIControl.State.normal)
|
|
|
- followButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
|
|
|
- followButton.setImage(kImage(name: "star_attention"), for: UIControl.State.normal)
|
|
|
- followButton.layer.borderColor = kThemeColor.cgColor
|
|
|
- followButton.setBackgroundImage(UIImage.imageWithColor(color: kffffffColor), for: UIControl.State.normal)
|
|
|
- followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
|
|
|
-
|
|
|
- break
|
|
|
- case .alreadyFollow?:
|
|
|
- followButton.setTitle("关注", for: UIControl.State.normal)
|
|
|
- followButton.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
|
- followButton.setImage(kImage(name: "star_followed"), for: UIControl.State.normal)
|
|
|
- followButton.layer.borderColor = kf7f8faColor.cgColor
|
|
|
- followButton.setBackgroundImage(UIImage.imageWithColor(color: kf7f8faColor), for: UIControl.State.normal)
|
|
|
- followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 2)
|
|
|
- break
|
|
|
- case .mutualFollow?:
|
|
|
- followButton.setTitle("互相关注", for: UIControl.State.normal)
|
|
|
- followButton.setTitleColor(k333333Color, for: UIControl.State.normal)
|
|
|
- followButton.setImage(nil, for: UIControl.State.normal)
|
|
|
- followButton.layer.borderColor = kCCCCCCColor.cgColor
|
|
|
- followButton.setBackgroundImage(UIImage.imageWithColor(color: kffffffColor), for: UIControl.State.normal)
|
|
|
- followButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 0)
|
|
|
-
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
}
|