diff --git a/apps/miniprogram/src/pages/appointment/create/index.tsx b/apps/miniprogram/src/pages/appointment/create/index.tsx
index 664c73e..c554924 100644
--- a/apps/miniprogram/src/pages/appointment/create/index.tsx
+++ b/apps/miniprogram/src/pages/appointment/create/index.tsx
@@ -3,6 +3,7 @@ import { View, Text, Input } from '@tarojs/components';
import Taro from '@tarojs/taro';
import { listDoctors, createAppointment, calendarView } from '../../../services/appointment';
import { useAuthStore } from '../../../stores/auth';
+import { TEMPLATE_IDS } from '@/services/wechat-templates';
import StepIndicator from '../../../components/StepIndicator';
import WeekCalendar from '../../../components/WeekCalendar';
import './index.scss';
@@ -111,6 +112,13 @@ export default function AppointmentCreate() {
reason: reason.trim() || undefined,
});
Taro.showToast({ title: '预约成功', icon: 'success' });
+ // 订阅消息引导
+ const tmplId = TEMPLATE_IDS.APPOINTMENT_REMINDER;
+ if (tmplId) {
+ try {
+ await Taro.requestSubscribeMessage({ tmplIds: [tmplId] });
+ } catch { /* 用户拒绝 */ }
+ }
setTimeout(() => Taro.navigateBack(), 1500);
} catch {
Taro.showToast({ title: '预约失败', icon: 'none' });
diff --git a/apps/miniprogram/src/pages/followup/detail/index.tsx b/apps/miniprogram/src/pages/followup/detail/index.tsx
index 1cd7c7b..be0d18e 100644
--- a/apps/miniprogram/src/pages/followup/detail/index.tsx
+++ b/apps/miniprogram/src/pages/followup/detail/index.tsx
@@ -3,6 +3,7 @@ import { View, Text, Textarea } from '@tarojs/components';
import Taro, { useRouter } from '@tarojs/taro';
import { getTaskDetail, submitRecord } from '../../../services/followup';
import type { FollowUpTask } from '../../../services/followup';
+import { TEMPLATE_IDS } from '@/services/wechat-templates';
import Loading from '../../../components/Loading';
import ErrorState from '../../../components/ErrorState';
import './index.scss';
@@ -41,6 +42,10 @@ export default function FollowUpDetail() {
content: { text: content.trim() },
});
Taro.showToast({ title: '提交成功', icon: 'success' });
+ const tmplId = TEMPLATE_IDS.FOLLOWUP_REMINDER;
+ if (tmplId) {
+ try { await Taro.requestSubscribeMessage({ tmplIds: [tmplId] }); } catch { /* 用户拒绝 */ }
+ }
setContent('');
} catch {
Taro.showToast({ title: '提交失败', icon: 'none' });
diff --git a/apps/miniprogram/src/pages/profile/index.scss b/apps/miniprogram/src/pages/profile/index.scss
index b7833ce..3169ecb 100644
--- a/apps/miniprogram/src/pages/profile/index.scss
+++ b/apps/miniprogram/src/pages/profile/index.scss
@@ -72,6 +72,24 @@
color: $tx3;
}
+.menu-badge {
+ background: $dan;
+ border-radius: 20px;
+ min-width: 36px;
+ height: 36px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0 10px;
+ margin-right: 12px;
+}
+
+.menu-badge-text {
+ font-size: 20px;
+ color: white;
+ font-weight: bold;
+}
+
.profile-logout {
margin: 24px;
background: $card;
diff --git a/apps/miniprogram/src/pages/profile/index.tsx b/apps/miniprogram/src/pages/profile/index.tsx
index 0dc817a..3c13c41 100644
--- a/apps/miniprogram/src/pages/profile/index.tsx
+++ b/apps/miniprogram/src/pages/profile/index.tsx
@@ -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() {
>
{item.icon}
{item.label}
+ {item.badge && unreadCount > 0 && (
+
+ {unreadCount > 99 ? '99+' : unreadCount}
+
+ )}
›
))}
diff --git a/apps/miniprogram/src/services/wechat-templates.ts b/apps/miniprogram/src/services/wechat-templates.ts
new file mode 100644
index 0000000..7d3c2aa
--- /dev/null
+++ b/apps/miniprogram/src/services/wechat-templates.ts
@@ -0,0 +1,5 @@
+export const TEMPLATE_IDS = {
+ APPOINTMENT_REMINDER: '',
+ FOLLOWUP_REMINDER: '',
+ REPORT_NOTIFICATION: '',
+};