feat(mini): 下单/提现/报名前补订阅消息授权(提升微信服务通知到达率)

- 新增 common/subscribe.js:页面预加载模板ID + 点击动作中同步请求授权(避免 await 丢失手势上下文)

- 下单支付前请求订单状态/核销码模板;提现前请求到账模板;组局报名确认后请求报名模板

- 自动过滤 tmpl_ 占位模板;授权失败不阻塞业务

- 新增回归护栏 subscribe-authorization.spec.ts(80 套件/615 用例全绿)
这个提交包含在:
xcbyy
2026-10-19 09:01:36 +08:00
父节点 1ff4da290a
当前提交 029c6189a7
共有 5 个文件被更改,包括 103 次插入 和 0 次删除

查看文件

@@ -423,6 +423,7 @@ import {
import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
import { ensureLoginOrRedirect } from '@/common/role.js';
import { preloadSubscribeTemplates, requestSubscribeFor } from '@/common/subscribe.js';
const currentUserId = computed(() => {
try {
@@ -465,6 +466,7 @@ onMounted(() => {
currentThemeKey.value = getCurrentThemeKey();
applyThemeToNativeUI(currentThemeKey.value);
uni.$on('theme-change', onThemeChanged);
preloadSubscribeTemplates();
});
onShow(() => {
@@ -846,6 +848,8 @@ const handleJoin = () => {
confirmColor: '#6366F1',
success: async (res) => {
if (res.confirm) {
// 报名前请求一次性订阅授权(组局报名通知)
requestSubscribeFor('activity');
uni.showLoading({ title: '正在报名生成核销码...' });
let code = '8392';
try {