|
@@ -236,8 +236,7 @@ Page({
|
|
|
},
|
|
|
|
|
|
onLoad(e) {
|
|
|
-
|
|
|
- this.scanFlag = false;
|
|
|
+ this.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
if (e.q) {
|
|
|
//console.log(decodeURIComponent(e.q));
|
|
@@ -600,8 +599,8 @@ Page({
|
|
|
// carParkingRate: false,
|
|
|
// parkTime: 0,
|
|
|
console.info(res)
|
|
|
- let dataSharePlatform = res.data.dataSharePlatform;
|
|
|
- if(!dataSharePlatform){
|
|
|
+ let reduceTime = res.data?.reduceTime;
|
|
|
+ if(!reduceTime){
|
|
|
that.setData({
|
|
|
carParkingRate:false
|
|
|
})
|
|
@@ -612,7 +611,7 @@ Page({
|
|
|
})
|
|
|
try{
|
|
|
that.setData({
|
|
|
- parkTime: parseFloat((dataSharePlatform.chargeUserId/ 3600).toFixed(2))
|
|
|
+ parkTime: parseFloat((reduceTime/ 3600).toFixed(2))
|
|
|
})
|
|
|
}catch(e){
|
|
|
that.setData({
|
|
@@ -755,10 +754,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
click_scan_control(scanResult,inner) {
|
|
|
- if(this.scanFlag){
|
|
|
+ if(this.data.scanFlag){
|
|
|
return;
|
|
|
}
|
|
|
- this.scanFlag = true;
|
|
|
+ this.data.scanFlag = true;
|
|
|
wx.showLoading({
|
|
|
title: '努力加载中...',
|
|
|
})
|
|
@@ -770,7 +769,7 @@ Page({
|
|
|
if (!this.data.isLogin) {
|
|
|
log.info('[首页]', '[未登陆跳转登录界面]');
|
|
|
let url = `/pages/login/phone_login/phone_login`;
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
wx.navigateTo({
|
|
|
url
|
|
@@ -796,7 +795,7 @@ Page({
|
|
|
} = data;
|
|
|
log.info('[首页]', '[获取用户是否有未支付订单]', '[响应]', data);
|
|
|
if (data && order && data.code == 200) {
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
log.info('[首页]', '[用户有未支付订单跳转订单支付界面]');
|
|
|
wx.showModal({
|
|
@@ -827,7 +826,7 @@ Page({
|
|
|
wx.pro.scanCode().then(d=>{
|
|
|
that.afterScanCode(d,that,inner)
|
|
|
}).catch(e=>{
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
});
|
|
|
}else{
|
|
@@ -839,7 +838,7 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
fail(e) {
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
getApp().showNetworkError();
|
|
|
}
|
|
@@ -885,7 +884,7 @@ Page({
|
|
|
success(res) {
|
|
|
log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
|
|
|
if (!res.data || res.data.code == 500) {
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
//没有该充电桩信息
|
|
|
wx.showModal({
|
|
@@ -916,13 +915,13 @@ Page({
|
|
|
});
|
|
|
log.info('[首页]', '[扫一扫充电桩空闲跳转去充电界面]');
|
|
|
let url = `/pages/scan_result/scan_result`;
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
});
|
|
|
}
|
|
|
- that.scanFlag = false;
|
|
|
+ that.data.scanFlag = false;
|
|
|
wx.hideLoading();
|
|
|
}
|
|
|
},
|
|
@@ -1058,9 +1057,8 @@ Page({
|
|
|
},
|
|
|
|
|
|
phoneCheck(){
|
|
|
-
|
|
|
-
|
|
|
if (this.data.userInfo.bindingPhone==0) {
|
|
|
+ wx.hideLoading();
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '当前账户未绑定手机号,请您进行手机号绑定操作',
|
|
@@ -1084,6 +1082,7 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
+ this.data.scanFlag = false;
|
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
|
let isLogin = wx.getStorageSync('isLogin');
|
|
|
// 页面显示
|