杨锴
2024-08-20 ace001e14dcd4b5a230d6a3f677a6cd43fa7bc9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
//  NoticeCenterVC.swift
//  XQMuse
//
//  Created by 无故事王国 on 2024/8/20.
//
 
import UIKit
 
class NoticeCenterVC: BaseVC {
 
                private var tableView:UITableView!
 
    override func viewDidLoad() {
        super.viewDidLoad()
                                title = "消息通知"
 
    }
 
                override func setUI() {
                                super.setUI()
                                view.backgroundColor = UIColor(hexString: "#fafafa")
 
                                tableView = UITableView(frame: .zero, style: .plain)
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.backgroundColor = .clear
                                tableView.separatorStyle = .none
                                tableView.register(UINib(nibName: "MessageTCell", bundle: nil), forCellReuseIdentifier: "_MessageTCell")
                                view.addSubview(tableView)
                                tableView.snp.makeConstraints { make in
                                                make.left.right.bottom.equalToSuperview()
                                                make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(9)
                                }
                }
}
 
extension NoticeCenterVC:UITableViewDelegate & UITableViewDataSource{
 
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                if indexPath.row == 0{
                                                let vc = NoticeCenterSysDetailVC()
                                                push(vc: vc)
                                }
 
                                if indexPath.row == 1{
                                                let vc = NoticeCenterUserRepeaceDetailVC()
                                                push(vc: vc)
                                }
                }
 
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_MessageTCell", for: indexPath) as! MessageTCell
                                cell.backgroundColor = .clear
                                return cell
                }
 
                func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
                                94.5
                }
 
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return 10
                }
 
 
}