IOS调用微信扫一扫scanQRCode报错the permission value is offline verifying
<view class="a_c a_j" @click="scancode()">
点击扫码绑定设备
</view>
onLoad(){
let redirect_url=location.href.split('#')[0];
let urlNow = encodeURIComponent(redirect_url); //处理域名
uni.request({
url: common.baseUrl+'/health/user/api/weChatConfig?url='+urlNow,
method: "get",
dataType: "json",
header: {
"content-type": "application/x-www-form-urlencoded;charset=utf-8"
},
success(res) {
that.s=2;
console.log('sss',res)
// uni.showToast({
// icon: 'none',
// title: JSON.stringify(res)
// })
if (res.data) {
that.s=3;
if(that.aip){
jweixin.config({
debug: false,
appId: res.data.appid,
timestamp: res.data.timestamp,
nonceStr: res.data.noncestr,
signature: res.data.signature,
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'getLocation',
'scanQRCode'
]
});
that.aip=false;
}
that.s=4;
setTimeout(function(){
that.$wx.ready(function(res){
that.s=5;
that.$wx.checkJsApi({
jsApiList:['scanQRCode'],
success:function(res){
that.s=res;
console.log('watchRes',res);
callback(res)
}
});
});
},400)
that.$wx.error(function(res){
that.s=res;
console.log(res,'that.$wx.error')
})
}
}
})
}
methods:{
scancode:function(){
let that=this;
that.s=8;
this.$wx.scanQRCode({
desc: 'scanQRCode desc',
needResult:1,
scanType:["qrCode","barCode"],
success:function(res){
that.s=10;
setTimeout(function() {
that.s=11;
console.log('扫码返回值',res);
let data={
toCusId:that.userId,
toName:that.userName,
officeName:that.officeName,
deviceNumber:res.resultStr
}
// uni.showToast({
// icon: 'none',
// title: JSON.stringify(res)
// })
this.s=data;
console.log('data',data)
uni.request({
url: common.baseUrl +'/health/user/api/userBindDevice',
method: "POST",
dataType: "json",
header: {
"content-type":"application/x-www-form-urlencoded;charset=utf-8"
},
data:data,
success: function(result) {
that.s=14;
that.sm=true;
if (result.data.result === 'true') {
uni.showToast({
icon: 'none',
title:'设备绑定成功'
})
that.onLoads();
} else {
// uni.showToast({
// icon: 'none',
// title: JSON.stringify(result)
// })
return;
}
},
fail() {
that.s=13;
that.sm=true;
}
})
},2000)
},
fail(ssss){
that.s=12;
uni.showToast({
icon: 'none',
title: JSON.stringify(ssss)
})
}
})
},
}
安卓没问题,ios报错scanQRCode:the permission value is offline verifying;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论