| | |
| | | |
| | | import UIKit |
| | | |
| | | class OrderReviewViewModel:YYRefreshViewModel<OrderReviewModel>{ |
| | | |
| | | override func api() -> API! { |
| | | return .approveOrderList(pageNum: currentPage) |
| | | } |
| | | |
| | | } |
| | | |
| | | let OrderReviewRefresh_Noti = Notification.Name.init("OrderReviewRefresh_Noti") |
| | | |
| | | |
| | | class OrderReviewListVC: YYTableViewController { |
| | | |
| | | private var viewModel:OrderReviewViewModel! |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "订单审核" |
| | | |
| | | viewModel = OrderReviewViewModel() |
| | | viewModel.configure(tableView: tableView) |
| | | |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.register(UINib(nibName: "OrderReviewTCell", bundle: nil), forCellReuseIdentifier: "_OrderReviewTCell") |
| | | tableView.beginRefreshing() |
| | | } |
| | | |
| | | override func bindRx() { |
| | | NotificationCenter.default.rx.notification(OrderReviewRefresh_Noti).takeUntil(self.rx.deallocated).subscribe(onNext: {[weak self] noti in |
| | | self?.tableView.beginRefreshing() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | extension OrderReviewListVC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return 10 |
| | | 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: "_OrderReviewTCell") as! OrderReviewTCell |
| | | cell.backgroundColor = .clear |
| | | cell.orderReviewModel = model |
| | | return cell |
| | | } |
| | | } |