完成Salon小程序合规整改

This commit is contained in:
2026-10-22 00:27:12 +08:00
parent 1120f9d5a9
commit da1f2d2cba
99 changed files with 2815 additions and 702 deletions
@@ -3,7 +3,7 @@ import { computed, 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 { afterSaleApi, orderApi, paymentApi } from '../api/order'
import { afterSaleApi, orderApi } from '../api/order'
import type { AfterSaleVO, OrderArtistChangeRequestVO, OrderArtistReviewVO } from '../api/order'
import { userApi, type ContactInfoVO } from '@/api/user'
import type { IdType } from '@/utils/id'
@@ -35,10 +35,7 @@ const formatDateTime = (value?: string) => value ? String(value).replace('T', '
const isQuoteStatus = (status?: unknown) => Number(status) === 0
const isQuoteConfirming = computed(() => isQuoteStatus(order.value?.status))
const statusClass = (status?: number) => isQuoteStatus(status) ? 'quote' : status === 2 ? 'done' : status === 3 ? 'cancelled' : status === 4 ? 'in-service' : 'pending'
const isOrderPaid = (target: any) => String(target?.paymentStatus || '').toUpperCase() === 'PAID'
const canPreparePayment = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 1 && !isOrderPaid(order.value))
const canMockPay = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 1 && String(order.value?.paymentStatus || '').toUpperCase() === 'PAYING')
const canApplyAfterSale = computed(() => !isQuoteConfirming.value && (Number(order.value?.status) === 2 || isOrderPaid(order.value)))
const canApplyAfterSale = computed(() => !isQuoteConfirming.value && Number(order.value?.status) === 2)
const timeline = computed(() => {
const current = order.value || {}
@@ -197,24 +194,6 @@ const confirmQuote = () => {
})
}
const preparePayment = async () => {
if (!order.value?.id) return
await runWithGlobalLoading(async () => {
await paymentApi.prepareOrderPayment(order.value.id)
await loadOrder()
})
message.success('支付单已准备')
}
const mockPay = async () => {
if (!order.value?.id) return
await runWithGlobalLoading(async () => {
await paymentApi.mockSuccess(order.value.id)
await loadOrder()
})
message.success('模拟支付成功')
}
const cancelOrder = () => {
if (!order.value?.id) return
Modal.confirm({
@@ -357,8 +336,6 @@ onMounted(loadOrder)
</section>
<section class="action-bar">
<a-button v-if="canPreparePayment" @click="preparePayment">准备支付</a-button>
<a-button v-if="canMockPay" type="primary" @click="mockPay">模拟支付</a-button>
<a-button v-if="canApplyAfterSale" @click="router.push({ path: '/after-sale/apply', query: { orderId } })">申请售后</a-button>
<a-button v-if="order.status === 1" danger @click="cancelOrder">取消订单</a-button>
</section>