Browse Source

测试

测试11111
yinzhipeng 4 years ago
parent
commit
2c4672f22f
67 changed files with 2732 additions and 195 deletions
  1. 44 3
      app.js
  2. 8 2
      app.json
  3. BIN
      images/marker_b.png
  4. BIN
      images/monitor.png
  5. BIN
      images/notice.png
  6. BIN
      images/notice_icon.png
  7. BIN
      images/notice_list.png
  8. 35 3
      pages/chargemoney/chargemoney.js
  9. 52 11
      pages/charging/charging.js
  10. 2 2
      pages/charging/charging.wxml
  11. 1 1
      pages/forget/forget.js
  12. 179 16
      pages/index/index.js
  13. 27 3
      pages/index/index.wxml
  14. 115 0
      pages/index/index.wxss
  15. 22 4
      pages/login/login.js
  16. 2 2
      pages/login/login.wxml
  17. 68 7
      pages/order/order.js
  18. 2 1
      pages/order/order.wxml
  19. 136 8
      pages/outmoney/outmoney.js
  20. 6 0
      pages/outmoney/outmoney.wxml
  21. 15 0
      pages/outmoney/outmoney.wxss
  22. 31 1
      pages/register/register.js
  23. 6 2
      pages/register/register.wxml
  24. 5 0
      pages/register/register.wxss
  25. 1 1
      pages/reset_password/reset_password.js
  26. 40 9
      pages/scan_result/scan_result.js
  27. 34 3
      pages/scan_result/scan_result.wxml
  28. 12 8
      pages/search_result/search_result.js
  29. 11 2
      pages/search_result/search_result.wxml
  30. 150 0
      pages/sign/sign.js
  31. 3 0
      pages/sign/sign.json
  32. 13 0
      pages/sign/sign.wxml
  33. 39 0
      pages/sign/sign.wxss
  34. 1 1
      pages/ucenter/center/center.js
  35. 1 1
      pages/ucenter/center/center.wxml
  36. 1 1
      pages/ucenter/chargemoneylog/chargemoneylog.js
  37. 2 1
      pages/ucenter/charginglog/charginglog.js
  38. 2 1
      pages/ucenter/charginglog/charginglog.wxml
  39. 287 0
      pages/ucenter/chargpilemonitor/chargpilemonitor.js
  40. 3 0
      pages/ucenter/chargpilemonitor/chargpilemonitor.json
  41. 45 0
      pages/ucenter/chargpilemonitor/chargpilemonitor.wxml
  42. 181 0
      pages/ucenter/chargpilemonitor/chargpilemonitor.wxss
  43. 239 0
      pages/ucenter/chargpilemonitor/chargpilemonitorsearch.js
  44. 3 0
      pages/ucenter/chargpilemonitor/chargpilemonitorsearch.json
  45. 38 0
      pages/ucenter/chargpilemonitor/chargpilemonitorsearch.wxml
  46. 129 0
      pages/ucenter/chargpilemonitor/chargpilemonitorsearch.wxss
  47. 20 2
      pages/ucenter/index/index.js
  48. 24 1
      pages/ucenter/index/index.wxml
  49. 28 0
      pages/ucenter/index/index.wxss
  50. 3 2
      pages/ucenter/mychargestation/mychargestation.js
  51. 8 0
      pages/ucenter/mychargestation/mychargestation.wxml
  52. 1 1
      pages/ucenter/myworksheet/myworksheet.js
  53. 98 0
      pages/ucenter/notice/notice.js
  54. 4 0
      pages/ucenter/notice/notice.json
  55. 15 0
      pages/ucenter/notice/notice.wxml
  56. 92 0
      pages/ucenter/notice/notice.wxss
  57. 74 0
      pages/ucenter/notice_info/notice_info.js
  58. 4 0
      pages/ucenter/notice_info/notice_info.json
  59. 10 0
      pages/ucenter/notice_info/notice_info.wxml
  60. 51 0
      pages/ucenter/notice_info/notice_info.wxss
  61. 1 1
      pages/ucenter/purse/purse.js
  62. 1 1
      pages/worksheetinfo/accendant.js
  63. 218 75
      pages/worksheetinfo/worksheetinfo.js
  64. 45 17
      pages/worksheetinfo/worksheetinfo.wxml
  65. 7 1
      project.config.json
  66. 7 0
      sitemap.json
  67. 30 0
      utils/log.js

+ 44 - 3
app.js

@@ -1,9 +1,50 @@
 //app.js
 let wechat = require('./utils/wechat.js');
+let log = require('./utils/log.js');
 App({
   globalData: {
-    postHeadAgreement:'https',
-    helpPhoneNum:'18211188302'
+    postHeadAgreement: 'https://cdgl.pjnes.com',
+    helpPhoneNum: '18211188302'
   },
-  onLaunch() {}
+  onLaunch() {
+    log.info('[全局]', '[小程序加载完成]');
+    // log.error({ str: 'hello world22' }, 'warn log', 100, [1, 2, 3]);
+    // log.warn({ str: 'hello world33' }, 'warn log', 100, [1, 2, 3]);
+    // log.setFilterMsg('filterkeyword');
+    // log.setFilterMsg('addfilterkeyword');
+    // wx.showModal({
+    //   title: '温馨提示',
+    //   content: '为方便您更好的使用派捷充电小程序,平台将定期(暂定每周一次)对未支付订单进行自动支付。望周知',
+    //   showCancel:false
+    // }); 
+    // wx.showToast({
+    //   title: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话18211188302,接听时段08:00-17:00。',
+    //   icon: 'none',
+    //   duration:2000
+    // });
+    //this.showNetworkError();
+     
+  },
+  showNetworkError(){
+    wx.showModal({
+      title: '温馨提示',
+      content: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话18211188302,接听时段08:00-17:00。',
+      showCancel: false
+    });
+  },
+  onShow() {
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    // 页面显示
+    if (userInfo && isLogin) {
+      if ((!userInfo.userId && userInfo.userId != 0)) {
+        log.info('[全局]', '[已登陆未有用户ID跳转登录界面]');
+        let url = `/pages/login/login`;
+        wx.navigateTo({
+          url
+        });
+        return;
+      }
+    }
+  }
 })

+ 8 - 2
app.json

@@ -24,7 +24,12 @@
     "pages/worksheetinfo/accendant",
     "pages/forget/forget",
     "pages/reset_password/reset_password",
-    "pages/ucenter/center/center"
+    "pages/ucenter/center/center",
+    "pages/sign/sign",
+    "pages/ucenter/notice/notice",
+    "pages/ucenter/notice_info/notice_info",
+    "pages/ucenter/chargpilemonitor/chargpilemonitor",
+    "pages/ucenter/chargpilemonitor/chargpilemonitorsearch"
   ],
   "window": {
     "backgroundTextStyle": "light",
@@ -41,5 +46,6 @@
     "request": 300000,
     "connectSocket": 300000
   },
-  "debug": false
+  "debug": false,
+  "sitemapLocation": "sitemap.json"
 }

BIN
images/marker_b.png


BIN
images/monitor.png


BIN
images/notice.png


BIN
images/notice_icon.png


BIN
images/notice_list.png


+ 35 - 3
pages/chargemoney/chargemoney.js

@@ -1,4 +1,5 @@
 // pages/chargemoney/chargemoney.js
+let log = require('../../utils/log.js');
 Page({
 
   /**
@@ -24,31 +25,50 @@ Page({
   },
   beginChargemoney(e) {
     //console.log(this.data.chargemoney_select);
+    log.info('[充值]', '[开始充值流程]');
     let that = this;
     if (this.data.chargemoney_select) {
       wx.showLoading({
         title: '充值中...',
         mask: true
       });
+      log.info('[充值]', '[开始微信充值]', '[wx.login请求]');
       wx.login({
         success(res) {
           console.log(res);
+          log.info('[充值]', '[开始微信充值]', '[wx.login响应]', res);
           if (res.code) {
             // 发起网络请求
+            log.info('[充值]', '[服务端微信充值]', '[请求]', {
+              //outTradeNo: new Date().getTime(), //订单号
+              totalFee: that.data.chargemoney_select, //钱
+              //totalFee:0.01,
+              code: res.code,
+              userId: that.data.userInfo.userId
+            });
             wx.request({
-              url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechatpay/dopaychargmoney',
+              url: getApp().globalData.postHeadAgreement +'/restapi/wechatpay/dopaychargmoney',
               data: {
                 //outTradeNo: new Date().getTime(), //订单号
                 totalFee: that.data.chargemoney_select, //钱
                 //totalFee:0.01,
-                code: res.code
+                code: res.code,
+                userId: that.data.userInfo.userId
               },
               header: {
                 'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
               },
               method: 'POST',
               success(res1) {
+                log.info('[充值]', '[服务端微信充值]', '[响应]', res1.data);
                 //console.log(res1);
+                log.info('[充值]', '[微信支付]', '[请求]', {
+                  timeStamp: res1.data.timeStamp,
+                  nonceStr: res1.data.nonceStr,
+                  package: res1.data.package,
+                  signType: res1.data.signType,
+                  paySign: res1.data.paySign
+                });
                 wx.requestPayment({
                   timeStamp: res1.data.timeStamp,
                   nonceStr: res1.data.nonceStr,
@@ -57,8 +77,14 @@ Page({
                   paySign: res1.data.paySign,
                   success(res2) {
                     console.log(res2);
+                    log.info('[充值]', '[微信支付]', '[响应]', res2);
+                    log.info('[充值]', '[微信支付回调]', '[请求]', {
+                      userId: that.data.userInfo.userId,
+                      rechargeMoney: that.data.chargemoney_select
+                      //rechargeMoney: 0.01,
+                    });
                     wx.request({
-                      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/pileLog/wechatrechargeback',
+                      url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatrechargeback',
                       data: {
                         userId: that.data.userInfo.userId,
                         rechargeMoney: that.data.chargemoney_select
@@ -70,16 +96,19 @@ Page({
                         let {
                           data
                         } = res3;
+                        log.info('[充值]', '[微信支付回调]', '[响应]', data);
                         if (data && data.code == 200) {
                           wx.showModal({
                             showCancel: false,
                             content: '充值成功'
                           });
+                          log.info('[充值]', '[微信支付回调]', '[成功]');
                         } else {
                           wx.showModal({
                             showCancel: false,
                             content: '充值失败'
                           });
+                          log.info('[充值]', '[微信支付回调]', '[失败data null||data.code<>200]', data);
                         }
                       }
                     });
@@ -87,6 +116,7 @@ Page({
                   fail(res3) {
                     wx.hideLoading();
                     console.log(res3);
+                    log.info('[充值]', '[微信支付]', '[fail]', res3);
                   }
                 });
               }
@@ -94,6 +124,7 @@ Page({
           } else {
             wx.hideLoading();
             console.log('登录失败!' + res.errMsg)
+            log.info('[充值]', '[开始微信充值]', '[wx.login响应失败code null]', res);
           }
         }
       })
@@ -105,6 +136,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
+    log.info('[充值]', '[页面加载完成]');
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
 

+ 52 - 11
pages/charging/charging.js

@@ -1,4 +1,5 @@
 // pages/charging/charging.js
+let log = require('../../utils/log.js');
 var chargingPng;
 var chargingStatus;
 Page({
@@ -12,6 +13,8 @@ Page({
     chargPileId: null,
     chargingRate: 0,
     chargingTime: '',
+    yczds:'',
+    totalMoney:'',
     chargingOrder: null,
     chargPile: null
   },
@@ -51,8 +54,14 @@ Page({
       userId,
       chargPileId
     } = this.data;
+
+    log.info('[充电中]', '[结束充电]', '[请求]', {
+      chargPileId,
+      userId,
+      orderid
+    });
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/pileLog/chargstop',
+      url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/chargstop',
       data: {
         chargPileId,
         userId,
@@ -64,16 +73,19 @@ Page({
         let {
           data
         } = res;
+        log.info('[充电中]', '[结束充电]', '[响应]', data);
         if (data && data.code == 200) {
           //wx.showModal({
           //showCancel: false,
           //content: '结束充电成功'
           //});
+          log.info('[充电中]', '[结束充电]', '[成功跳转订单支付界面]', data);
           let url = `/pages/order/order?orderid=${orderid}&userId=${userId}&chargPileId=${chargPileId}`;
           wx.redirectTo({
             url
           });
         } else {
+          log.info('[充电中]', '[结束充电]', '[失败data null||data.code<>200]', data);
           wx.showModal({
             showCancel: false,
             content: '结束充电失败'
@@ -81,12 +93,13 @@ Page({
 
         }
       },
-      fail(err){
+      fail(err){ 
        wx.hideLoading();
        wx.showModal({
          showCancel: false,
          content: '结束充电失败'
        });
+      log.info('[充电中]', '[结束充电]', '[fail]', err );
       }
     });
   },
@@ -118,17 +131,27 @@ Page({
       userId,
       chargPileId
     } = options;
+    log.info('[充电中]', '[加载完成]', '[参数]', {
+      orderid,
+      userId,
+      chargPileId
+    });
     this.setData({
       orderid,
       userId,
       chargPileId
     });
     if (!orderid||orderid=="null"){
-      orderid="";
+      orderid=undefined;
     }
     let that = this;
+    log.info('[充电中]', '[获取订单状态]', '[请求]', {
+      chargPileId,
+      userId,
+      orderid
+    });
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/pileLog/wechatchargstatus',
+      url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatchargstatus',
       data: {
         chargPileId,
         userId,
@@ -139,7 +162,7 @@ Page({
         let {
           data
         } = res;
-
+        log.info('[充电中]', '[获取订单状态]', '[响应]', data);
         if (data && data.code == 200) {
           let {
             result: chargingOrder
@@ -150,8 +173,9 @@ Page({
           } = chargingOrder;
           let orderid_r = chargingOrder.orderid;
           console.log(chargingOrder);
+          log.info('[充电中]', '[获取充电桩]', '[请求]', chargPileId);
           wx.request({
-            url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/chargPile',
+            url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
             data: chargPileId,
             method: 'POST',
             success(res1) {
@@ -160,6 +184,7 @@ Page({
                 let {
                   data: chargPile
                 } = res1;
+                log.info('[充电中]', '[获取充电桩]', '[响应]', chargPile);
                 that.setData({
                   chargPile
                 });
@@ -168,6 +193,7 @@ Page({
           });
           console.log(chargingOrder.chargPileStatus);
           if (chargingOrder.chargPileStatus == 1) { //启动中,继续轮训
+            log.info('[充电中]', '[初次订单状态判定]', '[chargPileStatus状态1启动中,继续轮训]', data)
             that.setData({
               chargingOrder,
               chargPileId,
@@ -186,15 +212,20 @@ Page({
               }
               var chargingTime = chargingTimeHour + ":" + chargingTimeMinute + ":00";
             }
+            var totalMoney = (parseFloat(chargingOrder.ycdfje) + parseFloat(chargingOrder.ycfwfje)).toFixed(2);
+            var yczds = parseFloat(chargingOrder.yczds).toFixed(2);
             that.setData({
               chargingOrder,
               chargPileId,
               chargingTime,
-              orderid: orderid_r
+              orderid: orderid_r,
+              totalMoney,
+              yczds
             });
             that.showChargingPng();
           } else if (chargingOrder.chargPileStatus == 3) { //充电完成,适用于主动拔枪
             clearInterval(chargingStatus);
+            log.info('[充电中]', '[初次订单状态判定]', '[chargPileStatus状态3跳转到订单支付界面]', data);
             let {
               orderid,
               userId,
@@ -206,6 +237,7 @@ Page({
             });
           } else if (chargingOrder.chargPileStatus == 4) { //启动异常,回退界面
             clearInterval(chargingStatus);
+            log.info('[充电中]', '[初次订单状态判定]', '[chargPileStatus状态4启动异常删除订单]', data);
             wx.showModal({
               showCancel: false,
               content: '开启充电失败'
@@ -227,12 +259,14 @@ Page({
   },
   delOrder(orderId){
     if (orderId){
+      log.info('[充电中]', '[删除订单]', '[请求]', { "orderid": orderId });
       wx.request({
-        url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/pileLog/exceptOrder',
+        url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/exceptOrder',
         data: {"orderid":orderId},
         method: 'POST',
         success(res1) {
           console.log(res1.data);
+          log.info('[充电中]', '[删除订单]', '[响应]', res1.data);
           //if (res1.data ) {
             
           //}
@@ -258,12 +292,12 @@ Page({
       chargPileId
     } = this.data;
     if (!orderid || orderid == "null") {
-      orderid = "";
+      orderid = undefined;
     }
     let that = this;
     chargingStatus = setInterval(function() {
       wx.request({
-        url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/pileLog/wechatchargstatus',
+        url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatchargstatus',
         data: {
           chargPileId,
           userId,
@@ -285,6 +319,7 @@ Page({
             } = chargingOrder;
             let orderid_r = chargingOrder.orderid;
             if (chargingOrder.chargPileStatus == 1) { //启动中,继续轮训
+              log.info('[充电中]', '[充电轮训]', '[chargPileStatus状态1启动中,继续轮训]', data);
               that.setData({
                 chargingOrder,
                 chargPileId,
@@ -302,16 +337,21 @@ Page({
                 }
                 var chargingTime = chargingTimeHour + ":" + chargingTimeMinute + ":00";
               }
+              var totalMoney = (parseFloat(chargingOrder.ycdfje) + parseFloat(chargingOrder.ycfwfje)).toFixed(2);
+              var yczds = parseFloat(chargingOrder.yczds).toFixed(2);
               that.setData({
                 chargingOrder,
                 chargPileId,
                 chargingTime,
                 chargingRate,
-                orderid: orderid_r
+                orderid: orderid_r,
+                totalMoney,
+                yczds
               });
               that.drawCircle(chargingRate);
             } else if (chargingOrder.chargPileStatus == 3) { //充电完成,适用于主动拔枪
               clearInterval(chargingStatus);
+              log.info('[充电中]', '[充电轮训]', '[chargPileStatus状态3跳转到订单支付界面]', data);
               let {
                 orderid,
                 userId,
@@ -323,6 +363,7 @@ Page({
               });
             } else if (chargingOrder.chargPileStatus == 4) { //启动异常,回退界面
               clearInterval(chargingStatus);
+              log.info('[充电中]', '[充电轮训]', '[chargPileStatus状态4启动异常删除订单]', data);
               wx.showModal({
                 showCancel: false,
                 content: '开启充电失败'

+ 2 - 2
pages/charging/charging.wxml

@@ -15,7 +15,7 @@
     <image src='/images/chargeover_1.png'></image>
     <canvas class="progress_canvas" canvas-id="canvasProgress"> </canvas>
     <view class='chargeover_text_view' wx:if="{{chargingOrder.chargPileStatus==2}}">
-      <text class="text2">{{chargingOrder.yczds}}</text>
+      <text class="text2">{{yczds}}</text>
       <text class="text1">已充电量(度)</text>
       <!-- <text class="text2">01小时04分</text>
       <text class="text1">剩余充满时间</text> -->
@@ -47,7 +47,7 @@
     <text class="text1">已充时长</text>
     <text class="text3">{{chargingTime}}</text>
     <text class="text1">充电费用</text>
-    <text class="text3 inline">{{chargingOrder.ycdfje}}</text>
+    <text class="text3 inline">{{totalMoney}}</text>
     <text class="inline">元</text>
   </view>
   <text class="help" decode='true'>客服电话:18211188302&nbsp;&nbsp;&nbsp;&nbsp;工作时间:工作日 08:00-17:00</text>

+ 1 - 1
pages/forget/forget.js

@@ -19,7 +19,7 @@ Page({
       email
     } = this.data;
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/forget',
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/forget',
       data: {
         loginName,
         phonenumber: phone,

File diff suppressed because it is too large
+ 179 - 16
pages/index/index.js


+ 27 - 3
pages/index/index.wxml

@@ -2,7 +2,7 @@
   <view class="section">
     <view class="userAvatarUrl" bindtap="bindUserAvatarUrl">
       <!-- <open-data type='userAvatarUrl'></open-data> -->
-      <image src='{{isLogin?userInfo.avatar:"/images/user.png"}}'></image>
+      <image src='{{isLogin?!userInfo.flag?userInfo.avatar:"/images/userhead.png":"/images/user.png"}}'></image>
     </view>
     <!-- <input bindtouchstart="bindInput" placeholder="搜索位置查找附近的充电桩" value="{{keywords.name}}" /> -->
     <!-- <input bindtouchstart="bindInput" placeholder="搜索充电桩" value="{{keywords}}" /> -->
@@ -10,6 +10,11 @@
   </view>
   <view class="{{textData.name?userInfo.flag?'map_container1':'map_container':'map_container_big'}}">
     <map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="16" show-location="true" markers="{{markers}}" bindmarkertap="makertap" bindregionchange="mapchange" polygon="{{polygon}}">
+      <view class='map_distance'>
+        <picker class="picker" bindchange="bindDistanceinfoChange" value="{{distanceinfoindex}}" range-key="text" range="{{distanceinfo}}">
+          <text>距离{{distanceinfo[distanceinfoindex].text}}</text>
+        </picker>
+      </view>
       <cover-view class='map_location' bindtap='click_location_control' hover-class='map_location_hover'>
         <cover-image src='/images/circle1.png'></cover-image>
       </cover-view>
@@ -39,14 +44,33 @@
       <text decode='true' class='inline' wx:if="{{!userInfo.flag}}">电桩数:{{textData.chargPileNum}}&nbsp;&nbsp;&nbsp;&nbsp;空闲数:</text>
       <text class='fast inline' wx:if="{{!userInfo.flag}}" decode='true'>快{{textData.fastfreenum==null?0:textData.fastfreenum}}&nbsp;&nbsp;</text>
       <text class='slow inline' wx:if="{{!userInfo.flag}}">慢{{textData.slowfreenum==null?0:textData.slowfreenum}}</text>
+       <!-- 初始,待运营,运营中,暂停营业,关闭,未运营 -->
+      <text  decode='true'  class='inline' >&nbsp;&nbsp;&nbsp;&nbsp;状态:</text>
+      <text  decode='true'  class='inline' wx:if="{{textData.operationState==1}}">初始</text>
+      <text  decode='true'  class='inline' wx:if="{{textData.operationState==2}}">待运营</text>
+      <text  decode='true'  class='inline' wx:if="{{textData.operationState==3}}">运营中</text>
+      <text  decode='true'  class='inline' wx:if="{{textData.operationState==4}}">暂停营业</text>
+      <text  decode='true'  class='inline' wx:if="{{textData.operationState==5}}">关闭</text>
+      <text  decode='true'  class='inline' wx:if="{{textData.operationState==6}}">未运营</text>
     </view>
     <text class='fast'>快桩数:{{textData.fastCharg==null?0:textData.fastCharg}}</text>
     <text class='slow'>慢桩数:{{textData.slowCharg==null?0:textData.slowCharg}}</text>
     <text class='inline' wx:if="{{userInfo.flag}}">当前故障桩:</text><text class='red inline' wx:if="{{userInfo.flag}}">{{textData.breaknum==null?0:textData.breaknum}}</text>
-    <text  wx:if="{{!userInfo.flag}}">参考电价:{{textData.chargprice}}元/度</text>
-    <text decode='true'  wx:if="{{!userInfo.flag}}">服务费:{{textData.serviceprice}}元/度&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{textData.stopprice}}元/小时</text>
+    <text  wx:if="{{!userInfo.flag}}">实时参考电费:{{textData.chargprice}}元/度</text>
+    <!--<text decode='true'  wx:if="{{!userInfo.flag}}">实时参考服务费:{{textData.serviceprice}}元/度&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{textData.stopprice}}元/小时</text>-->
+    <text decode='true'  wx:if="{{!userInfo.flag}}">实时参考服务费:{{textData.serviceprice}}元/度</text>
     <view class='navigation' bindtap="getRoute">
       <image src='/images/navigation.png'></image>
     </view>
   </view>
+</view>
+<view wx:if='{{!(textData.name)&&showModal&&notice.noticeTitle}}'>
+  <view class="modal_box"> 
+    <view class="title"><image src='/images/notice.png' />公告</view>
+    <view class='content_title'>{{notice.noticeTitle}}:</view>
+    <view class='content'>
+      <view class='modalMsg' ><rich-text nodes='{{notice.noticeContent}}'></rich-text></view>
+    </view>
+    <view bindtap='Sure' class='Sure' hover-class='hover_sure'>确定</view>
+  </view>
 </view>

+ 115 - 0
pages/index/index.wxss

@@ -71,6 +71,7 @@
   bottom: 110rpx;
   width: 80rpx;
   height: 80rpx;
+   z-index:999;
 }
 
 .map_location_hover{
@@ -82,6 +83,7 @@
   height: 80rpx;
   bottom: 110rpx;
   left: 270rpx;
+   z-index:999;
 }
 /*
 .map_scan_hover{
@@ -228,3 +230,116 @@ text.red {
   height: 32px;
 }
 */
+
+.picker{
+  text-align: right;
+  position: absolute;
+  left: 30rpx;
+  top: 30rpx;
+  
+}
+.picker text{
+  color: #545253;
+  margin: 0;
+  padding: 4rpx 10rpx 4rpx 10rpx;
+  border:solid 2rpx #545253;
+  border-radius: 8rpx;
+}
+
+/* 通知相关 begin */
+.modal_box {
+  width: 688rpx;
+  height: 688rpx;
+  overflow: hidden;
+  position: fixed;
+  top: 50%;
+  left: 0;
+  z-index:9999;
+  background: #ffffff;
+  margin: -344rpx 31rpx 0 31rpx;
+  border-radius: 12rpx;
+}
+ 
+.title {
+  height:128rpx;
+  text-align: center;
+  background-color: #27a6bf;
+  font-size: 34rpx;
+  color: #ffffff;
+  line-height: 128rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.title image{
+  position: absolute;
+  top: 14rpx;
+  left: 14rpx;
+  width: 89rpx;
+  height: 101rpx;
+}
+.content {
+  height:300rpx;
+  overflow-y: scroll; /*超出父盒子高度可滚动*/
+}
+.content_title{
+  color: #27a6bf;
+  font-size: 30rpx;
+  line-height: 32rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  margin: 40rpx 40rpx 28rpx 40rpx;
+}
+.Sure {
+  width: 288rpx;
+  height:78rpx;
+  position: absolute;
+  bottom: 0rpx;
+  color: #27a6bf;
+  line-height: 78rpx;
+  border: solid #27a6bf 2rpx;
+  border-radius: 12rpx;
+  text-align: center;
+  margin: 40rpx 200rpx;
+  font-size: 32rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+}
+.Sure.hover_sure {
+  color: #ffffff;
+  background-color:#27a6bf; 
+}
+.modalMsg {
+  text-align: left;
+  margin: 0rpx 40rpx;
+  display: block;
+  font-size: 26rpx;
+  line-height: 48rpx;
+  color: #27a6bf;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+
+}
+rich-text{
+  word-break:break-all; 
+}
+/* 通知相关 end */

+ 22 - 4
pages/login/login.js

@@ -1,4 +1,5 @@
 // pages/login/login.js
+let log = require('../../utils/log.js');
 Page({
 
   /**
@@ -8,7 +9,15 @@ Page({
     loginName: null,
     password: null,
     checkPass: false,
-    errorMsg: ''
+    errorMsg: '',
+    passwordFocus:false
+  },
+  onError(e) {
+    wx.showModal({
+      title: '温馨提示',
+      content: '当前网络环境较差,无法连接服务器,请稍后重试。有问题请联系客服电话18211188302,接听时段08:00-17:00。',
+      showCancel: false
+    });
   },
   inputAccount(e) {
     this.setData({
@@ -44,8 +53,9 @@ Page({
   loginUser(e) {
     let that = this;
     let { loginName, password } = this.data;
+    log.info('[登录]', '[登录]', '[请求]', { loginName, password });
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/login',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/login',
       data: {
         loginName,
         password
@@ -54,21 +64,29 @@ Page({
       success(res) {
         //console.log(res1);
         //console.log(res1.data.code == 1);
+        log.info('[登录]', '[登录]', '[响应]', res.data);
         if (res.data.code == 1) {
           that.setData({
+            password: null,
+            passwordFocus:true,
             errorMsg: res.data.msg
-          })
+          });
+          log.info('[登录]', '[登录]', '[失败code==1]', res.data);
         } else {
           //返回该用户
           //跳转到上一页
           wx.setStorageSync("userInfo", res.data);
           wx.setStorageSync("isLogin", true);
           //let url = `/pages/ucenter/index/index`;
+          log.info('[登录]', '[登录]', '[成功返回上一个界面]', res.data);
           wx.navigateBack();
           //wx.redirectTo({
           // url
           //});
         }
+      },
+      fail(e){
+        getApp().showNetworkError();
       }
     });
   },
@@ -90,7 +108,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    log.info('[登录]', '[加载完成]');
   },
 
   /**

+ 2 - 2
pages/login/login.wxml

@@ -5,11 +5,11 @@
     <view class='context_input'>
       <view class='input_view'>
         <image class='account_img' src='/images/account.png'></image>
-        <input placeholder='请输入您的账号' bindinput='inputAccount' maxlength='16' focus='true' placeholder-class='placeholder'></input>
+        <input placeholder='请输入您的账号' bindinput='inputAccount' maxlength='20' focus='true' placeholder-class='placeholder'></input>
       </view>
       <view class='input_view'>
         <image class='password_img' src='/images/password.png'></image>
-        <input placeholder='请输入您的密码' maxlength='16' bindinput='inputPassword'type='password' placeholder-class='placeholder'></input>
+        <input placeholder='请输入您的密码' value="{{password}}" focus="{{passwordFocus}}" maxlength='16' bindinput='inputPassword'type='password' placeholder-class='placeholder'></input>
       </view>
     </view>
     <view class="errorMsg"><text>{{errorMsg}}</text></view>

+ 68 - 7
pages/order/order.js

@@ -1,5 +1,6 @@
 // pages/order/order.js
 let Util = require("../../utils/util");
+let log = require('../../utils/log.js');
 Page({
 
   /**
@@ -17,6 +18,11 @@ Page({
   },
 
   payOrder(e) {
+    log.info('[订单支付]', '[用户触发支付订单]');
+    wx.showLoading({
+      title: '支付中...',
+      mask: true
+    });
     console.log('去支付');
     console.log(this.order);
     let that = this;
@@ -24,13 +30,21 @@ Page({
       order,
       userId
     } = this.data;
+    log.info('[订单支付]', '[用户触发支付订单]', '[wx.login请求]');
     wx.login({
       success(res) {
         console.log(res);
+        log.info('[订单支付]', '[用户触发支付订单]', '[wx.login响应]',res);
         if (res.code) {
           // 发起网络请求
+          log.info('[订单支付]', '[服务端订单支付]', '[请求]', {
+            outTradeNo: order.orderid, //订单号
+            totalFee: order.chargallmoney, //钱
+            code: res.code,
+            user_id: userId
+          });
           wx.request({
-            url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechatpay/chargpayfor',
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechatpay/chargpayfor',
             data: {
               outTradeNo: order.orderid, //订单号
               totalFee: order.chargallmoney, //钱
@@ -45,6 +59,7 @@ Page({
               let {
                 data
               } = res1;
+              log.info('[订单支付]', '[服务端订单支付]', '[响应]', data);
               console.log(res1);
               if (data && data.code == 200) {
                 if (data.result) {
@@ -52,6 +67,12 @@ Page({
                   //  showCancel: false,
                   //  content: '请微信支付'
                   // });
+                  log.info('[订单支付]', '[余额不足微信支付]','[请求]',{
+                    timeStamp: data.result.timeStamp,
+                    nonceStr: data.result.nonceStr,
+                    package: data.result.package,
+                    signType: data.result.signType,
+                    paySign: data.result.paySign});
                   wx.requestPayment({
                     timeStamp: data.result.timeStamp,
                     nonceStr: data.result.nonceStr,
@@ -59,8 +80,14 @@ Page({
                     signType: data.result.signType,
                     paySign: data.result.paySign,
                     success(res2) {
+                      log.info('[订单支付]', '[余额不足微信支付成功]', '[响应]', res2);
+                      log.info('[订单支付]', '[微信支付成功回调服务端]', '[请求]', {
+                        //chargPileId,
+                        //userId,
+                        orderid: order.orderid
+                      });
                       wx.request({
-                        url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/pileLog/wechatpayback',
+                        url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatpayback',
                         data: {
                           //chargPileId,
                           //userId,
@@ -68,9 +95,11 @@ Page({
                         },
                         method: 'POST',
                         success(res3) {
+                          wx.hideLoading();
                           let {
                             data
                           } = res3;
+                          log.info('[订单支付]', '[微信支付成功回调服务端]', '[响应]', data);
                           if (data && data.code == 200) {
                             that.setData({
                               orderFlag:true 
@@ -79,38 +108,48 @@ Page({
                               showCancel: false,
                               content: '支付订单成功'
                             });
+                            log.info('[订单支付]', '[微信支付成功回调服务端]', '[成功]');
                           } else {
                             wx.showModal({
                               showCancel: false,
                               content: '支付订单失败'
                             });
+                            log.info('[订单支付]', '[微信支付成功回调服务端]', '[失败data null||data.code<>200]', data);
                           }
                         }
                       });
                     },
                     fail(res3) {
+                      wx.hideLoading();
+                      log.info('[订单支付]', '[余额不足微信支付]', '[fail]', res3);
                       console.log(res3);
                     }
                   });
                 } else {
+                  wx.hideLoading();
                   that.setData({
                     orderFlag: true
                   });
                   wx.showModal({
                     showCancel: false,
-                    content: '支付订单成功'
+                    content: data.msg
                   });
                 }
+                log.info('[订单支付]', '[服务端订单支付]', '[余额支付成功]', data);
               } else {
+                wx.hideLoading();
                 wx.showModal({
                   showCancel: false,
-                  content: '支付订单失败'
+                  content: data.msg
                 });
+                log.info('[订单支付]', '[服务端订单支付]', '[失败data null||data.code<>200]', data);
               }
             }
           });
         } else {
-          console.log('登录失败!' + res.errMsg)
+          wx.hideLoading();
+          console.log('登录失败!' + res.errMsg);
+          log.info('[订单支付]', '[用户触发支付订单]', '[wx.login响应失败code null]', res);
         }
       }
     });
@@ -126,6 +165,11 @@ Page({
       userId,
       chargPileId
     } = options;
+    log.info('[订单支付]', '[加载完成]', '[参数]', {
+      orderid,
+      userId,
+      chargPileId
+    });
     this.setData({
       orderid,
       userId,
@@ -138,8 +182,13 @@ Page({
     });
     var timeoutflag = setInterval(function() {
         i++;
+        log.info('[订单支付]', '[轮训获取订单]', '[请求]', {
+          chargPileId,
+          userId,
+          orderid
+        });
         wx.request({
-          url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/pileLog/wechatsettlement',
+          url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatsettlement_new',
           data: {
             chargPileId,
             userId,
@@ -150,13 +199,18 @@ Page({
             let {
               data
             } = res;
+            log.info('[订单支付]', '[轮训获取订单]', '[响应]', data);
             let {
               result: order
             } = data;
             if (data && data.code == 200) {
               if (order.transstatus==3){
+                //order.paystatus=1;
+                //order.chargstarttime='2020-10-19 10:00:00';
+                //order.chargendtime = '2020-10-19 10:20:20';
                 wx.hideLoading();
                 clearInterval(timeoutflag);
+                log.info('[订单支付]', '[轮训获取订单]', '[订单transstatus状态3]可手动支付');
               }
               // if (order.chargallmoney && order.chargpower) {
               //   wx.hideLoading();
@@ -187,6 +241,7 @@ Page({
               //wx.hideLoading();
               if (i>=60){
                 clearInterval(timeoutflag);
+                log.info('[订单支付]', '[轮训获取订单]', '[60S超时]', data);
                 wx.showModal({
                   showCancel: false,
                   content: '获取订单失败'
@@ -197,6 +252,7 @@ Page({
           fail(err) {
             wx.hideLoading();
             clearInterval(timeoutflag);
+            log.info('[订单支付]', '[轮训获取订单]', '[fail]', err);
             wx.showModal({
               showCancel: false,
               content: '获取订单失败'
@@ -207,7 +263,12 @@ Page({
       1000);
 
   },
-
+  closeView:function(){
+    let url = `/pages/index/index`;
+    wx.navigateTo({
+      url
+    });
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 2 - 1
pages/order/order.wxml

@@ -65,4 +65,5 @@
     </view>
   </view>-->
 </view>
-<button class='{{orderFlag?"pay_button1":"pay_button"}}' wx:if="{{order}}" bindtap="{{orderFlag?'':'payOrder'}}">去支付</button>
+<button class='{{orderFlag?"pay_button1":"pay_button"}}' wx:if="{{order.paystatus==0}}" bindtap="{{orderFlag?'':'payOrder'}}">去支付</button>
+<button class='pay_button' wx:if="{{order.paystatus==1}}" bindtap="closeView">已余额扣款,请关闭</button>

+ 136 - 8
pages/outmoney/outmoney.js

@@ -1,4 +1,5 @@
 // pages/outmoney/outmoney.js
+let log = require('../../utils/log.js');
 Page({
 
   /**
@@ -7,8 +8,23 @@ Page({
   data: {
     outMoney: null,
     checkPass: false,
+    msg:null,
     userInfo: {},
-    isLogin: false
+    isLogin: false,
+    remarkArray: [{
+      value: 1,
+      text: '平台使用不方便'
+    }, {
+      value: 2,
+        text: '车卖了'
+    }, {
+      value: 3,
+        text: '换地方住'
+    }, {
+      value: 4,
+        text: '其他'
+    }],
+    remarkArrayIndex: null
   },
   outMoney(e) {
     console.log(e);
@@ -17,9 +33,15 @@ Page({
       outMoney
     });
     if (this.data.userInfo.repaidbalance && outMoney && outMoney >= 0.3 && outMoney <= this.data.userInfo.repaidbalance) {
-      this.setData({
-        checkPass: true
-      });
+      if (this.data.remarkArrayIndex){
+        this.setData({
+          checkPass: true
+        });
+      }else{
+        this.setData({
+          checkPass: false
+        });
+      }
     } else {
       this.setData({
         checkPass: false
@@ -27,24 +49,44 @@ Page({
     }
   },
   beginOutMoney(e) {
+    if (this.data.msg) {
+      wx.showModal({
+        showCancel: false,
+        content: this.data.msg
+      });
+      return;
+    }
+    log.info('[提现]', '[用户触发提现流程]');
     wx.showLoading({
       title: '提现中...',
       mask: true
     });
-    
     let that = this;
+    log.info('[提现]', '[用户触发提现流程]', '[wx.login请求]');
     wx.login({
       success(res) {
         console.log(res);
+        log.info('[提现]', '[用户触发提现流程]', '[wx.login响应]', res);
         if (res.code) {
           // 发起网络请求
+          log.info('[提现]', '[服务端提现]', '[请求]', {
+            //outTradeNo: new Date().getTime(), //订单号
+            //totalFee: that.data.chargemoney_select, //钱
+            totalFee: that.data.outMoney,
+            userId: that.data.userInfo.userId,
+            loginName: that.data.userInfo.loginName,
+            remark: that.data.remarkArray[that.data.remarkArrayIndex].text,
+            code: res.code
+          });
           wx.request({
-            url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechatpay/dopayTransfers',
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechatpay/dopayTransfers',
             data: {
               //outTradeNo: new Date().getTime(), //订单号
               //totalFee: that.data.chargemoney_select, //钱
               totalFee: that.data.outMoney,
               userId: that.data.userInfo.userId,
+              loginName: that.data.userInfo.loginName,
+              remark: that.data.remarkArray[that.data.remarkArrayIndex].text,
               code: res.code
             },
             header: {
@@ -56,27 +98,48 @@ Page({
               let {
                 data
               } = res1;
+              log.info('[提现]', '[服务端提现]', '[响应]', data);
               if (data && data.code == 200) {
                 wx.navigateBack();
                 wx.showModal({
                   showCancel: false,
                   content: '提现成功'
                 });
+                log.info('[提现]', '[服务端提现]', '[提现成功]', data);
               } else {
                 wx.showModal({
                   showCancel: false,
                   content: data.msg
                 });
+                log.info('[提现]', '[服务端提现]', '[提现失败data null||data.code<>200]', data);
               }
             }
           });
         } else {
           wx.hideLoading();
-          console.log('登录失败!' + res.errMsg)
+          console.log('登录失败!' + res.errMsg);
+          log.info('[提现]', '[用户触发提现流程]', '[wx.login响应失败code null]', res);
         }
       }
     })
   },
+  bindRemarkChange: function (e) {
+    //console.log(e.detail.value);
+    //let remarkValue = this.data.remarkArray[e.detail.value].value;
+    this.setData({
+      remarkArrayIndex: e.detail.value
+    });
+
+    if (this.data.userInfo.repaidbalance && this.data.outMoney && this.data.outMoney >= 0.3 && this.data.outMoney <= this.data.userInfo.repaidbalance) {
+        this.setData({
+          checkPass: true
+        });
+    }else{
+      this.setData({
+        checkPass: false
+      });
+    }
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -95,11 +158,15 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
+    log.info('[提现]', '[加载完成]');
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
     let that = this;
+    log.info('[提现]', '[同步用户数据]', '[请求]', {
+      loginName: userInfo.loginName
+    });
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/syncUser',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/syncUser',
       data: {
         loginName: userInfo.loginName
       },
@@ -108,6 +175,7 @@ Page({
         let {
           data
         } = res;
+        log.info('[提现]', '[同步用户数据]', '[响应]', data);
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
@@ -115,6 +183,7 @@ Page({
           wx.redirectTo({
             url,
           });
+          log.info('[提现]', '[同步用户数据]', '[失败data null||data.code<>200跳转登陆界面]', data);
         } else {
           that.setData({
             userInfo: data,
@@ -122,12 +191,71 @@ Page({
           });
           wx.setStorageSync('userInfo', data);
           wx.setStorageSync('isLogin', true);
+          log.info('[提现]', '[同步用户数据]', '[成功]', data);
+          log.info('[提现]', '[获取用户是否有未完成订单]', '[请求]', {
+            userId: userInfo.userId
+          });
+          wx.request({
+            url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatchargstatus',
+            data: {
+              userId: userInfo.userId
+            },
+            method: 'POST',
+            success(res) {
+              let {
+                data
+              } = res;
+              log.info('[提现]', '[获取用户是否有未完成订单]', '[响应]', data);
+              if (data && data.code == 200) {
+                //有正在充电的订单
+                that.setData({
+                  msg: '暂时无法退款,请先完成订单!'
+                });
+              log.info('[提现]', '[获取用户是否有未完成订单]', '[用户有未完成订单无法体现]', data);
+              } else {
+                console.log(res);
+                log.info('[提现]', '[获取用户是否有未完成订单]', '[用户没有未完成订单]', data);
+              }
+            }
+          });
+          log.info('[提现]', '[获取用户是否有未支付订单]', '[请求]', {
+            userId: that.data.userInfo.userId
+          });
+          wx.request({
+            url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatsettlement',
+            data: {
+              userId: that.data.userInfo.userId
+            },
+            method: 'POST',
+            success(res) {
+              let {
+                data
+              } = res;
+              log.info('[提现]', '[获取用户是否有未支付订单]', '[响应]', data);
+              let {
+                result: order
+              } = data;
+              if (data && order && data.code == 200) {
+               //有未支付的订单
+                that.setData({
+                  msg: '暂时无法退款,请先完成订单!'
+                });
+                log.info('[提现]', '[获取用户是否有未支付订单]','[用户有未支付订单无法提现]');
+              } else {
+                console.log(res);
+                log.info('[提现]', '[获取用户是否有未支付订单]', '[用户没有未支付订单]');
+              }
+            }
+          });
         }
       },
       fail(e) {
         console.log("用户数据同步失败");
+        log.info('[提现]', '[同步用户数据]', '[fail]', e);
       }
     });
+
+
   },
 
   /**

+ 6 - 0
pages/outmoney/outmoney.wxml

@@ -4,4 +4,10 @@
   <input placeholder-class="section_phcolor" bindinput='outMoney' focus="true" type='digit' placeholder="请输入转出金额,不低于0.3元" />
 </view>
 <view class="outmoney"><text>可用余额{{userInfo.repaidbalance}}元</text></view>
+<view class='money_input'>
+  <text>备注</text>
+  <picker class="picker" bindchange="bindRemarkChange" value="{{remarkArrayIndex}}" range-key="text" range="{{remarkArray}}">
+      <text>{{remarkArrayIndex==null?'请选择':remarkArray[remarkArrayIndex].text}}</text>
+  </picker>
+</view>
 <button class='{{checkPass?"outmoney_button":"outmoney_button_disable"}}' bindtap="{{checkPass?'beginOutMoney':''}}" >立即提现(转入微信账户)</button>

+ 15 - 0
pages/outmoney/outmoney.wxss

@@ -56,6 +56,21 @@ text {
   color: #aaaaaa;
   font-size: 28rpx;
 }
+.money_input picker {
+  padding: 0 20rpx;
+  display: inline-block;
+  width: 540rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  min-height: 100rpx;
+  color: #aaaaaa;
+  font-size: 28rpx;
+  text-align: right;
+}
+.money_input picker text{
+  color: #aaaaaa;
+  font-size: 28rpx;
+}
 .outmoney{
   margin: 0 30rpx;
   padding: 0 20rpx;

+ 31 - 1
pages/register/register.js

@@ -8,6 +8,7 @@ Page({
     userName: null,
     phone: null,
     email: null,
+    carNum:null,
     password: null,
     rePassword: null,
     checkPass: false,
@@ -54,6 +55,7 @@ Page({
         userName: loginName,
         password,
         phone,
+        carNum,
         email
       } = this.data;
       wx.login({
@@ -61,7 +63,7 @@ Page({
           //console.log(res);
           if (res.code) {
             wx.request({
-              url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/register',
+              url: getApp().globalData.postHeadAgreement + '/restapi/wechat/register',
               data: {
                 userName,
                 sex,
@@ -70,6 +72,7 @@ Page({
                 password,
                 phonenumber: phone,
                 email,
+                license_number: carNum,
                 code: res.code
               },
               method: 'POST',
@@ -131,6 +134,12 @@ Page({
     });
     this.checkAll();
   },
+  inputCarNum(e){
+    this.setData({
+      carNum: e.detail.value
+    });
+    this.checkAll();
+  },
   checkPassword() {
     if (!this.data.password || !this.data.rePassword || this.data.password != this.data.rePassword) {
       return false;
@@ -149,6 +158,14 @@ Page({
     }
     return true;
   },
+  checkCarNum(){
+    if (this.data.carNum){
+      if (!(/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(this.data.carNum))) {
+        return false;
+      }
+    }
+    return true;
+  },
   checkAll() {
     if (!this.data.userName || !this.data.userName.replace(/(^\s*)|(\s*$)/g,"")) {
       this.setData({
@@ -205,6 +222,19 @@ Page({
         errorMsg: ''
       });
     }
+    if (!this.checkCarNum()) {
+      this.setData({
+        errorMsg: '车牌号输入有误,请重新输入'
+      });
+      this.setData({
+        checkPass: false
+      });
+      return;
+    } else {
+      this.setData({
+        errorMsg: ''
+      });
+    }
     if (this.data.password && (this.data.password.length < 5 || this.data.password.length > 20)) {
       this.setData({
         errorMsg: '密码长度应为5-20'

+ 6 - 2
pages/register/register.wxml

@@ -5,14 +5,14 @@
     <view class='context_input'>
       <view class='input_view'>
         <image class='account_img' src='/images/account.png'></image>
-        <input placeholder='请设置账号' bindinput='inputAccount' focus='true' placeholder-class='placeholder'></input>
+        <input placeholder='请设置账号' bindinput='inputAccount' maxlength='20' focus='true' placeholder-class='placeholder'></input>
       </view>
 
       <view class='input_view'>
         <image class='phone_img' src='/images/phone.png'></image>
         <input placeholder='请输入电话' maxlength='11' bindinput='inputPhone' type='number' placeholder-class='placeholder'></input>
       </view>  
-       <view class='input_view'>
+      <view class='input_view'>
         <image class='email_img' src='/images/email.png'></image>
         <input placeholder='请输入邮箱' maxlength='48' bindinput='inputEmail' type='text' placeholder-class='placeholder'></input>
       </view>
@@ -23,6 +23,10 @@
         </view> 
       -->  
       <view class='input_view'>
+        <image class='carNum_img' src='/images/car.png'></image>
+        <input placeholder='请输入车牌号' maxlength='8' bindinput='inputCarNum' type='text' placeholder-class='placeholder'></input>
+      </view>
+      <view class='input_view'>
         <image class='password_img' src='/images/password.png'></image>
         <input placeholder='请设置密码' maxlength='16' bindinput='inputPassword' type='password' placeholder-class='placeholder'></input>
       </view>

+ 5 - 0
pages/register/register.wxss

@@ -45,6 +45,11 @@
   height: 20rpx;
   margin: 34rpx 32rpx 34rpx 0;
 }
+.carNum_img {
+  width: 36rpx;
+  height: 26rpx;
+  margin: 31rpx 22rpx 31rpx 0;
+}
 .man_img {
   width: 28rpx;
   height: 24rpx;

+ 1 - 1
pages/reset_password/reset_password.js

@@ -18,7 +18,7 @@ Page({
       password
     } = this.data;
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/resetPassword',
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/resetPassword',
       data: {
         loginName,
         password

+ 40 - 9
pages/scan_result/scan_result.js

@@ -1,4 +1,5 @@
 // pages/scan_result/scan_result.js
+let log = require('../../utils/log.js');
 Page({
 
   /**
@@ -20,15 +21,23 @@ Page({
       success: function (res) {
         //console.log(res);
         //console.log(res.data);
+        var chargPile = res.data;      
+        chargPile.sharpTotalPrice = (chargPile.sharpChargPrice + chargPile.sharpServicePrice).toFixed(4);
+        chargPile.peakTotalPrice = (chargPile.peakChargPrice + chargPile.peakServicePrice).toFixed(4);
+        chargPile.flatTotalPrice = (chargPile.flatChargPrice + chargPile.flatServicePrice).toFixed(4);
+        chargPile.valleyTotalPrice = (chargPile.valleyChargPrice + chargPile.valleyServicePrice).toFixed(4);
+        chargPile.totalprice = (chargPile.chargprice + chargPile.serviceprice).toFixed(4);
         that.setData({
-          chargPile: res.data
+          chargPile
         });
+        //console.log(chargPile);
         wx.removeStorage({
           key: 'scan_chargpile',
           success(res) {
             console.log(res);
           }
-        })
+        });
+        log.info('[扫码]', '[加载完成]', '[参数]', res.data);
       }
     });
   },
@@ -37,12 +46,16 @@ Page({
       title: '开启充电中...',
       mask: true
     });
+    log.info('[扫码]', '[开始充电流程]');
     //同步用户数据
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
     let that = this;
+    log.info('[扫码]', '[同步用户数据]', '[请求]', {
+      loginName: userInfo.loginName
+    });
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/syncUser',
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/syncUser',
       data: {
         loginName: userInfo.loginName
       },
@@ -52,6 +65,7 @@ Page({
         let {
           data
         } = res;
+        log.info('[扫码]', '[同步用户数据]', '[响应]', data);
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
@@ -59,9 +73,11 @@ Page({
           wx.redirectTo({
             url,
           });
+          log.info('[扫码]', '[同步用户数据]', '[失败data null||data.code<>200跳转登陆界面]', data);
         } else {
           wx.setStorageSync('userInfo', data);
           wx.setStorageSync('isLogin', true);
+          
           //开始充电
           if (!data.repaidbalance||data.repaidbalance<=0){
             wx.showModal({
@@ -76,8 +92,8 @@ Page({
                 } 
               }
             });
-            
-          } else if (data.repaidbalance > 0 && data.repaidbalance<=10){
+            log.info('[扫码]', '[同步用户数据]', '[data.repaidbalance null||data.repaidbalance<=0余额不足跳转充值界面]', data);
+          } else if (data.repaidbalance > 0 && data.repaidbalance<=15){
             wx.showModal({
               title: '余额:' + data.repaidbalance+'元',
               showCancel: false,
@@ -92,6 +108,7 @@ Page({
                 } 
               }
             });
+            log.info('[扫码]', '[同步用户数据]', '[0<data.repaidbalance<=15余额过低]', data);
 
             // wx.showModal({
             //   title:'请选择',
@@ -111,13 +128,15 @@ Page({
             //     }
             //   }
             // });
-          } else if (data.repaidbalance > 10 ) {
+          } else if (data.repaidbalance > 15 ) {
+            log.info('[扫码]', '[同步用户数据]', '[余额充足开始充电]', data);
             that.beginCharge_satrt();
           } 
         }
       },
       fail(e) {
         console.log("用户数据同步失败");
+        log.info('[扫码]', '[同步用户数据]', '[fail]', e);
       }
     });
 
@@ -128,6 +147,7 @@ Page({
       title: '开启充电中...',
       mask: true
     });
+
     let that = this;
     let terminalNum = this.data.chargPile.chargPileId;
 
@@ -138,8 +158,14 @@ Page({
     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 + '://cdgl.xinyhy.cn/restapi/pileLog/miniprogramadd',
+      url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/miniprogramadd',
       data: {
         //chargPileId: '201811010000004202',
         chargPileId: terminalNum,
@@ -147,25 +173,28 @@ Page({
         chargstarttime: chargstarttime
       },
       method: 'POST',
-      fail() {
+      fail(e) {
         wx.hideLoading();
         //开启充电失败,提示用户
         wx.showModal({
           showCancel: false,
           content: '开启充电失败'
         });
+        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({
@@ -177,19 +206,21 @@ Page({
             showCancel: false,
             content: '余额不足,请充值!'
           });
-          message
+          log.info('[扫码]', '[开始充电]', '[失败data.code=501余额不足]', data);
         } else if (data && data.code == 502) {
           //开启充电失败,提示用户
           wx.showModal({
             showCancel: false,
             content: data.message
           });
+          log.info('[扫码]', '[开始充电]', '[失败data.code=502' + data.message+']', data);
         }else {
           //开启充电失败,提示用户
           wx.showModal({
             showCancel: false,
             content: '开启充电失败'
           });
+          log.info('[扫码]', '[开始充电]', '[失败]', data);
         }
       }
     });

+ 34 - 3
pages/scan_result/scan_result.wxml

@@ -14,9 +14,23 @@
       </view>
     </view>
     <text>终端编号:{{chargPile.chargPileId}}</text>
-    <text class='fast' wx:if="{{chargPile.pileType=='快充'}}">快桩:2小时</text>
-    <text class='slow' wx:if="{{chargPile.pileType=='慢充'}}">慢桩:2小时</text>
-     <view style='line-height:0;'>
+    <!-- <text class='fast' wx:if="{{chargPile.pileType=='快充'}}">快桩:2小时</text>
+    <text class='slow' wx:if="{{chargPile.pileType=='慢充'}}">慢桩:2小时</text> -->
+    <text class="inline">实时参考费用:</text>
+    <view style='line-height:0;'>
+      <text decode='true' style='color:red;font-size:22rpx;'>电&nbsp;&nbsp;&nbsp;费:{{chargPile.chargprice}}元&nbsp;&nbsp;服务费:{{chargPile.serviceprice}}元&nbsp;&nbsp;总费用:{{chargPile.totalprice}}元</text>
+    </view>
+    <text class="inline">参考价格:</text>
+    <view style='line-height:0;'>
+      <text decode='true' style='font-size:22rpx;'>服务费:尖峰{{chargPile.sharpServicePrice}}元&nbsp;&nbsp;高峰{{chargPile.peakServicePrice}}元&nbsp;&nbsp;平段{{chargPile.flatServicePrice}}元&nbsp;&nbsp;低谷{{chargPile.valleyServicePrice}}元&nbsp;&nbsp;</text>
+    </view>
+    <view style='line-height:0;'>
+      <text decode='true' style='font-size:22rpx;'>电&nbsp;&nbsp;&nbsp;费:尖峰{{chargPile.sharpChargPrice}}元&nbsp;&nbsp;高峰{{chargPile.peakChargPrice}}元&nbsp;&nbsp;平段{{chargPile.flatChargPrice}}元&nbsp;&nbsp;低谷{{chargPile.valleyChargPrice}}元&nbsp;&nbsp;</text>
+    </view>
+    <view style='line-height:0;'>
+      <text decode='true' style='color:red;font-size:22rpx;'>总费用:尖峰{{chargPile.sharpTotalPrice}}元&nbsp;&nbsp;高峰{{chargPile.peakTotalPrice}}元&nbsp;&nbsp;平段{{chargPile.flatTotalPrice}}元&nbsp;&nbsp;低谷{{chargPile.valleyTotalPrice}}元&nbsp;&nbsp;</text>
+    </view>
+    <!-- <view style='line-height:0;'>
       <text decode='true' class='inline'>费用:&nbsp;&nbsp;</text>
       <text decode='true' class='slow inline'>{{chargPile.sharpChargPrice}}</text>
       <text decode='true' class='inline'>元尖&nbsp;&nbsp;</text>
@@ -26,6 +40,23 @@
       <text decode='true' class='inline'>元平&nbsp;&nbsp;</text>
       <text decode='true' class='slow inline'>{{chargPile.valleyChargPrice}}</text>
       <text decode='true' class='inline'>元谷&nbsp;&nbsp;</text>
+    </view> -->
+    <text class="inline">峰谷时段划分:</text>
+    <view style='line-height:0;'>
+      <text decode='true' style='font-size:22rpx;'>高峰:10:00-15:00&nbsp;&nbsp;18:00-21:00</text>
+    </view>
+    <view style='line-height:0;'>
+      <text decode='true' style='font-size:22rpx;'>平段:07:00-10:00&nbsp;&nbsp;15:00-18:00&nbsp;&nbsp;21:00-23:00</text>
+    </view>
+    <view style='line-height:0;'>
+      <text decode='true' style='font-size:22rpx;'>低谷:23:00至次日07:00</text>
+    </view>
+    <view style='line-height:0;'>
+      <text decode='true' style='font-size:22rpx;'>尖峰:7\8月11:00-13:00&nbsp;&nbsp;16:00-17:00</text>
+    </view>
+    
+    <view wx:if="{{chargPile.showinfo}}">
+      <rich-text style='line-height:48rpx;color:red;font-size:32rpx;word-break:break-all;'>{{chargPile.showinfo}}</rich-text> 
     </view>
   </view>
   <button wx:if="{{chargPile}}" class='charg_button' bindtap="beginCharge" >开始充电</button>

+ 12 - 8
pages/search_result/search_result.js

@@ -60,7 +60,7 @@ Page({
       chargStationType = '2';
     }
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/chargStationsSearch',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargStationsSearch',
       data: {
         searchString,
         chargStationType
@@ -70,7 +70,7 @@ Page({
         //userInfo.flag = true;
         if (isLogin && userInfo.flag) {
           wx.request({
-            url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/userChargStations',
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/userChargStations',
             data: {
               userId: userInfo.userId,
               lat: latitude,
@@ -114,7 +114,8 @@ Page({
                   /** 服务费 */
                   serviceprice: item.serviceprice,
                   /** 停车费 */
-                  stopprice: item.stopprice
+                  stopprice: item.stopprice,
+                  operationState: item.operationState
                 };
                 if (myChargeStationsIds.indexOf(item.id + ',') != -1) {
                   marker.userFlag = true;
@@ -164,7 +165,8 @@ Page({
               /** 服务费 */
               serviceprice: item.serviceprice,
               /** 停车费 */
-              stopprice: item.stopprice
+              stopprice: item.stopprice,
+              operationState: item.operationState
             };
             markers[index] = marker;
           });
@@ -219,7 +221,7 @@ Page({
       chargStationType = '2';
     }
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/chargStations',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/chargStations',
       data: {
         lon: location.split(",")[0],
         lat: location.split(",")[1],
@@ -231,7 +233,7 @@ Page({
         //userInfo.flag = true;
         if (isLogin && userInfo.flag) {
           wx.request({
-            url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/userChargStations',
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/userChargStations',
             data: {
               userId: userInfo.userId,
               lat: latitude,
@@ -280,7 +282,8 @@ Page({
                   /** 服务费 */
                   serviceprice: item.serviceprice,
                   /** 停车费 */
-                  stopprice: item.stopprice
+                  stopprice: item.stopprice,
+                  operationState: item.operationState
                 };
                 if (myChargeStationsIds.indexOf(item.id + ',') != -1) {
                   marker.userFlag = true;
@@ -336,7 +339,8 @@ Page({
               /** 服务费 */
               serviceprice: item.serviceprice,
               /** 停车费 */
-              stopprice: item.stopprice
+              stopprice: item.stopprice,
+              operationState: item.operationState
             };
             markers[index] = marker;
           });

+ 11 - 2
pages/search_result/search_result.wxml

@@ -41,13 +41,22 @@
       <text decode='true' class='inline' wx:if="{{!userInfo.flag}}">电桩数:{{item.chargPileNum}}&nbsp;&nbsp;&nbsp;&nbsp;空闲数:</text>
       <text class='fast inline' decode='true' wx:if="{{!userInfo.flag}}">快{{item.fastfreenum==null?0:item.fastfreenum}}&nbsp;&nbsp;</text>
       <text class='slow inline' wx:if="{{!userInfo.flag}}">慢{{item.slowfreenum==null?0:item.slowfreenum}}</text>
+    <!-- 初始,待运营,运营中,暂停营业,关闭,未运营 -->
+      <text  decode='true'  class='inline' >&nbsp;&nbsp;&nbsp;&nbsp;状态:</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==1}}">初始</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==2}}">待运营</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==3}}">运营中</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==4}}">暂停营业</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==5}}">关闭</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==6}}">未运营</text>
     </view>
     <text class='fast'>快桩数:{{item.fastCharg==null?0:item.fastCharg}}</text>
     <text class='slow'>慢桩数:{{item.slowCharg==null?0:item.slowCharg}}</text>
     <text class='inline' wx:if="{{userInfo.flag}}">当前故障桩:</text>
     <text class='red inline' wx:if="{{userInfo.flag}}">{{item.breaknum==null?0:item.breaknum}}</text>
-    <text wx:if="{{!userInfo.flag}}">参考电价:{{item.chargprice}}元/度</text>
-    <text decode='true' wx:if="{{!userInfo.flag}}">服务费:{{item.serviceprice}}元/度&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{item.stopprice}}元/小时</text>
+    <text wx:if="{{!userInfo.flag}}">实时参考电费:{{item.chargprice}}元/度</text>
+    <!--<text decode='true' wx:if="{{!userInfo.flag}}">实时参考服务费:{{item.serviceprice}}元/度&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{item.stopprice}}元/小时</text>-->
+    <text decode='true' wx:if="{{!userInfo.flag}}">实时参考服务费:{{item.serviceprice}}元/度</text>
     <view id="{{item.id}}" class='navigation' bindtap="getRoute">
       <image src='/images/navigation.png'></image>
     </view>

+ 150 - 0
pages/sign/sign.js

@@ -0,0 +1,150 @@
+// pages/sign/sign.js
+var context = null;
+var isButtonDown = false;
+var arrx = [];
+var arry = [];
+var arrz = [];
+var canvasw = 0;
+var canvash = 0;
+//注册页面
+Page({
+  canvasIdErrorCallback: function (e) {
+    console.error(e.detail.errMsg)
+  },
+  //开始
+  canvasStart: function (event) {
+    isButtonDown = true;
+    arrz.push(0);
+    arrx.push(event.changedTouches[0].x);
+    arry.push(event.changedTouches[0].y);
+
+  },
+  data: {
+    src: "",
+    img: "",
+    rpx: ''
+  },
+
+  onLoad: function (options) {
+    var that = this
+    // 使用 wx.createContext 获取绘图上下文 context
+    context = wx.createCanvasContext('canvas');
+    context.beginPath()
+    context.setStrokeStyle('#000000');
+    context.setLineWidth(4);
+    context.setLineCap('round');
+    context.setLineJoin('round');
+
+    // context.drawImage('../../images/img111.png', 0, 0, canvasw, 500);
+    context.draw(false);
+  },
+
+  //过程
+  canvasMove: function (event) {
+    var that = this
+    if (isButtonDown) {
+      arrz.push(1);
+      //console.log(event)
+      arrx.push(event.changedTouches[0].x);
+      arry.push(event.changedTouches[0].y);
+    };
+
+    for (var i = 0; i < arrx.length; i++) {
+      if (arrz[i] == 0) {
+        context.moveTo(arrx[i], arry[i])
+      } else {
+        context.lineTo(arrx[i], arry[i])
+      };
+
+    };
+    context.clearRect(0, 0, canvasw, canvash);
+    context.setStrokeStyle('#000000');
+    context.setLineWidth(4);
+    context.setLineCap('round');
+    context.setLineJoin('round');
+    context.stroke();
+    context.draw(false);
+  },
+  // 点击保存图片
+  clickMe: function () {
+    wx.showToast({
+      title: '签名生成中...',
+      icon: 'loading',
+      duration: 2000
+    });
+
+    setTimeout(function () {
+      context.draw(true, wx.canvasToTempFilePath({
+        canvasId: 'canvas',
+        fileType: 'png',
+        //quality:0.5,
+        success: function (res) {
+          //console.log(res);
+
+          let pages = getCurrentPages();
+          let prevPage = pages[pages.length - 2]; //首页
+          //console.log(pages);
+          //console.log(prevPage);
+          var signs = [res.tempFilePath];
+          // 限制最多只能留下5张照片
+          prevPage.setData({
+            signs
+          });
+          wx.navigateBack();
+          // //存入服务器
+          // wx.uploadFile({
+          //   url: 'a.php', //接口地址
+          //   filePath: res.tempFilePath,
+          //   name: 'file',
+          //   formData: {                                 //HTTP 请求中其他额外的 form data 
+          //     'user': 'test'
+          //   },
+          //   success: function (res) {
+          //     console.log(res);
+
+          //   },
+          //   fail: function (res) {
+          //     console.log(res);
+          //   },
+          //   complete: function (res) {
+          //   }
+          // });
+
+          // wx.saveImageToPhotosAlbum({
+          //   filePath: res.tempFilePath,
+          //   success(res) {
+          //     console.log(res)
+          //     wx.hideLoading();
+          //     wx.showToast({
+          //       title: '保存成功',
+          //     });
+          //   },
+          //   fail() {
+          //     wx.hideLoading()
+          //   }
+          // });
+
+        }
+      }));
+    }, 2000);
+  },
+  canvasEnd: function (event) {
+    isButtonDown = false;
+  },
+  cleardraw: function () {
+    //清除画布
+    arrx = [];
+    arry = [];
+    arrz = [];
+    context.draw(false);
+  },
+  goWorksheet(e) {
+    wx.navigateBack();
+  },
+  onShow(e) {
+    if (context) {
+      this.cleardraw();
+    }
+  }
+
+})

+ 3 - 0
pages/sign/sign.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "签名"
+}

+ 13 - 0
pages/sign/sign.wxml

@@ -0,0 +1,13 @@
+<!--pages/sign/sign.wxml-->
+<view class='container'>
+  <!-- 签名画布 -->
+  <canvas class="canvas" id="canvas" canvas-id="canvas" disable-scroll="true" bindtouchstart="canvasStart" bindtouchmove="canvasMove" bindtouchend="canvasEnd" touchcancel="canvasEnd" binderror="canvasIdErrorCallback">
+ 
+  </canvas>
+ 
+  <view class='buttonBox'>
+    <button bindtap='clickMe' class='addbutton'>确定</button>
+    <button class='delbutton' bindtap="cleardraw">清除</button>
+    <button bindtap='goWorksheet' class='addbutton' >返回</button>
+  </view>
+</view>

+ 39 - 0
pages/sign/sign.wxss

@@ -0,0 +1,39 @@
+/* pages/sign/sign.wxss */
+.canvas {
+  width: 100%;
+  height: calc(100% - 120rpx);
+  position: fixed;
+  box-sizing: border-box;
+  border-bottom: 2rpx  #2583c1 solid;
+} 
+ 
+.imageCanvas{
+  width: 100%;
+  height: 100%;
+}
+.buttonBox{
+  width: 100%;
+  justify-content: center;
+  display: flex;
+  position: fixed;
+  bottom: 20rpx;
+  left: 0;
+}
+
+.buttonBox button{
+  font-size: 32rpx;
+  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;
+}
+.buttonBox button.button-hover{
+  background-color: #1ca05e;
+}

+ 1 - 1
pages/ucenter/center/center.js

@@ -112,7 +112,7 @@ Page({
       sex = this.data.userInfo.sex;
     }
     wx.request({
-      url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/updateUser',
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/updateUser',
       data: {
         loginName,
         sex: sex,

+ 1 - 1
pages/ucenter/center/center.wxml

@@ -6,7 +6,7 @@
   <view class="user_text">
     <!--<open-data class="userAvatarUrl" bindtap="" type='userAvatarUrl'></open-data>-->
     <view class="userAvatarUrl" bindtap="">
-      <image src='{{userInfo.avatar}}'></image>
+      <image src='{{isLogin&&!userInfo.flag?userInfo.avatar:"/images/userhead.png"}}'></image>
     </view>
     <text class='bold'>{{userInfo.userName}}</text>
   </view>

+ 1 - 1
pages/ucenter/chargemoneylog/chargemoneylog.js

@@ -24,7 +24,7 @@ Page({
     // 页面显示
     if (userInfo && isLogin) {
       wx.request({
-        url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/rechargeList',
+        url: getApp().globalData.postHeadAgreement +'/restapi/wechat/rechargeList',
         data: {
           userId: userInfo.userId
         },

+ 2 - 1
pages/ucenter/charginglog/charginglog.js

@@ -19,7 +19,7 @@ Page({
     // 页面显示
     if (userInfo && isLogin) {
       wx.request({
-        url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/pileLog/wechatuserallcharglog',
+        url: getApp().globalData.postHeadAgreement +'/restapi/pileLog/wechatuserallcharglog',
         data: {
           userId: userInfo.userId
         },
@@ -57,6 +57,7 @@ Page({
         item.chargallmoney = item.chargallmoney.toFixed(2);
         item.chargservice = item.chargservice.toFixed(2);
         item.chargmoney = item.chargmoney.toFixed(2);
+        //console.log(item.chargPile);
       } catch (err) {
         //在这里处理错误
       }

+ 2 - 1
pages/ucenter/charginglog/charginglog.wxml

@@ -21,7 +21,8 @@
       </view>
     </view>
     <text>{{charginglog.chargPile.chargPileName}}</text>
-    <text>充电时长:{{charginglog.totalTime}}</text>
+    <text class='inline' decode='true'>充电时长:{{charginglog.totalTime}}&nbsp;&nbsp;&nbsp;&nbsp;</text>
+    <text class='inline'>充电电量:{{charginglog.chargpower}}度</text>
     <text class='gray'>{{charginglog.startTime}}-{{charginglog.endTime}}</text>
     <view style='line-height:0;'>
       <text class='inline'>总费用:</text>

+ 287 - 0
pages/ucenter/chargpilemonitor/chargpilemonitor.js

@@ -0,0 +1,287 @@
+//logs.js
+let util = require('../../../utils/util.js');
+let wechat = require("../../../utils/wechat");
+let amap = require("../../../utils/amap");
+Page({
+  timer: null,
+  data: {
+    userInfo: {},
+    isLogin: false,
+    searchString: null,
+    chargpiles: [],
+    pageNum: 1,
+    total: 0,
+    showAll: false,
+    showTop: true,
+    scrollTop: 0
+  },
+  onLoad(e) {
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    });
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    let that = this;
+    // 页面显示
+    if (userInfo && isLogin) {
+      this.setData({
+        userInfo: userInfo,
+        isLogin: isLogin
+      });
+      wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargpileList',
+        data: {
+          pams: userInfo.userId,
+          params: {
+            pageSize: 10,
+            pageNum: 1
+            //orderByColumn:
+            //isAsc: asc
+          }
+        },
+        method: 'POST',
+        success(res) {
+          //console.log(res);
+          if (res.data && res.data.code == 0) {
+            let {
+              rows: chargpiles
+            } = res.data;
+            var show_chargpiles = [];
+            chargpiles.forEach((item, index) => {
+              show_chargpiles.push({
+                chargStationId: item.chargStationId,
+                chargPileName: item.chargPileName,
+                chargPileId: item.chargPileId,
+                chargStationName: item.chargStationName,
+                chargmode: item.chargmode,//name = "充电模式", readConverterExp = "1=自动,2=手动"
+                chargway: item.chargway,//name = "充电方式", readConverterExp = "1=直流,2=交流"
+                chargstatus: item.chargstatus//充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+              });
+            });
+
+            //充电状态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.navigateTo({
+            //     url
+            //   });
+            // }
+
+            if (res.data.total <= 10) {
+              that.setData({
+                chargpiles: show_chargpiles,
+                total: res.data.total,
+                showAll: true,
+                pageNum: 1,
+                scrollTop: 24
+              });
+            } else {
+              that.setData({
+                chargpiles: show_chargpiles,
+                total: res.data.total,
+                showAll: false,
+                pageNum: 1,
+                scrollTop: 24
+              });
+            }
+            wx.hideLoading();
+          }
+        }
+      });
+    }
+  },
+  bindInput(e) {
+    this.setData({
+      searchString: e.detail.value
+    });
+  },
+  bindSearch(e) {
+    let {
+      searchString: keywords
+    } = this.data;
+    if (keywords) {
+      let url = `/pages/ucenter/chargpilemonitor/chargpilemonitorsearch?keywords=${keywords}`;
+      wx.navigateTo({
+        url
+      });
+    }
+  },
+  scrollFn(e) {
+    // 防抖,优化性能
+    // 当滚动时,滚动条位置距离页面顶部小于设定值时,触发下拉刷新
+    // 通过将设定值尽可能小,并且初始化scroll-view组件竖向滚动条位置为设定值。来实现下拉刷新功能,但没有官方的体验好
+    // clearTimeout(this.timer)
+    // if (e.detail.scrollTop < this.data.scrollTop) {
+    //   this.timer = setTimeout(() => {
+    //     this.loadInitData()
+    //   }, 350)
+    // }
+    
+    if (e.detail.scrollTop > 24) {
+      //clearTimeout(this.timer);
+      this.setData({
+        showTop: false
+      });
+    }
+    // if (e.detail.scrollTop == 0) {
+    //   this.timer = setTimeout(() => {
+    //     if (!this.data.showTop) {
+    //       this.setData({
+    //         showTop: true
+    //       });
+    //     }
+    //   }, 350)
+    // }
+  },
+  loadInitData(e) {
+    if (!this.data.showTop) {
+      //clearTimeout(this.timer);
+      //this.timer = setTimeout(() => {
+        this.setData({
+          showTop: true,
+          scrollTop: 24
+        });
+      //}, 50)
+    } else {
+      wx.showLoading({
+        title: '刷新中',
+        mask: true
+      });
+      let that = this;
+      // 页面显示
+      if (that.data.userInfo && that.data.isLogin) {
+        wx.request({
+          url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargpileList',
+          data: {
+            pams: that.data.userInfo.userId,
+            params: {
+              pageSize: 10,
+              pageNum: 1
+              //orderByColumn:
+              //isAsc: asc
+            }
+          },
+          method: 'POST',
+          success(res) {
+            //console.log(res);
+            if (res.data && res.data.code == 0) {
+              let {
+                rows: chargpiles
+              } = res.data;
+              var show_chargpiles = [];
+              chargpiles.forEach((item, index) => {
+                show_chargpiles.push({
+                  chargStationId: item.chargStationId,
+                  chargPileName: item.chargPileName,
+                  chargPileId: item.chargPileId,
+                  chargStationName: item.chargStationName,
+                  chargmode: item.chargmode,//name = "充电模式", readConverterExp = "1=自动,2=手动"
+                  chargway: item.chargway,//name = "充电方式", readConverterExp = "1=直流,2=交流"
+                  chargstatus: item.chargstatus//充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+                });
+              });
+              if (res.data.total <= 10) {
+                that.setData({
+                  chargpiles: show_chargpiles,
+                  total: res.data.total,
+                  showAll: true,
+                  pageNum: 1,
+                  scrollTop: 24
+                });
+              } else {
+                that.setData({
+                  chargpiles: show_chargpiles,
+                  total: res.data.total,
+                  showAll: false,
+                  pageNum: 1,
+                  scrollTop: 24
+                });
+              }
+              wx.hideLoading();
+            }
+          }
+        });
+      }
+    }
+  },
+  loadMoreData(e) {
+    var totalPage = parseInt((this.data.total + 10 - 1) / 10);
+    if ((this.data.pageNum + 1) > totalPage) {
+      this.setData({
+        showAll: true
+      });
+      return;
+    }
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    });
+    let that = this;
+    let pageNum = this.data.pageNum + 1;
+    this.setData({
+      pageNum
+    });
+    // 页面显示
+    if (that.data.userInfo && that.data.isLogin) {
+      wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargpileList',
+        data: {
+          pams: that.data.userInfo.userId,
+          params: {
+            pageSize: 10,
+            pageNum: pageNum
+            //orderByColumn:
+            //isAsc: asc
+          }
+        },
+        method: 'POST',
+        success(res) {
+          //console.log(res);
+          if (res.data && res.data.code == 0) {
+            let {
+              rows: chargpiles
+            } = res.data;
+            var show_chargpiles = that.data.chargpiles;
+            chargpiles.forEach((item, index) => {
+              show_chargpiles.push({
+                chargStationId: item.chargStationId,
+                chargPileName: item.chargPileName,
+                chargPileId: item.chargPileId,
+                chargStationName: item.chargStationName,
+                chargmode: item.chargmode,//name = "充电模式", readConverterExp = "1=自动,2=手动"
+                chargway: item.chargway,//name = "充电方式", readConverterExp = "1=直流,2=交流"
+                chargstatus: item.chargstatus//充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+              });
+            });
+            that.setData({
+              chargpiles: show_chargpiles
+            });
+            if (pageNum * 10 >= that.data.total) {
+              that.setData({
+                showAll: true
+              });
+            }
+            wx.hideLoading();
+          }
+        }
+      });
+    }
+  }
+});

+ 3 - 0
pages/ucenter/chargpilemonitor/chargpilemonitor.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "充电桩监控"
+}

+ 45 - 0
pages/ucenter/chargpilemonitor/chargpilemonitor.wxml

@@ -0,0 +1,45 @@
+<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="请输入充电桩名称" confirm-type='search' bindinput="bindInput" bindconfirm="bindSearch" />
+</view>
+<scroll-view class='context' wx:if='{{chargpiles.length!=0}}' scroll-with-animation='false' scroll-y='true' scroll-top='{{scrollTop}}' bindscrolltoupper="loadInitData" bindscrolltolower="loadMoreData" upper-threshold="20"  bindscroll='scrollFn'>
+  <text class="showInit" wx:if='{{showTop}}'>刷新中...</text>
+  <view class='context_block'></view>
+  <view class="map_text" hover-class='active' data-keywords="{{item}}" wx:key='{{key}}' wx:for="{{chargpiles}}">
+    <view class='charging_text_title'>
+      <view class='charging'>
+        <image src='/images/charging1.png'></image>
+      </view>
+      <view class='charging_text_title1'>
+        <text class='bold'>{{item.chargPileName}}</text>
+        <text class="h1">{{item.chargPileId}}</text>
+      </view>
+    </view>
+    <view style='line-height:0;'>
+      <text >所属充电站:{{item.chargStationName}}</text>
+      <text class='inline' wx:if='{{item.chargmode==1}}'>充电模式:自动</text>
+      <text class='inline' wx:if='{{item.chargmode==2}}'>充电模式:手动</text>
+      <text decode='true' class='inline' wx:if='{{item.chargway==1}}'>&emsp;&emsp;&emsp;&emsp;&emsp;充电方式:直流</text>
+      <text decode='true' class='inline' wx:if='{{item.chargway==2}}'>&emsp;&emsp;&emsp;&emsp;&emsp;充电方式:交流</text>
+    </view>
+    <!--充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等-->
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==0}}'>充电桩状态:离线&emsp;&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==1}}'>充电桩状态:故障&emsp;&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==2}}'>充电桩状态:空闲中&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==3}}'>充电桩状态:充电中&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==4}}'>充电桩状态:欠压故障&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==5}}'>充电桩状态:过压故障&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==6}}'>充电桩状态:过电流故障&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==8}}'>充电桩状态:预约&emsp;&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==9}}'>充电桩状态:在线升级&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==10}}'>充电桩状态:操作中&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==11}}'>充电桩状态:已插枪&emsp;&emsp;&emsp;</text>
+      <!-- 运行状态2,3,8,10,11:正常运行、0,1,4,5,6,9:故障终止-->
+      <text class='inline' wx:if='{{item.chargstatus==2||item.chargstatus==3||item.chargstatus==8||item.chargstatus==10||item.chargstatus==11}}'>运行状态:正常运行</text>
+      <text class='inline' wx:if='{{item.chargstatus==0||item.chargstatus==1||item.chargstatus==4||item.chargstatus==5||item.chargstatus==6||item.chargstatus==9}}'>运行状态:故障终止</text>
+  </view>
+  <text class="showAll" wx:if='{{showAll}}'>已加载全部</text>
+</scroll-view>

+ 181 - 0
pages/ucenter/chargpilemonitor/chargpilemonitor.wxss

@@ -0,0 +1,181 @@
+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 24rpx 20rpx 0rpx;
+  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;
+}
+
+
+
+
+.context {
+  height: calc(100% - 88rpx);
+  background-color: #f4f4f4;
+}
+
+.context_block {
+  width: 100%;
+  height: 32rpx;
+}
+
+.map_text {
+  position: relative;
+  height: 246rpx;
+  background: #fff;
+  padding: 0 30rpx;
+  margin: 0 20rpx 32rpx 20rpx;
+  border-radius: 20rpx;
+  box-shadow: 0rpx 4rpx 4rpx #d5d5d5;
+}
+
+.mychargestation {
+  background: #fafbfa;
+  box-shadow: 0rpx 4rpx 4rpx #d0d0d0;
+}
+
+.map_text.active, .map_text1.active {
+  background-color: #ebebeb;
+}
+
+.charging_text_title {
+  height: 105rpx;
+  width: 100%;
+  display: flex;
+}
+
+.charging_text_title1 {
+  width: 100%;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.charging {
+  width: 45rpx;
+  height: 45rpx;
+  margin: 30rpx 30rpx 30rpx 0;
+  flex-shrink: 0;
+  overflow: hidden;
+}
+
+.charging image {
+  width: 45rpx;
+  height: 45rpx;
+}
+
+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;
+}
+
+text.bold {
+  font-weight: bold;
+  line-height: 24rpx;
+  height: 24rpx;
+  min-height: 24rpx;
+  margin-top: 30rpx;
+  margin-bottom: 1rpx;
+  display: block;
+}
+
+text.inline {
+  display: inline-block;
+}
+
+text.fast {
+  color: #2483c0;
+}
+
+text.slow {
+  color: #42b9b4;
+}
+
+text.red {
+  color: red;
+}
+
+.h1 {
+  margin: 0rpx 0rpx 30rpx 0rpx;
+  font-size: 20rpx;
+  line-height: 20rpx;
+  height: 20rpx;
+  min-height: 20rpx;
+  color: #959595;
+}
+
+.h1.right {
+  margin: 55rpx 0rpx 30rpx 30rpx;
+  flex-shrink: 0;
+  float: right;
+}
+
+.showAll{
+  text-align: center;
+  color: #b5b5b5;
+}
+
+.showInit{
+  margin: 20rpx 0 0 0;
+  text-align: center;
+  color: #b5b5b5;
+}
+
+
+

+ 239 - 0
pages/ucenter/chargpilemonitor/chargpilemonitorsearch.js

@@ -0,0 +1,239 @@
+//logs.js
+let util = require('../../../utils/util.js');
+let wechat = require("../../../utils/wechat");
+let amap = require("../../../utils/amap");
+Page({
+  data: {
+    userInfo: {},
+    isLogin: false,
+    searchString: null,
+    chargpiles: [],
+    pageNum: 1,
+    total: 0,
+    showAll: false,
+    scrollTop: 0
+  },
+  onLoad(e) {
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    });
+    let { keywords } = e ;
+    this.setData({
+      searchString: keywords
+    });
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    let that = this;
+    // 页面显示
+    if (userInfo && isLogin) {
+      this.setData({
+        userInfo: userInfo,
+        isLogin: isLogin
+      });
+      wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargpileList',
+        data: {
+          pams: userInfo.userId,
+          chargStationName:that.data.searchString,
+          params: {
+            pageSize: 10,
+            pageNum: 1
+            //orderByColumn:
+            //isAsc: asc
+          }
+        },
+        method: 'POST',
+        success(res) {
+          //console.log(res);
+          if (res.data && res.data.code == 0) {
+            let {
+              rows: chargpiles
+            } = res.data;
+            var show_chargpiles = [];
+            chargpiles.forEach((item, index) => {
+              show_chargpiles.push({
+                chargStationId: item.chargStationId,
+                chargPileName: item.chargPileName,
+                chargPileId: item.chargPileId,
+                chargStationName: item.chargStationName,
+                chargmode: item.chargmode,//name = "充电模式", readConverterExp = "1=自动,2=手动"
+                chargway: item.chargway,//name = "充电方式", readConverterExp = "1=直流,2=交流"
+                chargstatus: item.chargstatus//充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+              });
+            });
+
+            //充电状态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.navigateTo({
+            //     url
+            //   });
+            // }
+
+            if (res.data.total <= 10) {
+              that.setData({
+                chargpiles: show_chargpiles,
+                total: res.data.total,
+                showAll: true,
+                pageNum: 1,
+                scrollTop: 24
+              });
+            } else {
+              that.setData({
+                chargpiles: show_chargpiles,
+                total: res.data.total,
+                showAll: false,
+                pageNum: 1,
+                scrollTop: 24
+              });
+            }
+            wx.hideLoading();
+          }
+        }
+      });
+    }
+  },
+  loadInitData(e) {
+    wx.showLoading({
+      title: '刷新中',
+      mask: true
+    });
+    let that = this;
+    // 页面显示
+    if (that.data.userInfo && that.data.isLogin) {
+      wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargpileList',
+        data: {
+          pams: that.data.userInfo.userId,
+          chargStationName: that.data.searchString,
+          params: {
+            pageSize: 10,
+            pageNum: 1
+            //orderByColumn:
+            //isAsc: asc
+          }
+        },
+        method: 'POST',
+        success(res) {
+          //console.log(res);
+          if (res.data && res.data.code == 0) {
+            let {
+              rows: chargpiles
+            } = res.data;
+            var show_chargpiles = [];
+            chargpiles.forEach((item, index) => {
+              show_chargpiles.push({
+                chargStationId: item.chargStationId,
+                chargPileName: item.chargPileName,
+                chargPileId: item.chargPileId,
+                chargStationName: item.chargStationName,
+                chargmode: item.chargmode,//name = "充电模式", readConverterExp = "1=自动,2=手动"
+                chargway: item.chargway,//name = "充电方式", readConverterExp = "1=直流,2=交流"
+                chargstatus: item.chargstatus//充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+              });
+            });
+            if (res.data.total <= 10) {
+              that.setData({
+                chargpiles: show_chargpiles,
+                total: res.data.total,
+                showAll: true,
+                pageNum: 1,
+                scrollTop: 24
+              });
+            } else {
+              that.setData({
+                chargpiles: show_chargpiles,
+                total: res.data.total,
+                showAll: false,
+                pageNum: 1,
+                scrollTop: 24
+              });
+            }
+            wx.hideLoading();
+          }
+        }
+      });
+    }
+  },
+  loadMoreData(e) {
+    var totalPage = parseInt((this.data.total + 10 - 1) / 10);
+    if ((this.data.pageNum + 1) > totalPage) {
+      this.setData({
+        showAll: true
+      });
+      return;
+    }
+    wx.showLoading({
+      title: '加载中',
+      mask: true
+    });
+    let that = this;
+    let pageNum = this.data.pageNum + 1;
+    this.setData({
+      pageNum
+    });
+    // 页面显示
+    if (that.data.userInfo && that.data.isLogin) {
+      wx.request({
+        url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargpileList',
+        data: {
+          pams: that.data.userInfo.userId,
+          chargStationName: that.data.searchString,
+          params: {
+            pageSize: 10,
+            pageNum: pageNum
+            //orderByColumn:
+            //isAsc: asc
+          }
+        },
+        method: 'POST',
+        success(res) {
+          //console.log(res);
+          if (res.data && res.data.code == 0) {
+            let {
+              rows: chargpiles
+            } = res.data;
+            var show_chargpiles = that.data.chargpiles;
+            chargpiles.forEach((item, index) => {
+              show_chargpiles.push({
+                chargStationId: item.chargStationId,
+                chargPileName: item.chargPileName,
+                chargPileId: item.chargPileId,
+                chargStationName: item.chargStationName,
+                chargmode: item.chargmode,//name = "充电模式", readConverterExp = "1=自动,2=手动"
+                chargway: item.chargway,//name = "充电方式", readConverterExp = "1=直流,2=交流"
+                chargstatus: item.chargstatus//充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
+              });
+            });
+            that.setData({
+              chargpiles: show_chargpiles
+            });
+            if (pageNum * 10 >= that.data.total) {
+              that.setData({
+                showAll: true
+              });
+            }
+            wx.hideLoading();
+          }
+        }
+      });
+    }
+  }
+});

+ 3 - 0
pages/ucenter/chargpilemonitor/chargpilemonitorsearch.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "充电桩监控"
+}

+ 38 - 0
pages/ucenter/chargpilemonitor/chargpilemonitorsearch.wxml

@@ -0,0 +1,38 @@
+<scroll-view class='context' wx:if='{{chargpiles.length!=0}}' scroll-with-animation='true' scroll-y='true' scroll-top='{{scrollTop}}' bindscrolltoupper="loadInitData" bindscrolltolower="loadMoreData">
+  <text class="showInit">刷新中...</text>
+  <view class='context_block'></view>
+  <view class="map_text" hover-class='active' data-keywords="{{item}}" wx:key='{{key}}' wx:for="{{chargpiles}}">
+    <view class='charging_text_title'>
+      <view class='charging'>
+        <image src='/images/charging1.png'></image>
+      </view>
+      <view class='charging_text_title1'>
+        <text class='bold'>{{item.chargPileName}}</text>
+        <text class="h1">{{item.chargPileId}}</text>
+      </view>
+    </view>
+    <view style='line-height:0;'>
+      <text >所属充电站:{{item.chargStationName}}</text>
+      <text class='inline' wx:if='{{item.chargmode==1}}'>充电模式:自动</text>
+      <text class='inline' wx:if='{{item.chargmode==2}}'>充电模式:手动</text>
+      <text decode='true' class='inline' wx:if='{{item.chargway==1}}'>&emsp;&emsp;&emsp;&emsp;&emsp;充电方式:直流</text>
+      <text decode='true' class='inline' wx:if='{{item.chargway==2}}'>&emsp;&emsp;&emsp;&emsp;&emsp;充电方式:交流</text>
+    </view>
+    <!--充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等-->
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==0}}'>充电桩状态:离线&emsp;&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==1}}'>充电桩状态:故障&emsp;&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==2}}'>充电桩状态:空闲中&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==3}}'>充电桩状态:充电中&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==4}}'>充电桩状态:欠压故障&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==5}}'>充电桩状态:过压故障&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==6}}'>充电桩状态:过电流故障&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==8}}'>充电桩状态:预约&emsp;&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==9}}'>充电桩状态:在线升级&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==10}}'>充电桩状态:操作中&emsp;&emsp;&emsp;</text>
+      <text decode='true' class='inline' wx:if='{{item.chargstatus==11}}'>充电桩状态:已插枪&emsp;&emsp;&emsp;</text>
+      <!-- 运行状态2,3,8,10,11:正常运行、0,1,4,5,6,9:故障终止-->
+      <text class='inline' wx:if='{{item.chargstatus==2||item.chargstatus==3||item.chargstatus==8||item.chargstatus==10||item.chargstatus==11}}'>运行状态:正常运行</text>
+      <text class='inline' wx:if='{{item.chargstatus==0||item.chargstatus==1||item.chargstatus==4||item.chargstatus==5||item.chargstatus==6||item.chargstatus==9}}'>运行状态:故障终止</text>
+  </view>
+  <text class="showAll" wx:if='{{showAll}}'>已加载全部</text>
+</scroll-view>

+ 129 - 0
pages/ucenter/chargpilemonitor/chargpilemonitorsearch.wxss

@@ -0,0 +1,129 @@
+page {
+  height: 100%;
+  background-color: #f4f4f4;
+}
+.context {
+  height: 100%;
+  background-color: #f4f4f4;
+}
+
+.context_block {
+  width: 100%;
+  height: 32rpx;
+}
+
+.map_text {
+  position: relative;
+  height: 246rpx;
+  background: #fff;
+  padding: 0 30rpx;
+  margin: 0 20rpx 32rpx 20rpx;
+  border-radius: 20rpx;
+  box-shadow: 0rpx 4rpx 4rpx #d5d5d5;
+}
+
+.mychargestation {
+  background: #fafbfa;
+  box-shadow: 0rpx 4rpx 4rpx #d0d0d0;
+}
+
+.map_text.active, .map_text1.active {
+  background-color: #ebebeb;
+}
+
+.charging_text_title {
+  height: 105rpx;
+  width: 100%;
+  display: flex;
+}
+
+.charging_text_title1 {
+  width: 100%;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.charging {
+  width: 45rpx;
+  height: 45rpx;
+  margin: 30rpx 30rpx 30rpx 0;
+  flex-shrink: 0;
+  overflow: hidden;
+}
+
+.charging image {
+  width: 45rpx;
+  height: 45rpx;
+}
+
+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;
+}
+
+text.bold {
+  font-weight: bold;
+  line-height: 24rpx;
+  height: 24rpx;
+  min-height: 24rpx;
+  margin-top: 30rpx;
+  margin-bottom: 1rpx;
+  display: block;
+}
+
+text.inline {
+  display: inline-block;
+}
+
+text.fast {
+  color: #2483c0;
+}
+
+text.slow {
+  color: #42b9b4;
+}
+
+text.red {
+  color: red;
+}
+
+.h1 {
+  margin: 0rpx 0rpx 30rpx 0rpx;
+  font-size: 20rpx;
+  line-height: 20rpx;
+  height: 20rpx;
+  min-height: 20rpx;
+  color: #959595;
+}
+
+.h1.right {
+  margin: 55rpx 0rpx 30rpx 30rpx;
+  flex-shrink: 0;
+  float: right;
+}
+
+.showAll{
+  text-align: center;
+  color: #b5b5b5;
+}
+.showInit{
+  margin: 20rpx 0 0 0;
+  text-align: center;
+  color: #b5b5b5;
+}

+ 20 - 2
pages/ucenter/index/index.js

@@ -43,7 +43,6 @@ Page({
     //wx.setNavigationBarTitle({
     // title: '个人中心'
     //})
-
   },
 
   /**
@@ -154,6 +153,12 @@ Page({
       url
     });
   },
+  goChargpileMonitor(e) {
+    let url = '/pages/ucenter/chargpilemonitor/chargpilemonitor'
+    wx.navigateTo({
+      url
+    });
+  },
   goMyWorksheet(e) {
     let url = '/pages/ucenter/myworksheet/myworksheet'
     wx.navigateTo({
@@ -162,7 +167,7 @@ Page({
   },
   goHelp(){
     // wx.downloadFile({
-    //   //url: getApp().globalData.postHeadAgreement + '://cdgl.xinyhy.cn/restapi/wechat/updateUser',//要预览的PDF的地址
+    //   //url: getApp().globalData.postHeadAgreement + '/restapi/wechat/updateUser',//要预览的PDF的地址
     //   url: 'http://localhost:8080/aiconfig/index/downloadTest',//要预览的PDF的地址
     //   success: function (res) {
     //     console.log(res);
@@ -182,6 +187,19 @@ Page({
     // });
 
   },
+  goNotice(){
+    if (!this.data.isLogin) {
+      let url = `/pages/login/login`;
+      wx.navigateTo({
+        url
+      });
+      return;
+    }
+    let url = '/pages/ucenter/notice/notice'
+    wx.navigateTo({
+      url
+    });
+  },
   /*,
   goLogin: function() {
     wx.navigateTo({

+ 24 - 1
pages/ucenter/index/index.wxml

@@ -6,7 +6,7 @@
   <view class="user_text" bindtap='{{isLogin?"toUserCenter":"tologin"}}' hover-class='active'>
     <!--<open-data class="userAvatarUrl" bindtap="" type='userAvatarUrl'></open-data>-->
     <view class="userAvatarUrl" bindtap="">
-      <image src='{{isLogin?userInfo.avatar:"/images/userhead.png"}}'></image>
+      <image src='{{isLogin&&!userInfo.flag?userInfo.avatar:"/images/userhead.png"}}'></image>
     </view>
 
     <text class='bold'>{{isLogin?userInfo.userName:'点击登录'}}</text>
@@ -60,6 +60,17 @@
           <image src='/images/enter.png'></image>
         </view>
       </view>
+       <view class="zan-cell" wx:if='{{userInfo.flag}}' hover-class="active" bindtap="goChargpileMonitor">
+        <view class="zan-icon monitor">
+          <image src='/images/monitor.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}}' hover-class="active" bindtap="goMyWorksheet">
         <view class="zan-icon worksheet">
           <image src='/images/worksheet.png'></image>
@@ -72,6 +83,18 @@
         </view>
       </view>
       <!-- 运维用户 -->
+     
+      <view class="zan-cell" hover-class="active" bindtap="goNotice">
+        <view class="zan-icon notice">
+          <image src='/images/notice_icon.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="goHelp">
         <view class="zan-icon help">
           <image src='/images/help.png'></image>

+ 28 - 0
pages/ucenter/index/index.wxss

@@ -118,6 +118,7 @@ text.bold {
 }
 
 .zan-icon.chargemoneylog {
+  margin-right: 27rpx;
   width: 39rpx;
   height: 33rpx;
 }
@@ -128,6 +129,7 @@ text.bold {
 }
 
 .zan-icon.purse {
+  margin-right: 31rpx;
   width: 35rpx;
   height: 29rpx;
 }
@@ -139,6 +141,7 @@ text.bold {
 }
 
 .zan-icon.help {
+  margin-right: 32rpx;
   width: 34rpx;
   height: 34rpx;
 }
@@ -149,7 +152,20 @@ text.bold {
   height: 34rpx;
 }
 
+.zan-icon.notice {
+  margin-right: 38rpx;
+  width: 28rpx;
+  height: 36rpx;
+}
+
+.zan-icon.notice image {
+  display: block;
+  width: 28rpx;
+  height: 36rpx;
+}
+
 .zan-icon.charging3 {
+  margin-right: 34rpx;
   width: 32rpx;
   height: 32rpx;
 }
@@ -159,7 +175,19 @@ text.bold {
   width: 32rpx;
   height: 32rpx;
 }
+.zan-icon.monitor {
+  margin-right: 30rpx;
+  width: 36rpx;
+  height: 36rpx;
+}
+
+.zan-icon.monitor image {
+  display: block;
+  width: 36rpx;
+  height: 36rpx;
+}
 .zan-icon.worksheet {
+  margin-right: 38rpx;
   width: 28rpx;
   height: 36rpx;
 }

+ 3 - 2
pages/ucenter/mychargestation/mychargestation.js

@@ -52,7 +52,7 @@ Page({
             longitude,
           } = res;
           wx.request({
-            url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/userChargStations',
+            url: getApp().globalData.postHeadAgreement +'/restapi/wechat/userChargStations',
             data: {
               userId: userInfo.userId,
               lat: latitude,
@@ -96,7 +96,8 @@ Page({
                   /** 服务费 */
                   serviceprice: item.serviceprice,
                   /** 停车费 */
-                  stopprice: item.stopprice
+                  stopprice: item.stopprice,
+                  operationState: item.operationState
                 };
                 markers[index] = marker;
               });

+ 8 - 0
pages/ucenter/mychargestation/mychargestation.wxml

@@ -30,6 +30,14 @@
       <!--<text decode='true' class='inline'>电桩数:{{item.chargPileNum}}&nbsp;&nbsp;&nbsp;&nbsp;空闲数:</text>
       <text class='fast inline' decode='true'>快{{item.fastfreenum==null?0:item.fastfreenum}}&nbsp;&nbsp;</text>
       <text class='slow inline'>慢{{item.slowfreenum==null?0:item.slowfreenum}}</text>-->
+      <!-- 初始,待运营,运营中,暂停营业,关闭,未运营 -->
+      <text  decode='true'  class='inline' >&nbsp;&nbsp;&nbsp;&nbsp;状态:</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==1}}">初始</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==2}}">待运营</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==3}}">运营中</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==4}}">暂停营业</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==5}}">关闭</text>
+      <text  decode='true'  class='inline' wx:if="{{item.operationState==6}}">未运营</text>
     </view>
     <text class='fast'>快桩数:{{item.fastCharg==null?0:item.fastCharg}}</text>
     <text class='slow'>慢桩数:{{item.slowCharg==null?0:item.slowCharg}}</text>

+ 1 - 1
pages/ucenter/myworksheet/myworksheet.js

@@ -50,7 +50,7 @@ Page({
         isLogin: isLogin
       });
       wx.request({
-        url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/workSheets',
+        url: getApp().globalData.postHeadAgreement +'/restapi/wechat/workSheets',
         data: {
           accendant: userInfo.userName
           //accendant: '康国栋'

+ 98 - 0
pages/ucenter/notice/notice.js

@@ -0,0 +1,98 @@
+// pages/ucenter/notice/notice.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    userInfo: {},
+    isLogin: false,
+    noticeList: []
+  },
+  goInfo(e) {
+    console.log(e);
+    let {
+      keywords
+    } = e.currentTarget.dataset;
+    //console.log(notice);
+    let notice = JSON.stringify(keywords);
+    //console.log(notice);
+    let url = '/pages/ucenter/notice_info/notice_info?notice=' + notice;
+    wx.navigateTo({
+      url
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let that = this;
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    //console.log(userInfo);
+    wx.request({
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/noticeList',
+      data: { loginName: userInfo.loginName },
+      method: 'POST',
+      success(res) {
+        if (res.data) {
+          that.setData({
+            noticeList: res.data
+          });
+        }
+      },
+      fail(e) {
+        console.log(e);
+      }
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function (e) {
+   
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/ucenter/notice/notice.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "通知公告",
+  "usingComponents": {}
+}

+ 15 - 0
pages/ucenter/notice/notice.wxml

@@ -0,0 +1,15 @@
+<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="{{noticeList}}">
+    <view class='notice_text_title'>
+      <view class='notice'>
+        <image src='/images/notice_list.png'></image>
+      </view>
+      <view class='notice_text_title1'>
+        <text class='bold'>{{item.noticeTitle}}</text>
+        <text class="h1">{{item.createTime}}</text>
+      </view>  
+    </view>  
+  </view>
+  
+</scroll-view>

+ 92 - 0
pages/ucenter/notice/notice.wxss

@@ -0,0 +1,92 @@
+/* pages/ucenter/notice/notice.wxss */
+page {
+  background-color: #f4f4f4;
+  height: 100%;
+  overflow-y:hidden; 
+}
+
+.context {
+  height: 100%;
+}
+.context_block{
+  width: 100%;
+  height: 32rpx;
+}
+.map_text {
+  position: relative;
+  height: 112rpx;
+  background: #fff;
+  padding: 0 30rpx;
+  margin: 0 20rpx 32rpx 20rpx;
+  border-radius: 10rpx;
+  box-shadow: 0rpx 4rpx 4rpx #d5d5d5;
+}
+
+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;
+}
+.notice_text_title {
+  height: 112rpx;
+  width: 100%;
+  display: flex;
+}
+
+.notice_text_title1 {
+  width: 100%;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+
+.notice {
+  width: 49rpx;
+  height: 61rpx;
+  margin: 26rpx 30rpx 26rpx 0;
+  flex-shrink: 0;
+  overflow: hidden;
+}
+
+.notice image {
+  width: 49rpx;
+  height: 61rpx;
+}
+
+text.bold {
+  font-weight: bold;
+  line-height: 28rpx;
+  height: 28rpx;
+  min-height: 28rpx;
+  margin-top: 26rpx;
+  margin-bottom: 13rpx;
+  display: block;
+}
+
+text.inline {
+  display: inline-block;
+}
+
+.h1 {
+  margin: 0rpx 0rpx 30rpx 0rpx;
+  font-size: 20rpx;
+  line-height: 20rpx;
+  height: 20rpx;
+  min-height: 20rpx;
+  color: #959595;
+}

+ 74 - 0
pages/ucenter/notice_info/notice_info.js

@@ -0,0 +1,74 @@
+// pages/ucenter/notice_info/notice_info.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    noticeInfo:null
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    //console.log(options);
+    let {
+      notice
+    } = options;
+    console.log(notice);
+    let noticeInfo = JSON.parse(notice);
+    this.setData({
+      noticeInfo
+    });
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/ucenter/notice_info/notice_info.json

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

+ 10 - 0
pages/ucenter/notice_info/notice_info.wxml

@@ -0,0 +1,10 @@
+<!--pages/ucenter/notice_info/notice_info.wxml-->
+<view wx:if='{{noticeInfo}}'>
+  <text class='content_title bold'>{{noticeInfo.noticeTitle}}</text>
+  <!--<text class='content_title1'>发布单位:{{noticeInfo.remark}}</text>-->
+  <text class='content_title1'>发布单位:派捷充电平台</text>
+  <text class='content_title2'>时间:{{noticeInfo.createTime}}</text>
+  <view class='content'>
+    <view class='modalMsg' ><rich-text nodes='{{noticeInfo.noticeContent}}'></rich-text></view>
+  </view>
+</view>

+ 51 - 0
pages/ucenter/notice_info/notice_info.wxss

@@ -0,0 +1,51 @@
+/* pages/ucenter/notice_info/notice_info.wxss */
+page {
+  background-color: #f4f4f4;
+}
+
+text {
+  margin: 0rpx 50rpx;
+  display: block;
+  font-size: 24rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #959595;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+  line-height: 36rpx;
+}
+rich-text{
+  margin: 0rpx 50rpx;
+  display: block;
+  font-size: 24rpx;
+  font-family: 'Lucida Sans',
+                 'Lucida Sans Regular',
+                 'Lucida Grande',
+                 'Lucida Sans Unicode',
+                 Geneva,
+                 Verdana,
+                 sans-serif;
+  color: #818181;
+  line-height: 36rpx;
+}
+text.bold {
+  font-weight: bold;
+  margin:50rpx 20rpx 20rpx 20rpx;
+  text-align: center;
+  font-size: 32rpx;
+  line-height: 48rpx;
+  color: #545352;
+}
+.content_title1,.content_title2{
+  text-align: center;
+}
+
+.content {
+  margin: 50rpx 0rpx;
+}

+ 1 - 1
pages/ucenter/purse/purse.js

@@ -42,7 +42,7 @@ Page({
     let isLogin = wx.getStorageSync('isLogin');
     let that = this;
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/syncUser',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/syncUser',
       data: {
         loginName: userInfo.loginName
       },

+ 1 - 1
pages/worksheetinfo/accendant.js

@@ -36,7 +36,7 @@ Page({
     //console.log(chargstationid);
     let that = this;
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/getuserstation',
+      url: getApp().globalData.postHeadAgreement +'/restapi/wechat/getuserstation',
       data: chargstationid,
       method: 'POST',
       success(res) {

+ 218 - 75
pages/worksheetinfo/worksheetinfo.js

@@ -6,6 +6,7 @@ Page({
    */
   data: {
     images: [],
+    signs: [],
     worksheetinfo: {},
     chargstations: [],
     chargstationsindex: 0,
@@ -25,10 +26,12 @@ Page({
     }, {
       value: 5,
       text: '进行中'
-    }, {
-      value: 6,
-      text: '已完成'
-    }, {
+    }
+    // , {
+    //   value: 6,
+    //   text: '已完成'
+    // }
+    , {
       value: 7,
       text: '完成确认'
     }],
@@ -41,10 +44,27 @@ Page({
       text: '工程实施'
     }],
     workBigclassindex: 0,
-    exceptdate: '0000-00-00',
-    excepttime: '00:00',
-    finishdate: '0000-00-00',
-    finishtime: '00:00',
+    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: []
   },
   bindChargstationsChange: function(e) {
@@ -81,6 +101,16 @@ Page({
       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) {
     let chargstationid = this.data.chargstations[this.data.chargstationsindex].id;
     let accendant = this.data.worksheetinfo.accendant;
@@ -129,37 +159,38 @@ Page({
     let worksheetinfo = this.data.worksheetinfo;
     worksheetinfo.pams = this.data.accendantids;
     worksheetinfo.accendant = null;
-    worksheetinfo.exceptTime = this.data.exceptdate + " " + this.data.excepttime + ":00";
-    worksheetinfo.finishTime = this.data.finishdate + " " + this.data.finishtime + ":00";
-
+    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;
-    if (images.length == 0) {
-      wx.request({
-        url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/editWorkSheet',
-        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 {
-      var imgString = [];
-
-      function uploadFile() {
+    var imgString = [];
+    
+    var pciString = [];
+    this.data.pcitures.forEach((item, index) =>{
+      pciString.push(item.src);
+    });
 
-      }
-      images.forEach((item, index) => {
+    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 +'://cdgl.xinyhy.cn/restapi/wechat/editWorkSheetImg',
-          filePath: images[index],
+          url: getApp().globalData.postHeadAgreement + '/restapi/wechat/editWorkSheetImg',
+          filePath: signs[index],
           name: 'imageFileName',
           success: function(res) {
             let result = JSON.parse(res.data);
@@ -169,57 +200,117 @@ Page({
                 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 = imgString.join(",");
-                    wx.request({
-                      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/editWorkSheet',
-                      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);
-
-
-              }
+              signString.push(result.msg);
+              console.log(signString);
             }
-          },
-          fail: function(data) {
-            console.log(data);
           }
         });
       });
-
     }
+    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);
+          }
+          wx.request({
+            url: getApp().globalData.postHeadAgreement + '/restapi/wechat/editWorkSheet',
+            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);
+                        wx.request({
+                          url: getApp().globalData.postHeadAgreement + '/restapi/wechat/editWorkSheet',
+                          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: 5,
+      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 <= 5 ? images : images.slice(0, 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: [],
+          //pcitures: [],
           images
         });
       }
@@ -235,14 +326,47 @@ Page({
       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, //所有要预览的图片
+    })
+  },
 
   /**
    * 生命周期函数--监听页面加载
@@ -254,6 +378,7 @@ Page({
     } = options;
     //console.log(worksheet);
     let worksheetinfo = JSON.parse(worksheet);
+    //worksheetinfo.breakdownType = 2;
     this.setData({
       worksheetinfo
     });
@@ -285,9 +410,21 @@ Page({
         finishtime: datetime[1].substr(0, 5)
       });
     }
+    this.data.breakdownType.forEach((item, index) => {
+      if (item.value == worksheetinfo.breakdownType) {
+        this.setData({
+          breakdownTypeindex: index
+        });
+      }
+    });
+    
 
     if (worksheetinfo.pciture) {
-      let pcitures = worksheetinfo.pciture.split(",");
+      let pcitures_src = worksheetinfo.pciture.split(",");
+      var pcitures = [];
+      pcitures_src.forEach((item, index) => {
+        pcitures[index] = { src: item, flag: item.indexOf('https://cdgl.pjnes.com/profile/station/') != -1};
+      });
       this.setData({
         pcitures
       });
@@ -309,7 +446,7 @@ Page({
             longitude,
           } = res;
           wx.request({
-            url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/userChargStations',
+            url: getApp().globalData.postHeadAgreement + '/restapi/wechat/userChargStations',
             data: {
               userId: userInfo.userId,
               lat: latitude,
@@ -337,7 +474,7 @@ Page({
       });
     }
     wx.request({
-      url: getApp().globalData.postHeadAgreement +'://cdgl.xinyhy.cn/restapi/wechat/getuserworksheet',
+      url: getApp().globalData.postHeadAgreement + '/restapi/wechat/getuserworksheet',
       data: worksheetinfo.id,
       method: 'POST',
       success(res) {
@@ -352,7 +489,13 @@ Page({
       }
     });
   },
+  openSign(e) {
+    let url = `/pages/sign/sign`;
+    wx.navigateTo({
+      url
+    });
 
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 45 - 17
pages/worksheetinfo/worksheetinfo.wxml

@@ -2,51 +2,61 @@
 <scroll-view scroll-y='true'>
   <view class="context">
     <text>场站</text>
-    <picker class="picker" bindchange="bindChargstationsChange" value="{{chargstationsindex}}" range-key="chargStationName" range="{{chargstations}}">
+    <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' bindinput='bindMainLocationInput' type='text' value='{{worksheetinfo.mainLocation}}'></input>
+    <input class='input' disabled="{{worksheetinfo.workStatus==6}}" bindinput='bindMainLocationInput' type='text' value='{{worksheetinfo.mainLocation}}'></input>
   </view>
   <view class="context">
     <text>工单状态</text>
-    <picker class="picker" bindchange="bindWorkstatusChange" value="{{workstatusindex}}" range-key="text" range="{{workstatus}}">
+    <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" bindchange="bindWorkBigclassChange" value="{{workBigclassindex}}" range-key="text" range="{{workBigclass}}">
+    <picker class="picker" disabled="{{worksheetinfo.workStatus==6}}" bindchange="bindWorkBigclassChange" value="{{workBigclassindex}}" range-key="text" range="{{workBigclass}}">
       <text>{{workBigclass[workBigclassindex].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 bindtap='bindAccendantChange' class='input' type='text' value='{{worksheetinfo.accendant}}'></input>
+    <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'  bindinput='bindContentInput'  type='text' value='{{worksheetinfo.content}}'></input>
+    <input class='input' disabled="{{worksheetinfo.workStatus==6}}"  bindinput='bindContentInput'  type='text' value='{{worksheetinfo.content}}'></input>
   </view>
   <view class="context">
     <text>预计完成时间</text>
-    <picker class="picker1" mode="date" value="{{exceptdate}}" bindchange="bindExceptdateChange">
-      <text>{{exceptdate}}</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" mode="time" value="{{excepttime}}" bindchange="bindExcepttimeChange">
-      <text>{{excepttime}}:00</text>
+    <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" mode="date" value="{{finishdate}}" bindchange="bindFinishdateChange">
-      <text>{{finishdate}}</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" mode="time" value="{{finishtime}}" bindchange="bindFinishtimeChange">
-      <text>{{finishtime}}:00</text>
+    <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>
@@ -54,8 +64,10 @@
    <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 class="q-image" src="https://cdgl.xinyhy.cn/profile/station/{{item}}" 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>
@@ -70,12 +82,28 @@
       </view>
     </block>
   </view>
-  <view class="context_image">
+  <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>
 
-<button bindtap='bindWorkSheetSubmit' class='submitbutton'>提交</button>
+<button wx:if="{{worksheetinfo.workStatus!=6}}" bindtap='bindWorkSheetSubmit' class='submitbutton'>提交</button>

+ 7 - 1
project.config.json

@@ -9,10 +9,12 @@
 		"autoAudits": false
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.7.7",
+	"libVersion": "2.13.1",
 	"appid": "wx6e03e5ada030b1aa",
 	"projectname": "充电桩",
 	"isGameTourist": false,
+	"simulatorType": "wechat",
+	"simulatorPluginLibVersion": {},
 	"condition": {
 		"search": {
 			"current": -1,
@@ -30,6 +32,10 @@
 			"currentL": -1,
 			"list": []
 		},
+		"gamePlugin": {
+			"current": -1,
+			"list": []
+		},
 		"miniprogram": {
 			"current": -1,
 			"list": []

+ 7 - 0
sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

+ 30 - 0
utils/log.js

@@ -0,0 +1,30 @@
+var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
+
+module.exports = {
+  debug() {
+    if (!log) return
+    log.debug.apply(log, arguments)
+  },
+  info() {
+    if (!log) return
+    log.info.apply(log, arguments)
+  },
+  warn() {
+    if (!log) return
+    log.warn.apply(log, arguments)
+  },
+  error() {
+    if (!log) return
+    log.error.apply(log, arguments)
+  },
+  setFilterMsg(msg) { // 从基础库2.7.3开始支持
+    if (!log || !log.setFilterMsg) return
+    if (typeof msg !== 'string') return
+    log.setFilterMsg(msg)
+  },
+  addFilterMsg(msg) { // 从基础库2.8.1开始支持
+    if (!log || !log.addFilterMsg) return
+    if (typeof msg !== 'string') return
+    log.addFilterMsg(msg)
+  }
+}

Some files were not shown because too many files changed in this diff