cr лет назад: 4
Родитель
Сommit
85e4031f0e
2 измененных файлов с 115 добавлено и 97 удалено
  1. 1 1
      src/pages/manage/index.vue
  2. 114 96
      src/pages/wallet/index.vue

+ 1 - 1
src/pages/manage/index.vue

@@ -76,7 +76,7 @@
76 76
 
77 77
         <!-- <button class="btn" @click="layout">退出登录</button> -->
78 78
 
79
-        <div class="ver">0.5.1</div>
79
+        <div class="ver">0.5.11</div>
80 80
         <wyg-bottom-tab
81 81
             ref="tabbar"
82 82
             :tabIndex="2"

+ 114 - 96
src/pages/wallet/index.vue

@@ -1,86 +1,90 @@
1 1
 <template>
2 2
     <div class="page">
3
-        <div
4
-            v-if="!loading && !account"
5
-            class="go-bind"
6
-            @click="jump('/pages/wallet/bind')"
7
-        >
8
-            您还未绑定账号,请先绑定绑定账号
9
-        </div>
10
-        <block v-if="!loading && account">
11
-            <!-- <block> -->
12
-            <div class="info card">
13
-                <h1 class="tit">账号信息</h1>
14
-                <ul class="info-list">
15
-                    <li class="item">
16
-                        <div class="key">姓名:</div>
17
-                        <div class="value">{{ account.name }}</div>
18
-                    </li>
19
-                    <li class="item">
20
-                        <div class="key">微信号:</div>
21
-                        <div class="value">{{ account.wechat }}</div>
22
-                    </li>
23
-                    <li class="item">
24
-                        <div class="key">银行:</div>
25
-                        <div class="value">{{ account.bank }}</div>
26
-                    </li>
27
-                    <li class="item">
28
-                        <div class="key">开户行:</div>
29
-                        <div class="value">{{ account.bankBranch }}</div>
30
-                    </li>
31
-                    <li class="item">
32
-                        <div class="key">卡号:</div>
33
-                        <div class="value">{{ account.bankAccount }}</div>
34
-                    </li>
35
-                </ul>
3
+        <div class="info card">
4
+            <h1 class="tit">账号信息</h1>
5
+            <ul class="info-list" v-if="!loading && account">
6
+                <li class="item">
7
+                    <div class="key">姓名:</div>
8
+                    <div class="value">{{ account.name }}</div>
9
+                </li>
10
+                <li class="item">
11
+                    <div class="key">微信号:</div>
12
+                    <div class="value">{{ account.wechat }}</div>
13
+                </li>
14
+                <li class="item">
15
+                    <div class="key">银行:</div>
16
+                    <div class="value">{{ account.bank }}</div>
17
+                </li>
18
+                <li class="item">
19
+                    <div class="key">开户行:</div>
20
+                    <div class="value">{{ account.bankBranch }}</div>
21
+                </li>
22
+                <li class="item">
23
+                    <div class="key">卡号:</div>
24
+                    <div class="value">{{ account.bankAccount }}</div>
25
+                </li>
26
+            </ul>
27
+            <div class="no-bind" v-if="!loading && !account">
28
+                <p class="text">您还没有绑定提现账号信息</p>
29
+                <a class="go-bind" @click="jump('/pages/wallet/bind')"
30
+                    >绑定提现账号信息</a
31
+                >
36 32
             </div>
37
-            <div class="money card">
38
-                <h1 class="tit">可提现金额</h1>
39
-                <div class="money-num">
40
-                    <div class="num">¥{{ balance / 100 }}</div>
41
-                    <div class="view" @click="jump('/pages/wallet/bill')">
42
-                        查看账单
43
-                    </div>
44
-                </div>
45
-                <p class="tip">最低提现2元,单日上线20000元</p>
46
-                <div class="input">
47
-                    <input type="digit" v-model="formVal" placeholder="¥0" />
33
+        </div>
34
+        <div class="money card">
35
+            <h1 class="tit">可提现金额</h1>
36
+            <div class="money-num">
37
+                <div class="num">¥{{ balance / 100 }}</div>
38
+                <div class="view" @click="jump('/pages/wallet/bill')">
39
+                    查看账单
48 40
                 </div>
49
-                <p class="tip tip-color">提现金额超出总金额,请重新填写</p>
50
-                <button type="button" class="btn" @click="withdrawal">
51
-                    申请提现
52
-                </button>
53 41
             </div>
54
-            <div class="card record">
55
-                <h1 class="tit">提现记录</h1>
56
-                <ul class="table">
57
-                    <li class="row">
58
-                        <div class="item">申请时间</div>
59
-                        <div class="item">备注</div>
60
-                        <div class="item">金额</div>
61
-                        <div class="item">状态</div>
62
-                    </li>
63
-                    <li
64
-                        class="row"
65
-                        v-for="item of withdrawalList"
66
-                        :key="item.id"
67
-                    >
68
-                        <div class="item">
69
-                            {{ item.applyTime | dateFormat("yyyy/MM/dd") }}
70
-                        </div>
71
-                        <div class="item">
72
-                            {{ item.remark }}
73
-                        </div>
74
-                        <div class="item">
75
-                            {{ item.amount / 100 }}
76
-                        </div>
77
-                        <div class="item">
78
-                            {{ item.status | status }}
79
-                        </div>
80
-                    </li>
81
-                </ul>
42
+            <p class="tip">最低提现2元,单日上线20000元</p>
43
+            <div class="input">
44
+                <input
45
+                    type="digit"
46
+                    v-model="formVal"
47
+                    placeholder="¥0"
48
+                    @input="valChange"
49
+                />
82 50
             </div>
83
-        </block>
51
+            <p class="tip tip-color" v-if="showErr">
52
+                提现金额超出总金额,请重新填写
53
+            </p>
54
+            <button
55
+                v-if="!loading && account"
56
+                type="button"
57
+                class="btn"
58
+                @click="withdrawal"
59
+            >
60
+                申请提现
61
+            </button>
62
+        </div>
63
+        <div class="card record">
64
+            <h1 class="tit">提现记录</h1>
65
+            <ul class="table">
66
+                <li class="row">
67
+                    <div class="item">申请时间</div>
68
+                    <div class="item">备注</div>
69
+                    <div class="item">金额</div>
70
+                    <div class="item">状态</div>
71
+                </li>
72
+                <li class="row" v-for="item of withdrawalList" :key="item.id">
73
+                    <div class="item">
74
+                        {{ item.applyTime | dateFormat("yyyy/MM/dd") }}
75
+                    </div>
76
+                    <div class="item">
77
+                        {{ item.remark }}
78
+                    </div>
79
+                    <div class="item">
80
+                        {{ item.amount / 100 }}
81
+                    </div>
82
+                    <div class="item">
83
+                        {{ item.status | status }}
84
+                    </div>
85
+                </li>
86
+            </ul>
87
+        </div>
84 88
 
85 89
         <uni-popup ref="popup" type="dialog">
86 90
             <uni-popup-dialog
@@ -113,6 +117,7 @@ export default {
113 117
             account: null,
114 118
             balance: 0,
115 119
             loading: false,
120
+            showErr: false,
116 121
         };
117 122
     },
118 123
     filters: {
@@ -147,10 +152,6 @@ export default {
147 152
             this.api.get("/User/GetWithdrawalInfo").then((res) => {
148 153
                 uni.hideLoading();
149 154
                 this.loading = false;
150
-                if (!res.data.account) {
151
-                    // this.router.push('/pages/wallet/bind');
152
-                    // return;
153
-                }
154 155
                 this.account = res.data.account;
155 156
                 this.balance = res.data.balance;
156 157
                 this.withdrawalList = res.data.withdrawalList.data;
@@ -201,6 +202,17 @@ export default {
201 202
                 });
202 203
             done();
203 204
         },
205
+
206
+        valChange() {
207
+            if (this.formVal) {
208
+                let val = Number(this.formVal);
209
+                if (val > this.balance/100) {
210
+                    this.showErr = true;
211
+                    return;
212
+                }
213
+            }
214
+            this.showErr = false;
215
+        },
204 216
     },
205 217
 
206 218
     // 数据计算
@@ -274,7 +286,7 @@ export default {
274 286
     .tip {
275 287
         font-size: px(40);
276 288
         color: #999;
277
-        &.top-color {
289
+        &.tip-color {
278 290
             color: rgb(255, 173, 129);
279 291
         }
280 292
     }
@@ -302,30 +314,36 @@ export default {
302 314
             // text-align: center;
303 315
             padding: px(20);
304 316
             @include omits(4);
305
-            &:nth-child(1){
317
+            &:nth-child(1) {
306 318
                 width: 30%;
307 319
             }
308
-            &:nth-child(2){
320
+            &:nth-child(2) {
309 321
                 width: 30%;
310 322
             }
311
-            &:nth-child(3){
323
+            &:nth-child(3) {
312 324
                 width: 20%;
313 325
             }
314
-            &:nth-child(4){
326
+            &:nth-child(4) {
315 327
                 width: 20%;
316 328
             }
317 329
         }
318 330
     }
319 331
 }
320
-.go-bind {
321
-    margin: px(40);
322
-    border: 1px solid #f1f1f1;
323
-    border-radius: px(10);
324
-    display: flex;
325
-    align-items: center;
326
-    justify-content: center;
327
-    background-color: #fff;
328
-    min-height: px(300);
329
-    font-size: px(46);
332
+.no-bind {
333
+    .text {
334
+        font-size: px(44);
335
+        color: #666;
336
+        margin-top: px(30);
337
+    }
338
+    .go-bind {
339
+        width: px(400);
340
+        height: px(100);
341
+        line-height: px(100);
342
+        text-align: center;
343
+        border-radius: px(10);
344
+        margin: px(60) auto px(100);
345
+        border: 1px solid rgb(0, 188, 38);
346
+        color: rgb(0, 188, 38);
347
+    }
330 348
 }
331 349
 </style>