|
@@ -97,7 +97,6 @@ export default class Pay extends Vue {
|
|
|
|
|
|
mounted () {
|
|
mounted () {
|
|
this.getInfo()
|
|
this.getInfo()
|
|
- console.log(this.$wxSdk)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
radioCheck (type) {
|
|
radioCheck (type) {
|
|
@@ -125,30 +124,31 @@ export default class Pay extends Vue {
|
|
|
|
|
|
// 确认支付
|
|
// 确认支付
|
|
confirmPay () {
|
|
confirmPay () {
|
|
- this.$toast.loading({
|
|
|
|
- message: '加载中...',
|
|
|
|
- forbidClick: true,
|
|
|
|
- duration: 0
|
|
|
|
- })
|
|
|
|
- const data = {
|
|
|
|
- payway: this.payWay,
|
|
|
|
- ordercode: this.orderInfo.ordercode
|
|
|
|
- }
|
|
|
|
- this.getPaySign(data).then(res => {
|
|
|
|
- if (res.error_code === 0) {
|
|
|
|
- this.$toast.clear()
|
|
|
|
- if (res.status === 1) {
|
|
|
|
- // 获取参数成功,判断是微信h5还是非微信h5
|
|
|
|
- if (this.env.isWeiXinBrowser) {
|
|
|
|
- this.wxPayCallBack(res.data.payStr)
|
|
|
|
- } else {
|
|
|
|
- this.appPayCallBack(res.data.payStr)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.$toast(res.error_msg || '获取支付信息失败')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ this.wxPayCallBack('')
|
|
|
|
+ // this.$toast.loading({
|
|
|
|
+ // message: '加载中...',
|
|
|
|
+ // forbidClick: true,
|
|
|
|
+ // duration: 0
|
|
|
|
+ // })
|
|
|
|
+ // const data = {
|
|
|
|
+ // payway: this.payWay,
|
|
|
|
+ // ordercode: this.orderInfo.ordercode
|
|
|
|
+ // }
|
|
|
|
+ // this.getPaySign(data).then(res => {
|
|
|
|
+ // if (res.error_code === 0) {
|
|
|
|
+ // this.$toast.clear()
|
|
|
|
+ // if (res.status === 1) {
|
|
|
|
+ // // 获取参数成功,判断是微信h5还是非微信h5
|
|
|
|
+ // if (this.env.isWeiXinBrowser) {
|
|
|
|
+ // this.wxPayCallBack(res.data.payStr)
|
|
|
|
+ // } else {
|
|
|
|
+ // this.appPayCallBack(res.data.payStr)
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$toast(res.error_msg || '获取支付信息失败')
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
}
|
|
}
|
|
|
|
|
|
// 微信h5支付逻辑
|
|
// 微信h5支付逻辑
|
|
@@ -180,6 +180,9 @@ export default class Pay extends Vue {
|
|
signType: sign.signType,
|
|
signType: sign.signType,
|
|
paySign: sign.paySign,
|
|
paySign: sign.paySign,
|
|
appId: sign.appId
|
|
appId: sign.appId
|
|
|
|
+ },
|
|
|
|
+ success: () => {
|
|
|
|
+ console.log(123)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -213,7 +216,7 @@ export default class Pay extends Vue {
|
|
if (res.error_code === 0 && res.data.status === 1) {
|
|
if (res.error_code === 0 && res.data.status === 1) {
|
|
// 支付完成订单,关闭定时器
|
|
// 支付完成订单,关闭定时器
|
|
clearInterval(checkPaySuccessTimer)
|
|
clearInterval(checkPaySuccessTimer)
|
|
- this.$router.push(`/pay-success/${ordercode}`)
|
|
|
|
|
|
+ this.$router.replace(`/pay-success/${ordercode}`)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}, 3000)
|
|
}, 3000)
|