Commit 94bd366b authored by Steven杜宇's avatar Steven杜宇

// 推送

parent 8259c128
......@@ -10,7 +10,7 @@ import UIKit
class YHGalaxyNewsListViewController: YHBaseViewController {
let type: Int = 10
let type: Int = YHMessageType.article.rawValue
var newsArr: [YHNewsModel] = []
var currentPage = 1
var isLastPage = false
......@@ -127,11 +127,10 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
}
}
func markRead(model: YHNewsModel) {
func markRead(_ model: YHNewsModel) {
if let id = Int(model.id) {
self.viewModel.readMessages(type: self.type, msgIds: [id], isAllRead: false) {
[weak self] success, _ in
self.viewModel.readMessages(type: self.type, msgIds: [id], isAllRead: false) { [weak self] success, _ in
guard let self = self else { return }
if success {
for msgItem in newsArr {
......@@ -150,20 +149,20 @@ class YHGalaxyNewsListViewController: YHBaseViewController {
static func enterDetail(_ item: YHNewsModel) {
if item.news_type == 2 { // 图文
let vc = YHHomeWebViewController()
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(item.id)"
vc.id = Int(item.id) ?? 0
vc.url = YHBaseUrlManager.shared.curH5URL() + "articleDetail.html" + "?id=\(item.article_id)"
vc.id = item.article_id
UIViewController.current?.navigationController?.pushViewController(vc)
return
} else if item.news_type == 1 { // 视频
if !item.media_url.isEmpty, let url = URL(string: item.media_url) {
if !item.media_url.isEmpty, let _ = URL(string: item.media_url) {
let vc = YHVideoPlayerVC()
if !item.media_transcode_url.isEmpty {
vc.url = item.media_transcode_url
} else {
vc.url = item.media_url
}
vc.id = Int(item.id) ?? 0
vc.id = item.article_id
UIViewController.current?.navigationController?.pushViewController(vc)
}
return
......@@ -201,7 +200,7 @@ extension YHGalaxyNewsListViewController: UITableViewDelegate, UITableViewDataSo
if 0 <= indexPath.row && indexPath.row < newsArr.count {
let item = newsArr[indexPath.row]
Self.enterDetail(item)
self.markRead(item)
}
}
......
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