待支付订单支付

This commit is contained in:
2021-11-30 16:54:05 +08:00
parent 00677377ca
commit bb9f67d3f8
26 changed files with 879 additions and 598 deletions
+5 -3
View File
@@ -32,7 +32,8 @@
</div>
<div class="pay-button-container">
<van-button block type="primary" round class="pay-button" @click="onCreatePayOrder">确认支付</van-button>
<van-button v-if="query.order_id" block type="primary" round class="pay-button" @click="onContinuePayOrder">确认支付</van-button>
<van-button v-else block type="primary" round class="pay-button" @click="onCreatePayOrder">确认支付</van-button>
</div>
</div>
</div>
@@ -52,12 +53,14 @@ export default {
}
},
methods: {
onContinuePayOrder(){
this.onPayment({ id: this.query.order_id })
},
async onCreatePayOrder(){
// 创建日行一善支付订单
if(this.query.goods_type == '1'){
const request = {
...this.query,
}
const order = await createFriendlyDayOrder(request)
this.onPayment(order)
@@ -99,7 +102,6 @@ export default {
},
async onPayment(order){
console.log(order)
const result = await createPay(order.id);
const payResult = await requestPayment(result)
await this.$router.push({