Przeglądaj źródła

修复被覆盖掉的相关代码以及注释相关功能

jiuling 3 miesięcy temu
rodzic
commit
5325a472bf

+ 52 - 10
pages/charginfo/charginfo.js

@@ -1,3 +1,6 @@
+import * as echarts from '../../ec-canvas/echarts';
+import * as lf from '../../ec-canvas/echarts-liquidfill';
+
 
 let log = require('../../utils/log.js');
 
@@ -19,7 +22,7 @@ Page({
     slowFree:0,
     fastSum:0,
     slowSum:0,
-    pagesize:30,
+    pagesize:10,
     pagenum:1,
     ele_pagenum:1,
     total:-1,
@@ -43,6 +46,7 @@ Page({
     // 停车时间
     parkTime: 0,
     activeTab: '0',
+    scrollTop:0
   },
   execParking(that,stationId){
     wx.request({
@@ -163,10 +167,29 @@ Page({
       chargid,
       sumprice
     });
- 
+    this.fastAndSlow()
     this.ori_getPage();
     this.ele_getPage();
   },
+  fastAndSlow(e){
+    let that = this;
+    wx.request({
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/fastAndSlow',
+      data: {
+        id: that.data.chargid,
+        ivType: 3,//统计桩和电池
+      },
+      method: 'POST',
+      success(res) {
+        that.setData({
+          fastFree : res.data.fastFree,
+          slowFree : res.data.slowFree,
+          fastSum : res.data.fastSum,
+          slowSum : res.data.slowSum
+        });
+      }
+    });
+  },
   previewImage(e){
     var that = this,
     //获取当前图片的下表
@@ -182,12 +205,11 @@ Page({
   },
   getPage(){
     let that = this;
-    if(that.activeTab=='1'){
+    if(that.__data__.activeTab=='0'){
         that.ori_getPage();
     }else{
         that.ele_getPage();
     }
-
   },
 
   ori_getPage(){
@@ -221,7 +243,6 @@ Page({
       wx.showLoading({
         title: '数据加载中....',
       })
-  
     let that = this;
       // 充电桩
       wx.request({
@@ -230,7 +251,7 @@ Page({
           id: that.data.chargid,
           pagenum: this.data.pagenum++,
           ivType: 0,
-          pagesize: 30,
+          pagesize: 10,
         },
         method: 'POST',
         success(res) {
@@ -265,13 +286,14 @@ Page({
           wx.hideLoading()
           that.setData({
             chargList: that.data.chargList.concat(chargList),
-            total: res.data.chargList.total,
+            total: res.data.total,
             dataLoading: false,
             fastFree : res.data.fastFree,
             slowFree : res.data.slowFree,
             fastSum : res.data.fastSum,
             slowSum : res.data.slowSum
           });
+          console.log("that.data:",that.data);
         }
       });
   },
@@ -307,8 +329,10 @@ Page({
     wx.showLoading({
       title: '数据加载中....',
     })
-
-  let that = this;
+    let that = this;
+    // that.setData({
+    //   pagenum:1
+    // });
     // 充电桩
     wx.request({
       url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargInfo',
@@ -316,7 +340,7 @@ Page({
         id: that.data.chargid,
         pagenum: this.data.ele_pagenum++,
         ivType: 1,
-        pagesize: 30,
+        pagesize: 10,
       },
       method: 'POST',
       success(res) {
@@ -358,10 +382,27 @@ Page({
           ele_fastSum : res.data.fastSum,
           ele_slowSum : res.data.slowSum
         });
+        console.log("that.setData:",that.data);
       }
     });
 
   },
+  refreshPage: function(e) {
+    wx.showLoading({
+      title: '数据加载中....',
+    })
+    let that = this;
+    that.setData({
+      pagenum:1
+    });
+    this.getPage()
+    that.fastAndSlow()
+    that.setData({
+      scrollTop: 0
+    });
+    wx.hideLoading()
+  },
+
   goEleCarMap(e){
     console.info("呼叫充电车");
     let that = this;
@@ -646,6 +687,7 @@ Page({
   },
   bindScrollTolowerEvent: function(){
     this.getPage();
+    console.log("触发滚动");
   },
   /**
    * 页面相关事件处理函数--监听用户下拉动作

+ 6 - 2
pages/charginfo/charginfo.wxml

@@ -96,12 +96,15 @@
   </view>
 
   <view class="title_list">终端列表</view>
+    <view  bindtap="refreshPage">
+      <image class= "refreshPage" src="/images/refresh.png"></image>
+    </view>
   <view class="tabList">
     <view data-idx="0" class="tab {{activeTab=='0'?'active':''}}" bindtap="toggleTabs">充电桩</view>
     <view data-idx="1" class="tab {{activeTab=='1'?'active':''}}" bindtap="toggleTabs">机器人充电车</view>
   </view>
 
-  <scroll-view class='context' scroll-y='true' bindscrolltolower="bindScrollTolowerEvent" >
+  <scroll-view class='context' scroll-y='true' bindscrolltolower="bindScrollTolowerEvent" id="scrollview" scrollTop="{{scrollTop}}">
     <!-- 充电桩 start -->
     <view wx:if="{{activeTab=='0'}}" class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{chargList}}" data-idx="{{item}}" bindtap="{{userInfo.flag ?'chargingLog':''}}">
       <view class="runstatus {{item.chargstatusclass}}">
@@ -121,7 +124,8 @@
     <!--
     <view wx:if="{{activeTab=='1'}}" class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{ele_chargList}}" data-idx="{{item}}" bindtap="{{userInfo.flag ?'chargingLog':''}}">
     -->
-    <view wx:if="{{activeTab=='1'}}" class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{ele_chargList}}" data-idx="{{item}}" bindtap="goEleCarMap">
+    <!-- <view wx:if="{{activeTab=='1'}}" class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{ele_chargList}}" data-idx="{{item}}" bindtap="goEleCarMap"> 取消机器人详情点击事件 -->
+      <view wx:if="{{activeTab=='1'}}" class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{ele_chargList}}" data-idx="{{item}}">
       <view class="runstatus {{item.chargstatusclass}}">
       <view class="runstatus_inner ">{{item.chargstatusname}}</view>
       </view>

+ 11 - 3
pages/charginfo/charginfo.wxss

@@ -185,9 +185,9 @@ text.price {
 .charg{
   position: relative;
   height: 150rpx;
-  width: calc(100% - 30rpx);
+  width: calc(100% - 12rpx);
   border-radius: 20rpx;
-  margin: 12rpx 15rpx;
+  margin: 12rpx 8rpx;
   background: #FFFFFF;
   flex-direction: row;
   display: flex;
@@ -382,7 +382,15 @@ text.price {
     color: #9d9d9d;
     margin: 0;
 }
-
+.refreshPage{
+  width: 70rpx;
+  height: 70rpx;
+  /* float: right; */
+  z-index: 999;
+  position: absolute;
+  right: 5px;
+  bottom: 25px;
+}
 .tabList{
     height: 100rpx;
     width: 100%;

+ 2 - 2
pages/ucenter/index/index.wxml

@@ -169,7 +169,7 @@
         </view>
       </view>
 
-      <view class="zan-cell"  wx:if='{{userInfo.flag==null?1:!userInfo.flag}}' hover-class="active" bindtap="goBatteryControl">
+      <!-- <view class="zan-cell"  wx:if='{{userInfo.flag==null?1:!userInfo.flag}}' hover-class="active" bindtap="goBatteryControl">
         <view class="zan-icon">
           <image src='/images/column.png'></image>
         </view>
@@ -190,7 +190,7 @@
         <view class="zan-ft">
           <image src='/images/enter.png'></image>
         </view>
-      </view>
+      </view> -->
 
 
       <view class="zan-cell" hover-class="active" bindtap="goAgreement">