提交 e645b12f authored 作者: pengxiaohui's avatar pengxiaohui

微信内支付调起jsapi支付

上级 d22e09b4
......@@ -66,7 +66,7 @@ export default {
shopInfo: {},
popupOptions: {},
payment_order_id: '',
payment_method: '4',
payment_method: '3',
order_params: ''
}
},
......@@ -85,7 +85,7 @@ export default {
return window.sessionStorage.getItem('isBackFormWxPay')
},
openId () {
return window.localStorage.getItem('openId')
return window.localStorage.getItem('openId') || 'oF3a-t9pFpmL2gWuTmtWs5HlDGkU'
}
},
beforeMount() {
......@@ -207,11 +207,19 @@ export default {
checkPayStatus({ payment_order_id: id }).then(res => {})
},
placeOrderCallback(res) {
console.log(res)
const payType = this.payment_method
console.log(payType)
if (payType === '3') {
// 微信内支付
if (typeof res.payment_more_info === 'string') {
const payInfo = JSON.parse(res.payment_more_info)
if (payInfo.appId) {
WeixinJSBridge.invoke('getBrandWCPayRequest', payInfo, (res) => {
console.log(res)
})
} else {
console.log('下单失败')
}
}
} else if (payType === '4') {
// 微信外微信h5支付
window.sessionStorage.setItem('isBackFormWxH5Pay', 1)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论