//
|
// WalletVC.swift
|
// XQMuse
|
//
|
// Created by 无故事王国 on 2024/8/21.
|
//
|
|
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(income: walletModel?.balance ?? 0)
|
push(vc: vc)
|
}
|
|
@IBAction func recharegeAction(_ sender: UIButton) {
|
let vc = WalletRechargeVC()
|
push(vc: vc)
|
}
|
|
@IBAction func spendingDetailAction(_ sender: TapBtn) {
|
let vc = SpendingDetailVC(balance: walletModel?.balance ?? 0, income: walletModel?.income ?? 0)
|
push(vc: vc)
|
}
|
|
@IBAction func commentAction(_ sender: TapBtn) {
|
let vc = WebVC(url: ShareUrl + "/ranking/recommend?userId=\(UserViewModel.getAvatarInfo().id)")
|
vc.title = "推荐名单"
|
push(vc: vc)
|
|
}
|
|
@IBAction func popularizeAction(_ sender: TapBtn) {
|
let vc = InviteVC()
|
vc.title = "推广活动"
|
push(vc: vc)
|
}
|
|
}
|