xuqiang 4 лет назад
Родитель
Сommit
c8a72e62e5

+ 6 - 7
src/main/pc-space/src/components/PageHeader.vue

@@ -107,18 +107,17 @@ export default {
         avatarBox() {
             return this.userInfo.avatar;
         }
-        // type() {
-        //     return this.lists[0].org;
-        // }
     },
     mounted() {
         this.$EventBus.$on('login', () => {
-            this.Login()
+            this.Login();
         });
         this.getActive();
-        setTimeout(() => {
-            this.add();
-        }, 1000);
+        if (this.userInfo.authStatus !== 'NOT_AUTH') {
+            setTimeout(() => {
+                this.add();
+            }, 1000);
+        }
     },
     methods: {
         add() {

+ 16 - 3
src/main/pc-space/src/views/AssetDetail.vue

@@ -327,6 +327,9 @@ export default {
         setTimeout(() => {
             this.record();
         }, 1000);
+        if (this.userInfo.authStatus !== 'NOT_AUTH') {
+            this.add();
+        }
     },
     watch: {
         $route() {
@@ -548,6 +551,7 @@ export default {
                     }
                 )
                 .then(res => {
+                    console.log(res);
                     this.lists = res.content[0].org;
                     console.log(this.lists);
                 });
@@ -555,8 +559,8 @@ export default {
         send() {
             if (this.userInfo.authStatus === 'SUCCESS') {
                 this.$refs.send.show = true;
-            } else {
-                this.$confirm('未认证不能转增,是否认证', '认证', {
+            } else if (this.userInfo.authStatus === 'PENDING' || this.userInfo.authStatus === 'FAIL') {
+                this.$confirm('用户认证中,是否查看认证状态', '认证', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     customClass: 'myClass',
@@ -564,7 +568,7 @@ export default {
                 }).then(() => {
                     this.add();
                     this.$nextTick(() => {
-                        console.log(this.lists);
+                        // console.log(this.lists);
                         setTimeout(() => {
                             if (this.userInfo.authStatus !== 'NOT_AUTH' && this.lists == false) {
                                 this.add();
@@ -579,6 +583,15 @@ export default {
                         }, 1000);
                     });
                 });
+            } else if (this.userInfo.authStatus === 'NOT_AUTH') {
+                this.$confirm('未认证不可转增,是否认证', '认证', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    customClass: 'myClass',
+                    center: true
+                }).then(() => {
+                    this.$router.push('/authentication');
+                });
             }
         }
     }

+ 65 - 65
src/main/pc-space/src/views/CollectionDetail.vue

@@ -205,7 +205,7 @@
             </collection-info>
         </div>
         <!-- 悄悄话 -->
-        <el-dialog append-to-body class="abb" :visible.sync="show2" title="提示">
+        <!-- <el-dialog append-to-body class="abb" :visible.sync="show2" title="提示">
             <img
                 @click="openedFn"
                 class="imgBox"
@@ -213,9 +213,9 @@
                 alt=""
             />
             <div class="Whisper1">点击图标打开悄悄话,(隐藏内容,只能开启一次)</div>
-        </el-dialog>
+        </el-dialog> -->
         <!-- 悄悄话 -->
-        <el-dialog append-to-body v-if="init2" :visible.sync="show3" :before-close="handleClose2">
+        <!-- <el-dialog append-to-body v-if="init2" :visible.sync="show3" :before-close="handleClose2">
             <div class="title2">
                 <img class="img" v-if="init2.icon" :src="init2.icon[1]" alt="" />
                 <div class="title3">悄悄话</div>
@@ -226,9 +226,9 @@
                 说明:<span>{{ init2.remark || '暂无' }}</span>
             </div>
             <div v-if="init2.openTime" class="timename"><span class="time">开启时间:</span>{{ init2.openTime }}</div>
-        </el-dialog>
+        </el-dialog> -->
         <!-- 其余三个 -->
-        <el-dialog append-to-body :visible.sync="show4" :before-close="handleClose">
+        <!-- <el-dialog append-to-body :visible.sync="show4" :before-close="handleClose">
             <div class="title2">
                 <div class="title3">{{ list2.name }}</div>
             </div>
@@ -256,7 +256,7 @@
                 </div>
                 <div v-else class="timename"><span class="time">打开时间:</span>{{ list2.openTime }}</div>
             </div>
-        </el-dialog>
+        </el-dialog> -->
         <submit ref="sub"></submit>
     </div>
 </template>
@@ -320,65 +320,65 @@ export default {
         }
     },
     methods: {
-        copy() {
-            this.$copyText(this.list2.id).then(
-                e => {
-                    this.$message.success('复制成功');
-                },
-                e => {
-                    this.$message.warning('复制失败');
-                }
-            );
-        },
-        handleClose2() {
-            this.show3 = false;
-            this.getDetail();
-        },
-        handleClose() {
-            this.show4 = false;
-            this.getDetail();
-        },
-        Whisper() {
-            if (!this.init2.once) {
-                this.show2 = true;
-                this.$http
-                    .post('/asset/usePrivilege', {
-                        assetId: this.info.id,
-                        privilegeId: this.init2.id
-                    })
-                    .then(res => {
-                        console.log(res);
-                    });
-            }
-        },
-        privilegeFn(init) {
-            this.list2 = init;
-            if (!init.once) {
-                this.show4 = true;
-                this.$http
-                    .post('/asset/usePrivilege', {
-                        assetId: this.info.id,
-                        privilegeId: init.id
-                    })
-                    .then(res => {
-                        console.log(res);
-                    });
-            }
-        },
-        openedFn() {
-            this.show2 = false;
-            this.show3 = true;
-            if (!this.init2.once) {
-                this.$http
-                    .post('/asset/usePrivilege', {
-                        assetId: this.info.id,
-                        privilegeId: this.init2.id
-                    })
-                    .then(res => {
-                        console.log(res);
-                    });
-            }
-        },
+        // copy() {
+        //     this.$copyText(this.list2.id).then(
+        //         e => {
+        //             this.$message.success('复制成功');
+        //         },
+        //         e => {
+        //             this.$message.warning('复制失败');
+        //         }
+        //     );
+        // },
+        // handleClose2() {
+        //     this.show3 = false;
+        //     this.getDetail();
+        // },
+        // handleClose() {
+        //     this.show4 = false;
+        //     this.getDetail();
+        // },
+        // Whisper() {
+        //     if (!this.init2.once) {
+        //         this.show2 = true;
+        //         this.$http
+        //             .post('/asset/usePrivilege', {
+        //                 assetId: this.info.id,
+        //                 privilegeId: this.init2.id
+        //             })
+        //             .then(res => {
+        //                 console.log(res);
+        //             });
+        //     }
+        // },
+        // privilegeFn(init) {
+        //     this.list2 = init;
+        //     if (!init.once) {
+        //         this.show4 = true;
+        //         this.$http
+        //             .post('/asset/usePrivilege', {
+        //                 assetId: this.info.id,
+        //                 privilegeId: init.id
+        //             })
+        //             .then(res => {
+        //                 console.log(res);
+        //             });
+        //     }
+        // },
+        // openedFn() {
+        //     this.show2 = false;
+        //     this.show3 = true;
+        //     if (!this.init2.once) {
+        //         this.$http
+        //             .post('/asset/usePrivilege', {
+        //                 assetId: this.info.id,
+        //                 privilegeId: this.init2.id
+        //             })
+        //             .then(res => {
+        //                 console.log(res);
+        //             });
+        //     }
+        // },
         getDetail() {
             this.$http
                 .get('/collection/get/' + this.$route.query.id)

+ 76 - 3
src/main/pc-space/src/views/Submit.vue

@@ -55,7 +55,13 @@
                         <div class="qrcode">
                             <vue-qrcode :value="payUrl" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
                         </div>
-                        <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div>
+                        <!-- <div class="qrcode-text">二维码有效时常为5分钟,请尽快支付</div> -->
+                        <h3 class="qrcode-text">
+                            二维码有效时常为5分钟,<span v-if="minters < 10">0</span>{{ minters }}分<span
+                                v-if="seconds < 10"
+                                >0</span
+                            >{{ seconds }} 请尽快支付
+                        </h3>
                         <!-- <div class="qrcode-text">手机微信扫描二维码下单</div> -->
                     </div>
                 </div>
@@ -108,6 +114,11 @@ import resolveUrl from 'resolve-url';
 import { mapState } from 'vuex';
 import { add } from 'mathjs';
 export default {
+    props: {
+        statusAll: {
+            type: Object
+        }
+    },
     // mixins: [pageableTable],
     data() {
         return {
@@ -115,8 +126,13 @@ export default {
             show2: false,
             // url: '/userCoupon/all',
             chooseId: '',
+            org: '',
             empty: false,
             payMethods: 'WEIXIN',
+            minters: 0,
+            seconds: 0,
+            allTime: 5 * 60 - 1,
+            closeTime: '',
             list2: [],
             list3: [],
             payList: [
@@ -169,8 +185,63 @@ export default {
         if (this.isLogin) {
             this.add();
         }
+        if (this.matchedTime1 == 0) {
+            this.show = false;
+        }
     },
     methods: {
+        initTime(dingdanId, initTime) {
+            let oldTime = new Date(initTime).valueOf();
+            let newTime = new Date().valueOf();
+            let matchedTime = undefined;
+            let matchedTime1 = undefined;
+            if (oldTime) {
+                matchedTime = newTime - oldTime;
+                matchedTime1 = this.allTime - parseInt(matchedTime / 1000);
+                if (matchedTime1 > 0) {
+                    this.timeout(matchedTime1);
+                } else {
+                    this.show = false;
+                }
+            } else {
+                if (dingdanId) {
+                    this.timeout(this.allTime);
+                }
+            }
+        },
+        timeout(time) {
+            let _this = this;
+            _this.minters = parseInt(time / 60) > 0 ? parseInt(time / 60) : 0;
+            _this.seconds = parseInt(time - _this.minters * 60);
+            try {
+                if (_this.minters > 0) {
+                    _this.closeTime = setInterval(() => {
+                        _this.seconds--;
+                        if (_this.seconds <= 0) {
+                            _this.minters--;
+                            if (_this.minters == -1) {
+                                _this.minters = 0;
+                                _this.seconds = 0;
+                                clearInterval(_this.closeTime);
+                            } else {
+                                _this.seconds = 60;
+                            }
+                        }
+                    }, 1000);
+                } else {
+                    _this.closeTime = setInterval(() => {
+                        _this.seconds--;
+                        if (_this.seconds <= 0) {
+                            this.show = false;
+                            _this.seconds = 0;
+                            clearInterval(_this.closeTime);
+                        }
+                    }, 1000);
+                }
+            } catch (err) {
+                console.log(err);
+            }
+        },
         add() {
             this.$http
                 .post(
@@ -197,7 +268,7 @@ export default {
             this.show2 = true;
         },
         choose(info) {
-            console.log(info);
+            // console.log(info);
             this.chooseId = info.id;
             this.$store.commit('setCouponInfo', info);
         },
@@ -213,10 +284,11 @@ export default {
             this.$http
                 .post(url)
                 .then(res => {
+                    // console.log(res);
+                    this.initTime(res.id, res.createdAt);
                     if (this.money) {
                         this.status = res.status;
                         this.id = res.id;
-                        // this.show = false;
                     } else {
                         this.$message.success('支付成功');
                         setTimeout(() => {
@@ -231,6 +303,7 @@ export default {
                 });
         },
         init(info) {
+            this.status = 'Unpaid';
             this.checkLogin()
                 .then(() => {
                     this.show = true;