add requestSubscribeMessage & templateId on ticket submit

main
Dawn_Ocean 2024-03-21 10:48:27 +08:00
parent 16cb2362e6
commit 7ae5d8758a
2 changed files with 20 additions and 6 deletions

View File

@ -3,6 +3,8 @@ export type FixStatus = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
export const defaultAvatar = export const defaultAvatar =
'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'; 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png';
export const tmplIds = ['hbblqs928F2kd1s0IR_pDIAjYrNscUmz6tv6NZKsctM'];
export type Info = { export type Info = {
phone: string; phone: string;
name: string; name: string;

View File

@ -2,7 +2,7 @@ import RepairPage from '@/pages/repair/repair';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import pt from '@/plain-text'; import pt from '@/plain-text';
import wechatUser, { UserInfo } from '@/wechat'; import wechatUser, { UserInfo } from '@/wechat';
import { defaultAvatar } from '@/common'; import { defaultAvatar, tmplIds } from '@/common';
import { getUrl } from '.'; import { getUrl } from '.';
const relaunchInterval = 1000; const relaunchInterval = 1000;
@ -63,11 +63,23 @@ export function submitTicket(that: RepairPage) {
message: pt.get().button.submitText.success, message: pt.get().button.submitText.success,
type: 'success', type: 'success',
}); });
setTimeout(() => { Taro.requestSubscribeMessage({
Taro.reLaunch({ tmplIds: tmplIds,
url: '/pages/repair/repair', success: function (re) {
}); console.log(re);
}, relaunchInterval); },
fail: function (err) {
console.log(err);
},
complete: function () {
setTimeout(() => {
Taro.reLaunch({
url: '/pages/repair/repair',
});
}, relaunchInterval);
},
entityIds: tmplIds,
});
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);