uni-app 小程序拉起正常但无法返回 点击button无反应
uni-app 小程序拉起正常但无法返回 点击button无反应
项目信息 | 详情 |
---|---|
产品分类 | uniapp/App |
PC开发环境操作系统 | Windows |
PC开发环境操作系统版本号 | win7 |
HBuilderX类型 | 正式 |
HBuilderX版本号 | 3.1.4 |
手机系统 | Android |
手机系统版本号 | Android 10 |
手机厂商 | 华为 |
手机机型 | HUAWEI Mate 10 |
页面类型 | vue |
打包方式 | 离线 |
项目创建方式 | HBuilderX |
示例代码:
<!-- <button open-type="launchApp" app-parameter="wechat" bindlaunchapp="launchAppSuccess" binderror="launchAppError">返回App1</button> -->
<button open-type="launchapp" app-parameter='{"errcode":0}' binderror="launchAppError">返回App1</button>
methods: {
launchAppSuccess: function(e) {
console.log('launchAppSuccess', e)
},
launchAppError: function(e) {
console.error('launchAppError', e)
},
}
操作步骤:
<!-- <button open-type="launchApp" app-parameter="wechat" bindlaunchapp="launchAppSuccess" binderror="launchAppError">返回App1</button> -->
<button open-type="launchapp" app-parameter='{"errcode":0}' binderror="launchAppError">返回App1</button>
methods: {
launchAppSuccess: function(e) {
console.log('launchAppSuccess', e)
},
launchAppError: function(e) {
console.error('launchAppError', e)
},
}
预期结果:
希望可以从小程序正常返回app,并可以接收参数。
实际结果:
场景值是1069,但是无法从app拉起的小程序返回app。
bug描述:
<button open-type="launchapp" app-parameter='{"errcode":0}' binderror="launchAppError">返回App1</button>
uniapp离线打包的安卓版app,可以正常拉起小程序,打印的场景值是1069,但是点击是没反应的,也不会报错。
<button open-type="launchApp" app-parameter="wechat" bindlaunchapp="launchAppSuccess" binderror="launchAppError">返回App1</button>
加了bindlaunchapp
事件,就会报错没有launchAppSuccess
方法。
更多关于uni-app 小程序拉起正常但无法返回 点击button无反应的实战教程也可以访问 https://www.itying.com/category-93-b0.html