Commit 104bb280 authored by Steven杜宇's avatar Steven杜宇

// 消息

parent 0ceb7101
...@@ -18,7 +18,7 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -18,7 +18,7 @@ class YHMessageSessionCell: UITableViewCell {
var badgeLabel: UILabel! var badgeLabel: UILabel!
var nameLabel: UILabel! var nameLabel: UILabel!
var detailLabel: UILabel! var detailLabel: UILabel!
// var timeLabel: UILabel! var timeLabel: UILabel!
var bottomLineView: UIView! var bottomLineView: UIView!
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
...@@ -64,7 +64,8 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -64,7 +64,8 @@ class YHMessageSessionCell: UITableViewCell {
} }
self.detailLabel.text = !model.lastMessage.isEmpty ? model.lastMessage : "暂无消息".local self.detailLabel.text = !model.lastMessage.isEmpty ? model.lastMessage : "暂无消息".local
// self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime)) self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
self.timeLabel.isHidden = model.lastMessage.isEmpty
} }
func formatTimestamp(_ timestamp: TimeInterval) -> String { func formatTimestamp(_ timestamp: TimeInterval) -> String {
...@@ -126,13 +127,13 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -126,13 +127,13 @@ class YHMessageSessionCell: UITableViewCell {
detailLabel.font = UIFont.PFSC_R(ofSize:12) detailLabel.font = UIFont.PFSC_R(ofSize:12)
contentView.addSubview(detailLabel) contentView.addSubview(detailLabel)
// timeLabel = UILabel() timeLabel = UILabel()
// timeLabel.textColor = UIColor(hex:0x121A26, alpha: 0.3) timeLabel.textColor = UIColor(hex:0x121A26, alpha: 0.3)
// timeLabel.textAlignment = .right timeLabel.textAlignment = .right
// timeLabel.font = UIFont.PFSC_R(ofSize:11) timeLabel.font = UIFont.PFSC_R(ofSize:11)
// timeLabel.setContentCompressionResistancePriority(.required, for: .horizontal) timeLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
// timeLabel.setContentHuggingPriority(.required, for: .horizontal) timeLabel.setContentHuggingPriority(.required, for: .horizontal)
// contentView.addSubview(timeLabel) contentView.addSubview(timeLabel)
bottomLineView = UIView() bottomLineView = UIView()
bottomLineView.backgroundColor = UIColor(hex: 0xF0F3F7) bottomLineView.backgroundColor = UIColor(hex: 0xF0F3F7)
...@@ -158,22 +159,23 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -158,22 +159,23 @@ class YHMessageSessionCell: UITableViewCell {
nameLabel.snp.makeConstraints { make in nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconContentView.snp.right).offset(16) make.left.equalTo(iconContentView.snp.right).offset(16)
make.right.equalToSuperview().offset(-20) make.right.equalTo(timeLabel.snp.left).offset(-20)
make.top.equalTo(iconContentView) make.top.equalTo(iconContentView)
make.height.equalTo(21) make.height.equalTo(21)
} }
detailLabel.snp.makeConstraints { make in detailLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel) make.left.equalTo(nameLabel)
make.right.equalTo(timeLabel)
make.top.equalTo(nameLabel.snp.bottom).offset(2) make.top.equalTo(nameLabel.snp.bottom).offset(2)
make.height.equalTo(17) make.height.equalTo(17)
} }
// timeLabel.snp.makeConstraints { make in timeLabel.snp.makeConstraints { make in
// make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
// make.top.equalTo(nameLabel) make.top.equalTo(nameLabel)
// make.height.equalTo(15) make.height.equalTo(15)
// } }
bottomLineView.snp.makeConstraints { make in bottomLineView.snp.makeConstraints { make in
make.left.right.equalTo(detailLabel) make.left.right.equalTo(detailLabel)
......
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