diff --git a/frontend/src/components/InAppBrowserPrompt.vue b/frontend/src/components/InAppBrowserPrompt.vue index 65b632ba..21a5b30a 100644 --- a/frontend/src/components/InAppBrowserPrompt.vue +++ b/frontend/src/components/InAppBrowserPrompt.vue @@ -139,7 +139,7 @@ onMounted(() => { margin: 14px 0 18px; padding: 8px 13px; border-radius: 12px; - background: #f6f8fb; + background: var(--brand-canvas); color: #4b5563; font-size: 12px; line-height: 1.35; @@ -164,7 +164,7 @@ onMounted(() => { width: 100%; min-height: 48px; border: 0; - background: linear-gradient(135deg, #ff7a1a, #ef5b00); + background: linear-gradient(135deg, var(--brand-primary-hover), #ef5b00); color: #fff; font: inherit; font-size: 15px; diff --git a/frontend/src/features/announcement/components/AnnouncementPopup.vue b/frontend/src/features/announcement/components/AnnouncementPopup.vue index 3ded7270..61823db1 100644 --- a/frontend/src/features/announcement/components/AnnouncementPopup.vue +++ b/frontend/src/features/announcement/components/AnnouncementPopup.vue @@ -156,7 +156,12 @@ function handleClose() { width: 100%; height: 4px; flex-shrink: 0; - background: linear-gradient(90deg, #ff7a1a 0%, #ea580c 50%, #f97316 100%); + background: linear-gradient( + 90deg, + var(--brand-primary-hover) 0%, + var(--brand-primary-strong) 50%, + #f97316 100% + ); } /* ===== 头部:雅致浅色顶栏 + 品牌橙徽标 + 标题与标签 ===== */ @@ -180,10 +185,10 @@ function handleClose() { width: 46px; height: 46px; border-radius: 50%; - background: #fff7ed; - border: 1px solid #fed7aa; + background: var(--brand-primary-soft); + border: 1px solid var(--brand-border); box-shadow: 0 2px 8px rgba(234, 88, 12, 0.1); - color: #ea580c; + color: var(--brand-primary-strong); } .popup-icon-svg { @@ -198,7 +203,7 @@ function handleClose() { .popup-title { margin: 0; - color: #0f172a; + color: var(--brand-ink); font-size: 18px; font-weight: 700; line-height: 1.4; @@ -208,7 +213,7 @@ function handleClose() { .popup-subtitle { margin: 4px 0 0; - color: #64748b; + color: var(--brand-muted); font-size: 13px; line-height: 1.4; } @@ -217,10 +222,10 @@ function handleClose() { .popup-badge { flex-shrink: 0; padding: 4px 11px; - border: 1px solid #fed7aa; + border: 1px solid var(--brand-border); border-radius: 999px; - background: #fff7ed; - color: #ea580c; + background: var(--brand-primary-soft); + color: var(--brand-primary-strong); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; @@ -242,7 +247,7 @@ function handleClose() { padding: 20px 22px; border: 1px solid #eef2f6; border-radius: 14px; - background: #f8fafc; + background: var(--brand-canvas); } .popup-content { @@ -261,7 +266,7 @@ function handleClose() { } .popup-content :deep(a) { - color: #ea580c; + color: var(--brand-primary-strong); font-weight: 600; text-decoration: none; } @@ -271,7 +276,7 @@ function handleClose() { } .popup-content :deep(strong) { - color: #0f172a; + color: var(--brand-ink); font-weight: 700; } @@ -279,7 +284,7 @@ function handleClose() { .popup-content :deep(h2), .popup-content :deep(h3) { margin: 18px 0 10px; - color: #0f172a; + color: var(--brand-ink); font-size: 16px; font-weight: 700; line-height: 1.5; @@ -306,7 +311,7 @@ function handleClose() { } .popup-content :deep(li::marker) { - color: #ea580c; + color: var(--brand-primary-strong); } .popup-content :deep(blockquote) { @@ -314,16 +319,16 @@ function handleClose() { padding: 10px 16px; border-left: 3px solid #f97316; border-radius: 0 8px 8px 0; - background: #fff7ed; + background: var(--brand-primary-soft); color: #9a3412; } .popup-content :deep(code) { padding: 2px 6px; - border: 1px solid #fed7aa; + border: 1px solid var(--brand-border); border-radius: 5px; - background: #fff7ed; - color: #ea580c; + background: var(--brand-primary-soft); + color: var(--brand-primary-strong); font-size: 13.5px; } @@ -369,7 +374,11 @@ function handleClose() { min-height: 48px; border: none; border-radius: 12px; - background: linear-gradient(135deg, #ff7a1a 0%, #ea580c 100%); + background: linear-gradient( + 135deg, + var(--brand-primary-hover) 0%, + var(--brand-primary-strong) 100% + ); color: #ffffff; font-size: 15.5px; font-weight: 700; diff --git a/frontend/src/features/announcement/views/AnnouncementDetailView.vue b/frontend/src/features/announcement/views/AnnouncementDetailView.vue index 4ffdfd76..927511da 100644 --- a/frontend/src/features/announcement/views/AnnouncementDetailView.vue +++ b/frontend/src/features/announcement/views/AnnouncementDetailView.vue @@ -142,7 +142,7 @@ function getCategoryLabel(category: string) { border: 1px solid #e2e8f0; border-radius: 10px; background: #ffffff; - color: #64748b; + color: var(--brand-muted); font-size: 14px; font-weight: 700; cursor: pointer; @@ -196,7 +196,7 @@ function getCategoryLabel(category: string) { display: flex; align-items: center; gap: 6px; - color: #64748b; + color: var(--brand-muted); font-size: 14px; } @@ -339,7 +339,7 @@ function getCategoryLabel(category: string) { } .detail-content :deep(table th) { - background: #f8fafc; + background: var(--brand-canvas); font-weight: 700; } diff --git a/frontend/src/features/announcement/views/AnnouncementsView.vue b/frontend/src/features/announcement/views/AnnouncementsView.vue index eac9e911..f045ef5d 100644 --- a/frontend/src/features/announcement/views/AnnouncementsView.vue +++ b/frontend/src/features/announcement/views/AnnouncementsView.vue @@ -22,7 +22,7 @@ const total = ref(0) const activeCategory = ref('') const categories = [ - { value: '', label: '全部', icon: Tickets, color: '#64748b' }, + { value: '', label: '全部', icon: Tickets, color: 'var(--brand-muted)' }, { value: 'notice', label: '通知公告', icon: Bell, color: '#3b82f6' }, { value: 'tutorial', label: '使用教程', icon: Document, color: '#10b981' }, { value: 'rule', label: '规则说明', icon: Warning, color: '#f59e0b' }, @@ -200,8 +200,8 @@ function getCategoryLabel(category: string) { padding: 10px 18px; border: 1px solid #e2e8f0; border-radius: 10px; - background: #f8fafc; - color: #64748b; + background: var(--brand-canvas); + color: var(--brand-muted); font-size: 14px; font-weight: 700; cursor: pointer; @@ -279,7 +279,7 @@ function getCategoryLabel(category: string) { .announcement-preview { margin: 0 0 16px; - color: #64748b; + color: var(--brand-muted); font-size: 14px; line-height: 1.7; } diff --git a/frontend/src/features/announcement/views/MobileAnnouncementDetailView.vue b/frontend/src/features/announcement/views/MobileAnnouncementDetailView.vue index ad68a792..2bd0dbb9 100644 --- a/frontend/src/features/announcement/views/MobileAnnouncementDetailView.vue +++ b/frontend/src/features/announcement/views/MobileAnnouncementDetailView.vue @@ -86,8 +86,8 @@ function getCategoryLabel(category: string) { diff --git a/frontend/src/features/mohong/components/MohongProductCard.vue b/frontend/src/features/mohong/components/MohongProductCard.vue index 514cdb8f..b39e7316 100644 --- a/frontend/src/features/mohong/components/MohongProductCard.vue +++ b/frontend/src/features/mohong/components/MohongProductCard.vue @@ -68,7 +68,7 @@ const stockLabel = computed(() => { .mohong-card:hover { border-color: #ffb27a; - box-shadow: 0 10px 24px rgba(255, 106, 0, 0.12); + box-shadow: 0 10px 24px rgb(var(--brand-primary-rgb) / 0.12); transform: translateY(-2px); } @@ -94,8 +94,8 @@ const stockLabel = computed(() => { justify-content: center; width: 100%; height: 100%; - background: linear-gradient(145deg, #fff7ed, #ffe4cc); - color: #ff6a00; + background: linear-gradient(145deg, var(--brand-primary-soft), #ffe4cc); + color: var(--brand-primary); font-size: 28px; font-weight: 900; } @@ -149,7 +149,7 @@ const stockLabel = computed(() => { } .price strong { - color: #ff6a00; + color: var(--brand-primary); font-size: 18px; font-weight: 800; line-height: 1; @@ -165,13 +165,13 @@ const stockLabel = computed(() => { flex-shrink: 0; padding: 5px 10px; border-radius: 8px; - background: #ff6a00; + background: var(--brand-primary); color: #fff; font-size: 12px; font-weight: 700; } .mohong-card:hover .buy { - background: #ea580c; + background: var(--brand-primary-strong); } diff --git a/frontend/src/features/mohong/views/MobileMohongDetailView.vue b/frontend/src/features/mohong/views/MobileMohongDetailView.vue index 34403db4..feb831cd 100644 --- a/frontend/src/features/mohong/views/MobileMohongDetailView.vue +++ b/frontend/src/features/mohong/views/MobileMohongDetailView.vue @@ -187,12 +187,18 @@ async function handleBuy() {
合计 ¥{{ totalPrice }}
- + 加购 - + @@ -335,11 +335,11 @@ async function handleSupportClick() { .orders-btn { border: 0; background: transparent; - color: #17233d; + color: var(--brand-ink); flex-shrink: 0; } .orders-btn { - color: #ff6a00; + color: var(--brand-primary); font-size: 14px; font-weight: 600; } @@ -362,7 +362,7 @@ async function handleSupportClick() { outline: none; background: transparent; font-size: 14px; - color: #17233d; + color: var(--brand-ink); } .shop-body { flex: 1; @@ -388,15 +388,15 @@ async function handleSupportClick() { border: 0; border-left: 3px solid transparent; background: transparent; - color: #64748b; + color: var(--brand-muted); font-size: 13px; text-align: center; cursor: pointer; } .cat-item.active { background: #fff; - border-left-color: #ff6a00; - color: #ff6a00; + border-left-color: var(--brand-primary); + color: var(--brand-primary); font-weight: 700; } .list-panel { @@ -447,15 +447,15 @@ async function handleSupportClick() { height: 100%; align-items: center; justify-content: center; - background: linear-gradient(145deg, #fff7ed, #ffe4cc); - color: #ff6a00; + background: linear-gradient(145deg, var(--brand-primary-soft), #ffe4cc); + color: var(--brand-primary); font-size: 22px; font-weight: 900; } .info h2 { margin: 0 0 8px; font-size: 15px; - color: #17233d; + color: var(--brand-ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; diff --git a/frontend/src/features/mohong/views/MobileMohongOrderDetailView.vue b/frontend/src/features/mohong/views/MobileMohongOrderDetailView.vue index 21ce290b..8c478fc0 100644 --- a/frontend/src/features/mohong/views/MobileMohongOrderDetailView.vue +++ b/frontend/src/features/mohong/views/MobileMohongOrderDetailView.vue @@ -158,7 +158,7 @@ async function copyText() { Boolean(snapshot.value)) gap: 4px; padding: 10px 12px; border-radius: 8px; - background: #f8fafc; + background: var(--brand-canvas); } .kv-item span { color: #94a3b8; font-size: 12px; } .kv-item strong { - color: #0f172a; + color: var(--brand-ink); font-size: 13px; font-weight: 600; word-break: break-word; @@ -415,7 +415,7 @@ const hasContent = computed(() => Boolean(snapshot.value)) display: inline-block; padding: 6px 10px; border-radius: 999px; - background: #fff7ed; + background: var(--brand-primary-soft); color: #9a3412; font-size: 12px; margin-bottom: 6px; @@ -497,7 +497,7 @@ const hasContent = computed(() => Boolean(snapshot.value)) } .kv-row em { font-style: normal; - color: #0f172a; + color: var(--brand-ink); text-align: right; word-break: break-word; } diff --git a/frontend/src/features/orders/components/OrderCheckoutSummary.vue b/frontend/src/features/orders/components/OrderCheckoutSummary.vue index d602f162..6b1e3dca 100644 --- a/frontend/src/features/orders/components/OrderCheckoutSummary.vue +++ b/frontend/src/features/orders/components/OrderCheckoutSummary.vue @@ -289,7 +289,7 @@ const checkoutContent = computed(() => splitCheckoutContent(props.order.checkout .summary-row span { font-size: 12px; - color: #64748b; + color: var(--brand-muted); line-height: 1.35; } @@ -323,12 +323,12 @@ const checkoutContent = computed(() => splitCheckoutContent(props.order.checkout .summary-note { margin-top: 4px; padding: 8px 10px; - background: #f8fafc; + background: var(--brand-canvas); border-radius: 6px; } .summary-note.warning { - background: #fff7ed; + background: var(--brand-primary-soft); } .summary-note.system { @@ -338,7 +338,7 @@ const checkoutContent = computed(() => splitCheckoutContent(props.order.checkout .summary-note label { display: block; margin-bottom: 2px; - color: #64748b; + color: var(--brand-muted); font-size: 11px; font-weight: 700; } @@ -370,7 +370,7 @@ const checkoutContent = computed(() => splitCheckoutContent(props.order.checkout padding: 8px 10px; border: 1px solid #eef1f5; border-radius: 6px; - background: #f8fafc; + background: var(--brand-canvas); } .note-block.system { diff --git a/frontend/src/features/orders/components/OrderHandoffTimeline.vue b/frontend/src/features/orders/components/OrderHandoffTimeline.vue index 58d12310..f85b5da1 100644 --- a/frontend/src/features/orders/components/OrderHandoffTimeline.vue +++ b/frontend/src/features/orders/components/OrderHandoffTimeline.vue @@ -141,7 +141,7 @@ const recordEntries = computed(() => width: 7px; height: 7px; border-radius: 50%; - background: #ff6a00; + background: var(--brand-primary); } .timeline-time { @@ -161,7 +161,7 @@ const recordEntries = computed(() => display: grid; gap: 6px; font-size: 13px; - color: #64748b; + color: var(--brand-muted); line-height: 1.55; } @@ -176,7 +176,7 @@ const recordEntries = computed(() => .remark-block { border-color: #e2e8f0; - background: #f8fafc; + background: var(--brand-canvas); } .system-block { @@ -250,7 +250,7 @@ const recordEntries = computed(() => height: 11px; border: 2px solid #ffffff; border-radius: 50%; - background: #ff6a00; + background: var(--brand-primary); } .log-content-wrap { diff --git a/frontend/src/features/orders/components/OrderResourceUsageEditor.vue b/frontend/src/features/orders/components/OrderResourceUsageEditor.vue index 347e45a7..6579b757 100644 --- a/frontend/src/features/orders/components/OrderResourceUsageEditor.vue +++ b/frontend/src/features/orders/components/OrderResourceUsageEditor.vue @@ -319,7 +319,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: } .section-header.compact span { - color: #64748b; + color: var(--brand-muted); font-size: 12px; } @@ -364,7 +364,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: padding: 2px 8px; border-radius: 999px; background: #f1f5f9; - color: #64748b; + color: var(--brand-muted); font-size: 12px; font-weight: 700; } @@ -400,7 +400,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: } .amount-highlight { - color: #ff6a00; + color: var(--brand-primary); font-weight: 700; font-size: 13px; } @@ -444,7 +444,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: .checkout-resource-amount { min-width: 72px; text-align: right; - color: #ff6a00; + color: var(--brand-primary); font-weight: 700; font-size: 15px; } @@ -479,7 +479,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: } .checkout-number-card.deposit { - border-color: #fed7aa; + border-color: var(--brand-border); background: #fffaf3; } @@ -512,13 +512,13 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: } .checkout-number-card.deposit .checkout-number-title span { - color: #c2410c; + color: var(--brand-primary-strong); background: #ffedd5; } .checkout-number-copy p { margin: 0; - color: #64748b; + color: var(--brand-muted); font-size: 12px; line-height: 1.5; } @@ -576,7 +576,7 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: .checkout-deduct-preview strong, .checkout-fee-preview strong { - color: #ff6a00; + color: var(--brand-primary); font-size: 16px; font-weight: 800; } @@ -723,10 +723,10 @@ function updateNumberField(field: 'coin_consumed_m' | 'otherAmountYuan', event: .deposit-deduct-warning { padding: 8px 10px; - border: 1px solid #fed7aa; + border: 1px solid var(--brand-border); border-radius: 6px; - background: #fff7ed; - color: #c2410c; + background: var(--brand-primary-soft); + color: var(--brand-primary-strong); font-size: 12px; line-height: 1.5; } diff --git a/frontend/src/features/orders/components/PayWaySelectDialog.vue b/frontend/src/features/orders/components/PayWaySelectDialog.vue index 8f8ff347..f8f4b6f3 100644 --- a/frontend/src/features/orders/components/PayWaySelectDialog.vue +++ b/frontend/src/features/orders/components/PayWaySelectDialog.vue @@ -55,7 +55,7 @@ function choose(payWay: PaymentPayWay) { diff --git a/frontend/src/sites/dachui/index.ts b/frontend/src/sites/dachui/index.ts new file mode 100644 index 00000000..11c966d5 --- /dev/null +++ b/frontend/src/sites/dachui/index.ts @@ -0,0 +1,17 @@ +import { defaultStorefrontText } from '@/shared/utils/storefrontText' + +import type { SiteBrand } from '../types' + +export const dachuiSite: SiteBrand = { + key: 'dachui', + name: '大锤商行', + mark: '锤', + themeColor: '#ff6a00', + favicon: '', + storefrontText: defaultStorefrontText, + logos: { + light: '', + dark: '', + seal: '', + }, +} diff --git a/frontend/src/sites/dachui/theme.css b/frontend/src/sites/dachui/theme.css new file mode 100644 index 00000000..e09f100b --- /dev/null +++ b/frontend/src/sites/dachui/theme.css @@ -0,0 +1,20 @@ +:root, +html[data-site='dachui'] { + --brand-primary: #ff6a00; + --brand-primary-rgb: 255 106 0; + --brand-primary-hover: #ff8533; + --brand-primary-light: #ff914d; + --brand-primary-strong: #ff5200; + --brand-primary-soft: #fff3e8; + --brand-on-primary: #ffffff; + --brand-accent: #f59e0b; + --brand-canvas: #f6f8fb; + --brand-surface: #ffffff; + --brand-surface-muted: #f2f5f9; + --brand-ink: #17233d; + --brand-muted: #64748b; + --brand-border: #fed7aa; + --brand-shadow: rgb(255 106 0 / 0.24); + --brand-font-body: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; + --brand-font-display: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; +} diff --git a/frontend/src/sites/index.ts b/frontend/src/sites/index.ts new file mode 100644 index 00000000..55f8570a --- /dev/null +++ b/frontend/src/sites/index.ts @@ -0,0 +1,19 @@ +import { dachuiSite } from './dachui' +import { jieyouSite } from './jieyou' + +import type { SiteBrand, SiteKey } from './types' + +export const siteBrands: Record = { + dachui: dachuiSite, + jieyou: jieyouSite, +} + +export function resolveSiteKey(tenantCode?: string): SiteKey { + return (tenantCode || '').trim().toLowerCase() === 'jieyou' ? 'jieyou' : 'dachui' +} + +export function siteBrandFor(tenantCode?: string): SiteBrand { + return siteBrands[resolveSiteKey(tenantCode)] +} + +export type { BrandLogoVariant, SiteBrand, SiteKey } from './types' diff --git a/frontend/src/sites/jieyou/MobileBottomNav.vue b/frontend/src/sites/jieyou/MobileBottomNav.vue new file mode 100644 index 00000000..701732cb --- /dev/null +++ b/frontend/src/sites/jieyou/MobileBottomNav.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/frontend/src/sites/jieyou/assets/favicon.svg b/frontend/src/sites/jieyou/assets/favicon.svg new file mode 100644 index 00000000..c18f85f8 --- /dev/null +++ b/frontend/src/sites/jieyou/assets/favicon.svg @@ -0,0 +1,8 @@ + + 解忧商行印章 + 解忧商行方形朱砂印章 + + + 解 + 忧 + diff --git a/frontend/src/sites/jieyou/assets/logo-dark.svg b/frontend/src/sites/jieyou/assets/logo-dark.svg new file mode 100644 index 00000000..a2954ed1 --- /dev/null +++ b/frontend/src/sites/jieyou/assets/logo-dark.svg @@ -0,0 +1,10 @@ + + 解忧商行 + 解忧商行横版 logo,深色背景反白使用 + + + 解 + 忧 + 解忧商行 + JIEYOU TRADING HOUSE + diff --git a/frontend/src/sites/jieyou/assets/logo-jieyou.png b/frontend/src/sites/jieyou/assets/logo-jieyou.png new file mode 100644 index 00000000..2d513034 Binary files /dev/null and b/frontend/src/sites/jieyou/assets/logo-jieyou.png differ diff --git a/frontend/src/sites/jieyou/assets/logo-light.svg b/frontend/src/sites/jieyou/assets/logo-light.svg new file mode 100644 index 00000000..1ff7730b --- /dev/null +++ b/frontend/src/sites/jieyou/assets/logo-light.svg @@ -0,0 +1,10 @@ + + 解忧商行 + 解忧商行横版 logo,浅色背景使用 + + + 解 + 忧 + 解忧商行 + JIEYOU TRADING HOUSE + diff --git a/frontend/src/sites/jieyou/assets/logo-seal.svg b/frontend/src/sites/jieyou/assets/logo-seal.svg new file mode 100644 index 00000000..c18f85f8 --- /dev/null +++ b/frontend/src/sites/jieyou/assets/logo-seal.svg @@ -0,0 +1,8 @@ + + 解忧商行印章 + 解忧商行方形朱砂印章 + + + 解 + 忧 + diff --git a/frontend/src/sites/jieyou/index.ts b/frontend/src/sites/jieyou/index.ts new file mode 100644 index 00000000..ec623f57 --- /dev/null +++ b/frontend/src/sites/jieyou/index.ts @@ -0,0 +1,25 @@ +import logoDark from './assets/logo-dark.svg' +import logoLight from './assets/logo-light.svg' +import logoSeal from './assets/logo-seal.svg' +import favicon from './assets/favicon.svg' + +import type { SiteBrand } from '../types' + +export const jieyouSite: SiteBrand = { + key: 'jieyou', + name: '解忧商行', + mark: '解', + themeColor: '#a64332', + favicon, + storefrontText: { + tagline: '解忧商号 · 安心租号', + hero_badge: '解忧严选', + hero_desc: '解忧商行严选三角洲账号,逐号核验、独立订单与专属售后,让每次租用更安心。', + card_sub: '逐号验真 · 独立订单 · 解忧售后', + }, + logos: { + light: logoLight, + dark: logoDark, + seal: logoSeal, + }, +} diff --git a/frontend/src/sites/jieyou/theme.css b/frontend/src/sites/jieyou/theme.css new file mode 100644 index 00000000..243e60c8 --- /dev/null +++ b/frontend/src/sites/jieyou/theme.css @@ -0,0 +1,159 @@ +html[data-site='jieyou'] { + --brand-primary: #a64332; + --brand-primary-rgb: 166 67 50; + --brand-primary-hover: #bd5845; + --brand-primary-light: #c97868; + --brand-primary-strong: #853326; + --brand-primary-soft: #f7ebe4; + --brand-on-primary: #fffdf8; + --brand-accent: #1e4d42; + --brand-canvas: #f4efe5; + --brand-surface: #fffdf8; + --brand-surface-muted: #f1e9dc; + --brand-ink: #1d2c28; + --brand-muted: #6f7f79; + --brand-border: #e7d2b5; + --brand-shadow: rgb(166 67 50 / 0.24); + --brand-font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; + --brand-font-display: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif; +} + +html[data-site='jieyou'] body { + background: var(--brand-canvas); + color: var(--brand-ink); +} + +html[data-site='jieyou'] .pc-app-shell { + background: var(--brand-canvas); +} + +html[data-site='jieyou'] .pc-topbar { + border-bottom-color: rgb(166 67 50 / 0.14); + background: rgb(255 253 248 / 0.94); + box-shadow: 0 2px 18px rgb(30 77 66 / 0.08); +} + +html[data-site='jieyou'] .pc-brand-text, +html[data-site='jieyou'] .pc-brand-sub { + font-family: var(--brand-font-display); +} + +html[data-site='jieyou'] .pc-brand-text { + color: var(--brand-accent); + letter-spacing: 0.04em; +} + +html[data-site='jieyou'] .pc-brand-sub { + color: var(--brand-muted); + letter-spacing: 0.08em; +} + +html[data-site='jieyou'] .pc-search { + border-color: var(--brand-border); + background: var(--brand-surface); +} + +html[data-site='jieyou'] .pc-post-link, +html[data-site='jieyou'] .pc-login-link { + border-radius: 8px; +} + +html[data-site='jieyou'] .pc-nav-link.router-link-active { + background: var(--brand-primary-soft); + color: var(--brand-primary-strong); +} + +html[data-site='jieyou'] .pc-home-redesign { + background: + linear-gradient(rgb(166 67 50 / 0.025) 1px, transparent 1px), + linear-gradient(90deg, rgb(166 67 50 / 0.025) 1px, transparent 1px), var(--brand-canvas); + background-size: 28px 28px; +} + +html[data-site='jieyou'] .pc-footer { + border-top-color: var(--brand-border); + background: var(--brand-surface); +} + +html[data-site='jieyou'] .mobile-shell { + background: var(--brand-canvas); + color: var(--brand-ink); +} + +html[data-site='jieyou'] .mobile-hero { + border-bottom: 1px solid var(--brand-border); + background: var(--brand-surface); + box-shadow: 0 1px 0 rgb(166 67 50 / 0.08); +} + +html[data-site='jieyou'] .mobile-brand strong, +html[data-site='jieyou'] .mobile-brand-title-row strong { + color: var(--brand-accent); + font-family: var(--brand-font-display); + letter-spacing: 0.04em; +} + +html[data-site='jieyou'] .mobile-brand small { + color: var(--brand-muted); +} + +html[data-site='jieyou'] .mobile-service, +html[data-site='jieyou'] .add-home-strip { + border-color: var(--brand-border); + background: var(--brand-surface); + color: var(--brand-primary-strong); +} + +html[data-site='jieyou'] .add-home-strip { + background: var(--brand-primary-soft); +} + +html[data-site='jieyou'] .login-page { + background-color: var(--brand-canvas); +} + +html[data-site='jieyou'] .login-card { + border: 1px solid var(--brand-border); + border-radius: 12px; + box-shadow: 0 24px 64px rgb(30 77 66 / 0.12); +} + +html[data-site='jieyou'] .card-hero { + background: + radial-gradient(circle at 82% 72%, rgb(166 67 50 / 0.3) 0%, transparent 52%), + linear-gradient(155deg, #10241f 0%, #173a32 52%, #1e4d42 100%); +} + +html[data-site='jieyou'] .card-hero::after { + position: absolute; + right: -24px; + bottom: -20px; + width: 240px; + height: 240px; + background: url('./assets/logo-seal.svg') center / contain no-repeat; + content: ''; + opacity: 0.16; + pointer-events: none; + transform: rotate(-8deg); + z-index: 0; +} + +html[data-site='jieyou'] .hero-shield-art { + display: none; +} + +html[data-site='jieyou'] .hero-title, +html[data-site='jieyou'] .brand-name, +html[data-site='jieyou'] .brand-lockup strong { + font-family: var(--brand-font-display); + letter-spacing: 0.08em; +} + +html[data-site='jieyou'] .mobile-login-shell { + background: + radial-gradient(circle at 50% 8%, rgb(166 67 50 / 0.1), transparent 34%), var(--brand-canvas); +} + +html[data-site='jieyou'] .tenant-brand-banner { + display: grid; +} diff --git a/frontend/src/sites/siteBrand.spec.ts b/frontend/src/sites/siteBrand.spec.ts new file mode 100644 index 00000000..8f1a0f1f --- /dev/null +++ b/frontend/src/sites/siteBrand.spec.ts @@ -0,0 +1,18 @@ +import { describe, expect, it } from 'vitest' + +import { resolveSiteKey, siteBrandFor } from '.' + +describe('site branding registry', () => { + it('resolves the Jieyou brand from the tenant code', () => { + expect(resolveSiteKey('jieyou')).toBe('jieyou') + expect(siteBrandFor('jieyou').name).toBe('解忧商行') + expect(siteBrandFor('jieyou').logos.seal).toMatch(/^data:image\/svg\+xml/) + }) + + it('falls back to Dachui for main, legacy distribution and ops contexts', () => { + expect(resolveSiteKey('dachui')).toBe('dachui') + expect(resolveSiteKey('')).toBe('dachui') + expect(resolveSiteKey('legacy_site')).toBe('dachui') + expect(siteBrandFor('').mark).toBe('锤') + }) +}) diff --git a/frontend/src/sites/theme.ts b/frontend/src/sites/theme.ts new file mode 100644 index 00000000..d5b76fe7 --- /dev/null +++ b/frontend/src/sites/theme.ts @@ -0,0 +1,15 @@ +import { siteBrandFor, type SiteKey } from '.' + +export function applySiteTheme(siteKey: SiteKey) { + if (typeof document === 'undefined') return + const brand = siteBrandFor(siteKey) + document.documentElement.dataset.site = siteKey + + let meta = document.querySelector('meta[name="theme-color"]') as HTMLMetaElement | null + if (!meta) { + meta = document.createElement('meta') + meta.name = 'theme-color' + document.head.appendChild(meta) + } + meta.content = brand.themeColor +} diff --git a/frontend/src/sites/types.ts b/frontend/src/sites/types.ts new file mode 100644 index 00000000..cb55113a --- /dev/null +++ b/frontend/src/sites/types.ts @@ -0,0 +1,15 @@ +import type { StorefrontText } from '@/shared/utils/storefrontText' + +export type SiteKey = 'dachui' | 'jieyou' + +export type BrandLogoVariant = 'light' | 'dark' | 'seal' + +export interface SiteBrand { + key: SiteKey + name: string + mark: string + themeColor: string + favicon: string + storefrontText: StorefrontText + logos: Record +} diff --git a/frontend/src/stores/distributionSite.ts b/frontend/src/stores/distributionSite.ts index 6dfe74d1..fc68448b 100644 --- a/frontend/src/stores/distributionSite.ts +++ b/frontend/src/stores/distributionSite.ts @@ -1,5 +1,7 @@ import { defineStore } from 'pinia' import { apiClient } from '@/shared/api/client' +import { siteBrandFor } from '@/sites' +import type { SiteKey } from '@/sites/types' import type { ApiResponse } from '@/shared/types/types' import { normalizeAnnouncements } from '@/shared/utils/announcements' import { @@ -251,6 +253,11 @@ export const useDistributionSiteStore = defineStore('distributionSite', { }, getters: { + siteKey(state): SiteKey { + return state.siteMode === 'tenant' && state.tenantCode.trim().toLowerCase() === 'jieyou' + ? 'jieyou' + : 'dachui' + }, /** 品牌标识字符:分站取站名首字,主站沿用「锤」。 */ brandMark(state): string { if (state.siteMode === 'ops') return '运' @@ -489,14 +496,18 @@ export const useDistributionSiteStore = defineStore('distributionSite', { : null this.logoUrl = text(profile.logo_url) this.faviconUrl = text(profile.favicon_url) + if (!this.faviconUrl) { + this.faviconUrl = siteBrandFor(this.tenantCode).favicon + } this.banners = parseJSONArray(profile.banners_json) this.announcements = normalizeAnnouncements( parseJSONArray(profile.announcements_json) ) this.footerInfo = parseJSONObject(profile.footer_info_json) - this.storefrontText = mergeStorefrontText( - parseJSONObject>(profile.storefront_text_json) - ) + this.storefrontText = mergeStorefrontText({ + ...siteBrandFor(this.tenantCode).storefrontText, + ...parseJSONObject>(profile.storefront_text_json), + }) this.receiveRatioDelta = Math.max(0, Number(profile.receive_ratio_delta || 0)) this.receiveCostDelta = Math.max(0, Number(profile.receive_cost_delta || 0)) diff --git a/frontend/src/styles/base.css b/frontend/src/styles/base.css index 1a4aba45..f3a1ef97 100644 --- a/frontend/src/styles/base.css +++ b/frontend/src/styles/base.css @@ -1,15 +1,13 @@ :root { + --el-color-primary: var(--brand-primary); + --el-color-primary-light-3: var(--brand-primary-hover); + --el-color-primary-light-5: var(--brand-primary-light); + --el-color-primary-light-8: var(--brand-primary-soft); + --el-color-primary-dark-2: var(--brand-primary-strong); + --van-primary-color: var(--brand-primary); color: #1f2933; - background: #f6f8fb; - font-family: - Inter, - 'PingFang SC', - 'Microsoft YaHei', - system-ui, - -apple-system, - BlinkMacSystemFont, - 'Segoe UI', - sans-serif; + background: var(--brand-canvas); + font-family: var(--brand-font-body); font-synthesis: none; text-rendering: optimizeLegibility; } @@ -27,6 +25,11 @@ body { overflow-x: clip; } +body { + background: var(--brand-canvas); + color: var(--brand-ink); +} + #app { max-width: 100%; overflow-x: clip; @@ -37,6 +40,33 @@ a { text-decoration: none; } +.site-brand-logo { + display: block; + width: auto; + max-width: min(220px, 42vw); + object-fit: contain; +} + +.site-brand-mark { + display: grid; + flex: 0 0 auto; + place-items: center; + border-radius: 10px; + background: linear-gradient(135deg, var(--brand-primary-hover), var(--brand-primary-strong)); + box-shadow: 0 8px 20px var(--brand-shadow); + color: var(--brand-on-primary); + font-family: var(--brand-font-display); + font-size: 1.15em; + font-weight: 900; +} + +html[data-site='jieyou'] h1, +html[data-site='jieyou'] h2, +html[data-site='jieyou'] h3, +html[data-site='jieyou'] .brand-lockup strong { + font-family: var(--brand-font-display); +} + /* * iOS Safari 在 input/textarea/select 的 font-size < 16px 时, * 聚焦会自动放大页面,导致 UI 被轻微放大且需手动缩小才能恢复。 diff --git a/frontend/src/styles/home-filters.css b/frontend/src/styles/home-filters.css index d7b3175c..3f5af0bf 100644 --- a/frontend/src/styles/home-filters.css +++ b/frontend/src/styles/home-filters.css @@ -31,14 +31,14 @@ width: 4px; height: 16px; border-radius: 999px; - background: #ff6a00 !important; - box-shadow: 0 0 0 1px rgba(255, 106, 0, 0.12); + background: var(--brand-primary) !important; + box-shadow: 0 0 0 1px rgb(var(--brand-primary-rgb) / 0.12); } .filter-title strong { font-size: 15px; font-weight: 800; - color: #17233d; + color: var(--brand-ink); } .filter-title span { @@ -47,7 +47,7 @@ background: #f1f5f9; font-size: 12px; font-weight: 700; - color: #64748b; + color: var(--brand-muted); } /* 重置全部条件:橙色胶囊按钮,默认浅色描边,悬停填充品牌橙,按下加深,突出主题色。 @@ -58,12 +58,12 @@ padding: 0 16px; border: 1px solid #ffc79b !important; border-radius: 999px; - background: linear-gradient(135deg, #fff7ed 0%, #ffeedd 100%) !important; - color: #ff6a00 !important; + background: linear-gradient(135deg, var(--brand-primary-soft) 0%, #ffeedd 100%) !important; + color: var(--brand-primary) !important; font-size: 13px; font-weight: 800; letter-spacing: 0.2px; - box-shadow: 0 2px 6px rgba(255, 106, 0, 0.14); + box-shadow: 0 2px 6px rgb(var(--brand-primary-rgb) / 0.14); transition: background 0.2s ease, border-color 0.2s ease, @@ -79,10 +79,14 @@ .filter-header .reset-conditions-btn:hover, .filter-header .reset-conditions-btn:focus-visible { - border-color: #ff6a00 !important; - background: linear-gradient(135deg, #ff6a00 0%, #ff8533 100%) !important; + border-color: var(--brand-primary) !important; + background: linear-gradient( + 135deg, + var(--brand-primary) 0%, + var(--brand-primary-hover) 100% + ) !important; color: #ffffff !important; - box-shadow: 0 8px 18px rgba(255, 106, 0, 0.3) !important; + box-shadow: 0 8px 18px rgb(var(--brand-primary-rgb) / 0.3) !important; transform: translateY(-1px); } @@ -91,7 +95,7 @@ background: linear-gradient(135deg, #e85f00 0%, #ff7a20 100%) !important; color: #ffffff !important; transform: translateY(0); - box-shadow: 0 3px 8px rgba(255, 106, 0, 0.3) !important; + box-shadow: 0 3px 8px rgb(var(--brand-primary-rgb) / 0.3) !important; } /* PC 点击式快速筛选:上下两块(快速筛选 / 高级筛选)共用同一套两列网格。 @@ -161,8 +165,8 @@ /* 悬浮/按下统一走主题橙,避免灰蓝色调与品牌色脱节(active 更实,便于区分已选) */ .pill-chip:hover { background: #fff4ea; - color: #ff6a00; - box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.28); + color: var(--brand-primary); + box-shadow: inset 0 0 0 1px rgb(var(--brand-primary-rgb) / 0.28); } .pill-chip:active { @@ -173,9 +177,9 @@ .pill-chip.active { background: #ffe8d5; - color: #ff6a00; + color: var(--brand-primary); font-weight: 700; - box-shadow: inset 0 0 0 1px #ff6a00; + box-shadow: inset 0 0 0 1px var(--brand-primary); } .pill-empty { @@ -197,14 +201,14 @@ padding: 6px 12px; border: none; background: transparent; - color: #64748b; + color: var(--brand-muted); font-size: 13px; font-weight: 600; cursor: pointer; } .advanced-toggle:hover { - color: #ff6a00; + color: var(--brand-primary); } .advanced-toggle em { @@ -212,7 +216,7 @@ height: 18px; padding: 0 5px; border-radius: 999px; - background: #ff6a00; + background: var(--brand-primary); color: #fff; font-size: 11px; font-style: normal; @@ -235,7 +239,7 @@ .advanced-filter-panel { margin-top: 12px; padding-top: 14px; - border-top: 1px dashed rgba(255, 106, 0, 0.4); + border-top: 1px dashed rgb(var(--brand-primary-rgb) / 0.4); } @media (max-width: 960px) { @@ -270,14 +274,14 @@ } .filter-chip:hover { - border-color: #ff6a00; - background: #fff7ed; + border-color: var(--brand-primary); + background: var(--brand-primary-soft); } .filter-chip.active { - border-color: #ff6a00; - background: #fff7ed; - color: #ff6a00; + border-color: var(--brand-primary); + background: var(--brand-primary-soft); + color: var(--brand-primary); } .filter-chip.wide { @@ -318,8 +322,8 @@ .filter-menu button.active, .range-menu button.active { - background: #fff7ed; - color: #ff6a00; + background: var(--brand-primary-soft); + color: var(--brand-primary); font-weight: 700; } @@ -340,8 +344,8 @@ } .filter-option-check.checked { - border-color: #ff6a00; - background: #ff6a00; + border-color: var(--brand-primary); + background: var(--brand-primary); box-shadow: inset 0 0 0 2px #ffffff; } @@ -390,8 +394,8 @@ } .skin-reset.active { - background: #fff7ed; - color: #ff6a00; + background: var(--brand-primary-soft); + color: var(--brand-primary); font-weight: 700; } @@ -411,7 +415,7 @@ .skin-filter-title strong { font-size: 13px; font-weight: 700; - color: #17233d; + color: var(--brand-ink); } .skin-filter-title button { @@ -421,7 +425,7 @@ background: transparent; font-size: 11px; font-weight: 600; - color: #64748b; + color: var(--brand-muted); cursor: pointer; transition: all 0.15s; } @@ -431,8 +435,8 @@ } .skin-filter-title button.active { - background: #fff7ed; - color: #ff6a00; + background: var(--brand-primary-soft); + color: var(--brand-primary); } .skin-filter-options { @@ -459,7 +463,7 @@ } .skin-filter-options button.active { - background: #fff7ed; - color: #ff6a00; + background: var(--brand-primary-soft); + color: var(--brand-primary); font-weight: 700; } diff --git a/frontend/src/styles/pc.css b/frontend/src/styles/pc.css index ac756850..332dc8fa 100644 --- a/frontend/src/styles/pc.css +++ b/frontend/src/styles/pc.css @@ -511,7 +511,7 @@ h1 { height: 38px; border-radius: 12px; background: #fff3e8; - color: #ff6a00; + color: var(--brand-primary); font-size: 13px; font-weight: 900; } @@ -540,7 +540,7 @@ h1 { .pc-nav-link.router-link-active, .pc-nav-link:hover { background: #fff3e8; - color: #ff6a00; + color: var(--brand-primary); } .pc-search { @@ -593,10 +593,10 @@ h1 { .pc-post-link { gap: 6px; - background: #ff6a00; + background: var(--brand-primary); padding: 0 16px; color: #ffffff; - box-shadow: 0 10px 22px rgba(255, 106, 0, 0.18); + box-shadow: 0 10px 22px rgb(var(--brand-primary-rgb) / 0.18); } .pc-post-link.large { @@ -755,8 +755,8 @@ h1 { width: 42px; height: 42px; border-radius: 14px; - background: #fff7ed; - color: #ea580c; + background: var(--brand-primary-soft); + color: var(--brand-primary-strong); font-size: 20px; }