H5页面调用微信的扫一扫,苹果手机调不起来,什么原因? | 您所在的位置:网站首页 › 小程序调用扫码 › H5页面调用微信的扫一扫,苹果手机调不起来,什么原因? |
H5页面无法调起微信扫一扫,安卓机正常, 苹果手机报错。以下是苹果机的报错顺序,最后一张是安卓手机,一切正常,求解 mounted () { const that = this this.getList() that.$http.post(that.API.getJsSDKApi, { 'url': window.location.href }, (res) => { if (res.data.ret_code === '00') { wx.config({ debug: false, // 开启调试模式, appId: res.data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid timestamp: res.data.timestamp, // 必填,生成签名的时间戳 nonceStr: res.data.nonceStr, // 必填,生成签名的随机串 signature: res.data.signature, // 必填,签名,见附录1 jsApiList: ['scanQRCode'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }) } else { that.$util.errorToast(res.data.ret_msg) } }) } scaneCode () { const that = this wx.ready(function () { wx.scanQRCode({ needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有 success: function (res) { var result = res.resultStr // 当needResult 为 1 时,扫码返回的结果 console.log(res) let params = {opType: 'add', result} alert(result) // that.$router.push({path: '/speaker_set', query: { boxMsg: encodeURIComponent(JSON.stringify(params)) }}) } }) }) } |
CopyRight 2018-2019 实验室设备网 版权所有 |