杨锴
2025-04-16 09a372bc45fde16fd42257ab6f78b8deeecf720b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
//  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)
                }
                
}