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

测试支付宝支付

上级 e645b12f
......@@ -66,7 +66,7 @@ export default {
shopInfo: {},
popupOptions: {},
payment_order_id: '',
payment_method: '3',
payment_method: '12',
order_params: ''
}
},
......@@ -81,17 +81,17 @@ export default {
shop_id () {
return this.query.shop_id || '6800681447305773056'
},
isBackFormWxPay () {
return window.sessionStorage.getItem('isBackFormWxPay')
isBackFormPay () {
return window.sessionStorage.getItem('isBackFormPay')
},
openId () {
return window.localStorage.getItem('openId') || 'oF3a-t9pFpmL2gWuTmtWs5HlDGkU'
return window.localStorage.getItem('openId') // 'oF3a-t9pFpmL2gWuTmtWs5HlDGkU'
}
},
beforeMount() {
this.fetchGoodsDetails()
this.fetchShopDetails()
if (this.isBackFormWxH5Pay) {
if (this.isBackFormH5Pay) {
Dialog.alert({
title: '支付确认',
message: '确认已经完成微信支付',
......@@ -99,7 +99,7 @@ export default {
}).then(() => {
this.fetchCheckPayStatus()
})
window.sessionStorage.removeItem('isBackFormWxH5Pay')
window.sessionStorage.removeItem('isBackFormH5Pay')
}
if (this.isWxBrowser && !this.openId) {
const { code } = this.$route.query
......@@ -127,6 +127,7 @@ export default {
const isLogin = store.state.isLogin || (await store.dispatch('checkLogin'))
if (isLogin) {
if (this.isWxBrowser) {
console.log(1234)
this.payment_method = '3'
}
this.popupVisiable = true
......@@ -222,12 +223,14 @@ export default {
}
} else if (payType === '4') {
// 微信外微信h5支付
window.sessionStorage.setItem('isBackFormWxH5Pay', 1)
window.sessionStorage.setItem('isBackFormH5Pay', 1)
window.sessionStorage.setItem('payment_order_id', res.payment_order_id)
window.location.href = res.payment_url + '&redirect_url=' + encodeURIComponent(window.location.href)
} else if (payType === '12') {
// 支付宝网页支付
console.log(res)
window.sessionStorage.setItem('isBackFormH5Pay', 1)
window.sessionStorage.setItem('payment_order_id', res.payment_order_id)
window.location.href = res.payment_url
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论