| | |
| | | @IBOutlet weak var tf_withdraw: UITextField! |
| | | @IBOutlet weak var cons_height: NSLayoutConstraint! |
| | | @IBOutlet weak var label_income: UILabel! |
| | | private var selectIndexPath:IndexPath? |
| | | @IBOutlet weak var btn_complete: UIButton! |
| | | private var selectIndexPath:IndexPath? |
| | | |
| | | private var bankModels = [BankInfoModel]() |
| | | private var income:CGFloat = 0 |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "收益提现" |
| | | title = "余额提现" |
| | | label_income.text = "可提现余额:¥" + income.jq_formatFloat |
| | | getBanks() |
| | | |
| | | btn_complete.isEnabled = false |
| | | btn_complete.alpha = 0.6 |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | NotificationCenter.default.rx.notification(AddBank_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { _ in |
| | | self.getBanks() |
| | | }).disposed(by: disposeBag) |
| | | |
| | | tf_withdraw.rx.text.orEmpty.subscribe(onNext: {[weak self] text in |
| | | self?.btn_complete.isEnabled = !text.isEmpty |
| | | self?.btn_complete.alpha = text.isEmpty ? 0.6:1.0 |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | |
| | |
| | | self.tf_withdraw.resignFirstResponder() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func viewDidLayoutSubviews() { |
| | | super.viewDidLayoutSubviews() |
| | | btn_complete.localGradientColor(cornerRadius: 20) |
| | | } |
| | | } |
| | | |
| | | extension BankWithdrawVC:UITableViewDelegate & UITableViewDataSource{ |
| | |
| | | |
| | | func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { |
| | | let id = bankModels[indexPath.row].id |
| | | CommonAlertView.show(title: "提示", content: "是否删除此张银行卡?") { _ in |
| | | Services.deleteBank(id).subscribe(onNext: { _ in |
| | | self.tableView.beginUpdates() |
| | | self.bankModels.remove(at: indexPath.row) |
| | | self.tableView.deleteItemsAtIndexPaths([indexPath], animationStyle: .left) |
| | | self.tableView.endUpdates() |
| | | self.cons_height.constant = CGFloat(self.bankModels.count) * 84.0 |
| | | UIView.animate(withDuration: 0.4) { |
| | | self.view.layoutIfNeeded() |
| | | } |
| | | }).disposed(by: self.disposeBag) |
| | | |
| | | CommonAlertView.show(title: "提示", content: "是否删除此张银行卡?") { state in |
| | | if state{ |
| | | Services.deleteBank(id).subscribe(onNext: { _ in |
| | | self.tableView.beginUpdates() |
| | | self.bankModels.remove(at: indexPath.row) |
| | | self.tableView.deleteItemsAtIndexPaths([indexPath], animationStyle: .left) |
| | | self.tableView.endUpdates() |
| | | self.cons_height.constant = CGFloat(self.bankModels.count) * 84.0 |
| | | UIView.animate(withDuration: 0.4) { |
| | | self.view.layoutIfNeeded() |
| | | } |
| | | }).disposed(by: self.disposeBag) |
| | | } |
| | | } |
| | | } |
| | | |