XWookey 2 年 前
コミット
23b5c94764

+ 5 - 0
app.js

@@ -3,6 +3,9 @@ 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: '4009608068',
     version:'2.0'
@@ -36,6 +39,8 @@ App({
   onShow() {
     let userInfo = wx.getStorageSync('userInfo');
     let isLogin = wx.getStorageSync('isLogin');
+    console.info("cccccccccccccccccccccccccccccccccccccccccccccccccccccc")
+    console.info(userInfo)
     // 页面显示
     if (userInfo && isLogin) {
       if ((!userInfo.userId && userInfo.userId != 0)) {

+ 6 - 1
pages/charging/charging.js

@@ -225,10 +225,15 @@ Page({
           log.info('[充电中]', '[获取充电桩]', '[请求]', chargPileId);
           wx.request({
             url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
-            data: chargPileId,
+            // data: chargPileId,
+            data:{
+              chargPileId:chargPileId,
+              userId: userId
+            },
             method: 'POST',
             success(res1) {
               //console.log(res1.data);
+              res1.data = res1.data.result
               if (res1.data) {
                 let {
                   data: chargPile

+ 19 - 7
pages/index/index.js

@@ -111,7 +111,11 @@ Page({
               log.info('[首页]', '[获取微信扫一扫充电桩]', '[请求]', charePileId);
               wx.request({
                 url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
-                data: charePileId,
+                // data: charePileId,
+                data:{
+                  chargPileId:charePileId,
+                  userId: userInfo.userId
+                },
                 method: 'POST',
                 success(res) {
                   //console.log(res.data);
@@ -120,12 +124,14 @@ Page({
                     //没有该充电桩信息
                     wx.showModal({
                       showCancel: false,
-                      content: '无效的终端编号'
+                      content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号'
                     });
                   } else {
+                    res.data = res.data.result
                     //充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
                     if (!res.data.chargstatus || res.data.chargstatus == 0 || res.data.chargstatus == 1 || res.data.chargstatus == 4 || res.data.chargstatus == 5 || res.data.chargstatus == 6 || res.data.chargstatus == 9) {
                       //充电桩故障
+
                       wx.showModal({
                         showCancel: false,
                         content: '终端故障,维修中'
@@ -560,6 +566,7 @@ Page({
   click_scan_control(e) {
     console.log("打开扫一扫");
     log.info('[首页]', '[打开扫一扫]');
+    let that = this;
     if (!this.data.isLogin) {
       log.info('[首页]', '[未登陆跳转登录界面]');
       let url = `/pages/login/login`;
@@ -610,7 +617,7 @@ Page({
                 //console.log(d);
                 //兼容标准格式hlht://202001022222220101.330414214二维码
                 let scanResult = d.result;
-                if(scanResult || scanResult == ""){
+                if((!scanResult) || scanResult == ""){
                   scanResult="*"
                 }
                 console.log(scanResult);
@@ -622,21 +629,26 @@ Page({
                 log.info('[首页]', '[获取扫一扫充电桩]', '[请求]', scanResult);
                 wx.request({
                   url: getApp().globalData.postHeadAgreement + '/restapi/wechat/chargPile',
-                  data: scanResult,
+                  // data: scanResult,
+                  data: {
+                    chargPileId:scanResult,
+                    userId: that.data.userInfo.userId
+                  },
                   method: 'POST',
                   success(res) {
-                    //console.log(res.data);
+                    console.log(scanResult);
                     log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
                     if (!res.data || res.data.code == 500) {
                       //没有该充电桩信息
                       wx.showModal({
                         showCancel: false,
-                        content: '无效的终端编号'
+                        content: res && res.data && res.data.msg ? res.data.msg :'无效的终端编号'
                       });
                     } else {
+                      res.data = res.data.result
                       //充电状态0:离线、1:故障、2:空闲中、3:充电中、4:欠压故障、5:过压故障、6:过电流故障、8:预约、9:在线升级、10:操作中、11:已插枪等
                       if (!res.data.chargstatus || res.data.chargstatus == 0 || res.data.chargstatus == 1 || res.data.chargstatus == 4 || res.data.chargstatus == 5 || res.data.chargstatus == 6 || res.data.chargstatus == 9) {
-                        //充电桩故障
+                        //充电桩故障    
                         wx.showModal({
                           showCancel: false,
                           content: '终端故障,维修中'

+ 1 - 1
pages/index/index.wxml

@@ -78,7 +78,7 @@
     <image src='/images/index_selected.png'></image>
     <text class='selected'>首页</text>
   </view>
-  <view class='footer_2' bindtap='click_scan_control'>
+  <view class='footer_2' bindtap='click_scan_control' wx:if='{{!userInfo.flag}}'>
     <image src='/images/scan.png'></image>
   </view>
   <view class='footer_3' bindtap='bindUserAvatarUrl'>

+ 3 - 3
pages/order/order.wxml

@@ -9,11 +9,11 @@
       <image src='/images/charging2_1.png'></image>
     </view>
     <view class='charging_text_title1'>
-      <text class='bold'>终端编号:{{chargPileId}}</text>
-      <text class="h1">{{order.chargPile.chargPileName}}</text>
+      <text class='bold'>{{order.chargPile.chargPileName}}</text>
+      <text class="h1">终端编号:{{chargPileId}}</text>
     </view>
   </view>
-  <text>地址:{{order.chargStation.chargStationName}}</text>
+  <text>地址:{{order.chargStation.address}}</text>
   <view class="table">
     <view class="tr title">
       <view class="th">

+ 13 - 9
pages/scan_result/scan_result.wxml

@@ -13,22 +13,23 @@
         <text class="h1">终端编号:{{chargPile.chargPileId}}</text>
       </view>
     </view>
-    <text style='margin-bottom:10rpx;'>地址:{{chargPile.address}}</text>
+    <!-- <text style='margin-bottom:10rpx;'>地址:{{chargPile.address}}</text> -->
+    <rich-text space='nbsp' nodes="地址:{{chargPile.address}}" style='line-height:30rpx;font-size:24rpx;margin-bottom:10rpx;word-wrap: break-word;' ></rich-text>
     <!-- <text 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='font-size:24rpx;margin-bottom:10rpx;'>电&nbsp;&nbsp;&nbsp;费:{{chargPile.chargprice}}元&nbsp;&nbsp;服务费:{{chargPile.serviceprice}}元&nbsp;&nbsp;总费用:{{chargPile.totalprice}}元</text>
+      <rich-text space='nbsp' nodes="电   费:{{chargPile.chargprice}}元  服务费:{{chargPile.serviceprice}}元  总费用:{{chargPile.totalprice}}元" style='line-height:30rpx;font-size:24rpx;margin-bottom:10rpx;word-wrap: break-word;' ></rich-text>
     </view>
     <text class="inline">参考价格:</text>
     <view style='line-height:0;'>
-      <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>
+      <rich-text space='nbsp' nodes="服务费:尖峰{{chargPile.sharpServicePrice}}元  高峰{{chargPile.peakServicePrice}}元  平段{{chargPile.flatServicePrice}}元  低谷{{chargPile.valleyServicePrice}}元  " style='line-height:30rpx;font-size:24rpx;color:#a3a3a3;margin-bottom:10rpx;word-wrap: break-word;'></rich-text>
     </view>
-    <view style='line-height:0;'>
-      <text decode='true' style='font-size:24rpx;margin-bottom:10rpx;'>电&nbsp;&nbsp;&nbsp;费:尖峰{{chargPile.sharpChargPrice}}元&nbsp;&nbsp;高峰{{chargPile.peakChargPrice}}元&nbsp;&nbsp;平段{{chargPile.flatChargPrice}}元&nbsp;&nbsp;低谷{{chargPile.valleyChargPrice}}元&nbsp;&nbsp;</text>
+    <view style='line-height:0;margin-bottom:10rpx'>
+      <rich-text space="nbsp" nodes="电   费:尖峰{{chargPile.sharpChargPrice}}元  高峰{{chargPile.peakChargPrice}}元  平段{{chargPile.flatChargPrice}}元  低谷{{chargPile.valleyChargPrice}}元  " style='line-height:30rpx;font-size:24rpx;margin-bottom:10rpx;word-wrap: break-word;'></rich-text>
     </view>
     <view style='line-height:0;'>
-      <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>
+      <rich-text space='nbsp' nodes="总费用:尖峰{{chargPile.sharpTotalPrice}}元  高峰{{chargPile.peakTotalPrice}}元  平段{{chargPile.flatTotalPrice}}元  低谷{{chargPile.valleyTotalPrice}}元  " style='line-height:30rpx;font-size:24rpx;color:red;margin-bottom:10rpx;word-wrap: break-word;'></rich-text>
     </view>
     <!-- <view style='line-height:0;'>
       <text decode='true' class='inline'>费用:&nbsp;&nbsp;</text>
@@ -41,7 +42,10 @@
       <text decode='true' class='slow inline'>{{chargPile.valleyChargPrice}}</text>
       <text decode='true' class='inline'>元谷&nbsp;&nbsp;</text>
     </view> -->
-    <text class="inline">峰谷时段划分:</text>
+    <!-- <text class="inline"></text> -->
+    <view style="margin-bottom:10rpx;margin-top:10rpx">
+    <rich-text style='line-height:30rpx;word-break:break-all;color: #575757;font-size:26rpx;'><span style="font-weight:bold;color:#000">北京地区</span>峰谷时段划分如下所示(如有峰谷差异电价,详情请咨询场站现场负责人):</rich-text>
+  </view>
     <view style='line-height:0;'>
       <text decode='true' style='font-size:24rpx;color:#a3a3a3;margin-bottom:10rpx;'>高峰:10:00-15:00&nbsp;&nbsp;18:00-21:00</text>
     </view>
@@ -59,10 +63,10 @@
       <rich-text style='line-height:48rpx;color:red;font-size:32rpx;word-break:break-all;'>信息展现:{{chargPile.showinfo}}</rich-text> 
     </view> -->
   </view>
-  <view>
+  <view  style='margin-top:24rpx;'>
     <rich-text style='line-height:48rpx;color:red;font-size:32rpx;word-break:break-all;'>您当前余额为:{{repaidbalance}}元。建议参考充电总费用(元/度电)与您爱车的电池容量(度),避免因费用不足导致充电量不足的情况发生。</rich-text>
   </view>
-  <view wx:if="{{chargPile.showinfo}}">
+  <view wx:if="{{chargPile.showinfo}}" style='margin-top:24rpx;'>
     <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>

+ 3 - 0
pages/ucenter/help/help.wxml

@@ -9,7 +9,10 @@
       <image class='online_service' src='/images/online_service.png'></image>
       <text>在线客服</text>
     </view>
+
+
   </view>
+
   <!-- <view class='title1'>
     <text class='blod'>常见问题</text>
   </view> -->

+ 5 - 0
pages/ucenter/help/help.wxss

@@ -157,3 +157,8 @@ image.advice{
   min-height: 56rpx;
   display: block;
 }
+
+.adContainer {
+  width: 100%;
+  height:400rpx;
+}

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

@@ -15,7 +15,7 @@
   <view class="banner">
     <image src='/banner/banner1.png'></image>
   </view>
-  <view class="context">
+  <view class="context" wx:if='{{!userInfo.flag}}' >
     <view class='context_view' bindtap="goPurse" hover-class='active'>
       <image class='my_purse' src='/images/my_purse.png'></image>
       <text>我的钱包</text>
@@ -139,6 +139,7 @@
     </view>
 
   </view>
+
   <view class="logout" hover-class="active" wx:if="{{isLogin}}" bindtap="logout">退出账号</view>
 </view>
 <!-- <view class='footer' bindtap='phoneCall'>

+ 1 - 1
project.config.json

@@ -37,7 +37,7 @@
     "minifyWXSS": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.21.0",
+  "libVersion": "2.22.1",
   "appid": "wx6e03e5ada030b1aa",
   "projectname": "%E5%85%85%E7%94%B5%E6%A1%A9",
   "isGameTourist": false,