|
@@ -27,6 +27,8 @@ Page({
|
|
|
dataLoading: false,
|
|
|
finishedLoadTap: 0,
|
|
|
chargList: [],
|
|
|
+ userInfo:{},
|
|
|
+ isLogin: false,
|
|
|
},
|
|
|
|
|
|
|
|
@@ -95,13 +97,13 @@ Page({
|
|
|
chargList.forEach(key => {
|
|
|
let chargstatusname = '';
|
|
|
let chargstatusclass = '';
|
|
|
- if(key.chargstatus == '2'){
|
|
|
+ if(key.chargstatus == 2){
|
|
|
chargstatusname='空闲中'
|
|
|
chargstatusclass = 'chargstatus_kxz'
|
|
|
- }else if(key.chargstatus == '11'){
|
|
|
+ }else if(key.chargstatus == 11){
|
|
|
chargstatusname='已插枪'
|
|
|
chargstatusclass = 'chargstatus_ycq'
|
|
|
- }else if(key.chargstatus == '3' || key.chargstatus == '10'){
|
|
|
+ }else if(key.chargstatus == 3 || key.chargstatus == 10){
|
|
|
chargstatusname='充电中'
|
|
|
chargstatusclass = 'chargstatus_cdz'
|
|
|
}else{
|
|
@@ -119,8 +121,8 @@ Page({
|
|
|
chargList: that.data.chargList.concat(chargList),
|
|
|
total: res.data.chargList.total,
|
|
|
dataLoading: false,
|
|
|
- fastFree : res.data.fastSum,
|
|
|
- slowFree : res.data.fastFree,
|
|
|
+ fastFree : res.data.fastFree,
|
|
|
+ slowFree : res.data.slowFree,
|
|
|
fastSum : res.data.fastSum,
|
|
|
slowSum : res.data.slowSum
|
|
|
});
|
|
@@ -128,16 +130,38 @@ Page({
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- goScanResult(){
|
|
|
+ goScanResult(e){
|
|
|
// scan_result
|
|
|
|
|
|
- wx.showLoading({
|
|
|
- title: '努力加载中...',
|
|
|
- })
|
|
|
+
|
|
|
+ let {
|
|
|
+ keywords
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
let userInfo = wx.getStorageSync('userInfo');
|
|
|
let isLogin = wx.getStorageSync('isLogin');
|
|
|
-
|
|
|
+ let chargid = keywords.chargPileId;
|
|
|
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) {
|
|
|
log.info('[首页]', '[未登陆跳转登录界面]');
|
|
|
let url = `/pages/login/login`;
|
|
@@ -258,7 +282,22 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
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: {}
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|