Fix(订单):[#1621]已完成的订单无法删除

This commit is contained in:
lifizer
2024-05-22 14:21:51 +08:00
parent e6960b8c2a
commit ac49206b91
2 changed files with 29 additions and 22 deletions
+22 -17
View File
@@ -49,25 +49,30 @@ export function takeOrderHandle(orderId) {
export function delOrderHandle(orderId) {
return new Promise((resolve, reject) => {
dialog.confirm({
mes: "确认删除该订单?",
opts() {
delOrder(orderId)
.then(res => {
uni.showModal({
title: '提示',
content: '确认删除该订单?',
success(res) {
if (res.confirm) {
delOrder(orderId).then(res => {
uni.showToast({
title: '删除成功', icon: 'success', duration: 2000
});
resolve(res);
title: '删除成功',
icon: 'success',
duration: 2000
})
resolve(res)
}).catch(err => {
uni.showToast({
title: '删除失败',
icon: 'none',
duration: 2000
})
reject(err)
})
.catch(err => {
uni.showToast({
title: '删除失败', icon: 'none', duration: 2000
});
reject(err);
});
}
});
});
}
}
})
})
}
export function payOrderHandle(orderId, type, from) {
+7 -5
View File
@@ -233,9 +233,11 @@
</template>
<template v-if="status.type == 4">
<view class="bnt cancel" @click="delOrder">删除订单</view>
<view class="bnt default" @click="
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
" v-if="orderInfo.isTickets!==1">查看物流
<view
v-if="orderInfo.isTickets !== 1"
class="bnt default"
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
>查看物流
</view>
</template>
<template v-if="status.type == 6">
@@ -483,8 +485,8 @@ export default {
},
delOrder() {
delOrderHandle(this.orderInfo.orderId).then(() => {
setTimeout(() => this.goBack(), 300);
});
this.goBack()
})
},
setOfflinePayStatus: function (status) {
var that = this;