From 418986e46cce1e0a9b886b4204d483243bbef483 Mon Sep 17 00:00:00 2001 From: Hera Zhao Date: Fri, 10 Apr 2026 10:01:36 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=95=86=E4=B8=9A=E8=AE=A4=E8=AF=81+?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E9=87=8D=E5=86=99=EF=BC=8C?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=85=A5=E5=8F=A3=E7=A7=BB=E5=88=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 商业认证: - 重写申请表单:认证类型、企业名称、联系电话、业务描述 - 状态栏样式:左侧彩色条(绿/橙/红) - 用户管理页:同一用户只显示一条,可展开历史查看拒绝原因 - 后端 API 补充 reject_reason 字段 商业核算: - 成分表改为标准表格(精油/用量/单价/小计) - 总成本显示栏(绿色背景大字) - 定价字段放在成本下方 管理入口: - 操作日志/Bug/用户管理从主 tab 栏移到管理员用户菜单 - 添加配方按钮对所有用户可见 Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/main.py | 2 +- frontend/src/App.vue | 3 - frontend/src/components/UserMenu.vue | 10 ++ frontend/src/views/MyDiary.vue | 126 +++++++++++++++----------- frontend/src/views/Projects.vue | 107 +++++++++++++++------- frontend/src/views/RecipeManager.vue | 2 +- frontend/src/views/UserManagement.vue | 75 ++++++++++++--- 7 files changed, 223 insertions(+), 102 deletions(-) diff --git a/backend/main.py b/backend/main.py index 0c79e1b..db3ddcd 100644 --- a/backend/main.py +++ b/backend/main.py @@ -501,7 +501,7 @@ def get_my_business_application(user=Depends(get_current_user)): def list_business_applications(user=Depends(require_role("admin"))): conn = get_db() rows = conn.execute( - "SELECT a.id, a.user_id, a.business_name, a.document, a.status, a.created_at, " + "SELECT a.id, a.user_id, a.business_name, a.document, a.status, a.reject_reason, a.created_at, " "u.display_name, u.username FROM business_applications a " "LEFT JOIN users u ON a.user_id = u.id ORDER BY a.id DESC" ).fetchall() diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 3de03fe..c21ba42 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -82,9 +82,6 @@ const allTabs = [ { key: 'inventory', icon: '📦', label: '个人库存', require: 'login' }, { key: 'oils', icon: '💧', label: '精油价目' }, { key: 'projects', icon: '💼', label: '商业核算', require: 'login' }, - { key: 'audit', icon: '📜', label: '操作日志', hide: 'admin' }, - { key: 'bugs', icon: '🐛', label: 'Bug', hide: 'admin' }, - { key: 'users', icon: '👥', label: '用户管理', hide: 'admin' }, ] // 所有人都能看到大部分 tab,bug 和用户管理只有 admin 可见 diff --git a/frontend/src/components/UserMenu.vue b/frontend/src/components/UserMenu.vue index 32e5d81..d72ff52 100644 --- a/frontend/src/components/UserMenu.vue +++ b/frontend/src/components/UserMenu.vue @@ -14,6 +14,11 @@ + @@ -88,6 +93,11 @@ function goMyDiary() { router.push('/mydiary') } +function goAdmin(section) { + emit('close') + router.push('/' + section) +} + function toggleNotifications() { showNotifPanel.value = !showNotifPanel.value showBugForm.value = false diff --git a/frontend/src/views/MyDiary.vue b/frontend/src/views/MyDiary.vue index a9632eb..5dc58d1 100644 --- a/frontend/src/views/MyDiary.vue +++ b/frontend/src/views/MyDiary.vue @@ -241,56 +241,58 @@ -
-

💼 商业认证

+
+

🏢 商业用户认证

-
-
-
已认证商业用户
+
+ ✅ 已认证商业用户
- +
+ ⏳ 认证申请审核中 +
商户名:{{ bizApp.business_name }} · 提交时间:{{ formatDate(bizApp.created_at) }}
+
- + - -