当前位置:网站首页>Wechat applet exits the applet (navigator and api--wx.exitminiprogram)
Wechat applet exits the applet (navigator and api--wx.exitminiprogram)
2022-06-26 04:41:00 【Chu Junjun】
demand :
In the wechat applet , Click on “ Cancel ” To exit the applet , Return to the wechat chat interface
effect :
step :
Method 1 :
Use it directly uni-app The components of ——navigator, Modify the parameters open-type="exit" target="miniProgram" that will do
( immediate withdrawal , No other action is required )
<navigator open-type="exit" target="miniProgram" > Cancel </navigator>
Method 2 :
Use wechat applet API--wx.exitMiniProgram
( For exit , Clear cache and other operations )
Set click event :
<view @click="exitApplet()"> Cancel </view>
Set up api( stay success Function can be written to exit the applet , What to do )
// Exit applet
exitApplet() {
wx.exitMiniProgram({
success: function () {
postCancelLogin({unique_id:this.unique_id}).then((res => {
uni.removeStorageSync('iv'); // Clear cache
uni.removeStorageSync('encryptedData');
}))
}
})
}
边栏推荐
- TP5 distinct method paging problem
- 1.13 learning summary
- Use shell script to analyze system CPU, memory and network throughput
- Create alicloud test instances
- 1.21 learning summary
- Yapi cross domain request plug-in installation
- Nabicat连接:本地Mysql&&云服务Mysql以及报错
- 2.9 learning summary
- CDN with OSS acceleration
- Group by and order by are used together
猜你喜欢
How can the intelligent transformation path of manufacturing enterprises be broken due to talent shortage and high cost?
Svn error command revert error previous operation has not finished; run ‘ cleanup‘ if
How to carry out word-of-mouth marketing for enterprises' products and services? Can word of mouth marketing be done on behalf of others?
The statistics in the MySQL field become strings, and then they are converted into numbers for sorting
NPM installation tutorial
Realize video call and interactive live broadcast in the applet
1.17 learning summary
Multipass中文文档-设置驱动
mysql高级学习(跟着尚硅谷老师周阳学习)
修改Oracle连接数
随机推荐
Tips for using idea
SixTool-多功能多合一代挂助手源码
Numpy data input / output
Group by and order by are used together
1.20 learning summary
08_ Spingboot integrated redis
Multipass中文文档-设置驱动
2022.2.11
Svn error command revert error previous operation has not finished; run ‘ cleanup‘ if
企业的产品服务怎么进行口碑营销?口碑营销可以找人代做吗?
2022.1.23
PHP design function getmaxstr to find the longest symmetric string in a string - [original]
Numpy index and slice
numpy 随机数
An unexpected attempt (Imperial CMS list template filters spaces and newlines in smalltext introduction)
"Eight hundred"
Multipass中文文档-使用Packer打包Multipass镜像
PHP get mobile number operator
Laravel uses phpword to generate word documents
1.14 learning summary