|
@@ -20,24 +20,49 @@
|
|
|
var that=this;
|
|
|
uni.scanCode({
|
|
|
success: function (res) {
|
|
|
- console.log('条码类型:' + res.scanType);
|
|
|
- console.log('条码内容:' + res.result);
|
|
|
- that.url=res.result;
|
|
|
- that.shopId=that.getHashQuery('shopId')
|
|
|
- if(that.shopId){
|
|
|
- that.gologin()
|
|
|
+ console.log(res)
|
|
|
+ console.log('条码类型:' + res.scanType);
|
|
|
+ if(res.scanType=='WX_CODE'){
|
|
|
+ that.url=res.path;
|
|
|
+ that.shopId=that.getHashQuery('scene')
|
|
|
+ that.shopId=that.insertStr(that.shopId,8,"-");
|
|
|
+ that.shopId=that.insertStr(that.shopId,13,"-");
|
|
|
+ that.shopId=that.insertStr(that.shopId,18,"-");
|
|
|
+ that.shopId=that.insertStr(that.shopId,23,"-");
|
|
|
+ console.log(that.shopId)
|
|
|
+ if(that.shopId){
|
|
|
+ that.gologin()
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: '请扫码正确的二维码',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
}else{
|
|
|
- uni.showToast({
|
|
|
- title: '请扫码正确的二维码',
|
|
|
- icon: 'none',
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
+ console.log('条码内容:' + res.result);
|
|
|
+ that.url=res.result;
|
|
|
+ that.shopId=that.getHashQuery('shopId')
|
|
|
+ if(that.shopId){
|
|
|
+ that.gologin()
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: '请扫码正确的二维码',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- console.log(that.shopId)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ insertStr(soure, start, newStr){
|
|
|
+ return soure.slice(0, start) + newStr + soure.slice(start);
|
|
|
+ },
|
|
|
gologin(){
|
|
|
uni.navigateTo({
|
|
|
url:'../login/login?shopId='+this.shopId
|