|
@@ -3,14 +3,19 @@
|
|
</route>
|
|
</route>
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import SectionHeading from '@/components/section-heading.vue'
|
|
import SectionHeading from '@/components/section-heading.vue'
|
|
-import { getPointsOrder } from '../../../../core/libs/requests'
|
|
|
|
|
|
+import { cancelOrder, getPointsOrder } from '../../../../core/libs/requests'
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
|
+import { requestToast } from '../../../../core/utils/common'
|
|
|
|
|
|
const id = ref()
|
|
const id = ref()
|
|
const status = ref({ '0': '待交付', '1': '已完成', '2': '已驳回', '3': '已撤销' })
|
|
const status = ref({ '0': '待交付', '1': '已完成', '2': '已驳回', '3': '已撤销' })
|
|
const payTypes = ref({ 0: '积分支付', 1: '现金支付' })
|
|
const payTypes = ref({ 0: '积分支付', 1: '现金支付' })
|
|
const { data, run: setData } = useRequest(() => getPointsOrder(id.value), { initialData: {} })
|
|
const { data, run: setData } = useRequest(() => getPointsOrder(id.value), { initialData: {} })
|
|
|
|
+const handleSubmit = async () => {
|
|
|
|
+ await requestToast(() => cancelOrder(id.value), { success: true, successTitle: '取消成功' })
|
|
|
|
+ await setData()
|
|
|
|
+}
|
|
onLoad((query: { id: string }) => {
|
|
onLoad((query: { id: string }) => {
|
|
id.value = query.id
|
|
id.value = query.id
|
|
setData()
|
|
setData()
|
|
@@ -77,7 +82,9 @@ onLoad((query: { id: string }) => {
|
|
<div class="flex-1"></div>
|
|
<div class="flex-1"></div>
|
|
<BottomAppBar fixed>
|
|
<BottomAppBar fixed>
|
|
<div>
|
|
<div>
|
|
- <wd-button :round="false" block v-if="data.orderStatus === '0'">取消订单</wd-button>
|
|
|
|
|
|
+ <wd-button :round="false" block v-if="data.orderStatus === '0'" @click="handleSubmit">
|
|
|
|
+ 取消订单
|
|
|
|
+ </wd-button>
|
|
</div>
|
|
</div>
|
|
</BottomAppBar>
|
|
</BottomAppBar>
|
|
</div>
|
|
</div>
|