vue调用微信JSDK 扫一扫,相册等需要注意的事项
(编辑:jimmy 日期: 2025/10/25 浏览:3 次 )
在VUE里面需要注意的第一个问题就是路由得设置成
第二个就是 跳转路由的时候
不要用this.$router.push 或者this.$router.replace 前者在ios 和安卓端都调不起来的
后者只能在安卓端有效 在ios端无效
this.$router.push的效果图
测试工具上是可以调起,然后在安卓手机上和ios上这个是调不起的
这个在测试上椰是可以的,然后在安卓端上可以,在ios上会出现无效的token 40029
config:function(res){ //配置JSSDK和调取扫一扫功能
// location.reload();
this.isDisable = true;
this.model = 'block';
setTimeout(() => {
this.isDisable = false;
var that = this,
USER = JSON.parse(sessionStorage.getItem('USER')),
iscode = JSON.parse(sessionStorage.getItem('key')),
dizhi = encodeURIComponent(location.href.split('#')[0]);
console.log(dizhi);
var data = {
dizhi:dizhi,
i:USER.uniacid,
token:USER.token
}
this.$fetch('app/index.php/"qrCode","barCode"],
success:((option)=>{
var o = JSON.parse(option.resultStr);
var id = o.id;
var ordertype = o.ordertype;
var user_id = o.user_id
that.id = id;
that.ordertype = ordertype;
that.user_id = o.user_id;
let parm = {
i:USER.uniacid,
id:id,
ordertype:ordertype,
user_id:user_id,
bid:USER.bid,
token:USER.token,
}
that.$fetch('app/index.php/"0"){
that.isUsed = "未使用";
}else if(res.data.isUsed == "1"){
that.isUsed = "已使用";
}
}else if(ordertype == 11){
that.bname = res.data.bname;
that.couname = res.data.fname;
that.limittime = res.data.wtime;
that.uid = res.data.openid;
that.type = 1;
if(res.data.isUsed == "0"){
that.isUsed = "未核销";
}else if(res.data.isUsed == "1"){
that.isUsed = "已核销";
}
}
}
})
})
})
})
})
}, 300);
}
所以用了这个,用了这个的话,在安卓端和ios端都可以掉的起来。
以上就是vue调用微信JSDK 扫一扫,相册等需要注意的事项的详细内容,更多关于vue 调用微信扫一扫和相册的资料请关注其它相关文章!
下一篇:vue中使用echarts的示例





