|
|
@@ -19,6 +19,7 @@ class LNProfileUserInfoView: UIView {
|
|
|
private let likeCountLabel = UILabel()
|
|
|
|
|
|
private let scoreLabel = UILabel()
|
|
|
+ private let likeIc = UIImageView()
|
|
|
|
|
|
private var curDetail: LNUserProfileVO?
|
|
|
|
|
|
@@ -34,10 +35,14 @@ class LNProfileUserInfoView: UIView {
|
|
|
idLabel.text = "ID \(detail.userNo)"
|
|
|
|
|
|
followCountLabel.text = .init(key: "A00234", detail.fansCount.formattedAsShortNumber())
|
|
|
-// likeCountLabel.text = detail.fansCount.formattedAsShortNumber() + .init(key: "A00301")
|
|
|
+ likeCountLabel.text = detail.likeCount.formattedAsShortNumber() + .init(key: "A00301")
|
|
|
|
|
|
-// scoreLabel.text = detail.star.formattedAsShortNumber()
|
|
|
+ scoreLabel.text = detail.likeScore.formattedAsShortNumber()
|
|
|
scoreLabel.superview?.isHidden = !detail.playmate
|
|
|
+ if detail.hasLike {
|
|
|
+ likeIc.image = .icLikeFilled
|
|
|
+ likeIc.superview?.isUserInteractionEnabled = false
|
|
|
+ }
|
|
|
|
|
|
curDetail = detail
|
|
|
}
|
|
|
@@ -138,10 +143,16 @@ extension LNProfileUserInfoView {
|
|
|
let container = UIView()
|
|
|
container.onTap { [weak self] in
|
|
|
guard let self else { return }
|
|
|
-
|
|
|
+ guard let curDetail else { return }
|
|
|
+ LNProfileManager.shared.likeUser(uid: curDetail.userNo)
|
|
|
+ { [weak self] success in
|
|
|
+ guard let self else { return }
|
|
|
+ guard success else { return }
|
|
|
+ likeIc.image = .icLikeFilled
|
|
|
+ likeIc.superview?.isUserInteractionEnabled = false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- let likeIc = UIImageView()
|
|
|
likeIc.image = .icLikeEmpty.withTintColor(.text_1, renderingMode: .alwaysOriginal)
|
|
|
container.addSubview(likeIc)
|
|
|
likeIc.snp.makeConstraints { make in
|