// // SpeedViewController.swift // xingchuangke // // Created by Apple on 2020/10/24. // Copyright © 2020 Virgil. All rights reserved. // import UIKit class SpeedViewController: BaseViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self.title = "进度查询" initNavLeftBackButton() tableView.register(UINib(nibName: "ApplyCardBillTableViewCell", bundle: nil), forCellReuseIdentifier: "ApplyCardBillTableViewCell") tableView.delegate = self tableView.dataSource = self tableView.separatorStyle = .none tableView.showsVerticalScrollIndicator = false tableView.estimatedRowHeight = 100 tableView.mj_header = MJRefreshNormalHeader(refreshingBlock: {[weak self] in self!.currentPage = 1 self!.loadData() }) // tableView.mj_header.lastUpdatedTimeKey = "ApplyCardBillTableViewCell" // tableView.mj_footer = MJRefreshBackNormalFooter(refreshingBlock: {[weak self] in // self!.currentPage += 1 // self!.loadData() // }) tableView.mj_header?.beginRefreshing() self.view.backgroundColor = tableView.backgroundColor // Do any additional setup after loading the view. } // MARK: =============加载数据=============== func loadData() { let url = RequestURL.findResultByOrder let params = NSMutableDictionary() loadDataList(url: url, params: params, tableView: self.tableView, tag: 1001) } override func returnData(tag: Int) { if tag == 1001 { tableView.reloadData() } } override func returnError(tag: Int, type: String) { } // MARK: TABLEVLEW 实现 func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.arrData.count } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 100 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "ApplyCardBillTableViewCell", for: indexPath as IndexPath) as! ApplyCardBillTableViewCell cell.selectionStyle = .none cell.lblCard.text = CommonValue.formatCardNum(str: getString(current: indexPath.row, key: "identity_id")) cell.lblDate.text = getString(current: indexPath.row, key: "apply_time") cell.lblPhone.text = CommonValue.formatPhone(phone: getString(current: indexPath.row, key: "user_phone")) cell.lblCardName.text = getString(current: indexPath.row, key: "bank_name") cell.lblApplyName.text = "申请人:\(getString(current: indexPath.row, key: "user_name"))" cell.btnQuery.setTitle(getString(current: indexPath.row, key: "status"), for: .normal) return cell } @objc func btnQueryClick(btn: UIButton) { UIApplication.shared.openURL(URL(string: "http://card-dev.qdrsd.top/#/progress")!) } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.tabBarController?.title = self.title } override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: "SpeedViewController", bundle: nil) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } }