Commit 0aefdf04 authored by David黄金龙's avatar David黄金龙

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

* 'youhua-dev' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  解决刷新混乱问题
  //  消息新增类型和点击事件
parents 6234381c a011d8ce
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
import UIKit import UIKit
import SafariServices
class YHMessageDetailListVC: YHBaseViewController { class YHMessageDetailListVC: YHBaseViewController {
...@@ -196,8 +197,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -196,8 +197,7 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHDetailMessageCell.cellReuseIdentifier, for: indexPath) as! YHDetailMessageCell let cell = tableView.dequeueReusableCell(withIdentifier: YHDetailMessageCell.cellReuseIdentifier, for: indexPath) as! YHDetailMessageCell
if 0 <= indexPath.row && indexPath.row < msgArr.count { if 0 <= indexPath.row && indexPath.row < msgArr.count {
let item = msgArr[indexPath.row] let item = msgArr[indexPath.row]
cell.updateModel(item) cell.updateModel(item, type:self.type)
cell.updateBottomBtn(type: self.type)
} }
return cell return cell
} }
...@@ -252,6 +252,17 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource { ...@@ -252,6 +252,17 @@ extension YHMessageDetailListVC: UITableViewDelegate, UITableViewDataSource {
} }
} else if self.type == YHMessageType.infoSubmit.rawValue { // 资料递交 } else if self.type == YHMessageType.infoSubmit.rawValue { // 资料递交
if !item.url.isEmpty {
if let url = URL(string: item.url) {
let safariViewController = SFSafariViewController(url: url)
safariViewController.dismissButtonStyle = .close
safariViewController.modalPresentationStyle = .fullScreen
present(safariViewController, animated: true, completion: nil)
} else {
YHHUD.flash(message: "url无效")
}
return
}
self.navigationController?.popToRootViewController(animated: false) self.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .service) goTabBarBy(tabType: .service)
} }
......
...@@ -84,13 +84,14 @@ class YHDetailMessageModel: SmartCodable { ...@@ -84,13 +84,14 @@ class YHDetailMessageModel: SmartCodable {
var time: Int = 0 var time: Int = 0
var isRead: Bool = false var isRead: Bool = false
var orderId: String = "" var orderId: String = ""
var url: String = ""
required init() { required init() {
} }
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case id, title, content, time case id, title, content, time, url
case isRead = "is_read" case isRead = "is_read"
case orderId = "order_id" case orderId = "order_id"
} }
......
...@@ -32,15 +32,13 @@ class YHDetailMessageCell: UITableViewCell { ...@@ -32,15 +32,13 @@ class YHDetailMessageCell: UITableViewCell {
setupUI() setupUI()
} }
func updateModel(_ model: YHDetailMessageModel) { func updateModel(_ model: YHDetailMessageModel, type:Int) {
self.model = model self.model = model
titleLabel.text = model.title titleLabel.text = model.title
detailLabel.text = model.content detailLabel.text = model.content
unreadPointView.isHidden = model.isRead unreadPointView.isHidden = model.isRead
timeLabel.text = formatTimestamp(Double(model.time)) timeLabel.text = formatTimestamp(Double(model.time))
}
func updateBottomBtn(type:Int) {
if type == YHMessageType.infoFill.rawValue { if type == YHMessageType.infoFill.rawValue {
bottomBtn.setTitle("去填写".local, for: .normal) bottomBtn.setTitle("去填写".local, for: .normal)
...@@ -55,8 +53,12 @@ class YHDetailMessageCell: UITableViewCell { ...@@ -55,8 +53,12 @@ class YHDetailMessageCell: UITableViewCell {
} else if type == YHMessageType.infoSubmit.rawValue { } else if type == YHMessageType.infoSubmit.rawValue {
bottomBtn.setTitle("去查看".local, for: .normal) bottomBtn.setTitle("去查看".local, for: .normal)
if !model.url.isEmpty {
bottomBtn.setTitle("去签字".local, for: .normal)
}
} }
} }
func formatTimestamp(_ timestamp: TimeInterval) -> String { func formatTimestamp(_ timestamp: TimeInterval) -> String {
let currentDate = Date() let currentDate = Date()
......
...@@ -29,11 +29,11 @@ class YHMyLikeViewController: YHBaseViewController { ...@@ -29,11 +29,11 @@ class YHMyLikeViewController: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setupUI() setupUI()
loadData()
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
loadData()
} }
} }
......
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