斑码开发者
斑码开发者
  • 发布:2023-03-08 15:08
  • 更新:2023-03-09 14:37
  • 阅读:446

【报Bug】switchTab 跳转 报错 $.$getAppWebview is not a function

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 3.7.3

手机系统: iOS

手机系统版本号: iOS 13.1

手机厂商: 苹果

手机机型: iPad air 2

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

App下载地址或H5⽹址: https://naibademo.banma-soft.cn/test.zip

示例代码:
jumpUrl(index){  
                let activeIndex = this.activeIndex;  
                let menu = this.menu[index];  
                if(activeIndex!=index){  
                    if(menu.opentype=='switchTab'){  
                        console.log(menu.path);  
                        uni.switchTab({  
                            url:menu.path,  
                            success(res){  
                                console.log(res);   
                            },  
                            fail(res){  
                                console.log(res);   
                            }  
                        });  
                    }else{  
                        uni.reLaunch({  
                            animationType: 'pop-in',  
                            url:menu.path  
                        })  
                    }  
                }  
            },  

操作步骤:
jumpUrl(index){  
                let activeIndex = this.activeIndex;  
                let menu = this.menu[index];  
                if(activeIndex!=index){  
                    if(menu.opentype=='switchTab'){  
                        console.log(menu.path);  
                        uni.switchTab({  
                            url:menu.path,  
                            success(res){  
                                console.log(res);   
                            },  
                            fail(res){  
                                console.log(res);   
                            }  
                        });  
                    }else{  
                        uni.reLaunch({  
                            animationType: 'pop-in',  
                            url:menu.path  
                        })  
                    }  
                }  
            },  

预期结果:

正常跳转

实际结果:

跳转报错,以后就无法进行跳转了

bug描述:

从tabarA页面跳到B页面,再从B页面跳到A页面就开始报错,$.$getAppWebview is not a function 然后怎么跳都跳不到A页面了

2023-03-08 15:08 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

该测试工程 测试正常,而且看你的截图只有部分页面跳转失败,请检查代码逻辑是否存在问题,如确认框架问题,提供最简可复现demo

  • 斑码开发者 (作者)

    我在登录页面提前使用了预加载,去掉预加载就没问题了

    2023-05-01 19:06

  • 斑码开发者 (作者)

    demo地址:https://naibademo.banma-soft.cn/test.zip

    新BUG反馈:https://ask.dcloud.net.cn/question/172040

    2023-06-15 11:32

要回复问题请先登录注册