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

微信支付成功逻辑修改

cuiyalong 5 лет назад
Родитель
Сommit
db4bc11850

+ 0 - 2
public/index.html

@@ -11,8 +11,6 @@
     <meta name="x5-orientation" content="portrait">
     <meta name="screen-orientation" content="portrait">
     <meta name="x5-page-mode" content="app">
-    <meta name="apple-mobile-web-app-capable" content="yes" />
-    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
     <meta name="apple-mobile-web-app-capable" content="yes">
     <meta name="apple-mobile-web-app-status-bar-style" content="black">
     <meta name="format-detection" content="telephone=no">

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

@@ -29,7 +29,7 @@ export default [
     name: 'introduce',
     component: () => import(/* webpackChunkName: "index" */ '@/views/main/IntroducePage.vue'),
     meta: {
-      title: '',
+      title: '数据报告',
       layoutConf: true
     }
   },

+ 1 - 1
src/views/Test.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="j-main j-test">
+  <div class="j-test">
     <!-- 项目内部页面导航 -->
     <van-cell-group v-for="(conf, index) in confPageArr" :key="index" :title="conf.title">
       <van-cell

+ 1 - 0
src/views/buy/Buy.vue

@@ -358,6 +358,7 @@ export default class BuyReport extends Vue {
           // 将错误提示清空
           this.errorMsg.code = ''
           this.emailCodePass = true
+          this.sendedEmail = true
           this.$toast({
             message: '邮箱验证码验证成功',
             forbidClick: true,

+ 4 - 6
src/views/main/IntroducePage.vue

@@ -45,14 +45,12 @@ export default class Introduce extends Vue {
     { src: require('../../assets/image/shangjijiazhi.png'), title: '商机价值', desc: '通过剑鱼标讯数据报告分析,针对每个行业的独特视角,寻找适合企业发展的商机价值' }
   ]
 
-  created () {
-    document.title = '数据报告'
-  }
-
   mounted () {
-    console.log(this.$store.state)
     this.updateHeader({
-      transparentHeader: true
+      transparentHeader: true,
+      titleStyle: {
+        'font-size': 0
+      }
     })
     this.clearReportList()
   }

+ 8 - 5
src/views/pay/Pay.vue

@@ -155,8 +155,6 @@ export default class Pay extends Vue {
   // 微信h5支付逻辑
   wxPayCallBack (paySign: string) {
     const sign = paySign ? JSON.parse(paySign) : {}
-    console.log(this.$wxSdk)
-    console.log('sign---------------', sign)
     if (!this.$wxSdk) {
       return this.$toast({
         message: '微信Sdk初始化失败',
@@ -165,7 +163,6 @@ export default class Pay extends Vue {
       })
     }
     // 进行支付
-    console.log(this.$wxSdk)
     this.$wxSdk.chooseWXPayForWeiXinJSBridge({
       config: {
         timestamp: sign.timestamp,
@@ -176,7 +173,13 @@ export default class Pay extends Vue {
         appId: sign.appId
       },
       success: () => {
-        this.$router.replace(`/pay-success/${this.orderInfo.ordercode}`)
+        const ordercode = this.orderInfo.ordercode
+        // 查询订单,是否支付完成
+        this.isPaySuccess({ ordercode }).then(res => {
+          if (res.error_code === 0 && res.data.status === 1) {
+            this.$router.replace(`/pay-success/${ordercode}`)
+          }
+        })
       }
     })
   }
@@ -202,7 +205,7 @@ export default class Pay extends Vue {
   }
 
   // 开启定时任务,3s查询一次是否支付成功
-  checkAppPaySuccess () {
+  checkAppPaySuccess (interval = true) {
     const ordercode = this.orderInfo.ordercode
     const checkPaySuccessTimer = setInterval(() => {
       this.isPaySuccess({ ordercode }).then(res => {