add requestSubscribeMessage & templateId on ticket submit
parent
16cb2362e6
commit
7ae5d8758a
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
});
|
});
|
||||||
|
Taro.requestSubscribeMessage({
|
||||||
|
tmplIds: tmplIds,
|
||||||
|
success: function (re) {
|
||||||
|
console.log(re);
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log(err);
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.reLaunch({
|
Taro.reLaunch({
|
||||||
url: '/pages/repair/repair',
|
url: '/pages/repair/repair',
|
||||||
});
|
});
|
||||||
}, relaunchInterval);
|
}, relaunchInterval);
|
||||||
|
},
|
||||||
|
entityIds: tmplIds,
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue