| | |
| | | // |
| | | |
| | | import UIKit |
| | | import RxSwift |
| | | |
| | | class ExchangeRecordViewModel:RefreshModel<ExchangeRecordModel>{ |
| | | override func api() -> (Observable<BaseResponse<[ExchangeRecordModel]>>)? { |
| | | return Services.exchangeRecord() |
| | | } |
| | | } |
| | | |
| | | class ExchangeRecordHistoryVC: BaseVC { |
| | | |
| | | |
| | | private let viewModel = ExchangeRecordViewModel() |
| | | private var tableView:UITableView! |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | viewModel.configure(tableView) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | extension ExchangeRecordHistoryVC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_GoodsItemTCell") as! GoodsItemTCell |
| | | cell.setModel(viewModel.dataSource.value[indexPath.row]) |
| | | return cell |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return 10 |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |