通过扫二维码获取数据作为参数跳转到新的小程序失败?
发布于 6 年前 作者 yuangang 11642 次浏览 来自 官方Issues
   wx.scanCode({
        success(res) {
          console.log("scanSN res=>", res)
            wx.navigateToMiniProgram({
                  appId: util.SN_AppId,
                  path'pages/index/index?id=123',
                  extraData: {
                    foo'bar'
                  },
                  envVersion'trial',
                  success(res) {
              
                   console.log("打开成功 res=>", res)
            
                  },
                  fail(err) {
                
                    console.log("打开失败 err=>", err)  //
            
                  }
                })
  
        },
      
      })

// 提示:打开失败 err=> {errMsg: "navigateToMiniProgram:fail can only be invoked by user TAP gesture."}
该业务场景能否支持下呀?主要用于根据不同的二维码跳转到不同的小程序对应参数请求处理不同的业务逻辑
1 回复

小程序 跳转小程序 只能用户主动点击跳转,不能非用户主动点击跳转

回到顶部