xuqiang 5 лет назад
Родитель
Сommit
b3a96f8e53

+ 2 - 2
project.private.config.json

@@ -175,8 +175,8 @@
           "scene": null
         },
         {
-          "name": "管理商品",
-          "pathName": "pages/store/administration",
+          "name": "提现",
+          "pathName": "pages/walletdetails",
           "query": "null",
           "scene": null
         }

+ 74 - 38
src/components/AllorderInfo.vue

@@ -187,6 +187,7 @@ export default {
         },
         userIds() {
             this.$http.get('/store/get/' + this.storeId).then(res => {
+                // console.log(res);
                 this.userId = res.userId;
             });
         },
@@ -213,15 +214,22 @@ export default {
                 content: '确定收货?',
                 success: res => {
                     if (res.confirm) {
-                        this.$http.post('/orderInfo/finish', { orderInfoId: this.id }).then(res => {
-                            wx.showToast({
-                                icon: 'none',
-                                title: '收货成功'
+                        this.$http
+                            .post('/orderInfo/finish', { orderInfoId: this.id })
+                            .then(res => {
+                                wx.showToast({
+                                    icon: 'none',
+                                    title: '收货成功'
+                                });
+                                setTimeout(() => {
+                                    this.refreash();
+                                }, 1000);
+                            })
+                            .catch(e => {
+                                if (e.error) {
+                                    this.toast(e.rror);
+                                }
                             });
-                            setTimeout(() => {
-                                this.refreash();
-                            }, 1000);
-                        });
                     }
                 }
             });
@@ -269,15 +277,22 @@ export default {
                 content: '确定取消订单?',
                 success: res => {
                     if (res.confirm) {
-                        this.$http.post('/orderInfo/cancel', { orderInfoId: this.id }).then(res => {
-                            wx.showToast({
-                                icon: 'none',
-                                title: '订单已取消'
+                        this.$http
+                            .post('/orderInfo/cancel', { orderInfoId: this.id })
+                            .then(res => {
+                                wx.showToast({
+                                    icon: 'none',
+                                    title: '订单已取消'
+                                });
+                                setTimeout(() => {
+                                    this.refreash();
+                                }, 1000);
+                            })
+                            .catch(e => {
+                                if (e.error) {
+                                    this.toast(e.rror);
+                                }
                             });
-                            setTimeout(() => {
-                                this.refreash();
-                            }, 1000);
-                        });
                     }
                 }
             });
@@ -305,15 +320,22 @@ export default {
                 content: '确定删除订单?',
                 success: res => {
                     if (res.confirm) {
-                        this.$http.post('orderInfo/delete', { orderInfoId: this.id }).then(res => {
-                            wx.showToast({
-                                icon: 'none',
-                                title: '订单已删除'
+                        this.$http
+                            .post('orderInfo/delete', { orderInfoId: this.id })
+                            .then(res => {
+                                wx.showToast({
+                                    icon: 'none',
+                                    title: '订单已删除'
+                                });
+                                setTimeout(() => {
+                                    this.refreash();
+                                }, 1000);
+                            })
+                            .catch(e => {
+                                if (e.error) {
+                                    this.toast(e.rror);
+                                }
                             });
-                            setTimeout(() => {
-                                this.refreash();
-                            }, 1000);
-                        });
                     }
                 }
             });
@@ -324,15 +346,22 @@ export default {
                 content: '确定取消退款?',
                 success: res => {
                     if (res.confirm) {
-                        this.$http.post('orderRefundApply/cancel', { id: this.refundId }).then(res => {
-                            wx.showToast({
-                                icon: 'none',
-                                title: '退款已取消'
+                        this.$http
+                            .post('orderRefundApply/cancel', { id: this.refundId })
+                            .then(res => {
+                                wx.showToast({
+                                    icon: 'none',
+                                    title: '退款已取消'
+                                });
+                                setTimeout(() => {
+                                    this.refreash();
+                                }, 1000);
+                            })
+                            .catch(e => {
+                                if (e.error) {
+                                    this.toast(e.rror);
+                                }
                             });
-                            setTimeout(() => {
-                                this.refreash();
-                            }, 1000);
-                        });
                     }
                 }
             });
@@ -352,17 +381,24 @@ export default {
             this.navigateTo('/pages/Applydetails?id=' + this.id);
         },
         remind() {
-            this.$http.post('orderInfo/remindMy', { orderInfoId: this.id, remark: '' }).then(res => {
-                wx.showToast({
-                    icon: 'none',
-                    title: '提醒商家成功'
+            this.$http
+                .post('orderInfo/remindMy', { orderInfoId: this.id, remark: '' })
+                .then(res => {
+                    wx.showToast({
+                        icon: 'none',
+                        title: '提醒商家成功'
+                    });
+                })
+                .catch(e => {
+                    if (e.error) {
+                        this.toast(e.rror);
+                    }
                 });
-            });
         }
     },
     created() {
         this.rufundApply();
-        // this.userIds();
+        this.userIds();
     }
 };
 </script>

+ 40 - 2
src/components/AllselloutInfo.vue

@@ -59,7 +59,7 @@
                 <div v-if="status == 'CANCELED'" @click="deletes" class="box-but">删除订单</div>
                 <div v-if="status == 'CANCELED'" @click="Buyers" class="box-but3">联系买家</div>
                 <div v-if="status == 'REFUND'" @click="Buyers" class="box-but">联系买家</div>
-                <div v-if="status == 'REFUND'" @click="deliver" class="box-but2">同意退款</div>
+                <div v-if="status == 'REFUND'" @click="refund" class="box-but2">同意退款</div>
                 <div v-if="status == 'REFUNDED'" @click="deletes" class="box-but">删除订单</div>
                 <!-- <div v-if="status == 'bbb'" @click="deletes" class="box-but">删除订单</div> -->
             </div>
@@ -103,7 +103,8 @@ export default {
             show: false,
             stepsList: [],
             logisTics: [],
-            userId: ''
+            userId: '',
+            tradeId: ''
         };
     },
     computed: {
@@ -119,6 +120,9 @@ export default {
         caseId() {
             return this.all.caseId || 0;
         },
+        storeId() {
+            return this.all.storeId || 0;
+        },
         userNickName() {
             return this.all.userNickName || '';
         },
@@ -204,6 +208,7 @@ export default {
         userIds() {
             this.$http.get('/store/get/' + this.storeId).then(res => {
                 this.userId = res.userId;
+                console.log(this.userId);
             });
         },
         Buyers() {
@@ -250,6 +255,33 @@ export default {
         applydetails() {
             this.navigateTo('/pages/Applydetails?id=' + this.id);
         },
+        orderRefund() {
+            this.$http.post('orderRefundApply/applySuccess', { orderId: this.id }).then(res => {
+                console.log(res);
+                // this.tradeId = res.store.id;
+                this.tradeId = res.tradeId;
+            });
+        },
+        refund() {
+            wx.showModal({
+                title: '提示',
+                content: '确定同意退款?',
+                success: res => {
+                    if (res.confirm) {
+                        this.$http.post('orderRefundApply/audit', { id: this.tradeId }).then(res => {
+                            console.log(res);
+                            wx.showToast({
+                                icon: 'none',
+                                title: '退款成功'
+                            });
+                            setTimeout(() => {
+                                this.allsellout();
+                            }, 1000);
+                        });
+                    }
+                }
+            });
+        },
         deliver() {
             console.log(this.all);
             wx.showToast({
@@ -260,6 +292,12 @@ export default {
             //     console.log(res);
             // });
         }
+    },
+    created() {
+        this.userIds();
+        if (this.status == 'REFUND' || this.status == 'REFUNDED') {
+            this.orderRefund();
+        }
     }
 };
 </script>

+ 1 - 0
src/main.js

@@ -47,6 +47,7 @@ export default {
             'pages/setting',
             'pages/wallet',
             'pages/walletdetails',
+            'pages/walletreview',
             'pages/authorized',
             'pages/questions',
             'pages/rule',

+ 8 - 0
src/mixins/allPage.js

@@ -10,6 +10,14 @@ export default {
                     value: 'CANCELED',
                     label: '已取消'
                 },
+                {
+                    value: 'REFUND',
+                    label: '买家申请退款'
+                },
+                {
+                    value: 'REFUNDED',
+                    label: '退款成功'
+                },
                 {
                     value: 'PAYED',
                     label: '待发货'

BIN
src/native/imgs/icon_jiage@3x.png


BIN
src/native/imgs/png_weixin@3x.png


BIN
src/native/imgs/shenqing_shenhezhong@3x.png


BIN
src/native/imgs/shenqing_yitongguo@3x.png


+ 35 - 1
src/pages/allselldetails.vue

@@ -179,7 +179,7 @@
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>联系买家</span>
                 </div>
-                <div v-if="status.orderStatus === 'REFUND'" class="box-btn-right">
+                <div v-if="status.orderStatus === 'REFUND'" class="box-btn-right" @click="refund">
                     <img src="/native/imgs/btn_01@3x.png" alt="" />
                     <span>同意退款</span>
                 </div>
@@ -246,6 +246,7 @@ export default {
             Boxes: [],
             cardCaseInfo: {},
             total: '',
+            tradeId: '',
             addressList: [],
             name: '',
             orderInfoId: '',
@@ -326,6 +327,7 @@ export default {
                 .then(res => {
                     this.hideLoading();
                     this.status = res;
+                    console.log(this.status);
                     this.cardBoxListLength = this.status.cardBoxList.length;
                     this.user = res.user;
                     this.addressList = res.address;
@@ -333,6 +335,7 @@ export default {
                     this.store = res.store;
                     this.Boxes = res.cardBoxList;
                     this.orderInfoId = res.id;
+                    console.log(this.orderInfoId);
                     this.postage = res.cardCase.postage;
                     this.cardCaseInfo = res.cardCase.collection;
                     if (this.status.orderStatus === 'CREATED') {
@@ -443,6 +446,32 @@ export default {
                 }
             });
         },
+        orderRefund() {
+            this.$http.post('orderRefundApply/applySuccess', { orderId: this.orderInfoId }).then(res => {
+                console.log(res);
+                this.tradeId = res.tradeId;
+            });
+        },
+        refund() {
+            wx.showModal({
+                title: '提示',
+                content: '确定同意退款?',
+                success: res => {
+                    if (res.confirm) {
+                        this.$http.post('orderRefundApply/audit', { id: this.tradeId }).then(res => {
+                            console.log(res);
+                            wx.showToast({
+                                icon: 'none',
+                                title: '退款成功'
+                            });
+                            setTimeout(() => {
+                                this.getFn();
+                            }, 1000);
+                        });
+                    }
+                }
+            });
+        },
         deletes() {
             wx.showModal({
                 title: '提示',
@@ -496,6 +525,11 @@ export default {
     },
     created() {
         this.getFn();
+        setTimeout(() => {
+            if (this.status.orderStatus == 'REFUND' || this.status.orderStatus === 'REFUNDED') {
+                this.orderRefund();
+            }
+        }, 1000);
     }
 };
 </script>

+ 1 - 1
src/pages/allsellout.vue

@@ -57,7 +57,7 @@ export default {
             this.empty = false;
             let userId = this.$store.state.userInfo.id;
             this.$http
-                .get('/orderInfo/showMyOrderInfos', {
+                .get('/orderInfo/showStoreOrder', {
                     orderStatus: this.allStatus(this.active),
                     userId
                 })

+ 1 - 2
src/pages/orderdetails.vue

@@ -307,6 +307,7 @@ export default {
                     this.caseId = res.caseId;
                     this.status = res;
                     this.store = res.store;
+                    // console.log(this.store);
                     this.addressList = res.address;
                     this.total = res.total;
                     this.Boxes = res.cardBoxList;
@@ -345,7 +346,6 @@ export default {
                     });
                 });
             // setTimeout(() => {
-            // this.$nextTick(() => {
             // if (this.status.orderStatus == 'COMPETED' || this.status.orderStatus == 'SEND') {
             // console.log(this.status.orderStatus);
             this.$http.get('/orderInfo/checkLogistic', { orderInfoId: this.$mp.query.id }).then(res => {
@@ -363,7 +363,6 @@ export default {
                 this.stepsShow = res.logistic.result.list[0];
             });
             // }
-            // });
             // }, 1000);
         },
         again() {

+ 2 - 2
src/pages/wallet.vue

@@ -82,7 +82,7 @@ export default {
     methods: {
         loginMethods() {
             this.$http.get('/memberInfo/findByUser').then(res => {
-                // console.log(res);
+                console.log(res);
                 this.moneyInfo = res;
             });
         },
@@ -141,7 +141,7 @@ export default {
                 });
         }
     },
-    onLoad() {
+    onShow() {
         this.initApi(this.option1[0].text);
     }
 };

+ 118 - 27
src/pages/walletdetails.vue

@@ -8,24 +8,39 @@
 }
 </config>
 <template>
-    <div>
-        <div>{{ moneyInfo.money || 320 }}</div>
-        <div class="box">
-            <span>¥</span>
-            <van-cell-group>
-                <van-field
-                    type="digit"
-                    :value="form.boxPrice"
-                    @input="form.boxPrice = $event.detail"
-                    placeholder="请输入金额"
-                >
-                </van-field>
-            </van-cell-group>
-            <van-button type="primary" size="small" @click="allMoney">全部</van-button>
+    <div class="top">
+        <div class="box-con">
+            <p>提现金额</p>
+            <div class="num">
+                <span>全部可提现 ¥</span>
+                <span>{{ moneyInfo.money || 320 }}</span>
+            </div>
+            <div class="box">
+                <div class="box-left">
+                    <!-- <img src="../native/imgs/icon_jiage@3x.png" alt="" /> -->
+                    <van-cell-group>
+                        <van-field
+                            type="digit"
+                            :value="form.boxPrice"
+                            @input="form.boxPrice = $event.detail"
+                            placeholder="请输入金额"
+                        >
+                        </van-field>
+                    </van-cell-group>
+                </div>
+                <div class="box-right" @click="allMoney">全部</div>
+            </div>
+            <div class="btom">
+                <span>提现至</span>
+                <div>
+                    <img src="../native/imgs/png_weixin@3x.png" alt="" />
+                    <span>微信钱包</span>
+                </div>
+            </div>
+            <van-button type="primary" size="small" :disabled="notWithdrawal" @click="Withdrawal(notWithdrawal)"
+                >申请退款</van-button
+            >
         </div>
-        <van-button type="primary" size="small" :disabled="notWithdrawal" @click="Withdrawal(notWithdrawal)"
-            >申请退款</van-button
-        >
     </div>
 </template>
 <script>
@@ -66,19 +81,20 @@ export default {
                 });
                 return;
             }
+            if (!this.form.boxPrice) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请输入金额'
+                });
+                return;
+            }
             this.showLoading();
             let userId = this.$store.state.userInfo.id;
-            console.log(this.form.boxPrice);
             this.$http
                 .post('/memberInfo/newWithDraw', { userId, money: this.form.boxPrice })
                 .then(res => {
                     this.hideLoading();
-                    // console.log(res);
-                    // wx.showToast({
-                    //     icon: 'none',
-                    //     title: '提现审核中,72小时内通过',
-                    //     duration: 4000
-                    // });
+                    this.navigateTo('/pages/walletreview');
                 })
                 .catch(e => {
                     this.hideLoading();
@@ -92,9 +108,84 @@ export default {
 };
 </script>
 <style lang="less" scoped>
-.box {
-    .flex();
-    span {
+/deep/ .van-button {
+    width: 290px !important;
+    height: 48px !important;
+    background: #ff6c00;
+    border-radius: 12px;
+    margin: 77px 0 0 20px;
+    font-size: 16px !important;
+    width: 100%;
+}
+.top {
+    width: 375px;
+    height: 491px;
+    padding-top: 25px;
+    background: linear-gradient(180deg, #ff6c00 0%, #ffffff 100%);
+    .box-con {
+        width: 335px;
+        height: 708px;
+        background: #ffffff;
+        border-radius: 8px;
+        margin-left: 20px;
+        p {
+            font-size: 14px;
+            font-weight: bold;
+            color: #000000;
+            line-height: 20px;
+            padding: 30px 0 4px 16px;
+        }
+        .num {
+            .flex();
+            padding-left: 16px;
+            span {
+                font-size: 13px;
+                font-weight: 400;
+                color: #c8c9cc;
+                line-height: 22px;
+            }
+        }
+        .box {
+            .flex();
+            justify-content: space-between;
+            padding: 16px 16px 23px 16px;
+            .box-left {
+                img {
+                    width: 15px;
+                    height: 17px;
+                }
+            }
+            .box-right {
+                width: 70px;
+                height: 31px;
+                border-radius: 8px;
+                border: 1px solid #ff6c00;
+                font-size: 13px;
+                color: #ff6c00;
+                font-weight: 500;
+                line-height: 31px;
+                text-align: center;
+            }
+        }
+        .btom {
+            .flex();
+            padding: 0 17px;
+            justify-content: space-between;
+            div {
+                .flex();
+                img {
+                    width: 24px;
+                    height: 22px;
+                    margin-right: 5px;
+                }
+            }
+            span {
+                font-size: 14px;
+                font-weight: bold;
+                color: #000000;
+                line-height: 24px;
+            }
+        }
     }
 }
 </style>

+ 99 - 0
src/pages/walletreview.vue

@@ -0,0 +1,99 @@
+<config>
+{
+    "navigationBarTitleText": "提交成功",
+    "navigationBarBackgroundColor": "#ffffff",
+    "navigationBarTextStyle": "black"
+}
+</config>
+<template>
+    <div class="review">
+        <van-image width="100%" :src="img" fit="widthFix" />
+        <div class="content">
+            <div class="text1">{{ title }}</div>
+            <div class="text2">{{ desc }}</div>
+
+            <template>
+                <van-button type="primary" block @click="navigateBack">返回</van-button>
+            </template>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            authentication: null
+        };
+    },
+    computed: {
+        status() {
+            return this.authentication ? this.authentication.status : '';
+        },
+        img() {
+            const imgs = [
+                'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/shenqing_yitongguo.png',
+                'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/shenqing_yitongguo@3x.png'
+            ];
+            return imgs[this.status === 'CREATED' ? 0 : 1];
+        },
+        title() {
+            const list = ['提交成功', '审核已通过'];
+            return list[this.status === 'CREATED' ? 0 : 1];
+        },
+        desc() {
+            const list = [
+                '您已成功申请提现服务,待审核成功后钱款将在72小时内提现到您的账户,请注意查收',
+                '您已申请的提现服务已通过审核,钱款将在72小时内提现到您的账户,请注意查收'
+            ];
+            return list[this.status === 'CREATED' ? 0 : 1];
+        }
+    },
+    methods: {
+        // loginMethods() {
+        //     this.$http
+        //         .postJson('/storeAuthentication/all', {
+        //             query: { userId: this.$store.state.userInfo.id, del: false }
+        //         })
+        //         .then(res => {
+        //             console.log(res);
+        //             // if (!res.empty) {
+        //             //     this.authentication = res.content[0];
+        //             //     if (res.content[0].status === 'PASS') {
+        //             //         this.navigateBack();
+        //             //     }
+        //             // }
+        //         });
+        // }
+    }
+};
+</script>
+
+<style lang="less" scoped>
+.review {
+    .flex-col();
+    padding: 22px 26px 100px;
+    .content {
+        .flex-col();
+        padding: 0 15px;
+        text-align: center;
+
+        .text1 {
+            font-size: 22px;
+            color: #000000;
+            line-height: 32px;
+        }
+
+        .text2 {
+            font-size: 14px;
+            color: #939599;
+            line-height: 24px;
+            padding: 16px 0 60px;
+        }
+
+        ._van-button + ._van-button {
+            margin-top: 20px;
+        }
+    }
+}
+</style>