更新密码找回uniapp

This commit is contained in:
hero920103 committed 2026-11-16 17:22:50 +08:00
1 parent 7f9a66da0f
commit 3fdda89833
1304 files changed
+3503 -26132

No files matched your search

-1
View File
@@ -1,5 +1,4 @@
<script setup lang="ts">
// 站点根组件:仅负责渲染路由出口
</script>
<template>
-63
View File
@@ -17,22 +17,11 @@ import { news } from "@/data/news";
import { events } from "@/data/events";
import { singlePages } from "@/data/pages";
/**
* 内容数据访问层
*
* 已接入后端真实数据的栏目见 REMOTE_SECTIONS(数据来自 platform 端「官网管理」,
* 落库 yz_platform_website_*,由 Go 的 /site/* 接口对外提供)。
* 其余栏目仍读本地 mock,后续可逐个迁移 —— 接入时只需把栏目 key 加进
* REMOTE_SECTIONS 并补上对应的 fetchXxx 分支,调用方(list/detail 页)无需改动。
*/
/** 已接入后端接口的栏目 */
const REMOTE_SECTIONS: SectionKey[] = ["news"];
const isRemote = (section: SectionKey): boolean =>
REMOTE_SECTIONS.includes(section);
/** 本地 mock 数据(未接入后端的栏目使用) */
const registry: Record<SectionKey, ContentItem[]> = {
news,
products,
@@ -41,16 +30,10 @@ const registry: Record<SectionKey, ContentItem[]> = {
events,
};
/* ============================================================
* 后端数据 -> 页面内容模型
* ============================================================ */
/** /site/news 系列接口返回的文章结构 */
interface RemoteArticle {
id: number;
title: string;
summary?: string;
/** 文章自身的封面图 */
image?: string;
content?: string;
author?: string;
@@ -61,7 +44,6 @@ interface RemoteArticle {
category_id?: number;
category_name?: string;
category_desc?: string;
/** 所属分类的图片,文章没有封面图时作为兜底 */
category_image?: string;
tags?: string[];
}
@@ -76,7 +58,6 @@ interface RemoteListData {
interface RemoteCategoryItem {
id: number;
/** 父级分类ID,0 为顶级 */
cid?: number;
name: string;
desc?: string;
@@ -84,12 +65,10 @@ interface RemoteCategoryItem {
count: number;
}
/** 封面配色池:后端数据没有配色字段,按内容ID稳定取色,避免每次渲染跳色 */
const TONES: CoverTone[] = ["navy", "blue", "teal", "indigo"];
const toneOf = (id: number): CoverTone =>
TONES[Math.abs(id || 0) % TONES.length];
/** 后端时间(RFC3339)-> YYYY-MM-DD */
function formatDate(value?: string | null): string {
if (!value) return "";
const date = new Date(value);
@@ -98,10 +77,8 @@ function formatDate(value?: string | null): string {
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
}
/** 后端文章 -> 页面内容模型 */
function toContentItem(raw: RemoteArticle, withContent = false): ContentItem {
const blocks: Block[] = [];
// 正文由平台「文章管理」用富文本编辑器录入,这里整体作为一个 html 区块交给渲染器
if (withContent && raw.content) {
blocks.push({ type: "html", html: raw.content });
}
@@ -112,7 +89,6 @@ function toContentItem(raw: RemoteArticle, withContent = false): ContentItem {
category: raw.category_id ? String(raw.category_id) : "",
categoryName: raw.category_name || "",
title: raw.title || "",
// 后端没有独立的副标题字段,列表卡片的 eyebrow 留空,不编造内容
subtitle: "",
summary: raw.summary || "",
tone: toneOf(raw.id),
@@ -120,20 +96,13 @@ function toContentItem(raw: RemoteArticle, withContent = false): ContentItem {
author: raw.author || "",
tags: raw.tags ?? [],
featured: raw.recommend === 1 || raw.top === 1,
// 封面兜底链:文章封面 -> 所属分类图片 -> 空(为空时 ContentCard 按 tone 渲染渐变占位)
image: assetUrl(raw.image) || assetUrl(raw.category_image),
blocks,
};
}
/* ============================================================
* 对外方法
* ============================================================ */
/** 模拟一次异步请求,保证调用方始终按异步处理 */
const tick = () => new Promise<void>((resolve) => setTimeout(resolve, 0));
/** 列表 / 分类 / 搜索(带分页) */
export async function fetchList(query: ListQuery): Promise<ListResult> {
const { section, category, keyword, page = 1, pageSize = 6 } = query;
@@ -144,7 +113,6 @@ export async function fetchList(query: ListQuery): Promise<ListResult> {
category,
keyword,
});
// 接口异常时不回落 mock:官网展示真实数据,无数据就展示空态,便于发现问题
if (!data) {
return { list: [], total: 0, page, pageSize, totalPages: 1 };
}
@@ -190,7 +158,6 @@ export async function fetchList(query: ListQuery): Promise<ListResult> {
};
}
/** 详情 */
export async function fetchDetail(
section: SectionKey,
slug: string
@@ -200,7 +167,6 @@ export async function fetchDetail(
`/site/news/${encodeURIComponent(slug)}`
);
if (!data) return undefined;
// 浏览量 +1,失败不影响正文展示
void postJSON(`/site/news/${encodeURIComponent(slug)}/view`);
return toContentItem(data, true);
}
@@ -209,7 +175,6 @@ export async function fetchDetail(
return (registry[section] ?? []).find((item) => item.slug === slug);
}
/** 相关推荐:同分类优先,不足时用同栏目其它内容补齐 */
export async function fetchRelated(
section: SectionKey,
slug: string,
@@ -238,7 +203,6 @@ export async function fetchRelated(
return [...sameCategory, ...others].slice(0, limit);
}
/** 统计各分类下的内容数量,用于筛选条上的角标;__all__ 为总数 */
export async function fetchCategoryCounts(
section: SectionKey
): Promise<Record<string, number>> {
@@ -263,11 +227,6 @@ export async function fetchCategoryCounts(
return counts;
}
/**
* 后端分类是扁平列表(带 cid),这里在前端按 cid 组树。
* 顶级分类作为筛选条第一行,子分类作为第二行。
* 父级不存在(数据异常)时视为顶级,避免分类丢失。
*/
function buildCategoryTree(raw: RemoteCategoryItem[]): Category[] {
const nodes: Category[] = raw.map((item) => ({
slug: String(item.id),
@@ -292,11 +251,6 @@ function buildCategoryTree(raw: RemoteCategoryItem[]): Category[] {
return roots;
}
/**
* 分类列表:已接入后端的栏目取后端分类(返回父子树),
* 其余取 config/sections 的静态配置。
* 分类 slug 统一用字符串,便于路由参数传递。
*/
export async function fetchCategories(section: SectionKey): Promise<Category[]> {
if (isRemote(section)) {
const data = await getJSON<{ list: RemoteCategoryItem[] }>(
@@ -307,7 +261,6 @@ export async function fetchCategories(section: SectionKey): Promise<Category[]>
return sections[section].categories;
}
/** 单页:key 为去掉前导斜杠的路径,例如 about、support/docs */
export async function fetchSinglePage(
key: string
): Promise<SinglePage | undefined> {
@@ -315,11 +268,6 @@ export async function fetchSinglePage(
return singlePages[key];
}
/* ============================================================
* 站点公告(yz_platform_website_notice)
* ============================================================ */
/** /site/notices 返回的公告结构 */
interface RemoteNotice {
id: number;
title: string;
@@ -337,29 +285,18 @@ export interface NoticeItem {
summary: string;
type: number;
typeLabel: string;
/** 跳转地址:站内相对路径或完整 URL,为空表示不可点击 */
linkUrl: string;
/** linkUrl 是否站外地址 */
external: boolean;
top: boolean;
/** YYYY-MM-DD,无发布时间时为空串 */
date: string;
}
/** 公告类型:与平台端「官网管理 - 站点公告」保持一致 */
const NOTICE_TYPE_LABELS: Record<number, string> = {
1: "通知公告",
2: "活动公告",
3: "系统维护",
};
/**
* 站点公告列表(首页 banner 下方的「弹窗公告」区)
*
* 后端已按「已发布 + 处于有效期内」过滤,已过期、未发布、已下线的公告
* 不会返回 —— 因此调用方只需判断返回是否为空,为空即隐藏公告区。
* 接口异常时同样返回空数组,由页面降级隐藏,不影响新闻中心展示。
*/
export async function fetchNotices(
options: { popup?: boolean; limit?: number } = {}
): Promise<NoticeItem[]> {
-18
View File
@@ -1,35 +1,18 @@
/**
* 官网 SPA 轻量请求封装
*
* 基地址规则与 api/site.ts 保持一致:
* 开发期 .env.development 的 VITE_API_BASE_URL 指向本地 Go 服务(http://localhost:9000),
* 未配置时回落 /api,由 vite 代理到后端。
*
* 约定:所有接口返回后端统一结构 { code, msg, data },
* 这里只把 data 交给调用方;请求失败或 code !== 200 时返回 null,
* 由调用方决定展示空态还是降级,避免异常直接冒泡到页面。
*/
const API_BASE = (
(import.meta as any).env?.VITE_API_BASE_URL || "/api"
).replace(/\/$/, "");
/** 拼接口完整地址 */
export function apiUrl(path: string): string {
return `${API_BASE}${path.startsWith("/") ? "" : "/"}${path}`;
}
/**
* 后端返回的资源地址补全为可访问地址。
* 图片等资源存的是 /uploads/... 相对路径,需要拼上接口域名。
*/
export function assetUrl(path?: string): string {
if (!path) return "";
if (/^https?:\/\//i.test(path)) return path;
return apiUrl(path);
}
/** GET 请求,返回 data;失败返回 null */
export async function getJSON<T>(
path: string,
params?: Record<string, unknown>
@@ -54,7 +37,6 @@ export async function getJSON<T>(
}
}
/** POST 请求(无请求体),用于浏览量累加等副作用接口;失败静默 */
export async function postJSON(path: string): Promise<boolean> {
try {
const res = await fetch(apiUrl(path), {
-31
View File
@@ -1,49 +1,18 @@
/**
* 站点设置接口
*
* 数据来源:后端 yz_platform_site_setting(platform 端「官网管理 - 站点设置」)。
* 返回字段名与官网模板标签一一对应,因此 SPA 官网与 themes 直出模板展示的
* 站点信息始终一致:
* sitename {yz:sitename} 站点名称
* logo {yz:logo} 深色 Logo(浅色背景)
* logow {yz:logow} 浅色 Logo(深色背景)
* icp {yz:icp} ICP 备案号
* policeicp {yz:policeicp} 公安备案号
* copyright {yz:copyright} 版权信息
* privacy {yz:privacy} 隐私政策链接
* terms {yz:terms} 使用条款链接
*/
/**
* 后端返回的站点设置:key 就是模板标签名
* 完全数据驱动 —— 表里有什么 tag 就返回什么,新增设置项前端无需改动。
* 下列为常用项的类型提示,其余标签通过索引签名访问即可。
*/
export type SiteSetting = Record<string, string> & {
/** {yz:sitename} 站点名称 */
sitename?: string;
/** {yz:subtitle} 副标题 */
subtitle?: string;
/** {yz:logo} 深色 Logo,用于浅色背景(如页头) */
logo?: string;
/** {yz:logow} 浅色 Logo,用于深色背景(如页脚) */
logow?: string;
/** {yz:icp} ICP 备案号 */
icp?: string;
/** {yz:policeicp} 公安备案号 */
policeicp?: string;
/** {yz:copyright} 版权信息 */
copyright?: string;
/** {yz:privacy} 隐私政策链接 */
privacy?: string;
/** {yz:terms} 使用条款链接 */
terms?: string;
};
/** 接口前缀:开发期由 vite 代理 /api 到后端,生产可用 VITE_API_BASE_URL 覆盖 */
const API_BASE = (import.meta as any).env?.VITE_API_BASE_URL || "/api";
/** 拉取当前域名的站点设置;接口不可用时返回 null,由调用方保留默认配置 */
export async function fetchSiteSetting(): Promise<SiteSetting | null> {
try {
const res = await fetch(`${API_BASE}/site/setting`, {
-4
View File
@@ -1,8 +1,4 @@
<script setup lang="ts">
/**
* 轻量图标组件:统一描边风格,颜色继承 currentColor
* 用法:<AppIcon name="calendar" :size="22" />
*/
withDefaults(
defineProps<{
name: string;
-8
View File
@@ -1,13 +1,6 @@
<script setup lang="ts">
/**
* 全站「回到顶部」按钮
*
* 已在 main.ts 注册为全局组件,DefaultLayout 中渲染一次即对全站生效。
* 页面滚动超过 SHOW_OFFSET 后淡入,点击平滑回到页面顶部。
*/
import { onBeforeUnmount, onMounted, ref } from "vue";
/** 页面滚动超过该距离才显示按钮 */
const SHOW_OFFSET = 320;
const visible = ref(false);
@@ -17,7 +10,6 @@ const onScroll = () => {
};
const toTop = () => {
// html 上已有 scroll-behavior: smooth,这里显式声明以避免被局部样式覆盖
window.scrollTo({ top: 0, behavior: "smooth" });
};
-25
View File
@@ -8,32 +8,27 @@ defineProps<{ blocks: Block[] }>();
<template>
<div class="blocks">
<template v-for="(block, index) in blocks" :key="index">
<!-- 富文本正文:后端(平台「文章管理」)录入的 HTML 原样渲染 -->
<div
v-if="block.type === 'html'"
class="blk-html"
v-html="block.html"
></div>
<!-- 小标题 -->
<header v-else-if="block.type === 'heading'" class="blk-heading">
<h2>{{ block.text }}</h2>
<p v-if="block.sub">{{ block.sub }}</p>
</header>
<!-- 段落 -->
<p v-else-if="block.type === 'paragraph'" class="blk-paragraph">
{{ block.text }}
</p>
<!-- 引用 -->
<blockquote v-else-if="block.type === 'quote'" class="blk-quote">
<span class="blk-quote__mark" aria-hidden="true">&ldquo;</span>
<p>{{ block.text }}</p>
<cite v-if="block.author">{{ block.author }}</cite>
</blockquote>
<!-- 要点列表 -->
<ul v-else-if="block.type === 'list'" class="blk-list">
<li v-for="item in block.items" :key="item">
<AppIcon name="check" :size="15" :stroke-width="2.2" />
@@ -41,7 +36,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ul>
<!-- 能力卡片 -->
<ul v-else-if="block.type === 'features'" class="blk-features">
<li v-for="item in block.items" :key="item.title">
<span class="blk-features__icon">
@@ -52,7 +46,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ul>
<!-- 数据指标 -->
<ul v-else-if="block.type === 'stats'" class="blk-stats">
<li v-for="item in block.items" :key="item.label">
<strong>{{ item.value }}</strong>
@@ -60,7 +53,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ul>
<!-- 步骤 -->
<ol v-else-if="block.type === 'steps'" class="blk-steps">
<li v-for="(item, i) in block.items" :key="item.title">
<span class="blk-steps__index">{{ String(i + 1).padStart(2, "0") }}</span>
@@ -71,7 +63,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ol>
<!-- 发展历程 -->
<ul v-else-if="block.type === 'timeline'" class="blk-timeline">
<li v-for="item in block.items" :key="item.year">
<span class="blk-timeline__year">{{ item.year }}</span>
@@ -80,7 +71,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ul>
<!-- 联系信息 -->
<ul v-else-if="block.type === 'contact'" class="blk-contact">
<li v-for="item in block.items" :key="item.label">
<span class="blk-contact__icon">
@@ -93,7 +83,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ul>
<!-- 快捷入口 -->
<ul v-else-if="block.type === 'links'" class="blk-links">
<li v-for="item in block.items" :key="item.path + item.title">
<RouterLink :to="item.path">
@@ -109,7 +98,6 @@ defineProps<{ blocks: Block[] }>();
</li>
</ul>
<!-- 表格 -->
<div v-else-if="block.type === 'table'" class="blk-table">
<table>
<thead>
@@ -135,7 +123,6 @@ defineProps<{ blocks: Block[] }>();
gap: 30px;
}
/* ---------------- 小标题 ---------------- */
.blk-heading {
margin-top: 18px;
padding-left: 16px;
@@ -155,14 +142,12 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 段落 ---------------- */
.blk-paragraph {
font-size: 15.5px;
line-height: 2.05;
color: @ink-600;
}
/* ---------------- 引用 ---------------- */
.blk-quote {
padding: 32px 36px 30px;
border-radius: 12px;
@@ -195,7 +180,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 要点列表 ---------------- */
.blk-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -216,7 +200,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 能力卡片 ---------------- */
.blk-features {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -256,7 +239,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 数据指标 ---------------- */
.blk-stats {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
@@ -288,7 +270,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 步骤 ---------------- */
.blk-steps {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -327,7 +308,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 发展历程 ---------------- */
.blk-timeline {
display: flex;
flex-direction: column;
@@ -393,7 +373,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 联系信息 ---------------- */
.blk-contact {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -439,7 +418,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 快捷入口 ---------------- */
.blk-links {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -507,7 +485,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 表格 ---------------- */
.blk-table {
overflow-x: auto;
border: 1px solid @line;
@@ -550,7 +527,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 富文本正文 ---------------- */
.blk-html {
font-size: 15.5px;
line-height: 2.05;
@@ -694,7 +670,6 @@ defineProps<{ blocks: Block[] }>();
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 768px) {
.blocks {
gap: 24px;
-10
View File
@@ -7,7 +7,6 @@ import AppIcon from "./AppIcon.vue";
const props = withDefaults(
defineProps<{
item: ContentItem;
/** list = 横向大卡(新闻/活动);grid = 竖向卡片(产品/方案/案例) */
layout?: "list" | "grid";
}>(),
{ layout: "grid" }
@@ -17,20 +16,17 @@ const to = computed(
() => `${sections[props.item.section].detailPath}/${props.item.slug}`
);
// 后端数据自带分类名;本地 mock 走 config/sections 查表
const categoryLabel = computed(
() =>
props.item.categoryName || categoryName(props.item.section, props.item.category)
);
/** 封面上的装饰文字:取标题首字,中文视觉上很像一个字标 */
const glyph = computed(() => props.item.title.slice(0, 1));
</script>
<template>
<RouterLink :to="to" class="content-card" :class="`content-card--${layout}`">
<div class="content-card__cover" :class="`tone-${item.tone}`">
<!-- 有真实封面图时优先展示,否则用渐变 + 首字占位 -->
<img
v-if="item.image"
class="content-card__img"
@@ -99,7 +95,6 @@ const glyph = computed(() => props.item.title.slice(0, 1));
}
}
/* ---------------- 封面 ---------------- */
&__cover {
position: relative;
overflow: hidden;
@@ -151,7 +146,6 @@ const glyph = computed(() => props.item.title.slice(0, 1));
opacity 0.4s ease;
}
/* 分类标签:位于正文区日期上方,不再覆盖在封面图上 */
&__badge {
display: inline-flex;
align-items: center;
@@ -173,7 +167,6 @@ const glyph = computed(() => props.item.title.slice(0, 1));
min-width: 0;
}
/* ---------------- 正文 ---------------- */
&__body {
display: flex;
flex-direction: column;
@@ -254,7 +247,6 @@ const glyph = computed(() => props.item.title.slice(0, 1));
transition: color 0.28s ease;
}
/* ---------------- 竖向卡片 ---------------- */
&--grid {
flex-direction: column;
@@ -263,7 +255,6 @@ const glyph = computed(() => props.item.title.slice(0, 1));
}
}
/* ---------------- 横向大卡 ---------------- */
&--list {
align-items: stretch;
@@ -289,7 +280,6 @@ const glyph = computed(() => props.item.title.slice(0, 1));
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 992px) {
.content-card--list {
.content-card__cover {
-12
View File
@@ -6,7 +6,6 @@ import AppIcon from "./AppIcon.vue";
const props = defineProps<{
categories: Category[];
/** 当前分类 slug,空串表示全部 */
active: string;
counts: Record<string, number>;
total: number;
@@ -19,12 +18,10 @@ const emit = defineEmits<{
(e: "update:keyword", value: string): void;
}>();
/** 当前选中分类(可能是二级分类) */
const activeItem = computed(() =>
props.active ? findCategory(props.categories, props.active) : undefined
);
/** 当前所属的一级分类 */
const activeTop = computed(() => {
const item = activeItem.value;
if (!item) return undefined;
@@ -33,10 +30,6 @@ const activeTop = computed(() => {
: findTopCategory(props.categories, item.slug);
});
/**
* 二级分类行:首位是「全部」(选中它等于选中整个一级分类),其后是各子分类。
* 返回空数组表示当前一级分类没有子分类,此时整行隐藏。
*/
const subTabs = computed(() => {
const top = activeTop.value;
const children = top?.children ?? [];
@@ -53,11 +46,9 @@ const subTabs = computed(() => {
];
});
/** 一级分类高亮:自身被选中,或它的某个子分类被选中 */
const isTopActive = (item: Category) =>
props.active === item.slug || activeTop.value?.slug === item.slug;
/** 当前选中分类的描述 */
const activeDesc = computed(() => activeItem.value?.desc ?? "");
</script>
@@ -102,7 +93,6 @@ const activeDesc = computed(() => activeItem.value?.desc ?? "");
</label>
</div>
<!-- 二级分类:仅当当前一级分类存在子分类时出现 -->
<div v-if="subTabs.length" class="filter-bar__row filter-bar__row--sub">
<ul class="filter-bar__tabs">
<li v-for="item in subTabs" :key="item.slug">
@@ -146,7 +136,6 @@ const activeDesc = computed(() => activeItem.value?.desc ?? "");
flex-wrap: wrap;
}
/* 二级分类行:缩进 + 左侧引导线,体现层级 */
&__row--sub {
margin-left: 6px;
padding-left: 14px;
@@ -193,7 +182,6 @@ const activeDesc = computed(() => activeItem.value?.desc ?? "");
}
}
/* 二级分类:更小的胶囊 + 虚线边框,与一级分类区分层级 */
&--sub {
padding: 6px 14px;
font-size: 13px;
-1
View File
@@ -4,7 +4,6 @@ import cover from "@/assets/images/hero-cover.svg";
defineProps<{
title: string;
subtitle?: string;
/** 面包屑,不含首页 */
crumbs: string[];
}>();
</script>
-1
View File
@@ -11,7 +11,6 @@ const props = defineProps<{
const emit = defineEmits<{ (e: "change", page: number): void }>();
/** 最多显示 7 个页码,超出时用省略号 */
const pages = computed<(number | string)[]>(() => {
const { page, totalPages } = props;
if (totalPages <= 7) {
-25
View File
@@ -5,10 +5,8 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
<template>
<footer class="site-footer">
<div class="container site-footer__top">
<!-- 品牌与联系方式 -->
<div class="footer-brand">
<RouterLink to="/" class="footer-brand__logo">
<!-- 站点设置 - 浅色 Logo({yz:logow}),未配置时回退品牌文字标记 -->
<img
v-if="siteInfo.logoLight"
:src="siteInfo.logoLight"
@@ -28,7 +26,6 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
<span>地址</span>{{ siteInfo.address }}(邮编
{{ siteInfo.postalCode }})
</li>
<!-- 站点设置 - ICP 备案({yz:icp})与公安备案({yz:policeicp}) -->
<li v-if="siteInfo.icp || siteInfo.policeIcp">
<span>备案</span>
{{ siteInfo.icp }}
@@ -43,32 +40,15 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
</ul>
</div>
<!-- 链接分组 -->
<!-- <div class="footer-links">
<div
v-for="column in footerColumns"
:key="column.title"
class="footer-links__column"
>
<h3>{{ column.title }}</h3>
<ul>
<li v-for="link in column.links" :key="link.path">
<RouterLink :to="link.path">{{ link.label }}</RouterLink>
</li>
</ul>
</div>
</div> -->
</div>
<div class="site-footer__bottom">
<div class="container site-footer__bottom-inner">
<!-- 站点设置 - ICP 备案号:标签模式,{yz:icp} 由 v-yz 指令替换为站点设置中的值 -->
<p class="copyright" v-yz>{yz:icp}</p>
<div class="footer-end">
<ul class="policy-links">
<li v-for="link in policyLinks" :key="link.path">
<!-- 站点设置 - 隐私政策({yz:privacy})/ 使用条款({yz:terms}),可能为站外完整 URL -->
<a
v-if="isExternalLink(link.path)"
:href="link.path"
@@ -114,7 +94,6 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
}
}
/* ---------- 左侧品牌 ---------- */
.footer-brand {
max-width: 720px;
@@ -125,7 +104,6 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
margin-bottom: 26px;
}
/* 站点设置下发的浅色 Logo {yz:logow} */
&__logo-img {
height: 38px;
width: auto;
@@ -172,7 +150,6 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
}
}
/* ---------- 右侧链接 ---------- */
.footer-links {
display: flex;
gap: 88px;
@@ -203,7 +180,6 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
}
}
/* ---------- 底部 ---------- */
.copyright {
font-size: 12px;
letter-spacing: 0.04em;
@@ -272,7 +248,6 @@ import { isExternalLink, policyLinks, siteInfo } from "@/config/site";
}
}
/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
.footer-links {
gap: 56px;
-28
View File
@@ -2,12 +2,10 @@
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { siteInfo, utilityLinks } from "@/config/site";
// 页头主导航来自后端「官网管理 - 导航菜单」,未配置时回退 config/site.ts 的静态菜单
import { navMenus } from "@/config/nav";
const route = useRoute();
// 统一认证中心地址:登录/注册均跳转到认证中心页面
const AUTH_CENTER = "https://api.yunzer.cn";
const authLoginUrl = `${AUTH_CENTER}/auth/login`;
const authRegisterUrl = `${AUTH_CENTER}/auth/register`;
@@ -28,7 +26,6 @@ onBeforeUnmount(() => {
window.removeEventListener("scroll", onScroll);
});
// 路由变化时收起移动端菜单
watch(
() => route.fullPath,
() => {
@@ -36,7 +33,6 @@ watch(
}
);
// 点击「首页」:已在首页时属于重复导航,不会触发 router 的滚动重置,这里手动回到顶部
const onHomeClick = () => {
if (route.path === "/") {
window.scrollTo({ top: 0, behavior: "smooth" });
@@ -46,7 +42,6 @@ const onHomeClick = () => {
<template>
<header class="site-header" :class="{ 'is-stuck': stuck }">
<!-- 顶部工具条 -->
<div class="header-util">
<div class="container header-util__inner">
<p class="header-util__slogan">{{ siteInfo.slogan }}</p>
@@ -58,11 +53,9 @@ const onHomeClick = () => {
</div>
</div>
<!-- 主导航 -->
<div class="header-main">
<div class="container header-main__inner">
<RouterLink to="/" class="brand" aria-label="返回首页">
<!-- 站点设置 - 深色 Logo({yz:logo}),未配置时回退品牌文字标记 -->
<img
v-if="siteInfo.logoDark"
:src="siteInfo.logoDark"
@@ -71,15 +64,12 @@ const onHomeClick = () => {
/>
<span v-else class="brand__mark">{{ siteInfo.brandMark }}</span>
<span class="brand__text">
<!-- 站点设置 - 站点名称({yz:sitename}) -->
<strong>{{ siteInfo.brandName }}</strong>
<!-- 站点设置 - 副标题({yz:subtitle}) -->
<em>{{ siteInfo.subtitle || siteInfo.brandSub }}</em>
</span>
</RouterLink>
<nav class="main-nav">
<!-- 静态首页入口:固定在最左,不受后台「导航菜单」配置影响 -->
<div class="main-nav__item">
<RouterLink to="/" class="main-nav__link is-home" @click="onHomeClick">首页</RouterLink>
</div>
@@ -90,7 +80,6 @@ const onHomeClick = () => {
class="main-nav__item"
:class="{ 'is-parent': item.children.length > 0 }"
>
<!-- 外链菜单新窗口打开 -->
<a
v-if="item.external"
:href="item.path"
@@ -104,7 +93,6 @@ const onHomeClick = () => {
{{ item.label }}
</RouterLink>
<!-- 二级菜单:后台「目录」类型下配置的子菜单 -->
<div v-if="item.children.length" class="main-nav__sub">
<template v-for="child in item.children" :key="child.key">
<a
@@ -123,7 +111,6 @@ const onHomeClick = () => {
</div>
</nav>
<!-- 登录 / 注册:跳转统一认证中心 -->
<div class="header-auth">
<a class="auth-link auth-link--login" :href="authLoginUrl">登录</a>
<a class="auth-link auth-link--register" :href="authRegisterUrl">试用</a>
@@ -144,11 +131,9 @@ const onHomeClick = () => {
</div>
</div>
<!-- 移动端下拉菜单 -->
<transition name="drawer">
<nav v-show="menuOpen" class="mobile-nav">
<div class="container">
<!-- 静态首页入口:与主导航保持一致,固定在最前 -->
<RouterLink to="/" class="mobile-nav__link" @click="onHomeClick">首页</RouterLink>
<template v-for="item in navMenus" :key="item.key">
@@ -214,7 +199,6 @@ const onHomeClick = () => {
}
}
/* ---------- 顶部工具条 ---------- */
.header-util {
background: #f8fafd;
border-bottom: 1px solid @line;
@@ -261,7 +245,6 @@ const onHomeClick = () => {
}
}
/* ---------- 主导航 ---------- */
.header-main {
&__inner {
display: flex;
@@ -277,7 +260,6 @@ const onHomeClick = () => {
gap: 12px;
flex-shrink: 0;
/* 站点设置下发的深色 Logo {yz:logo} */
&__logo {
height: 42px;
width: auto;
@@ -359,10 +341,6 @@ const onHomeClick = () => {
}
}
/*
* 静态「首页」入口:to="/" 的 router-link-active 会命中所有子路由,
* 因此仅在精确匹配或悬停时才高亮,避免首页菜单全程处于选中态。
*/
&.is-home.router-link-active:not(.router-link-exact-active):not(:hover) {
color: @ink-800;
@@ -372,7 +350,6 @@ const onHomeClick = () => {
}
}
/* 一级菜单项容器:作为二级下拉的定位参照 */
&__item {
position: relative;
@@ -383,7 +360,6 @@ const onHomeClick = () => {
}
}
/* 二级菜单(后台「目录」菜单下的子菜单) */
&__sub {
position: absolute;
left: 50%;
@@ -416,7 +392,6 @@ const onHomeClick = () => {
}
}
/* ---------- 登录 / 注册入口 ---------- */
.header-auth {
display: flex;
align-items: center;
@@ -493,7 +468,6 @@ const onHomeClick = () => {
}
}
/* ---------- 移动端菜单 ---------- */
.mobile-nav {
display: none;
border-top: 1px solid @line;
@@ -508,7 +482,6 @@ const onHomeClick = () => {
color: @ink-800;
border-bottom: 1px solid @line;
/* 二级菜单:缩进以体现层级 */
&--sub {
padding-left: 22px;
font-size: 15px;
@@ -541,7 +514,6 @@ const onHomeClick = () => {
transform: translateY(-10px);
}
/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
.main-nav__link {
padding: 0 16px;
-24
View File
@@ -1,33 +1,16 @@
/**
* 页头导航菜单配置
*
* 数据来源:后端「官网管理 - 导航菜单」(yz_platform_website_nav),
* 由 GET /site/nav 下发(仅启用且显示中的菜单,已按 pid 组好树)。
* 接口异常或后台未配置任何菜单时,回退到 config/site.ts 里的静态 navItems,
* 保证页头导航不会为空。
*
* 菜单类型(与平台端一致):
* 1 目录 仅分组,本身可带 path;配置了子菜单时页头渲染为下拉
* 2 页面 路由地址
* 3 外链 完整 URL,新窗口打开
* 4 单页 路由地址(内容取自「单页管理」)
*/
import { ref } from "vue";
import { getJSON } from "@/api/request";
import { navItems } from "./site";
import { sections } from "./sections";
export interface NavMenuItem {
/** v-for key:后端菜单用 nav-{id},静态回退用 static-{path} */
key: string;
label: string;
path: string;
/** 是否站外链接:后台菜单类型为「外链」或 path 填写了完整 URL */
external: boolean;
children: NavMenuItem[];
}
/** /site/nav 返回的节点结构 */
interface RemoteNavNode {
id: number;
pid: number;
@@ -52,7 +35,6 @@ function toMenuItem(node: RemoteNavNode): NavMenuItem {
};
}
/** 静态回退菜单:后台未配置时使用 */
const fallbackMenus = (): NavMenuItem[] =>
navItems.map((item) => {
const menuItem: NavMenuItem = {
@@ -63,7 +45,6 @@ const fallbackMenus = (): NavMenuItem[] =>
children: [],
};
// 新闻中心:默认把「新闻中心」下的分类作为二级菜单(鼠标悬停展开)
if (item.path === "/news") {
menuItem.children = sections.news.categories.map((cat) => ({
key: `static-news-${cat.slug}`,
@@ -77,13 +58,8 @@ const fallbackMenus = (): NavMenuItem[] =>
return menuItem;
});
/** 页头导航菜单(应用启动时由 loadNavMenus 拉取,初始为静态回退) */
export const navMenus = ref<NavMenuItem[]>(fallbackMenus());
/**
* 拉取后台配置的导航菜单(应用启动时调用一次)。
* 接口异常或后台未配置时保持静态回退菜单,不置空。
*/
export async function loadNavMenus(): Promise<void> {
const data = await getJSON<{ list: RemoteNavNode[] }>("/site/nav");
const list = data?.list ?? [];
-8
View File
@@ -4,17 +4,11 @@ export interface SectionConfig {
key: SectionKey;
title: string;
subtitle: string;
/** 列表页路径 */
basePath: string;
/** 详情页路径前缀 */
detailPath: string;
/** 分类页路径前缀 */
categoryPath: string;
/** 计数单位 */
unit: string;
/** 列表布局:list = 横向大卡;grid = 竖向卡片网格 */
layout: "list" | "grid";
/** 是否提供关键字搜索 */
searchable: boolean;
categories: Category[];
}
@@ -105,13 +99,11 @@ export const sections: Record<SectionKey, SectionConfig> = {
},
};
/** 从路由路径推断栏目:/news/detail/xxx -> news */
export function sectionFromPath(path: string): SectionConfig | undefined {
const first = path.split("/").filter(Boolean)[0];
return first && first in sections ? sections[first as SectionKey] : undefined;
}
/** 查询某个分类的展示名 */
export function categoryName(
section: SectionKey,
slug: string | undefined
-44
View File
@@ -1,18 +1,3 @@
/**
* 站点级公共配置:品牌、导航、页脚
*
* 站点信息的数据来源已切换为后端「官网管理 - 站点设置」(应用启动时由 loadSiteInfo 拉取),
* 与官网模板 themes/ 中使用的标签同源,括号内为对应标签:
* sitename 站点名称 {yz:sitename}
* logoDark 深色 Logo {yz:logo}
* logoLight 浅色 Logo {yz:logow}
* icp ICP 备案号 {yz:icp}
* policeIcp 公安备案号 {yz:policeicp}
* copyright 版权信息 {yz:copyright}
* privacy 隐私政策链接 {yz:privacy}
* terms 使用条款链接 {yz:terms}
* 后端未返回的字段保留文件内默认值。
*/
import { computed, reactive } from "vue";
import { fetchSiteSetting } from "@/api/site";
@@ -39,40 +24,22 @@ export const siteInfo = reactive({
copyright:
"COPYRIGHT (C) 2026 WENXIN TECHNOLOGY CO., LTD. ALL RIGHTS RESERVED.",
// ↓↓↓ 以下字段由「官网管理 - 站点设置」下发(对应官网模板标签) ↓↓↓
/** {yz:sitename} 站点名称 */
sitename: "",
/** {yz:subtitle} 副标题 */
subtitle: "",
/** {yz:logo} 深色 Logo,用于浅色背景(页头) */
logoDark: "",
/** {yz:logow} 浅色 Logo,用于深色背景(页脚) */
logoLight: "",
/** {yz:icp} ICP 备案号 */
icp: "",
/** {yz:policeicp} 公安备案号 */
policeIcp: "",
/** {yz:privacy} 隐私政策链接 */
privacy: "",
/** {yz:terms} 使用条款链接 */
terms: "",
});
/**
* 站点设置标签值:key 就是模板标签名,与后端 {yz:xxx} 完全一致
* 供 v-yz 指令解析(<p v-yz>{yz:icp}</p>),未配置或后端未返回时输出空字符串
*/
export const siteTags = reactive<Record<string, string>>({});
/**
* 拉取站点设置并回填 siteInfo(应用启动时调用一次)。
* 接口异常时静默处理,页面继续使用默认配置。
*/
export async function loadSiteInfo(): Promise<void> {
const data = await fetchSiteSetting();
if (!data) return;
// {yz:sitename} → 页头品牌名
if (data.sitename) {
siteInfo.sitename = data.sitename;
siteInfo.brandName = data.sitename;
@@ -80,7 +47,6 @@ export async function loadSiteInfo(): Promise<void> {
if (data.subtitle) siteInfo.subtitle = data.subtitle;
if (data.logo) siteInfo.logoDark = data.logo;
if (data.logow) siteInfo.logoLight = data.logow;
// 公司信息:站点设置里有值就覆盖本地默认(页脚联系栏、页脚品牌全称),没填则保留默认
if (data.companyname) siteInfo.fullName = data.companyname;
if (data.phone) siteInfo.phone = data.phone;
if (data.email) siteInfo.email = data.email;
@@ -91,19 +57,15 @@ export async function loadSiteInfo(): Promise<void> {
if (data.privacy) siteInfo.privacy = data.privacy;
if (data.terms) siteInfo.terms = data.terms;
// 标签值:直接以接口返回的「标签名 -> 值」为准(v-yz 指令解析用)。
// 数据驱动:表里新增的设置项会自动进入 siteTags,模板里写 {yz:新tag} 即可,无需改代码。
Object.assign(siteTags, data);
}
/** 顶部工具条链接 */
export const utilityLinks: NavItem[] = [
{ label: "加入我们", path: "/careers" },
{ label: "客户支持", path: "/support" },
{ label: "合作伙伴", path: "/partners" },
];
/** 主导航 */
export const navItems: NavItem[] = [
{ label: "关于我们", path: "/about" },
{ label: "产品中心", path: "/products" },
@@ -112,7 +74,6 @@ export const navItems: NavItem[] = [
{ label: "新闻中心", path: "/news" },
];
/** 页脚链接分组 */
export const footerColumns: FooterColumn[] = [
{
title: "产品与方案",
@@ -134,16 +95,11 @@ export const footerColumns: FooterColumn[] = [
},
];
/**
* 页脚底部合规链接
* 隐私政策 {yz:privacy} / 使用条款 {yz:terms} 取自站点设置,未配置时回退站内默认页面
*/
export const policyLinks = computed<NavItem[]>(() => [
{ label: "隐私政策", path: siteInfo.privacy || "/policy/privacy" },
{ label: "使用条款", path: siteInfo.terms || "/policy/terms" },
{ label: "网站地图", path: "/policy/sitemap" },
]);
/** 是否为站外链接(站点设置里可能填完整 URL) */
export const isExternalLink = (path: string): boolean =>
/^https?:\/\//i.test(path);
-4
View File
@@ -1,9 +1,5 @@
import type { SinglePage } from "@/types/content";
/**
* 独立单页内容
* key = 去掉前导斜杠的路由路径,例如 about、support/docs、policy/privacy
*/
export const singlePages: Record<string, SinglePage> = {
about: {
title: "关于云泽",
-18
View File
@@ -1,26 +1,10 @@
/**
* {yz:xxx} 站点标签指令(dedecms 风格)
*
* 用法:在模板里直接写标签,元素加 v-yz 即可
* <p v-yz>{yz:icp}</p>
* <p v-yz>备案号:{yz:icp} | {yz:policeicp}</p>
*
* 元素内所有 {yz:标签名} 会被替换为「官网管理 - 站点设置」中对应的值,
* 未配置的标签输出空字符串(与后端 themes 模板行为一致)。
*
* 注意:指令通过 innerHTML 替换内容,因此元素内只能放纯文本/HTML 片段,
* 不要放子组件或需要响应式绑定的内容;需要条件渲染的地方请用 siteInfo.xxx。
*/
import { watchEffect, type Directive } from "vue";
import { siteTags } from "@/config/site";
/** 与后端 tagengine 的全局标签正则保持一致 */
const TAG_PATTERN = /\{yz:([a-zA-Z_]\w*)\}/g;
/** 每个元素对应的 watchEffect 停止函数 */
const stops = new WeakMap<HTMLElement, () => void>();
/** 依据当前标签值渲染元素内容;始终基于首次保存的原文,避免重复替换 */
function render(el: HTMLElement): void {
if (!el.dataset.yzRaw) {
el.dataset.yzRaw = el.innerHTML;
@@ -35,8 +19,6 @@ function render(el: HTMLElement): void {
export const yz: Directive<HTMLElement> = {
mounted(el) {
// watchEffect 会追踪 render 中读取到的标签值;
// 站点设置是异步拉取的,数据到位后会自动重新渲染
stops.set(el, watchEffect(() => render(el)));
},
unmounted(el) {
-7
View File
@@ -1,10 +1,4 @@
<script setup lang="ts">
/**
* 官网根布局:页头 + 路由出口 + 页脚
*
* SiteHeader / SiteFooter 已在 main.ts 注册为全局组件,
* 本文件(以及任意页面)直接使用标签即可,无需 import。
*/
</script>
<template>
@@ -14,7 +8,6 @@
<RouterView />
</main>
<SiteFooter />
<!-- 全站回到顶部 -->
<BackTop />
</div>
</template>
+5 -10
View File
@@ -1,11 +1,10 @@
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router"; // 配置路由
import store from "./store"; // 配置vuex
import { loadSiteInfo } from "./config/site"; // 站点设置:品牌/Logo/备案/版权/隐私政策等(与官网模板标签同源)
import { loadNavMenus } from "./config/nav"; // 页头导航菜单(后台「官网管理 - 导航菜单」)
import { yz } from "./directives/yz"; // {yz:xxx} 站点标签解析指令
// 全局组件:官网页头 / 页脚 / 回到顶部
import router from "./router";
import store from "./store";
import { loadSiteInfo } from "./config/site";
import { loadNavMenus } from "./config/nav";
import { yz } from "./directives/yz";
import SiteHeader from "./components/SiteHeader.vue";
import SiteFooter from "./components/SiteFooter.vue";
import BackTop from "./components/BackTop.vue";
@@ -13,17 +12,13 @@ import "./styles/index.less";
const app = createApp(App);
// 注册全局组件:任意页面直接写 <SiteHeader /> / <SiteFooter /> / <BackTop /> 即可,无需各自 import
app.component("SiteHeader", SiteHeader);
app.component("SiteFooter", SiteFooter);
app.component("BackTop", BackTop);
// 注册 {yz:xxx} 标签指令:模板里写 <p v-yz>{yz:icp}</p> 即可
app.directive("yz", yz);
// 站点设置先于渲染发起,接口异常时静默回退到 config/site.ts 内的默认配置
void loadSiteInfo();
// 页头导航菜单:接口异常或后台未配置时回退静态菜单
void loadNavMenus();
app.use(router).use(store).mount("#app");
+2 -24
View File
@@ -1,19 +1,10 @@
//index.ts
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
import { siteInfo } from "@/config/site"; // 站点设置(站点名称 {yz:sitename} 等)
import { siteInfo } from "@/config/site";
const DefaultLayout = () => import("../layout/DefaultLayout.vue");
const HomeView = () => import("../views/home/index.vue");
const NotFoundView = () => import("../views/not-found.vue");
/**
* 路由约定:
* - 列表页 /news、/products、/solutions、/cases、/events
* - 分类页 /news/category/:slug (其余栏目同理)
* - 详情页 /news/detail/:slug (其余栏目同理)
* - 单页 /about、/careers、/contact、/support、/support/:slug、/policy/:slug
* 列表页与详情页共用同一个组件,通过路由路径推导所属栏目。
*/
const routes: RouteRecordRaw[] = [
{
path: "/",
@@ -26,7 +17,6 @@ const routes: RouteRecordRaw[] = [
meta: { title: "官方网站" },
},
// ---------------- 新闻中心 ----------------
{
path: "news",
name: "News",
@@ -46,7 +36,6 @@ const routes: RouteRecordRaw[] = [
meta: { title: "新闻详情" },
},
// ---------------- 产品中心 ----------------
{
path: "products",
name: "Products",
@@ -66,7 +55,6 @@ const routes: RouteRecordRaw[] = [
meta: { title: "产品详情" },
},
// ---------------- 解决方案 ----------------
{
path: "solutions",
name: "Solutions",
@@ -86,7 +74,6 @@ const routes: RouteRecordRaw[] = [
meta: { title: "方案详情" },
},
// ---------------- 客户案例 ----------------
{
path: "cases",
name: "Cases",
@@ -106,7 +93,6 @@ const routes: RouteRecordRaw[] = [
meta: { title: "案例详情" },
},
// ---------------- 市场活动 ----------------
{
path: "events",
name: "Events",
@@ -126,7 +112,6 @@ const routes: RouteRecordRaw[] = [
meta: { title: "活动详情" },
},
// ---------------- 独立单页 ----------------
{
path: "about",
name: "About",
@@ -176,16 +161,10 @@ const routes: RouteRecordRaw[] = [
meta: { title: "政策条款" },
},
// ---------------- 兼容后台「导航菜单」中配置的旧路径 ----------------
// 平台端「官网管理 - 导航菜单」当前配的是 CMS 风格路径,与 SPA 实际路由不一致,
// 这里做一层重定向,保证点菜单能落到正确页面。
// 推荐把导航菜单的路径改成 /news、/products、/about(/solutions、/cases 本来就一致),
// 改完后以下 3 条即可删除。
{ path: "newscenter", redirect: "/news" },
{ path: "productcenter", redirect: "/products" },
{ path: "aboutus", redirect: "/about" },
// ---------------- 兜底 ----------------
{
path: ":pathMatch(.*)*",
name: "NotFound",
@@ -197,7 +176,7 @@ const routes: RouteRecordRaw[] = [
];
const router = createRouter({
history: createWebHashHistory(), // 哈希模式
history: createWebHashHistory(),
routes,
scrollBehavior(_to, _from, savedPosition) {
if (savedPosition) return savedPosition;
@@ -205,7 +184,6 @@ const router = createRouter({
},
});
/** 根据路由 meta 同步浏览器标题(站点名称取自站点设置 {yz:sitename}) */
router.afterEach((to) => {
const title = (to.meta.title as string | undefined) ?? "";
const siteName = siteInfo.brandName || siteInfo.sitename;
-1
View File
@@ -1,3 +1,2 @@
//actions.ts
const actions= {};
export default actions;
-1
View File
@@ -1,4 +1,3 @@
//index.ts
import { createStore } from "vuex";
import state from "./state";
import mutations from "./mutations";
-1
View File
@@ -1,3 +1,2 @@
//mutations.ts
const mutations= {};
export default mutations;
-1
View File
@@ -1,3 +1,2 @@
//state.ts
const state= {};
export default state;
-4
View File
@@ -75,7 +75,6 @@ textarea {
padding: 0 @page-gutter;
}
// 通用:横向滚动时隐藏滚动条
.no-scrollbar {
scrollbar-width: none;
-ms-overflow-style: none;
@@ -84,7 +83,6 @@ textarea {
}
}
// 通用圆形箭头按钮
.circle-btn {
display: inline-flex;
align-items: center;
@@ -114,7 +112,6 @@ textarea {
}
}
// 通用:封面配色(暂用渐变替代实拍图,后续可换成 img)
.tone-navy {
background: linear-gradient(140deg, #1b2f6e 0%, #0b1430 100%);
}
@@ -131,7 +128,6 @@ textarea {
background: linear-gradient(140deg, #5b5ee8 0%, #3a3dbf 100%);
}
// 通用:淡入上移动画
.fade-up {
animation: fadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
+7 -10
View File
@@ -1,16 +1,14 @@
// ============ 品牌色 ============
@navy-900: #0b1430; // 页脚 / 最深
@navy-800: #142352; // 主色:深蓝区块
@navy-900: #0b1430;
@navy-800: #142352;
@navy-700: #1b2f6e;
@navy-600: #24418f;
@blue-600: #2f6bf3; // 强调蓝
@blue-600: #2f6bf3;
@blue-500: #4b83ff;
@teal-600: #17a88f; // 右侧卡片
@teal-600: #17a88f;
@teal-500: #22c2a0;
@green-400: #2ec89b; // 小竖条
@green-400: #2ec89b;
@indigo-500: #4a4ddb;
// ============ 中性色 ============
@ink-900: #14161c;
@ink-800: #232733;
@ink-700: #3c4252;
@@ -22,6 +20,5 @@
@bg-soft: #f4f6fb;
@white: #ffffff;
// ============ 布局 ============
@page-width: 1680px; // 内容最大宽度
@page-gutter: 40px; // 左右安全边距
@page-width: 1680px;
@page-gutter: 40px;
-22
View File
@@ -1,24 +1,14 @@
/**
* 内容模型:列表页 / 详情页 / 单页共用
* 与后端 CMS(文章、产品、解决方案)字段保持一一对应的思路,
* 后续接入接口时只需替换 data 层的数据来源。
*/
/** 栏目标识 */
export type SectionKey = "news" | "products" | "solutions" | "cases" | "events";
/** 分类(支持父子树:顶级分类的 parent 为 "" 或 "0") */
export interface Category {
slug: string;
name: string;
desc?: string;
/** 父级分类 slug,顶级为空串 */
parent?: string;
/** 子分类,叶子节点为空数组 */
children?: Category[];
}
/** 封面配色(暂用渐变替代实拍图) */
export type CoverTone = "navy" | "blue" | "teal" | "indigo";
export interface Feature {
@@ -55,9 +45,7 @@ export interface QuickLink {
path: string;
}
/** 正文区块:详情页与单页共用同一套渲染器 */
export type Block =
/** 后端富文本正文(平台「文章管理」录入的 HTML),由 BlockRenderer 原样渲染 */
| { type: "html"; html: string }
| { type: "heading"; text: string; sub?: string }
| { type: "paragraph"; text: string }
@@ -71,13 +59,10 @@ export type Block =
| { type: "links"; items: QuickLink[] }
| { type: "table"; head: string[]; rows: string[][] };
/** 一条内容(新闻 / 产品 / 方案 / 案例 / 活动) */
export interface ContentItem {
slug: string;
section: SectionKey;
/** 分类 slug(接入后端真实数据时为分类ID的字符串形式) */
category: string;
/** 分类展示名:后端数据直接带回,本地 mock 走 config/sections 查表 */
categoryName?: string;
title: string;
subtitle: string;
@@ -87,25 +72,18 @@ export interface ContentItem {
author?: string;
tags?: string[];
featured?: boolean;
/**
* 封面图完整地址。
* 兜底链:文章封面 -> 所属分类的图片 -> 空(为空时按 tone 渲染渐变占位封面)
*/
image?: string;
blocks: Block[];
}
/** 独立单页 */
export interface SinglePage {
title: string;
subtitle: string;
/** 面包屑(不含"首页") */
crumbs: string[];
tone: CoverTone;
blocks: Block[];
}
/** 列表查询参数 */
export interface ListQuery {
section: SectionKey;
category?: string;
-1
View File
@@ -1,4 +1,3 @@
// 补充第三方库缺失的类型声明
declare module "vuex";
declare module "*.vue" {
-9
View File
@@ -1,13 +1,5 @@
/**
* 分类树查找工具
*
* 后台「官网管理 - 分类管理」的分组支持父子两级(cid 指向父级),
* 前台筛选条按「一级 / 二级」两行渲染,列表页还要根据路由里的分类 slug
* 反查分类名与描述,因此把递归查找统一收在这里,避免各处重复实现。
*/
import type { Category } from "@/types/content";
/** 递归查找分类(子分类也能命中),未找到返回 undefined */
export function findCategory(
list: Category[],
slug: string
@@ -20,7 +12,6 @@ export function findCategory(
return undefined;
}
/** 递归查找某分类所属的一级分类,找不到返回 undefined */
export function findTopCategory(
list: Category[],
slug: string
-26
View File
@@ -10,12 +10,6 @@ import ContentCard from "@/components/ContentCard.vue";
import AppIcon from "@/components/AppIcon.vue";
import { siteInfo } from "@/config/site";
/**
* 通用详情页
* 服务 /news/detail/:slug、/products/detail/:slug、/cases/detail/:slug 等,
* 正文统一交给 BlockRenderer 渲染。
*/
const route = useRoute();
const section = computed(
@@ -31,7 +25,6 @@ const item = ref<ContentItem | null>(null);
const related = ref<ContentItem[]>([]);
const loading = ref(true);
/** 分类展示名:后端数据直接带回,本地 mock 走 config/sections 查表 */
const categoryLabel = computed(() =>
item.value
? item.value.categoryName || categoryName(section.value.key, item.value.category)
@@ -44,10 +37,6 @@ const crumbs = computed(() =>
: [section.value.title]
);
/**
* 列表页路径,用于「返回列表」与面包屑跳转。
* 带分类时回到该分类的列表页。
*/
const backPath = computed(() =>
item.value
? `${section.value.categoryPath}/${item.value.category}`
@@ -65,7 +54,6 @@ async function load() {
related.value = recommend;
loading.value = false;
// 详情页标题跟随内容变化(站点名称取自站点设置 {yz:sitename})
const siteName = siteInfo.brandName || siteInfo.sitename;
document.title = detail
? `${detail.title} | ${siteName}`
@@ -77,7 +65,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
<template>
<div class="detail-page">
<!-- 详情头图 -->
<PageHero
v-if="item"
:title="item.title"
@@ -87,14 +74,12 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
<PageHero v-else :title="section.title" :crumbs="[section.title]" />
<div class="container detail-page__body">
<!-- 加载中 -->
<div v-if="loading" class="detail-skeleton">
<span></span>
<span></span>
<span></span>
</div>
<!-- 内容不存在 -->
<div v-else-if="!item" class="detail-missing">
<span class="detail-missing__icon">
<AppIcon name="file" :size="26" />
@@ -108,7 +93,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
<template v-else>
<div class="detail-page__grid">
<!-- 正文 -->
<article class="detail-article">
<RouterLink :to="backPath" class="detail-article__back">
<AppIcon name="arrow-left" :size="15" />
@@ -126,7 +110,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
</footer>
</article>
<!-- 侧栏 -->
<aside class="detail-aside">
<div class="aside-card">
<h3 class="aside-card__title">内容信息</h3>
@@ -188,7 +171,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
</aside>
</div>
<!-- 相关推荐 -->
<section v-if="related.length" class="detail-related">
<header class="detail-related__head">
<h2>相关推荐</h2>
@@ -221,14 +203,12 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
grid-template-columns: minmax(0, 1fr) 340px;
gap: 64px;
align-items: start;
/* 全站容器 1680px 偏宽,详情页正文+侧栏收敛到 1400px 居中 */
max-width: 1400px;
margin-left: auto;
margin-right: auto;
}
}
/* ---------------- 正文 ---------------- */
.detail-article {
min-width: 0;
@@ -274,7 +254,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
}
}
/* ---------------- 侧栏 ---------------- */
.detail-aside {
position: sticky;
top: 120px;
@@ -391,10 +370,8 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
}
}
/* ---------------- 相关推荐 ---------------- */
.detail-related {
margin-top: 96px;
/* 与上方正文网格同宽对齐(1400px 居中) */
max-width: 1400px;
margin-left: auto;
margin-right: auto;
@@ -432,7 +409,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
}
}
/* ---------------- 缺失状态 ---------------- */
.detail-missing {
display: flex;
flex-direction: column;
@@ -478,7 +454,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
}
}
/* ---------------- 骨架屏 ---------------- */
.detail-skeleton {
display: flex;
flex-direction: column;
@@ -515,7 +490,6 @@ watch(() => `${section.value.key}|${slug.value}`, load, { immediate: true });
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
.detail-page__grid {
grid-template-columns: minmax(0, 1fr) 300px;
-19
View File
@@ -11,12 +11,6 @@ import ContentCard from "@/components/ContentCard.vue";
import PagerBar from "@/components/PagerBar.vue";
import AppIcon from "@/components/AppIcon.vue";
/**
* 通用列表 / 分类页
* 同一组件服务 /news、/news/category/:slug、/products 等所有栏目,
* 栏目与分类通过路由路径推导,组件实例复用时也能正确响应。
*/
const route = useRoute();
const router = useRouter();
@@ -36,16 +30,10 @@ const counts = ref<Record<string, number>>({});
const total = ref(0);
const totalPages = ref(1);
const loading = ref(true);
/**
* 分类列表:已接入后端真实数据的栏目由接口返回,其余取 config/sections 静态配置。
* 初始为空,避免先闪出静态分类再被接口数据替换。
*/
const categories = ref<Category[]>([]);
/** 瀑布式列表每页 6 条,卡片网格每页 9 条 */
const pageSize = computed(() => (section.value.layout === "grid" ? 9 : 6));
/** 当前选中的分类(可能是二级分类,需递归查找) */
const activeCategoryItem = computed(() =>
activeCategory.value
? findCategory(categories.value, activeCategory.value)
@@ -94,7 +82,6 @@ async function load() {
loading.value = false;
}
/** 条件变化 => 回到第一页并重新加载 */
watch(
() => `${section.value.key}|${activeCategory.value}|${keyword.value}|${page.value}`,
load,
@@ -129,14 +116,12 @@ function handleKeywordChange(value: string) {
@update:keyword="handleKeywordChange"
/>
<!-- 加载骨架 -->
<ul v-if="loading" class="content-grid" :class="`is-${section.layout}`">
<li v-for="i in pageSize" :key="i" class="skeleton" :class="`is-${section.layout}`">
<span></span>
</li>
</ul>
<!-- 空状态 -->
<div v-else-if="empty" class="empty">
<span class="empty__icon">
<AppIcon name="search" :size="26" />
@@ -156,7 +141,6 @@ function handleKeywordChange(value: string) {
</button>
</div>
<!-- 内容列表 -->
<template v-else>
<ul class="content-grid" :class="`is-${section.layout}`">
<li v-for="item in items" :key="item.slug">
@@ -200,7 +184,6 @@ function handleKeywordChange(value: string) {
}
}
/* ---------------- 骨架屏 ---------------- */
.skeleton {
overflow: hidden;
border: 1px solid @line;
@@ -237,7 +220,6 @@ function handleKeywordChange(value: string) {
}
}
/* ---------------- 空状态 ---------------- */
.empty {
display: flex;
flex-direction: column;
@@ -286,7 +268,6 @@ function handleKeywordChange(value: string) {
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
.content-grid.is-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
-13
View File
@@ -8,19 +8,12 @@ import BlockRenderer from "@/components/BlockRenderer.vue";
import AppIcon from "@/components/AppIcon.vue";
import { siteInfo } from "@/config/site";
/**
* 通用单页
* 服务 /about、/careers、/partners、/contact、/support、/support/:slug、/policy/:slug,
* 页面 key 直接由路由路径推导(去掉前后斜杠)。
*/
const route = useRoute();
const key = computed(() => route.path.replace(/^\/+|\/+$/g, ""));
const page = ref<SinglePage | null>(null);
const loading = ref(true);
/** 政策类页面不需要底部转化入口 */
const showCta = computed(() => !key.value.startsWith("policy"));
watch(
@@ -30,7 +23,6 @@ watch(
page.value = (await fetchSinglePage(key.value)) ?? null;
loading.value = false;
// 单页标题跟随内容变化(站点名称取自站点设置 {yz:sitename})
const siteName = siteInfo.brandName || siteInfo.sitename;
document.title = page.value
? `${page.value.title} | ${siteName}`
@@ -70,7 +62,6 @@ watch(
<BlockRenderer :blocks="page.blocks" />
</div>
<!-- 底部转化入口 -->
<section v-if="showCta" class="single-cta">
<div class="single-cta__text">
<h2>还没找到想要的信息?</h2>
@@ -104,7 +95,6 @@ watch(
}
}
/* ---------------- 底部转化 ---------------- */
.single-cta {
display: flex;
align-items: center;
@@ -171,7 +161,6 @@ watch(
}
}
/* ---------------- 缺失状态 ---------------- */
.single-missing {
display: flex;
flex-direction: column;
@@ -217,7 +206,6 @@ watch(
}
}
/* ---------------- 骨架屏 ---------------- */
.single-skeleton {
display: flex;
flex-direction: column;
@@ -260,7 +248,6 @@ watch(
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 992px) {
.single-page__body {
padding-top: 48px;
@@ -12,7 +12,6 @@ import { siteInfo } from "@/config/site";
<div class="container banner__inner">
<!-- 站点设置 - 站点名称({yz:sitename}) -->
<h1 class="banner__title">{{ siteInfo.brandName }}</h1>
<p class="banner__desc">
@@ -87,7 +86,6 @@ import { siteInfo } from "@/config/site";
padding-bottom: 110px;
}
/* ---------- 面包屑 ---------- */
&__crumbs {
display: flex;
align-items: center;
@@ -113,7 +111,6 @@ import { siteInfo } from "@/config/site";
}
}
/* ---------- 主标题 ---------- */
&__title {
font-size: 74px;
font-weight: 900;
@@ -139,7 +136,6 @@ import { siteInfo } from "@/config/site";
background: rgba(255, 255, 255, 0.38);
}
/* ---------- 数据条 ---------- */
&__meta {
display: flex;
align-items: stretch;
@@ -222,7 +218,6 @@ import { siteInfo } from "@/config/site";
}
}
/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
.banner {
&__title {
@@ -101,7 +101,6 @@ const step = (delta: number) => {
>
<div v-for="(group, index) in slides" :key="index" class="news__slide">
<template v-for="(card, i) in group" :key="`${index}-${i}`">
<!-- 社交动态卡片 -->
<article v-if="card.type === 'media'" class="news-card news-card--media">
<img :src="card.image" :alt="card.caption" />
<span class="news-card__veil"></span>
@@ -112,7 +111,6 @@ const step = (delta: number) => {
<p class="news-card__caption">{{ card.caption }}</p>
</article>
<!-- 图文引用卡片 -->
<article
v-else-if="card.type === 'article'"
class="news-card news-card--article"
@@ -128,7 +126,6 @@ const step = (delta: number) => {
</div>
</article>
<!-- 引言卡片 -->
<article v-else class="news-card news-card--quote">
<span class="news-card__mark">&ldquo;</span>
<p class="news-card__text">{{ card.text }}</p>
@@ -149,7 +146,6 @@ const step = (delta: number) => {
</div>
</div>
<!-- 轮播控制行:任何宽度下都不会被裁切 -->
<div class="container news__controls">
<button
class="news__nav"
@@ -211,7 +207,6 @@ const step = (delta: number) => {
min-width: 0;
}
/* 控制行:上一组 / 指示点 / 下一组,居中排列,不依赖容器外空间 */
&__controls {
display: flex;
align-items: center;
@@ -261,7 +256,6 @@ const step = (delta: number) => {
}
}
/* ---------------- 卡片通用 ---------------- */
.news-card {
position: relative;
display: flex;
@@ -301,7 +295,6 @@ const step = (delta: number) => {
letter-spacing: 0.02em;
}
/* ---------- 社交动态 ---------- */
&--media {
justify-content: space-between;
background: @navy-900;
@@ -357,7 +350,6 @@ const step = (delta: number) => {
color: @white;
}
/* ---------- 图文引用 ---------- */
&--article {
background: @white;
border: 1px solid @line;
@@ -394,7 +386,6 @@ const step = (delta: number) => {
}
}
/* ---------- 引言卡片 ---------- */
&--quote {
background: linear-gradient(160deg, @teal-500 0%, @teal-600 100%);
color: @white;
@@ -432,7 +423,6 @@ const step = (delta: number) => {
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
.news {
padding: 84px 0 80px;
@@ -452,7 +442,6 @@ const step = (delta: number) => {
}
}
/* 两列:隐藏最后一张,避免第二行只留孤卡 */
@media (max-width: 992px) {
.news {
padding: 72px 0 68px;
@@ -468,7 +457,6 @@ const step = (delta: number) => {
}
}
/* 单列:卡片高度交给内容决定,不再写死 min-height */
@media (max-width: 640px) {
.news {
padding: 56px 0 60px;
@@ -4,26 +4,13 @@ import type { ContentItem } from "@/types/content";
import { categoryName } from "@/config/sections";
import { fetchList, fetchNotices, type NoticeItem } from "@/api/content";
/**
* 首页取新闻中心最新若干条,
* 卡片文案与详情页共用同一数据源,点击标题/卡片可直接进入详情。
*/
const notices = ref<ContentItem[]>([]);
/** 新闻卡片池:无弹窗公告时新闻中心整行显示,每页多展示一张 */
const NOTICE_POOL = 6;
/**
* 站点公告(弹窗公告区)。
* 后端只回「已发布 + 处于有效期内」的弹窗公告,列表为空即代表无公告或
* 公告已过期,页面据此隐藏该区域、让新闻中心整行显示。
*/
const popups = ref<NoticeItem[]>([]);
const POPUP_LIMIT = 3;
/* ---------------- 公告轮播 ---------------- */
/** 是否存在可展示的弹窗公告,决定本区块的整体布局 */
const hasPopup = computed(() => popups.value.length > 0);
/** 每页卡片数:整行显示时放宽到 3 张,避免两张被拉得过宽 */
const pageSize = computed(() => (hasPopup.value ? 2 : 3));
const page = ref(0);
const progress = ref(0);
@@ -75,7 +62,6 @@ const togglePlay = () => {
}
};
/* ---------------- 弹窗公告轮播 ---------------- */
const popupIndex = ref(0);
const currentPopup = computed<NoticeItem | null>(
() => popups.value[popupIndex.value] ?? popups.value[0] ?? null
@@ -87,7 +73,6 @@ const stepPopup = (delta: number) => {
};
onMounted(async () => {
// 新闻与公告并行拉取;公告为空时只隐藏弹窗区,不影响新闻中心
const [result, noticeList] = await Promise.all([
fetchList({
section: "news",
@@ -106,9 +91,7 @@ onBeforeUnmount(stopTimer);
<template>
<section class="notice" :class="{ 'notice--nopopup': !hasPopup }">
<!-- 无弹窗公告(未配置 / 已过期 / 已下线)时整行显示新闻中心 -->
<div class="container notice__grid" :class="{ 'is-single': !hasPopup }">
<!-- 通知公告 -->
<div class="notice__main">
<header class="notice__head">
<h2>新闻中心</h2>
@@ -205,7 +188,6 @@ onBeforeUnmount(stopTimer);
</div>
</div>
<!-- 弹窗公告 -->
<aside v-if="currentPopup" class="popup">
<header class="popup__head">
<h2>弹窗公告</h2>
@@ -254,7 +236,6 @@ onBeforeUnmount(stopTimer);
<em>{{ currentPopup.date || "-" }}</em>
</li>
</ul>
<!-- 公告配置了跳转地址才给出入口,避免指向不存在的页面 -->
<div v-if="currentPopup.linkUrl" class="popup__action">
<a
v-if="currentPopup.external"
@@ -281,7 +262,6 @@ onBeforeUnmount(stopTimer);
padding: 74px 0 96px;
height: 650px;
/* 无弹窗公告时按内容自适应高度(固定 650px 是为右侧弹窗卡片预留的) */
&--nopopup {
height: auto;
}
@@ -291,7 +271,6 @@ onBeforeUnmount(stopTimer);
grid-template-columns: minmax(0, 1fr) 470px;
gap: 70px;
/* 无弹窗公告:新闻中心整行显示 */
&.is-single {
grid-template-columns: minmax(0, 1fr);
}
@@ -346,7 +325,6 @@ onBeforeUnmount(stopTimer);
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 24px;
/* 整行显示时放宽到三列,避免两张卡被拉得过宽 */
&.is-wide {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@@ -409,7 +387,6 @@ onBeforeUnmount(stopTimer);
}
}
/* ---------------- 公告卡片 ---------------- */
.notice-card {
display: flex;
flex-direction: column;
@@ -425,7 +402,6 @@ onBeforeUnmount(stopTimer);
transform: translateY(-6px);
box-shadow: 0 26px 56px rgba(4, 10, 30, 0.36);
/* 整卡可点,标题给出明确的点击反馈 */
.notice-card__title {
color: @blue-600;
text-decoration: underline;
@@ -479,7 +455,6 @@ onBeforeUnmount(stopTimer);
}
}
/* ---------------- 弹窗公告 ---------------- */
.popup {
display: flex;
flex-direction: column;
@@ -554,7 +529,6 @@ onBeforeUnmount(stopTimer);
}
}
/* 公告摘要:超过三行截断,避免卡片高度失控 */
&__summary {
margin-bottom: 20px;
font-size: 13.5px;
@@ -566,7 +540,6 @@ onBeforeUnmount(stopTimer);
overflow: hidden;
}
/* 仅在公告配置了跳转地址时出现 */
&__action {
margin-top: 22px;
@@ -642,7 +615,6 @@ onBeforeUnmount(stopTimer);
transform: translateY(-10px);
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
.notice {
padding: 60px 0 76px;
@@ -652,7 +624,6 @@ onBeforeUnmount(stopTimer);
gap: 44px;
}
/* is-single 特异性更高,需在此断点同样覆盖,否则中屏会退回两列 */
&__grid.is-single {
grid-template-columns: minmax(0, 1fr);
}
@@ -194,7 +194,6 @@ const services = [
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 1300px) {
.quick {
&__inner {
@@ -12,7 +12,6 @@ interface UpgradeItem {
const upgradeList = ref<UpgradeItem[]>([]);
const loading = ref(false);
// 获取平台更新内容列表
const fetchUpgradeList = async () => {
loading.value = true;
try {
@@ -37,7 +36,6 @@ onMounted(() => {
<template>
<section class="schedule">
<div class="container schedule__inner">
<!-- 平台更新时间轴 -->
<div class="schedule__panel">
<div class="schedule__head">
<h2>近期平台更新内容</h2>
@@ -53,7 +51,6 @@ onMounted(() => {
>
<h3 class="timeline__date">{{ item.update_date }}</h3>
<!-- 节点轨道:横线由 CSS 绘制,节点天然居中 -->
<span class="timeline__rail" aria-hidden="true">
<i class="timeline__node"></i>
<i class="timeline__axis"></i>
@@ -72,20 +69,6 @@ onMounted(() => {
</div>
</div>
<!-- 管理入口 -->
<!-- <RouterLink to="/platform/softwareupgrade" class="schedule-card">
<span class="schedule-card__icon">
<AppIcon name="update" :size="28" :stroke-width="1.5" />
</span>
<div class="schedule-card__text">
<strong>更新管理</strong>
<em>查看和管理平台更新记录</em>
</div>
<span class="schedule-card__more">
进入管理后台
<AppIcon name="arrow-right" :size="16" />
</span>
</RouterLink> -->
</div>
</section>
</template>
@@ -118,7 +101,6 @@ onMounted(() => {
&__inner {
position: relative;
display: grid;
/* grid-template-columns: minmax(0, 1fr) 360px; */
gap: 26px;
align-items: stretch;
}
@@ -155,7 +137,6 @@ onMounted(() => {
}
}
/* ---------------- 时间轴 ---------------- */
.timeline {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
@@ -176,7 +157,6 @@ onMounted(() => {
white-space: nowrap;
}
/* 节点轨道:自身即 flex 容器,节点与横线必然在同一中线 */
&__rail {
display: flex;
align-items: center;
@@ -195,7 +175,6 @@ onMounted(() => {
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
/* 把横线延伸进列间距,让三个节点真正连成一条轴 */
&__axis {
flex: 1;
height: 1px;
@@ -278,7 +257,6 @@ onMounted(() => {
}
}
/* ---------------- 活动入口卡 ---------------- */
.schedule-card {
position: relative;
display: flex;
@@ -366,7 +344,6 @@ onMounted(() => {
}
}
/* ---------------- 响应式 ---------------- */
@media (max-width: 1200px) {
.schedule {
padding: 74px 0 82px;
@@ -445,7 +422,6 @@ onMounted(() => {
}
}
/* 移动端改为左侧竖向节点 */
&__rail {
position: absolute;
left: 0;