|
@@ -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');
|
|
|
|
|
@@ -24,12 +21,18 @@ Page({
|
|
|
slowSum:0,
|
|
|
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:[],
|
|
@@ -161,7 +164,8 @@ Page({
|
|
|
sumprice
|
|
|
});
|
|
|
|
|
|
- this.getPage();
|
|
|
+ this.ori_getPage();
|
|
|
+ this.ele_getPage();
|
|
|
},
|
|
|
previewImage(e){
|
|
|
var that = this,
|
|
@@ -177,14 +181,113 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
getPage(){
|
|
|
+ let that = this;
|
|
|
+ if(that.activeTab=='1'){
|
|
|
+ that.ori_getPage();
|
|
|
+ }else{
|
|
|
+ that.ele_getPage();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
+ ori_getPage(){
|
|
|
+ // ivType
|
|
|
+ // 是否为无人车充电站(0否;1是)
|
|
|
+ // 0:桩
|
|
|
+ // 1:电池
|
|
|
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
|
|
|
+ })
|
|
|
+ wx.showLoading({
|
|
|
+ title: '数据加载中....',
|
|
|
})
|
|
|
- if(this.data.finishedLoadTap>0 && this.data.finishedLoadShowTimes==0){
|
|
|
+
|
|
|
+ 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);
|
|
|
+ // that.rechargeTimeOrder(chargemoneylogs);
|
|
|
+ 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(){
|
|
|
+ // ivType
|
|
|
+ // 是否为无人车充电站(0否;1是)
|
|
|
+ // 0:桩
|
|
|
+ // 1:电池
|
|
|
+ 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: '全部加载完毕',
|
|
@@ -195,22 +298,24 @@ 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++,
|
|
|
+ pagenum: this.data.ele_pagenum++,
|
|
|
+ ivType: 1,
|
|
|
pagesize: 30,
|
|
|
},
|
|
|
method: 'POST',
|
|
@@ -245,18 +350,29 @@ Page({
|
|
|
// that.rechargeTimeOrder(chargemoneylogs);
|
|
|
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_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
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
+ goEleCarMap(e){
|
|
|
+ console.info("呼叫充电车");
|
|
|
+ let that = this;
|
|
|
+ wx.$bus.emit('eleCarMapPage', {
|
|
|
+ chargid: that.data.chargid
|
|
|
+ })
|
|
|
+ let url = '/pages/charginfo/eleCarMap';
|
|
|
+ wx.navigateTo({
|
|
|
+ url
|
|
|
+ });
|
|
|
+ },
|
|
|
goScanResult(e){
|
|
|
// scan_result
|
|
|
|