|
@@ -20,6 +20,53 @@ Page({
|
|
|
keywords: null,
|
|
|
moneyPng: ''
|
|
|
},
|
|
|
+ resetchargStations(data){
|
|
|
+ let that = this
|
|
|
+ for(let i=0;i<data.length;i++){
|
|
|
+ let seeInfoChargPile = data[i];
|
|
|
+ let resultTable = seeInfoChargPile.resultList
|
|
|
+ that.resetResultList(resultTable);
|
|
|
+ that.resetResultData(resultTable,seeInfoChargPile)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resetResultData(resultList,data){
|
|
|
+ if(!resultList){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for(let i=0;i<resultList.length;i++){
|
|
|
+ if(resultList[i].currentTime){
|
|
|
+ data.chargprice = resultList[i].elecPrice
|
|
|
+ data.serviceprice = resultList[i].serviceprice
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ resetResultList(resultList){
|
|
|
+ let that = this
|
|
|
+ if(!resultList){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ resultList.forEach(item=>{
|
|
|
+ item["sumPrice"] = that.resetResultListSumPrice(item);
|
|
|
+ if(!item.elecPrice){
|
|
|
+ item["elecPrice"] = '暂无费用'
|
|
|
+ }
|
|
|
+ if(!item.servicePrice){
|
|
|
+ item["servicePrice"] = '暂无费用'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetResultListSumPrice(item){
|
|
|
+
|
|
|
+ if(!item.elecPrice){
|
|
|
+ return '暂无费用'
|
|
|
+ }
|
|
|
+ if(!item.servicePrice){
|
|
|
+ return '暂无费用'
|
|
|
+ }
|
|
|
+ return parseFloat((item.elecPrice + item.servicePrice).toFixed(6))
|
|
|
+ },
|
|
|
+
|
|
|
onLoad(e) {
|
|
|
let {
|
|
|
city,
|
|
@@ -67,7 +114,7 @@ Page({
|
|
|
},
|
|
|
method: 'POST',
|
|
|
success(res) {
|
|
|
-
|
|
|
+ that.resetchargStations(res.data)
|
|
|
//userInfo.flag = true;
|
|
|
if (isLogin && userInfo.flag) {
|
|
|
wx.request({
|
|
@@ -254,10 +301,7 @@ Page({
|
|
|
},
|
|
|
method: 'POST',
|
|
|
success(res) {
|
|
|
- var chargPile = res.data;
|
|
|
- let resultTable = chargPile.resultList
|
|
|
- that.resetResultList(resultTable);
|
|
|
- that.resetResultData(resultTable,chargPile)
|
|
|
+ that.resetchargStations(res.data)
|
|
|
//userInfo.flag = true;
|
|
|
if (isLogin && userInfo.flag) {
|
|
|
wx.request({
|