移动系统liao
2025-02-17 557c2711a3e103ebc3d0492344eca9730d5e92b2
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
    <view>
        <u-toast ref="uToast" /><u-no-network></u-no-network>
        <u-navbar title="我的账户" safeAreaInsetTop fixed placeholder>
            <view class="coreshop-navbar-left-slot" slot="left">
                <u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
                <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
                <u-icon name="home" size="22" @click="goHome"></u-icon>
            </view>
            <view slot="right">
            </view>
        </u-navbar>
        <view class="content">
            <view class='withdrawcash-top'>
                <text class='withdrawcash-title'>账户余额(元)</text>
                <text class='withdrawcash-num'>{{ userInfo.balance }}</text>
            </view>
            <view class="coreshop-list menu card-menu coreshop-margin-top-15">
                <view class="coreshop-list-item arrow" v-if="showRecharge" @click="navigateToHandle('/pages/member/balance/recharge/recharge')">
                    <view class="content">
                        <u-icon name="gift" size="16" class="coreshop-text-grey" label="账户充值"></u-icon>
                    </view>
                </view>
                <view class="coreshop-list-item arrow" v-if="isAllowWithdrawCash" @click="navigateToHandle('/pages/member/balance/withdrawCash/withdrawCash')">
                    <view class="content">
                        <u-icon name="rmb" size="16" class="coreshop-text-yellow" label="余额提现"></u-icon>
                    </view>
                </view>
                <view class="coreshop-list-item arrow" @click="navigateToHandle('/pages/member/balance/details/details')">
                    <view class="content">
                        <u-icon name="rmb-circle" size="16" class="coreshop-text-olive" label="余额明细"></u-icon>
                    </view>
                </view>
                <view class="coreshop-list-item arrow" @click="navigateToHandle('/pages/member/balance/cashlist/cashlist')">
                    <view class="content">
                        <u-icon name="list-dot" size="16" class="coreshop-text-orange" label="提现记录"></u-icon>
                    </view>
                </view>
                <view class="coreshop-list-item arrow" @click="navigateToHandle('/pages/member/balance/bankcard/bankcard')">
                    <view class="content">
                        <u-icon name="coupon" size="16" class="coreshop-text-blue" label="我的银行卡"></u-icon>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                userInfo: {},
                platform: 'ios'
            }
        },
        computed: {
            showRecharge() {
                return this.$store.state.config.showStoreBalanceRechargeSwitch === 1;
            },
            isAllowWithdrawCash() {
                return this.$store.state.config.isAllowWithdrawCash === 1;
            },
        },
        onShow() {
            this.getUserInfo();
        },
        methods: {
            // 获取用户信息
            getUserInfo() {
                let _this = this;
                uni.getSystemInfo({
                    success: function (res) {
                        _this.platform = res.platform;
                    }
                });
 
                this.$u.api.userInfo().then(res => {
                    if (res.status) {
                        this.userInfo = res.data
                    } else {
                        this.$u.toast(res.msg)
                    }
                })
            },
            // 页面跳转
            navigateToHandle(pageUrl) {
                this.$u.route(pageUrl)
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    @import "index.scss";
</style>