| | |
| | | // |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | |
| | | class WalletVC: BaseVC { |
| | | @IBOutlet weak var label_balance: UILabel! |
| | | @IBOutlet weak var label_recharge: UILabel! |
| | | @IBOutlet weak var label_income: UILabel! |
| | | |
| | | private var walletModel:WalletModel? |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "钱包" |
| | | |
| | | getData() |
| | | } |
| | | |
| | | override func setRx() { |
| | | |
| | | NotificationCenter.default.rx.notification(WithDrawReply_Noti).subscribe(onNext: {_ in |
| | | self.getData() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func getData(){ |
| | | Services.myWallet().subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | self.walletModel = m |
| | | self.label_balance.text = m.balance.jq_formatFloat |
| | | self.label_recharge.text = m.recharge.jq_formatFloat |
| | | self.label_income.text = m.income.jq_formatFloat |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | | view.backgroundColor = UIColor(hexString: "#fafafa") |
| | | } |
| | | |
| | | @IBAction func withdrawAction(_ sender: UIButton) { |
| | | let vc = BankWithdrawVC() |
| | | let vc = BankWithdrawVC(income: walletModel?.income ?? 0) |
| | | push(vc: vc) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func spendingDetailAction(_ sender: TapBtn) { |
| | | let vc = SpendingDetailVC() |
| | | let vc = SpendingDetailVC(balance: walletModel?.balance ?? 0, income: walletModel?.income ?? 0) |
| | | push(vc: vc) |
| | | } |
| | | |