浏览代码

页面优化

cuiyalong 5 年之前
父节点
当前提交
d50bae30a2
共有 7 个文件被更改,包括 29 次插入13 次删除
  1. 1 1
      public/index.html
  2. 1 1
      src/App.vue
  3. 1 0
      src/router/modules/home.ts
  4. 1 1
      src/utils/index.ts
  5. 13 7
      src/utils/vConsole.ts
  6. 11 2
      src/views/buy/Buy.vue
  7. 1 1
      src/views/pay/Pay.vue

+ 1 - 1
public/index.html

@@ -16,7 +16,7 @@
     <meta name="format-detection" content="telephone=no">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
-    <title>剑鱼标讯</title>
+    <title>数据报告</title>
     <!-- 使用CDN的CSS文件 -->
     <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
     <link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />

+ 1 - 1
src/App.vue

@@ -3,7 +3,7 @@
     <template v-slot:main>
       <transition :name="transitionName" appear>
         <keep-alive :include="cashViews">
-          <router-view class="router j-container" :class="$env.isWeiXinBrowser ? 'wx' : ''" />
+          <router-view class="router j-container" :class="$env.isWeiXinBrowser ? 'wx' : 'app'" />
         </keep-alive>
       </transition>
     </template>

+ 1 - 0
src/router/modules/home.ts

@@ -43,6 +43,7 @@ export default [
   },
   {
     path: '/pay',
+    // 兼容微信端安全域名的别名
     alias: '/weixin/pay/datareport',
     name: 'pay',
     component: () => import(/* webpackChunkName: "pay" */ '@/views/pay/Pay.vue'),

+ 1 - 1
src/utils/index.ts

@@ -1,4 +1,4 @@
 import './globalDirectives'
 import './globalFilters'
 import './globalVariable'
-// import './vConsole'
+import './vConsole'

+ 13 - 7
src/utils/vConsole.ts

@@ -1,7 +1,13 @@
-if (process.env.NODE_ENV === 'development') {
-  // eslint-disable-next-line @typescript-eslint/no-var-requires
-  const VConsole = require('vconsole')
-  const vConsole = new VConsole()
-  console.log('vConsole', vConsole)
-  // console.log('env', process.env)
-}
+// if (process.env.NODE_ENV === 'development') {
+//   // eslint-disable-next-line @typescript-eslint/no-var-requires
+//   const VConsole = require('vconsole')
+//   const vConsole = new VConsole()
+//   console.log('vConsole', vConsole)
+//   // console.log('env', process.env)
+// }
+
+// eslint-disable-next-line @typescript-eslint/no-var-requires
+const VConsole = require('vconsole')
+const vConsole = new VConsole()
+console.log('vConsole', vConsole)
+// console.log('env', process.env)

+ 11 - 2
src/views/buy/Buy.vue

@@ -85,7 +85,12 @@
         <template #title>
           <p class="state">
             <span>我已阅读,理解并接受</span>
-            <a class="link highlight-text" @click.stop.prevent="toServiceTerms" href="/jyapp/front/staticPage/dataExport_serviceterms.html">《剑鱼标讯线上购买与服务条款》</a>
+            <a class="link highlight-text"
+              @click.stop.prevent="toServiceTerms"
+              :href="$env.isWeiXinBrowser ? '/front/staticPage/serviceterms.html' : '/jyapp/front/staticPage/dataExport_serviceterms.html'"
+            >
+            《剑鱼标讯线上购买与服务条款》
+            </a>
           </p>
         </template>
       </van-cell>
@@ -392,7 +397,11 @@ export default class BuyReport extends Vue {
       if (res.error_code === 0 && res.data.ordercode) {
         this.$toast.clear()
         this.saveState()
-        location.href = `/weixin/pay/datareport?ordercode=${res.data.ordercode}`
+        if (this.$env.isWeiXinBrowser) {
+          location.href = `/weixin/pay/datareport?ordercode=${res.data.ordercode}`
+        } else {
+          this.$router.push(`/pay?ordercode=${res.data.ordercode}`)
+        }
       }
     })
   }

+ 1 - 1
src/views/pay/Pay.vue

@@ -205,7 +205,7 @@ export default class Pay extends Vue {
   }
 
   // 开启定时任务,3s查询一次是否支付成功
-  checkAppPaySuccess (interval = true) {
+  checkAppPaySuccess () {
     const ordercode = this.orderInfo.ordercode
     const checkPaySuccessTimer = setInterval(() => {
       this.isPaySuccess({ ordercode }).then(res => {