功能:完善订单流程和加固

This commit is contained in:
xiaowang
2026-05-23 15:16:40 +08:00
parent 9227ec6175
commit 3e6e1cc4e8
90 changed files with 6859 additions and 368 deletions
+19
View File
@@ -29,11 +29,13 @@ import SystemMessageCard from './components/SystemMessageCard.vue'
import { cartApi } from './api/cart'
import { userApi, type SystemMessageVO } from './api/user'
import antdLocale from './config/antdv-locale'
import { useGlobalConfirmEnter } from './composables/useConfirmEnter'
import { useShopTheme } from './composables/useShopTheme'
const route = useRoute()
const router = useRouter()
const { currentTheme, refreshShopTheme, resetShopTheme, setupShopThemeSync } = useShopTheme()
useGlobalConfirmEnter()
type ButtonPropsWithClass = ButtonProps & { class?: string }
const popupMessageOkButtonProps: ButtonPropsWithClass = { class: 'popup-message-ok-button' }
/** routerReady is a reactive state variable used by the template and event handlers. */
@@ -108,6 +110,22 @@ const updateCartCount = async () => {
await loadCartCount()
}
const resolveSystemMessageActionPath = (item: SystemMessageVO) => {
const actionPath = String(item.actionPath || '').trim()
if (!actionPath || !actionPath.startsWith('/') || actionPath.startsWith('//')) {
return ''
}
return actionPath
}
const openSystemMessageAction = async (item: SystemMessageVO) => {
const actionPath = resolveSystemMessageActionPath(item)
if (!actionPath) {
return
}
await router.push(actionPath)
}
/** showPopupMessage is a local helper used by this page script. */
const showPopupMessage = (item: SystemMessageVO) => {
return new Promise<void>((resolve) => {
@@ -142,6 +160,7 @@ const showPopupMessage = (item: SystemMessageVO) => {
okButtonProps: popupMessageOkButtonProps,
async onOk() {
await markShownAndResolve()
await openSystemMessageAction(item)
},
async afterClose() {
await markShownAndResolve()