diff --git a/Frontend/src/App.vue b/Frontend/src/App.vue
index 43424a10..04a9db1f 100644
--- a/Frontend/src/App.vue
+++ b/Frontend/src/App.vue
@@ -4,11 +4,19 @@
@@ -32,6 +40,16 @@ const isHiddenNav = computed(() => {
return result
})
+const isAdminRoute = computed(() => route.matched.some(r => r.meta.isAdmin))
+
+const shouldCenterUserContent = computed(() => {
+ if (isAdminRoute.value) {
+ return false
+ }
+
+ return route.name !== 'auth' && route.name !== 'not-found'
+})
+
// 全局购物车数量状态
const cartCount = ref(0)
@@ -98,6 +116,16 @@ loadCartCount()
z-index: 1;
}
+.page-renderer {
+ min-height: 100%;
+}
+
+.page-renderer.centered-user-shell > * {
+ width: 100%;
+ max-width: var(--frontend-page-max-width);
+ margin: 0 auto;
+}
+
/* 当导航栏隐藏时,移除底部 padding */
.page-content.no-nav-padding {
padding-bottom: 0;
diff --git a/Frontend/src/components/BottomNav.vue b/Frontend/src/components/BottomNav.vue
index c2521959..e43efcbf 100644
--- a/Frontend/src/components/BottomNav.vue
+++ b/Frontend/src/components/BottomNav.vue
@@ -113,8 +113,9 @@ const handleNavClick = (tab: string) => {
.bottom-nav {
position: fixed;
bottom: 0;
- left: 0;
- right: 0;
+ left: 50%;
+ right: auto;
+ width: min(100%, var(--frontend-page-max-width));
height: 60px;
background: white;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
@@ -125,7 +126,7 @@ const handleNavClick = (tab: string) => {
overflow: hidden;
backface-visibility: hidden;
will-change: transform;
- transform: translateZ(0);
+ transform: translateX(-50%) translateZ(0);
transition: none !important;
}
@@ -135,7 +136,6 @@ const handleNavClick = (tab: string) => {
align-items: center;
height: 100%;
width: 100%;
- max-width: 600px;
padding: 0 10px;
transition: none !important;
}
@@ -182,4 +182,4 @@ const handleNavClick = (tab: string) => {
.nav-item.active .nav-label {
font-weight: 600;
}
-
\ No newline at end of file
+
diff --git a/Frontend/src/style.css b/Frontend/src/style.css
index 7e35e179..d96ae20a 100644
--- a/Frontend/src/style.css
+++ b/Frontend/src/style.css
@@ -6,6 +6,8 @@
--text-secondary: #999999;
--border-radius-base: 10px;
--border-radius-large: 30px;
+ --frontend-page-max-width: 480px;
+ --admin-content-max-width: 1440px;
}
* {
@@ -21,6 +23,7 @@ body {
}
.mobile-container {
+ width: 100%;
max-width: 375px;
margin: 0 auto;
min-height: 100vh;
@@ -28,3 +31,9 @@ body {
position: relative;
overflow-x: hidden;
}
+
+@media (min-width: 768px) {
+ .mobile-container {
+ max-width: var(--frontend-page-max-width);
+ }
+}
diff --git a/Frontend/src/views/ArtistOrderView.vue b/Frontend/src/views/ArtistOrderView.vue
index 96098437..789e8a30 100644
--- a/Frontend/src/views/ArtistOrderView.vue
+++ b/Frontend/src/views/ArtistOrderView.vue
@@ -120,4 +120,13 @@ onMounted(loadOrders)
.title { font-weight: 600; }
.line { margin-top: 4px; color: #666; font-size: 13px; }
.appointment { color: #1890ff; }
+
+@media (min-width: 768px) {
+ .header {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
diff --git a/Frontend/src/views/CartView.vue b/Frontend/src/views/CartView.vue
index 492cc0c7..41b368f2 100644
--- a/Frontend/src/views/CartView.vue
+++ b/Frontend/src/views/CartView.vue
@@ -539,4 +539,14 @@ onMounted(async () => {
.artist-option.active { border-color: #1890ff; color: #1890ff; background: #f0f9ff; }
.artist-option img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.time-picker { border-radius: 8px; }
+
+@media (min-width: 768px) {
+ .header,
+ .footer {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
diff --git a/Frontend/src/views/CouponView.vue b/Frontend/src/views/CouponView.vue
index 137a9e5f..1c075322 100644
--- a/Frontend/src/views/CouponView.vue
+++ b/Frontend/src/views/CouponView.vue
@@ -283,4 +283,13 @@ onMounted(() => {
background: #fff1f0;
color: #ff4d4f;
}
-
\ No newline at end of file
+
+@media (min-width: 768px) {
+ .header {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
+
diff --git a/Frontend/src/views/OrderView.vue b/Frontend/src/views/OrderView.vue
index eb435acb..c1187a44 100644
--- a/Frontend/src/views/OrderView.vue
+++ b/Frontend/src/views/OrderView.vue
@@ -119,4 +119,13 @@ onMounted(loadOrders)
.title { font-weight: 600; }
.line { margin-top: 4px; color: #666; font-size: 13px; }
.appointment { color: #1890ff; }
+
+@media (min-width: 768px) {
+ .header {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
diff --git a/Frontend/src/views/ProductDetailView.vue b/Frontend/src/views/ProductDetailView.vue
index 38af75cf..f4b6e6a0 100644
--- a/Frontend/src/views/ProductDetailView.vue
+++ b/Frontend/src/views/ProductDetailView.vue
@@ -560,4 +560,13 @@ onMounted(() => {
height: 44px;
border-radius: 22px;
}
+
+@media (min-width: 768px) {
+ .action-buttons {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
diff --git a/Frontend/src/views/ProductListView.vue b/Frontend/src/views/ProductListView.vue
index d25470b0..20609ae0 100644
--- a/Frontend/src/views/ProductListView.vue
+++ b/Frontend/src/views/ProductListView.vue
@@ -568,4 +568,13 @@ onMounted(async () => {
color: #999;
font-size: 14px;
}
+
+@media (min-width: 768px) {
+ .header {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
diff --git a/Frontend/src/views/ProfileView.vue b/Frontend/src/views/ProfileView.vue
index be26867a..d60c2071 100644
--- a/Frontend/src/views/ProfileView.vue
+++ b/Frontend/src/views/ProfileView.vue
@@ -1027,4 +1027,14 @@ const loadWishlistCount = async () => {
background: #f5f5f5;
color: #8b8b9a;
}
+
+@media (min-width: 768px) {
+ .header-bg,
+ .header {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
diff --git a/Frontend/src/views/ShopDetailView.vue b/Frontend/src/views/ShopDetailView.vue
index df4d4a63..c1103707 100644
--- a/Frontend/src/views/ShopDetailView.vue
+++ b/Frontend/src/views/ShopDetailView.vue
@@ -386,4 +386,14 @@ onMounted(() => {
object-fit: contain;
border-radius: 8px;
}
-
\ No newline at end of file
+
+@media (min-width: 768px) {
+ .header-bg,
+ .header {
+ width: min(100%, var(--frontend-page-max-width));
+ left: 50%;
+ right: auto;
+ transform: translateX(-50%);
+ }
+}
+
diff --git a/Frontend/src/views/admin/AdminLayout.vue b/Frontend/src/views/admin/AdminLayout.vue
index 603a3eb7..34c8142c 100644
--- a/Frontend/src/views/admin/AdminLayout.vue
+++ b/Frontend/src/views/admin/AdminLayout.vue
@@ -31,47 +31,51 @@