修复退款审核前账号提前释放
This commit is contained in:
@@ -293,17 +293,20 @@ export function useOrderActions(options: UseOrderActionsOptions) {
|
||||
|
||||
async function handleCancel() {
|
||||
if (!order.value) return
|
||||
const needsRefundReview = order.value.status === 'pending_handoff'
|
||||
if (needsConfirm('cancel')) {
|
||||
const ok = await options.confirm({
|
||||
title: '取消订单',
|
||||
message: '确定取消订单并释放账号吗?',
|
||||
message: needsRefundReview
|
||||
? '确定申请取消订单吗?账号将在客服审核通过后释放,退款将原路退回。'
|
||||
: '确定取消订单并释放账号吗?',
|
||||
})
|
||||
if (!ok) return
|
||||
}
|
||||
cancelling.value = true
|
||||
try {
|
||||
await cancelOrder(order.value.id)
|
||||
options.notifySuccess('订单已取消,账号已释放')
|
||||
options.notifySuccess(needsRefundReview ? '退款申请已提交,等待客服审核' : '订单已取消,账号已释放')
|
||||
await router.push(options.ordersPath)
|
||||
} catch (error) {
|
||||
options.notifyError(readError(error, '取消失败'))
|
||||
|
||||
@@ -463,7 +463,7 @@ watch([() => route.query.focus, order, loading], () => {
|
||||
<div v-if="order.status === 'pending_handoff'" class="secondary-action-card danger">
|
||||
<div>
|
||||
<strong>不继续交接?</strong>
|
||||
<span>取消后将释放账号,订单会回到可租状态。</span>
|
||||
<span>取消后将提交退款申请,客服审核通过后账号才会恢复可租。</span>
|
||||
</div>
|
||||
<el-button type="danger" plain :loading="cancelling" @click="handleCancel">
|
||||
取消订单
|
||||
|
||||
Reference in New Issue
Block a user