XWookey 3 år sedan
förälder
incheckning
667640e4d8

+ 1 - 1
app.js

@@ -3,7 +3,7 @@ let wechat = require('./utils/wechat.js');
 let log = require('./utils/log.js');
 App({
   globalData: {
-    postHeadAgreement: 'https://jqcs.pjnes.com/cloud/chargapi',
+    postHeadAgreement: 'https://cdglyy.pjnes.com/cloud/chargapi',
     helpPhoneNum: '18211188302',
     version:'2.0'
   },

+ 14 - 0
pages/charging/charging.js

@@ -62,6 +62,8 @@ Page({
     chargingTime: '',
     yczds:'',
     totalMoney:'',
+    cdscdy:0,
+    cdscdl:0,
     chargingOrder: null,
     chargPile: null,
     ec: {
@@ -72,6 +74,10 @@ Page({
       var newoption = chart.getOption();
       newoption.series[0].data[0] = parseFloat(step / 100.0).toFixed(2);
       chart.setOption(newoption, true);
+      console.info(newoption)
+      console.info("dsfsdfsf")
+      console.info(step)
+      console.info(newoption.series[0].data[0])
   },
   stopCharging(e) {
     wx.showLoading({
@@ -251,6 +257,8 @@ Page({
               var chargingTime = chargingTimeHour + ":" + chargingTimeMinute + ":00";
             }
             var totalMoney = (parseFloat(chargingOrder.ycdfje) + parseFloat(chargingOrder.ycfwfje)).toFixed(2);
+            var cdscdl = chargingOrder.cdscdl;
+            var cdscdy = chargingOrder.cdscdy;
             var yczds = parseFloat(chargingOrder.yczds).toFixed(2);
             that.setData({
               chargingOrder,
@@ -258,6 +266,8 @@ Page({
               chargingTime,
               orderid: orderid_r,
               totalMoney,
+              cdscdl,
+              cdscdy,
               yczds
             });
             that.showChargingPng();
@@ -376,6 +386,8 @@ Page({
                 }
                 var chargingTime = chargingTimeHour + ":" + chargingTimeMinute + ":00";
               }
+              var cdscdl = chargingOrder.cdscdl;
+              var cdscdy = chargingOrder.cdscdy;
               var totalMoney = (parseFloat(chargingOrder.ycdfje) + parseFloat(chargingOrder.ycfwfje)).toFixed(2);
               var yczds = parseFloat(chargingOrder.yczds).toFixed(2);
               that.setData({
@@ -384,6 +396,8 @@ Page({
                 chargingTime,
                 chargingRate,
                 orderid: orderid_r,
+                cdscdl,
+                cdscdy,
                 totalMoney,
                 yczds
               });

+ 2 - 2
pages/charging/charging.wxml

@@ -20,12 +20,12 @@
     <view class='context_view' bindtap="goPurse" hover-class='active'>
       <image class='electric' src='/images/electric.png'></image>
       <text>电流</text>
-      <text class='text2'>3.5kW-16A</text>
+      <text class='text2'>{{cdscdl}}A</text>
     </view>
     <view class='context_view1' bindtap="goCharginglog" hover-class='active'>
       <image class='voltage' src='/images/voltage.png'></image>
       <text>电压</text>
-      <text class='text2'>220V</text>
+      <text class='text2'>{{cdscdy}}V</text>
     </view>
     <view class='context_view' hover-class='active'>
       <image class='money' src='/images/money.png'></image>

+ 37 - 2
pages/scan_result/scan_result.js

@@ -8,7 +8,8 @@ Page({
   data: {
     chargPile: null,
     orderid: null,
-    userId: null
+    userId: null,
+    repaidbalance: 0
   },
 
   /**
@@ -38,6 +39,33 @@ Page({
           }
         });
         log.info('[扫码]', '[加载完成]', '[参数]', res.data);
+		let userInfo = wx.getStorageSync('userInfo');
+		wx.request({
+		  url: getApp().globalData.postHeadAgreement + '/restapi/wechat/syncUser',
+		  data: {
+			loginName: userInfo.loginName
+		  },
+		  method: 'POST',
+		  success: function (res) {
+			let {
+			  data
+			} = res;
+			log.info('[扫码]', '[同步用户数据]', '[响应]', data);
+			console.info('[扫码]', '[同步用户数据]', '[响应]', data);
+			if (data.code && data.code != 200) {
+			  log.info('[扫码]', '[同步用户数据]', '[失败data null||data.code<>200跳转登陆界面]', data);
+			} else {
+			  that.setData({
+				repaidbalance:data.repaidbalance
+			  });
+			}
+		  },
+		  fail(e) {
+			console.log("用户数据同步失败");
+			log.info('[扫码]', '[同步用户数据]', '[fail]', e);
+		  }
+		});
+
       }
     });
   },
@@ -65,7 +93,10 @@ Page({
         let {
           data
         } = res;
+
+
         log.info('[扫码]', '[同步用户数据]', '[响应]', data);
+        console.info('[扫码]', '[同步用户数据]', '[响应]', data);
         if (data.code && data.code != 200) {
           wx.removeStorageSync('userInfo');
           wx.removeStorageSync('isLogin');
@@ -77,7 +108,11 @@ Page({
         } else {
           wx.setStorageSync('userInfo', data);
           wx.setStorageSync('isLogin', true);
-
+          let repaidbalance = data.repaidbalance;
+          that.setData({
+            repaidbalance
+          });
+          console.info("sssssss   " + data.repaidbalance)
           //开始充电
           if (!data.repaidbalance || data.repaidbalance <= 0) {
             wx.showModal({

+ 11 - 5
pages/scan_result/scan_result.wxml

@@ -25,10 +25,10 @@
       <text decode='true' style='font-size:24rpx;color:#a3a3a3;margin-bottom:10rpx;'>服务费:尖峰{{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:24rpx;color:#a3a3a3;margin-bottom:10rpx;'>电&nbsp;&nbsp;&nbsp;费:尖峰{{chargPile.sharpChargPrice}}元&nbsp;&nbsp;高峰{{chargPile.peakChargPrice}}元&nbsp;&nbsp;平段{{chargPile.flatChargPrice}}元&nbsp;&nbsp;低谷{{chargPile.valleyChargPrice}}元&nbsp;&nbsp;</text>
+      <text decode='true' style='font-size:24rpx;color:#FF0000;margin-bottom:10rpx;'>电&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='font-size:24rpx;color:#a3a3a3;margin-bottom:10rpx;'>总费用:尖峰{{chargPile.sharpTotalPrice}}元&nbsp;&nbsp;高峰{{chargPile.peakTotalPrice}}元&nbsp;&nbsp;平段{{chargPile.flatTotalPrice}}元&nbsp;&nbsp;低谷{{chargPile.valleyTotalPrice}}元&nbsp;&nbsp;</text>
+      <text decode='true' style='font-size:24rpx;color:red;margin-bottom:10rpx;'>总费用:尖峰{{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>
@@ -54,10 +54,16 @@
     <view style='line-height:0;'>
       <text decode='true' style='font-size:24rpx;color:#a3a3a3;margin-bottom:10rpx;'>尖峰: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>
+      <rich-text style='line-height:48rpx;color:red;font-size:32rpx;word-break:break-all;'>信息展现:{{chargPile.showinfo}}</rich-text> 
+    </view> -->
+  </view>
+  <view>
+    <rich-text style='line-height:48rpx;color:red;font-size:32rpx;word-break:break-all;'>您当前余额为:{{repaidbalance}}元。建议参考充电总费用(元/度电)与您爱车的电池容量(度),避免因费用不足导致充电量不足的情况发生。</rich-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>
   <button wx:if="{{chargPile}}" class='charg_button' bindtap="beginCharge" >开始充电</button>
 

+ 2 - 2
pages/scan_result/scan_result.wxss

@@ -1,4 +1,4 @@
-/* pages/scan_result/scan_result.wxss */
+map_text/* pages/scan_result/scan_result.wxss */
 page {
   height: 100%;
   overflow-y:hidden; 
@@ -14,7 +14,7 @@ view.inline {
 
 .map_text {
   position: relative;
-  height: calc(100% - 210rpx);
+  height: calc(100% - 240rpx);
   background: #fff;
   padding: 20rpx 30rpx 0 30rpx;
   box-shadow: 0rpx 6rpx 6rpx  #f5f5f5 inset;