Browse Source

fix(订单): 修复支付功能并优化支付流程

修改支付按钮点击事件,传递完整订单对象而非仅ID
添加openId到支付请求参数
支付完成后调用refresh方法刷新订单列表
修复支付成功后的状态更新问题
master
前端-胡立永 1 month ago
parent
commit
dda414f0bd
2 changed files with 9 additions and 7 deletions
  1. +1
    -1
      pages/personalCenter/breedSelect.vue
  2. +8
    -6
      pages_order/order/orderList.vue

+ 1
- 1
pages/personalCenter/breedSelect.vue View File

@ -391,7 +391,7 @@ export default {
border-radius: 50%;
&.active {
color: #fff;
color: #fff !important;
font-weight: bold;
background-color: #FFBF60;
}


+ 8
- 6
pages_order/order/orderList.vue View File

@ -67,7 +67,7 @@
<view class="action-btn details-btn" @click="viewOrderDetails(order.orderId)">
<text>查看详情</text>
</view>
<view class="action-btn pay-btn" v-if="order.status == 0" @click="goToPay(order.orderId)">
<view class="action-btn pay-btn" v-if="order.status == 0" @click="goToPay(order)">
<text>去付款</text>
</view>
<view class="action-btn pay-btn" v-if="[0, 1].includes(order.status)" @click="modifyOrder(order)">
@ -318,13 +318,15 @@
},
//
goToPay(orderId) {
goToPay({payId, orderId}) {
orderPay({
orderId: orderId
payId,
orderId,
openId : getOpenIdKey(),
}).then(res => {
this.pay(res.data)
this.pay(res)
}).catch(err => {
console.log(err);
this.refresh()
});
},
pay(params) {
@ -341,7 +343,6 @@
paySign: params.paySign,
success: (res) => {
this.$modal.showToast('支付成功')
this.getOrderList()
},
fail: (err) => {
this.loading = false
@ -351,6 +352,7 @@
complete: () => {
this.loading = false
this.isPaying = false
this.refresh()
}
})
},


Loading…
Cancel
Save