feat:新增取消订单确认提示框

This commit is contained in:
wangsongsole 2022-10-27 11:26:39 +08:00
parent 276c54eeac
commit c1c1586f73
1 changed files with 24 additions and 16 deletions

View File

@ -81,8 +81,8 @@
</div>
<model-pop :show.sync="popShow" :title="popTitle" :status="popStatus" :text="popText" :bottom_text="bottomText"
@backFunction="backFunction">
<model-pop :show.sync="popShow" :cancel="isCancel" :title="popTitle" :status="popStatus" :text="popText"
:bottom_text="bottomText" @backFunction="backFunction">
</model-pop>
<!-- 单条弹出框 -->
@ -119,6 +119,7 @@
bottomText: '' /*1 成功 2提示 3失败 */,
goodsCount: 0,/* 商品数量 */
href: '',/* 支付链接 */
isCancel: false,
/* toast */
toastShow: '',
@ -210,19 +211,9 @@
/* 取消订单按钮 */
immediatelyCancel (item) {
const token = localStorage.getItem('token')
req.axiosPut(`/key/order/cancel/${item.order_number}?token=${token}`).then(({ code, message }) => {
if (code === 403) {
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
this.toPage(3)
return this.redirect = true
}
if (code === 200) {
this.popFunction({ title: '温馨提示', text: '取消订单成功', status: 2, b_text: '我知道了', show: true })
this.getOrderList()
}
})
this.isCancel = true;
this.activeOrder = item;
this.popFunction({ title: '温馨提示', text: '是否确认取消订单', status: 2, b_text: '', show: true })
},
/* 去支付 */
@ -326,6 +317,23 @@
if (this.redirect) {
this.toPage()
}
/* 二次确认提示 */
if (this.isCancel && type === 2) {
const token = localStorage.getItem('token')
req.axiosPut(`/key/order/cancel/${this.activeOrder.order_number}?token=${token}`).then(({ code, message }) => {
if (code === 403) {
this.popFunction({ title: '温馨提示', text: message, status: 2, b_text: '我知道了', show: true })
this.toPage(3)
return this.redirect = true
}
if (code === 200) {
this.popFunction({ title: '温馨提示', text: '取消订单成功', status: 2, b_text: '我知道了', show: true })
this.getOrderList()
}
})
this.isCancel = false;
}
},