Commit 623bcb8d authored by Steven杜宇's avatar Steven杜宇

// 消息UI

parent 6fec4f66
...@@ -14,28 +14,41 @@ class YHGalaxyNewsListViewController: YHBaseViewController { ...@@ -14,28 +14,41 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame: .zero, style: .grouped) let tableView = UITableView(frame: .zero, style: .grouped)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
tableView.estimatedSectionHeaderHeight = 1.0 tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0 tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = .white tableView.backgroundColor = .clear
tableView.backgroundView = emptyDataTipsView
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHGalaxyNewsCell.self, forCellReuseIdentifier: YHGalaxyNewsCell.cellReuseIdentifier) tableView.register(YHGalaxyNewsCell.self, forCellReuseIdentifier: YHGalaxyNewsCell.cellReuseIdentifier)
return tableView return tableView
}() }()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无消息", kEmptyMessageBgName)
let topMargin = 310-k_Height_NavigationtBarAndStatuBar
view.topMargin = topMargin
view.isHidden = true
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navTitle = "银河资讯" gk_navTitle = "银河资讯"
view.backgroundColor = .init(hex: 0xF8F9FB) gk_navigationBar.backgroundColor = .white
let rightButtonItem = UIBarButtonItem(image: UIImage(named: "msg_clean")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(didCleanBtnClicked)) let rightButtonItem = UIBarButtonItem(image: UIImage(named: "msg_clean")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(didCleanBtnClicked))
gk_navRightBarButtonItem = rightButtonItem gk_navRightBarButtonItem = rightButtonItem
gk_navItemRightSpace = 16 gk_navItemRightSpace = 16
view.backgroundColor = .init(hex: 0xF8F9FB)
view.addSubview(tableView) view.addSubview(tableView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
...@@ -46,6 +59,9 @@ class YHGalaxyNewsListViewController: YHBaseViewController { ...@@ -46,6 +59,9 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
@objc func didCleanBtnClicked() { @objc func didCleanBtnClicked() {
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
}
} }
} }
...@@ -73,4 +89,22 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo ...@@ -73,4 +89,22 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
} }
...@@ -177,7 +177,7 @@ class YHMessageDetailListVC: YHBaseViewController { ...@@ -177,7 +177,7 @@ class YHMessageDetailListVC: YHBaseViewController {
lazy var emptyDataTipsView: YHEmptyDataView = { lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("暂无消息", kEmptyMessageBgName) let view = YHEmptyDataView.createView("暂无消息", kEmptyMessageBgName)
let topMargin = 310-k_Height_NavigationtBarAndStatuBar let topMargin = 222.0
view.topMargin = topMargin view.topMargin = topMargin
view.isHidden = true view.isHidden = true
return view return view
......
...@@ -31,7 +31,13 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -31,7 +31,13 @@ class YHGalaxyNewsCell: UITableViewCell {
lazy var coverImgV: UIImageView = { lazy var coverImgV: UIImageView = {
let imgV = UIImageView() let imgV = UIImageView()
imgV.backgroundColor = .green imgV.image = UIImage(named: "msg_news_cover_default")
return imgV
}()
lazy var playImgV: UIImageView = {
let imgV = UIImageView()
imgV.image = UIImage(named: "msg_news_video_play")
return imgV return imgV
}() }()
...@@ -50,7 +56,7 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -50,7 +56,7 @@ class YHGalaxyNewsCell: UITableViewCell {
label.textAlignment = .left label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize: 12) label.font = UIFont.PFSC_R(ofSize: 12)
label.numberOfLines = 0 label.numberOfLines = 0
label.text = "这是描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述" label.text = "这是描述"
return label return label
}() }()
...@@ -74,9 +80,13 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -74,9 +80,13 @@ class YHGalaxyNewsCell: UITableViewCell {
func setupUI() { func setupUI() {
self.selectionStyle = .none self.selectionStyle = .none
self.backgroundColor = .clear
contentView.backgroundColor = .clear
contentView.addSubview(timeLabel) contentView.addSubview(timeLabel)
contentView.addSubview(whiteContentView) contentView.addSubview(whiteContentView)
whiteContentView.addSubview(coverImgV) whiteContentView.addSubview(coverImgV)
coverImgV.addSubview(playImgV)
whiteContentView.addSubview(titleLabel) whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(descLabel) whiteContentView.addSubview(descLabel)
whiteContentView.addSubview(redPointView) whiteContentView.addSubview(redPointView)
...@@ -99,6 +109,11 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -99,6 +109,11 @@ class YHGalaxyNewsCell: UITableViewCell {
make.height.equalTo(146) make.height.equalTo(146)
} }
playImgV.snp.makeConstraints { make in
make.width.height.equalTo(42)
make.center.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.equalTo(16) make.left.equalTo(16)
make.top.equalTo(coverImgV.snp.bottom).offset(16) make.top.equalTo(coverImgV.snp.bottom).offset(16)
...@@ -118,9 +133,6 @@ class YHGalaxyNewsCell: UITableViewCell { ...@@ -118,9 +133,6 @@ class YHGalaxyNewsCell: UITableViewCell {
make.height.lessThanOrEqualTo(34.0) make.height.lessThanOrEqualTo(34.0)
make.top.equalTo(titleLabel.snp.bottom).offset(4) make.top.equalTo(titleLabel.snp.bottom).offset(4)
} }
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033197585@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033197585@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "点击播放icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "点击播放icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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