Browse Source

feat: 支持小程序支付

zhangyuhan 7 months ago
parent
commit
084c58c258
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/views/order/detail.vue

+ 4 - 2
src/views/order/detail.vue

@@ -325,8 +325,10 @@ export default class OrderDetail extends Vue {
       wx: `/weixin/pay/datareport?ordercode=${this.ordercode}`
     }
     if (this.orderInfo.state === 0) {
-      // 去支付, 微信需要跳转到指定路径
-      if (this.$envs.inWX) {
+  
+      if (window.navigator.userAgent.indexOf('miniProgram') !== -1) {
+        location.href = `/jyapp/pay/checkout_subvip?order_code=${this.ordercode}&orderCode=${this.ordercode}&code=${this.ordercode}&ordercode=${this.ordercode}&t=3`
+      } else if (this.$envs.inWX) {
         location.href = payUrl[this.$env.platform]
       } else {
         this.$router.push(payUrl[this.$env.platform])