- 构建日志({logs.length} 行)
-
- ),
+ label: 构建日志({logs.length} 行),
children: (
-
+
{logs.map((log, index) => (
-
- {formatLogTime(log.at)}
-
+ {formatLogTime(log.at)}
{" "}
{log.message}
diff --git a/apps/admin/src/features/publication/PublicationPage.tsx b/apps/admin/src/features/publication/PublicationPage.tsx
index 2da4e36..0dfbf98 100644
--- a/apps/admin/src/features/publication/PublicationPage.tsx
+++ b/apps/admin/src/features/publication/PublicationPage.tsx
@@ -4,7 +4,6 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import {
Alert,
Button,
- Card,
Divider,
Empty,
Input,
@@ -13,7 +12,6 @@ import {
Select,
Space,
Spin,
- Tag,
Tabs,
Typography,
message,
@@ -21,7 +19,9 @@ import {
import type { BrandTemplateKey } from "@personal-brand/api-client";
import { createApiClient } from "../../lib/api.js";
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
-import { MutationError, QueryState } from "../../components/QueryState.js";
+import { AdminSection } from "../../components/AdminSection.js";
+import { ErrorNote, MutationError, QueryState } from "../../components/QueryState.js";
+import { StatusTag, statusLabel } from "../../components/StatusTag.js";
import { MiniAppReleaseCard } from "./MiniAppReleaseCard.js";
const client = createApiClient();
@@ -268,17 +268,16 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool
const contentTab = null;
const miniAppSettingsTab = (
-
-
-
- AppID 用于服务端调用微信官方上传工具;上传私钥保存前会使用 AES-256-GCM
- 加密。小程序产物目录由系统构建流程决定,不需要手动修改。
-
+
+
{miniAppSettings.data?.buildError ? (
@@ -286,7 +285,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool
@@ -337,7 +336,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool
autoComplete="off"
spellCheck={false}
placeholder={"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"}
- style={{ fontFamily: "monospace", fontSize: 12 }}
+ className="admin-code-input"
/>
@@ -345,15 +344,15 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool
保存上传配置
{miniAppSettings.data?.hasStoredCredentials ? (
- 已加密保存上传凭据
+
) : (
- 未配置上传私钥
+
)}
-
-
+
+
);
return (
@@ -380,13 +379,15 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool
]}
/>
{activeTab === "content" && (
-
-
- 1. 选择表达方式
+
+
- )}
- {activeTab === "content" && (
-
-
- 3. 检查并发布
-
-
- {currentRelease ? `已发布 v${currentRelease.version}` : "尚未发布"}
-
-
+
+
+
+ -
+
+
+ {brand.data?.name || "未命名品牌"}
+
+ {brand.data?.tagline || "尚未填写品牌定位"}
+
+
+
+
+ -
+
+
+ 已启用业务项
+
+ {draftOfferings.map((item) => item.name).join("、") || "无"}
+
+
+
+
+ -
+
+
+ 已启用咨询表单
+
+ {draftForms
+ .filter((item) => item.isEnabled)
+ .map((item) => item.name)
+ .join("、") || "无"}
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+ }
+ >
+
{(readiness.data?.checks ?? []).map((check) => (
-
-
- {check.passed ? "已完成" : "待完善"}
-
- {check.label}
- {check.help ? (
- {check.help}
- ) : null}
- {!check.passed && (
+ -
+
+
+
+ {check.label}
+ {check.help ? {check.help} : null}
+
+
+ {!check.passed ? (
- )}
-
+ ) : null}
+
))}
-
-
+
+
+
+
)}
{activeTab === "miniapp" && (
-
-
- 小程序代码发布
-
- 使用微信官方 miniprogram-ci 上传代码;审核与发布状态需按微信平台结果人工确认。
-
-
- uploadLatestMiniAppRelease.mutate()}
- >
- 上传当前版本到微信
-
- {miniAppSettings.data?.hasStoredCredentials ? (
- 已配置上传凭据
- ) : (
- 未配置上传凭据
- )}
-
-
+
+
+ uploadLatestMiniAppRelease.mutate()}
+ >
+ 上传当前版本到微信
+
+ {miniAppSettings.data?.hasStoredCredentials ? (
+
+ ) : (
+
+ )}
+
+ }
+ >
{miniAppReleases.data?.length ? (
-
+
{miniAppReleases.data.map((task) => (
updateMiniAppStatus.mutate({ id: task.id, status })}
/>
))}
-
+
) : (
-
+
)}
-
-
+
+
)}
) : (
-
+
当前草稿将成为品牌新的公开版本。
-
+
)}
{offeringKindLabels[String(value)] ?? String(value)},
+ render: (value: unknown) => (
+
+ ),
},
{ title: "价格", dataIndex: "priceText" },
{
title: "状态",
dataIndex: "isEnabled",
- render: (value: boolean) => (value ? "已启用" : "已停用"),
+ render: (value: boolean) => (
+
+ ),
},
{
title: "操作",
render: (_: unknown, item: Offering) => (
- onEdit(item)}>
+ onEdit(item)}>
编辑详情
toggleOffering.mutate({ id: item.id, isEnabled: !item.isEnabled })}
@@ -66,6 +73,7 @@ export function OfferingsTable({
cancelText="取消"
>
-
-
- {pageLabel}中的内容
-
- 已启用的项目会公开展示
-
- {detailSectionTitles.length ? (
-
- 编辑单项详情时,附加字段将用于:
- {detailSectionTitles.join("、")}
- 。列表中的名称、说明、价格和封面也会显示在业务展示页。
-
- ) : null}
+
{items.length === 0 && (
-
+
还没有公开业务提供项。创建后,小程序服务页会优先读取这些内容。
-
+
)}
-
+
);
}
diff --git a/apps/admin/src/features/services/ServicesPage.css b/apps/admin/src/features/services/ServicesPage.css
index 04be16c..395b5b6 100644
--- a/apps/admin/src/features/services/ServicesPage.css
+++ b/apps/admin/src/features/services/ServicesPage.css
@@ -11,7 +11,7 @@
display: flex;
flex-direction: column;
height: 72vh;
- border: 1px solid #e5e7eb;
+ border: 1px solid var(--admin-border);
border-radius: 12px;
overflow: hidden;
}
@@ -47,8 +47,8 @@
overflow-y: auto;
padding: 20px 16px 24px;
border-radius: 12px;
- background: #f8fafc;
- border: 1px solid #e5e7eb;
+ background: var(--admin-fill);
+ border: 1px solid var(--admin-border);
}
.service-offering-editor__form-scroll > .ant-typography:first-child {
@@ -62,7 +62,7 @@
.service-offering-editor__form-scroll .ant-typography h5.ant-typography {
margin: 28px 0 4px;
padding-bottom: 8px;
- border-bottom: 1px solid #e5e7eb;
+ border-bottom: 1px solid var(--admin-border);
}
.service-offering-editor__form-scroll > .ant-typography-secondary {
diff --git a/apps/admin/src/features/team/MembersPage.tsx b/apps/admin/src/features/team/MembersPage.tsx
index 8834399..81ea56e 100644
--- a/apps/admin/src/features/team/MembersPage.tsx
+++ b/apps/admin/src/features/team/MembersPage.tsx
@@ -1,23 +1,11 @@
-import {
- Alert,
- Button,
- Card,
- Form,
- Input,
- Modal,
- Select,
- Space,
- Table,
- Tag,
- Typography,
- message,
-} from "antd";
+import { Alert, Button, Card, Form, Input, Modal, Select, Space, Table, message } from "antd";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import type { AdminBrandMember } from "@personal-brand/api-client";
import { useState } from "react";
import { createApiClient } from "../../lib/api.js";
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
import { MutationError, QueryState } from "../../components/QueryState.js";
+import { StatusTag } from "../../components/StatusTag.js";
const roleLabels: Record = {
owner: "负责人",
@@ -81,9 +69,9 @@ export function MembersPage() {
(
- {roleLabels[item.role] ?? item.role}
+
{!item.adminUser.isEnabled ? (
- 账号已停用
+
) : null}
),
diff --git a/apps/admin/src/features/trust-content/TrustContentPage.tsx b/apps/admin/src/features/trust-content/TrustContentPage.tsx
index b6b8b7c..fa4c05a 100644
--- a/apps/admin/src/features/trust-content/TrustContentPage.tsx
+++ b/apps/admin/src/features/trust-content/TrustContentPage.tsx
@@ -1,5 +1,6 @@
-import { Button, Divider, Form, Typography } from "antd";
+import { Button, Form } from "antd";
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
+import { AdminSection } from "../../components/AdminSection.js";
import { QueryState } from "../../components/QueryState.js";
import { TrustContentEditorModal } from "./components/TrustContentEditorModal.js";
import { TrustContentTable } from "./components/TrustContentTable.js";
@@ -61,29 +62,27 @@ export function TrustContentPage() {
}
/>
-
-
- 当前模板需要配置的内容
-
-
- 标记为“发布必填”的项目需要填写完整后,才能发布小程序。
-
+
-
-
- begin(item)}
- onDelete={(id) => remove.mutate(id)}
- />
+
+
+ begin(item)}
+ onDelete={(id) => remove.mutate(id)}
+ />
+
(
- {availableTypes.find((item) => item.type === value)?.label ?? value}
+ item.type === value)?.label ?? String(value)}
+ />
),
},
{ title: "标题", dataIndex: "title" },
@@ -47,14 +51,17 @@ export function TrustContentTable({
title: "发布状态",
dataIndex: "isPublished",
render: (value) => (
- {value ? "随发布展示" : "草稿"}
+
),
},
{
title: "操作",
render: (_: unknown, item: TrustContent) => (
- onEdit(item)}>
+ onEdit(item)}>
编辑
onDelete(item.id)}
>
-
+
删除
diff --git a/apps/admin/src/features/trust-content/components/TrustRequirementsList.tsx b/apps/admin/src/features/trust-content/components/TrustRequirementsList.tsx
index 1382fe3..b0310c9 100644
--- a/apps/admin/src/features/trust-content/components/TrustRequirementsList.tsx
+++ b/apps/admin/src/features/trust-content/components/TrustRequirementsList.tsx
@@ -1,7 +1,8 @@
-import { Button, List, Space, Tag, Typography } from "antd";
+import { Button } from "antd";
import { isTrustContentComplete } from "@personal-brand/api-client";
import type { TrustContent } from "@personal-brand/api-client";
import type { TrustTypeOption } from "../domain/trust-content-domain.js";
+import { StatusTag } from "../../../components/StatusTag.js";
export function TrustRequirementsList({
availableTypes,
@@ -15,10 +16,8 @@ export function TrustRequirementsList({
onEdit: (item?: TrustContent, type?: string) => void;
}) {
return (
- {
+
+ {availableTypes.map((item) => {
const content = contentByType.get(item.type);
const publishedCount = items.filter(
(record) => record.type === item.type && record.isPublished,
@@ -28,38 +27,41 @@ export function TrustRequirementsList({
const complete = Boolean(content && isTrustContentComplete(content, item) && !tooMany);
return (
- (content ? onEdit(content) : onEdit(undefined, item.type))}
- >
- {content ? "编辑" : "新增"}
-
,
- ]}
- >
-
- {item.label}
- {item.required && 发布必填}
- {(item.pages ?? []).map((page) => (
- {page}
- ))}
-
- {tooMany
- ? `公开内容过多(${publishedCount} 条)`
- : complete
- ? "内容完整"
- : content
- ? "需要完善"
- : "尚未填写"}
-
- {item.help && {item.help}}
-
-
+
+
+
+ {item.label}
+ {item.required ? : null}
+
+ {(item.pages ?? []).map((page) => (
+
+ {page}
+
+ ))}
+
+ {item.help ?
{item.help}
: null}
+
+ (content ? onEdit(content) : onEdit(undefined, item.type))}
+ >
+ {content ? "编辑" : "新增"}
+
+
);
- }}
- />
+ })}
+
);
}
diff --git a/apps/admin/src/features/workspace/WorkspacePage.tsx b/apps/admin/src/features/workspace/WorkspacePage.tsx
index 2bea671..f174776 100644
--- a/apps/admin/src/features/workspace/WorkspacePage.tsx
+++ b/apps/admin/src/features/workspace/WorkspacePage.tsx
@@ -1,4 +1,4 @@
-import { Button, Card, Form, Input, Modal, Select, Space, Table, Tag, Typography } from "antd";
+import { Button, Card, Form, Input, Modal, Select, Space, Table, Typography } from "antd";
import { useNavigate } from "react-router-dom";
import { ApiClientError } from "@personal-brand/api-client";
import { createApiClient } from "../../lib/api.js";
@@ -18,6 +18,7 @@ import {
import { supportsIndustry, type IndustryTarget } from "./workspace-templates.js";
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
import { MutationError } from "../../components/QueryState.js";
+import { StatusTag } from "../../components/StatusTag.js";
export const inquiryFieldTypes = [
{ value: "text", label: "简短文字" },
@@ -146,12 +147,12 @@ export function WorkspacePage() {
}
const { fields, installations } = query.data;
return (
-
+
-
+
下面这些入口面向日常经营,不需要理解模板或技术设置。完成后回到“配置与发布”统一检查并上线。
@@ -166,38 +167,45 @@ export function WorkspacePage() {
{runtimeQuery.isError ? (
- 公开运行时工作空间暂时无法加载。
+
) : (
-
+
- 小程序数据已同步
- 公开业务 {runtimeQuery.data?.offerings?.length ?? 0} 项
- 已启用能力 {runtimeQuery.data?.capabilities?.length ?? 0} 项
+
+
+
-
+
小程序和后台预览会使用同一份已发布内容。这里的能力由当前模板自动提供,通常不需要手动调整。
-
-
- 已启用的服务能力
+
+
+
已启用的服务能力
{(runtimeQuery.data?.plugins ?? []).map((plugin) => (
-
- {plugin.displayName}
-
- {plugin.status}
-
-
-
+
+ {plugin.displayName}
+
+
+
这项能力已接入当前小程序流程,无需单独配置技术参数。
-
+
))}
{!runtimeQuery.data?.plugins?.length && (
-
当前模板未启用能力插件。
+
当前模板未启用能力插件。
)}
-
+
- 视觉模板
+ 视觉模板
{runtimeQuery.data?.visualTemplate && (
-
- v{runtimeQuery.data.visualTemplate.version} ·{" "}
- {Object.values(runtimeQuery.data.visualTemplate.variants).join(" / ")}
-
+
)}
-
- 视觉模板切换历史
+
+
视觉模板切换历史
{visualHistory.data?.history.length ? (
- visualHistory.data.history.map((item) => (
-
- {item.visualTemplateKey} · {item.savedAt}
-
- ))
+
+ {visualHistory.data.history.map((item) => (
+
+ ))}
+
) : (
-
暂无历史版本
+
暂无历史版本
)}
{visualHistory.data?.history.length ? (
rollbackVisual.mutate()}
loading={rollbackVisual.isPending}
>
@@ -236,33 +249,33 @@ export function WorkspacePage() {
) : null}
-
-
- 可用视觉模板
+
+
+
可用视觉模板
{compatibleVisuals.map((visual) => (
-
- {visual.name}
-
- {visual.description}
-
-
+
+ {visual.name}
+ {visual.description}
+
{Object.entries(visual.theme.colors).map(([name, color]) => (
-
+
{name}
-
+
))}
-
-
+
+
{Object.values(visual.variants).join(" / ")}
-
+
))}
-
+
-
+
)}
模板只提供行业表达样例,不会替代你的品牌定位、经历、作品和合作方式。
- {installations.length ? `已安装 ${installations.length} 个模板` : "尚未安装模板"}
+
{installations.length > 0 && (
-
-
+
+
当前版本:{templatePreview.data?.currentVersion ?? "加载中"},最新版本:
{templatePreview.data?.latestVersion ?? "加载中"}
{templatePreview.data?.canUpgrade ? (
<>
-
+
可升级内容:新增 {templatePreview.data.missingModules.length} 个模块,新增{" "}
{templatePreview.data.missingFields.length} 个字段。已有内容不会被覆盖。
@@ -326,7 +342,9 @@ export function WorkspacePage() {
>
) : (
- 已是最新版本
+
+
+
)}
{templatePreview.data?.canRollback && (
rollback.mutate()} loading={rollback.isPending}>
@@ -336,7 +354,7 @@ export function WorkspacePage() {
-
+
)}
@@ -360,7 +378,6 @@ export function WorkspacePage() {
高级预览}
>
@@ -384,19 +401,18 @@ export function WorkspacePage() {
/>
{combinationPreview.isLoading ? (
-
+
) : combinationPreview.data ? (
-
+
{combinationPreview.data.industry.name} × {combinationPreview.data.visual.name}
-
能力:
{combinationPreview.data.runtime.capabilities.map((item) => item.key).join("、") ||
"无"}
-
+
) : null}
v{value} },
+ {
+ title: "版本",
+ dataIndex: "version",
+ render: (value) => ,
+ },
{
title: "字段数",
dataIndex: "fieldsSnapshot",
render: (value: unknown[]) => value?.length ?? 0,
},
- { title: "状态", dataIndex: "isEnabled", render: (value) => (value ? "启用" : "停用") },
+ {
+ title: "状态",
+ dataIndex: "isEnabled",
+ render: (value: boolean) => (
+
+ ),
+ },
{
title: "操作",
render: (_: unknown, item: InquiryForm) => (
{
setEditingForm(item);
@@ -637,7 +664,7 @@ export function WorkspacePage() {
>
-
+
({
value: item.id,
@@ -664,7 +691,7 @@ export function WorkspacePage() {
}))}
/>
-
+
{(fields, { add, remove }) => (
<>
@@ -685,36 +712,36 @@ export function WorkspacePage() {
{fields.map(({ key, name, ...restField }) => (
-
+
-
+
-
+
- remove(name)} style={{ marginTop: 30 }}>
+ remove(name)} className="admin-field-offset">
删除
-
+
{({ getFieldValue }) =>
["select", "radio", "multi-select"].includes(
@@ -735,32 +762,28 @@ export function WorkspacePage() {
{(optionFields, { add, remove }, { errors }) => (
<>
{optionFields.map((optionField) => (
-
+
remove(optionField.name)}
- style={{ marginBottom: 8 }}
+ className="admin-offset-bottom-xs"
>
删除
-
+
))}
add({ label: "", value: "" })}
- style={{ marginBottom: 8 }}
+ className="admin-offset-bottom-xs"
>
新增选项
@@ -778,6 +801,6 @@ export function WorkspacePage() {
-
+
);
}
diff --git a/apps/admin/src/lib/theme.ts b/apps/admin/src/lib/theme.ts
new file mode 100644
index 0000000..b0fe1d0
--- /dev/null
+++ b/apps/admin/src/lib/theme.ts
@@ -0,0 +1,83 @@
+import { ConfigProvider } from "antd";
+import type { ThemeConfig } from "antd";
+
+export const adminTheme: ThemeConfig = {
+ token: {
+ colorPrimary: "#2563EB",
+ colorLink: "#2563EB",
+ colorText: "#1C1F23",
+ colorTextSecondary: "#6B7280",
+ colorTextTertiary: "#9AA1AC",
+ colorTextQuaternary: "#C3C7CF",
+ colorBgLayout: "#F7F8FA",
+ colorBgContainer: "#FFFFFF",
+ colorBorder: "#D8DBE0",
+ colorBorderSecondary: "#E7E9EC",
+ colorSplit: "#F0F1F3",
+ colorFillTertiary: "#F7F8FA",
+ colorFillQuaternary: "#FAFAFB",
+ borderRadius: 6,
+ borderRadiusLG: 10,
+ borderRadiusSM: 4,
+ fontSize: 14,
+ fontFamily:
+ "Inter, 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
+ controlHeight: 32,
+ controlHeightLG: 40,
+ boxShadow: "0 1px 2px rgba(16, 24, 40, 0.04)",
+ boxShadowSecondary: "0 8px 24px rgba(16, 24, 40, 0.08)",
+ wireframe: false,
+ },
+ components: {
+ Layout: {
+ headerHeight: 56,
+ headerBg: "#FFFFFF",
+ headerPadding: "0 24px",
+ siderBg: "#FFFFFF",
+ bodyBg: "#F7F8FA",
+ triggerBg: "#FFFFFF",
+ triggerColor: "#475467",
+ triggerHeight: 40,
+ },
+ Menu: {
+ itemHeight: 36,
+ itemBorderRadius: 6,
+ itemBg: "transparent",
+ itemColor: "#475467",
+ itemHoverBg: "#F7F8FA",
+ itemHoverColor: "#1C1F23",
+ itemSelectedBg: "#EFF4FF",
+ itemSelectedColor: "#2563EB",
+ itemMarginInline: 8,
+ itemMarginBlock: 2,
+ groupTitleColor: "#9AA1AC",
+ groupTitleFontSize: 12,
+ collapsedWidth: 0,
+ subMenuItemBg: "transparent",
+ },
+ Card: {
+ paddingLG: 20,
+ headerFontSize: 16,
+ headerHeight: 52,
+ headerHeightSM: 44,
+ },
+ Table: {
+ headerBg: "#FAFAFB",
+ headerColor: "#6B7280",
+ rowHoverBg: "#FAFAFB",
+ headerSplitColor: "transparent",
+ borderColor: "#F0F1F3",
+ cellPaddingBlock: 16,
+ headerBorderRadius: 8,
+ },
+ Button: { fontWeight: 500, primaryShadow: "none", defaultShadow: "none" },
+ Progress: { defaultColor: "#2563EB", remainingColor: "#F0F1F3", lineBorderRadius: 3 },
+ Tag: { defaultBg: "#F2F4F7", defaultColor: "#475467", borderRadiusSM: 6 },
+ Tabs: { inkBarColor: "#2563EB", itemSelectedColor: "#1C1F23", itemColor: "#6B7280" },
+ Form: { labelColor: "#475467", labelFontSize: 13, verticalLabelPadding: "0 0 6px" },
+ Modal: { borderRadiusLG: 12 },
+ Statistic: { titleFontSize: 12, contentFontSize: 28 },
+ },
+};
+
+ConfigProvider.config({ theme: adminTheme });
diff --git a/apps/admin/src/main.tsx b/apps/admin/src/main.tsx
index a751fc8..9b6139a 100644
--- a/apps/admin/src/main.tsx
+++ b/apps/admin/src/main.tsx
@@ -6,17 +6,31 @@ import {
App,
Button,
Card,
+ ConfigProvider,
Form,
Input,
Layout,
Menu,
Select,
- Space,
- Tag,
- Typography,
message,
} from "antd";
+import zhCN from "antd/locale/zh_CN";
+import {
+ AppstoreOutlined,
+ BarsOutlined,
+ CloudUploadOutlined,
+ MessageOutlined,
+ MobileOutlined,
+ SafetyCertificateOutlined,
+ SettingOutlined,
+ TeamOutlined,
+ ThunderboltOutlined,
+} from "@ant-design/icons";
import { createApiClient } from "./lib/api.js";
+import { adminTheme } from "./lib/theme.js";
+import { LoadingStack } from "./components/QueryState.js";
+import { StatusTag } from "./components/StatusTag.js";
+import "./styles/admin.css";
const FeatureInquiriesPage = React.lazy(() =>
import("./features/inquiries/InquiriesPage.js").then((module) => ({
default: module.InquiriesPage,
@@ -88,19 +102,27 @@ function Login({
}
}
return (
-
-
-
-
-
-
-
-
- 登录
-
-
-
+
+
+
+ 品
+ 个人品牌后台
+
+ 管理你的品牌表达、内容发布与客户咨询。
+
+
+
+
+
+
+
+ 登录
+
+
+ 仅限授权成员访问。
+
+
);
}
@@ -133,27 +155,33 @@ function ChangePassword({ onComplete }: { onComplete: () => void }) {
}
}
return (
-
- 请先设置只有你本人知道的新密码。
-
-
-
-
-
-
-
-
-
-
- 保存新密码
-
-
-
+
+
+
+ 品
+ 首次登录需要修改密码
+
+ 请先设置只有你本人知道的新密码。
+
+
+
+
+
+
+
+
+
+
+ 保存新密码
+
+
+
+
);
}
@@ -183,12 +211,12 @@ function Dashboard({ onLogout, role }: { onLogout: () => void; role: string }) {
type: "group" as const,
label: "日常经营",
children: [
- { key: "overview", label: "当前品牌概览" },
- { key: "publication", label: "配置与发布" },
- { key: "brand", label: "小程序页面" },
- { key: "trust", label: "信任内容" },
- { key: "services", label: "业务提供项" },
- { key: "inquiries", label: "咨询记录" },
+ { key: "overview", label: "当前品牌概览", icon: },
+ { key: "publication", label: "配置与发布", icon: },
+ { key: "brand", label: "小程序页面", icon: },
+ { key: "trust", label: "信任内容", icon: },
+ { key: "services", label: "业务提供项", icon: },
+ { key: "inquiries", label: "咨询记录", icon: },
],
},
...(role === "editor"
@@ -198,43 +226,39 @@ function Dashboard({ onLogout, role }: { onLogout: () => void; role: string }) {
type: "group" as const,
label: "系统管理",
children: [
- { key: "workspace", label: "模板与表单设置" },
- { key: "capabilities", label: "能力插件" },
- { key: "members", label: "团队成员" },
+ { key: "workspace", label: "模板与表单设置", icon: },
+ { key: "capabilities", label: "能力插件", icon: },
+ { key: "members", label: "团队成员", icon: },
],
},
]),
];
return (
-
-
-
- 当前品牌工作区
-
+
+
+
+ 品
+ 品牌工作区
+
-
-
-
- {brand.data?.name || "当前品牌"}
- 品牌工作区
-
- {role === "owner" ? "负责人" : "内容编辑"}
-
+
+
+
+ {brand.data?.name || "当前品牌"}
+ 品牌工作区
+
{
@@ -245,35 +269,37 @@ function Dashboard({ onLogout, role }: { onLogout: () => void; role: string }) {
label: item.brand.name,
}))}
/>
-
+
退出登录
-
- }>
-
- } />
- }
- />
- } />
- {role === "editor" ? null : (
- } />
- )}
- {role === "editor" ? null : (
- } />
- )}
- {role === "editor" ? null : (
- } />
- )}
- } />
- } />
- } />
- } />
-
-
+
+
+ }>
+
+ } />
+ }
+ />
+ } />
+ {role === "editor" ? null : (
+ } />
+ )}
+ {role === "editor" ? null : (
+ } />
+ )}
+ {role === "editor" ? null : (
+ } />
+ )}
+ } />
+ } />
+ } />
+ } />
+
+
+
@@ -315,12 +341,14 @@ function Root() {
}
createRoot(document.getElementById("app")!).render(
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
,
);
diff --git a/apps/admin/src/styles/admin.css b/apps/admin/src/styles/admin.css
new file mode 100644
index 0000000..52a0dd1
--- /dev/null
+++ b/apps/admin/src/styles/admin.css
@@ -0,0 +1,675 @@
+/*
+ * 后台全局样式。视觉规则见 apps/admin/design.md。
+ * 颜色令牌与 apps/admin/src/lib/theme.ts 保持一致,改动需同步。
+ */
+:root {
+ --admin-bg: #f7f8fa;
+ --admin-surface: #ffffff;
+ --admin-border: #e7e9ec;
+ --admin-divider: #f0f1f3;
+ --admin-text: #1c1f23;
+ --admin-text-secondary: #6b7280;
+ --admin-text-tertiary: #9aa1ac;
+ --admin-primary: #2563eb;
+ --admin-primary-bg: #eff4ff;
+ --admin-fill: #f7f8fa;
+ --admin-fill-quiet: #fafafb;
+
+ --admin-tone-success-bg: #ecfdf3;
+ --admin-tone-success-fg: #067647;
+ --admin-tone-warning-bg: #fffaeb;
+ --admin-tone-warning-fg: #b54708;
+ --admin-tone-error-bg: #fef3f2;
+ --admin-tone-error-fg: #b42318;
+ --admin-tone-neutral-bg: #f2f4f7;
+ --admin-tone-neutral-fg: #475467;
+ --admin-tone-info-bg: #eff4ff;
+ --admin-tone-info-fg: #2563eb;
+}
+
+html,
+body,
+#app {
+ height: 100%;
+}
+
+body {
+ margin: 0;
+ background: var(--admin-bg);
+ color: var(--admin-text);
+ font-variant-numeric: tabular-nums;
+ -webkit-font-smoothing: antialiased;
+}
+
+:where(a, button, [tabindex]):focus-visible {
+ outline: 2px solid var(--admin-primary);
+ outline-offset: 2px;
+}
+
+/* 外壳 */
+.admin-shell {
+ min-height: 100vh;
+}
+
+.admin-sider,
+.admin-sider .ant-layout-sider-children {
+ border-right: 1px solid var(--admin-border);
+}
+
+.admin-sider.ant-layout-sider-collapsed,
+.admin-sider.ant-layout-sider-zero-width,
+.admin-sider.ant-layout-sider-zero-width .ant-layout-sider-children {
+ border-right: 0;
+}
+
+.admin-sider .ant-layout-sider-zero-width-trigger {
+ border: 1px solid var(--admin-border);
+ border-left: 0;
+ border-radius: 0 6px 6px 0;
+ box-shadow: none;
+}
+
+.admin-sider-brand {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ height: 56px;
+ padding: 0 20px;
+}
+
+.admin-sider-brand-mark {
+ width: 24px;
+ height: 24px;
+ border-radius: 6px;
+ background: var(--admin-primary);
+ color: #fff;
+ font-size: 13px;
+ font-weight: 600;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex: none;
+}
+
+.admin-sider-brand-name {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--admin-text);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.admin-sider .ant-menu {
+ border-inline-end: 0;
+ padding: 4px 0 12px;
+}
+
+.admin-sider .ant-menu-item-group-title {
+ padding: 16px 24px 6px;
+ font-size: 12px;
+}
+
+.admin-main {
+ display: flex;
+ flex-direction: column;
+ min-height: 100vh;
+ min-width: 0;
+}
+
+.admin-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 16px;
+ border-bottom: 1px solid var(--admin-border);
+}
+
+.admin-header-left {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-width: 0;
+}
+
+.admin-header-brand {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--admin-text);
+}
+
+.admin-header-context {
+ font-size: 13px;
+ color: var(--admin-text-tertiary);
+}
+
+.admin-brand-switcher {
+ min-width: 140px;
+}
+
+.admin-equal-height > .ant-col > .ant-card {
+ height: 100%;
+}
+
+.admin-content {
+ flex: 1;
+ padding: 24px;
+}
+
+.admin-content-inner {
+ max-width: 1200px;
+ margin: 0 auto;
+}
+
+/* 页面头部 */
+.admin-page-header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 16px;
+ margin-bottom: 24px;
+}
+
+.admin-page-header-title {
+ margin: 0;
+ font-size: 24px;
+ font-weight: 600;
+ line-height: 1.35;
+ color: var(--admin-text);
+}
+
+.admin-page-header-description {
+ margin: 8px 0 0;
+ font-size: 14px;
+ line-height: 1.5;
+ color: var(--admin-text-secondary);
+}
+
+/* 区块与列表 */
+.admin-section {
+ padding: 20px;
+ border: 1px solid var(--admin-border);
+ border-radius: 10px;
+ background: var(--admin-surface);
+}
+
+.admin-section + .admin-section {
+ margin-top: 16px;
+}
+
+.admin-section-head {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 16px;
+ margin-bottom: 12px;
+}
+
+.admin-section-head:last-child {
+ margin-bottom: 0;
+}
+
+.admin-section-title {
+ margin: 0;
+ font-size: 16px;
+ font-weight: 600;
+ line-height: 1.45;
+ color: var(--admin-text);
+}
+
+.admin-section-description {
+ margin: 6px 0 0;
+ font-size: 13px;
+ line-height: 1.5;
+ color: var(--admin-text-secondary);
+}
+
+.admin-stack {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+}
+
+.admin-stack-lg {
+ gap: 16px;
+}
+
+.admin-stack-tight {
+ gap: 12px;
+}
+
+.admin-actions {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 12px;
+}
+
+.admin-row-title {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--admin-text);
+}
+
+.admin-row-meta {
+ font-size: 12px;
+ color: var(--admin-text-tertiary);
+}
+
+.admin-row-summary {
+ font-size: 13px;
+ line-height: 1.5;
+ color: var(--admin-text-secondary);
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+
+.admin-empty-inline {
+ padding: 24px 0;
+ text-align: center;
+ font-size: 13px;
+ color: var(--admin-text-tertiary);
+ margin: 0;
+}
+
+/* 列表行 */
+.admin-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.admin-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 16px;
+ padding: 14px 0;
+ border-bottom: 1px solid var(--admin-divider);
+}
+
+.admin-row:last-child {
+ border-bottom: 0;
+}
+
+.admin-row-main {
+ min-width: 0;
+}
+
+.admin-row-line {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 8px;
+}
+
+.admin-row-help {
+ margin: 6px 0 0;
+ font-size: 13px;
+ line-height: 1.5;
+ color: var(--admin-text-secondary);
+}
+
+.admin-field-stack {
+ display: grid;
+ gap: 12px;
+}
+
+.admin-field-label {
+ display: block;
+ font-size: 13px;
+ font-weight: 500;
+ color: var(--admin-text-secondary);
+ margin-bottom: 6px;
+}
+
+.admin-offset-top {
+ margin-top: 16px;
+}
+
+.admin-offset-top-xs {
+ margin-top: 4px;
+}
+
+.admin-divider {
+ margin: 16px 0;
+}
+
+.admin-offset-top-sm {
+ margin-top: 8px;
+}
+
+.admin-offset-top-md {
+ margin-top: 12px;
+}
+
+.admin-offset-bottom {
+ margin-bottom: 16px;
+}
+
+.admin-text-xs {
+ font-size: 12px;
+ line-height: 1.5;
+ color: var(--admin-text-secondary);
+}
+
+.admin-text-xs-quiet {
+ font-size: 12px;
+ color: var(--admin-text-tertiary);
+}
+
+.admin-text-warning {
+ color: var(--admin-tone-warning-fg);
+}
+
+.admin-flush {
+ margin-bottom: 0;
+}
+
+.admin-flush-top {
+ margin-top: 0;
+}
+
+.admin-block {
+ width: 100%;
+}
+
+.admin-offset-bottom-sm {
+ margin-bottom: 12px;
+}
+
+.admin-offset-bottom-lg {
+ margin-bottom: 24px;
+}
+
+.admin-offset-top-lg {
+ margin-top: 24px;
+}
+
+.admin-link-flush {
+ padding: 0;
+}
+
+.admin-form-row {
+ display: flex;
+ align-items: flex-start;
+ gap: 16px;
+ flex-wrap: wrap;
+}
+
+.admin-form-row-center {
+ display: flex;
+ align-items: center;
+ gap: 16px;
+ flex-wrap: wrap;
+}
+
+.admin-flex-1 {
+ flex: 1;
+ min-width: 0;
+}
+
+.admin-field-w-sm {
+ width: 90px;
+}
+
+.admin-field-w-md {
+ width: 150px;
+}
+
+.admin-field-w-lg {
+ width: 160px;
+}
+
+.admin-field-w-xl {
+ width: 220px;
+}
+
+.admin-field-w-2xl {
+ width: 180px;
+}
+
+.admin-field-stack-xs {
+ display: grid;
+ gap: 4px;
+}
+
+.admin-form-column {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+}
+
+.admin-brand-title {
+ margin: 0;
+ font-size: 20px;
+ font-weight: 600;
+ line-height: 1.4;
+ color: var(--admin-text);
+}
+
+.admin-brand-tagline {
+ margin: 6px 0 12px;
+ font-size: 14px;
+ line-height: 1.5;
+ color: var(--admin-text-secondary);
+}
+
+.admin-field-offset {
+ margin-top: 30px;
+}
+
+.admin-offset-bottom-xs {
+ margin-bottom: 8px;
+}
+
+.admin-visual-card {
+ width: 260px;
+}
+
+.admin-swatch {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ height: 24px;
+ padding: 0 8px;
+ border-radius: 6px;
+ background: var(--admin-fill);
+ color: var(--admin-text-secondary);
+ font-size: 12px;
+}
+
+.admin-swatch::before {
+ content: "";
+ width: 10px;
+ height: 10px;
+ border-radius: 3px;
+ border: 1px solid var(--admin-border);
+ background: var(--swatch-color, transparent);
+}
+
+/* 状态标签 */
+.admin-status-tag {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ height: 24px;
+ padding: 0 8px;
+ border-radius: 6px;
+ font-size: 12px;
+ font-weight: 500;
+ line-height: 1;
+ white-space: nowrap;
+ background: var(--admin-tone-neutral-bg);
+ color: var(--admin-tone-neutral-fg);
+}
+
+.admin-status-tag[data-tone="success"] {
+ background: var(--admin-tone-success-bg);
+ color: var(--admin-tone-success-fg);
+}
+
+.admin-status-tag[data-tone="warning"] {
+ background: var(--admin-tone-warning-bg);
+ color: var(--admin-tone-warning-fg);
+}
+
+.admin-status-tag[data-tone="error"] {
+ background: var(--admin-tone-error-bg);
+ color: var(--admin-tone-error-fg);
+}
+
+.admin-status-tag[data-tone="info"] {
+ background: var(--admin-tone-info-bg);
+ color: var(--admin-tone-info-fg);
+}
+
+/* 指标卡 */
+.admin-metric-label {
+ font-size: 12px;
+ color: var(--admin-text-tertiary);
+}
+
+.admin-metric-value {
+ margin-top: 8px;
+ font-size: 28px;
+ font-weight: 600;
+ line-height: 1.2;
+ color: var(--admin-text);
+}
+
+.admin-metric-suffix {
+ margin-left: 6px;
+ font-size: 12px;
+ font-weight: 400;
+ color: var(--admin-text-tertiary);
+}
+
+/* 反馈 */
+.admin-error-note {
+ padding: 12px 16px;
+ border: 1px solid #fbd5d1;
+ border-radius: 8px;
+ background: var(--admin-tone-error-bg);
+ color: var(--admin-tone-error-fg);
+ font-size: 14px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+}
+
+.admin-loading-stack {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+}
+
+.admin-log {
+ margin: 0;
+ padding: 16px;
+ border-radius: 8px;
+ background: #1c1f23;
+ color: #e4e7ec;
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
+ font-size: 12px;
+ line-height: 1.7;
+ max-height: 280px;
+ overflow: auto;
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+.admin-log__line {
+ color: #e4e7ec;
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+.admin-log__line[data-stream="stderr"] {
+ color: #fda29b;
+}
+
+.admin-log__time {
+ color: #98a2b3;
+}
+
+.admin-code-input {
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
+ font-size: 12px;
+}
+
+.admin-thumb {
+ width: 80px;
+ height: 80px;
+ object-fit: cover;
+ border-radius: 8px;
+ border: 1px solid var(--admin-border);
+}
+
+.admin-thumb-remove {
+ position: absolute;
+ top: 8px;
+ right: 8px;
+}
+
+.admin-thumb-wrap {
+ position: relative;
+ display: inline-block;
+}
+
+.admin-media-preview {
+ position: relative;
+ width: 100%;
+ min-height: 140px;
+ border-radius: 8px;
+ overflow: hidden;
+ border: 1px solid var(--admin-border);
+ background: var(--admin-fill);
+}
+
+@media (max-width: 1024px) {
+ .admin-content {
+ padding: 16px;
+ }
+}
+
+/* 登录与改密 */
+.admin-auth {
+ min-height: 100vh;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 24px;
+ background: var(--admin-bg);
+}
+
+.admin-auth-card {
+ width: 100%;
+ max-width: 400px;
+}
+
+.admin-auth-card .ant-card-body {
+ padding: 32px;
+}
+
+.admin-auth-brand {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.admin-auth-hint {
+ margin: 8px 0 20px;
+ font-size: 13px;
+ color: var(--admin-text-secondary);
+}
+
+.admin-auth-footnote {
+ margin: 16px 0 0;
+ font-size: 12px;
+ color: var(--admin-text-tertiary);
+ text-align: center;
+}