如题:
咨询一下小程序中如果在详情页中调用openDocument方法之后,会自动返回首页,应该如何处理?
在详情页中,成功调用openDocument方法后,成功打开文档并且显示正常,但是点击右上角的返回按钮之后,小程序会自动跳转到首页。现业务需要保留在详情页中。应当如何处理?
环境:ios
问题模块 | 框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|---|
API和组件 | 小程序 | Bug | openDocument | 微信iOS客户端 | 7.0.8 | 2.9.2 |
如题:
咨询一下小程序中如果在详情页中调用openDocument方法之后,会自动返回首页,应该如何处理?
在详情页中,成功调用openDocument方法后,成功打开文档并且显示正常,但是点击右上角的返回按钮之后,小程序会自动跳转到首页。现业务需要保留在详情页中。应当如何处理?
环境:ios
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
代码片段:
wx.downloadFile({
url: this.GlobalConfig._api2 + '/attachment/getFile/' + encodeURIComponent(obj.fileName), //仅为示例,并非真实的资源
success: res => {
wx.openDocument({
filePath: res.tempFilePath,
success: function (res) {
console.log('打开文档成功');
}
});
// this.dd = res.tempFilePath;
console.log(res);
}
});