uniapp微信小程序订阅消息
程序员文章站
2022-07-13 21:29:45
...
'use strict';
exports.main = async (event, context) => {
const token = event.token;
const openid = event.openid;
const name = event.custname;
const phone = event.custphone;
const dizhi = event.custdizhi;
const ydate = event.custdate;
const beizhu = event.custbeizhu;
const url = `https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=${token}`;
const res = await uniCloud.httpclient.request(url,{
method:"POST",
contentType: 'json',
dataType:"json",
data:{
touser: openid,
page: 'index',
lang: 'zh_CN',
data: {
name1: {
value: name
},
thing2: {
value: dizhi
},
phone_number4:{
value:phone
},
thing7:{
value:ydate
}
},
template_id:'krG6MsATQYYfr2xzXpmoGc4FfQh9MZXCDNoY1aGNxUU',
miniprogramState:'developer'
}
})
return res;
};
上一篇: python中的正则表达式,python
下一篇: WPF实现字体仿开门3D效果