guhongwei 3 лет назад
Родитель
Сommit
ed88e74597

+ 3 - 3
src/views/patent/admin/message/parts/list-4.vue

@@ -46,9 +46,9 @@ export default {
       if (newDate) return newDate;
     },
     getNum(num) {
-      if (num === 1) return '还有三个月到期';
-      else if (num === 2) return '还有两个月到期';
-      else if (num === 3) return '本月到期';
+      if (num == '1') return '还有三个月到期';
+      else if (num == '2') return '还有两个月到期';
+      else if (num == '3') return '本月到期';
       else return '暂无';
     },
   },

+ 3 - 3
src/views/patent/mech/patent/parts/list-4.vue

@@ -46,9 +46,9 @@ export default {
       if (newDate) return newDate;
     },
     getNum(num) {
-      if (num === 1) return '还有三个月到期';
-      else if (num === 2) return '还有两个月到期';
-      else if (num === 3) return '本月到期';
+      if (num == '1') return '还有三个月到期';
+      else if (num == '2') return '还有两个月到期';
+      else if (num == '3') return '本月到期';
       else return '暂无';
     },
   },

+ 3 - 3
src/views/patent/user/patent/early/parts/list-4.vue

@@ -46,9 +46,9 @@ export default {
       if (newDate) return newDate;
     },
     getNum(num) {
-      if (num === 1) return '还有三个月到期';
-      else if (num === 2) return '还有两个月到期';
-      else if (num === 3) return '本月到期';
+      if (num == '1') return '还有三个月到期';
+      else if (num == '2') return '还有两个月到期';
+      else if (num == '3') return '本月到期';
       else return '暂无';
     },
   },

+ 21 - 35
src/views/test.vue

@@ -51,42 +51,28 @@ export default {
       console.log(this.textname);
     },
     oneSearch() {
-      const limitMonth = 3;
-      const create_date = '2015-12-24';
-      // 当前年份
-      const now_year = moment(new Date()).format('YYYY');
-      // 专利日期
-      const patent_month = moment(create_date).format('MM-DD');
-      // 专利到期日期
-      const end = now_year + '-' + patent_month;
-      // 专利到期前一天
-      const endbeforeone = moment(end).subtract(1, 'd').format('YYYY-MM-DD');
-      // 专利到期日期减去三个月
-      const start = moment(end).subtract(limitMonth, 'months').format('YYYY-MM-DD');
+      const create_date = '2015-1-22';
+      // 专利到期时间
+      const expire_date = moment(new Date()).format('YYYY') + '-' + moment(create_date).format('MM-DD');
+      // 专利到期时间延后一个月
+      const end = moment(expire_date).add(1, 'months').format('YYYY-MM-DD');
+      // 专利到期前三个月
+      const start = moment(end).subtract(3, 'months').format('YYYY-MM-DD');
+      // 专利到期前两个月
+      const start_two = moment(end).subtract(2, 'months').format('YYYY-MM-DD');
+      // 专利到期前一个月
+      const start_thr = moment(end).subtract(1, 'months').format('YYYY-MM-DD');
+      // 判断是否是三个月的区间
       const r = moment().isBetween(start, end, null, '[]');
-      console.log(r);
-      // // 专利月日减去三个月
-      // const start = moment(end).subtract(limitMonth, 'months').format('MM-DD');
-      // // 专利月日减去一天
-      // const endbeforeone = moment(end).subtract(1, 'd').format('MM-DD');
-      // // 取得当前月份
-      // const month_now = moment(new Date()).format('MM-DD');
-      // const r = moment('02-01').isBetween(start, end, null, '[]');
-      // console.log(r);
-      // // // 取得当前年份
-      //
-      // // // 当前年份+一年
-      // const afterYear = moment(nowYear).add(1, 'year').format('YYYY');
-      // // // 开始时间(先组合日期,减去三个月)
-      // const nowDate = nowYear + '-' + month;
-      // const start = moment(nowDate).subtract(limitMonth, 'months').format('YYYY-MM-DD');
-      // console.log(start + '----------5');
-      // // 结束时间
-      // const end = nowYear + '-' + month;
-      // console.log(end + '----------6');
-      // const endbeforeone = moment(end).subtract(1, 'd').format('YYYY-MM-DD');
-      // const r = moment().isBetween(start, end, null, '[]');
-      // console.log(r);
+      if (r) {
+        // 三个月内的第一天||两个月内的第一天||一个月内的第一天
+        const toDay = moment('2022-01-22').format('YYYY-MM-DD');
+        if (toDay === start || toDay === start_two || toDay === start_thr) {
+          console.log('1');
+        }
+        const early_num = toDay === start ? 1 : toDay === start_two ? 2 : toDay === start_thr ? 3 : 1;
+        console.log(early_num);
+      }
     },
     // async twoSearch() {
     //   let res = await this.personalQuery({ code: 'XQGQ' });

+ 3 - 3
vue.config.js

@@ -30,17 +30,17 @@ module.exports = {
         ws: false,
       },
       '/api/question': {
-        target: 'http://127.0.0.1:9101', //http://192.168.1.19:9101
+        target: 'http://broadcast.kqyjy.com', //http://192.168.1.19:9101
         changeOrigin: true,
         ws: false,
       },
       '/api/achieve': {
-        target: 'http://127.0.0.1:9101', //http://192.168.1.19:9101
+        target: 'http://broadcast.kqyjy.com', //http://192.168.1.19:9101
         changeOrigin: true,
         ws: false,
       },
       '/api/live': {
-        target: 'http://127.0.0.1:9101', //http://127.0.0.1:9101
+        target: 'http://broadcast.kqyjy.com', //http://127.0.0.1:9101
         changeOrigin: true,
         ws: false,
       },