From 4043de2473e540508df43c2382b9154808015f83 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jul 2026 11:29:33 +0800 Subject: [PATCH 1/2] Align admin section default routes --- assets/admin/src/constants/sections/index.js | 53 ++++++++++++++++---- assets/admin/src/router/index.js | 17 ++++++- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/assets/admin/src/constants/sections/index.js b/assets/admin/src/constants/sections/index.js index ddb007c8..82b8ef49 100644 --- a/assets/admin/src/constants/sections/index.js +++ b/assets/admin/src/constants/sections/index.js @@ -66,6 +66,19 @@ const COMPAT_PAGE_ORDER = [ const COMPAT_PAGE_ORDER_INDEX = new Map(COMPAT_PAGE_ORDER.map((key, index) => [key, index])) +const SECTION_DEFAULT_CHILDREN = { + global: 'global-common', + page_display: 'page-display-homepage', + 'post-list': 'post-list-page', + permissions: 'permissions-comment', + users: 'users-auth', + payment: 'payment-gateway', + shop: 'shop-products', + forum: 'forum-boards', + extensions: 'extensions-ip', + 'tools-compat': 'tools-import-export', +} + const DEMOTED_PAGE_OVERRIDES = { 'post-list-submit': { label: '前台投稿(兼容)', @@ -184,16 +197,30 @@ function pickChildren(section, childKeys = []) { })) } +function attachSectionDefaultRoute(section) { + const defaultChildKey = SECTION_DEFAULT_CHILDREN[section.key] + const defaultChild = (section.children || []).find((child) => child.key === defaultChildKey) + + if (!defaultChild) { + return section + } + + return { + ...section, + defaultRoute: defaultChild.route, + } +} + const primarySections = [ - globalSection, - pageDisplaySection, - withoutChildren(postListSection, DEMOTED_CHILDREN['post-list']), - permissionsSection, - withoutChildren(usersSection, DEMOTED_CHILDREN.users), - withoutChildren(paymentSection, DEMOTED_CHILDREN.payment), - withoutChildren(shopSection, DEMOTED_CHILDREN.shop), - withoutChildren(forumSection, DEMOTED_CHILDREN.forum), - withoutChildren(extensionsSection, DEMOTED_CHILDREN.extensions), + attachSectionDefaultRoute(globalSection), + attachSectionDefaultRoute(pageDisplaySection), + attachSectionDefaultRoute(withoutChildren(postListSection, DEMOTED_CHILDREN['post-list'])), + attachSectionDefaultRoute(permissionsSection), + attachSectionDefaultRoute(withoutChildren(usersSection, DEMOTED_CHILDREN.users)), + attachSectionDefaultRoute(withoutChildren(paymentSection, DEMOTED_CHILDREN.payment)), + attachSectionDefaultRoute(withoutChildren(shopSection, DEMOTED_CHILDREN.shop)), + attachSectionDefaultRoute(withoutChildren(forumSection, DEMOTED_CHILDREN.forum)), + attachSectionDefaultRoute(withoutChildren(extensionsSection, DEMOTED_CHILDREN.extensions)), ] const compatChildren = [ @@ -212,19 +239,23 @@ const compatChildren = [ return leftIndex - rightIndex }) -export const compatToolsSection = { +export const compatToolsSection = attachSectionDefaultRoute({ key: 'tools-compat', label: '兼容&工具', icon: toolsSection.icon, route: '/tools', children: compatChildren, -} +}) export const ADMIN_SECTIONS = [ ...primarySections, compatToolsSection, ] +export function getAdminSections() { + return ADMIN_SECTIONS +} + export function getAllAdminPages() { const pages = [] diff --git a/assets/admin/src/router/index.js b/assets/admin/src/router/index.js index 6d28ca64..d1bac765 100644 --- a/assets/admin/src/router/index.js +++ b/assets/admin/src/router/index.js @@ -1,5 +1,5 @@ import { createRouter, createWebHashHistory } from 'vue-router' -import { getAllAdminPages } from '@/constants/admin-sections' +import { getAdminSections, getAllAdminPages } from '@/constants/admin-sections' import { componentLoaders } from './component-loaders/index.js' const ADMIN_DEFAULT_ROUTE = '/global/common' @@ -57,8 +57,23 @@ function createRouteMeta(page) { return meta } +function createSectionRedirectRoutes() { + const seenPaths = new Set(['/']) + + return getAdminSections() + .filter((section) => section.defaultRoute && section.route !== section.defaultRoute && !seenPaths.has(section.route)) + .map((section) => { + seenPaths.add(section.route) + return { + path: section.route, + redirect: section.defaultRoute, + } + }) +} + const routes = [ { path: '/', redirect: ADMIN_DEFAULT_ROUTE }, + ...createSectionRedirectRoutes(), ...getAllAdminPages().map((page) => ({ path: page.route, name: page.name, From 1284ebc63e6860387357573ee0100e6f7dcc071d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jul 2026 11:49:31 +0800 Subject: [PATCH 2/2] Align forum shop and user page shells --- assets/css/frontend/forum/board.css | 58 ++++++++++++++++++-- assets/css/frontend/forum/topic.css | 69 +++++++++++++++++++++++- assets/css/frontend/product-archive.css | 16 ++++-- assets/css/routes/product.css | 21 +++++++- assets/css/routes/user-center/part-1.css | 20 +++++++ assets/css/routes/user-home.css | 38 ++++++++++--- templates/forum/forum-board.php | 55 +++++++++++++++++-- templates/forum/forum-topic.php | 40 +++++++++++++- templates/pages/page-forums.php | 49 +++++++++++------ templates/pages/page-product.php | 9 +++- templates/pages/page-profile.php | 8 ++- templates/pages/page-user-home.php | 7 +++ templates/shop/product-cat.php | 1 + templates/shop/product-tag.php | 1 + 14 files changed, 348 insertions(+), 44 deletions(-) diff --git a/assets/css/frontend/forum/board.css b/assets/css/frontend/forum/board.css index 122ac577..68c1be79 100644 --- a/assets/css/frontend/forum/board.css +++ b/assets/css/frontend/forum/board.css @@ -1,8 +1,58 @@ -/* ============================================================ - * Forum — 板块页、主题页、发帖页 - * ============================================================ */ +/* Forum home-shell refinement */ +.aksrt-forum-board__hero { + margin-bottom: 20px; + padding: 20px; + border-radius: 16px; + background: linear-gradient(180deg, rgba(59,130,246,0.06), rgba(255,255,255,0.96)); + border: 1px solid var(--color-line-soft, rgba(0,0,0,0.06)); +} + +.aksrt-forum-board__summary { + display: flex; + flex-wrap: wrap; + gap: 12px; + margin-top: 16px; +} + +.aksrt-forum-board__summary-item { + min-width: 120px; + padding: 10px 14px; + border-radius: 999px; + background: var(--surface-1, #fff); + border: 1px solid var(--color-line-soft, rgba(0,0,0,0.06)); +} + +.aksrt-forum-board__summary-label { + display: block; + margin-bottom: 4px; + font-size: 12px; + color: var(--color-ink-4, #8a909c); +} + +.aksrt-forum-board__layout { + align-items: start; +} + +.aksrt-forum-board__governance--inline { + margin-bottom: 20px; +} + +.aksrt-forum-board__sidebar { + display: flex; + flex-direction: column; + gap: 16px; +} + +.aksrt-forum-board__governance-card--sidebar { + position: sticky; + top: calc(var(--nav-height, 64px) + 16px); +} + +.aksrt-forum-board__moderators--stacked { + flex-direction: column; + align-items: stretch; +} -/* Board page */ .aksrt-forum-board { padding-top: 24px; padding-bottom: 48px; diff --git a/assets/css/frontend/forum/topic.css b/assets/css/frontend/forum/topic.css index e4ded01f..c8799f7b 100644 --- a/assets/css/frontend/forum/topic.css +++ b/assets/css/frontend/forum/topic.css @@ -3,12 +3,71 @@ * ============================================================ */ .aksrt-forum-topic { + display: grid; + grid-template-columns: minmax(0, 1fr) 280px; + gap: 24px; padding-top: 24px; padding-bottom: 48px; - max-width: 800px; - margin: 0 auto; } +.aksrt-forum-topic__shell { + min-width: 0; +} + +.aksrt-forum-topic__sidebar { + display: flex; + flex-direction: column; + gap: 16px; +} + +.aksrt-forum-topic__sidebar-card { + padding: 18px; + background: var(--surface-1, #fff); + border: 1px solid var(--color-line-soft, rgba(0,0,0,0.06)); + border-radius: 14px; + box-shadow: 0 1px 4px rgba(0,0,0,0.04); +} + +.aksrt-forum-topic__sidebar-card h2 { + margin: 0 0 12px; + font-size: 15px; +} + +.aksrt-forum-topic__sidebar-link { + display: flex; + flex-direction: column; + gap: 6px; + color: inherit; + text-decoration: none; +} + +.aksrt-forum-topic__sidebar-link span { + font-size: 13px; + color: var(--color-ink-3, #8a909c); +} + +.aksrt-forum-topic__sidebar-author { + display: flex; + align-items: center; + gap: 12px; +} + +.aksrt-forum-topic__sidebar-author img { + border-radius: 50%; +} + +.aksrt-forum-topic__sidebar-author strong, +.aksrt-forum-topic__board-link { + color: var(--color-ink); +} + +.aksrt-forum-topic__board-link-wrap { + display: inline-flex; + align-items: center; + gap: 6px; +} + + .aksrt-forum-topic__breadcrumb { font-size: 13px; color: var(--color-ink-4, #8a909c); @@ -325,6 +384,12 @@ font-size: 14px; } +@media (max-width: 960px) { + .aksrt-forum-topic { + grid-template-columns: minmax(0, 1fr); + } +} + .aksrt-forum-topic__login-notice a { color: var(--color-primary); } diff --git a/assets/css/frontend/product-archive.css b/assets/css/frontend/product-archive.css index 04dd094b..81230196 100644 --- a/assets/css/frontend/product-archive.css +++ b/assets/css/frontend/product-archive.css @@ -50,9 +50,19 @@ color: var(--color-ink-4, #8A8F98); } -/* ================================================ - * 商品网格 - * ================================================ */ + +.aksrt-product-archive__eyebrow { + display: inline-flex; + align-items: center; + min-height: 28px; + padding: 0 12px; + margin-bottom: 10px; + border-radius: 999px; + background: var(--surface-2, #f4f5f7); + color: var(--color-ink-3); + font-size: 12px; + font-weight: 600; +} .aksrt-product-archive__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); diff --git a/assets/css/routes/product.css b/assets/css/routes/product.css index 64a579d3..8b2b1376 100644 --- a/assets/css/routes/product.css +++ b/assets/css/routes/product.css @@ -109,8 +109,25 @@ object-fit: cover; } -/* ===== Badges & Price ===== */ -.aksrt-product-page__badges, + +.aksrt-product-page__service-strip { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin: 6px 0 4px; +} + +.aksrt-product-page__service-strip span { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 8px 12px; + border-radius: 999px; + background: var(--surface-2); + color: var(--color-ink-3); + font-size: 12px; + font-weight: 500; +} .aksrt-product-page__price-row, .aksrt-product-page__quantity, .aksrt-product-page__term-list, diff --git a/assets/css/routes/user-center/part-1.css b/assets/css/routes/user-center/part-1.css index 3120e9e2..04a667b9 100644 --- a/assets/css/routes/user-center/part-1.css +++ b/assets/css/routes/user-center/part-1.css @@ -26,6 +26,26 @@ width: 100%; } + +.uc-header__actions { + position: relative; +} + +.uc-header__action-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 18px; + height: 18px; + margin-left: 6px; + padding: 0 5px; + border-radius: 999px; + background: var(--color-error, #ef4444); + color: #fff; + font-size: 11px; + font-weight: 700; + line-height: 1; +} /* ==================== 左侧边栏 ==================== */ .uc-sidebar { position: sticky; diff --git a/assets/css/routes/user-home.css b/assets/css/routes/user-home.css index f9faa0c5..e94a78b4 100644 --- a/assets/css/routes/user-home.css +++ b/assets/css/routes/user-home.css @@ -635,12 +635,36 @@ } } -@media (max-width: 480px) { - .aksrt-user-home .uc-header__actions { - justify-content: flex-start; - } - .aksrt-user-home .dashboard--public { - padding: 14px; - } +.aksrt-user-home .uh-forum__section-head { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; + padding-bottom: 14px; + border-bottom: 1px solid var(--color-line-soft, rgba(0,0,0,0.06)); +} + +.aksrt-user-home .uh-forum__section-title-main { + margin: 0 0 6px; + font-size: 20px; + color: var(--color-ink); +} + +.aksrt-user-home .uh-forum__section-desc { + margin: 0; + color: var(--color-ink-3); + font-size: 13px; +} + +.aksrt-user-home .uh-forum__section-link { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 8px 14px; + border-radius: 999px; + background: var(--surface-2); + color: var(--color-ink-2); + text-decoration: none; } diff --git a/templates/forum/forum-board.php b/templates/forum/forum-board.php index e4575e28..7ce4a6bf 100644 --- a/templates/forum/forum-board.php +++ b/templates/forum/forum-board.php @@ -47,9 +47,12 @@ $name_sticky = __('置顶', 'aksrt'); $name_featured = __('精华', 'aksrt'); ?> -
+
+ +
+

@@ -84,8 +87,26 @@ $name_featured = __('精华', 'aksrt');
-
-
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+

@@ -138,8 +159,8 @@ $name_featured = __('精华', 'aksrt');
- -
+ +
@@ -290,6 +311,30 @@ $name_featured = __('精华', 'aksrt');
+
+ +
diff --git a/templates/forum/forum-topic.php b/templates/forum/forum-topic.php index 31765353..cde9ee34 100644 --- a/templates/forum/forum-topic.php +++ b/templates/forum/forum-topic.php @@ -109,7 +109,9 @@ $is_locked = !empty($topic['locked']); $comments_enabled = !empty($permissions['can_reply']); ?> -
+
+ +
@@ -126,6 +128,7 @@ $comments_enabled = !empty($permissions['can_reply']);
+

@@ -152,6 +155,10 @@ $comments_enabled = !empty($permissions['can_reply']);

+ + + + @@ -173,6 +180,10 @@ $comments_enabled = !empty($permissions['can_reply']);
+ +