Commit 05111627 authored by Steven杜宇's avatar Steven杜宇

// 社区

parent 20d13a65
......@@ -209,6 +209,7 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
guard let self = self else { return }
let vc = YHInformationAuthorizationStepTwoViewController()
vc.name = self.viewModel.model.username
vc.popToRoot = true
self.navigationController?.pushViewController(vc)
}
}
......
......@@ -9,6 +9,7 @@
import UIKit
class YHInformationAuthorizationStepTwoViewController: YHBaseViewController {
var popToRoot: Bool = false
var stepOneView: UIView!
var stepTwoView: UIView!
var nextButton: UIButton!
......@@ -124,7 +125,11 @@ class YHInformationAuthorizationStepTwoViewController: YHBaseViewController {
// let window = UIApplication.shared.yhKeyWindow()
// window?.addSubview(view)
// } else {
if popToRoot {
self.navigationController?.popToRootViewController(animated: true)
} else {
self.navigationController?.popViewController(animated: true)
}
// }
}
}
......
......@@ -33,6 +33,7 @@ class YHContact: SmartCodable {
var position: String = ""
var industry: String = ""
var signature: String = ""
var bio: String = ""
var type: Int = 1 // 人脉状态 1: 陌生人 3: 待验证 5: 好友
required init() {
......
......@@ -38,7 +38,7 @@ class YHConnectListCell: UITableViewCell {
return label
}()
private lazy var signatureLabel: UILabel = {
private lazy var detailLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 11)
label.textColor = UIColor.brandGrayColor6
......@@ -99,7 +99,7 @@ class YHConnectListCell: UITableViewCell {
contentView.addSubview(avatarImageView)
contentView.addSubview(nameLabel)
contentView.addSubview(titleLabel)
contentView.addSubview(signatureLabel)
contentView.addSubview(detailLabel)
contentView.addSubview(statusLabel)
contentView.addSubview(addFriendButton)
contentView.addSubview(separatorLine)
......@@ -137,7 +137,7 @@ class YHConnectListCell: UITableViewCell {
make.height.equalTo(18)
}
signatureLabel.snp.makeConstraints { make in
detailLabel.snp.makeConstraints { make in
make.left.equalTo(avatarImageView.snp.right).offset(10)
make.top.equalTo(titleLabel.snp.bottom).offset(4)
make.right.equalToSuperview().offset(-20)
......@@ -157,7 +157,7 @@ class YHConnectListCell: UITableViewCell {
self.contact = contact
avatarImageView.sd_setImage(with: URL(string: contact.avatar), placeholderImage: UIImage(named: ""))
nameLabel.text = contact.username
signatureLabel.text = contact.signature
detailLabel.text = contact.bio
var text1 = ""
var text1Arr: [String] = []
......
......@@ -53,6 +53,7 @@ class YHDynamicItem: SmartCodable {
var position: String = ""
var release_time: String = ""
var format_release_time: String = ""
var created_at: String = ""
var is_self_posts: Int = 0 // 是否是自己的动态
required init() {
......
......@@ -65,6 +65,12 @@ class YHNameCardDynamicCell: UITableViewCell {
private lazy var img3V: UIImageView = {
let v = UIImageView()
v.addSubview(numLabel)
numLabel.snp.makeConstraints { make in
make.height.equalTo(44)
make.right.equalTo(-12)
make.bottom.equalTo(0)
}
return v
}()
......@@ -89,6 +95,14 @@ class YHNameCardDynamicCell: UITableViewCell {
return label
}()
private lazy var numLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 32)
label.textColor = .mainTextColor
label.textAlignment = .right
return label
}()
private lazy var publishBtn: UIButton = {
let btn = UIButton(type: .custom)
btn.setTitle("重新发布", for: .normal)
......@@ -110,14 +124,15 @@ class YHNameCardDynamicCell: UITableViewCell {
}
func updateModel(_ model: YHDynamicItem) {
timeLabel.text = model.format_release_time
let test = false
if test {
model.is_self_posts = 1
model.audit_status = 3
model.violation_remark = "阿是就发了时代峰峻阿克拉生发剂拉卡萨电极法卡拉是电极法考拉手机大发卡拉季湿哒哒开发逻辑阿达山卡拉代发久啊双打卡拉法基1"
}
timeLabel.text = self.formatDateString(model.created_at)
// let test = true
// if test {
// model.is_self_posts = 1
// model.audit_status = 3
// model.violation_remark = "阿是就发了时代峰峻阿克拉生发剂拉卡萨电极法卡拉是电极法考拉手机大发卡拉季湿哒哒开发逻辑阿达山卡拉代发久啊双打卡拉法基1"
// }
// 审核视图显示
var hiddenReview = true
......@@ -172,6 +187,45 @@ class YHNameCardDynamicCell: UITableViewCell {
let resource = model.resource_urls[2]
img3V.sd_setImage(with: URL(string: resource.url), placeholderImage: UIImage(named: "global_default_image"), context: nil)
}
numLabel.isHidden = model.resource_urls.count <= 3
numLabel.text = "\(model.resource_urls.count)"
// let shadow = NSShadow()
// shadow.shadowColor = UIColor.black
// shadow.shadowOffset = CGSize(width: 44, height: 44)
// shadow.shadowBlurRadius = 44
//
// let attributes: [NSAttributedString.Key: Any] = [
// .foregroundColor: UIColor.white,
// .font: UIFont.PFSC_R(ofSize: 32),
// .shadow: shadow]
//
// numLabel.attributedText = NSAttributedString(string: "\(model.resource_urls.count)", attributes: attributes)
}
func formatDateString(_ dateString: String) -> String? {
let inputFormatter = DateFormatter()
inputFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
guard let date = inputFormatter.date(from: dateString) else {
return dateString
}
let calendar = Calendar.current
let currentYear = calendar.component(.year, from: Date())
let dateYear = calendar.component(.year, from: date)
let outputFormatter = DateFormatter()
outputFormatter.locale = Locale(identifier: "en_US_POSIX")
if dateYear == currentYear {
outputFormatter.dateFormat = "MM-dd"
} else {
outputFormatter.dateFormat = "yyyy-MM-dd"
}
return outputFormatter.string(from: date)
}
func setupUI() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment