feat(miniprogram): 微信订阅消息引导 + 个人中心消息 badge 占位
- 新增 wechat-templates.ts 集中管理模板 ID - 预约成功后引导用户订阅预约提醒 - 随访记录提交后引导订阅随访提醒 - 个人中心新增消息中心入口 + 未读数 badge(MVP 占位 unreadCount: 0)
This commit is contained in:
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user