Просмотр исходного кода

Merge branch 'dev' of xiongzhu/raex_front into master

熊竹 4 лет назад
Родитель
Сommit
d1e6675a8d
1 измененных файлов с 33 добавлено и 10 удалено
  1. 33 10
      src/views/asset/Detail.vue

+ 33 - 10
src/views/asset/Detail.vue

@@ -605,6 +605,7 @@ export default {
                 if (res.status == 'GIFTED' || res.status === 'TRANSFERRED') {
                     this.emitter.emit('refreash');
                 }
+                // res.source = 'GIFT';
                 this.info = res;
 
                 if (res.orderId) {
@@ -646,21 +647,43 @@ export default {
                 });
                 console.log(init);
                 if (init && !this.$store.state.reviewPay) {
-                    if (this.info.holdDays) {
-                        this.holdDays = Number(this.info.holdDays);
-                        this.getTime();
-                    } else {
-                        this.$http.get('/sysConfig/get/hold_days').then(res => {
-                            this.holdDays = Number(res.value);
-                            // this.holdDays = 10;
-                            this.getTime();
-                        });
-                    }
+                    this.setHolds();
                 } else {
                     this.$toast.clear();
                 }
             });
         },
+        setHolds() {
+            let holdDays = 0;
+            let _this = this;
+
+            function getHolds() {
+                if (_this.info.holdDays) {
+                    holdDays = Number(_this.info.holdDays);
+                    return Promise.resolve();
+                } else {
+                    return _this.$http.get('/sysConfig/get/hold_days').then(res => {
+                        holdDays = Number(res.value);
+                        return Promise.resolve();
+                    });
+                }
+            }
+            getHolds()
+                .then(() => {
+                    if (this.info.source === 'GIFT') {
+                        return this.$http.get('/sysConfig/get/gift_days').then(res => {
+                            holdDays = Number(res.value);
+                            return Promise.resolve();
+                        });
+                    } else {
+                        return Promise.resolve();
+                    }
+                })
+                .then(() => {
+                    this.holdDays = holdDays;
+                    this.getTime();
+                });
+        },
         openBlindBox() {
             this.$refs.box.show = true;
         },