杨锴
2024-08-21 e978b3aa02f00859588949dfdf24778b05fe4adb
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
//
//  BankWithdrawVC.swift
//  XQMuse
//
//  Created by 无故事王国 on 2024/8/21.
//
 
import UIKit
import QMUIKit
 
class BankWithdrawVC: BaseVC {
 
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var cons_height: NSLayoutConstraint!
                private var selectIndexPath = IndexPath(row: 0, section: 0)
 
                override func viewDidLoad() {
        super.viewDidLoad()
        title = "收益提现"
    }
 
                override func setUI() {
                                view.backgroundColor = UIColor(hexString: "f6f6f6")
                                tableView.delegate = self
                                tableView.dataSource = self
                                tableView.separatorStyle = .none
                                tableView.backgroundColor = .clear
                                tableView.register(UINib(nibName: "BankInfoTCell", bundle: nil), forCellReuseIdentifier: "_BankInfoTCell")
                                cons_height.constant = 84 * 2
                }
 
                @IBAction func addBankCardAction(_ sender: QMUIButton) {
                                let vc = AddBankInfoVC()
                                push(vc: vc)
                }
}
 
extension BankWithdrawVC:UITableViewDelegate & UITableViewDataSource{
 
                func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
                                selectIndexPath = indexPath
                                tableView.reloadData()
                }
 
                func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
                                let cell = tableView.dequeueReusableCell(withIdentifier: "_BankInfoTCell", for: indexPath) as! BankInfoTCell
                                cell.isSelect(indexPath == selectIndexPath)
                                return cell
                }
 
                func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
                                return true
                }
 
                func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
                                CommonAlertView.show(title: "提示", content: "是否删除此张银行卡?") { _ in
 
                                }
                }
 
                func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle {
                                return .delete
                }
 
                func tableView(_ tableView: UITableView, titleForDeleteConfirmationButtonForRowAt indexPath: IndexPath) -> String? {
                                return "删除"
                }
 
 
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                return 2
                }
 
                func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
                                return 84
                }
}