|
@ -82,6 +82,10 @@ |
|
|
async onReady() { |
|
|
async onReady() { |
|
|
await this.setPageHeight() |
|
|
await this.setPageHeight() |
|
|
// this.testAcceptScanCode() |
|
|
// this.testAcceptScanCode() |
|
|
|
|
|
this.preMakeOrder() |
|
|
|
|
|
}, |
|
|
|
|
|
onUnload(){ |
|
|
|
|
|
this.clearMakeOrder() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//测试扫码,弹窗提醒,点确定时执行acceptScanCode |
|
|
//测试扫码,弹窗提醒,点确定时执行acceptScanCode |
|
@ -124,6 +128,13 @@ |
|
|
} |
|
|
} |
|
|
return pay_type |
|
|
return pay_type |
|
|
}, |
|
|
}, |
|
|
|
|
|
async preMakeOrder(){ |
|
|
|
|
|
this.makeInfo = await this.makeOrder() |
|
|
|
|
|
if(!this.makeInfo?.order_no)return util.showNone("生成订单失败,请重新下单!") |
|
|
|
|
|
}, |
|
|
|
|
|
clearMakeOrder(){ |
|
|
|
|
|
this.makeInfo = null |
|
|
|
|
|
}, |
|
|
async acceptScanCode(code) { |
|
|
async acceptScanCode(code) { |
|
|
console.log("acceptScanCode:",code) |
|
|
console.log("acceptScanCode:",code) |
|
|
// util.showNone("支付中...") |
|
|
// util.showNone("支付中...") |
|
@ -136,15 +147,24 @@ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await this.makeOrder((makeInfo)=>{ |
|
|
|
|
|
console.log("makeInfo-result",makeInfo) |
|
|
|
|
|
}).then((orderInfo)=>{ |
|
|
|
|
|
console.log("orderInfo-result",orderInfo) |
|
|
|
|
|
return this.payOrder({ |
|
|
|
|
|
"order_no":orderInfo.order_no, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// await this.makeOrder((makeInfo)=>{ |
|
|
|
|
|
// console.log("makeInfo-result",makeInfo) |
|
|
|
|
|
// }).then((orderInfo)=>{ |
|
|
|
|
|
// console.log("orderInfo-result",orderInfo) |
|
|
|
|
|
// return this.payOrder({ |
|
|
|
|
|
// "order_no":orderInfo.order_no, |
|
|
|
|
|
// pay_code,pay_type |
|
|
|
|
|
// }) |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
let order_no = this.makeInfo?.order_no||"" |
|
|
|
|
|
if(!order_no)return util.showNone("支付失败,请重新下单!") |
|
|
|
|
|
await this.payOrder({ |
|
|
|
|
|
"order_no":order_no, |
|
|
pay_code,pay_type |
|
|
pay_code,pay_type |
|
|
}) |
|
|
|
|
|
}).then((payInfo)=>{ |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.then((payInfo)=>{ |
|
|
console.log("payInfo-result:",payInfo) |
|
|
console.log("payInfo-result:",payInfo) |
|
|
return this.checkOrder(payInfo) |
|
|
return this.checkOrder(payInfo) |
|
|
}).then(async (checkInfo)=>{ |
|
|
}).then(async (checkInfo)=>{ |
|
|