绿满眶商城微信小程序-uniapp
peng
13 小时以前 7318243a22f764392040c3bf0942691237a93604
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<template>
  <div class="wrapper">
    <u-navbar :custom-back="back" title="余额"></u-navbar>
    <div class="box">
      <div class="deposit">预存款金额</div>
      <div class="money">¥{{walletNum | unitPrice }}</div>
      <div class="operation-btns">
          <!-- 移除提现按钮 -->
        <div v-if="false" class="operation-btn light" @click="navigateTo('/pages/mine/deposit/withdrawal')">提现</div>
        <div class="operation-btn" @click="navigateTo('/pages/mine/deposit/recharge')">充值</div>
      </div>
    </div>
    <div class="box list" @click="navigateTo('/pages/mine/deposit/index')">
      <div class="list-left">预存款明细</div>
      <div class="list-right">
        <u-icon name="arrow-right"></u-icon>
      </div>
    </div>
  </div>
</template>
 
<script>
import '@/components/uview-components/uview-ui'
import { getUserWallet } from "@/api/members";
export default {
  data() {
    return {
      walletNum: 0,
    };
  },
  async onShow() {
    if (this.$options.filters.isLogin("auth")) {
      let result = await getUserWallet(); //预存款
      this.walletNum = result.data.result.memberWallet;
    } else {
      this.$options.filters.navigateToLogin("redirectTo");
    }
  },
  methods: {
    back() {
        console.log("触犯返回页面")
      uni.switchTab({
        url: "/pages/tabbar/user/my",
      });
    },
    /**
     * 跳转
     */
    navigateTo(url) {
      uni.navigateTo({
        url,
      });
    },
  },
};
</script>
 
<style lang="scss" scoped>
.list {
  display: flex;
  justify-content: center;
  align-items: center;
}
.list-left {
  flex: 8;
}
.list-right {
  flex: 2;
  text-align: right;
}
.wrapper {
  width: 94%;
  margin: 0 3%;
}
.box {
  margin: 20rpx 0;
  background: #fff;
  border-radius: 20rpx;
 
  padding: 40rpx;
}
.operation-btns {
  display: flex;
  justify-content: center;
  align-items: center;
}
.money {
  text-align: center;
  color: #333;
  font-size: 50rpx;
  margin: 20rpx 0 40rpx 0;
  letter-spacing: 2rpx;
}
.deposit {
  margin-top: 50rpx;
  text-align: center;
  color: #999;
  font-size: 28rpx;
 
  letter-spacing: 2rpx;
}
.operation-btn {
  background: #ee6d41;
  color: #fff;
  height: 90rpx;
  width: 240rpx;
  margin: 0 20rpx;
  border-radius: 10rpx;
  text-align: center;
  line-height: 90rpx;
  font-size: 32rpx;
}
.light {
  background: #fdf2ee;
  color: #ee6d41;
}
</style>