宽窄优行-由【嘉易行】项目成品而来
younger_times
2023-04-06 a1ae6802080a22e6e6ce6d0935e95facb1daca5c
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
//
//  InvoiceHistoryViewController.swift
//  OKProject
//
//  Created by 无故事王国 on 2022/6/10.
//  Copyright © 2022 yangwang. All rights reserved.
//
 
import UIKit
 
class InvoiceHistoryViewController: YYTableViewController {
 
    let viewModel = InvoiceHistoryViewModel()
 
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "开票历史"
 
        tableView.delegate = self
        tableView.dataSource = self
        tableView.register(UINib(nibName: "InvoiceCheckTCell", bundle: nil), forCellReuseIdentifier: "_InvoiceCheckTCell")
        tableView.separatorStyle = .none
        viewModel.configure(tableView: tableView)
        tableView.beginRefreshing()
    }
}
 
extension InvoiceHistoryViewController:UITableViewDelegate{
 
}
 
extension InvoiceHistoryViewController:UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return viewModel.dataSource.value.count
    }
 
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_InvoiceCheckTCell") as! InvoiceCheckTCell
        cell.setInvoiceHistoryModel(model)
        return cell
    }
 
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 82
    }
}