style:根据不同浏览器环境 判断对应支付方式
This commit is contained in:
parent
cfb13dae85
commit
4632930025
|
@ -542,7 +542,7 @@
|
||||||
let orderInfo = await this.createdOrder(payType);
|
let orderInfo = await this.createdOrder(payType);
|
||||||
if (orderInfo.pay_status == 2 || [1, 2].includes(orderInfo.channel)) {//pay_status 2已支付 channel 1 支付宝 2微信
|
if (orderInfo.pay_status == 2 || [1, 2].includes(orderInfo.channel)) {//pay_status 2已支付 channel 1 支付宝 2微信
|
||||||
let orderNumber = orderInfo.pay_status == 2 ? orderInfo.order_number : orderInfo.original_order_number;
|
let orderNumber = orderInfo.pay_status == 2 ? orderInfo.order_number : orderInfo.original_order_number;
|
||||||
window.location.replace('/paysuccess.html?order_number=' + orderNumber+'&token='+localStorage.getItem('token'));
|
window.location.replace('/paysuccess.html?order_number=' + orderNumber + '&token=' + localStorage.getItem('token'));
|
||||||
} else {
|
} else {
|
||||||
this.createdPay(orderInfo.order_number);
|
this.createdPay(orderInfo.order_number);
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@
|
||||||
let data = {
|
let data = {
|
||||||
"token": localStorage.getItem('token'),
|
"token": localStorage.getItem('token'),
|
||||||
"key": localStorage.getItem('key'),
|
"key": localStorage.getItem('key'),
|
||||||
"code_batch_id": this.goodsDetail.coupon.code_batch_id||this.goodsDetail.code_batch_id,
|
"code_batch_id": this.goodsDetail.coupon.code_batch_id || this.goodsDetail.code_batch_id,
|
||||||
"goods_id": this.goodInfo.goods_id,
|
"goods_id": this.goodInfo.goods_id,
|
||||||
"account": this.account || '888888', /* 卡密时默认账号 */
|
"account": this.account || '888888', /* 卡密时默认账号 */
|
||||||
"pay_type": payType == 2 ? 1 : 5,
|
"pay_type": payType == 2 ? 1 : 5,
|
||||||
|
@ -589,7 +589,6 @@
|
||||||
|
|
||||||
//根据环境去执行
|
//根据环境去执行
|
||||||
payWayRun (result) {
|
payWayRun (result) {
|
||||||
console.log(391, this.payType);
|
|
||||||
if (this.payType == 1) {// 1微信支付 2 支付宝支付
|
if (this.payType == 1) {// 1微信支付 2 支付宝支付
|
||||||
if (isWx()) {
|
if (isWx()) {
|
||||||
|
|
||||||
|
@ -599,7 +598,6 @@
|
||||||
}
|
}
|
||||||
if (this.payType == 2) {// 1微信支付 2 支付宝支付
|
if (this.payType == 2) {// 1微信支付 2 支付宝支付
|
||||||
if (isWx()) {
|
if (isWx()) {
|
||||||
this.openErrorDialog(`请在其他浏览器打开链接`, '点击复制')
|
|
||||||
this.href = result;
|
this.href = result;
|
||||||
} else {
|
} else {
|
||||||
window.location.href = result;
|
window.location.href = result;
|
||||||
|
|
|
@ -233,7 +233,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 去支付 */
|
/* 去支付 */
|
||||||
payFunction ({ payType, isSupport }) {
|
payFunction ({ payType }) {
|
||||||
/* payType 1:微信 2:支付宝 */
|
/* payType 1:微信 2:支付宝 */
|
||||||
/* 后端 微信是5 */
|
/* 后端 微信是5 */
|
||||||
this.active = payType === 2 ? 1 : 5
|
this.active = payType === 2 ? 1 : 5
|
||||||
|
@ -250,16 +250,16 @@
|
||||||
|
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
this.getOrderList()
|
this.getOrderList()
|
||||||
this.payRealFunction(isSupport)
|
this.payRealFunction()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.payRealFunction(isSupport)
|
this.payRealFunction()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 调用支付 */
|
/* 调用支付 */
|
||||||
payRealFunction (isSupport) {
|
payRealFunction () {
|
||||||
req.axiosGet(`/key/coupon/createPay/${this.activeOrder.order_number}`, { token: localStorage.getItem('token') }).then(({ code, data, message }) => {
|
req.axiosGet(`/key/coupon/createPay/${this.activeOrder.order_number}`, { token: localStorage.getItem('token') }).then(({ code, data, message }) => {
|
||||||
if (code === 403) {
|
if (code === 403) {
|
||||||
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
|
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
|
||||||
|
@ -267,16 +267,9 @@
|
||||||
return this.redirect = true
|
return this.redirect = true
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 支付宝跳转链接 */
|
/* 跳转链接 */
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
/* 判断浏览器 */
|
window.location.href = data
|
||||||
if (isSupport) {
|
|
||||||
this.popFunction({ title: '温馨提示', text: `请在其他浏览器打开链接`, status: 2, b_text: '点击复制', show: true })
|
|
||||||
this.href = data
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
window.location.href = data
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue