diff --git a/libs/wechat.js b/libs/wechat.js index b95b507..de04fa9 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -1,4 +1,4 @@ -import { subscribeMessage } from '@/libs/order' +// import { subscribeMessage } from '@/libs/order' import { getProvider } from '@/utils' import WechatJSSDK from 'wechat-jssdk/dist/client.umd' import { getWechatConfig, wechatAuth } from '@/api/public' @@ -65,7 +65,7 @@ export const weappPay = option => { resolve(success) }, 3000) // #ifdef MP-WEIXIN - subscribeMessage() + // subscribeMessage() // #endif }, fail: error => { diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index e211e46..c45c512 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -743,21 +743,7 @@ export default { icon: "none", duration: 2000 }) - this.afterPaySuccess(orderId, (drawTicketResult) => { - if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) { - this.$yrouter.replace({ - path: "/pagesOrder/order/OrderDetails/index", - query: this.buildOrderDetailQuery(orderId, drawTicketResult) - }) - } else { - this.$yrouter.replace({ - path: "/pages/order/MyOrder/index", - query: { - type: 2 - } - }) - } - }) + this.paySuccessToMyOrderOrDetail(orderId) break; case "WECHAT_H5_PAY": // H5支付 @@ -771,41 +757,17 @@ export default { case "WECHAT_PAY": // 小程序支付 weappPay(data.result.jsConfig).then(() => { - this.afterPaySuccess(orderId, () => { - this.$yrouter.replace({ - path: "/pages/order/MyOrder/index", - query: { - type: 1 - } - }) - }) + this.paySuccessToMyOrderOrDetail(orderId) }).catch(() => { - this.$yrouter.replace({ - path: "/pages/order/MyOrder/index", - query: { - type: 1 - } - }) + this.paySuccessToMyOrderOrDetail(orderId) }) break; case "WECHAT_APP_PAY": // APP支付 weappPay(data.result.jsConfig).then(() => { - this.afterPaySuccess(orderId, () => { - this.$yrouter.replace({ - path: "/pages/order/MyOrder/index", - query: { - type: 1 - } - }) - }) + this.paySuccessToMyOrderOrDetail(orderId) }).catch(() => { - this.$yrouter.replace({ - path: "/pages/order/MyOrder/index", - query: { - type: 1 - } - }) + this.paySuccessToMyOrderOrDetail(orderId) }) break; } @@ -820,9 +782,29 @@ export default { duration: 2000 }) }).finally(function () { + if (that.$refs.payPwdPop) { + that.$refs.payPwdPop.clear() + that.$refs.payPwdPop.close() + } that.isShowPayPwdPop = false - that.$refs.payPwdPop.clear() - that.$refs.payPwdPop.close() + }) + }, + paySuccessToMyOrderOrDetail(orderId) { + this.afterPaySuccess(orderId, (drawTicketResult) => { + if (this.orderGroupInfo.cartInfo && this.orderGroupInfo.cartInfo.length === 1) { + this.$yrouter.replace({ + path: "/pagesOrder/order/OrderDetails/index", + query: this.buildOrderDetailQuery(orderId, drawTicketResult) + }) + } else { + this.$yrouter.replace({ + path: "/pages/order/MyOrder/index", + query: { + type: 2, + query: this.buildOrderDetailQuery(orderId, drawTicketResult) + } + }) + } }) }, close() {