疑惑小程序跳转的的问题navigateTo和wx.switchTab

wx.showModal({ //小程序弹窗
title: ‘您还未登录,请您先登陆’, //提示的标题,

      showCancel: true, //是否显示取消按钮,
      cancelText: '拒绝登陆', //取消按钮的文字,默认为取消,最多 4 个字符,
      cancelColor: '#000000', //取消按钮的文字颜色,
      confirmText: '前往登陆', //确定按钮的文字,默认为取消,最多 4 个字符,
      confirmColor: '#3CC51F', //确定按钮的文字颜色,
      success: res => {
        if (res.confirm) {
      
       wx.navigateTo({   //页面跳转
            url:'/pages/mine/mine'
         });
        } else if (res.cancel) {
            console.log(111111)   //tab跳转
            wx.switchTab({ url: '/pages/logs/logs' })
        }
      }
    });

猜你喜欢

转载自blog.csdn.net/weixin_45663264/article/details/105271564