|
@@ -46,6 +46,7 @@ class RecommendDetailContentCell: UITableViewCell {
|
|
|
addSubview(contentLabel)
|
|
|
addSubview(collectionView)
|
|
|
addSubview(timeLabel)
|
|
|
+ addSubview(locationButton)
|
|
|
addSubview(readLabel)
|
|
|
}
|
|
|
|
|
@@ -87,6 +88,10 @@ class RecommendDetailContentCell: UITableViewCell {
|
|
|
make.height.equalTo(15)
|
|
|
make.bottom.equalToSuperview().offset(-20)
|
|
|
}
|
|
|
+ locationButton.snp.makeConstraints { (make) in
|
|
|
+ make.centerY.equalTo(timeLabel)
|
|
|
+ make.left.equalTo(timeLabel.snp_right).offset(8)
|
|
|
+ }
|
|
|
readLabel.snp.makeConstraints { (make) in
|
|
|
make.right.equalTo(titleLabel.snp_right)
|
|
|
make.centerY.equalTo(timeLabel.snp_centerY)
|
|
@@ -202,9 +207,16 @@ class RecommendDetailContentCell: UITableViewCell {
|
|
|
didSet {
|
|
|
beanLabel.text = "\(communityPostDetailModel?.availableBean ?? 0)彩虹豆待收获"
|
|
|
contentLabel.text = communityPostDetailModel?.content
|
|
|
- timeLabel.text = "\(communityPostDetailModel?.createdAt ?? "") I"
|
|
|
- locationButton.setTitle(communityPostDetailModel?.location, for: UIControl.State.normal)
|
|
|
- locationButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 3)
|
|
|
+ if communityPostDetailModel?.location == nil || communityPostDetailModel?.location == "" {
|
|
|
+ timeLabel.text = "\(communityPostDetailModel?.createdAt ?? "")"
|
|
|
+ locationButton.isHidden = true
|
|
|
+ }else {
|
|
|
+ timeLabel.text = "\(communityPostDetailModel?.createdAt ?? "") I"
|
|
|
+ locationButton.isHidden = false
|
|
|
+ locationButton.setTitle(communityPostDetailModel?.location, for: UIControl.State.normal)
|
|
|
+ locationButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 3)
|
|
|
+
|
|
|
+ }
|
|
|
readLabel.text = "阅读·\(communityPostDetailModel?.pv ?? 0)"
|
|
|
|
|
|
if communityPostDetailModel?.title == nil || communityPostDetailModel?.title == "" {
|