xuqiang 4 years ago
parent
commit
865757a60b

+ 12 - 1
src/components/BillInfo.vue

@@ -1,5 +1,11 @@
 <template>
-    <van-cell :class="{ pay: billType === 'pay' }" :title="Info.title" :label="Info.settleTime" :value="Info.amount">
+    <van-cell
+        @click="details"
+        :class="{ pay: billType === 'pay' }"
+        :title="Info.title"
+        :label="Info.settleTime"
+        :value="Info.amount"
+    >
         <img
             slot="icon"
             class="cell-icon"
@@ -23,6 +29,11 @@ export default {
             type: String,
             default: ''
         }
+    },
+    methods: {
+        details() {
+            this.$emit('detail');
+        }
     }
 };
 </script>

+ 20 - 11
src/pages/addBlessing.vue

@@ -68,17 +68,17 @@ export default {
                     name: '宝可梦',
                     num: 2,
                     id: 1
+                },
+                {
+                    name: '皮卡丘',
+                    num: 3,
+                    id: 2
+                },
+                {
+                    name: '小火龙',
+                    num: 1,
+                    id: 3
                 }
-                // {
-                //     name: '皮卡丘',
-                //     num: 3,
-                //     id: 2
-                // },
-                // {
-                //     name: '小火龙',
-                //     num: 1,
-                //     id: 3
-                // }
             ],
             Flag: true,
             form: { name: '', boxesCount: '' },
@@ -87,15 +87,24 @@ export default {
             imageUrls: []
         };
     },
+    created() {
+        console.log(this.cardList);
+    },
     methods: {
         add() {
-            this.navigateTo('/pages/store/productEdit?num=' + this.cardList.length);
+            this.navigateTo(
+                '/pages/store/productEdit?cardList=' + JSON.stringify(this.cardList) + '&num=' + this.cardList.length
+            );
         },
         afterRead(file) {
             this.showLoading();
             this.$http
                 .uploadFile(file.path)
                 .then(res => {
+                    if (this.images.length > 0) {
+                        this.toast('最多上传一张图片');
+                        return;
+                    }
                     this.hideLoading();
                     this.imagesList.push({ ...file, url: res });
                     this.images = [...this.imagesList];

+ 7 - 6
src/pages/store/productEdit.vue

@@ -71,7 +71,7 @@
                     @input="form.boxesCount = $event.detail"
                     type="digit"
                 >
-                    <span slot="right-icon">{{ !addBlessing ? '去添加' : `已新增${addBlessing}福袋` }}</span>
+                    <span slot="right-icon">{{ !addBlessing ? '去添加' : `已新增${addBlessingNum}福袋` }}</span>
                 </van-field>
             </div>
         </van-cell-group>
@@ -241,7 +241,7 @@ export default {
             time: 0,
             times: 1,
             typeOptions: [
-                { id: 4, name: '福袋模式' },
+                // { id: 4, name: '福袋模式' },
                 { id: 0, name: '组队模板(24队每队6人)', group: 24, groupCount: 6, special: false },
                 { id: 1, name: '端盒模板(AB组24对)', group: 2, groupCount: 24, special: true },
                 { id: 2, name: '端盒模板(单组24盒)', group: 1, groupCount: 24, special: false },
@@ -273,12 +273,12 @@ export default {
             });
         },
         addBlessing() {
+            return this.$mp.query.cardList;
+        },
+        addBlessingNum() {
             return this.$mp.query.num;
         }
     },
-    created() {
-        console.log(this.addBlessing);
-    },
     watch: {
         show: {
             handler: function(newVal) {
@@ -296,7 +296,8 @@ export default {
         } else {
             this.$nextTick(() => {
                 this.change({
-                    detail: 4
+                    detail: 0
+                    // detail: 4
                 });
             });
         }

+ 24 - 9
src/pages/wallet.vue

@@ -18,9 +18,8 @@
                 <div class="text1">我的余额</div>
                 <div class="text2">{{ moneyInfo.money || 0 }}</div>
             </div>
-
-            <van-button type="default" size="small" @click="Withdrawal">
-                提现
+            <van-button :color="$colors.default" :disabled="canSubmit" size="small" @click="Withdrawal">
+                {{ canSubmit ? '提现中' : '提现' }}
             </van-button>
         </div>
 
@@ -33,8 +32,10 @@
                     <van-dropdown-item @change="names" :value="times" :options="option2" />
                 </van-dropdown-menu>
                 <div class="flex1"></div>
-                <span class="text"> 收入 ¥{{ count }} </span>
-                <span class="text"> 提现 ¥{{ TXCount }} </span>
+                <div v-if="times != 'user'">
+                    <span class="text"> 收入 ¥{{ count }} </span>
+                    <span class="text"> 提现 ¥{{ TXCount }} </span>
+                </div>
             </div>
         </van-sticky>
 
@@ -48,8 +49,8 @@
 
             <template>
                 <div v-for="(item, index) in recordList" :key="index">
-                    <bill-info :Info="item"></bill-info>
-                    <bill-info billType="pay" :Info="item"></bill-info>
+                    <bill-info :Info="item" v-if="item.type == 'SOLD'"></bill-info>
+                    <bill-info billType="pay" :Info="item" @detail="detail(item.attach)"></bill-info>
                 </div>
             </template>
         </div>
@@ -68,6 +69,7 @@ export default {
             times: 'user',
             dateList: [],
             list: [],
+            flag: '',
             nameList: '',
             option1: [
                 { text: '2021-05', value: 0 },
@@ -99,12 +101,23 @@ export default {
                     value: item.value
                 };
             });
+        },
+        canSubmit() {
+            return this.flag;
         }
     },
+    created() {
+        let userId = this.$store.state.userInfo.id;
+        this.$http.get('/withdrawApply/check', { userId: userId }).then(res => {
+            this.flag = res;
+        });
+    },
     methods: {
+        detail(attach) {
+            this.navigateTo('/pages/walletreview?attach=' + attach);
+        },
         loginMethods() {
             this.$http.get('/memberInfo/findByUser').then(res => {
-                console.log(res);
                 this.moneyInfo = res;
             });
         },
@@ -127,7 +140,9 @@ export default {
             this.initApi(this.dateList, this.nameList);
         },
         Withdrawal() {
-            this.navigateTo('/pages/walletdetails');
+            if (this.flag != true) {
+                this.navigateTo('/pages/walletdetails');
+            }
         },
         initApi(params, name) {
             // console.log(params);

+ 4 - 19
src/pages/walletdetails.vue

@@ -12,8 +12,7 @@
         <div class="box-con">
             <p>提现金额</p>
             <div class="num">
-                <span>全部可提现 ¥</span>
-                <span>{{ moneyInfo.money || 0 }}</span>
+                <span>全部可提现 ¥{{ moneyInfo.money || 0 }}</span>
             </div>
             <div class="box">
                 <div class="box-left">
@@ -90,25 +89,11 @@ export default {
                 });
                 return;
             }
-            this.showLoading();
-            let userId = this.$store.state.userInfo.id;
             this.$http
-                .post('/memberInfo/newWithDraw', { userId, money: this.form.boxPrice })
+                .post('/withdrawApply/withdraw', { userId: this.$store.state.userInfo.id, money: this.form.boxPrice })
                 .then(res => {
-                    this.hideLoading();
-                    wx.showToast({
-                        icon: 'none',
-                        title: '申请审核中,72小时内成功',
-                        duration: 2000
-                    });
-                    // this.navigateTo('/pages/walletreview');
-                })
-                .catch(e => {
-                    this.hideLoading();
-                    wx.showToast({
-                        icon: 'none',
-                        title: e.error
-                    });
+                    console.log(res);
+                    this.navigateTo('/pages/walletreview?attach=' + res.id);
                 });
         }
     }

+ 9 - 18
src/pages/walletreview.vue

@@ -13,7 +13,7 @@
             <div class="text2">{{ desc }}</div>
 
             <template>
-                <van-button type="primary" block @click="jump">返回</van-button>
+                <van-button type="primary" block @click="navigateTo('/pages/wallet')">返回</van-button>
             </template>
         </div>
     </div>
@@ -27,42 +27,33 @@ export default {
         };
     },
     computed: {
-        status() {
-            return this.authentication ? this.authentication.status : '';
-        },
         img() {
             const imgs = [
                 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-05-31-12-33-35bZnlCSEk.png',
                 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-05-31-12-34-56CFIoxiyB.png'
             ];
-            return imgs[this.status === 'PASS' ? 0 : 1];
+            return imgs[this.authentication === 'UNDO' ? 0 : 1];
         },
         title() {
             const list = ['提交成功', '审核已通过'];
-            return list[this.status === 'PASS' ? 0 : 1];
+            return list[this.authentication === 'UNDO' ? 0 : 1];
         },
         desc() {
             const list = [
                 '您已成功申请提现服务,待审核成功后钱款将在72小时内提现到您的账户,请注意查收',
                 '您已申请的提现服务已通过审核,钱款将在72小时内提现到您的账户,请注意查收'
             ];
-            return list[this.status === 'PASS' ? 0 : 1];
+            return list[this.authentication === 'UNDO' ? 0 : 1];
         }
     },
     methods: {
         loginMethods() {
-            this.$http
-                .postJson('/storeAuthentication/all', {
-                    query: { userId: this.$store.state.userInfo.id, del: false }
-                })
-                .then(res => {
-                    this.authentication = res.content[0];
-                    console.log(res);
-                });
+            let attach = this.$mp.query.attach;
+            this.$http.get('/withdrawApply/get/' + attach).then(res => {
+                this.authentication = res.status;
+                // console.log(this.authentication);
+            });
         }
-        // jump(){
-
-        // }
     }
 };
 </script>