无故事王国
2023-10-25 158f3707711ad4be78a55dc73a98aa1c9acda0dd
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
//
//  PersonalWalletVC.swift
//  BrokerDriver
//
//  Created by 无故事王国 on 2023/4/25.
//
 
import UIKit
 
class PersonalWalletVC: BaseViewController {
 
    @IBOutlet weak var label_account: UILabel!
    @IBOutlet weak var label_unpaid: UILabel!
    @IBOutlet weak var label_paid: UILabel!
    @IBOutlet weak var tableView: BaseTableView!
    @IBOutlet weak var label_billNumber: UILabel!
 
    private var model:UserWalletModel?
 
 
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "Wallet"
 
        Services.getMeWallet().subscribe(onNext: { [weak self] data in
            if let model = data.data{
                self?.model = model
                self?.label_account.text = model.allTotal.currency()
                self?.label_unpaid.text = String(format: "Total unpaid:%.2lf", model.unpaid)
                self?.label_paid.text = String(format: "Total paid:%.2lf", model.unpaid)
                self?.label_billNumber.text = String(format: "The bill number:%@ days", model.billNumber)
                self?.tableView.reloadData()
            }
        }) { error in
 
        }.disposed(by: disposeBag)
    }
 
    override func setUI() {
        super.setUI()
 
        tableView.delegate = self
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "WalletTCell", bundle: nil), forCellReuseIdentifier: "_WalletTCell")
        tableView.jq_setEmptyView("Not data", image: UIImage(named: "empty"), foregroundColor: .gray, clouse: nil)
        label_account.font = UIFont(name: "Impact", size: 36)
 
    }
}
 
extension PersonalWalletVC:UITableViewDelegate{
 
}
 
extension PersonalWalletVC:UITableViewDataSource{
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
       let cell = tableView.dequeueReusableCell(withIdentifier: "_WalletTCell") as! WalletTCell
        cell.model = model!.list[indexPath.row]
        return cell
    }
 
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return model?.list.count ?? 0
    }
}