Wechat applet development official account/service account method

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
insert image description here
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
insert image description here
page view
insert image description here

2. Service account notification development method

insert image description here
This kind also needs to go to the WeChat public platform to fill in the template
insert image description here
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

Guess you like

Origin blog.csdn.net/weixin_44255044/article/details/127900786
Recommended