| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //
- // MessageDetailViewController.swift
- // MTP2_iOS
- //
- // Created by Muchinfo on 2020/10/30.
- // Copyright © 2020 Muchinfo. All rights reserved.
- //
- import UIKit
- import SwiftyAttributes
- /// 公告详情视图容器控制类
- class MessageDetailViewController: BaseViewController {
- // MARK: - 属性列表
- /// 发布日期
- @IBOutlet weak var date: UILabel!
- /// 发布标题
- @IBOutlet weak var text: UILabel!
- /// 详情
- @IBOutlet weak var textView: UITextView!
-
- // MARK: - 生命周期相关
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- /// 异常
- guard let obj = takeInfo as? MoNotice else { return }
- /// 发布日期
- self.date.text = obj.createtime.getTDateString()
- /// 发布标题
- self.text.text = obj.title
- /// 详情
- let style: NSMutableParagraphStyle = NSMutableParagraphStyle()
- style.lineHeightMultiple = 1.5
- let attribute = obj.content.withFont(.font_14).withParagraphStyle(style).withTextColor(.hex333())
- self.textView.attributedText = attribute
-
- /// 设置公告已读
- requestNoticeReaded()
- }
-
- // MARK: - 接口请求
- /// 设置公告已读
- fileprivate func requestNoticeReaded() {
- /// 异常
- guard let commonManager = MTP2BusinessCore.shared.commonManager, let obj = takeInfo as? MoNotice else { return }
- /// 设置公告已读消息
- commonManager.requestNoticeReaded(noticeID: obj.autoid, callback: { (_, _) in })
- }
- }
|