feat(miniprogram): 微信订阅消息引导 + 个人中心消息 badge 占位
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 新增 wechat-templates.ts 集中管理模板 ID
- 预约成功后引导用户订阅预约提醒
- 随访记录提交后引导订阅随访提醒
- 个人中心新增消息中心入口 + 未读数 badge(MVP 占位 unreadCount: 0)
This commit is contained in:
iven
2026-04-24 12:47:25 +08:00
parent 38e53efaec
commit 0fe4cab593
5 changed files with 43 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import { useAuthStore } from '../../stores/auth';
import './index.scss';
const MENU_ITEMS = [
{ label: '消息中心', icon: '🔔', path: '/pages/profile/messages/index', badge: true },
{ label: '就诊人管理', icon: '👥', path: '/pages/profile/family/index' },
{ label: '我的报告', icon: '📋', path: '/pages/profile/reports/index' },
{ label: '我的随访', icon: '💬', path: '/pages/profile/followups/index' },
@@ -13,6 +14,7 @@ const MENU_ITEMS = [
export default function Profile() {
const { user, restore: restoreAuth, logout } = useAuthStore();
const unreadCount = 0; // MVP 占位,后续对接 erp-message API
useDidShow(() => {
restoreAuth();
@@ -54,6 +56,11 @@ export default function Profile() {
>
<Text className='menu-icon'>{item.icon}</Text>
<Text className='menu-label'>{item.label}</Text>
{item.badge && unreadCount > 0 && (
<View className='menu-badge'>
<Text className='menu-badge-text'>{unreadCount > 99 ? '99+' : unreadCount}</Text>
</View>
)}
<Text className='menu-arrow'></Text>
</View>
))}