From 07495f8c3569259ada49440c4958efb659805c10 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Mon, 16 Feb 2026 12:53:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8F=90=E4=BA=A4=E5=85=B6=E4=BD=99?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 + .vscode/settings.json | 5 +- apps/web-antd/src/api/merchant/index.ts | 47 +++++++++++--- apps/web-antd/src/enums/merchantEnum.ts | 62 +++++++++++++++++++ apps/web-antd/src/layouts/basic.vue | 7 +++ .../src/router/routes/external/personal.ts | 29 +++++++++ .../src/views/personal/center/index.vue | 19 ++++++ 7 files changed, 160 insertions(+), 12 deletions(-) create mode 100644 apps/web-antd/src/enums/merchantEnum.ts create mode 100644 apps/web-antd/src/router/routes/external/personal.ts create mode 100644 apps/web-antd/src/views/personal/center/index.vue diff --git a/.gitignore b/.gitignore index 3399f39..52c5c86 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ vite.config.ts.* *.sw? .history .cursor + +# Prototype backup files +backup/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 8da37dc..72acd4c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -204,7 +204,7 @@ ], "i18n-ally.pathMatcher": "{locale}/{namespace}.{ext}", "i18n-ally.enabledParsers": ["json"], - "i18n-ally.sourceLanguage": "en", + "i18n-ally.sourceLanguage": "zh-CN", "i18n-ally.displayLanguage": "zh-CN", "i18n-ally.enabledFrameworks": ["vue", "react"], "i18n-ally.keystyle": "nested", @@ -227,5 +227,6 @@ "commentTranslate.multiLineMerge": true, "vue.server.hybridMode": true, "typescript.tsdk": "node_modules/typescript/lib", - "oxc.enable": false + "oxc.enable": false, + "kiroAgent.configureMCP": "Disabled" } diff --git a/apps/web-antd/src/api/merchant/index.ts b/apps/web-antd/src/api/merchant/index.ts index 4d40336..c479a5a 100644 --- a/apps/web-antd/src/api/merchant/index.ts +++ b/apps/web-antd/src/api/merchant/index.ts @@ -1,5 +1,18 @@ +import type { + ContractStatus, + MerchantDocumentStatus, + MerchantDocumentType, + MerchantStatus, + OperatingMode, + StaffRoleType, + StaffStatus, + StoreStatus, +} from '#/enums/merchantEnum'; + import { requestClient } from '#/api/request'; +export * from '#/enums/merchantEnum'; + /** * 商户门店信息 */ @@ -15,7 +28,7 @@ export interface MerchantStoreDto { /** 门店地址 */ address: string; /** 门店状态 */ - status: number; + status: StoreStatus; } /** @@ -31,7 +44,7 @@ export interface MerchantDetailDto { /** 商户名称 */ name: string; /** 经营模式 */ - operatingMode?: number; + operatingMode?: OperatingMode; /** 营业执照号 */ licenseNumber?: string; /** 法人/负责人 */ @@ -43,7 +56,7 @@ export interface MerchantDetailDto { /** 联系邮箱 */ contactEmail?: string; /** 商户状态 */ - status: number; + status: MerchantStatus; /** 是否冻结 */ isFrozen: boolean; /** 冻结原因 */ @@ -74,8 +87,8 @@ export interface MerchantDetailDto { export interface MerchantDocumentDto { id: string; merchantId: string; - documentType: number; - status: number; + documentType: MerchantDocumentType; + status: MerchantDocumentStatus; fileUrl: string; documentNumber?: string; issuedAt?: null | string; @@ -91,7 +104,7 @@ export interface MerchantContractDto { id: string; merchantId: string; contractNumber: string; - status: number; + status: ContractStatus; startDate: string; endDate: string; fileUrl: string; @@ -111,8 +124,8 @@ export interface MerchantStaffDto { name: string; phone: string; email?: string; - roleType: number; - status: number; + roleType: StaffRoleType; + status: StaffStatus; } /** @@ -121,7 +134,7 @@ export interface MerchantStaffDto { export interface MerchantAuditLogDto { id: string; merchantId: string; - action: number; + action: number; // MerchantAuditAction (need to define) operatorId?: string; title: string; description?: string; @@ -163,9 +176,23 @@ export async function getMerchantInfoApi() { return requestClient.get('/merchant/info'); } +/** + * 更新商户信息参数 + */ +export interface UpdateMerchantDto { + id: string; + name: string; + operatingMode?: OperatingMode; + licenseNumber?: string; + legalRepresentative?: string; + contactPhone?: string; + contactEmail?: string; + registeredAddress?: string; +} + /** * 更新商户信息 */ -export async function updateMerchantInfoApi(data: any) { +export async function updateMerchantInfoApi(data: UpdateMerchantDto) { return requestClient.post('/merchant/update', data); } diff --git a/apps/web-antd/src/enums/merchantEnum.ts b/apps/web-antd/src/enums/merchantEnum.ts new file mode 100644 index 0000000..2bcba9d --- /dev/null +++ b/apps/web-antd/src/enums/merchantEnum.ts @@ -0,0 +1,62 @@ +export enum OperatingMode { + Direct = 1, + Franchise = 2, +} + +export enum MerchantStatus { + Active = 1, + Closed = 3, + Pending = 0, + Suspended = 2, +} + +export enum ContractStatus { + Active = 1, + Draft = 0, + Expired = 2, + Terminated = 3, +} + +export enum MerchantDocumentType { + BusinessLicense = 1, + None = 0, + Other = 99, + Permit = 2, +} + +export enum MerchantDocumentStatus { + Approved = 1, + Expired = 3, + Pending = 0, + Rejected = 2, +} + +export enum StaffRoleType { + Financial = 2, + Operator = 3, + StoreManager = 1, +} + +export enum StaffStatus { + Active = 1, + Resigned = 2, +} + +export enum StoreStatus { + Closed = 2, + Operating = 1, + Renovating = 3, +} + +export enum MerchantAuditAction { + Audit = 4, + Close = 10, + Create = 1, + Delete = 3, + Freeze = 8, + Reject = 5, + Reopen = 11, + Unfreeze = 9, + Unknown = 0, + Update = 2, +} diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index 5350e1a..6dffe5a 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -85,6 +85,13 @@ const showDot = computed(() => ); const menus = computed(() => [ + { + handler: () => { + router.push({ name: 'PersonalCenter' }); + }, + icon: 'lucide:user', + text: $t('page.auth.profile'), + }, { handler: () => { router.push({ name: 'MerchantCenter' }); diff --git a/apps/web-antd/src/router/routes/external/personal.ts b/apps/web-antd/src/router/routes/external/personal.ts new file mode 100644 index 0000000..d22a806 --- /dev/null +++ b/apps/web-antd/src/router/routes/external/personal.ts @@ -0,0 +1,29 @@ +import type { RouteRecordRaw } from 'vue-router'; + +import { BasicLayout } from '#/layouts'; +import { $t } from '#/locales'; + +const routes: RouteRecordRaw[] = [ + { + component: BasicLayout, + meta: { + hideInMenu: true, + title: $t('page.auth.profile'), + }, + name: 'PersonalLayout', + path: '/personal', + children: [ + { + name: 'PersonalCenter', + path: 'center', + component: () => import('#/views/personal/center/index.vue'), + meta: { + hideInMenu: true, + title: $t('page.auth.profile'), + }, + }, + ], + }, +]; + +export default routes; diff --git a/apps/web-antd/src/views/personal/center/index.vue b/apps/web-antd/src/views/personal/center/index.vue new file mode 100644 index 0000000..b8a8df7 --- /dev/null +++ b/apps/web-antd/src/views/personal/center/index.vue @@ -0,0 +1,19 @@ + + + + +