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