Ver Fonte

临时调试完成

XWookey há 7 meses atrás
pai
commit
df90c8dbf9

+ 5 - 1
app.json

@@ -52,7 +52,11 @@
     "pages/ucenter/yuyt/yuyt",
     "pages/ucenter/car/chooseCar",
     "pages/ucenter/car/chooseAndBindCar",
-    "pages/ucenter/charginglog/opsCharginglog"
+    "pages/ucenter/charginglog/opsCharginglog",
+    "pages/ucenter/control/carControl",
+    "pages/ucenter/control/batteryControl",
+    "pages/scan_result/elpackage",
+    "pages/batteryPack/batteryPackWait"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 184 - 0
components/circle-progress/circle-progress.js

@@ -0,0 +1,184 @@
+// components/circle/circle.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    // 新增一个进度百分比属性,外部可通过此属性传递进度值
+    progress: {
+      type: Number,
+      value: 0,
+      observer(newVal) {
+        this.updateProgress(newVal);
+      }
+    },
+    disabled: {
+        type: Boolean,
+        value: false,
+        observer(newVal) {
+          this.updateDisabled(newVal);
+        }
+      },
+    width: {
+        type: Number,
+        value: 100,
+        observer(newVal) {
+            this.updateWidth(newVal);
+        }
+    },
+    r: {
+        type: Number,
+        value: 90,
+        observer(newVal) {
+            this.updateR(newVal);
+        }
+    },
+    lw: {
+        type: Number,
+        value: 5,
+        observer(newVal) {
+            this.updateLw(newVal);
+        }
+    },
+  },
+
+  
+    /**
+     * 组件的初始数据
+     */
+    data: {
+      progress_txt: '加载中...', // 提示文字
+      progress: 0,
+      disabled: false,
+      width:110,
+      r:110,
+      lw:7,
+    },
+  
+    lifetimes: {
+      attached() {
+        // 组件加载后准备绘制
+        this.initCanvas();
+      },
+    },
+  
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+      /**
+       * 初始化 Canvas 上下文
+       */
+      initCanvas() {
+        // 获取两个canvas元素的上下文
+        this.bgContext = wx.createCanvasContext('canvasProgressbg', this);
+        this.progressContext = wx.createCanvasContext('canvasProgress', this);
+        this.drawProgressbg();
+        this.drawCircle(this.data.progress);
+      },
+  
+      /**
+       * 画progress底部背景
+       */
+      drawProgressbg() {
+        let w = this.data.width;
+        let r = this.data.r;
+        let lw = this.data.lw;
+
+        this.progressContext.setFillStyle('#FFFFFF');
+        this.progressContext.beginPath();
+        this.progressContext.arc(w, w, r, 0, 2 * Math.PI, false);
+        this.progressContext.fill();
+
+        this.bgContext.setLineWidth(lw);
+        this.bgContext.setStrokeStyle('#FFFFFF');
+        this.bgContext.setLineCap('round');
+        this.bgContext.beginPath();
+        this.bgContext.arc(w, w, r, 0, 2 * Math.PI, false);
+        this.bgContext.stroke();
+        this.bgContext.draw(false, () => {}); // 第二个参数用于兼容旧版API,新版不需要传入回调函数
+
+        this.progressContext.setFillStyle('red');
+
+
+    
+
+
+      },
+
+      /**
+      * 更新并画progress进度
+      */
+      updateProgress(progressPercentage) {
+        this.setData({
+            progress:progressPercentage
+        })
+        //const normalizedProgress = (progressPercentage / 100) * 2; // 转换成弧度,最大值为2(对应100%)
+        if(this.progressContext){
+            this.drawCircle(this.data.progressPercentage);
+        }
+      },
+            /**
+      * 更新并画disabled
+      */
+     updateDisabled(dis) {
+        this.setData({
+            disabled:dis
+        })
+        //const normalizedProgress = (progressPercentage / 100) * 2; // 转换成弧度,最大值为2(对应100%)
+        if(this.progressContext){
+            this.drawCircle(this.data.progressPercentage);
+        }
+      }, 
+                  /**
+      * 更新并画disabled
+      */
+     updateWidth(dis) {
+        this.setData({
+            width:dis
+        })
+        //const normalizedProgress = (progressPercentage / 100) * 2; // 转换成弧度,最大值为2(对应100%)
+        if(this.progressContext){
+            this.drawCircle(this.data.progressPercentage);
+        }
+      }, 
+      updateR(dis) {
+        this.setData({
+            r:dis
+        })
+        //const normalizedProgress = (progressPercentage / 100) * 2; // 转换成弧度,最大值为2(对应100%)
+        if(this.progressContext){
+            this.drawCircle(this.data.progressPercentage);
+        }
+      },
+      updateLw(dis) {
+        this.setData({
+            r:dis
+        })
+        //const normalizedProgress = (progressPercentage / 100) * 2; // 转换成弧度,最大值为2(对应100%)
+        if(this.progressContext){
+            this.drawCircle(this.data.progressPercentage);
+        }
+      },
+      /**
+       * 画progress进度
+       */
+      drawCircle(step) {
+        step = step * 2 / 100;
+        let w = this.data.width;
+        let r = this.data.r;
+        let lw = this.data.lw;
+        this.progressContext.setLineWidth(lw+1);
+        this.progressContext.setStrokeStyle(this.data.disabled?'#B6B3C1':'#21ADFF');
+        this.progressContext.setLineCap('round');
+        this.progressContext.beginPath();
+        this.progressContext.arc(w, w, r, -Math.PI / 2, step * Math.PI - Math.PI / 2, false);
+        this.progressContext.stroke();
+        this.progressContext.draw(false, () => {}); // 同样添加false参数
+        this.setData({
+            progress_txt:this.data.progress + "%"
+        })
+      },
+  
+    }
+  })

+ 4 - 0
components/circle-progress/circle-progress.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 14 - 0
components/circle-progress/circle-progress.wxml

@@ -0,0 +1,14 @@
+<!--components/circle/circle.wxml-->
+
+<view class='container'>
+  <view class='progress_box'>
+    <!-- 绘制圆环背景 -->
+    <canvas class="progress_bg" canvas-id="canvasProgressbg" />
+    <!-- 绘制加载中圆弧 -->
+    <canvas class="progress_canvas" canvas-id="canvasProgress" /> 
+    <!-- 绘制圆弧中心提示文字 -->
+    <view class="progress_text">
+      <text class="progress_info {{disabled?'dis':''}}"> {{progress_txt}}</text>
+    </view>
+  </view>
+</view>

+ 65 - 0
components/circle-progress/circle-progress.wxss

@@ -0,0 +1,65 @@
+/* components/circle/circle.wxss */
+
+.container {
+    position: relative;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    margin:0;
+    padding:0;
+    /* background-color: #34343d; */
+  }
+   
+  .progress_box {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background-color: transparent;
+    margin:0;
+    padding:0;
+  }
+   
+  .progress_bg {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    margin:0;
+    padding:0;
+  }
+   
+  .progress_canvas {
+    width: 100%;
+    height: 100%;
+    margin:0;
+    padding:0;
+  }
+   
+  .progress_text {
+    position: absolute;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width:100%;
+    margin:0;
+    padding:0;
+  }
+   
+  .progress_info {
+    font-size: 12rpx;
+    text-align: center;
+    /* letter-spacing: 2rpx; */
+    color: #21ADFF;
+    margin:0;
+    padding:0;
+  }
+  .progress_info.dis {
+    color: #B6B3C1;
+    margin:0;
+    padding:0;
+  }

BIN
images/chargingCarIcon.png


+ 66 - 0
pages/batteryPack/batteryPackWait.js

@@ -0,0 +1,66 @@
+// pages/batteryPack/batteryPackWait.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
pages/batteryPack/batteryPackWait.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": ""
+}

+ 10 - 0
pages/batteryPack/batteryPackWait.wxml

@@ -0,0 +1,10 @@
+<!--pages/batteryPack/batteryPackWait.wxml-->
+<image class="car" src='/images/chargingCarIcon.png'></image>
+<view class="txt">智能充电车调度中, 请等待!!</view>
+<view class="loading">
+    <view class="loader-circle"></view>
+    <view class="loader-circle"></view>
+    <view class="loader-circle"></view>
+    <view class="loader-circle"></view>
+    <view class="loader-circle"></view>
+</view>

+ 71 - 0
pages/batteryPack/batteryPackWait.wxss

@@ -0,0 +1,71 @@
+/* pages/batteryPack/batteryPackWait.wxss */
+page{
+    display: flex;
+    flex-direction: column;
+}
+.car{
+    margin-top:5%;
+    width:100%;
+    padding: 0;
+}
+.txt{
+    /* color: rgba(33, 173, 255, 1); */
+    font-size: 40rpx;
+    text-align: center;
+}
+.loading{
+    margin-top:10%;
+    height:40rpx;
+    display: flex;
+    justify-content: space-between;
+    width: 30%;
+    margin-left: 35%;
+}
+
+
+.loading .loader-circle {
+    width: 20rpx;
+    height: 20rpx;
+    border-radius: 50%;
+    background-color: #93dffb; /*淡蓝*/
+    animation-duration: 2s;
+    animation-name: loadingCircle;
+    animation-iteration-count: infinite;
+    animation-timing-function: ease-in-out;
+    opacity: 0;
+}
+
+@keyframes loadingCircle {
+    0%, 100% {
+        transform: scale(1);
+        opacity: 0.5;
+    }
+    16.67% { /* 每个元素动画开始的时间点 */
+        opacity: 0.5;
+    }
+    33.33% {
+        transform: scale(1.3);
+        background-color: #27bef7; /*深蓝*/
+    }
+    50% {
+        transform: scale(1.6);
+        opacity: 0.9;
+    }
+}
+
+/* 确保每个圆按照顺序开始动画 */
+.loading .loader-circle:nth-child(1) {
+    animation-delay: 0s;
+}
+.loading .loader-circle:nth-child(2) {
+    animation-delay: 0.2s;
+}
+.loading .loader-circle:nth-child(3) {
+    animation-delay: 0.4s;
+}
+.loading .loader-circle:nth-child(4) {
+    animation-delay: 0.6s;
+}
+.loading .loader-circle:nth-child(5) {
+    animation-delay: 0.8s;
+}

+ 7 - 0
pages/charginfo/charginfo.js

@@ -39,6 +39,7 @@ Page({
     carParkingRate: false,
     // 停车时间
     parkTime: 0,
+    activeTab: '0',
   },
   execParking(that,stationId){
     wx.request({
@@ -508,6 +509,12 @@ Page({
       })
   
   },
+  toggleTabs(e){
+    let idx = e.currentTarget.dataset.idx;
+    this.setData({
+        activeTab: idx
+    })
+  },
   /**
    * 生命周期函数--监听页面隐藏
    */

+ 24 - 2
pages/charginfo/charginfo.wxml

@@ -96,9 +96,14 @@
   </view>
 
   <view class="title_list">终端列表</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" >
-    <view class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{chargList}}" data-idx="{{item}}" bindtap="{{userInfo.flag ?'chargingLog':''}}">
+    <!-- 充电桩 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}}">
       <view class="runstatus_inner ">{{item.chargstatusname}}</view>
       </view>
@@ -109,8 +114,25 @@
       <view class="iconCard" >
         <view class="icon {{item.pileType=='慢充'?'slowBar':'fastBar'}}">{{item.pileType=='慢充'?'慢':'快'}}</view>
       </view>
-      
     </view>
+    <!-- 充电桩 end  -->
+
+    <!-- 机器人充电车 start -->
+    <view wx:if="{{activeTab=='1'}}" class="charg"  hover-class='active' wx:key='{{key}}' wx:for="{{chargList}}" data-idx="{{item}}" bindtap="{{userInfo.flag ?'chargingLog':''}}">
+      <view class="runstatus {{item.chargstatusclass}}">
+      <view class="runstatus_inner ">{{item.chargstatusname}}</view>
+      </view>
+      <view class="chargInfo_v">
+      <view class="chargInfo_v_name">{{item.chargPileName}}</view>
+      <view class="chargInfo_v_id"><text style="width:300rpx">{{item.chargPileId}}</text><text wx:if="{{!item.openStatus}}" decode="{{true}}" space="nbsp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</text><text wx:if="{{!userInfo.flag && item.openStatus}}" class="seeReservation" bindtap="seeReservation" bindtap="seeReservation"  data-idx="{{item}}">查看预约</text><text class="startpower" wx:if="{{!userInfo.flag && item.chargstatusname=='已插枪'}}"  data-keywords="{{item}}"  bindtap="{{(!userInfo.flag && item.chargstatusname=='已插枪')?'goScanResult':''}}">呼叫充电车 ></text></view>
+      </view>
+      <view class="iconCard" >
+        <view class="icon {{item.pileType=='慢充'?'slowBar':'fastBar'}}">{{item.pileType=='慢充'?'慢':'快'}}</view>
+      </view>
+    </view>
+    <!-- 机器人充电车 end  -->
+
+
     <view class = "bottomm"></view>
   </scroll-view>
 

+ 21 - 2
pages/charginfo/charginfo.wxss

@@ -185,9 +185,9 @@ text.price {
 .charg{
   position: relative;
   height: 150rpx;
-  width: calc(100% - 12rpx);
+  width: calc(100% - 30rpx);
   border-radius: 20rpx;
-  margin: 12rpx 8rpx;
+  margin: 12rpx 15rpx;
   background: #FFFFFF;
   flex-direction: row;
   display: flex;
@@ -381,4 +381,23 @@ text.price {
     min-height: 42rpx;
     color: #9d9d9d;
     margin: 0;
+}
+
+.tabList{
+    height: 100rpx;
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    color:#848484;
+}
+
+.tabList .tab{
+    height: 100rpx;
+    width: 50%;
+    line-height: 100rpx;
+    text-align: center;
+}
+
+.tabList .tab.active{
+    color: #21ADFF;
 }

+ 535 - 0
pages/scan_result/elpackage.js

@@ -0,0 +1,535 @@
+// pages/scan_result/elpackage.js
+let log = require('../../utils/log.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    progressPercentage: 100, // 初始进度值为50%
+    // chargPile: null,
+    chargPile: true,
+    orderid: null,
+    userId: null,
+    repaidbalance: 0,
+    resultTable: [],
+    // 是否减免停车费
+    carParkingRate: false,
+    // 停车时间
+    parkTime: 0,
+    url:'/images/scan_result.png',
+    authStatus: 1,
+    defPlateNumber:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let that = this;
+    wx.getStorage({
+      key: 'scan_chargpile',
+      success: function (res) {
+        console.log(res);
+        //console.log(res.data);
+        var chargPile = res.data;
+        let authStatus = chargPile.authStatus
+        let resultTable = chargPile.resultList
+        that.resetResultList(resultTable)
+        that.setData({
+          resultTable,
+          authStatus
+        })
+        chargPile.sharpTotalPrice = parseFloat((chargPile.sharpChargPrice + chargPile.sharpServicePrice).toFixed(6));
+        chargPile.peakTotalPrice = parseFloat((chargPile.peakChargPrice + chargPile.peakServicePrice).toFixed(6));
+        chargPile.flatTotalPrice = parseFloat((chargPile.flatChargPrice + chargPile.flatServicePrice).toFixed(6));
+        chargPile.valleyTotalPrice = parseFloat((chargPile.valleyChargPrice + chargPile.valleyServicePrice).toFixed(6));
+        chargPile.totalprice = parseFloat((chargPile.chargprice + chargPile.serviceprice).toFixed(6));
+        that.setData({
+          chargPile
+        });
+        //console.log(chargPile);
+
+        // 更新是否减停车费
+        that.execParking(that,chargPile)
+
+
+        wx.removeStorage({
+          key: 'scan_chargpile',
+          success(res) {
+            console.log(res);
+          }
+        });
+        log.info('[扫码]', '[加载完成]', '[参数]', res.data);
+		let userInfo = wx.getStorageSync('userInfo');
+		wx.request({
+		  url: getApp().globalData.postHeadAgreement + '/restapi/wechat/syncUser',
+		  data: {
+			loginName: userInfo.loginName
+		  },
+		  method: 'POST',
+		  success: function (res) {
+			let {
+			  data
+			} = res;
+			log.info('[扫码]', '[同步用户数据]', '[响应]', data);
+			console.info('[扫码]', '[同步用户数据]', '[响应]', data);
+			if (data.code && data.code != 200) {
+			  log.info('[扫码]', '[同步用户数据]', '[失败data null||data.code<>200跳转登陆界面]', data);
+			} else {
+			  that.setData({
+				repaidbalance:data.repaidbalance
+			  });
+			}
+		  },
+		  fail(e) {
+			console.log("用户数据同步失败");
+			log.info('[扫码]', '[同步用户数据]', '[fail]', e);
+		  }
+    });
+    
+
+
+
+      }
+    });
+  },
+  execParking(that,chargPile){
+    let stationId = chargPile.chargStationId;
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/carParkingRate?stationId=' + stationId,
+      // data: {
+      // loginName: userInfo.loginName
+      // },
+      method: 'POST',
+      success: function (res) {
+        // 是否减免停车费
+        // carParkingRate: false,
+        // parkTime: 0,
+        console.info(res)
+        let reduceTime = res.data?.reduceTime;
+        if(!reduceTime){
+          that.setData({
+            carParkingRate:false
+          })
+          return;
+        }
+        that.setData({
+          carParkingRate:true
+        })
+        try{
+          that.setData({
+            parkTime: parseFloat((reduceTime/ 3600).toFixed(2))
+          })
+        }catch(e){
+          that.setData({
+            carParkingRate:false
+          })
+        }
+
+      },
+      fail(e) {
+      console.log("用户数据同步失败");
+      log.info('[扫码]', '[同步用户数据]', '[fail]', e);
+      }
+    });
+
+  },
+
+  beginChargeInner(that,plateNumber){
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    // 扫码启动
+    wx.showLoading({
+      title: '开启充电中...',
+      mask: true
+    });
+    log.info('[扫码]', '[开始充电流程]');
+    //同步用户数据
+    log.info('[扫码]', '[同步用户数据]', '[请求]', {
+      loginName: userInfo.loginName
+    });
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/syncUser',
+      data: {
+        loginName: userInfo.loginName,
+      },
+      method: 'POST',
+      success: function (res) {
+        wx.hideLoading();
+        let {
+          data
+        } = res;
+
+
+        log.info('[扫码]', '[同步用户数据]', '[响应]', data);
+        console.info('[扫码]', '[同步用户数据]', '[响应]', data);
+        if (data.code && data.code != 200) {
+          wx.removeStorageSync('userInfo');
+          wx.removeStorageSync('isLogin');
+          let url = '/pages/login/phone_login/phone_login';
+          wx.redirectTo({
+            url,
+          });
+          log.info('[扫码]', '[同步用户数据]', '[失败data null||data.code<>200跳转登陆界面]', data);
+        } else {
+          wx.setStorageSync('userInfo', data);
+          wx.setStorageSync('isLogin', true);
+          let repaidbalance = data.repaidbalance;
+          that.setData({
+            repaidbalance
+          });
+          //开始充电
+          if(data.bindingPhone==0){
+            wx.showModal({
+              title: '提示',
+              content: '您未绑定手机号,请重新登录后自动刷新绑定信息',
+              confirmText: '去登录',
+              showCancel:false,
+              confirmColor:'#00AADD',
+              success: function (res1) {
+                if (res1.confirm) {
+                  wx.removeStorageSync('userInfo');
+                  wx.removeStorageSync('isLogin');
+                  let url = '/pages/login/phone_login/phone_login';
+                  wx.redirectTo({
+                    url
+                  })
+                }
+              }
+            });
+            log.info('[扫码]', '[同步用户数据]', '[未绑定手机号]', data);
+          }else if (!data.repaidbalance || data.repaidbalance <= 0) {
+            wx.showModal({
+              showCancel: false,
+              content: '余额不足,请充值!',
+              confirmColor:'#00AADD',
+              success: function (res) {
+                if (res.confirm) {
+                  let url = "/pages/chargemoney/chargemoney";
+                  wx.navigateTo({
+                    url
+                  });
+                }
+              }
+            });
+            log.info('[扫码]', '[同步用户数据]', '[data.repaidbalance null||data.repaidbalance<=0余额不足跳转充值界面]', data);
+          } else if (data.repaidbalance > 0 && data.repaidbalance <= 15) {
+            wx.showModal({
+              title: '余额:' + data.repaidbalance + '元',
+              showCancel: false,
+              confirmText: "去充值",
+              confirmColor:'#00AADD',
+              content: '余额过低,请尽快充值!',
+              success: function (res) {
+                if (res.confirm) {
+                  let url = "/pages/chargemoney/chargemoney";
+                  wx.navigateTo({
+                    url
+                  });
+                }
+              }
+            });
+            log.info('[扫码]', '[同步用户数据]', '[0<data.repaidbalance<=15余额过低]', data);
+
+            // wx.showModal({
+            //   title:'请选择',
+            //   showCancel: true,
+            //   confirmText:"继续充电",
+            //   cancelText:"去充值",
+            //   content: '余额过低,请尽快充值!',
+            //   success: function (res) {
+            //     if (res.confirm) {
+
+            //       that.beginCharge_satrt();
+            //     } else if (res.cancel) {
+            //       let url = "/pages/chargemoney/chargemoney";
+            //       wx.navigateTo({
+            //         url
+            //       });
+            //     }
+            //   }
+            // });
+          } else if (data.repaidbalance > 15) {
+            log.info('[扫码]', '[同步用户数据]', '[余额充足开始充电]', data);
+            that.beginCharge_satrt(plateNumber,1);
+          }
+        }
+      }
+    });
+    // 扫描结束
+  },
+  beginChargeMsg(e){
+    let that = this
+    wx.requestSubscribeMessage({
+      tmplIds: ['3FR5XRyycT81ZWMdVi_ZQYKJcVatZr2Tm7DgcLwCD1I','KWHBIONCrdumgTkE1dpIpAZRgrN5TuhpHuZ0uU-Eud4','XWj70eHMLAjLlufPuhE_NQmdSQzhrOwEXIblWveH0bk'],
+      success (res33333) {
+        that.beginCharge(e)
+      },fail(reee){
+        console.info("ffffffffffffff")
+        console.info(reee)
+      }
+    })
+  },
+  beginCharge(e) {
+    let that = this
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+
+    if(!that.data.carParkingRate){
+      that.beginChargeInner(that,'');
+      return;
+    }
+    // 读取默认车牌
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/carList?loginName=' + userInfo.loginName,
+      // data: {
+      // loginName: userInfo.loginName
+      // },
+      method: 'POST',
+      success: function (res) {
+        let userCarList = res.data;
+        userCarList = userCarList.filter(it=>it.defaultType==1);
+        console.info(userCarList)
+        if(userCarList.length==0 ){
+          wx.showModal({
+            title: '提示',
+            content: '当前充电站可减免停车费,是否绑定车牌信息?',
+            confirmText: '绑定车牌',
+            cancelText: '直接启动',
+            showCancel:true,
+            confirmColor:'#00AADD',
+            cancelColor:'#00AADD',
+            success: function (ress1) {
+              if(ress1.confirm){
+                let url = '/pages/ucenter/car/chooseCar'
+                wx.navigateTo({
+                  url
+                });
+              }else{
+                that.beginChargeInner(that,'')
+              }
+            }
+          });
+        }else{
+          let userCar = userCarList[0]
+          wx.showModal({
+            title: '提示',
+            content: '确定使用' + userCar.plateNumber + '车牌信息减免停车费?',
+            confirmText: '确定',
+            cancelText: '其他车牌',
+            showCancel:true,
+            confirmColor:'#00AADD',
+            cancelColor:'#00AADD',
+            success: function (ress1) {
+                if(ress1.confirm){
+                  that.beginChargeInner(that,userCar.plateNumber)
+                }else{
+                  let url = '/pages/ucenter/car/chooseCar'
+                  wx.navigateTo({
+                    url
+                  });
+                }
+                return;
+
+            },
+            fail: function(res1){
+              console.info(res1)
+            }
+          });
+        }
+
+      },
+      fail(e) {
+      console.log("查询车辆失败");
+      log.info('[查询车辆]','[fail]', e);
+      }
+    });
+  
+  
+  },
+  beginCharge_satrt(plateNumber,runTimes) {
+    wx.showLoading({
+      title: '开启充电中...',
+      mask: true
+    });
+
+    let that = this;
+    let terminalNum = this.data.chargPile.chargPileId;
+
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+
+    console.log(terminalNum);
+    let userId = userInfo.userId;
+    let chargstarttime = new Date().getTime();
+    console.log(chargstarttime);
+    log.info('[扫码]', '[开始充电]', '[请求]', {
+      //chargPileId: '201811010000004202',
+      chargPileId: terminalNum,
+      userId: userId,
+      chargstarttime: chargstarttime
+    });
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/miniprogramadd',
+      data: {
+        //chargPileId: '201811010000004202',
+        chargPileId: terminalNum,
+        userId: userId,
+        chargstarttime: chargstarttime,
+        userPlateNumber: plateNumber,
+        runTimes:runTimes
+      },
+      method: 'POST',
+      fail(e) {
+
+        wx.hideLoading();
+        //开启充电失败,提示用户
+        wx.showModal({
+          showCancel: false,
+          content: '开启充电失败',
+          confirmColor:'#00AADD',
+        });
+        log.info('[扫码]', '[开始充电]', '[fail]', e);
+      },
+      success(res) {
+        wx.hideLoading();
+        let {
+          data
+        } = res;
+        log.info('[扫码]', '[开始充电]', '[响应]', data);
+        if (data && data.code == 200) {
+          //if (data && data.code == 200 && data.orderid) {
+          //开启充电成功,跳转到正在充电界面
+          let {
+            orderid
+          } = data;
+          log.info('[扫码]', '[开始充电]', '[成功,跳转充电中页面]', data);
+          //console.log(this.data.city);
+          let url = `/pages/charging/charging?orderid=${orderid}&userId=${userId}&chargPileId=${terminalNum}`;
+          wx.redirectTo({
+            url
+          });
+        } else if (data && data.code == 501) {
+          //开启充电失败,提示用户
+          wx.showModal({
+            showCancel: false,
+            content: '余额不足,请充值!',
+            confirmColor:'#00AADD',
+          });
+          log.info('[扫码]', '[开始充电]', '[失败data.code=501余额不足]', data);
+        } else if (data && data.code == 502) {
+          //开启充电失败,提示用户
+          wx.showModal({
+            showCancel: false,
+            content: data.message,
+            confirmColor:'#00AADD',
+          });
+          log.info('[扫码]', '[开始充电]', '[失败data.code=502' + data.message + ']', data);
+        } else if (data && data.code == 503) {
+            //开启充电失败,提示用户
+            let msg = res?.data?.message
+            wx.showModal({
+                title: '提示',
+                showCancel: true,
+                content: msg,
+                cancelText:'其他车辆',
+                confirmText:'继续启动',
+                confirmColor:'#00AADD',
+                cancelColor:'#00AADD',
+                success: function (res) {
+                    if (res.cancel) {
+                       //点击取消,其他车辆
+                    } else {
+                       //点击确定,继续启动
+                       that.beginCharge_satrt(plateNumber,runTimes + 1)
+                    }
+                 },
+                 fail: function (res) { },//接口调用失败的回调函数
+                 complete: function (res) { },//接口调用结束的回调函数(调用成功、失败都会执行)
+              });
+            log.info('[扫码]', '[开始充电]', '[失败data.code=502' + data.message + ']', data);
+        } else {
+          //开启充电失败,提示用户
+          let msg = res?.data?.message
+          msg = msg?msg:'开启充电失败'
+          wx.showModal({
+            showCancel: false,
+            content: msg,
+            confirmColor:'#00AADD',
+          });
+          log.info('[扫码]', '[开始充电]', '[失败]', data);
+        }
+      }
+    });
+  },
+  previewImage(e){
+    let cur = e.target.dataset.src;//获取本地一张图片链接
+    console.info(cur)
+    wx.previewImage({
+        current: cur, //字符串,默认显示urls的第一张
+          urls: [cur] // 数组,需要预览的图片链接列表
+    })
+},
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    let car = wx.getStorageSync('chooseCar_plateNumber')
+    let plateNumber = ''
+    if(car){
+        plateNumber = car.plateNumber;
+        wx.removeStorageSync('chooseCar_plateNumber')
+    }
+    this.setData({
+        plateNumber
+    })
+    console.info('将会自动跳过弹窗,默认车牌号:' + plateNumber)
+
+    if(car){
+        this.beginChargeInner(this,plateNumber)
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 7 - 0
pages/scan_result/elpackage.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "circle-progress": "/components/circle-progress/circle-progress"
+  },
+  "navigationBarTitleText": "终端详情",
+  "backgroundColor": "#FFFFFF"
+}

+ 53 - 0
pages/scan_result/elpackage.wxml

@@ -0,0 +1,53 @@
+<!-- pages/index.wxml -->
+<!-- <import src="/components/circle-progress/circle-progress.wxml"/> -->
+<!-- <view style="width:400rpx;height:400rpx;background-color: green;">
+    <circle-progress name="circle-progress" progress="{{progressPercentage}}" disabled="{{false}}"/>
+</view> -->
+
+<!--pages/scan_result/scan_result.wxml-->
+<view wx:if="{{chargPile}}"  class="map_text" hover-class='active' >
+
+    <view class='charging_text_title'>
+      <view class='charging'>
+        <image src='/images/charging2_1.png'></image>
+      </view>
+      <view class='charging_text_title1'>
+        <text class='bold'>{{chargPile.chargPileName}}</text>  <!-- xxxxx场站 -->
+        <text class="h1">{{chargPile.chargPileId}}</text> <!-- xxx号车位 -->
+      </view>
+    </view>
+    <!-- <text style='margin-bottom:10rpx;'>地址:{{chargPile.address}}</text> -->
+    <rich-text space='nbsp' nodes="地址:{{chargPile.address}}" style='line-height:30rpx;font-size:24rpx;margin-bottom:10rpx;word-wrap: break-word;' ></rich-text>
+    <text style="font-size:28rpx;line-height:28rpx;">请选择电池包</text>
+    <view class="cardHub">
+
+        <view class="card">
+            <view class="circleOut"><view class="circleIn">1</view></view>
+            <view class="main">
+                <view style="width:60rpx;height:60rpx;margin: 0 auto;margin-top: 30rpx;">
+                    <circle-progress name="circle-progress" progress="100" disabled="{{false}}" width="{{15}}" r="{{14}}" lw="{{1}}"/>
+                </view>
+                <view class="no">编号:123456789</view>
+            </view>
+            <view class="foot">电池包可用
+            </view>
+        </view>
+
+        <view class="card dis">
+            <view class="circleOut"><view class="circleIn">1</view></view>
+            <view class="main">
+                <view style="width:60rpx;height:60rpx;margin: 0 auto;margin-top: 40rpx;">
+                    <circle-progress name="circle-progress" progress="100" disabled="{{true}}" width="{{15}}" r="{{14}}" lw="{{1}}"/>
+                </view>
+                <view class="no">编号:123456789</view>
+            </view>
+            <view class="foot">电池包可用
+            </view>
+        </view>
+
+    </view>
+
+
+
+  </view>
+  <button wx:if="{{chargPile}}" class='charg_button' bindtap="beginChargeMsg" >呼叫充电车</button>

+ 276 - 0
pages/scan_result/elpackage.wxss

@@ -0,0 +1,276 @@
+/* pages/scan_result/scan_result.wxss */
+page {
+    height: 100%;
+  }
+  
+  view.inline {
+    display: inline-block;
+    vertical-align: middle;
+    line-height: 28rpx;
+    height: 28rpx;
+    min-height: 28rpx;
+  }
+  
+  .map_text {
+    position: relative;
+    height: calc(100% - 160rpx);
+    padding: 20rpx 30rpx 0 30rpx;
+    box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+    width: calc(100% - 60rpx);
+  }
+  .charging_text_title {
+    height: 105rpx;
+    width: 100%;
+    display: flex;
+    margin-bottom: 20rpx;
+  }
+  
+  .charging_text_title1 {
+    width: 100%;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+  }
+  .charging {
+    width: 62rpx;
+    height: 62rpx;
+    margin: 30rpx 30rpx 30rpx 0;
+    flex-shrink: 0;
+    overflow: hidden;
+  }
+  .charging image {
+    width: 62rpx;
+    height: 62rpx;
+  }
+  
+  text {
+    margin: 0 0 18rpx 0;
+    display: block;
+    font-size: 26rpx;
+    font-family: 'Lucida Sans',
+                   'Lucida Sans Regular',
+                   'Lucida Grande',
+                   'Lucida Sans Unicode',
+                   Geneva,
+                   Verdana,
+                   sans-serif;
+    color: #231400;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+    line-height: 30rpx;
+    height: 30rpx;
+    min-height: 30rpx;
+  }
+  
+  text.bold {
+    font-weight: bold;
+    line-height: 34rpx;
+    height: 34rpx;
+    min-height: 34rpx;
+    margin-top: 28rpx;
+    margin-bottom: 8rpx;
+    display: block;  
+    font-size: 30rpx;
+  }
+  
+  text.inline {
+    display: inline-block;
+    color: #575757;
+    margin-top:18rpx;
+    margin-bottom: 0;
+  }
+  
+  .h1 {
+    margin: 0rpx 0rpx 24rpx 0rpx;
+    font-size: 24rpx;
+    line-height: 28rpx;
+    height: 28rpx;
+    min-height: 28rpx;
+    color: #a3a3a3;
+  }
+  .charg_button {
+    font-size: 32rpx;
+    margin: 20rpx 65rpx;
+    height: 90rpx;
+    font-family: 'Lucida Sans',
+                   'Lucida Sans Regular',
+                   'Lucida Grande',
+                   'Lucida Sans Unicode',
+                   Geneva,
+                   Verdana,
+                   sans-serif;
+    color: #ffffff;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    background-color: #1d9bf7;
+    border-radius: 45rpx;
+    box-shadow: 0rpx 16rpx 0rpx #edf5fd;
+    border: none;
+    position: fixed;
+    bottom: 10rpx;
+    width: 80%;
+  }
+  
+  .charg_button.button-hover {
+    background-color: #1d9cf7b9;
+    color: #ffffff;
+  }
+  
+  .rtable{
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+  }
+  
+  .rtable .rtr{
+    width: 100%;
+    height: 40rpx;
+    display: flex;
+    flex-direction: row;
+  }
+  
+  .rtable .rtr{
+    font-size: 26rpx;
+  }
+  .rtable .rtr.active{
+    color:#f06c6c;
+    font-weight: bold;
+    font-size: 28rpx;
+    font-style: italic;
+  }
+  
+  .rtable .rtr .rtd{
+    font-size: 26rpx;
+  }
+  
+  .rtable .rtr .rtd.t1{
+    width: 210rpx
+  }
+  
+  .rtable .rtr .rtd.t2{
+    width: 180rpx
+  }
+  
+  .context{
+    height: 1400rpx;
+    width: 100%;
+  }
+  .richHourNum{
+    display: inline;
+    color: red;
+    padding-left: 10rpx;
+    padding-right: 20rpx;
+  }
+  
+  .scan_img{
+      width:400rpx;
+      height:400rpx;
+      padding: 0 calc((100% - 400rpx) / 2);
+  }
+  
+  .scan_text{
+      word-wrap: break-word;
+      word-break: break-all;
+      white-space: pre-line;
+      text-align: center;
+      padding:0 calc((100% - 500rpx) / 2);
+      padding-bottom: 200rpx;
+  }
+
+
+  .cardHub{
+    height:calc(100% - 230rpx);
+    width:100%;
+    background-color: #FFF;
+  }
+
+
+  .cardHub .card{
+    float:left;
+    margin-bottom: 20rpx;
+    width:330rpx;
+    height:200rpx;
+    background-color: #FFFFFF;
+    display:flex;
+    flex-direction: column;
+    position: relative;
+    overflow: hidden;
+    box-shadow:0px 0px 5px 1px #DEDEDEFF;
+    border-radius: 15rpx;
+  }
+
+  .cardHub .card:nth-child(odd){
+    margin-right: 20rpx;
+  }
+
+  .cardHub .card .circleOut{
+    background-color: #21ADFF;
+    position: absolute;
+    width: 28rpx;
+    height: 28rpx;
+    border-radius: 50%;
+    padding: 0;
+    top:10rpx;
+    left:10rpx;
+  }
+
+  .cardHub .card .circleOut .circleIn{
+    background-color: #ebf8ff;
+    color:#21ADFF;
+    font-size: 18rpx;
+    width: 24rpx;
+    height: 24rpx;
+    line-height: 22rpx;
+    text-align: center;
+    border-radius: 50%;
+    margin: 3rpx;
+    padding: 0;
+  }
+
+  .cardHub .card .main{
+    width:100%;
+    height:calc(100% - 34rpx);
+    background:#ebf8ff;
+  }
+  
+  .cardHub .card .main .no{
+    width:100%;
+    height:32rpx;
+    font-size: 24rpx;
+    text-align: center;
+    color: #21ADFF;
+    line-height: 80rpx;
+  }
+  
+  .cardHub .card .foot{
+    width:100%;
+    height:34rpx;
+    background-color:#21ADFF;
+    font-size: 24rpx;
+    color:#FFF;
+    text-align: center;
+  }
+  
+  .cardHub .card.dis .main{
+    background-color: #EEEEEE;
+    color:#A4A3A3;
+  }
+
+  .cardHub .card.dis .foot{
+    background-color: #B6B3B1;
+  }
+
+  .cardHub .card.dis .circleOut .circleIn{
+    background-color: #EEEEEE;
+    color:#A4A3A3;
+  }
+
+  .cardHub .card.dis .circleOut{
+    background-color: #B6B3B1;
+  }
+
+  .cardHub .card.dis .no{
+    color:#A4A3A3;
+  }

+ 473 - 0
pages/ucenter/control/batteryControl.js

@@ -0,0 +1,473 @@
+// pages/ucenter/control/batteryControl.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    code: '202007221111110201',
+    chargPile:{
+        // chargPileName:'测试电池包',
+        // chargPileId:'202007221111110201',
+        // address:'雁塔区小寨西路',
+        // wxTest:'wxTest',
+        chargPileName:'',
+        chargPileId:'',
+        address:'',
+        wxTest:'wxTest',
+    },
+    cars:[],
+    carIndex: -1,
+    locations:[],
+    locationIndex: -1,
+    wxTest:{
+        msg:'uuddudududud',
+        index:0,
+        t: new Date().valueOf(),
+        tnum: 0,
+    },
+    tractorTaskTypeIndex: -1,
+    tractorTaskTypeList:[
+      {
+          "txt": "装载电池包",
+          "val": 2
+      },
+      {
+          "txt": "卸载电池包",
+          "val": 3
+      },
+      {
+          "txt": "离开电池包",
+          "val": 4
+      }
+    ]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let that = this
+    // let {code} = options
+    // this.setData({
+    //     code
+    // })
+
+
+
+    wx.request({
+        url: getApp().globalData.postHeadAgreement +'/restapi/wechat/ivCar',
+        data: {
+        },
+        method: 'POST',
+        success(res) {
+            console.info(res);
+            let cars = res?.data?.result?res?.data?.result:[]
+            that.setData({
+                cars
+            })
+        }
+    })
+
+    wx.request({
+        url: getApp().globalData.postHeadAgreement +'/restapi/wechat/ivParkPoint',
+        data: {
+        },
+        method: 'POST',
+        success(res) {
+            console.info(res);
+            let locations = res?.data?.result?res?.data?.result:[]
+            that.setData({
+                locations
+            })
+        }
+    })
+    let userInfo = wx.getStorageSync('userInfo');
+    wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
+        data: {
+          chargPileId:that.data.code,
+          userId: userInfo.userId
+        },
+        method: 'POST',
+        success(res) {
+        //   log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
+        console.info(res)
+        if (!res.data || res.data.code == 500) {
+            wx.showModal({
+              showCancel: false,
+              content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号',
+              confirmColor:'#00AADD',
+            });
+        }else{
+            let chargPile = res.data.result;
+            that.setData({
+                chargPile
+            })
+        }
+
+        },
+        fail(e) {
+          getApp().showNetworkError();
+        }
+      });
+
+
+    // wx.showToast({
+    //     title: that.data.code,
+    //     icon: 'success',
+    //     duration: 2000
+    //   })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  },
+  upBtn(){
+    let that = this;
+    // if(that.wxTestDebug(that,'u') > 4){
+    //     return ;
+    // }
+    that.bettyControl(1)
+  },
+  downBtn(){
+    let that = this;
+    // if(that.wxTestDebug(that,'d') > 4){
+    //     return ;
+    // }
+    that.bettyControl(2);
+  },
+  bettyControl(bettyControl){
+    let that = this;
+    wx.showLoading({
+      title: '控制电池中。。。',
+      mask: true
+    })
+    wx.request({
+        url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/bettyControl',
+        data: {
+            bettyControl,
+            chargPileId: that.data.chargPile.chargPileId
+        },
+        method: 'POST',
+        success(res) {
+            console.info(res)
+            wx.hideLoading()
+            wx.showToast({
+                icon: 'none',
+                title: res.data.msg,
+                duration: 1000
+              })
+        }
+     })
+  },
+  wxTestDebugClick(){
+    let that = this
+    if(new Date().valueOf() - that.data.wxTest.t <= 1000){
+        that.data.wxTest.tnum = that.data.wxTest.tnum + 1
+    }else{
+        that.data.wxTest.tnum = 0
+    }
+    that.data.wxTest.t = new Date().valueOf()
+    if(that.data.wxTest.tnum > 10){
+        wx.request({
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/wxTest/switch',
+            data: {
+            },
+            method: 'GET',
+            success(res) {
+                that.data.wxTest.tnum = 0
+                wx.showToast({
+                    title: "调试模式: " + res.data.msg,
+                    duration: 1000
+                  })
+            }
+         })
+    }
+
+  },
+  wxTestDebug(that,s){
+    // let that = this;
+
+    if(that.data.wxTest.msg.length == that.data.wxTest.index + 1){
+        wx.request({
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/wxTest/switch',
+            data: {
+            },
+            method: 'GET',
+            success(res) {
+                wx.showToast({
+                    title: "调试模式: " + res.data.msg,
+                    duration: 1000
+                  })
+            }
+         })
+         idx = 0;
+         that.setData({
+             wxTest:{
+                 msg:that.data.wxTest.msg,
+                 index: idx,
+             }
+         })
+         return;
+    }
+    let idx = 0
+    if(that.data.wxTest.msg.substr(that.data.wxTest.index,1) == s){
+        idx = that.data.wxTest.index + 1
+        that.setData({
+            wxTest:{
+                msg:that.data.wxTest.msg,
+                index: idx,
+            }
+        })
+    }else{
+        idx = 0;
+        that.setData({
+            wxTest:{
+                msg:that.data.wxTest.msg,
+                index: idx,
+            }
+        })
+    }
+    return idx;
+  },
+  carTap(e){
+    let  carIndex =  e.currentTarget.dataset.idx;
+    this.setData({
+        carIndex
+    })
+  },
+  locationTap(e){
+    let  locationIndex =  e.currentTarget.dataset.idx;
+    this.setData({
+        locationIndex
+    })
+
+  },
+  tractorTaskTypeTap(e){
+    let  tractorTaskTypeIndex =  e.currentTarget.dataset.idx;
+    this.setData({
+        tractorTaskTypeIndex
+    })
+},
+  submit(){
+     let that = this;
+
+
+     if(this.data.carIndex==-1){
+        wx.showToast({
+          icon: 'none',
+          title: '请选择车辆',
+          duration: 1000
+        })
+        return ;
+     }
+     if(this.data.locationIndex==-1){
+        wx.showToast({
+          icon: 'none',
+          title: '请选择点位',
+          duration: 1000
+        })
+        return ;
+     }
+     if(this.data.tractorTaskTypeIndex==-1){
+        wx.showToast({
+          icon: 'none',
+          title: '请选择任务类型',
+          duration: 1000
+        })
+        return ;
+     }
+      let car = this.data.cars[this.data.carIndex];
+      let location = this.data.locations[this.data.locationIndex]
+      wx.showModal({
+        title: '提示',
+        content: '是否调度当前车辆?' + car.carName + "|" + location.pointShowName,
+        complete: (res) => {
+          if (res.cancel) {
+            
+          }
+      
+          if (res.confirm) {
+            wx.showLoading({
+                title: '调度车辆中。。。',
+                mask: true
+            })
+            let userInfo = wx.getStorageSync('userInfo');
+            // userId: 
+            wx.request({
+                url: getApp().globalData.postHeadAgreement +'/restapi/wechat/createIvCarRequirement?' 
+                + 'finalTargetParkPointId=' + location.id
+                + '&carId=' + car.id
+                // + '&chargePileId=' + that.data.chargPile.id
+                + '&chargePileId=12'
+                + '&userId=' + userInfo.userId
+                // + '&requirementType=' + that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+                + '&requirementType=0',
+                data:{
+                    // "finalTargetParkPointId":location.id,
+                    // "carId":car.id,
+                    // "chargePileId":that.data.chargPile.chargPileId,
+                    // "userId":userInfo.userId,
+                    // "requirementType":that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+                },
+                method: 'POST',
+                success(ress) {
+                    if(ress && ress.statusCode==200){
+                        let iid = ress.data.result.id;
+                        console.info(iid);
+                        console.info("11111111111111111");
+                        wx.request({
+                            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/xingshen',
+                            data: {
+                                // capacityResourceId: car.id,
+                                // targetParkPointId: location.id,
+                                // tractorTaskType: that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+            
+                                // ivCarId:car.id,
+                                // targetParkPointId: 1,
+                                // capacityResourceId: location.id,
+                                // tractorTaskType: that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+            
+                                carId:car.id,
+                                parkPointId: location.id,
+                                carRequirementId: iid,
+                                tractorTaskType: that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+                            },
+                            method: 'POST',
+                            success(res) {
+                                wx.hideLoading();
+                                if(res.statusCode==200){
+                                    if(res.data.code==200){
+                                        wx.showToast({
+                                            icon: 'success',
+                                            title: res.data.msg,
+                                            duration: 1000
+                                        })
+                                    }else{
+                                        wx.showToast({
+                                            icon: 'none',
+                                            title: '调度失败:' + res.data.msg,
+                                            duration: 1000
+                                        })
+                                    }
+                                }else{
+                                    wx.showToast({
+                                        icon: 'none',
+                                        title: '调度失败',
+                                        duration: 1000
+                                    })
+                                }
+                            }
+                         })
+                    }
+                },
+
+            })
+
+          }
+        }
+      })
+  },
+  goToScanResult(){
+    let userInfo = wx.getStorageSync('userInfo');
+    let that = this;
+    wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
+        // data: charePileId,
+        data:{
+          chargPileId: that.data.chargPile.chargPileId,
+          userId: userInfo.userId
+        },
+        method: 'POST',
+        success(res) {
+          //console.log(res.data);
+        //   log.info('[首页]', '[获取微信扫一扫充电桩]', '[响应]', res.data);
+          if (!res.data || res.data.code == 500) {
+            //没有该充电桩信息
+            wx.showModal({
+              showCancel: false,
+              content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号',
+              confirmColor:'#00AADD',
+            });
+          } else {
+            res.data = res.data.result
+            //充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+            if (!res.data.chargstatus || res.data.chargstatus == 0 || res.data.chargstatus == 1 || res.data.chargstatus == 4 || res.data.chargstatus == 5 || res.data.chargstatus == 6 || res.data.chargstatus == 9) {
+              //充电桩故障
+
+              wx.showModal({
+                showCancel: false,
+                content: '终端故障,维修中',
+                confirmColor:'#00AADD',
+              });
+            } else if (res.data.chargstatus == 3 || res.data.chargstatus == 8 || res.data.chargstatus == 10) {
+              wx.showModal({
+                showCancel: false,
+                content: '正在充电中',
+                confirmColor:'#00AADD',
+              });
+            } else if (res.data.chargstatus == 2 || res.data.chargstatus == 11) {
+              wx.setStorage({
+                key: "scan_chargpile",
+                data: res.data
+              });
+            //   log.info('[首页]', '[微信扫一扫充电桩空闲跳转去充电界面]');
+              let url = `/pages/scan_result/scan_result`;
+              wx.navigateTo({
+                url
+              });
+            }
+          }
+        },
+        fail(e) {
+          getApp().showNetworkError();
+        }
+      });
+}
+})

+ 4 - 0
pages/ucenter/control/batteryControl.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "电池包控制"
+}

+ 44 - 0
pages/ucenter/control/batteryControl.wxml

@@ -0,0 +1,44 @@
+
+<view class="pg">
+    <view class='charging_text_title'>
+      <view class='charging'>
+        <image src='/images/charging2_1.png' bindtap="wxTestDebugClick"></image>
+      </view>
+      <view class='charging_text_title1'>
+        <text class='bold'>{{chargPile.chargPileName}}</text>
+        <text class="h1">终端编号:{{chargPile.chargPileId}}</text>
+      </view>
+    </view>
+    <rich-text space='nbsp' nodes="地址:{{chargPile.address}}" style='line-height:30rpx;font-size:24rpx;margin-bottom:10rpx;word-wrap: break-word;' ></rich-text>
+    <text class="stitle" >电池包举升控制</text>
+    <view class="vbtn v2">
+        <button class='btn b2 active' bindtap="upBtn" >上升</button>
+        <button class='btn b2 active' bindtap="downBtn" >下降</button>
+    </view>
+    <text class="stitle" >选择车辆</text>
+    <view class="vbtn v3">
+        <block wx:for="{{cars}}" wx:key="id">
+            <button class="btn b3 {{carIndex==index?'active':''}}" bindtap="carTap" data-idx="{{index}}">{{item.carName}}</button>
+        </block>
+    </view>
+    <text class="stitle" >选择点位</text>
+    <view class="vbtn v3">
+        <block wx:for="{{locations}}" wx:key="id">
+            <button class="btn b3 {{locationIndex==index?'active':''}}" bindtap="locationTap" data-idx="{{index}}" >{{item.pointShowName}}</button>
+        </block>
+    </view>    <text class="stitle" >选择任务类型</text>
+    <view class="vbtn v3">
+        <block wx:for="{{tractorTaskTypeList}}" wx:key="id">
+            <button class="btn b3 {{tractorTaskTypeIndex==index?'active':''}} char4" bindtap="tractorTaskTypeTap" data-idx="{{index}}" >{{item.txt}}</button>
+        </block>
+    </view>
+    <view class="vbtn v1">
+        <button class='btn b1 active' bindtap="submit" >调度车辆</button>
+    </view>
+    <text class="stitle" >启动充电</text>
+    <view class="vbtn v1" style="margin-top: 20rpx;">
+        <button class='btn b1 active' bindtap="goToScanResult" >启动充电</button>
+    </view>
+    <view class="vbtn v1"></view>
+    
+</view>

+ 144 - 0
pages/ucenter/control/batteryControl.wxss

@@ -0,0 +1,144 @@
+.pg {
+    position: relative;
+    /* height: calc(100% - 640rpx); */
+    background: #fff;
+    padding: 20rpx 30rpx 0 30rpx;
+    box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+    width: calc(100% - 60rpx);
+  }
+  .charging_text_title {
+    height: 105rpx;
+    width: 100%;
+    display: flex;
+    margin-bottom: 20rpx;
+  }
+  
+  .charging_text_title1 {
+    width: 100%;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+  }
+  .charging {
+    width: 62rpx;
+    height: 62rpx;
+    margin: 30rpx 30rpx 30rpx 0;
+    flex-shrink: 0;
+    overflow: hidden;
+  }
+  .charging image {
+    width: 62rpx;
+    height: 62rpx;
+  }
+  
+  text {
+    margin: 0 0 18rpx 0;
+    display: block;
+    font-size: 26rpx;
+    font-family: 'Lucida Sans',
+                   'Lucida Sans Regular',
+                   'Lucida Grande',
+                   'Lucida Sans Unicode',
+                   Geneva,
+                   Verdana,
+                   sans-serif;
+    color: #231400;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+    line-height: 30rpx;
+    min-height: 30rpx;
+  }
+
+
+  text.bold {
+    font-weight: bold;
+    line-height: 34rpx;
+    height: 34rpx;
+    min-height: 34rpx;
+    margin-top: 28rpx;
+    margin-bottom: 8rpx;
+    display: block;  
+    font-size: 30rpx;
+  }
+  
+  text.inline {
+    display: inline-block;
+    color: #575757;
+    margin-top:18rpx;
+    margin-bottom: 0;
+  }
+  
+  .h1 {
+    margin: 0rpx 0rpx 24rpx 0rpx;
+    font-size: 24rpx;
+    line-height: 28rpx;
+    height: 28rpx;
+    min-height: 28rpx;
+    color: #a3a3a3;
+  }
+
+  .btn {
+    width: 80%;
+    font-size: 32rpx;
+    /* margin: 0rpx 32rpx; */
+    font-family: 'Lucida Sans',
+                   'Lucida Sans Regular',
+                   'Lucida Grande',
+                   'Lucida Sans Unicode',
+                   Geneva,
+                   Verdana,
+                   sans-serif;
+    
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    border: #bbbbbb 1rpx solid;
+    background-color: #FFF;
+    color: #00a8dc;
+    border-radius: 40rpx;
+    height: 80rpx;
+    line-height: 80rpx;
+  }
+  .stitle{
+    line-height:40rpx;font-size:28rpx;margin:20rpx 0;word-wrap: break-word;
+  }
+
+  .btn.active{
+    background-color: #00a8dc;
+    color: #fff;
+  }
+
+  .btn.b1{
+    /* width: 80%; */
+}
+  .btn.b2{
+      /* width: 40%; */
+  }
+
+  .btn.b3{
+    /* width: 30%; */
+}
+  
+  .vbtn{
+    width: 100%;
+    display: grid;
+    margin:50rpx 0;
+  }
+  .vbtn.v1{
+    margin:0;
+    margin-top:60rpx;
+    grid-template-columns: auto;
+  }
+  .vbtn.v2{
+    margin:30rpx 0;
+    grid-template-columns: auto auto;
+    
+  }
+  .vbtn.v3{
+    margin:30rpx 0;
+    grid-template-columns: auto auto auto;
+    grid-row-gap: 30rpx;
+  }
+  .char4{
+    font-size: 24rpx;
+  }

+ 409 - 0
pages/ucenter/control/carControl.js

@@ -0,0 +1,409 @@
+// pages/ucenter/control/batteryControl.js
+
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+      code: '202007221111110201',
+      chargPile:{
+        //   chargPileName:'测试电池包',
+        //   chargPileId:'202007221111110201',
+        //   address:'雁塔区小寨西路',
+        //   wxTest:'wxTest',
+            chargPileName:'',
+            chargPileId:'',
+            address:'',
+            wxTest:'wxTest',
+      },
+      cars:[],
+      carIndex: -1,
+      locations:[],
+      locationIndex: -1,
+      wxTest:{
+          msg:'uuddudududud',
+          index:0,
+          t: new Date().valueOf(),
+          tnum: 0,
+      },
+      tractorTaskTypeIndex: -1,
+      tractorTaskTypeList:[
+        {
+            "txt": "装载电池包",
+            "val": 2
+        },
+        {
+            "txt": "卸载电池包",
+            "val": 3
+        },
+        {
+            "txt": "离开电池包",
+            "val": 4
+        }
+      ]
+    },
+  
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+      let that = this
+    //   let {code} = options
+    //   this.setData({
+    //       code
+    //   })
+  
+  
+  
+      wx.request({
+          url: getApp().globalData.postHeadAgreement +'/restapi/wechat/ivCar',
+          data: {
+          },
+          method: 'POST',
+          success(res) {
+              console.info(res);
+              let cars = res?.data?.result?res?.data?.result:[]
+              that.setData({
+                  cars
+              })
+          }
+      })
+  
+      wx.request({
+          url: getApp().globalData.postHeadAgreement +'/restapi/wechat/ivParkPoint',
+          data: {
+          },
+          method: 'POST',
+          success(res) {
+              console.info(res);
+              let locations = res?.data?.result?res?.data?.result:[]
+              that.setData({
+                  locations
+              })
+          }
+      })
+      let userInfo = wx.getStorageSync('userInfo');
+      wx.request({
+          url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
+          data: {
+            chargPileId:that.data.code,
+            userId: userInfo.userId
+          },
+          method: 'POST',
+          success(res) {
+          //   log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
+          console.info(res)
+          if (!res.data || res.data.code == 500) {
+              wx.showModal({
+                showCancel: false,
+                content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号',
+                confirmColor:'#00AADD',
+              });
+          }else{
+              let chargPile = res.data.result;
+              that.setData({
+                  chargPile
+              })
+          }
+  
+          },
+          fail(e) {
+            getApp().showNetworkError();
+          }
+        });
+    },
+  
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+  
+    },
+  
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+  
+    },
+  
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+  
+    },
+  
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+  
+    },
+  
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+  
+    },
+  
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+  
+    },
+  
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+  
+    },
+    upBtn(){
+      let that = this;
+      // if(that.wxTestDebug(that,'u') > 4){
+      //     return ;
+      // }
+      that.bettyControl(1)
+    },
+    downBtn(){
+      let that = this;
+      // if(that.wxTestDebug(that,'d') > 4){
+      //     return ;
+      // }
+      that.bettyControl(2);
+    },
+    bettyControl(bettyControl){
+      let that = this;
+      wx.showLoading({
+        title: '控制电池中。。。',
+        mask: true
+      })
+      wx.request({
+          url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/bettyControl',
+          data: {
+              bettyControl,
+              chargPileId: that.data.chargPile.chargPileId
+          },
+          method: 'POST',
+          success(res) {
+              console.info(res)
+              wx.hideLoading()
+              wx.showToast({
+                  icon: 'none',
+                  title: res.data.msg,
+                  duration: 1000
+                })
+          }
+       })
+    },
+    wxTestDebugClick(){
+      let that = this
+      if(new Date().valueOf() - that.data.wxTest.t <= 1000){
+          that.data.wxTest.tnum = that.data.wxTest.tnum + 1
+      }else{
+          that.data.wxTest.tnum = 0
+      }
+      that.data.wxTest.t = new Date().valueOf()
+      if(that.data.wxTest.tnum > 10){
+          wx.request({
+              url: getApp().globalData.postHeadAgreement +'/restapi/wechat/wxTest/switch',
+              data: {
+              },
+              method: 'GET',
+              success(res) {
+                  that.data.wxTest.tnum = 0
+                  wx.showToast({
+                      title: "调试模式: " + res.data.msg,
+                      duration: 1000
+                    })
+              }
+           })
+      }
+  
+    },
+    wxTestDebug(that,s){
+      // let that = this;
+  
+      if(that.data.wxTest.msg.length == that.data.wxTest.index + 1){
+          wx.request({
+              url: getApp().globalData.postHeadAgreement +'/restapi/wechat/wxTest/switch',
+              data: {
+              },
+              method: 'GET',
+              success(res) {
+                  wx.showToast({
+                      title: "调试模式: " + res.data.msg,
+                      duration: 1000
+                    })
+              }
+           })
+           idx = 0;
+           that.setData({
+               wxTest:{
+                   msg:that.data.wxTest.msg,
+                   index: idx,
+               }
+           })
+           return;
+      }
+      let idx = 0
+      if(that.data.wxTest.msg.substr(that.data.wxTest.index,1) == s){
+          idx = that.data.wxTest.index + 1
+          that.setData({
+              wxTest:{
+                  msg:that.data.wxTest.msg,
+                  index: idx,
+              }
+          })
+      }else{
+          idx = 0;
+          that.setData({
+              wxTest:{
+                  msg:that.data.wxTest.msg,
+                  index: idx,
+              }
+          })
+      }
+      return idx;
+    },
+    carTap(e){
+      let  carIndex =  e.currentTarget.dataset.idx;
+      this.setData({
+          carIndex
+      })
+    },
+    locationTap(e){
+      let  locationIndex =  e.currentTarget.dataset.idx;
+      this.setData({
+          locationIndex
+      })
+  
+    },
+    tractorTaskTypeTap(e){
+        let  tractorTaskTypeIndex =  e.currentTarget.dataset.idx;
+        this.setData({
+            tractorTaskTypeIndex
+        })
+    },
+    submit(){
+       let that = this;
+       if(this.data.carIndex==-1){
+          wx.showToast({
+            icon: 'none',
+            title: '请选择车辆',
+            duration: 1000
+          })
+          return ;
+       }
+       if(this.data.locationIndex==-1){
+          wx.showToast({
+            icon: 'none',
+            title: '请选择点位',
+            duration: 1000
+          })
+          return ;
+       }
+       if(this.data.tractorTaskTypeIndex==-1){
+        wx.showToast({
+          icon: 'none',
+          title: '请选择任务类型',
+          duration: 1000
+        })
+        return ;
+     }
+        let car = this.data.cars[this.data.carIndex];
+        let location = this.data.locations[this.data.locationIndex]
+        wx.showModal({
+          title: '提示',
+          content: '是否调度当前车辆?' + car.carName + "|" + location.pointShowName,
+          complete: (res) => {
+            if (res.cancel) {
+              
+            }
+            if (res.confirm) {
+              wx.showLoading({
+                  title: '调度车辆中。。。',
+                  mask: true
+              })
+  
+              let userInfo = wx.getStorageSync('userInfo');
+            // userId: 
+            wx.request({
+                url: getApp().globalData.postHeadAgreement +'/restapi/wechat/createIvCarRequirement?' 
+                + 'finalTargetParkPointId=' + location.id
+                + '&carId=' + car.id
+                // + '&chargePileId=' + that.data.chargPile.id
+                + '&chargePileId=12'
+                + '&userId=' + userInfo.userId
+                // + '&requirementType=' + that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+                + '&requirementType=0',
+                data:{
+                    // "finalTargetParkPointId":location.id,
+                    // "carId":car.id,
+                    // "chargePileId":that.data.chargPile.chargPileId,
+                    // "userId":userInfo.userId,
+                    // "requirementType":that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+                },
+                method: 'POST',
+                success(ress) {
+                    if(ress && ress.statusCode==200){
+                        let iid = ress.data.result.id;
+                        console.info(iid);
+                        console.info("11111111111111111");
+                        wx.request({
+                            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/xingshen',
+                            data: {
+                                // capacityResourceId: car.id,
+                                // targetParkPointId: location.id,
+                                // tractorTaskType: that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+            
+                                // ivCarId:car.id,
+                                // targetParkPointId: 1,
+                                // capacityResourceId: location.id,
+                                // tractorTaskType: that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+            
+                                carId:car.id,
+                                parkPointId: location.id,
+                                carRequirementId: iid,
+                                tractorTaskType: that.data.tractorTaskTypeList[that.data.tractorTaskTypeIndex]['val'],
+                            },
+                            method: 'POST',
+                            success(res) {
+                                wx.hideLoading();
+                                if(res.statusCode==200){
+                                    if(res.data.code==200){
+                                        wx.showToast({
+                                            icon: 'success',
+                                            title: res.data.msg,
+                                            duration: 1000
+                                        })
+                                    }else{
+                                        wx.showToast({
+                                            icon: 'none',
+                                            title: '调度失败:' + res.data.msg,
+                                            duration: 1000
+                                        })
+                                    }
+                                }else{
+                                    wx.showToast({
+                                        icon: 'none',
+                                        title: '调度失败',
+                                        duration: 1000
+                                    })
+                                }
+                            }
+                         })
+                    }
+                },
+
+            })
+            }
+          }
+        })
+    },
+
+  })

+ 4 - 0
pages/ucenter/control/carControl.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "车辆控制"
+}

+ 42 - 0
pages/ucenter/control/carControl.wxml

@@ -0,0 +1,42 @@
+
+<view class="pg">
+    <!-- <view class='charging_text_title'>
+      <view class='charging'>
+        <image src='/images/charging2_1.png' bindtap="wxTestDebugClick"></image>
+      </view>
+      <view class='charging_text_title1'>
+        <text class='bold'>{{chargPile.chargPileName}}</text>
+        <text class="h1">终端编号:{{chargPile.chargPileId}}</text>
+      </view>
+    </view>
+    <rich-text space='nbsp' nodes="地址:{{chargPile.address}}" style='line-height:30rpx;font-size:24rpx;margin-bottom:10rpx;word-wrap: break-word;' ></rich-text>
+    <text class="stitle" >电池包举升控制</text>
+    <view class="vbtn v2">
+        <button class='btn b2 active' bindtap="upBtn" >上升</button>
+        <button class='btn b2 active' bindtap="downBtn" >下降</button>
+    </view> -->
+    <text class="stitle" >选择车辆</text>
+    <view class="vbtn v3">
+        <block wx:for="{{cars}}" wx:key="id">
+            <button class="btn b3 {{carIndex==index?'active':''}}" bindtap="carTap" data-idx="{{index}}">{{item.carName}}</button>
+        </block>
+    </view>
+    <text class="stitle" >选择点位</text>
+    <view class="vbtn v3">
+        <block wx:for="{{locations}}" wx:key="id">
+            <button class="btn b3 {{locationIndex==index?'active':''}}" bindtap="locationTap" data-idx="{{index}}" >{{item.pointShowName}}</button>
+        </block>
+    </view>
+    <text class="stitle" >选择任务类型</text>
+    <view class="vbtn v3">
+        <block wx:for="{{tractorTaskTypeList}}" wx:key="id">
+            <button class="btn b3 {{tractorTaskTypeIndex==index?'active':''}} char4" bindtap="tractorTaskTypeTap" data-idx="{{index}}" >{{item.txt}}</button>
+        </block>
+    </view>
+
+    <view class="vbtn v1">
+        <button class='btn b1 active' bindtap="submit" >调度车辆</button>
+    </view>
+
+
+</view>

+ 145 - 0
pages/ucenter/control/carControl.wxss

@@ -0,0 +1,145 @@
+.pg {
+    position: relative;
+    /* height: calc(100% - 640rpx); */
+    background: #fff;
+    padding: 20rpx 30rpx 0 30rpx;
+    box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;
+    width: calc(100% - 60rpx);
+  }
+  .charging_text_title {
+    height: 105rpx;
+    width: 100%;
+    display: flex;
+    margin-bottom: 20rpx;
+  }
+  
+  .charging_text_title1 {
+    width: 100%;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+  }
+  .charging {
+    width: 62rpx;
+    height: 62rpx;
+    margin: 30rpx 30rpx 30rpx 0;
+    flex-shrink: 0;
+    overflow: hidden;
+  }
+  .charging image {
+    width: 62rpx;
+    height: 62rpx;
+  }
+  
+  text {
+    margin: 0 0 18rpx 0;
+    display: block;
+    font-size: 26rpx;
+    font-family: 'Lucida Sans',
+                   'Lucida Sans Regular',
+                   'Lucida Grande',
+                   'Lucida Sans Unicode',
+                   Geneva,
+                   Verdana,
+                   sans-serif;
+    color: #231400;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+    line-height: 30rpx;
+    min-height: 30rpx;
+  }
+
+
+  text.bold {
+    font-weight: bold;
+    line-height: 34rpx;
+    height: 34rpx;
+    min-height: 34rpx;
+    margin-top: 28rpx;
+    margin-bottom: 8rpx;
+    display: block;  
+    font-size: 30rpx;
+  }
+  
+  text.inline {
+    display: inline-block;
+    color: #575757;
+    margin-top:18rpx;
+    margin-bottom: 0;
+  }
+  
+  .h1 {
+    margin: 0rpx 0rpx 24rpx 0rpx;
+    font-size: 24rpx;
+    line-height: 28rpx;
+    height: 28rpx;
+    min-height: 28rpx;
+    color: #a3a3a3;
+  }
+
+  .btn {
+    width: 80%;
+    font-size: 32rpx;
+    /* margin: 0rpx 32rpx; */
+    font-family: 'Lucida Sans',
+                   'Lucida Sans Regular',
+                   'Lucida Grande',
+                   'Lucida Sans Unicode',
+                   Geneva,
+                   Verdana,
+                   sans-serif;
+    
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    border: #bbbbbb 1rpx solid;
+    background-color: #FFF;
+    color: #00a8dc;
+    border-radius: 40rpx;
+    height: 80rpx;
+    line-height: 80rpx;
+  }
+  .stitle{
+    line-height:40rpx;font-size:28rpx;margin:20rpx 0;word-wrap: break-word;
+  }
+
+  .btn.active{
+    background-color: #00a8dc;
+    color: #fff;
+  }
+
+  .btn.b1{
+    /* width: 80%; */
+}
+  .btn.b2{
+      /* width: 40%; */
+  }
+
+  .btn.b3{
+    /* width: 30%; */
+}
+  
+  .vbtn{
+    width: 100%;
+    display: grid;
+    margin:50rpx 0;
+  }
+  .vbtn.v1{
+    margin:0;
+    margin-top:60rpx;
+    grid-template-columns: auto;
+  }
+  .vbtn.v2{
+    margin:30rpx 0;
+    grid-template-columns: auto auto;
+    
+  }
+  .vbtn.v3{
+    margin:30rpx 0;
+    grid-template-columns: auto auto auto;
+    grid-row-gap: 30rpx;
+  }
+  .char4{
+    font-size: 24rpx;
+  }
+  

+ 17 - 0
pages/ucenter/index/index.js

@@ -282,6 +282,23 @@ Page({
     // });
     wx.navigateBack();
   },
+  goCarControl(){
+    wx.navigateTo({
+        url: '/pages/ucenter/control/carControl',
+      })
+  },
+  goBatteryControl(){
+    // wx.scanCode({
+    //     success (res) {
+    //       wx.navigateTo({
+    //         url: '/pages/ucenter/control/batteryControl?code=' +  res.result,
+    //       })
+    //     }
+    //   })
+      wx.navigateTo({
+        url: '/pages/ucenter/control/batteryControl',
+      })
+  }
   /*,
   goLogin: function() {
     wx.navigateTo({

+ 25 - 0
pages/ucenter/index/index.wxml

@@ -168,6 +168,31 @@
           <image src='/images/enter.png'></image>
         </view>
       </view>
+
+      <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>
+        <view class="zan-text">
+          <text>电池包控制</text>
+        </view>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
+      </view>
+      <view class="zan-cell"  wx:if='{{userInfo.flag==null?1:!userInfo.flag}}' hover-class="active" bindtap="goCarControl">
+        <view class="zan-icon">
+          <image src='/images/column.png'></image>
+        </view>
+        <view class="zan-text">
+          <text>车辆控制</text>
+        </view>
+        <view class="zan-ft">
+          <image src='/images/enter.png'></image>
+        </view>
+      </view>
+
+
       <view class="zan-cell" hover-class="active" bindtap="goAgreement">
         <view class="zan-icon">
           <!-- <image src='/images/help.png'></image> -->

+ 1 - 3
project.config.json

@@ -135,11 +135,9 @@
     "tabIndent": "insertSpaces",
     "tabSize": 2
   },
-  "libVersion": "2.25.1",
   "packOptions": {
     "ignore": [],
     "include": []
   },
-  "appid": "wx6e03e5ada030b1aa",
-  "projectname": "%E5%85%85%E7%94%B5%E6%A1%A9"
+  "appid": "wx6e03e5ada030b1aa"
 }

+ 1 - 1
project.private.config.json

@@ -4,5 +4,5 @@
   "setting": {
     "compileHotReLoad": true
   },
-  "libVersion": "3.2.4"
+  "libVersion": "3.3.4"
 }