Commit 3adbc068 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '1f48574e' into xiezhaolin

parents 0866b758 1f48574e
...@@ -2122,8 +2122,6 @@ ...@@ -2122,8 +2122,6 @@
044414022BC39B8D00784A14 /* YHServerTableHeadView.swift */, 044414022BC39B8D00784A14 /* YHServerTableHeadView.swift */,
049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */, 049AC4C52BC3E55300F857F4 /* YHServiceSectionView.swift */,
044414042BC3B9DE00784A14 /* YHServiceTableFootView.swift */, 044414042BC3B9DE00784A14 /* YHServiceTableFootView.swift */,
044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */,
044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */,
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */, 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */,
049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */, 049AC4C72BC513AB00F857F4 /* YHOrderListView.swift */,
049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */, 049AC4C92BC5141600F857F4 /* YHServerNoOrderView.swift */,
...@@ -2220,6 +2218,8 @@ ...@@ -2220,6 +2218,8 @@
A5F9AD322BC3CD66000323F8 /* YHHkLifeAndIdItemView.swift */, A5F9AD322BC3CD66000323F8 /* YHHkLifeAndIdItemView.swift */,
A53F42BA2BC3DE6F009CAC70 /* YHHomeKingKongBlockItem.swift */, A53F42BA2BC3DE6F009CAC70 /* YHHomeKingKongBlockItem.swift */,
A50A747B2BC8EC86003D28D9 /* YHHomeBannerCollectionViewCell.swift */, A50A747B2BC8EC86003D28D9 /* YHHomeBannerCollectionViewCell.swift */,
044414062BC3C54B00784A14 /* YHHomeCollectionViewCell.swift */,
044414082BC3CE8500784A14 /* YHHomeCollectionLayout.swift */,
A50A747D2BC91308003D28D9 /* YHHomeBannerIndicatorView.swift */, A50A747D2BC91308003D28D9 /* YHHomeBannerIndicatorView.swift */,
); );
path = V; path = V;
......
...@@ -28,7 +28,7 @@ class YHHomeCollectionViewCell: UICollectionViewCell { ...@@ -28,7 +28,7 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
} }
lazy var titleImageView:UIImageView = { lazy var titleImageView:UIImageView = {
let imageV = UIImageView(image: UIImage(named: "home_title_image")) let imageV = UIImageView(image: UIImage(named: "home_banner_default_icon"))
imageV.contentMode = .scaleAspectFill imageV.contentMode = .scaleAspectFill
return imageV return imageV
}() }()
...@@ -172,7 +172,7 @@ extension YHHomeCollectionViewCell { ...@@ -172,7 +172,7 @@ extension YHHomeCollectionViewCell {
if let url = URL(string: listModel.img_url) { if let url = URL(string: listModel.img_url) {
titleImageView.kf.setImage(with: url) titleImageView.kf.setImage(with: url)
} }
descripeLable.text = listModel.title.defaultStringIfEmpty(detaultValue: "***") descripeLable.text = listModel.title.defaultStringIfEmpty(detaultValue: "银河世纪")
descripeLable.snp.removeConstraints() descripeLable.snp.removeConstraints()
descripeLable.snp.remakeConstraints { make in descripeLable.snp.remakeConstraints { make in
make.top.equalToSuperview().offset(10) make.top.equalToSuperview().offset(10)
......
...@@ -10,6 +10,7 @@ import UIKit ...@@ -10,6 +10,7 @@ import UIKit
class YHInformationFillVC: YHBaseViewController { class YHInformationFillVC: YHBaseViewController {
var type:Int = -1
var msgArr:[YHDetailMessageModel] = [] var msgArr:[YHDetailMessageModel] = []
lazy var viewModel = { lazy var viewModel = {
...@@ -81,7 +82,7 @@ class YHInformationFillVC: YHBaseViewController { ...@@ -81,7 +82,7 @@ class YHInformationFillVC: YHBaseViewController {
func getMsgList() { func getMsgList() {
YHHUD.show(.progress(message: "加载中...")) YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getMsgDetailList { self.viewModel.getMsgDetailList(type: self.type) {
[weak self] success, error in [weak self] success, error in
YHHUD.hide() YHHUD.hide()
guard let self = self else { return } guard let self = self else { return }
......
...@@ -48,6 +48,7 @@ class YHMsgViewController: YHBaseViewController { ...@@ -48,6 +48,7 @@ class YHMsgViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") { YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
let vc = YHInformationFillVC() let vc = YHInformationFillVC()
vc.type = 1
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
...@@ -175,8 +176,12 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -175,8 +176,12 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHInformationFillVC() if 0 < indexPath.row && indexPath.row < msgArr.count {
self.navigationController?.pushViewController(vc) let msgItem = msgArr[indexPath.row]
let vc = YHInformationFillVC()
vc.type = msgItem.type
self.navigationController?.pushViewController(vc)
}
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
......
...@@ -43,9 +43,10 @@ class YHMsgViewModel: NSObject { ...@@ -43,9 +43,10 @@ class YHMsgViewModel: NSObject {
} }
} }
func getMsgDetailList(_ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) { func getMsgDetailList(type:Int, _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.msgDetaiList let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.msgDetaiList
let _ = YHNetRequest.getRequest(url: strUrl) { json, code in let params = ["type": type]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
let dic = json.data let dic = json.data
printLog("model 是 ==> \(json)") printLog("model 是 ==> \(json)")
...@@ -76,4 +77,29 @@ class YHMsgViewModel: NSObject { ...@@ -76,4 +77,29 @@ class YHMsgViewModel: NSObject {
callBackBlock(false, error) callBackBlock(false, error)
} }
} }
func readMessages(type:Int, msgIds:[Int], _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.readMsg
let params:[String : Any] = ["type": type,
"ids": msgIds]
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
let dic = json.data
printLog("model 是 ==> \(json)")
if json.code == 200 {
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { error in
self.msgList = nil
callBackBlock(false, error)
}
}
} }
...@@ -261,5 +261,7 @@ class YHAllApiName { ...@@ -261,5 +261,7 @@ class YHAllApiName {
static let unreadMsgList = "infoflow/unread-message" static let unreadMsgList = "infoflow/unread-message"
// 具体业务消息列表 // 具体业务消息列表
static let msgDetaiList = "infoflow/message/list" static let msgDetaiList = "infoflow/message/list"
// 标记消息已读
static let readMsg = "infoflow/read-push"
} }
} }
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "a1ee8b3bd2c4f4969fd48d8db3c66fd 93@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "fa969293-cb4c-490e-b597-3345266ff912 54@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fa969293-cb4c-490e-b597-3345266ff912 54@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