How to Embed WeChat Mini Programs into Public Accounts/Service Accounts
1. Official account development method
First go to the WeChat public platform to open the public account option
and then add components to the page
<official-account bindload="bindload" class="official-account"></official-account>
Component details can be found on the official website document document address
Local debugging needs to be compiled to change the compilation mode
page view
2. Service account notification development method
This kind also needs to go to the WeChat public platform to fill in the template
and then write it where it needs to pop up in the code
Official documentation link for this methodDocumentation link
wx.requestSubscribeMessage({
tmplIds: ['模版ID', '模版ID', '模版ID'],
success: (res) => {
// if (res.模版ID == 'accept') {
// console.log('成功');
// } else {
// console.log('失败');
}
},
})
then click to view