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

@@ -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' });