|
@@ -1,6 +1,3 @@
|
|
|
-import * as echarts from '../../ec-canvas/echarts';
|
|
|
-import * as lf from '../../ec-canvas/echarts-liquidfill';
|
|
|
-
|
|
|
|
|
|
let log = require('../../utils/log.js');
|
|
|
|
|
@@ -22,14 +19,20 @@ Page({
|
|
|
slowFree:0,
|
|
|
fastSum:0,
|
|
|
slowSum:0,
|
|
|
- pagesize:10,
|
|
|
+ pagesize:30,
|
|
|
pagenum:1,
|
|
|
+ ele_pagenum:1,
|
|
|
total:-1,
|
|
|
+ ele_total:-1,
|
|
|
loadTotal: 0,
|
|
|
dataLoading: false,
|
|
|
+ ele_dataLoading: false,
|
|
|
finishedLoadTap: 0,
|
|
|
+ ele_finishedLoadTap: 0,
|
|
|
finishedLoadShowTimes: 0,
|
|
|
+ ele_finishedLoadShowTimes: 0,
|
|
|
chargList: [],
|
|
|
+ ele_chargList: [],
|
|
|
seeInfoChargPile:{},
|
|
|
userInfo:{},
|
|
|
chargfeatureList:[],
|
|
@@ -39,7 +42,7 @@ Page({
|
|
|
carParkingRate: false,
|
|
|
|
|
|
parkTime: 0,
|
|
|
- scrollTop:0
|
|
|
+ activeTab: '0',
|
|
|
},
|
|
|
execParking(that,stationId){
|
|
|
wx.request({
|
|
@@ -160,26 +163,9 @@ Page({
|
|
|
chargid,
|
|
|
sumprice
|
|
|
});
|
|
|
- this.fastAndSlow()
|
|
|
- this.getPage();
|
|
|
- },
|
|
|
- fastAndSlow(e){
|
|
|
- let that = this;
|
|
|
- wx.request({
|
|
|
- url: getApp().globalData.postHeadAgreement +'/restapi/wechat/fastAndSlow',
|
|
|
- data: {
|
|
|
- id: that.data.chargid,
|
|
|
- },
|
|
|
- method: 'POST',
|
|
|
- success(res) {
|
|
|
- that.setData({
|
|
|
- fastFree : res.data.fastFree,
|
|
|
- slowFree : res.data.slowFree,
|
|
|
- fastSum : res.data.fastSum,
|
|
|
- slowSum : res.data.slowSum
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+ this.ori_getPage();
|
|
|
+ this.ele_getPage();
|
|
|
},
|
|
|
previewImage(e){
|
|
|
var that = this,
|
|
@@ -195,13 +181,113 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
getPage(){
|
|
|
+ let that = this;
|
|
|
+ if(that.activeTab=='1'){
|
|
|
+ that.ori_getPage();
|
|
|
+ }else{
|
|
|
+ that.ele_getPage();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ ori_getPage(){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if(this.data.chargList.length == this.data.total){
|
|
|
+ this.setData({
|
|
|
+ finishedLoadTap:this.data.finishedLoadTap+1
|
|
|
+ })
|
|
|
+ if(this.data.finishedLoadTap>0 && this.data.finishedLoadShowTimes==0){
|
|
|
+ this.setData({
|
|
|
+ finishedLoadShowTimes:this.data.finishedLoadShowTimes+1
|
|
|
+ })
|
|
|
+ wx.showToast({
|
|
|
+ title: '全部加载完毕',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.data.dataLoading){
|
|
|
+ return
|
|
|
+ }
|
|
|
this.setData({
|
|
|
- finishedLoadTap:this.data.finishedLoadTap+1
|
|
|
+ dataLoading: true
|
|
|
})
|
|
|
- if(this.data.finishedLoadTap>0 && this.data.finishedLoadShowTimes==0){
|
|
|
+ wx.showLoading({
|
|
|
+ title: '数据加载中....',
|
|
|
+ })
|
|
|
+
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ wx.request({
|
|
|
+ url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargInfo',
|
|
|
+ data: {
|
|
|
+ id: that.data.chargid,
|
|
|
+ pagenum: this.data.pagenum++,
|
|
|
+ ivType: 0,
|
|
|
+ pagesize: 30,
|
|
|
+ },
|
|
|
+ method: 'POST',
|
|
|
+ success(res) {
|
|
|
+ console.log(res);
|
|
|
+ let chargList = res.data.chargList.rows;
|
|
|
+
|
|
|
+ chargList.forEach(key => {
|
|
|
+ let chargstatusname = '';
|
|
|
+ let chargstatusclass = '';
|
|
|
+ if(key.chargstatus == 2){
|
|
|
+ chargstatusname='空闲中'
|
|
|
+ chargstatusclass = 'chargstatus_kxz'
|
|
|
+ }else if(key.chargstatus == 11){
|
|
|
+ chargstatusname='已插枪'
|
|
|
+ chargstatusclass = 'chargstatus_ycq'
|
|
|
+ }else if(key.chargstatus == 3 || key.chargstatus == 10){
|
|
|
+ chargstatusname='充电中'
|
|
|
+ chargstatusclass = 'chargstatus_cdz'
|
|
|
+ }else if(key.chargstatus == 0){
|
|
|
+ chargstatusname='离线'
|
|
|
+ chargstatusclass = 'chargstatus_lx'
|
|
|
+ }else{
|
|
|
+ chargstatusname='故障'
|
|
|
+ chargstatusclass = 'chargstatus_gz'
|
|
|
+ }
|
|
|
+ key.chargstatusname = chargstatusname;
|
|
|
+ key.chargstatusclass = chargstatusclass;
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(chargList);
|
|
|
+
|
|
|
+ wx.hideLoading()
|
|
|
+ that.setData({
|
|
|
+ chargList: that.data.chargList.concat(chargList),
|
|
|
+ total: res.data.chargList.total,
|
|
|
+ dataLoading: false,
|
|
|
+ fastFree : res.data.fastFree,
|
|
|
+ slowFree : res.data.slowFree,
|
|
|
+ fastSum : res.data.fastSum,
|
|
|
+ slowSum : res.data.slowSum
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ ele_getPage(){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(this.data.ele_chargList.length == this.data.ele_total){
|
|
|
+ this.setData({
|
|
|
+ ele_finishedLoadTap:this.data.ele_finishedLoadTap+1
|
|
|
+ })
|
|
|
+ if(this.data.ele_finishedLoadTap>0 && this.data.ele_finishedLoadShowTimes==0){
|
|
|
this.setData({
|
|
|
- finishedLoadShowTimes:this.data.finishedLoadShowTimes+1
|
|
|
+ ele_finishedLoadShowTimes:this.data.ele_finishedLoadShowTimes+1
|
|
|
})
|
|
|
wx.showToast({
|
|
|
title: '全部加载完毕',
|
|
@@ -212,27 +298,29 @@ Page({
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if(this.data.dataLoading){
|
|
|
+ if(this.data.ele_dataLoading){
|
|
|
return
|
|
|
}
|
|
|
this.setData({
|
|
|
- dataLoading: true
|
|
|
+ ele_dataLoading: true
|
|
|
})
|
|
|
wx.showLoading({
|
|
|
title: '数据加载中....',
|
|
|
})
|
|
|
+
|
|
|
let that = this;
|
|
|
+
|
|
|
wx.request({
|
|
|
url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargInfo',
|
|
|
data: {
|
|
|
id: that.data.chargid,
|
|
|
- pagenum: this.data.pagenum++,
|
|
|
- pagesize: 10,
|
|
|
+ pagenum: this.data.ele_pagenum++,
|
|
|
+ ivType: 1,
|
|
|
+ pagesize: 30,
|
|
|
},
|
|
|
method: 'POST',
|
|
|
success(res) {
|
|
|
console.log(res);
|
|
|
- console.log(that.data.pagenum+":num");
|
|
|
let chargList = res.data.chargList.rows;
|
|
|
|
|
|
chargList.forEach(key => {
|
|
@@ -262,91 +350,27 @@ Page({
|
|
|
|
|
|
wx.hideLoading()
|
|
|
that.setData({
|
|
|
- chargList: that.data.chargList.concat(chargList),
|
|
|
- total: res.data.total,
|
|
|
- dataLoading: false,
|
|
|
- fastFree : res.data.fastFree,
|
|
|
- slowFree : res.data.slowFree,
|
|
|
- fastSum : res.data.fastSum,
|
|
|
- slowSum : res.data.slowSum
|
|
|
+ ele_chargList: that.data.ele_chargList.concat(chargList),
|
|
|
+ ele_total: res.data.chargList.total,
|
|
|
+ ele_dataLoading: false,
|
|
|
+ ele_fastFree : res.data.fastFree,
|
|
|
+ ele_slowFree : res.data.slowFree,
|
|
|
+ ele_fastSum : res.data.fastSum,
|
|
|
+ ele_slowSum : res.data.slowSum
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- refreshPage: function(e) {
|
|
|
- wx.showLoading({
|
|
|
- title: '数据加载中....',
|
|
|
- })
|
|
|
+ goEleCarMap(e){
|
|
|
+ console.info("呼叫充电车");
|
|
|
let that = this;
|
|
|
- that.setData({
|
|
|
- pagenum:1
|
|
|
- });
|
|
|
- wx.request({
|
|
|
- url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargInfo',
|
|
|
- data: {
|
|
|
- id: that.data.chargid,
|
|
|
- pagenum: this.data.pagenum++,
|
|
|
- pagesize: 10,
|
|
|
- },
|
|
|
- method: 'POST',
|
|
|
- success(res) {
|
|
|
- let chargList = res.data.chargList.rows;
|
|
|
-
|
|
|
- chargList.forEach(key => {
|
|
|
- let chargstatusname = '';
|
|
|
- let chargstatusclass = '';
|
|
|
- if(key.chargstatus == 2){
|
|
|
- chargstatusname='空闲中'
|
|
|
- chargstatusclass = 'chargstatus_kxz'
|
|
|
- }else if(key.chargstatus == 11){
|
|
|
- chargstatusname='已插枪'
|
|
|
- chargstatusclass = 'chargstatus_ycq'
|
|
|
- }else if(key.chargstatus == 3 || key.chargstatus == 10){
|
|
|
- chargstatusname='充电中'
|
|
|
- chargstatusclass = 'chargstatus_cdz'
|
|
|
- }else if(key.chargstatus == 0){
|
|
|
- chargstatusname='离线'
|
|
|
- chargstatusclass = 'chargstatus_lx'
|
|
|
- }else{
|
|
|
- chargstatusname='故障'
|
|
|
- chargstatusclass = 'chargstatus_gz'
|
|
|
- }
|
|
|
- key.chargstatusname = chargstatusname;
|
|
|
- key.chargstatusclass = chargstatusclass;
|
|
|
- })
|
|
|
-
|
|
|
- console.log(chargList);
|
|
|
-
|
|
|
- wx.hideLoading()
|
|
|
- that.setData({
|
|
|
- chargList: chargList,
|
|
|
- total: res.data.total,
|
|
|
- dataLoading: false,
|
|
|
- fastFree : res.data.fastFree,
|
|
|
- slowFree : res.data.slowFree,
|
|
|
- fastSum : res.data.fastSum,
|
|
|
- slowSum : res.data.slowSum
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- wx.request({
|
|
|
- url: getApp().globalData.postHeadAgreement +'/restapi/wechat/fastAndSlow',
|
|
|
- data: {
|
|
|
- id: that.data.chargid,
|
|
|
- },
|
|
|
- method: 'POST',
|
|
|
- success(res) {
|
|
|
- that.setData({
|
|
|
- fastFree : res.data.fastFree,
|
|
|
- slowFree : res.data.slowFree,
|
|
|
- fastSum : res.data.fastSum,
|
|
|
- slowSum : res.data.slowSum
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- this.setData({
|
|
|
- scrollTop: 0
|
|
|
+ wx.setStorageSync('eleCarMapPage', {
|
|
|
+ chargid: that.data.chargid
|
|
|
+ })
|
|
|
+ let url = '/pages/charginfo/eleCarMap';
|
|
|
+ wx.navigateTo({
|
|
|
+ url
|
|
|
});
|
|
|
},
|
|
|
goScanResult(e){
|
|
@@ -601,6 +625,12 @@ Page({
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ toggleTabs(e){
|
|
|
+ let idx = e.currentTarget.dataset.idx;
|
|
|
+ this.setData({
|
|
|
+ activeTab: idx
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
*/
|