Commit b61d7014 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '66f23646' into xiezhaolin

parents 4dc91787 66f23646
......@@ -16,8 +16,8 @@
04174D742BCD5B74000BA46D /* IMAppKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D692BCD5B74000BA46D /* IMAppKey.swift */; };
04174D752BCD5B74000BA46D /* YHMessageListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6B2BCD5B74000BA46D /* YHMessageListModel.swift */; };
04174D762BCD5B74000BA46D /* YHMsgListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6C2BCD5B74000BA46D /* YHMsgListModel.swift */; };
04174D772BCD5B74000BA46D /* YHInformationFillVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6E2BCD5B74000BA46D /* YHInformationFillVC.swift */; };
04174D782BCD5B74000BA46D /* YHMsgViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6F2BCD5B74000BA46D /* YHMsgViewController.swift */; };
04174D772BCD5B74000BA46D /* YHMessageDetailListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6E2BCD5B74000BA46D /* YHMessageDetailListVC.swift */; };
04174D782BCD5B74000BA46D /* YHMessageListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D6F2BCD5B74000BA46D /* YHMessageListVC.swift */; };
04174D792BCD5B74000BA46D /* YHMessageSessionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D712BCD5B74000BA46D /* YHMessageSessionCell.swift */; };
04174D7A2BCD5B74000BA46D /* YHInformationFillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04174D722BCD5B74000BA46D /* YHInformationFillCell.swift */; };
0425E63D2BA9345200A5E763 /* YHSchemeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */; };
......@@ -463,8 +463,8 @@
04174D692BCD5B74000BA46D /* IMAppKey.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IMAppKey.swift; sourceTree = "<group>"; };
04174D6B2BCD5B74000BA46D /* YHMessageListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageListModel.swift; sourceTree = "<group>"; };
04174D6C2BCD5B74000BA46D /* YHMsgListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMsgListModel.swift; sourceTree = "<group>"; };
04174D6E2BCD5B74000BA46D /* YHInformationFillVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHInformationFillVC.swift; sourceTree = "<group>"; };
04174D6F2BCD5B74000BA46D /* YHMsgViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMsgViewController.swift; sourceTree = "<group>"; };
04174D6E2BCD5B74000BA46D /* YHMessageDetailListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageDetailListVC.swift; sourceTree = "<group>"; };
04174D6F2BCD5B74000BA46D /* YHMessageListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageListVC.swift; sourceTree = "<group>"; };
04174D712BCD5B74000BA46D /* YHMessageSessionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMessageSessionCell.swift; sourceTree = "<group>"; };
04174D722BCD5B74000BA46D /* YHInformationFillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHInformationFillCell.swift; sourceTree = "<group>"; };
0425E63C2BA9345200A5E763 /* YHSchemeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSchemeTableViewCell.swift; sourceTree = "<group>"; };
......@@ -955,8 +955,8 @@
04174D6D2BCD5B74000BA46D /* C */ = {
isa = PBXGroup;
children = (
04174D6E2BCD5B74000BA46D /* YHInformationFillVC.swift */,
04174D6F2BCD5B74000BA46D /* YHMsgViewController.swift */,
04174D6E2BCD5B74000BA46D /* YHMessageDetailListVC.swift */,
04174D6F2BCD5B74000BA46D /* YHMessageListVC.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -2765,7 +2765,7 @@
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
045EEEC02B9F171A0022A143 /* YHOtherInfoFillViewModel.swift in Sources */,
045EEEF22B9F171A0022A143 /* YHChildBasicInfoVC.swift in Sources */,
04174D772BCD5B74000BA46D /* YHInformationFillVC.swift in Sources */,
04174D772BCD5B74000BA46D /* YHMessageDetailListVC.swift in Sources */,
A592BFEF2B9AB720004C04A9 /* YHWholeScreenTipsView.swift in Sources */,
045EEEF42B9F171A0022A143 /* YHSpouseBasicInfoVC.swift in Sources */,
A5FD63C32B63438A00D1D9DA /* YHContactMainItemStatusModel.swift in Sources */,
......@@ -2811,7 +2811,7 @@
044413F92BC279D200784A14 /* YHHomeWebBottomView.swift in Sources */,
045EEEC32B9F171A0022A143 /* YHOtherResidenceFillView.swift in Sources */,
045EEE792B9F171A0022A143 /* YHPreviewViewModel.swift in Sources */,
04174D782BCD5B74000BA46D /* YHMsgViewController.swift in Sources */,
04174D782BCD5B74000BA46D /* YHMessageListVC.swift in Sources */,
A517A4E12BB573EB000DEECD /* YHDocListCell.swift in Sources */,
A58037212BAD7B2A0031C312 /* YHMySchemeModel.swift in Sources */,
0493B3DE2BA80C2300AF9393 /* YHCertificateFilterButton.swift in Sources */,
......
......@@ -123,30 +123,10 @@ extension AppDelegate {
//1.设置主窗口
private func setupRootVC() {
let tabBarController = YHTabBarViewController()
let homeVC = YHHomePageViewController()
tabBarController.delegate = homeVC
let v0 = YHNavigationController(rootVC:homeVC)
let v1 = YHNavigationController(rootVC:YHServiceCenterMainViewController())
let v2 = YHNavigationController(rootVC:YHMsgViewController())
let v3 = YHNavigationController(rootVC:YHMyViewController())
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
v1.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "服务", image: UIImage(named: "service"), selectedImage: UIImage(named: "service_1"))
v2.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "消息", image: UIImage(named: "msg"), selectedImage: UIImage(named: "msg_1"))
v3.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "我的", image: UIImage(named: "me"), selectedImage: UIImage(named: "me_1"))
tabBarController.viewControllers = [v0,v1,v2,v3]
tabBarController.tabBar.backgroundColor = .white
let nav = YHNavigationController(rootVC:YHStartPageViewController())
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = YHStartPageViewController()
window?.rootViewController = nav
window?.makeKeyAndVisible()
}
}
......
......@@ -105,6 +105,10 @@ private extension YHHomePageViewController {
gk_navigationBar.isHidden = true
view.backgroundColor = .white
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
view.addSubview(searchView)
searchView.snp.makeConstraints { make in
make.top.equalTo(k_Height_safeAreaInsetsTop() + 6)
......@@ -140,6 +144,15 @@ private extension YHHomePageViewController {
@objc func homepageRefresh() {
loadFirstData()
}
@objc func loginSuccess() {
getData()
}
@objc func logoutSuccess() {
getData()
}
}
extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDataSource {
......
......@@ -123,7 +123,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
make.bottom.left.right.equalToSuperview()
make.height.equalTo(59 + k_Height_safeAreaInsetsBottom())
}
getData()
if id == 0 {
if self.url.contains("?id=") {
......@@ -131,6 +130,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
if list.count == 2 {
if let iddd = list[1].int {
id = iddd
getData()
return
}
}
......@@ -138,6 +138,10 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
bottomView.isHidden = true
webview.frame = CGRect(x: 0, y: statusHeight + navHeight!, width: self.view.frame.width, height: self.view.frame.height - statusHeight - navHeight!)
}
getData()
}
deinit {
......
......@@ -202,8 +202,14 @@ class YHSearchInfomationVC: YHBaseViewController {
searchHistoryView.isHidden = true
self.tableView.reloadData()
tableView.es.stopPullToRefresh()
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
}
}
}
}
......@@ -221,8 +227,14 @@ class YHSearchInfomationVC: YHBaseViewController {
searchHistoryView.isHidden = true
self.tableView.reloadData()
tableView.es.stopLoadingMore()
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
}
}
}
}
......@@ -241,8 +253,14 @@ class YHSearchInfomationVC: YHBaseViewController {
searchHistoryView.isHidden = true
self.tableView.reloadData()
tableView.es.stopPullToRefresh()
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
// 只有一页的时候不展示没有更多数据了
if self.viewModel.totalCount < self.viewModel.searchPageSize { // 不足一页
tableView.footer?.isHidden = true
} else {
tableView.footer?.isHidden = false
if self.viewModel.hasMoreForHomeNews == false {
tableView.es.noticeNoMoreData()
}
}
}
}
......
......@@ -102,7 +102,7 @@ private extension YHStartPageViewController {
tabBarController.delegate = homeVC
let v0 = YHNavigationController(rootVC:homeVC)
let v1 = YHNavigationController(rootVC:YHServiceCenterMainViewController())
let v2 = YHNavigationController(rootVC:YHMsgViewController())
let v2 = YHNavigationController(rootVC:YHMessageListVC())
let v3 = YHNavigationController(rootVC:YHMyViewController())
v0.tabBarItem = ESTabBarItem.init(YHBasicContentView(),title: "首页", image: UIImage(named: "home"), selectedImage: UIImage(named: "home_1"))
......
......@@ -50,7 +50,7 @@ class YHHomeWebBottomView: UIView {
likeButton = {
let button = YHHomeWebBottomButton()
button.setContent("home_web_like", "652")
button.setContent("home_web_like", "0")
button.addTarget(self, action: #selector(likeBtnClick), for: .touchUpInside)
return button
}()
......@@ -64,7 +64,7 @@ class YHHomeWebBottomView: UIView {
starButton = {
let button = YHHomeWebBottomButton()
button.setContent("home_web_star", "34")
button.setContent("home_web_star", "0")
button.addTarget(self, action: #selector(starBtnClick), for: .touchUpInside)
return button
}()
......@@ -78,6 +78,12 @@ class YHHomeWebBottomView: UIView {
}
@objc private func likeBtnClick() {
if YHLoginManager.shared.isLogin() == false {
if let block = likeBlock {
block(isLike)
}
return
}
isLike = !isLike
if let block = likeBlock {
block(isLike)
......@@ -85,6 +91,13 @@ class YHHomeWebBottomView: UIView {
}
@objc private func starBtnClick() {
if YHLoginManager.shared.isLogin() == false {
if let block = starBlock {
block(isStar)
}
return
}
isStar = !isStar
if let block = starBlock {
block(isStar)
......
......@@ -81,8 +81,8 @@ class YHSearchInfoHistoryView: UIView {
func getwith(font: UIFont, height: CGFloat, string: String) -> CGSize {
let size = CGSize.init(width: CGFloat(MAXFLOAT), height: height)
let dic = [NSAttributedString.Key.font: font] // swift 4.2
let strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return strSize
var strSize = string.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
return CGSizeMake(ceil(strSize.width), strSize.height)
}
}
......@@ -99,8 +99,8 @@ extension YHSearchInfoHistoryView: UICollectionViewDelegate, UICollectionViewDat
let size = self.getwith(font: UIFont.systemFont(ofSize: 12), height: 24, string: historyItems[indexPath.item])
var width = size.width + gap*2.0
if width > collectionView.width {
width = collectionView.width
if width > 226.0 {
width = 226.0
}
return CGSize(width: width, height: cellHeight)
}
......
......@@ -18,8 +18,10 @@ class YHHomePageViewModel : YHBaseViewModel {
//首页相关参数
private var curPageIndex : Int = 1
private var page_Size : Int = 6
private var totalCount : Int = 0
var totalCount : Int = 0
var hasMoreForHomeNews : Bool = true
// 搜索
let searchPageSize: Int = 10
}
//接口
......@@ -261,11 +263,11 @@ extension YHHomePageViewModel {
if isFirstPage {
params = ["page": 1,
"page_size": 10,
"page_size": searchPageSize,
"title": title]
} else {
params = ["page": curPageIndex + 1,
"page_size": 10,
"page_size": searchPageSize,
"title": title]
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article
......
......@@ -8,7 +8,7 @@
import UIKit
class YHInformationFillVC: YHBaseViewController {
class YHMessageDetailListVC: YHBaseViewController {
var type:Int = -1
var msgArr:[YHDetailMessageModel] = []
......@@ -32,7 +32,7 @@ class YHInformationFillVC: YHBaseViewController {
[weak self] in
guard let self = self else { return }
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
self.markAllMsgsRead()
}
}
return bar
......@@ -40,7 +40,7 @@ class YHInformationFillVC: YHBaseViewController {
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.sectionHeaderHeight = 46.0
tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
......@@ -91,17 +91,38 @@ class YHInformationFillVC: YHBaseViewController {
self.tableView.reloadData()
}
}
func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中..."))
self.viewModel.readMessages(type:self.type, msgIds:nil, isAllRead:true) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
YHHUD.flash(message: "清除成功")
for item in self.msgArr {
item.isRead = true
}
self.tableView.reloadData()
return
}
if let error = error {
var msg = "清除失败"
if error.errorMsg.count > 0 {
msg = error.errorMsg
}
YHHUD.flash(message: msg)
return
}
}
}
}
extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return msgArr.count
}
extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
return msgArr.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
......@@ -119,7 +140,7 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 46.0
return 1.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
......@@ -132,18 +153,8 @@ extension YHInformationFillVC: UITableViewDelegate, UITableViewDataSource {
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
let label = UILabel()
label.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:12)
label.text = "2023-09-13"
view.addSubview(label)
label.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
return view
return UIView()
}
}
......
......@@ -8,7 +8,7 @@
import UIKit
class YHMsgViewController: YHBaseViewController {
class YHMessageListVC: YHBaseViewController {
var msgArr:[YHMessageInfoModel] = []
lazy var viewModel = {
......@@ -46,10 +46,12 @@ class YHMsgViewController: YHBaseViewController {
bar.rightBtnClick = {
[weak self] in
guard let self = self else { return }
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
let vc = YHInformationFillVC()
vc.type = 1
self.navigationController?.pushViewController(vc)
bar.rightBtnClick = {
[weak self] in
guard let self = self else { return }
YHCommonAlertView.show("清除未读", "确定要清除所有未读提示吗?", "取消", "确认") {
self.markAllMsgsRead()
}
}
}
return bar
......@@ -141,20 +143,51 @@ class YHMsgViewController: YHBaseViewController {
}
}
}
func markAllMsgsRead() {
YHHUD.show(.progress(message: "清除中..."))
self.viewModel.readMessages(type:nil, msgIds:nil, isAllRead:true) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
YHHUD.flash(message: "清除成功")
for item in self.msgArr {
item.unreadCount = 0
}
self.tableView.reloadData()
return
}
if let error = error {
var msg = "清除失败"
if error.errorMsg.count > 0 {
msg = error.errorMsg
}
YHHUD.flash(message: msg)
return
}
}
}
}
extension YHMsgViewController {
extension YHMessageListVC {
@objc func clean() {
@objc func didEnableNotifyBtnClicked() {
self.goToSettingPage()
}
@objc func didEnableNotifyBtnClicked() {
func goToSettingPage() {
let url = URL(string: UIApplication.openSettingsURLString)
if let url = url, UIApplication .shared.canOpenURL(url) {
UIApplication .shared.open(url, options: [:], completionHandler: {
(success) in
})
}
}
}
extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return msgArr.count
......@@ -176,9 +209,9 @@ extension YHMsgViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 < indexPath.row && indexPath.row < msgArr.count {
if 0 <= indexPath.row && indexPath.row < msgArr.count {
let msgItem = msgArr[indexPath.row]
let vc = YHInformationFillVC()
let vc = YHMessageDetailListVC()
vc.type = msgItem.type
self.navigationController?.pushViewController(vc)
}
......
......@@ -20,6 +20,7 @@ class YHInformationFillCell: UITableViewCell {
var unreadPointView:UIView!
var bottomBtn:UIButton!
var lineView:UIView!
var timeLabel:UILabel!
required init?(coder: NSCoder) {
super.init(coder: coder)
......@@ -30,10 +31,49 @@ class YHInformationFillCell: UITableViewCell {
setupUI()
}
func updateModel(_ model: YHDetailMessageModel) {
titleLabel.text = model.title
detailLabel.text = model.content
unreadPointView.isHidden = model.isRead
timeLabel.text = formatTimestamp(Double(model.time))
}
func formatTimestamp(_ timestamp: TimeInterval) -> String {
let currentDate = Date()
let calendar = Calendar.current
let currentYear = calendar.component(.year, from: currentDate)
let currentDay = calendar.component(.day, from: currentDate)
let date = Date(timeIntervalSince1970: timestamp)
let year = calendar.component(.year, from: date)
let day = calendar.component(.day, from: date)
let dateFormatter = DateFormatter()
if year == currentYear {
if day == currentDay {
dateFormatter.dateFormat = "HH:mm"
} else {
dateFormatter.dateFormat = "MM-dd"
}
} else {
dateFormatter.dateFormat = "yyyy-MM-dd"
}
return dateFormatter.string(from: date)
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = UIColor(hex:0xF8F8F8)
timeLabel = UILabel()
timeLabel.textColor = UIColor(hex: 0x121A26, alpha: 0.3)
timeLabel.textAlignment = .center
timeLabel.font = UIFont.PFSC_R(ofSize:12)
timeLabel.text = "2023-09-13"
contentView.addSubview(timeLabel)
whiteView = UIView()
whiteView.backgroundColor = .white
......@@ -71,10 +111,16 @@ class YHInformationFillCell: UITableViewCell {
bottomBtn.addTarget(self, action: #selector(didBottomBtnClicked), for: .touchUpInside)
whiteView.addSubview(bottomBtn)
timeLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(46.0)
}
whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.bottom.equalToSuperview()
make.top.equalTo(timeLabel.snp.bottom)
make.bottom.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
......
......@@ -34,15 +34,19 @@ class YHMessageSessionCell: UITableViewCell {
if model.customType == .infoFill {
self.nameLabel.text = "资料填写"
self.iconImgView.image = UIImage(named: "msg_icon_info_fill")
} else if model.customType == .cerUpload {
self.nameLabel.text = "证件上传"
self.iconImgView.image = UIImage(named: "msg_icon_cer_upload")
} else if model.customType == .draft {
self.nameLabel.text = "文书定稿"
self.iconImgView.image = UIImage(named: "msg_icon_draft")
} else if model.customType == .fileSign {
self.nameLabel.text = "文件签字"
self.iconImgView.image = UIImage(named: "msg_icon_file_sign")
} else {
self.nameLabel.text = ""
......@@ -103,7 +107,6 @@ class YHMessageSessionCell: UITableViewCell {
contentView.addSubview(iconContentView)
iconImgView = UIImageView()
iconImgView.backgroundColor = .red
iconContentView.addSubview(iconImgView)
badgeLabel = UILabel()
......@@ -183,5 +186,4 @@ class YHMessageSessionCell: UITableViewCell {
make.bottom.equalToSuperview()
}
}
}
......@@ -21,34 +21,34 @@ class YHMsgViewModel: NSObject {
var dic = json.data
var json = json
json.code = 200
dic = [
"information": [
"unread_count": 0,
"last_message": "阿法守法所发生的法师打发",
"last_message_time": 1586507545,
"type": 0
],
"certificate": [
"unread_count": 3,
"last_message": "发生发顺丰大声道发生大发萨法沙发沙发沙发沙发阿斯顿发生发顺丰阿凡达放大第三方",
"last_message_time": 1586507545,
"type": 0
],
"draft": [
"unread_count": 100,
"last_message": "发生发顺丰大声道发生大发",
"last_message_time": 1712737945,
"type": 0
],
"signature": [
"unread_count": 87,
"last_message": "发生发",
"last_message_time": 1713236425,
"type": 0
]
]
// var json = json
// json.code = 200
// dic = [
// "information": [
// "unread_count": 0,
// "last_message": "阿法守法所发生的法师打发",
// "last_message_time": 1586507545,
// "type": 0
// ],
// "certificate": [
// "unread_count": 3,
// "last_message": "发生发顺丰大声道发生大发萨法沙发沙发沙发沙发阿斯顿发生发顺丰阿凡达放大第三方",
// "last_message_time": 1586507545,
// "type": 0
// ],
// "draft": [
// "unread_count": 100,
// "last_message": "发生发顺丰大声道发生大发",
// "last_message_time": 1712737945,
// "type": 0
// ],
// "signature": [
// "unread_count": 87,
// "last_message": "发生发",
// "last_message_time": 1713236425,
// "type": 0
// ]
// ]
printLog("model 是 ==> \(json)")
if json.code == 200 {
......@@ -108,12 +108,23 @@ class YHMsgViewModel: NSObject {
}
}
func readMessages(type:Int, msgIds:[Int], _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
func readMessages(type:Int?, msgIds:[Int]?, isAllRead:Bool?, _ callBackBlock:@escaping (_ success: Bool, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Message.readMsg
let params:[String : Any] = ["type": type,
"ids": msgIds]
var params:[String : Any] = [:]
if let type = type {
params["type"] = type
}
if let msgIds = msgIds, msgIds.count > 0 {
params["ids"] = msgIds
}
if let isAllRead = isAllRead {
params["all_read"] = isAllRead
}
printLog("params 是 ==> \(params)")
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { json, code in
let dic = json.data
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Frame 1@2x.png",
"filename" : "Group 2033194158@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 1@3x.png",
"filename" : "Group 2033194158@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Message_zhengjian@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Message_zhengjian@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-wenshuqingdan@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-wenshuqingdan@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-wenshuqingdan@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-wenshuqingdan@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group 2033194489@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group 2033194489@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "超级app启动页占位图.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "启动页@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "启动页@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
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