Эх сурвалжийг харах

fix:时间格式&配置

yangfeng 3 жил өмнө
parent
commit
3056aa0011

+ 0 - 1
.env.alone

@@ -4,4 +4,3 @@ VUE_APP_BASE_URL='/'
 VUE_APP_MOCK=false
 VUE_APP_MOCK=false
 VUE_APP_ALONE=true
 VUE_APP_ALONE=true
 VUE_APP_BASE_PUBLIC='/'
 VUE_APP_BASE_PUBLIC='/'
-VUE_APP_JY_API=''

+ 0 - 1
.env.development

@@ -3,4 +3,3 @@ VUE_APP_BASE_API='/bigmember'
 VUE_APP_BASE_URL='/swordfish/page_big_pc'
 VUE_APP_BASE_URL='/swordfish/page_big_pc'
 VUE_APP_MOCK=false
 VUE_APP_MOCK=false
 VUE_APP_BASE_PUBLIC='http://localhost:8080/'
 VUE_APP_BASE_PUBLIC='http://localhost:8080/'
-VUE_APP_JY_API=''

+ 0 - 1
.env.production

@@ -2,4 +2,3 @@ NODE_ENV=production
 VUE_APP_BASE_API='/bigmember'
 VUE_APP_BASE_API='/bigmember'
 VUE_APP_BASE_URL='/page_big_pc'
 VUE_APP_BASE_URL='/page_big_pc'
 VUE_APP_BASE_PUBLIC='/page_big_pc/'
 VUE_APP_BASE_PUBLIC='/page_big_pc/'
-VUE_APP_JY_API='/jyapi'

+ 0 - 1
.env.qiankun

@@ -3,4 +3,3 @@ VUE_APP_BASE_API='http://localhost:8081/bigmember'
 VUE_APP_BASE_URL='/'
 VUE_APP_BASE_URL='/'
 VUE_APP_MOCK=false
 VUE_APP_MOCK=false
 VUE_APP_BASE_PUBLIC='http://localhost:8081/'
 VUE_APP_BASE_PUBLIC='http://localhost:8081/'
-VUE_APP_JY_API=''

+ 4 - 1
src/api/modules/marketing.js

@@ -1,5 +1,8 @@
 import request from '@/api'
 import request from '@/api'
-const jyApi = process.env.VUE_APP_JY_API
+let jyApi = ''
+if (process.env.NODE_ENV === 'production') {
+  jyApi = '/jyapi'
+}
 /**
 /**
  * 轻量化营销服务
  * 轻量化营销服务
  */
  */

+ 9 - 9
src/components/limited-countdown/index.vue

@@ -60,14 +60,14 @@ export default {
     }
     }
   },
   },
   created () {
   created () {
-    this.initAdjustTime ()
+    this.initAdjustTime()
   },
   },
   mounted () {
   mounted () {
     this.countdown(this.endTime)
     this.countdown(this.endTime)
     document.addEventListener('visibilitychange', () => {
     document.addEventListener('visibilitychange', () => {
       if (document.visibilityState === 'visible') {
       if (document.visibilityState === 'visible') {
         // console.log('切出当前页')
         // console.log('切出当前页')
-        // this.initAdjustTime()
+        this.initAdjustTime()
       }
       }
     })
     })
   },
   },
@@ -109,21 +109,21 @@ export default {
           let hour = Math.floor((t / 3600000) % 24)
           let hour = Math.floor((t / 3600000) % 24)
           let min = Math.floor((t / 60000) % 60)
           let min = Math.floor((t / 60000) % 60)
           let sec = Math.floor((t / 1000) % 60)
           let sec = Math.floor((t / 1000) % 60)
-          hour = hour < 10 ? '0' + hour : hour
-          min = min < 10 ? '0' + min : min
-          sec = sec < 10 ? '0' + sec : sec
+          hour = hour < 10 && hour > 0 ? '0' + hour : hour
+          min = min < 10 && min > 0 ? '0' + min : min
+          sec = sec < 10 && sec > 0 ? '0' + sec : sec
           let format = ''
           let format = ''
           if (this.placeholder) {
           if (this.placeholder) {
-            format = `${day}天${hour}小时${min}分${sec}秒`
+            format = `${day} 天 ${hour} 时 ${min} 分 ${sec} 秒`
           } else {
           } else {
             if (day > 0) {
             if (day > 0) {
-              format = `${day}天${hour}小时${min}分${sec}秒`
+              format = `${day} 天 ${hour} 时 ${min} 分 ${sec} 秒`
             }
             }
             if (day <= 0 && hour > 0) {
             if (day <= 0 && hour > 0) {
-              format = `${hour}小时${min}分${sec}秒`
+              format = `${hour} 时 ${min} 分 ${sec} 秒`
             }
             }
             if (day <= 0 && hour <= 0) {
             if (day <= 0 && hour <= 0) {
-              format = `${min}分${sec}秒`
+              format = `${min}  ${sec} 秒`
             }
             }
           }
           }
           this.content = format
           this.content = format

+ 8 - 4
vue.config.js

@@ -73,15 +73,19 @@ module.exports = {
         logLevel: 'debug'
         logLevel: 'debug'
       },
       },
       '^/jyCoupon': {
       '^/jyCoupon': {
-        // target: 'https://jybx2-webtest.jydev.jianyu360.com',
-        target: 'http://192.168.3.240:826',
+        target: 'https://jybx2-webtest.jydev.jianyu360.com',
+        // target: 'http://192.168.3.240:826',
         changeOrigin: true,
         changeOrigin: true,
         logLevel: 'debug'
         logLevel: 'debug'
       },
       },
       '^/marketing': {
       '^/marketing': {
-        target: 'http://192.168.3.240:8077',
+        target: 'https://jybx2-webtest.jydev.jianyu360.com',
+        // target: 'http://192.168.3.240:8077',
         changeOrigin: true,
         changeOrigin: true,
-        logLevel: 'debug'
+        logLevel: 'debug',
+        pathRewrite: {
+          '': '/jyapi'
+        }
       }
       }
     },
     },
     headers: {
     headers: {