杂务:更新 YumiNail 工作区

This commit is contained in:
xiaowang
2026-05-29 13:30:56 +08:00
parent 1d077d4089
commit 31cd06b5c9
16498 changed files with 10330586 additions and 2340 deletions
+35 -26
View File
@@ -1,12 +1,28 @@
<template>
<el-config-provider>
<ConfigProvider :locale="antdLocale" :theme="antdTheme">
<div class="app-container">
<BottomNav v-if="!isHiddenNav" />
<div class="page-content" :class="{ 'no-nav-padding': isHiddenNav }">
<router-view v-slot="{ Component }">
<component :is="Component" :key="route.path" />
</router-view>
<div
class="app-container"
:class="{
'app-container--phone-shell': !isAdminShell,
'app-container--admin': isAdminShell
}"
>
<div v-if="isAdminShell" class="admin-shell">
<div class="page-content no-nav-padding">
<router-view v-slot="{ Component }">
<component :is="Component" :key="route.path" />
</router-view>
</div>
</div>
<div v-else class="yumi-phone-frame" :class="{ 'yumi-phone-frame--hidden-nav': isHiddenNav }">
<BottomNav v-if="!isHiddenNav" />
<div class="page-content" :class="{ 'no-nav-padding': isHiddenNav }">
<router-view v-slot="{ Component }">
<component :is="Component" :key="route.path" />
</router-view>
</div>
</div>
</div>
</ConfigProvider>
@@ -35,6 +51,7 @@ import { userApi, type SystemMessageVO } from './api/user'
import antdLocale from './config/antdv-locale'
import { useGlobalConfirmEnter } from './composables/useConfirmEnter'
import { useShopTheme } from './composables/useShopTheme'
import { buildSystemMessageActionPath } from './utils/system-message-action'
/**
* Purpose: route supports App.vue by holding or executing the route page or API role.
@@ -46,7 +63,7 @@ const route = useRoute()
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const router = useRouter()
const { currentTheme, refreshShopTheme, resetShopTheme, setupShopThemeSync } = useShopTheme()
const { currentTheme, refreshShopTheme, setupShopThemeSync } = useShopTheme()
useGlobalConfirmEnter()
/**
* Purpose: ButtonPropsWithClass supports App.vue by holding or executing the button props with class page or API role.
@@ -57,6 +74,10 @@ const popupMessageOkButtonProps: ButtonPropsWithClass = { class: 'popup-message-
/** routerReady is a reactive state variable used by the template and event handlers. */
const routerReady = ref(false)
let stopThemeSync: (() => void) | undefined
const adminThemeRefreshOptions = { mode: 'admin' as const }
const customerThemeRefreshOptions = { mode: 'customer' as const }
const isAdminShell = computed(() => route.path.startsWith('/admin') || route.matched.some(r => r.meta.isAdmin))
/** isHiddenNav is a reactive state variable used by the template and event handlers. */
const isHiddenNav = computed(() => {
@@ -64,7 +85,7 @@ const isHiddenNav = computed(() => {
return true
}
if (route.path === '/' || route.path.startsWith('/admin')) {
if (route.path === '/' || isAdminShell.value) {
return true
}
@@ -135,11 +156,7 @@ const updateCartCount = async () => {
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const resolveSystemMessageActionPath = (item: SystemMessageVO) => {
const actionPath = String(item.actionPath || '').trim()
if (!actionPath || !actionPath.startsWith('/') || actionPath.startsWith('//')) {
return ''
}
return actionPath
return buildSystemMessageActionPath(item)
}
/**
@@ -224,11 +241,7 @@ provide('cartCount', cartCount)
watch(() => route.path, async () => {
// 检查当前是否是后台页面,如果是则不加载购物车数据
const isAdminPage = route.matched.some(r => r.meta.isAdmin)
if (isAdminPage) {
resetShopTheme()
} else {
await refreshShopTheme()
}
await refreshShopTheme(isAdminPage ? adminThemeRefreshOptions : customerThemeRefreshOptions)
if (!isAdminPage) {
await loadCartCount()
await checkPopupMessages()
@@ -242,11 +255,7 @@ onMounted(async () => {
stopThemeSync = setupShopThemeSync()
await router.isReady()
routerReady.value = true
if (route.matched.some(r => r.meta.isAdmin)) {
resetShopTheme()
} else {
await refreshShopTheme()
}
await refreshShopTheme(route.matched.some(r => r.meta.isAdmin) ? adminThemeRefreshOptions : customerThemeRefreshOptions)
await checkPopupMessages()
})
@@ -298,7 +307,7 @@ onUnmounted(() => {
.yumi-date-picker-panel .ant-picker-header {
padding: 8px 12px;
border-bottom-color: #eef1f5;
border-bottom-color: var(--theme-border);
}
.yumi-date-picker-panel .ant-picker-header button {
@@ -314,7 +323,7 @@ onUnmounted(() => {
.yumi-date-picker-panel .ant-picker-content th {
height: 34px;
color: #7b8494;
color: var(--text-secondary);
font-weight: 600;
}
@@ -344,7 +353,7 @@ onUnmounted(() => {
}
.yumi-date-picker-panel .ant-picker-footer {
border-top-color: #eef1f5;
border-top-color: var(--theme-border);
}
.yumi-date-time-panel .ant-picker-time-panel,