CNLiveMineBindingManagerController.swift
2.85 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// CNLiveMineBindingManagerController.swift
// metaCode
//
// Created by zx on 2024/4/26.
//
import Foundation
import SnapKit
class CNLiveMineBindingManagerController:CNLiveBaseViewController, UITableViewDataSource, UITableViewDelegate{
let kCNBindingManageCellIdentifier = "kCNBindingManageCellIdentifier"
lazy var tableView : UITableView = {
let tableView = UITableView(frame: .zero, style: .plain)
tableView.dataSource = self
tableView.delegate = self
tableView.separatorStyle = .none
tableView.register(CNBindingManageCell.self, forCellReuseIdentifier: kCNBindingManageCellIdentifier)
tableView.backgroundColor = HexColor("#f4f4f4")
return tableView
}()
///数据源
lazy var unBindingData: NSMutableArray = {
var dataArray = NSMutableArray()
return dataArray
}()
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex)
navigationBarHidden = false
titleName = "绑定管理"
self.view.addSubview(self.tableView)
self.tableView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.top.equalTo(KNavigationHeight)
}
self.loadData()
}
deinit {
}
func loadData(){
CNLiveMineViewModel.requestModels {[weak self] unBindingArr in
let unbingArr = unBindingArr as! NSMutableArray
self!.unBindingData = NSMutableArray(array: unbingArr)
self!.tableView.reloadData()
}
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.unBindingData.count;
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNBindingManageCellIdentifier) as? CNBindingManageCell
else {
return CNBindingManageCell()
}
let bindModel = self.unBindingData[indexPath.row] as! CNBindingManageModel
cell.bindModel = bindModel
cell.finishBlock = { status in
if status == .success{
self.loadData()
}else{
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
85
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 0{
//跳转绑定手机号页面
self.navigationController?.pushViewController(CNLiveMineChangePhoneController(), animated: true)
}
}
}