|
@@ -27,6 +27,8 @@ Page({
|
|
dataLoading: false,
|
|
dataLoading: false,
|
|
finishedLoadTap: 0,
|
|
finishedLoadTap: 0,
|
|
chargList: [],
|
|
chargList: [],
|
|
|
|
+ userInfo:{},
|
|
|
|
+ isLogin: false,
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -95,13 +97,13 @@ Page({
|
|
chargList.forEach(key => {
|
|
chargList.forEach(key => {
|
|
let chargstatusname = '';
|
|
let chargstatusname = '';
|
|
let chargstatusclass = '';
|
|
let chargstatusclass = '';
|
|
- if(key.chargstatus == '2'){
|
|
|
|
|
|
+ if(key.chargstatus == 2){
|
|
chargstatusname='空闲中'
|
|
chargstatusname='空闲中'
|
|
chargstatusclass = 'chargstatus_kxz'
|
|
chargstatusclass = 'chargstatus_kxz'
|
|
- }else if(key.chargstatus == '11'){
|
|
|
|
|
|
+ }else if(key.chargstatus == 11){
|
|
chargstatusname='已插枪'
|
|
chargstatusname='已插枪'
|
|
chargstatusclass = 'chargstatus_ycq'
|
|
chargstatusclass = 'chargstatus_ycq'
|
|
- }else if(key.chargstatus == '3' || key.chargstatus == '10'){
|
|
|
|
|
|
+ }else if(key.chargstatus == 3 || key.chargstatus == 10){
|
|
chargstatusname='充电中'
|
|
chargstatusname='充电中'
|
|
chargstatusclass = 'chargstatus_cdz'
|
|
chargstatusclass = 'chargstatus_cdz'
|
|
}else{
|
|
}else{
|
|
@@ -119,8 +121,8 @@ Page({
|
|
chargList: that.data.chargList.concat(chargList),
|
|
chargList: that.data.chargList.concat(chargList),
|
|
total: res.data.chargList.total,
|
|
total: res.data.chargList.total,
|
|
dataLoading: false,
|
|
dataLoading: false,
|
|
- fastFree : res.data.fastSum,
|
|
|
|
- slowFree : res.data.fastFree,
|
|
|
|
|
|
+ fastFree : res.data.fastFree,
|
|
|
|
+ slowFree : res.data.slowFree,
|
|
fastSum : res.data.fastSum,
|
|
fastSum : res.data.fastSum,
|
|
slowSum : res.data.slowSum
|
|
slowSum : res.data.slowSum
|
|
});
|
|
});
|
|
@@ -128,16 +130,38 @@ Page({
|
|
});
|
|
});
|
|
|
|
|
|
},
|
|
},
|
|
- goScanResult(){
|
|
|
|
|
|
+ goScanResult(e){
|
|
// scan_result
|
|
// scan_result
|
|
|
|
|
|
- wx.showLoading({
|
|
|
|
- title: '努力加载中...',
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ let {
|
|
|
|
+ keywords
|
|
|
|
+ } = e.currentTarget.dataset;
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
let isLogin = wx.getStorageSync('isLogin');
|
|
let isLogin = wx.getStorageSync('isLogin');
|
|
-
|
|
|
|
|
|
+ let chargid = keywords.chargPileId;
|
|
let that = this;
|
|
let that = this;
|
|
|
|
+
|
|
|
|
+ if(isLogin && userInfo.bindingPhone==0){
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '当前账户未绑定手机号,请您进行手机号绑定操作',
|
|
|
|
+ showCancel:false,
|
|
|
|
+ confirmText: '去绑定',
|
|
|
|
+ confirmColor:'#00AADD',
|
|
|
|
+ success: function (res1) {
|
|
|
|
+ let url = `/pages/bindPhone/bindPhone`;
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ wx.showLoading({
|
|
|
|
+ title: '努力加载中...',
|
|
|
|
+ })
|
|
|
|
+
|
|
if (!isLogin) {
|
|
if (!isLogin) {
|
|
log.info('[首页]', '[未登陆跳转登录界面]');
|
|
log.info('[首页]', '[未登陆跳转登录界面]');
|
|
let url = `/pages/login/login`;
|
|
let url = `/pages/login/login`;
|
|
@@ -258,7 +282,22 @@ Page({
|
|
* 生命周期函数--监听页面显示
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
*/
|
|
onShow: function(e) {
|
|
onShow: function(e) {
|
|
-
|
|
|
|
|
|
+ let userInfo = wx.getStorageSync('userInfo');
|
|
|
|
+ let isLogin = wx.getStorageSync('isLogin');
|
|
|
|
+ //console.log(userInfo);
|
|
|
|
+ // 页面显示
|
|
|
|
+ if (userInfo && isLogin) {
|
|
|
|
+ //userInfo.flag = true;
|
|
|
|
+ this.setData({
|
|
|
|
+ userInfo: userInfo,
|
|
|
|
+ isLogin: isLogin
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ //未登录信息
|
|
|
|
+ this.setData({
|
|
|
|
+ userInfo: {}
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|