XWookey hace 1 año
padre
commit
5e9f3dedc0

+ 4 - 2
app.json

@@ -2,6 +2,7 @@
   "pages": [
     "pages/index/index",
     "pages/routes/routes",
+    "pages/charginfo/charginfo",
     "pages/info/info",
     "pages/inputtip/inputtip",
     "pages/ucenter/index/index",
@@ -21,6 +22,7 @@
     "pages/ucenter/myworksheet/myworksheet",
     "pages/outmoney/outmoney",
     "pages/worksheetinfo/worksheetinfo",
+    "pages/worksheetinfo/addworksheetinfo",
     "pages/worksheetinfo/accendant",
     "pages/forget/forget",
     "pages/reset_password/reset_password",
@@ -31,7 +33,8 @@
     "pages/ucenter/chargpilemonitor/chargpilemonitor",
     "pages/ucenter/chargpilemonitor/chargpilemonitorsearch",
     "pages/chargemoneyresult/chargemoneyresult",
-    "pages/ucenter/help/help"
+    "pages/ucenter/help/help",
+    "pages/worksheetinfo/findstation"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -51,7 +54,6 @@
     "request": 300000,
     "connectSocket": 300000
   },
-  
   "debug": false,
   "sitemapLocation": "sitemap.json"
 }

+ 300 - 0
pages/charginfo/charginfo.js

@@ -0,0 +1,300 @@
+import * as echarts from '../../ec-canvas/echarts';
+import * as lf from '../../ec-canvas/echarts-liquidfill';
+
+
+let log = require('../../utils/log.js');
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    name:'',
+    address:'', 
+    chargprice: '', 
+    serviceprice: '', 
+    chargid: '',
+    sumprice: '',
+    fastFree:0,
+    slowFree:0,
+    fastSum:0,
+    slowSum:0,
+    pagesize:30,
+    pagenum:1,
+    total:-1,
+    loadTotal: 0,
+    dataLoading: false,
+    finishedLoadTap: 0,
+    chargList: [],
+  },
+
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(e) {
+    let { name, address, chargprice, serviceprice, chargid } = e;
+
+    name =  name=='null'?null:name;
+    address =  address=='null'?null:address;
+    chargprice =  chargprice=='null'?null:chargprice;
+    serviceprice =  serviceprice=='null'?null:serviceprice;
+    chargid =  chargid=='null'?null:chargid;
+    let sumprice = (chargprice==null || serviceprice==null)? null:chargprice+serviceprice;
+    this.setData({
+      name,
+      address,
+      chargprice,
+      serviceprice,
+      chargid,
+      sumprice
+    });
+    let that = this;
+    this.getPage();
+  },
+  getPage(){
+
+    if(this.data.chargList.length == this.data.total){
+      this.setData({
+        finishedLoadTap:this.data.finishedLoadTap+1
+      })
+      if(this.data.finishedLoadTap>0){
+        wx.showToast({
+          title: '全部加载完毕',
+          icon: 'success',
+          duration: 2000
+        })
+      }
+      return
+    }
+
+    if(this.data.dataLoading){
+      return
+    }
+    this.setData({
+      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: 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{
+            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.fastSum,
+          slowFree : res.data.fastFree,
+          fastSum : res.data.fastSum,
+          slowSum : res.data.slowSum
+        });
+      }
+    });
+
+  },
+  goScanResult(){
+    // scan_result
+
+    wx.showLoading({
+      title: '努力加载中...',
+    })
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    
+    let that = this;
+    if (!isLogin) {
+      log.info('[首页]', '[未登陆跳转登录界面]');
+      let url = `/pages/login/login`;
+      wx.hideLoading();
+      wx.navigateTo({
+        url
+      });
+      return;
+    } else {
+      log.info('[首页]', '[获取用户是否有未支付订单]', '[请求]', { userId: userInfo.userId });
+      wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatsettlement',
+        data: {
+          userId: userInfo.userId
+        },
+        method: 'POST',
+        success(res) {
+          let {
+            data
+          } = res;
+          let {
+            result: order
+          } = data;
+          log.info('[首页]', '[获取用户是否有未支付订单]', '[响应]', data);
+          if (data && order && data.code == 200) {
+            wx.hideLoading();
+            log.info('[首页]', '[用户有未支付订单跳转订单支付界面]');
+            wx.showModal({
+              showCancel: false,
+              content: '你有未支付的订单,请先支付',
+              success: function (res) {
+                //console.log(res);
+                if (!res.cancel) {
+                  //点击确定
+                  let url = `/pages/order/order?orderid=${order.orderid}&userId=${order.userId}&chargPileId=${order.chargPileId}`;
+                  wx.navigateTo({
+                    url
+                  });
+                }
+              }
+            });
+            //console.log(that.data.result);
+          } else {
+            //console.log('无订单');
+            log.info('[首页]', '[用户无未支付订单]');
+
+            wx.request({
+              url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
+              // data: scanResult,
+              data: {
+                chargPileId: chargid,
+                userId: userInfo.userId
+              },
+              method: 'POST',
+              success(res) {
+                console.log(chargid);
+                log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
+                if (!res.data || res.data.code == 500) {
+                  that.scanFlag = false;
+                  wx.hideLoading();
+                  //没有该充电桩信息
+                  wx.showModal({
+                    showCancel: false,
+                    content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号'
+                  });
+                } 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: '终端故障,维修中'
+                    });
+                  } else if (res.data.chargstatus == 3 || res.data.chargstatus == 8 || res.data.chargstatus == 10) {
+                    wx.showModal({
+                      showCancel: false,
+                      content: '正在充电中'
+                    });
+                  } 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.hideLoading();
+                    wx.navigateTo({
+                      url
+                    });
+                  }
+                  wx.hideLoading();
+                }
+              },
+              fail(e) {
+                getApp().showNetworkError();
+              }
+            });
+
+          }
+        },
+        fail(e) {
+          that.scanFlag = false;
+          wx.hideLoading();
+          getApp().showNetworkError();
+        }
+      });
+    }
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function(e) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function() {
+
+  },
+  bindScrollTolowerEvent: function(){
+    this.getPage();
+  },
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  }
+})

+ 3 - 0
pages/charginfo/charginfo.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "充电站详情"
+}

+ 49 - 0
pages/charginfo/charginfo.wxml

@@ -0,0 +1,49 @@
+<!--pages/charging/charging.wxml-->
+<view class="charginfo" hover-class='active'>
+
+  <view class="map_text">
+    <view class="map_text_info">
+      <view class='charging_text_title'>
+        <view class='charging_text_title1'>
+          <text class='name'>{{name}}</text>
+          <text class="grey">{{address}}</text>
+        </view>
+      </view>
+      <text class='inline yellow'>{{sumprice == null? '暂无电费' : ' ¥ ' + sumprice}}</text>
+      <text class='inline grey'>{{chargprice == null? '暂无实时电费' : '实时电费' + chargprice + ' 元/度'}} {{serviceprice == null? '暂无服务费': '服务费' + serviceprice + ' 元/度'}}</text>
+      <text class='inline red'>电费收费标准详见启动充电页面</text>
+	  <view class="btn_list">
+		  <view class="btn">
+			  <view class="icon">快</view>
+			  <view class="status">空闲 {{fastFree}} / 共 {{fastSum}}</view>
+		  </view>
+		  <view class="btn slow">
+			  <view class="icon slow">慢</view>
+			  <view class="status">空闲 {{slowFree}} / 共 {{slowSum}}</view>
+	  </view>
+    </view>
+    </view>
+
+  </view>
+  <view class="title_list">终端列表</view>
+
+  <scroll-view class='context' scroll-y='true' bindscrolltolower="bindScrollTolowerEvent" >
+    <view class="charg"  hover-class='active' data-keywords="{{item}}" wx:key='{{key}}' wx:for="{{chargList}}"   bindtap="{{item.chargstatusname=='空闲中'?'goScanResult':''}}">
+      <view class="runstatus {{item.chargstatusclass}}">
+        <view class="runstatus_inner ">
+          {{item.chargstatusname}}
+        </view>
+      </view>
+      <view class="chargInfo_v">
+      <view class="chargInfo_v_name">{{item.chargStationName}}</view>
+      <view class="chargInfo_v_id">{{item.chargPileId}}</view>
+      </view>
+      <view class="iconleft" >
+        <view class="icon {{item.pileType=='慢充'?'slowBar':'fastBar'}}">{{item.pileType=='慢充'?'慢':'快'}}</view>
+        <view class="startpower" wx:if="{{item.chargstatusname=='空闲中'}}" >启动充电 ></view>
+      </view>
+    </view>
+  </scroll-view>
+  <view class = "bottomm"></view>
+
+</view>

+ 243 - 0
pages/charginfo/charginfo.wxss

@@ -0,0 +1,243 @@
+/* pages/charging/charging.wxss */
+
+page {
+  background-color: #efefef;
+  height: 100%;
+  overflow-y: hidden;
+  
+}
+
+.charginfo{
+  height: 100%;
+}
+
+.map_text{
+  background:#FFFFFF;
+  height: 280rpx;
+  margin: 12rpx 0;
+  padding:20rpx 40rpx;
+}
+
+.map_text_info{
+  width: 100%;
+  display: inline-block;
+}
+
+.charging_text_title1 {
+  width: 100%;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.charging_text_title1 {
+  width: 100%;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+text.name {
+  line-height: 50rpx;
+  display: block;
+  font-size: 32rpx;
+}
+text.inline{
+ display: block;
+ margin:0;
+}
+.grey {
+  font-size: 22rpx;
+  line-height: 42rpx;
+  height: 42rpx;
+  min-height: 42rpx;
+  color: #9d9d9d;
+  margin: 0;
+}
+text.border{
+ line-height: 40rpx;
+ height: 40rpx;
+ color: #9d9d9d;
+ font-size: 20rpx;
+}
+text.yellow {
+  color: #da8527;
+  font-size: 24rpx;
+  /* font-weight: bold; */
+}
+
+text.red {
+  font-size: 20rpx;
+  color: #BD3124;
+  /* font-weight: bold; */
+}
+text.price {
+  font-size: 20rpx;
+  color: #9d9d9d;
+}
+.context {
+  height: calc(100% - 480rpx);
+}
+
+.chargprice {
+  height: 50rpx;
+  margin-bottom: 4rpx;
+}
+.chargprice text {
+  height: 50rpx;
+  min-height: 50rpx;
+  line-height: 50rpx;
+}
+.btn_list{
+    width: 100%;
+    height: 80rpx;
+    display: flex;
+    justify-content: space-around;
+    flex-direction: row;
+    margin: 10rpx 0;
+}
+.btn{
+  width: 280rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  background: #35b2ab;
+  border-radius: 60rpx;
+  font-size: 28rpx;
+  flex-direction: row;
+}
+
+.icon{
+  width: 40rpx;
+  height: 40rpx;
+  background: #FFFFFF;
+  color: #35b2ab;
+  margin: 10rpx 20rpx;
+  display: inline-block;
+  line-height: 40rpx;
+  text-align: center;
+  border-radius: 10rpx;
+  border: 1rpx solid #BBBBBB;
+}
+
+.icon.slow{
+  color: #e29e53;
+}
+
+.icon.slowBar{
+  color: #e29e53;
+  border: 1rpx solid #e29e53;
+}
+
+.icon.fastBar{
+  color: #35b2ab;
+  border: 1rpx solid #35b2ab;
+}
+
+.btn.slow{
+  background: #e29e53;
+}
+
+.status{
+  display: inline-block;
+    color: #FFFFFF;
+    line-height: 60rpx;
+}
+
+.title_list{
+  width:100%;
+  height:100rpx;
+  background:#FFFFFF;
+  font-size:30rpx;
+  text-align: center;
+  line-height: 100rpx;
+}
+
+.charg{
+  height: 150rpx;
+  width: calc(100% - 12rpx);
+  border-radius: 20rpx;
+  margin: 12rpx 8rpx;
+  background: #FFFFFF;
+  flex-direction: row;
+  display: flex;
+  justify-content: space-between;
+}
+
+.runstatus{
+  width: 100rpx;
+  height: 100rpx;
+  background-color: #35B2AB;
+  border-radius: 50%;
+  margin: 20rpx;
+  color: #35B2AB;
+}
+
+
+.runstatus_inner{
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 50%;
+  background-color: #ffff;
+  position: relative;
+  top: 10rpx;
+  left: 10rpx;
+  text-align: center;
+  line-height: 80rpx;
+  font-size: 22rpx;
+
+}
+.runstatus.chargstatus_kxz{
+  background-color: #35B2AB;
+  color: #35B2AB;
+}
+.runstatus.chargstatus_ycq{
+  background-color: #00AADD;
+  color: #00AADD;
+}
+
+.runstatus.chargstatus_cdz{
+  background-color: #00AADD;
+  color: #00AADD;
+}
+
+.runstatus.chargstatus_gz{
+  background-color: #E29E53;
+  color: #E29E53;
+}
+
+.chargInfo_v{
+  flex-direction: column;
+  justify-content: center;
+  display: flex;
+  width: 400rpx;
+  color: #888888;
+  font-size: 28rpx;
+  height: 100%;
+}
+
+.chargInfo_v_name{
+  width: 100%;
+}
+
+.iconleft{
+  width: 150rpx;
+  display: flex;
+  margin: 0 10rpx;
+  flex-direction: column;
+}
+
+.iconleft .icon{
+  margin-top: 20rpx;
+  margin-left: 60rpx;
+}
+
+.startpower{
+  font-size: 26rpx;
+  margin: 10rpx 0;
+  color: #039BE5;
+}
+
+.bottomm{
+  height: 60rpx;
+  width: 100%;
+}

+ 34 - 0
pages/index/index.js

@@ -525,6 +525,40 @@ Page({
       markerId
     });
   },
+  seeInfo(e){
+    //console.log(e);
+    // 起点
+    let {
+      user_lat: latitude,
+      user_lon: longitude,
+      markers,
+      markerId,
+      city,
+      textData
+    } = this.data;
+    let {
+      name,
+      address,
+      chargprice,
+      serviceprice,
+    } = textData;
+    if (!markers.length) return;
+    // 终点
+    markers.forEach((item, index) => {
+      if (markerId && markerId == item.id) {
+        let {
+          name: latitude2,
+          longitude: longitude2
+        } = item;
+        let url = `/pages/charginfo/charginfo?name=${name}&address=${address}&chargprice=${chargprice}&serviceprice=${serviceprice}&chargid=${markerId}`;
+        //console.log(url);
+        wx.navigateTo({
+          url
+        });
+      }
+    });
+
+  },
   //导航
   getRoute(e) {
     //console.log(e);

+ 2 - 2
pages/index/index.wxml

@@ -32,8 +32,8 @@
       </cover-view>
     </map>
   </view>
-  <view class="map_text" hover-class='active' wx:if="{{textData}}">
-  <view class="see_info" bindtap='seeInfo'>查看详情 > </view>
+  <view class="map_text" hover-class='active' wx:if="{{textData}}" bindtap='seeInfo'>
+  <view class="see_info" >查看详情 > </view>
     <view class="map_text_info">
       <view class='charging_text_title'>
         <view class='charging_text_title1'>

+ 2 - 2
pages/register/register.js

@@ -286,7 +286,7 @@ Page({
         //console.log(res1);
         //console.log(res1.data.code == 1);
         if (res.data.code == 1) {
-            this.setData({
+            that.setData({
               vcodeTimeOut:0,
               vcodeFlag:true,
               vcode_button_text:'获取验证码'
@@ -298,7 +298,7 @@ Page({
             confirmColor:'#4359b5'
           });
         }else if (res.data.code == 2) {
-          this.setData({
+          that.setData({
             vcodeTimeOut:0,
             vcodeFlag:true,
             vcode_button_text:'获取验证码'

+ 0 - 1
pages/ucenter/chargemoneylog/chargemoneylog.wxml

@@ -19,5 +19,4 @@
     <text class='state'>成功</text>
   </view>
   
-
 </scroll-view>

+ 7 - 0
pages/ucenter/myworksheet/myworksheet.js

@@ -22,6 +22,13 @@ Page({
     });
   },
 
+  addNew(e) {
+    let url = '/pages/worksheetinfo/addworksheetinfo';
+    wx.navigateTo({
+      url
+    });
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */

+ 29 - 27
pages/ucenter/myworksheet/myworksheet.wxml

@@ -1,31 +1,33 @@
 <!--pages/ucenter/myworksheet/myworksheet.wxml-->
-<scroll-view class='context' scroll-y='true'>
-  <view class='context_block'></view>
-  <view bindtap="goInfo" class="map_text" hover-class='active' data-keywords="{{item}}" wx:key='{{key}}' wx:for="{{worksheets}}">
-    <view class='worksheet_text_title'>
-      <view class='worksheet'>
-        <image src='/images/myworksheet.png'></image>
+<view class="container">
+  <view class="addNew" bindtap="addNew">新增工单</view>
+  <scroll-view class='context' scroll-y='true'>
+    <view bindtap="goInfo" class="map_text" hover-class='active' data-keywords="{{item}}" wx:key='{{key}}' wx:for="{{worksheets}}">
+      <view class='worksheet_text_title'>
+        <view class='worksheet'>
+          <image src='/images/myworksheet.png'></image>
+        </view>
+        <view class='worksheet_text_title1'>
+          <text class='bold inline'>{{item.chargStationName}}</text>
+          <text class="h1 inline">{{item.mainLocation==null?'':item.mainLocation}}</text>
+        </view>
       </view>
-      <view class='worksheet_text_title1'>
-        <text class='bold inline'>{{item.chargStationName}}</text>
-        <text class="h1 inline">{{item.mainLocation==null?'':item.mainLocation}}</text>
+      <text wx:if="{{item.workStatus==null}}">工作状态:未知</text>
+      <text wx:if="{{item.workStatus==1}}">工作状态:新建</text>
+      <text wx:if="{{item.workStatus==2}}">工作状态:人员指派</text>
+      <text wx:if="{{item.workStatus==3}}">工作状态:指派确认</text>
+      <text wx:if="{{item.workStatus==4}}">工作状态:施工前安全准备</text>
+      <text wx:if="{{item.workStatus==5}}">工作状态:进行中</text>
+      <text wx:if="{{item.workStatus==6}}">工作状态:已完成</text>
+      <text wx:if="{{item.workStatus==7}}">工作状态:完成确认</text>
+      <text wx:if="{{item.workBigclass==null}}">工单类型:未知</text>
+      <text wx:if="{{item.workBigclass==1}}">工单类型:售后服务</text>
+      <text wx:if="{{item.workBigclass==2}}">工单类型:工程实施</text>
+      <text>预计完成时间:{{item.exceptTime}}</text>
+      <text>工单创建时间:{{item.workCreatetime}}</text>
+      <view id="{{item.id}}" class='detail' bindtap="getRoute">详情
+        <image src='/images/detail.png'></image>
       </view>
     </view>
-    <text wx:if="{{item.workStatus==null}}">工作状态:未知</text>
-    <text wx:if="{{item.workStatus==1}}">工作状态:新建</text>
-    <text wx:if="{{item.workStatus==2}}">工作状态:人员指派</text>
-    <text wx:if="{{item.workStatus==3}}">工作状态:指派确认</text>
-    <text wx:if="{{item.workStatus==4}}">工作状态:施工前安全准备</text>
-    <text wx:if="{{item.workStatus==5}}">工作状态:进行中</text>
-    <text wx:if="{{item.workStatus==6}}">工作状态:已完成</text>
-    <text wx:if="{{item.workStatus==7}}">工作状态:完成确认</text>
-    <text wx:if="{{item.workBigclass==null}}">工单类型:未知</text>
-    <text wx:if="{{item.workBigclass==1}}">工单类型:售后服务</text>
-    <text wx:if="{{item.workBigclass==2}}">工单类型:工程实施</text>
-    <text>预计完成时间:{{item.exceptTime}}</text>
-    <text>工单创建时间:{{item.workCreatetime}}</text>
-    <view id="{{item.id}}" class='detail' bindtap="getRoute">详情
-      <image src='/images/detail.png'></image>
-    </view>
-  </view>
-</scroll-view>
+  </scroll-view>
+</view>

+ 14 - 1
pages/ucenter/myworksheet/myworksheet.wxss

@@ -6,7 +6,7 @@ page {
 }
 
 .context {
-  height: 100%;
+  height: calc(100% - 68rpx);
 }
 .context_block{
   width: 100%;
@@ -101,3 +101,16 @@ text.inline {
   width: 22rpx;
   height: 17rpx;
 }
+
+.addNew{
+  background: #F29B76;
+  height: 68rpx;
+  margin: 30rpx 20rpx;
+  border-radius: 60rpx;
+  width: calc(100% - 40rpx);
+  color: #FFFFFF;
+  font-size: 32rpx;
+  line-height: 68rpx;
+  text-align: center;
+  font-weight: bold;
+}

+ 588 - 0
pages/worksheetinfo/addworksheetinfo.js

@@ -0,0 +1,588 @@
+// pages/worksheetinfo/worksheetinfo.js
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    images: [],
+    signs: [],
+    worksheetinfo: {},
+    chargstations: [],
+    chargstationsindex: 0,
+    pcitures: [],
+    workstatus: [{
+      value: 1,
+      text: '新建'
+    }, {
+      value: 2,
+      text: '人员指派'
+    }, {
+      value: 3,
+      text: '指派确认'
+    }, {
+      value: 4,
+      text: '施工前安全准备'
+    }, {
+      value: 5,
+      text: '进行中'
+    }
+    // , {
+    //   value: 6,
+    //   text: '已完成'
+    // }
+    , {
+      value: 7,
+      text: '完成确认'
+    }],
+    workstatusindex: 0,
+    workBigclass: [{
+      value: 1,
+      text: '售后服务'
+    }, {
+      value: 2,
+      text: '工程实施'
+    }],
+    workBigclassindex: 0,
+    workSmallclass:[{
+      value: 1,
+      text: '日常巡站'
+      }, {
+      value: 2,
+      text: '紧急维修'
+      }, {
+      value: 3,
+      text: '施工准备'
+      }, {
+      value: 4,
+      text: '工程进程'
+      }, {
+      value: 5,
+      text: '施工过程'
+      }, {
+      value: 6,
+      text: '工程竣工'
+      }, {
+      value: 7,
+      text: '工程验收'
+      }],
+    workSmallclassIndex: 0,
+    breakdownType: [{
+      value: 1,
+      text: '车辆导致'
+    }, {
+      value: 2,
+      text: '桩体导致'
+    }, {
+      value: 3,
+      text: '人为导致'
+    }, {
+      value: 4,
+      text: '基础设施问题'
+    }, {
+      value: 5,
+      text: '其他'
+    }],
+    breakdownTypeindex: null,
+    exceptdate: null,
+    excepttime: null,
+    finishdate: null,
+    finishtime: null,
+    accendantids: [],
+    userNames:[],
+
+    school_name:'',
+    school_id:'',
+    schoolValidate:'',
+
+  },
+  bindChargstationsChange: function(e) {
+    if (this.data.chargstationsindex != e.detail.value) {
+      console.log('picker发送选择改变,携带值为', e.detail.value)
+      let chargstationid = this.data.chargstations[e.detail.value].id;
+      let worksheetinfo = this.data.worksheetinfo;
+      worksheetinfo.accendant = null;
+      worksheetinfo.chargStationId = chargstationid;
+      this.setData({
+        chargstationsindex: e.detail.value,
+        worksheetinfo
+      })
+    }
+
+  },
+  bindWorkstatusChange: function(e) {
+    //console.log('picker发送选择改变,携带值为', e.detail.value)
+    let workStatus = this.data.workstatus[e.detail.value].value;
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.workStatus = workStatus;
+    this.setData({
+      workstatusindex: e.detail.value,
+      worksheetinfo
+    });
+  },
+  bindWorkBigclassChange: function(e) {
+    //console.log('picker发送选择改变,携带值为', e.detail.value)
+    let workBigclass = this.data.workBigclass[e.detail.value].value;
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.workBigclass = workBigclass;
+    this.setData({
+      workBigclassindex: e.detail.value,
+      worksheetinfo
+    });
+  },
+  bindWorkSmallclassChange: function(e) {
+    //console.log('picker发送选择改变,携带值为', e.detail.value)
+    let workSmallclass = this.data.workSmallclass[e.detail.value].value;
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.workSmallclass = workSmallclass;
+    this.setData({
+      workSmallclassindex: e.detail.value,
+      worksheetinfo
+    });
+  },
+  bindBreakdownType(e) {
+    //console.log('picker发送选择改变,携带值为', e.detail.value)
+    let breakdownType = this.data.breakdownType[e.detail.value].value;
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.breakdownType = breakdownType;
+    this.setData({
+      breakdownTypeindex: e.detail.value,
+      worksheetinfo
+    });
+  },
+  bindAccendantChange: function(e) {
+    console.info(this.data.chargstations)
+    console.info(this.data.chargstationsindex)
+    console.info(this.data.chargstationsindex)
+    let chargstationid = this.data.chargstations[this.data.chargstationsindex].id;
+    let accendant = this.data.worksheetinfo.accendant;
+    let url = `/pages/worksheetinfo/accendant?chargstationid=${chargstationid}&accendant=${accendant}`;
+    wx.navigateTo({
+      url
+    });
+  },
+  bindExceptdateChange(e) {
+    this.setData({
+      exceptdate: e.detail.value
+    })
+  },
+  bindExcepttimeChange(e) {
+    this.setData({
+      excepttime: e.detail.value
+    })
+  },
+  bindFinishdateChange(e) {
+    this.setData({
+      finishdate: e.detail.value
+    })
+  },
+  bindFinishtimeChange(e) {
+    this.setData({
+      finishtime: e.detail.value
+    })
+  },
+  bindMainLocationInput(e) {
+    let mainLocation = e.detail.value;
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.mainLocation = mainLocation;
+    this.setData({
+      worksheetinfo
+    });
+  },
+  bindContentInput(e) {
+    let content = e.detail.value;
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.content = content;
+    this.setData({
+      worksheetinfo
+    });
+  },
+  bindWorkSheetSubmit(e) {
+    let worksheetinfo = this.data.worksheetinfo;
+    worksheetinfo.operatorName = this.data.userNames.length>0?this.data.userNames[0]:"";
+    worksheetinfo.pams = this.data.accendantids;
+    worksheetinfo.accendant = null;
+    if (this.data.exceptdate && this.data.excepttime) {
+      worksheetinfo.exceptTime = this.data.exceptdate + " " + this.data.excepttime + ":00";
+    }
+    if (this.data.finishdate && this.data.finishtime){
+      worksheetinfo.finishTime = this.data.finishdate + " " + this.data.finishtime + ":00";
+    }
+    let images = this.data.images;
+    var imgString = [];
+    
+    var pciString = [];
+    this.data.pcitures.forEach((item, index) =>{
+      pciString.push(item.src);
+    });
+
+    let signs = this.data.signs;
+    console.log(signs.length == 0);
+    var signString = [];
+    if (signs.length == 0) {
+      //2021-1-1撤销校验
+      // wx.showToast({
+      //   title: '请设置签名',
+      //   icon: 'loading',
+      //   duration: 2000,
+      //   mask: true,
+      //   success: function() {}
+      // });
+      // return;
+    } else {
+      signs.forEach((item, index) => {
+        wx.uploadFile({
+          url: getApp().globalData.postHeadAgreement + '/restapi/wechat/editWorkSheetImg',
+          filePath: signs[index],
+          name: 'imageFileName',
+          success: function(res) {
+            let result = JSON.parse(res.data);
+            if (result.code == 500) {
+              wx.showModal({
+                showCancel: false,
+                content: result.msg
+              });
+            } else {
+              signString.push(result.msg);
+              console.log(signString);
+            }
+          }
+        });
+      });
+    }
+    var uploadSignOverFlag = setInterval(function() {
+      if (signString.length == signs.length) {
+        clearInterval(uploadSignOverFlag);
+        if (images.length == 0) {
+          if (worksheetinfo.pciture) {
+            console.log(worksheetinfo.pciture);
+            worksheetinfo.pciture = (pciString.concat(imgString).concat(signString)).join(",");
+            //worksheetinfo.pciture = ((worksheetinfo.pciture.split(",")).concat(signString)).join(",");
+            console.log(worksheetinfo.pciture);
+          }
+          console.info("===============================")
+          console.info(worksheetinfo)
+          console.info("===============================")
+          wx.request({
+            url: getApp().globalData.postHeadAgreement + '/restapi/wechat/saveWorkSheet',
+            data: worksheetinfo,
+            method: 'POST',
+            success(res) {
+              //console.log(res);
+              if (res.data.code == 500) {
+                wx.showModal({
+                  showCancel: false,
+                  content: res.data.msg
+                });
+              } else {
+                wx.navigateBack();
+              }
+            }
+          });
+        } else {
+
+          images.forEach((item, index) => {
+            wx.uploadFile({
+              url: getApp().globalData.postHeadAgreement + '/restapi/wechat/editWorkSheetImg',
+              filePath: images[index],
+              name: 'imageFileName',
+              success: function(res) {
+                let result = JSON.parse(res.data);
+                if (result.code == 500) {
+                  wx.showModal({
+                    showCancel: false,
+                    content: result.msg
+                  });
+                } else {
+                  imgString.push(result.msg);
+                  console.log(imgString);
+                  if (index == (images.length - 1)) {
+                    var uploadImgOverFlag = setInterval(function() {
+                      if (imgString.length == images.length) {
+                        clearInterval(uploadImgOverFlag);
+                        //worksheetinfo.pciture = ((worksheetinfo.pciture.split(",")).concat(signString)).join(",");
+                        worksheetinfo.pciture = (pciString.concat(imgString).concat(signString)).join(",");
+                        //var images = this.data.images.concat(res.tempFilePaths);
+                        console.info("===============================")
+                        console.info(worksheetinfo)
+                        console.info("===============================")
+                        wx.request({
+                          url: getApp().globalData.postHeadAgreement + '/restapi/wechat/saveWorkSheet',
+                          data: worksheetinfo,
+                          method: 'POST',
+                          success(res) {
+                            //console.log(res);
+                            if (res.data.code == 500) {
+                              wx.showModal({
+                                showCancel: false,
+                                content: res.data.msg
+                              });
+                            } else {
+                              wx.navigateBack();
+                            }
+                          }
+                        });
+                      }
+                    }, 100);
+                  }
+                }
+              },
+              fail: function(data) {
+                console.log(data);
+              }
+            });
+          });
+        }
+      }
+
+    }, 100);
+
+
+  },
+  openImage(e) {
+    //var that = this;
+    var imgCount = (9 - this.data.pcitures.length) < 0 ? 0 : 9 - this.data.pcitures.length;
+    console.log(imgCount);
+    wx.chooseImage({
+      count: 9 - (this.data.pcitures.length + this.data.images.length),
+      //sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
+      //sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
+      success: res => {
+        //console.log(res);
+        var images = this.data.images.concat(res.tempFilePaths);
+        // 限制最多只能留下5张照片
+        images = images.length <= imgCount ? images : images.slice(0, imgCount);
+        if (images.length >= imgCount || imgCount<= 0){
+          wx.showToast({
+            title: '最多9张图片',
+            icon:'none'
+          });
+        }
+        this.setData({
+          //pcitures: [],
+          images
+        });
+      }
+    });
+  },
+  removeImage(e) {
+    //console.log(e);
+    //console.log(this.data.images);
+    let idx = e.currentTarget.dataset.idx;
+    var images = this.data.images;
+    images.splice(idx, 1);
+    this.setData({
+      images
+    });
+  },
+  removePciture(e) {
+    //console.log(e);
+    //console.log(this.data.images);
+    
+    let idx = e.currentTarget.dataset.idx;
+    var pcitures = this.data.pcitures;
+    pcitures.splice(idx, 1);
+    this.setData({
+      pcitures
+    });
+  },
+  removeSign(e) {
+    //console.log(e);
+    //console.log(this.data.images);
+    let idx = e.currentTarget.dataset.idx;
+    var signs = this.data.signs;
+    signs.splice(idx, 1);
+    this.setData({
+      signs
+    });
+  },
+  handleImagePreview(e) {
+    const idx = e.target.dataset.idx
+    const images = this.data.images
+    
+    wx.previewImage({
+      current: images[idx], //当前预览的图片
+      urls: images, //所有要预览的图片
+    })
+  },
+  handleSignPreview(e) {
+    const idx = e.target.dataset.idx
+    const signs = this.data.signs
+    //console.log(idx);
+    //console.log(signs);
+    //console.log(signs[idx]);
+    wx.previewImage({
+      current: signs[idx], //当前预览的图片
+      urls: signs, //所有要预览的图片
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+    //console.log(options);
+    // let {
+    //   worksheet
+    // } = options;
+    // //console.log(worksheet);
+    // let worksheetinfo = JSON.parse(worksheet);
+    // //worksheetinfo.breakdownType = 2;
+    // this.setData({
+    //   worksheetinfo
+    // });z
+    let worksheetinfo = {
+      workStatus: 0,
+      workBigclass: 0,
+      workSmallclass: 0,
+      chargStationId: 0,
+    }
+    this.setData({
+      worksheetinfo: worksheetinfo
+    });
+    this.setData({
+      workstatusindex: 0,
+      workBigclassindex: 0,
+      workSmallclassindex: 0,
+      chargstationsindex: 0,
+    });
+
+    // if (worksheetinfo.exceptTime) {
+    //   let datetime = worksheetinfo.exceptTime.split(" ");
+    //   this.setData({
+    //     exceptdate: datetime[0],
+    //     excepttime: datetime[1].substr(0, 5)
+    //   });
+    // }
+    // if (worksheetinfo.finishTime) {
+    //   let datetime = worksheetinfo.finishTime.split(" ");
+    //   this.setData({
+    //     finishdate: datetime[0],
+    //     finishtime: datetime[1].substr(0, 5)
+    //   });
+    // }
+    this.setData({
+      breakdownTypeindex: 0
+    });
+    
+
+    //console.log(worksheetinfo);
+
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    let that = this;
+    //console.log(12345);
+
+
+    if (userInfo && isLogin) {
+      wx.getLocation({
+        success: function(res) {
+          //console.log(res);
+          let {
+            latitude,
+            longitude,
+          } = res;
+          wx.request({
+            url: getApp().globalData.postHeadAgreement + '/restapi/wechat/userChargStationsWeb',
+            data: {
+              userId: userInfo.userId,
+              lat: latitude,
+              lon: longitude
+            },
+            method: 'POST',
+            success(res) {
+              //console.log(res);
+              let {
+                data: chargstations
+              } = res;
+              chargstations.forEach((item, index) => {
+                if (item.chargStationName && worksheetinfo && worksheetinfo.chargStationName && item.chargStationName == worksheetinfo.chargStationName) {
+                  that.setData({
+                    chargstationsindex: index
+                  });
+                }
+              });
+              that.setData({
+                chargstations
+              });
+            }
+          });
+        }
+      });
+    }
+    // wx.request({
+    //   url: getApp().globalData.postHeadAgreement + '/restapi/wechat/getuserworksheet',
+    //   data: worksheetinfo.id,
+    //   method: 'POST',
+    //   success(res) {
+    //     //console.log(res);
+    //     let accendantids = [];
+    //     let userNames = [];
+    //     res.data.forEach((item, index) => {
+    //       accendantids.push(item.userId);
+    //       userNames.push(item.userName);
+    //     });
+    //     that.setData({
+    //       accendantids,
+    //       userNames
+    //     });
+    //   }
+    // });
+  },
+  openSign(e) {
+    let url = `/pages/sign/sign`;
+    wx.navigateTo({
+      url
+    });
+
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  }
+})

+ 5 - 0
pages/worksheetinfo/addworksheetinfo.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "添加工单",
+  "navigationBarBackgroundColor": "#2483c0",
+  "usingComponents": {}
+}

+ 121 - 0
pages/worksheetinfo/addworksheetinfo.wxml

@@ -0,0 +1,121 @@
+<!--pages/worksheetinfo/worksheetinfo.wxml-->
+
+<lzcPicker ref="lzcPicker" change="changeItem" :pickerList="pickerList" pickerTittle='选择人物' />
+
+
+<scroll-view scroll-y='true'>
+  <view class="context">
+    <text>场站</text>
+    <picker class="picker" disabled="{{worksheetinfo.workStatus==6}}" bindchange="bindChargstationsChange" value="{{chargstationsindex}}" range-key="chargStationName" range="{{chargstations}}">
+      <text>{{chargstations[chargstationsindex].chargStationName}}</text>
+    </picker>
+  </view>
+  <view class="context">
+    <text>地址</text>
+    <input class='input' disabled="{{worksheetinfo.workStatus==6}}" bindinput='bindMainLocationInput' type='text' value='{{worksheetinfo.mainLocation}}'></input>
+  </view>
+  <view class="context">
+    <text>工单状态</text>
+    <picker class="picker" wx:if="{{worksheetinfo.workStatus!=6}}" bindchange="bindWorkstatusChange" value="{{workstatusindex}}" range-key="text" range="{{workstatus}}">
+      <text>{{workstatus[workstatusindex].text}}</text>
+    </picker>
+    <picker wx:if="{{worksheetinfo.workStatus==6}}" disabled="true" class="picker"  range-key="text" >
+      <text>已完成</text>
+    </picker>
+  </view>
+  <view class="context">
+    <text>工单大类</text>
+    <picker class="picker" disabled="{{worksheetinfo.workStatus==6}}" bindchange="bindWorkBigclassChange" value="{{workBigclassindex}}" range-key="text" range="{{workBigclass}}">
+      <text>{{workBigclass[workBigclassindex].text}}</text>
+    </picker>
+  </view>
+  <view class="context">
+    <text>工单小类</text>
+    <picker class="picker" disabled="{{worksheetinfo.workStatus==6}}" bindchange="bindWorkSmallclassChange" value="{{workSmallclassindex}}" range-key="text" range="{{workSmallclass}}">
+      <text>{{workSmallclass[workSmallclassindex].text}}</text>
+    </picker>
+  </view>
+  <!-- breakdownType故障原因:1车辆导致,2桩体导致,3人为导致,4基础设施问题,5其他 -->
+  <view class="context">
+    <text>故障原因</text>
+    <picker class="picker" disabled="{{worksheetinfo.workStatus==6}}" bindchange="bindBreakdownType" value="{{breakdownTypeindex}}" range-key="text" range="{{breakdownType}}">
+      <text>{{breakdownTypeindex==null?'请选择':breakdownType[breakdownTypeindex].text}}</text>
+    </picker>
+  </view>
+  <view class="context">
+    <text>维修人员</text>
+    <input disabled="{{worksheetinfo.workStatus==6}}" bindtap='{{worksheetinfo.workStatus==6?"":"bindAccendantChange"}}' class='input' type='text' value='{{worksheetinfo.accendant}}'></input>
+  </view>
+  <view class="context">
+    <text>工作内容</text>
+    <input class='input' disabled="{{worksheetinfo.workStatus==6}}"  bindinput='bindContentInput'  type='text' value='{{worksheetinfo.content}}'></input>
+  </view>
+  <view class="context">
+    <text>预计完成时间</text>
+    <picker class="picker1" disabled="{{worksheetinfo.workStatus==6}}" mode="date" value="{{exceptdate}}" bindchange="bindExceptdateChange">
+      <text>{{exceptdate==null?'0000-00-00':exceptdate}}</text>
+    </picker>
+    <picker class="picker2" disabled="{{worksheetinfo.workStatus==6}}" mode="time" value="{{excepttime}}" bindchange="bindExcepttimeChange">
+      <text>{{excepttime==null?'00:00':excepttime}}:00</text>
+    </picker>
+    <!-- <input class='input' type='text' value='{{worksheetinfo.exceptTime}}'></input> -->
+  </view>
+  <view class="context">
+    <text>工作完成截止时间</text>
+    <picker class="picker1" disabled="{{worksheetinfo.workStatus==6}}" mode="date" value="{{finishdate}}" bindchange="bindFinishdateChange">
+      <text>{{finishdate==null?'0000-00-00':finishdate}}</text>
+    </picker>
+    <picker class="picker2" disabled="{{worksheetinfo.workStatus==6}}" mode="time" value="{{finishtime}}" bindchange="bindFinishtimeChange">
+      <text>{{finishtime==null?'00:00':finishtime}}:00</text>
+    </picker>
+    <!-- <input class='input' type='text' value='{{worksheetinfo.finishTime}}'></input> -->
+  </view>
+  
+   <view wx:if="{{pcitures.length!=0}}" class="question-images">
+    <block wx:for="{{pcitures}}" wx:key="*this">
+      <view class="q-image-wrap">
+        <image wx:if="{{item.flag}}" class="q-image" src="{{item.src}}" mode="aspectFill" data-idx="{{index}}"></image>
+        <!-- 图片缩略图  -->
+        <image wx:if="{{!item.flag}}" class="q-image" src="{{item.url}}" mode="aspectFill" data-idx="{{index}}"></image>
+        <!-- <image wx:if="{{!item.flag}}" class="q-image" src="https://cdgl.pjnes.com/profile/station/{{item.src}}" mode="aspectFill" data-idx="{{index}}"></image> -->
+        <view wx:if="{{worksheetinfo.workStatus!=6}}" class="q-image-remover" data-idx="{{index}}" bindtap="removePciture">删除</view>
+      </view>
+    </block>
+  </view>
+
+  <view wx:if="{{images.length!=0}}" class="question-images">
+    <block wx:for="{{images}}" wx:key="*this">
+      <view class="q-image-wrap">
+        <!-- 图片缩略图  -->
+        <image class="q-image" src="{{item}}" mode="aspectFill" data-idx="{{index}}" bindtap="handleImagePreview"></image>
+        <!-- 移除图片的按钮  -->
+        <view class="q-image-remover" data-idx="{{index}}" bindtap="removeImage">删除</view>
+      </view>
+    </block>
+  </view>
+  <view class="context_image" wx:if="{{worksheetinfo.workStatus!=6}}">
+    <text>添加照片</text>
+    <view class="add" bindtap='openImage' hover-class='active'>
+      <text>+</text>
+    </view>
+  </view>
+  <view wx:if="{{signs.length!=0}}" class="question-images">
+    <block wx:for="{{signs}}" wx:key="*this">
+      <view class="q-image-wrap">
+        <!-- 图片缩略图  -->
+        <image class="q-image" src="{{item}}" mode="aspectFill" data-idx="{{index}}" bindtap="handleSignPreview"></image>
+        <!-- 移除图片的按钮  -->
+        <view class="q-image-remover" data-idx="{{index}}" bindtap="removeSign">删除</view>
+      </view>
+    </block>
+  </view>
+  <view class="context_image" wx:if="{{worksheetinfo.workStatus!=6}}">
+    <text>签名</text>
+    <view class="add" bindtap='openSign' hover-class='active'>
+      <text>+</text>
+    </view>
+  </view>
+</scroll-view>
+<view  class="School_Input"  style="{{school_id?'':'color:#808080'}};{{schoolValidate?'border:1rpx solid #BD3731':''}}" bindtap="showSchoolPicker">{{school_name}}
+        </view>
+<button wx:if="{{worksheetinfo.workStatus!=6}}" bindtap='bindWorkSheetSubmit' class='submitbutton'>提交</button>

+ 149 - 0
pages/worksheetinfo/addworksheetinfo.wxss

@@ -0,0 +1,149 @@
+/* pages/worksheetinfo/worksheetinfo.wxss */
+page {
+  height: 100%;
+  overflow-y: hidden;
+}
+scroll-view{
+  height:calc(100% - 180rpx);
+}
+.context {
+  margin: 0rpx 32rpx;
+  height: 87rpx;
+  border-bottom: 1rpx solid #f7f7f7;
+  line-height: 87rpx;
+  min-height: 87rpx;
+  display: flex;
+}
+
+text {
+  font-size: 28rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #545253;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+  flex-shrink: 0;
+}
+.picker{
+  width: 100%;
+  text-align: right;
+}
+.picker text{
+  color: #959595;
+}
+.picker1{
+  width: 100%;
+  text-align: right;
+}
+.picker1 text{
+  color: #959595;
+}
+.picker2{
+  flex-shrink: 0;
+  margin-left: 10rpx;
+  text-align: right;
+}
+.picker2 text{
+  color: #959595;
+}
+.input{
+  height: 87rpx;
+  line-height: 87rpx;
+  min-height: 87rpx;
+  color: #959595;
+  font-size: 28rpx;
+  text-align: right;
+  margin-right: 0;
+  width: 100%;
+}
+.context_image {
+  margin: 0rpx 32rpx;
+  height: 239rpx;
+  border-bottom: 1rpx solid #f7f7f7;
+  line-height: 87rpx;
+  min-height: 239rpx;
+}
+
+.context_image .add {
+  width: 120rpx;
+  height: 120rpx;
+  border: 1rpx solid #f7f7f7;
+  line-height: 120rpx;
+  min-height: 120rpx;
+}
+
+.add.active {
+  background-color: #ebebeb;
+}
+
+.add text {
+  width: 120rpx;
+  display: block;
+  color: #959595;
+  font-size: 80rpx;
+  font-weight: 100;
+  text-align: center;
+}
+
+.question-images {
+  margin: 0rpx 32rpx;
+  border-bottom: 1rpx solid #f7f7f7;
+}
+
+.q-image-wrap {
+  width: 120rpx;
+  height: 120rpx;
+  display: inline-block;
+  margin: 20rpx;
+}
+
+.q-image-wrap image {
+  width: 120rpx;
+  height: 120rpx;
+}
+
+.q-image-remover {
+  width: 120rpx;
+  height: 30rpx;
+  text-align: center;
+  font-size: 28rpx;
+  line-height: 30rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #545253;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+.submitbutton{
+  position: absolute;
+  bottom: 0;
+  width: calc(100% - 60rpx);
+  font-size: 32rpx;
+  margin: 50rpx 30rpx;
+  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: #2583c1;
+}
+.submitbutton.button-hover{
+  background-color: #1ca05e;
+}

+ 137 - 0
pages/worksheetinfo/findstation.js

@@ -0,0 +1,137 @@
+//logs.js
+let util = require('../../utils/util.js');
+let wechat = require("../../utils/wechat");
+let amap = require("../../utils/amap");
+Page({
+  data: {
+    lonlat: "",
+    city: "",
+    longitude: null,
+    latitude: null,
+    tips: [],
+    searchString: null
+  },
+  onLoad(e) {
+    let {
+      lonlat,
+      city
+    } = e;
+    var longitude = lonlat.split(",")[0];
+    var latitude = lonlat.split(",")[1];
+    console.log({
+      lonlat,
+      longitude,
+      latitude,
+      city
+    });
+    this.setData({
+      lonlat,
+      longitude,
+      latitude,
+      city
+    })
+  },
+  bindInput2(e) {
+
+    let {
+      value
+    } = e.detail;
+    let {
+      lonlat,
+      city
+    } = this.data;
+    amap.getInputtips(city, lonlat, value)
+      .then(d => {
+        //console.log(d);
+        if (d && d.tips) {
+          this.setData({
+            tips: d.tips
+          });
+        }
+      })
+      .catch(e => {
+        console.log(e);
+      })
+  },
+  bindInput(e) {
+    this.setData({
+      searchString: e.detail.value
+    });
+  },
+  bindSearch2(e) {
+    let {
+      keywords
+    } = e.currentTarget.dataset;
+    let pages = getCurrentPages();
+    let prevPage = pages[0]; //首页
+    //console.log(pages);
+    //console.log(e);
+    console.log(keywords);
+    if (keywords) {
+      prevPage.setData({
+        keywords
+      });
+      console.log(keywords.name, keywords.location);
+      //amap.getPoiAround(keywords.name, keywords.location)
+      //.then(d => {
+      //  console.log(d);
+      //  let {
+      //    markers
+      //  } = d;
+      //  markers.forEach((item, index) => {
+      //    item.callout = {}; //marker绑定点击事件后,导致气泡一闪一闪,不想显示
+      //    item.iconPath = "/images/marker.png";
+      //    item.width = '88rpx';
+      //    item.height = '112rpx';
+      //    item.address = d.poisData[index].cityname + d.poisData[index].adname + d.poisData[index].address;
+      //  })
+      //  prevPage.setData({
+      //    markers
+      //  });
+      //  prevPage.showMarkerInfo(markers[0]);
+      //  prevPage.changeMarkerColor(0);
+      //})
+      //.catch(e => {
+      //  console.log(e);
+      //})
+    }
+    //let url = `/pages/index/index`;
+    //wx.navigateBack({
+    //  url
+    // });
+    let {
+      city,
+      longitude,
+      latitude
+    } = this.data;
+    let url = `/pages/search_result/search_result?city=${city}&longitude=${longitude}&latitude=${latitude}&name=${keywords.name}&location=${keywords.location}`;
+    wx.navigateTo({
+      url
+    });
+  },
+  bindSearch(e) {
+    let {
+      searchString: keywords
+    } = this.data;
+    let pages = getCurrentPages();
+    let prevPage = pages[0]; //首页
+    if (keywords) {
+      prevPage.setData({
+        keywords
+      });
+      let {
+        city,
+        longitude,
+        latitude
+      } = this.data;
+      let url = `/pages/search_result/search_result?city=${city}&longitude=${longitude}&latitude=${latitude}&searchString=${keywords}`;
+      wx.navigateTo({
+        url
+      });
+    }
+  },
+  cancel(e) {
+    console.log(e);
+    wx.navigateBack();
+  }
+});

+ 3 - 0
pages/worksheetinfo/findstation.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "搜索"
+}

+ 21 - 0
pages/worksheetinfo/findstation.wxml

@@ -0,0 +1,21 @@
+<view class="section">
+  <view class='search_icon' hover-class='active' bindtap='bindSearch'>
+    <!-- <icon type="search" size="20" /> -->
+    <image src='/images/search.png'></image>
+  </view>
+  <input type='text' placeholder-class="section_phcolor" placeholder="请输入搜索内容" focus="true" confirm-type='search' bindinput="bindInput" bindconfirm="bindSearch" />
+  <view class='cancel' bindtap='cancel'>取消</view>
+</view>
+<scroll-view class='context' scroll-y='true' wx:if="{{tips.length!=0}}">
+  <view bindtap="bindSearch2" data-keywords="{{item}}" class="text_box" hover-class='active' wx:for="{{tips}}" wx:key="key" wx:if="{{item.location.length!=0}}">
+    <view class='search'>
+      <image src='/images/search.png'></image>
+    </view>
+    <view class='text_context'>
+      <text class='bold'>{{item.name}}</text>
+      <text class="h1">{{item.district}}{{item.address}}</text>
+    </view>
+    <text class="right">所有站场</text>
+  </view>
+</scroll-view>
+<view class='no_result' bindtap='bindSearch' wx:if="{{tips.length==0}}">没有搜索结果</view>

+ 157 - 0
pages/worksheetinfo/findstation.wxss

@@ -0,0 +1,157 @@
+page {
+  height: 100%;
+  overflow-y: hidden;
+}
+
+.section {
+  height: 89rpx;
+  width: 100%;
+  display: flex;
+  border-bottom: 1px solid #eee;
+}
+
+.search_icon {
+  flex-shrink: 0;
+  padding: 24rpx;
+}
+
+.search_icon.active {
+  background-color: #f4f4f4;
+}
+
+.search_icon image {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.section input {
+  width: 100%;
+  margin: 20rpx auto;
+  background-color: #f4f4f4;
+  color: #545253;
+  height: 48rpx;
+  line-height: 48rpx;
+  min-height: 48rpx;
+  border-radius: 24rpx;
+  padding: 0 24rpx;
+  font-size: 24rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.section_phcolor {
+  color: #b5b5b5;
+}
+
+.cancel {
+  flex-shrink: 0;
+  width: 56rpx;
+  height: 28rpx;
+  line-height: 28rpx;
+  min-height: 28rpx;
+  padding: 30rpx 24rpx;
+  font-size: 28rpx;
+  color: #b4b4b4;
+}
+
+.no_result {
+  width: 100%;
+  height: 100%;
+  padding-top: 60%;
+  color: #dcdcdc;
+  text-align: center;
+  vertical-align: center;
+  font-size: 24rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+
+.context {
+  height: calc(100% - 90rpx);
+}
+
+.text_box {
+  width: 100%;
+  border-bottom: 1px solid #eee;
+  display: flex;
+}
+
+.text_box.active {
+  background-color: #ebebeb;
+}
+
+.text_box .search {
+  width: 40rpx;
+  height: 40rpx;
+  margin: 24rpx;
+  flex-shrink: 0;
+}
+
+.text_box .search image {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.text_context {
+  width: 100%;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+text {
+  margin: 0 0 20rpx 0;
+  display: block;
+  font-size: 24rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #545253;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+  line-height: 24rpx;
+  height: 24rpx;
+  min-height: 24rpx;
+  min-width: 0;
+}
+
+text.bold {
+  font-weight: bold;
+  line-height: 24rpx;
+  height: 24rpx;
+  min-height: 24rpx;
+  margin-top: 30rpx;
+  margin-bottom: 10rpx;
+}
+
+text.h1 {
+  margin: 0rpx 0rpx 30rpx 0rpx;
+  font-size: 20rpx;
+  line-height: 20rpx;
+  height: 20rpx;
+  min-height: 20rpx;
+  color: #959595;
+}
+
+.right {
+  margin: 30rpx;
+  width: 144rpx;
+  flex-shrink: 0;
+  float: right;
+  color: #b5b5b5;
+}