//
|
// MineWithdrawalRecordVC.swift
|
// OKProject
|
//
|
// Created by alvin_y on 2020/7/3.
|
// Copyright © 2020 yangwang. All rights reserved.
|
//
|
|
import UIKit
|
|
/// 提现记录
|
class MineWithdrawalRecordVC: YYTableViewController {
|
|
let viewModel = MineWithdrawalRecordViewModel()
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
|
// Do any additional setup after loading the view.
|
}
|
|
//MARK: - UI
|
override func setupViews() {
|
super.setupViews()
|
navigationItem.title = "提现记录"
|
tableView.delegate = self
|
tableView.dataSource = self
|
tableView.tableFooterView = UIView()
|
tableView.register(cellName: "MineWithdrawalRecordCell", identifier: "item")
|
viewModel.configure(tableView: tableView)
|
tableView.beginRefreshing()
|
}
|
}
|
// MARK: - UITableViewDelegate
|
extension MineWithdrawalRecordVC:UITableViewDelegate{
|
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
return UITableView.automaticDimension
|
}
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
tableView.deselectRow(at: indexPath, animated: true)
|
}
|
}
|
|
// MARK: - UITableViewDelegate
|
extension MineWithdrawalRecordVC:UITableViewDataSource{
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
return viewModel.dataSource.value.count
|
}
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
let cell = tableView.dequeueReusableCell(withIdentifier: "item", for: indexPath) as! MineWithdrawalRecordCell
|
cell.model = viewModel.dataSource.value[indexPath.row]
|
cell.separatorInset = UIEdgeInsets(top: 0, left: 14, bottom: 0, right: 14)
|
return cell
|
}
|
|
}
|