|
@@ -9,6 +9,7 @@ let mapregionchange_makertap = false;
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
+ scanFlag:false,
|
|
|
markers: [],
|
|
|
latitude: 39.9088120620532,
|
|
|
longitude: 116.39747668717192,
|
|
@@ -168,6 +169,8 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
+ this.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
if (e.q) {
|
|
|
//console.log(decodeURIComponent(e.q));
|
|
|
//let charePileId = decodeURIComponent(e.q).replace("https://cdgl.pjnes.com/", "");
|
|
@@ -564,12 +567,23 @@ Page({
|
|
|
},
|
|
|
//打开扫一扫
|
|
|
click_scan_control(e) {
|
|
|
+ if(this.scanFlag){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.scanFlag = true;
|
|
|
+ wx.showLoading({
|
|
|
+ title: '努力加载中...',
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
console.log("打开扫一扫");
|
|
|
log.info('[首页]', '[打开扫一扫]');
|
|
|
let that = this;
|
|
|
if (!this.data.isLogin) {
|
|
|
log.info('[首页]', '[未登陆跳转登录界面]');
|
|
|
let url = `/pages/login/login`;
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
});
|
|
@@ -591,6 +605,8 @@ Page({
|
|
|
} = data;
|
|
|
log.info('[首页]', '[获取用户是否有未支付订单]', '[响应]', data);
|
|
|
if (data && order && data.code == 200) {
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
log.info('[首页]', '[用户有未支付订单跳转订单支付界面]');
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
@@ -639,6 +655,8 @@ Page({
|
|
|
console.log(scanResult);
|
|
|
log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
|
|
|
if (!res.data || res.data.code == 500) {
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
//没有该充电桩信息
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
@@ -665,26 +683,36 @@ Page({
|
|
|
});
|
|
|
log.info('[首页]', '[扫一扫充电桩空闲跳转去充电界面]');
|
|
|
let url = `/pages/scan_result/scan_result`;
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
});
|
|
|
}
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
}
|
|
|
},
|
|
|
fail(e) {
|
|
|
getApp().showNetworkError();
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ fail(e){
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
fail(e) {
|
|
|
+ that.scanFlag = false;
|
|
|
+ wx.hideLoading();
|
|
|
getApp().showNetworkError();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
//地图位移
|
|
|
mapchange(e) {
|