panhui %!s(int64=3) %!d(string=hai) anos
pai
achega
401d97c003
Modificáronse 1 ficheiros con 29 adicións e 13 borrados
  1. 29 13
      src/views/asset/Detail.vue

+ 29 - 13
src/views/asset/Detail.vue

@@ -923,20 +923,36 @@ export default {
                             holdDays = Number(res.value);
                             return Promise.resolve();
                         });
-                    } else if (_this.info.source === 'GIFT' && _this.info.type === 'PICTURE') {
-                        return _this.$http
-                            .get('/sysConfig/get/pic_gift_days')
-                            .catch(e => {
-                                return _this.$http.get('/sysConfig/get/gift_days');
-                            })
-                            .then(res => {
-                                holdDays = Number(res.value);
-                                return Promise.resolve();
-                            });
                     } else if (_this.info.source === 'GIFT') {
-                        return _this.$http.get('/sysConfig/get/gift_days').then(res => {
-                            holdDays = Number(res.value);
-                            return Promise.resolve();
+                        return _this.$http.get('/sysConfig/get/gift_change_time,git_pre_days').then(res => {
+                            console.log('63562');
+                            if (res.gift_change_time) {
+                                if (this.dayjs().isSameOrBefore(this.dayjs(res.gift_change_time.value))) {
+                                    let _days = res.git_pre_days.value.split(',');
+                                    if (_this.info.type === 'PICTURE') {
+                                        holdDays = Number(_days[1]);
+                                    } else {
+                                        holdDays = Number(_days[0]);
+                                    }
+                                    return Promise.resolve();
+                                }
+                            }
+                            if (_this.info.type === 'PICTURE') {
+                                return _this.$http
+                                    .get('/sysConfig/get/pic_gift_days')
+                                    .catch(e => {
+                                        return _this.$http.get('/sysConfig/get/gift_days');
+                                    })
+                                    .then(res => {
+                                        holdDays = Number(res.value);
+                                        return Promise.resolve();
+                                    });
+                            } else {
+                                return _this.$http.get('/sysConfig/get/gift_days').then(res => {
+                                    holdDays = Number(res.value);
+                                    return Promise.resolve();
+                                });
+                            }
                         });
                     } else {
                         return Promise.resolve();