feat: 支持大锤与解忧遥双品牌前端

This commit is contained in:
yml2213
2026-11-18 18:21:14 +08:00
parent 1a541bdf27
commit 5bd27e9d7d
26 changed files with 284 additions and 56 deletions
+5
View File
@@ -0,0 +1,5 @@
node_modules
dist
.git
.DS_Store
*.log
+5
View File
@@ -0,0 +1,5 @@
VITE_BRAND=dachui
VITE_BRAND_NAME=大锤网络
VITE_BRAND_DESCRIPTION=大锤网络数码商城,提供电脑、手机、平板及数码设备免押租赁服务。
VITE_BRAND_THEME="#e93323"
VITE_BRAND_FAVICON=./favicon-dachui.svg
+7
View File
@@ -0,0 +1,7 @@
VITE_BRAND=dachui
VITE_BRAND_NAME=大锤网络
VITE_BRAND_DESCRIPTION=大锤网络数码商城,提供电脑、手机、平板及数码设备免押租赁服务。
VITE_BRAND_THEME="#e93323"
VITE_BRAND_FAVICON=./favicon-dachui.svg
VITE_BASE=/
VITE_API_URL=/api
+5
View File
@@ -0,0 +1,5 @@
VITE_BRAND=jieyouyao
VITE_BRAND_NAME=解忧遥网络
VITE_BRAND_DESCRIPTION=解忧遥网络数码商城,提供电脑、手机、平板及数码设备免押租赁服务。
VITE_BRAND_THEME="#0f766e"
VITE_BRAND_FAVICON=./favicon-jieyouyao.svg
+1
View File
@@ -17,6 +17,7 @@ dist-ssr
.vscode/*
!.vscode/extensions.json
.idea
.openidea
*.suo
*.ntvs*
*.njsproj
+3 -1
View File
@@ -7,9 +7,11 @@ COPY package*.json ./
RUN npm install
COPY . .
ARG VITE_BRAND=dachui
ENV VITE_BRAND=$VITE_BRAND
ENV OUT_DIR=dist
ENV VITE_BASE=/
RUN npm run build
RUN ./node_modules/.bin/vite build --mode "$VITE_BRAND" --outDir dist
# Production Stage
FROM nginx:alpine
+65
View File
@@ -0,0 +1,65 @@
# 多品牌数码商城前端
一套 Vue 3 + Vite 代码维护多个商城品牌,当前包含:
- `dachui`:大锤网络
- `jieyouyao`:解忧遥网络
页面、组件、状态管理和接口逻辑全部共享,品牌名称、Logo、文案和主题色通过构建环境切换。
## 本地开发
```bash
npm ci
npm run dev
```
开发解忧遥品牌:
```bash
npm run dev:jieyouyao
```
默认开发地址为 `http://localhost:3000`。
## 分别构建
```bash
npm run build:dachui
npm run build:jieyouyao
```
产物分别位于:
- `dist/dachui/`
- `dist/jieyouyao/`
不指定品牌时,`npm run build` 默认构建大锤网络到 `dist/`。
## Docker
```bash
docker compose up -d --build
```
两个站点使用同一份源代码和 Dockerfile,仅构建参数不同:
- 大锤网络:宿主机 `8090`
- 解忧遥网络:宿主机 `8091`
域名入口模板见 `deploy/Caddyfile.brands.example`。
## 品牌配置
品牌定义位于 `src/config/brands.js`。新增品牌时:
1. 在 `brands.js` 增加品牌配置。
2. 增加对应 `.env.<brand>`。
3. 在 `package.json` 增加开发与构建脚本。
4. 在 `docker-compose.yml` 增加独立前端服务端口。
## 发布前确认
- 解忧遥网络正式域名为 `mall.hao857.com`。
- 如使用真实后端,需要配置 `VITE_API_URL` 和网关 `/api` 反向代理。
- 当前订单、购物车和登录仍包含演示 mock 回退,正式交易前应关闭生产环境回退。
+9
View File
@@ -0,0 +1,9 @@
mail.khhao.com, mall.khhao.com {
encode gzip zstd
reverse_proxy 172.17.0.1:8090
}
mall.hao857.com {
encode gzip zstd
reverse_proxy 172.17.0.1:8091
}
+13
View File
@@ -3,7 +3,20 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
VITE_BRAND: dachui
container_name: dachui_pc_web
restart: always
ports:
- "8090:80"
jieyouyao-pc:
build:
context: .
dockerfile: Dockerfile
args:
VITE_BRAND: jieyouyao
container_name: jieyouyao_mall_web
restart: always
ports:
- "8091:80"
+5 -3
View File
@@ -2,14 +2,16 @@
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="./favicon.ico" />
<link rel="icon" type="image/svg+xml" href="%VITE_BRAND_FAVICON%" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>大锤网络 - 官方旗舰商城 & 数码设备免押租赁</title>
<meta name="theme-color" content="%VITE_BRAND_THEME%" />
<meta name="description" content="%VITE_BRAND_DESCRIPTION%" />
<title>%VITE_BRAND_NAME% - 官方旗舰商城 & 数码设备免押租赁</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<body class="bg-gray-50 text-gray-800 font-sans antialiased selection:bg-red-500 selection:text-white">
<body class="bg-gray-50 text-gray-800 font-sans antialiased selection:bg-primary selection:text-white">
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
+6 -3
View File
@@ -4,9 +4,12 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"dev": "vite --mode dachui",
"dev:jieyouyao": "vite --mode jieyouyao",
"build": "vite build --mode dachui",
"build:dachui": "vite build --mode dachui --outDir dist/dachui",
"build:jieyouyao": "vite build --mode jieyouyao --outDir dist/jieyouyao",
"preview": "vite preview --mode dachui"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
+11
View File
@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<defs>
<linearGradient id="brand" x1="8" y1="8" x2="56" y2="56" gradientUnits="userSpaceOnUse">
<stop stop-color="#e93323"/>
<stop offset="1" stop-color="#ff7700"/>
</linearGradient>
</defs>
<rect width="64" height="64" rx="16" fill="url(#brand)"/>
<path d="M18 19h28v7H18zm4 12h20v6H22zm-5 12h30v6H17z" fill="#fff"/>
<circle cx="32" cy="16" r="3" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 460 B

+11
View File
@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<defs>
<linearGradient id="brand" x1="8" y1="8" x2="56" y2="56" gradientUnits="userSpaceOnUse">
<stop stop-color="#0f766e"/>
<stop offset="1" stop-color="#f59e0b"/>
</linearGradient>
</defs>
<rect width="64" height="64" rx="16" fill="url(#brand)"/>
<path d="M18 19h28v7H18zm4 12h20v6H22zm-5 12h30v6H17z" fill="#fff"/>
<circle cx="32" cy="16" r="3" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 460 B

+2 -1
View File
@@ -45,7 +45,7 @@
<div class="text-center p-2 text-xs">
<p class="font-bold text-gray-800">官方在线客服</p>
<p class="text-gray-400 mt-1 text-[11px]">9:00 - 21:00 在线</p>
<a href="http://localhost:8011/admin" target="_blank" class="mt-2 inline-block px-3 py-1 bg-primary text-white rounded text-[11px]">客服工作台</a>
<a :href="brand.serviceWorkbenchUrl" target="_blank" class="mt-2 inline-block px-3 py-1 bg-primary text-white rounded text-[11px]">客服工作台</a>
</div>
</el-popover>
@@ -73,6 +73,7 @@ import MobileBottomNav from '@/components/MobileBottomNav.vue'
import AuthModal from '@/components/AuthModal.vue'
import { useUserStore } from '@/store/user'
import { useCartStore } from '@/store/cart'
import { brand } from '@/config/brands'
const userStore = useUserStore()
const cartStore = useCartStore()
+6 -5
View File
@@ -1,4 +1,5 @@
import request from './request'
import { brand } from '@/config/brands'
import {
mockCategories,
mockBanners,
@@ -39,13 +40,13 @@ export const getRecommendList = (type) =>
}))
export const getSiteConfig = () =>
safeCall(() => request.get('/site_config'), { site_name: '大锤网络 官方旗舰商城', version: '6.0.0' })
safeCall(() => request.get('/site_config'), { site_name: `${brand.name} 官方旗舰商城`, version: '6.0.0' })
export const getHotSearch = () =>
safeCall(() => request.get('/search/keyword'), ['租电脑', '租iPhone', '租iPad', 'MacBook Pro', '智能手表'])
export const getCompanyInfo = () =>
safeCall(() => request.get('/pc/get_company_info'), { company_name: '大锤网络 智能数码租赁与商城', tel: '400-888-9999' })
safeCall(() => request.get('/pc/get_company_info'), { company_name: brand.companyDescription, tel: brand.customerServicePhone })
export const getWechatQrcode = () =>
safeCall(() => request.get('/pc/get_wechat_qrcode'), { code: '' })
@@ -251,18 +252,18 @@ export const getNewsCategory = () =>
export const getNewsList = (params) =>
safeCall(() => request.get('/pc/get_news_list', { params }), {
list: [
{ id: 1, title: '关于 大锤网络 开启全国免押数码设备租赁业务的通知', synopsis: '支持芝麻信用免押金快速起租,包含苹果MacBook、旗舰手机及平板...', add_time: '2026-08-19' },
{ id: 1, title: `关于 ${brand.name} 开启全国免押数码设备租赁业务的通知`, synopsis: '支持芝麻信用免押金快速起租,包含苹果MacBook、旗舰手机及平板...', add_time: '2026-08-19' },
{ id: 2, title: '数码设备长租与买断方案深度解读:怎样租最划算?', synopsis: '全品类数码设备租满 12 个月即可 0 元买断...', add_time: '2026-08-18' }
]
})
export const getNewsDetail = (id) =>
safeCall(() => request.get(`/pc/get_news_detail/${id}`), {
title: '关于 大锤网络 开启全国免押数码设备租赁业务的通知',
title: `关于 ${brand.name} 开启全国免押数码设备租赁业务的通知`,
add_time: '2026-08-19',
visit: 1280,
content: `
<p>为满足广大企业客户与个人用户的短期体验、办公扩容及活动会展需求,大锤网络 商城即日起全面开启全品类数码设备信用免押租赁服务!</p>
<p>为满足广大企业客户与个人用户的短期体验、办公扩容及活动会展需求,${brand.name} 商城即日起全面开启全品类数码设备信用免押租赁服务!</p>
<p><strong>业务核心亮点:</strong></p>
<ul>
<li>1. 芝麻信用分 ≥ 650 即可享受 0 押金极速起租;</li>
+10 -9
View File
@@ -4,7 +4,7 @@
<div class="max-w-site mx-auto px-4 pb-12 border-b border-gray-800">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div class="flex items-center space-x-4">
<div class="w-12 h-12 rounded-full bg-red-950/60 border border-red-800/40 text-primary flex items-center justify-center text-xl font-bold">
<div class="w-12 h-12 rounded-full bg-primary-dark/40 border border-primary/30 text-primary flex items-center justify-center text-xl font-bold">
正
</div>
<div>
@@ -13,7 +13,7 @@
</div>
</div>
<div class="flex items-center space-x-4">
<div class="w-12 h-12 rounded-full bg-red-950/60 border border-red-800/40 text-primary flex items-center justify-center text-xl font-bold">
<div class="w-12 h-12 rounded-full bg-primary-dark/40 border border-primary/30 text-primary flex items-center justify-center text-xl font-bold">
快
</div>
<div>
@@ -22,7 +22,7 @@
</div>
</div>
<div class="flex items-center space-x-4">
<div class="w-12 h-12 rounded-full bg-red-950/60 border border-red-800/40 text-primary flex items-center justify-center text-xl font-bold">
<div class="w-12 h-12 rounded-full bg-primary-dark/40 border border-primary/30 text-primary flex items-center justify-center text-xl font-bold">
退
</div>
<div>
@@ -31,7 +31,7 @@
</div>
</div>
<div class="flex items-center space-x-4">
<div class="w-12 h-12 rounded-full bg-red-950/60 border border-red-800/40 text-primary flex items-center justify-center text-xl font-bold">
<div class="w-12 h-12 rounded-full bg-primary-dark/40 border border-primary/30 text-primary flex items-center justify-center text-xl font-bold">
享
</div>
<div>
@@ -69,7 +69,7 @@
</ul>
</div>
<div>
<h5 class="text-white font-semibold mb-4 text-sm">关于 大锤网络</h5>
<h5 class="text-white font-semibold mb-4 text-sm">关于 {{ brand.name }}</h5>
<ul class="space-y-2.5">
<li><a href="javascript:;" class="hover:text-white transition-colors">企业简介</a></li>
<li><a href="javascript:;" class="hover:text-white transition-colors">免押租赁协议</a></li>
@@ -77,8 +77,8 @@
</ul>
</div>
<div class="col-span-2 md:col-span-1 text-center md:text-left">
<h5 class="text-white font-semibold mb-4 text-sm">大锤客服热线</h5>
<p class="text-primary font-bold text-lg">400-888-9999</p>
<h5 class="text-white font-semibold mb-4 text-sm">{{ brand.customerServiceTitle }}</h5>
<p class="text-primary font-bold text-lg">{{ brand.customerServicePhone }}</p>
<p class="text-[11px] text-gray-500 mt-1">周一至周日 9:00 - 21:00</p>
<button class="mt-3 w-full max-w-[160px] py-2 bg-primary hover:bg-primary-hover text-white rounded font-medium text-xs transition-colors">
在线客服咨询
@@ -88,11 +88,12 @@
<!-- Copyright -->
<div class="max-w-site mx-auto px-4 pt-8 border-t border-gray-800 text-center text-xs text-gray-500 space-y-2">
<p>© {{ new Date().getFullYear() }} 大锤网络科技. 保留所有权利.</p>
<p>大锤网络 · 高品质数码商城 & 企业/个人信用免押租赁平台</p>
<p>© {{ new Date().getFullYear() }} {{ brand.legalName }}. 保留所有权利.</p>
<p>{{ brand.footerDescription }}</p>
</div>
</footer>
</template>
<script setup>
import { brand } from '@/config/brands'
</script>
+7 -6
View File
@@ -4,7 +4,7 @@
<div class="hidden md:block bg-gray-100 border-b border-gray-200 text-xs text-gray-600 py-1.5">
<div class="max-w-site mx-auto px-4 flex justify-between items-center">
<div class="flex items-center space-x-3">
<span>欢迎来到 大锤网络 官方旗舰商城!</span>
<span>{{ brand.welcome }}</span>
<span class="text-gray-300">|</span>
<span class="text-gray-500">数码直营 · 免押租赁 · 正品保障</span>
</div>
@@ -33,15 +33,15 @@
<div class="flex items-center justify-between">
<!-- Logo -->
<router-link to="/" class="flex items-center space-x-2 sm:space-x-3 group">
<div class="w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-gradient-to-tr from-primary to-orange-500 flex items-center justify-center text-white font-black text-lg sm:text-xl shadow-md shadow-red-200 group-hover:scale-105 transition-transform">
锤
<div class="w-8 h-8 sm:w-10 sm:h-10 rounded-xl bg-gradient-to-tr from-primary to-orange-500 flex items-center justify-center text-white font-black text-lg sm:text-xl shadow-md shadow-primary/20 group-hover:scale-105 transition-transform">
{{ brand.logo }}
</div>
<div>
<div class="text-lg sm:text-2xl font-black tracking-tight text-gray-900 flex items-center">
<span>大锤网络</span>
<span class="ml-1 sm:ml-1.5 px-1 sm:px-1.5 py-0.5 text-[9px] sm:text-[10px] bg-red-100 text-primary font-bold rounded">商城 & 免押租赁</span>
<span>{{ brand.name }}</span>
<span class="ml-1 sm:ml-1.5 px-1 sm:px-1.5 py-0.5 text-[9px] sm:text-[10px] bg-primary-light text-primary font-bold rounded">商城 & 免押租赁</span>
</div>
<p class="hidden sm:block text-[11px] text-gray-400">专业数码商城 · 信用免押设备租赁</p>
<p class="hidden sm:block text-[11px] text-gray-400">{{ brand.tagline }}</p>
</div>
</router-link>
@@ -154,6 +154,7 @@ import { useRouter } from 'vue-router'
import { useUserStore } from '@/store/user'
import { useCartStore } from '@/store/cart'
import { getHotSearch } from '@/api'
import { brand } from '@/config/brands'
const router = useRouter()
const userStore = useUserStore()
+2 -2
View File
@@ -10,7 +10,7 @@
/>
<!-- Badges -->
<div class="absolute top-2.5 left-2.5 flex flex-col gap-1">
<span v-if="product.is_hot" class="px-2 py-0.5 text-[11px] font-bold bg-red-500 text-white rounded-md shadow-sm">爆款</span>
<span v-if="product.is_hot" class="px-2 py-0.5 text-[11px] font-bold bg-primary text-white rounded-md shadow-sm">爆款</span>
<span v-else-if="product.is_new" class="px-2 py-0.5 text-[11px] font-bold bg-green-500 text-white rounded-md shadow-sm">新品</span>
<span v-else-if="product.is_benefit" class="px-2 py-0.5 text-[11px] font-bold bg-orange-500 text-white rounded-md shadow-sm">特惠</span>
</div>
@@ -18,7 +18,7 @@
<!-- Quick Add to Cart Overlay on hover -->
<button
@click.stop="quickAddCart"
class="absolute bottom-3 right-3 w-9 h-9 rounded-full bg-primary hover:bg-primary-hover text-white flex items-center justify-center shadow-lg shadow-red-300 opacity-0 group-hover:opacity-100 transform translate-y-2 group-hover:translate-y-0 transition-all duration-200"
class="absolute bottom-3 right-3 w-9 h-9 rounded-full bg-primary hover:bg-primary-hover text-white flex items-center justify-center shadow-lg shadow-primary/30 opacity-0 group-hover:opacity-100 transform translate-y-2 group-hover:translate-y-0 transition-all duration-200"
title="加入购物车"
>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"></path></svg>
+80
View File
@@ -0,0 +1,80 @@
const brands = {
dachui: {
key: 'dachui',
name: '大锤网络',
legalName: '大锤网络科技',
logo: '锤',
welcome: '欢迎来到 大锤网络 官方旗舰商城!',
tagline: '专业数码商城 · 信用免押设备租赁',
companyDescription: '大锤网络 智能数码租赁与商城',
footerDescription: '大锤网络 · 高品质数码商城 & 企业/个人信用免押租赁平台',
customerServiceTitle: '大锤客服热线',
customerServicePhone: '400-888-9999',
serviceWorkbenchUrl: 'http://localhost:8011/admin',
theme: {
primary: '#e93323',
primaryHover: '#d82819',
primaryLight: '#fdebe9',
primaryDark: '#b71d10',
primaryRgb: '233 51 35',
primaryHoverRgb: '216 40 25',
primaryLightRgb: '253 235 233',
primaryDarkRgb: '183 29 16'
}
},
jieyouyao: {
key: 'jieyouyao',
name: '解忧遥网络',
legalName: '解忧遥网络科技',
logo: '解',
welcome: '欢迎来到 解忧遥网络 官方旗舰商城!',
tagline: '数码严选商城 · 信用免押设备租赁',
companyDescription: '解忧遥网络 智能数码租赁与商城',
footerDescription: '解忧遥网络 · 高品质数码商城 & 企业/个人信用免押租赁平台',
customerServiceTitle: '解忧遥客服热线',
customerServicePhone: '400-888-9999',
serviceWorkbenchUrl: 'http://localhost:8011/admin',
theme: {
primary: '#0f766e',
primaryHover: '#0d9488',
primaryLight: '#ccfbf1',
primaryDark: '#115e59',
primaryRgb: '15 118 110',
primaryHoverRgb: '13 148 136',
primaryLightRgb: '204 251 241',
primaryDarkRgb: '17 94 89'
}
}
}
export const brandKey = import.meta.env.VITE_BRAND || 'dachui'
export const brand = brands[brandKey] || brands.dachui
export const applyBrandTheme = () => {
const root = document.documentElement
const theme = brand.theme
root.style.setProperty('--brand-primary-rgb', theme.primaryRgb)
root.style.setProperty('--brand-primary-hover-rgb', theme.primaryHoverRgb)
root.style.setProperty('--brand-primary-light-rgb', theme.primaryLightRgb)
root.style.setProperty('--brand-primary-dark-rgb', theme.primaryDarkRgb)
root.style.setProperty('--el-color-primary', theme.primary)
root.style.setProperty('--el-color-primary-light-3', mixHex(theme.primary, '#ffffff', 0.3))
root.style.setProperty('--el-color-primary-light-5', mixHex(theme.primary, '#ffffff', 0.5))
root.style.setProperty('--el-color-primary-light-7', mixHex(theme.primary, '#ffffff', 0.7))
root.style.setProperty('--el-color-primary-light-8', mixHex(theme.primary, '#ffffff', 0.8))
root.style.setProperty('--el-color-primary-light-9', mixHex(theme.primary, '#ffffff', 0.9))
root.style.setProperty('--el-color-primary-dark-2', theme.primaryDark)
const themeMeta = document.querySelector('meta[name="theme-color"]')
if (themeMeta) themeMeta.setAttribute('content', theme.primary)
}
const mixHex = (source, target, weight) => {
const parse = (hex) => hex.replace('#', '').match(/.{2}/g).map((value) => Number.parseInt(value, 16))
const from = parse(source)
const to = parse(target)
const mixed = from.map((value, index) => Math.round(value + (to[index] - value) * weight))
return `#${mixed.map((value) => value.toString(16).padStart(2, '0')).join('')}`
}
+4
View File
@@ -7,8 +7,12 @@ import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import router from './router'
import { applyBrandTheme, brand } from './config/brands'
import './styles/index.css'
applyBrandTheme()
document.title = `${brand.name} - 官方旗舰商城 & 数码设备免押租赁`
const app = createApp(App)
const pinia = createPinia()
+10 -9
View File
@@ -1,59 +1,60 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import { brand } from '@/config/brands'
const routes = [
{
path: '/',
name: 'Home',
component: () => import('@/views/Home.vue'),
meta: { title: '首页 - 大锤网络 官方旗舰商城' }
meta: { title: `首页 - ${brand.name} 官方旗舰商城` }
},
{
path: '/products',
name: 'ProductList',
component: () => import('@/views/ProductList.vue'),
meta: { title: '商品列表 - 大锤网络' }
meta: { title: `商品列表 - ${brand.name}` }
},
{
path: '/rental',
name: 'Rental',
component: () => import('@/views/Rental.vue'),
meta: { title: '数码设备免押租赁专区 - 大锤网络' }
meta: { title: `数码设备免押租赁专区 - ${brand.name}` }
},
{
path: '/product/:id',
name: 'ProductDetail',
component: () => import('@/views/ProductDetail.vue'),
meta: { title: '商品详情 - 大锤网络' }
meta: { title: `商品详情 - ${brand.name}` }
},
{
path: '/cart',
name: 'Cart',
component: () => import('@/views/Cart.vue'),
meta: { title: '我的购物车 - 大锤网络', requiresAuth: true }
meta: { title: `我的购物车 - ${brand.name}`, requiresAuth: true }
},
{
path: '/checkout',
name: 'Checkout',
component: () => import('@/views/Checkout.vue'),
meta: { title: '结算中心 - 大锤网络', requiresAuth: true }
meta: { title: `结算中心 - ${brand.name}`, requiresAuth: true }
},
{
path: '/user',
name: 'User',
component: () => import('@/views/User.vue'),
meta: { title: '个人中心 - 大锤网络', requiresAuth: true }
meta: { title: `个人中心 - ${brand.name}`, requiresAuth: true }
},
{
path: '/news',
name: 'NewsList',
component: () => import('@/views/NewsList.vue'),
meta: { title: '新闻资讯 - 大锤网络' }
meta: { title: `新闻资讯 - ${brand.name}` }
},
{
path: '/news/:id',
name: 'NewsDetail',
component: () => import('@/views/NewsDetail.vue'),
meta: { title: '资讯详情 - 大锤网络' }
meta: { title: `资讯详情 - ${brand.name}` }
}
]
+4 -7
View File
@@ -4,13 +4,10 @@
@layer base {
:root {
--el-color-primary: #e93323;
--el-color-primary-light-3: #f06b60;
--el-color-primary-light-5: #f4928b;
--el-color-primary-light-7: #f8bab5;
--el-color-primary-light-8: #fbc2bd;
--el-color-primary-light-9: #fdebe9;
--el-color-primary-dark-2: #ba291c;
--brand-primary-rgb: 233 51 35;
--brand-primary-hover-rgb: 216 40 25;
--brand-primary-light-rgb: 253 235 233;
--brand-primary-dark-rgb: 183 29 16;
}
body {
+5 -4
View File
@@ -58,7 +58,7 @@
<div class="absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent flex items-end p-8">
<div>
<span class="px-2.5 py-1 bg-primary text-white text-xs font-bold rounded-lg mb-2 inline-block">精选推荐</span>
<h3 class="text-2xl font-bold text-white tracking-wide">{{ item.name || '大锤网络 · 数码狂欢' }}</h3>
<h3 class="text-2xl font-bold text-white tracking-wide">{{ item.name || `${brand.name} · 数码狂欢` }}</h3>
</div>
</div>
</div>
@@ -75,7 +75,7 @@
class="w-16 h-16 rounded-full mx-auto object-cover border-2 border-red-100 shadow-sm"
/>
<p class="text-sm font-bold text-gray-800 mt-2">
{{ userStore.token ? (userStore.userInfo?.nickname || userStore.userInfo?.account || '尊贵会员') : 'Hi,欢迎来到 大锤网络' }}
{{ userStore.token ? (userStore.userInfo?.nickname || userStore.userInfo?.account || '尊贵会员') : `Hi,欢迎来到 ${brand.name}` }}
</p>
<p class="text-xs text-gray-400 mt-0.5">正品大牌 · 全场包邮 · 售后无忧</p>
@@ -140,7 +140,7 @@
<div class="w-full h-full relative cursor-pointer" @click="handleBannerClick(item)">
<img :src="item.pic || item.img" class="w-full h-full object-cover" />
<div class="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent flex items-end p-4">
<h3 class="text-sm font-bold text-white line-clamp-1">{{ item.name || '大锤网络 · 爆款数码狂欢' }}</h3>
<h3 class="text-sm font-bold text-white line-clamp-1">{{ item.name || `${brand.name} · 爆款数码狂欢` }}</h3>
</div>
</div>
</el-carousel-item>
@@ -353,6 +353,7 @@ import { useRouter } from 'vue-router'
import { useUserStore } from '@/store/user'
import { useCartStore } from '@/store/cart'
import ProductCard from '@/components/ProductCard.vue'
import { brand } from '@/config/brands'
import {
getBanner,
getCategory,
@@ -424,7 +425,7 @@ const categoryFloors = ref([
{ id: 2, cate_name: '📱 智能手机 / 旗舰数码', productList: mockProducts.slice(2, 6) }
])
const newsList = ref([
{ id: 1, title: '关于 大锤网络 开启全国免押数码设备租赁业务的通知' },
{ id: 1, title: `关于 ${brand.name} 开启全国免押数码设备租赁业务的通知` },
{ id: 2, title: '数码设备长租与买断方案深度解读:怎样租最划算?' }
])
+2 -1
View File
@@ -42,12 +42,13 @@
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { getNewsList } from '@/api'
import { brand } from '@/config/brands'
const router = useRouter()
const list = ref([
{
id: 1,
title: '关于 大锤网络 开启全国免押数码设备租赁业务的通知',
title: `关于 ${brand.name} 开启全国免押数码设备租赁业务的通知`,
synopsis: '支持芝麻信用免押金快速起租,包含苹果MacBook、旗舰手机及平板...',
add_time: '2026-08-19'
},
+2 -1
View File
@@ -253,6 +253,7 @@ import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { useUserStore } from '@/store/user'
import { ElMessage } from 'element-plus'
import { brand } from '@/config/brands'
const router = useRouter()
const userStore = useUserStore()
@@ -406,7 +407,7 @@ const openRentalModal = (item) => {
}
const openConsult = () => {
ElMessage.success('企业客服专线已接通:400-888-9999,请联系在线客服了解企业批量免押授信方案')
ElMessage.success(`企业客服专线已接通:${brand.customerServicePhone},请联系在线客服了解企业批量免押授信方案`)
}
const submitRental = () => {
+4 -4
View File
@@ -8,10 +8,10 @@ export default {
extend: {
colors: {
primary: {
DEFAULT: '#e93323',
hover: '#d82819',
light: '#fdebe9',
dark: '#b71d10'
DEFAULT: 'rgb(var(--brand-primary-rgb) / <alpha-value>)',
hover: 'rgb(var(--brand-primary-hover-rgb) / <alpha-value>)',
light: 'rgb(var(--brand-primary-light-rgb) / <alpha-value>)',
dark: 'rgb(var(--brand-primary-dark-rgb) / <alpha-value>)'
},
secondary: {
DEFAULT: '#ff7700',