远程调试bug
发布于 5 年前 作者 tao94 2871 次浏览 来自 问答

在执行wx.navigateTo 的时候,预览模式可以正常跳转,但是远程调试模式无法正常跳转,出现白屏加报错问题,报错如下:(andriod ios 手机都出现了如下情况,基础库版本为1.9.91)

运用了分包加载,页面跳转是从一个主包页面前往一个分包页面,路径确认书写正确。

4 回复

可以简单看下 wx.navigateTo 所在的代码吗。

let publicLogic = require('../../../../utils/util.js');
let http = publicLogic.http;
let dataCheck = publicLogic.dataCheck;
let alert = publicLogic.alert;
let toast = publicLogic.toast;
let rejectStepLogic = publicLogic.rejectStepLogic;
let paramJoin = publicLogic.paramJoin;
 
//按钮点击触发completeInf 函数,上面是简化的执行逻辑,下面是详细的
Page({
    completeInf(e){
      //逻辑省略下来如下
      let step = e.currentTarget.dataset.step; //这里取到的是1  
      
      let navigateObj = {
            '1': '../../../companyInfFix/pages/uploadbusinesslicense/uploadbusinesslicense',
            '2': '../../../IDAuthorize/pages/userPersonIdentityCardRealName/userPersonIdentityCardRealName?businessType=' + that.data.businessType,
            '3':'../../../uploadAuthorization/pages/companyauthorization/companyauthorization'
      }
 
      console.log('before go to') //打印出来了
      wx.navigateTo({
          url: navigateObj[step],
      })
      console.log('after go to') //打印出来了
    },
 
    completeInf(e){//弹出提示框
        //详细版代码
        let step = e.currentTarget.dataset.step;
        let that = this;
        let navigateObj = {
        '1': '../../../companyInfFix/pages/uploadbusinesslicense/uploadbusinesslicense',
        '2': '../../../IDAuthorize/pages/userPersonIdentityCardRealName/userPersonIdentityCardRealName?businessType=' + that.data.businessType,
        '3':'../../../uploadAuthorization/pages/companyauthorization/companyauthorization'
        }
 
        if (!that.data['bigStep' + step].isQry){ //不可查看
            console.log('isQry') //没有打印
            if (that.data['bigStep' + step].completeStatus === 'COMPLETE'){ //已完成
                alert.call(this, {
                    isAlert: true,
                    isCancel: false,
                    cancelStr: '取消',
                    sureStr: '知道了',
                    alertMsg: (step == 1 ? '企业信息' : step == 2 ? '身份认证' : '授权书上传') + '模块已填写完成,不可修改查看。',
                    cancelCallBack: function () { },
                    sureCallBack: function () { }
                })
            }else{ //未完成
                alert.call(this, {
                    isAlert: true,
                    isCancel: false,
                    cancelStr: '取消',
                    sureStr: '知道了',
                    alertMsg: that.data.bigStep1.isEdit ? '请先完善企业信息' : that.data.bigStep2.isEdit ? '请先完成身份认证' : '请上传企业授权确认书',
                    cancelCallBack: function () { },
                    sureCallBack: function () { }
                })
            }
 
            return;
        }
 
        if (!that.data['bigStep' + step].isEdit){ //不可修改 可查看
 
            navigateObj = {
                '1': '../../../companyInfFix/pages/uploadbusinesslicense/uploadbusinesslicense',
                '2': '../../../IDAuthorize/pages/userPersonIdentityCardRealName/userPersonIdentityCardRealName?businessType=' + that.data.businessType,
                '3': '../../../uploadAuthorization/pages/uploadauthoriztion/uploadauthoriztion'
            }
 
            alert.call(this, {
                isAlert: true,
                isCancel: true,
                cancelStr: '取消',
                sureStr: '知道了',
                alertMsg: (step == 1 ? '企业信息' : step == 2 ? '身份认证' : '授权书上传') + '模块已提交完成,不可修改只可查看。',
                cancelCallBack: function () { },
                sureCallBack: function () {
                    console.log('before go to') //打印出来了
                    wx.navigateTo({
                        url: navigateObj[step],
                    })
                    console.log('after go to') //打印出来了
                }
            })
 
            return;
        }
    }
})

远程调试控制台输出:

手机出错截图:

  1. 更新之后试了两次依然会出现原来的那个报错

  2. 两个小问题:

    [1]. 官网的版本号好像标注错了,安装包是 wechat_devtools_1.02.1802270_x64,官网写的是1.02.1802770,注意倒数第三位。

    [2]. 微信开发者工具点击检查更新没有识别下载最新的版本。

回到顶部