@@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { computed, h, onMounted, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { LeftOutlined } from '@ant-design/icons-vue'
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { Input, message, Modal } from 'ant-design-vue'
|
||||
import { afterSaleApi, orderApi } from '../api/order'
|
||||
import type { AfterSaleVO, OrderArtistChangeRequestVO, OrderArtistReviewVO } from '../api/order'
|
||||
import { userApi, type ContactInfoVO } from '@/api/user'
|
||||
@@ -196,11 +196,21 @@ const confirmQuote = () => {
|
||||
|
||||
const cancelOrder = () => {
|
||||
if (!order.value?.id) return
|
||||
const cancelReason = ref('')
|
||||
Modal.confirm({
|
||||
title: '取消订单',
|
||||
content: '确认取消这笔订单吗?',
|
||||
content: h('div', [
|
||||
h('p', { style: 'margin-bottom: 12px' }, '确认取消这笔订单吗?'),
|
||||
h(Input.TextArea, {
|
||||
rows: 3,
|
||||
maxlength: 255,
|
||||
showCount: true,
|
||||
placeholder: '可填写取消原因',
|
||||
'onUpdate:value': (value: string) => { cancelReason.value = value }
|
||||
})
|
||||
]),
|
||||
onOk: async () => {
|
||||
await runWithGlobalLoading(() => orderApi.cancelOrder(order.value.id as IdType))
|
||||
await runWithGlobalLoading(() => orderApi.cancelOrder(order.value.id as IdType, cancelReason.value.trim()))
|
||||
message.success('订单已取消')
|
||||
await loadOrder()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user