Commit a5ffcacd authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 消息
  // 消息
parents 64316004 93273d9b
......@@ -73,7 +73,7 @@ class YHMessageDetailListVC: YHBaseViewController {
label.textColor = UIColor(hex: 0x94A3B8)
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .center
label.text = "暂无消息".local
label.text = "暂无消息".local
view.addSubview(label)
imgView.snp.makeConstraints { make in
......
......@@ -32,32 +32,31 @@ class YHMessageListVC: YHBaseViewController {
return tableView
}()
lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar()
bar.backButton.isHidden = true
bar.backgroundColor = .white
bar.title = "消息"
bar.showRightButtonType(.clean)
bar.backBlock = {
[weak self] in
guard let self = self else { return }
self.navigationController?.popViewController(animated: true)
lazy var navBar: UIView = {
let bar = UIView()
let titleLabel = UILabel()
titleLabel.textColor = UIColor(hex: 0x121A26)
titleLabel.textAlignment = .left
titleLabel.font = UIFont.PFSC_M(ofSize:21)
titleLabel.text = "消息"
bar.addSubview(titleLabel)
let cleanBtn = UIButton()
cleanBtn.setImage(UIImage(named: "msg_clean"), for: .normal)
cleanBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
cleanBtn.addTarget(self, action: #selector(didCleanButtonClicked), for: .touchUpInside)
bar.addSubview(cleanBtn)
titleLabel.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(20)
make.right.equalTo(cleanBtn.snp.left).offset(-20)
}
bar.rightBtnClick = {
[weak self] in
guard let self = self else { return }
bar.rightBtnClick = {
[weak self] in
guard let self = self else { return }
let unreadMessages = self.msgArr.filter { $0.unreadCount > 0 }
if unreadMessages.count <= 0 {
YHHUD.flash(message: "暂无未读消息~")
return
}
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
self.markAllMsgsRead()
}
}
cleanBtn.snp.makeConstraints { make in
make.width.height.equalTo(24)
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-20)
}
return bar
}()
......@@ -72,7 +71,7 @@ class YHMessageListVC: YHBaseViewController {
label.textColor = UIColor(hex: 0x94A3B8)
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .center
label.text = "暂无消息".local
label.text = "暂无消息".local
view.addSubview(label)
imgView.snp.makeConstraints { make in
......@@ -140,6 +139,17 @@ class YHMessageListVC: YHBaseViewController {
}
@objc func didCleanButtonClicked() {
let unreadMessages = self.msgArr.filter { $0.unreadCount > 0 }
if unreadMessages.count <= 0 {
YHHUD.flash(message: "暂无未读消息~")
return
}
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
self.markAllMsgsRead()
}
}
@objc func getUnreadMsgList() {
self.viewModel.getUnreadMsgList {
[weak self] success, error in
......
......@@ -18,7 +18,7 @@ class YHMessageSessionCell: UITableViewCell {
var badgeLabel: UILabel!
var nameLabel: UILabel!
var detailLabel: UILabel!
var timeLabel: UILabel!
// var timeLabel: UILabel!
var bottomLineView: UIView!
required init?(coder: NSCoder) {
......@@ -64,7 +64,7 @@ class YHMessageSessionCell: UITableViewCell {
}
self.detailLabel.text = !model.lastMessage.isEmpty ? model.lastMessage : "暂无消息".local
self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
// self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
}
func formatTimestamp(_ timestamp: TimeInterval) -> String {
......@@ -126,13 +126,13 @@ class YHMessageSessionCell: UITableViewCell {
detailLabel.font = UIFont.PFSC_R(ofSize:12)
contentView.addSubview(detailLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor(hex:0x121A26, alpha: 0.3)
timeLabel.textAlignment = .right
timeLabel.font = UIFont.PFSC_R(ofSize:11)
timeLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
timeLabel.setContentHuggingPriority(.required, for: .horizontal)
contentView.addSubview(timeLabel)
// timeLabel = UILabel()
// timeLabel.textColor = UIColor(hex:0x121A26, alpha: 0.3)
// timeLabel.textAlignment = .right
// timeLabel.font = UIFont.PFSC_R(ofSize:11)
// timeLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
// timeLabel.setContentHuggingPriority(.required, for: .horizontal)
// contentView.addSubview(timeLabel)
bottomLineView = UIView()
bottomLineView.backgroundColor = UIColor(hex: 0xF0F3F7)
......@@ -158,23 +158,22 @@ class YHMessageSessionCell: UITableViewCell {
nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconContentView.snp.right).offset(16)
make.right.equalTo(timeLabel.snp.left).offset(-20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(iconContentView)
make.height.equalTo(21)
}
detailLabel.snp.makeConstraints { make in
make.left.equalTo(nameLabel)
make.right.equalTo(timeLabel)
make.left.right.equalTo(nameLabel)
make.top.equalTo(nameLabel.snp.bottom).offset(2)
make.height.equalTo(17)
}
timeLabel.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-20)
make.top.equalTo(nameLabel)
make.height.equalTo(15)
}
// timeLabel.snp.makeConstraints { make in
// make.right.equalToSuperview().offset(-20)
// make.top.equalTo(nameLabel)
// make.height.equalTo(15)
// }
bottomLineView.snp.makeConstraints { make in
make.left.right.equalTo(detailLabel)
......
......@@ -46,12 +46,21 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
}()
lazy var items: [PersonalModuleItem] = {
#if DEBUG
return [PersonalModuleItem(title: "通知设置".local, type:.notifySettings),
PersonalModuleItem(title: "权限配置".local, type:.permissionSettings),
// PersonalModuleItem(title: "个人信息收集清单".local, type:.infoCollectList),
// PersonalModuleItem(title: "第三方信息共享清单".local, type:.infoShareList),
PersonalModuleItem(title: "关于我们".local, type:.aboutUs),
PersonalModuleItem(title: "设备相关".local, type:.deviceInfo)]
#else
return [PersonalModuleItem(title: "通知设置".local, type:.notifySettings),
PersonalModuleItem(title: "权限配置".local, type:.permissionSettings),
PersonalModuleItem(title: "个人信息收集清单".local, type:.infoCollectList),
PersonalModuleItem(title: "第三方信息共享清单".local, type:.infoShareList),
PersonalModuleItem(title: "关于我们".local, type:.aboutUs)]
#endif
}()
override func viewDidLoad() {
......
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