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

// 消息

parent fb476550
...@@ -36,11 +36,12 @@ class YHMessageDetailListVC: YHBaseViewController { ...@@ -36,11 +36,12 @@ class YHMessageDetailListVC: YHBaseViewController {
bar.rightBtnClick = { bar.rightBtnClick = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
let unreadMessages = self.msgArr.filter { !$0.isRead }
if unreadMessages.count <= 0 {
YHHUD.flash(message: "暂无未读消息~")
return
}
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") { YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
if self.msgArr.count <= 0 {
YHHUD.flash(message: "暂无消息~")
return
}
self.markAllMsgsRead() self.markAllMsgsRead()
} }
} }
......
...@@ -49,8 +49,8 @@ class YHMessageListVC: YHBaseViewController { ...@@ -49,8 +49,8 @@ class YHMessageListVC: YHBaseViewController {
bar.rightBtnClick = { bar.rightBtnClick = {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
if self.msgArr.count <= 0 { if self.viewModel.unreadTotalCount <= 0 {
YHHUD.flash(message: "暂无消息~") YHHUD.flash(message: "暂无未读消息~")
return return
} }
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") { YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
......
...@@ -63,7 +63,7 @@ class YHMessageSessionCell: UITableViewCell { ...@@ -63,7 +63,7 @@ class YHMessageSessionCell: UITableViewCell {
make.width.equalTo(width) make.width.equalTo(width)
} }
self.detailLabel.text = model.lastMessage self.detailLabel.text = !model.lastMessage.isEmpty ? model.lastMessage : "暂无消息".local
self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime)) self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
} }
......
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