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

测试支付宝支付

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