|
|
|
@ -182,10 +182,10 @@ |
|
|
|
|
|
|
|
|
|
// 选择支付方式 |
|
|
|
|
handleSelectPayType(index) { |
|
|
|
|
if (this.methods[index].method == 'huifu') { |
|
|
|
|
this.$toast('抱歉,此支付方式暂未完善') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// if (this.methods[index].method == 'huifu') { |
|
|
|
|
// this.$toast('抱歉,此支付方式暂未完善') |
|
|
|
|
// return |
|
|
|
|
// } |
|
|
|
|
this.curPaymentItem = this.methods[index] |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -230,14 +230,36 @@ |
|
|
|
|
// 按钮禁用 |
|
|
|
|
if (app.disabled) return |
|
|
|
|
app.disabled = true |
|
|
|
|
// 提交到后端API |
|
|
|
|
CashierApi.orderPay(app.orderId, { |
|
|
|
|
method: app.curPaymentItem.method, |
|
|
|
|
client: app.platform, |
|
|
|
|
extra: app.getExtraAsUnify(app.curPaymentItem.method) |
|
|
|
|
if (app.curPaymentItem.method !== 'huifu') { |
|
|
|
|
// 提交到后端API |
|
|
|
|
CashierApi.orderPay(app.orderId, { |
|
|
|
|
method: app.curPaymentItem.method, |
|
|
|
|
client: app.platform, |
|
|
|
|
extra: app.getExtraAsUnify(app.curPaymentItem.method) |
|
|
|
|
}) |
|
|
|
|
.then(result => app.onSubmitCallback(result)) |
|
|
|
|
.finally(err => setTimeout(() => app.disabled = false, 10)) |
|
|
|
|
} else { |
|
|
|
|
console.log(app.curPaymentItem.method); |
|
|
|
|
CashierApi.unify({ |
|
|
|
|
outTradeNo: new Date().getTime(), |
|
|
|
|
totalFee: 1, |
|
|
|
|
}) |
|
|
|
|
.then(result => { |
|
|
|
|
const { miniPayRequest } = result.data.data; |
|
|
|
|
let appPayRequest = ''; |
|
|
|
|
appPayRequest = encodeURIComponent(JSON.stringify({ |
|
|
|
|
sign: miniPayRequest.sign, |
|
|
|
|
prepayid: miniPayRequest.prepayid, |
|
|
|
|
})); |
|
|
|
|
console.log(appPayRequest); |
|
|
|
|
uni.navigateToMiniProgram({ |
|
|
|
|
appId: miniPayRequest.miniuser, |
|
|
|
|
path: `${miniPayRequest.minipath}?appPayRequest=${appPayRequest}`, |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.then(result => app.onSubmitCallback(result)) |
|
|
|
|
.finally(err => setTimeout(() => app.disabled = false, 10)) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 获取第三方支付的扩展参数 |
|
|
|
|