wx.scanQRCode IOS上调不出扫一扫的界面

发布于 8 年前作者 qiaona15885 次浏览最后编辑 8 年前来自 ask

wx.scanQRCode IOS上调不出扫一扫的界面,在Android上可以正常使用。

IOS上提示:scanQRCode the permission value is offline verifying。

代码片段:

wx.error(function(res) {

          alert(“出错了:” + res.errMsg);

//此处返回:config:fail

        });

        wx.ready(function(){

          alert(“ready”);

          wx.checkJsApi({

            jsApiList:[‘scanQRCode’],

            success:function(res){

                alert(“res.checkResult=”+JSON.stringify(res));

//此处返回的是scanQRCode:ok

            }

          });

          wx.scanQRCode({

              needResult: 0, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,

              scanType: [“qrCode”,“barCode”], // 可以指定扫二维码还是一维码,默认二者都有

              success: function (res) {

                alert(1234);

                var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果

                alert(result);

                alert(res.resultStr);

                window.open(result);

              }

          });

        });

JSSDK:jweixin-1.4.0

2 回复
liutao
liutao1 楼6 年前

报错信息是?

hyang
hyang2 楼6 年前

wx.scanCode