Browse Source

占位费提醒优化

jiuling 3 tuần trước cách đây
mục cha
commit
4d1c331b0f

+ 10 - 2
components/parking-order/parking-order.js

@@ -38,7 +38,9 @@ Component({
   pageLifetimes:{
     // 组件所在页面的生命周期函数
     show: function () {
-      if (this.data.pollingInterval) {
+      let isLogin = wx.getStorageSync('isLogin');
+      if (isLogin) {
+        if (this.data.pollingInterval) {
           this.stopPolling();
       }
   
@@ -60,6 +62,7 @@ Component({
   
       // 设置定时器
       this.data.pollingInterval = setInterval(executePolling, 30000);
+    }
   },
      hide: function() {
       // 页面被隐藏
@@ -73,7 +76,8 @@ Component({
     showPopup: false,
     occupyFeeOrderList:[],
     pollingInterval: null, // 定时器,
-    costCycleFee:0
+    costCycleFee:0,
+    template:{}
   },
 
   /**
@@ -95,6 +99,10 @@ Component({
       method: 'POST',
       success(res) {
           that.calculate(occupyFeeOrder, res.data);
+          that.setData({
+            template:res.data
+          })
+          console.log("that.data",that.data.template);
       }
   });
 },

+ 15 - 1
components/parking-order/parking-order.wxml

@@ -28,10 +28,24 @@
       </view>
     </view>
     <!-- 费用信息 -->
-    <view class="info-row fee-info">
+    <view class="info-row fee-info" style="margin-bottom: 18rpx;">
       <text class="label occupyTest">已产生占位费:</text>
       <text class="value occupyTest">{{item.occupyFee || 0}}元</text>
     </view>
+   <!-- 费用信息 -->
+   <view>
+   <view style="font-weight: 600;font-size: 24rpx;padding: 0 10rpx;">费用说明</view>
+      <view class="info-rows" style="padding: 0 10rpx;">
+        <text class="value occupyTest" style="margin: none;white-space: normal;">收费规则:{{template.costCycleFee || 0}}元/{{template.costCycle|| 0}}分钟,{{template.freeTime || 0}}分钟内免费</text>
+        <text class="value occupyTest" style="white-space: normal;"  wx:if='{{template.maxFee > 0}}'>,单次封顶{{template.maxFee}}元/次
+        </text>
+      </view>
+    </view>
+    <!-- 时间信息 -->
+    <view class="info-row">
+      <text class="value occupyTest">收费时段:</text>
+      <view class="value occupyTest" style="font-size: 24rpx;">{{template.costTimePeriod || '无'}}</view>
+    </view>
     <!-- 警告文字 -->
     <view class="warning-text">
       为避免给您带来更多的经济损失,请充电结束后及时挪车!

+ 11 - 7
components/parking-order/parking-order.wxss

@@ -155,9 +155,9 @@
   white-space: nowrap;
   overflow: hidden;
 }
-text .occupyTest {
-  margin: 0 0 20rpx 0;
-  display: block;
+.info-rows .occupyTest {
+  /* margin: 0 0 20rpx 0;
+  display: block; */
   font-size: 24rpx;
   font-family: 'Lucida Sans',
                  'Lucida Sans Regular',
@@ -166,10 +166,10 @@ text .occupyTest {
                  Geneva,
                  Verdana,
                  sans-serif;
-  color: #545253;
-  text-overflow: ellipsis;
+  color: #AAAAAA;
+  /* text-overflow: ellipsis;
   white-space: nowrap;
-  overflow: hidden; 
+  overflow: hidden;  */
   line-height: 24rpx;
   height: 24rpx;
   min-height: 24rpx;
@@ -202,4 +202,8 @@ text.inline{
   min-height: 42rpx;
   color: #9d9d9d;
   margin: 0;
-}
+}
+.fee-infos {
+  /* margin-bottom: 12rpx; */
+  /* padding: 0 10rpx; */
+ }

+ 42 - 40
pages/charginfo/charginfo.js

@@ -501,6 +501,46 @@ Page({
   async goScanResult(e){
     // scan_result
     
+  console.info('xxxxxxxxxxxxxx')
+    let {
+      keywords
+    } = e.currentTarget.dataset;
+    let userInfo = wx.getStorageSync('userInfo');
+    let isLogin = wx.getStorageSync('isLogin');
+    let chargid = keywords.chargPileId;
+    let that = this;
+
+    if(isLogin && userInfo.bindingPhone==0){
+      console.info('xxxxxxxxxxxxxx1')
+      wx.showModal({
+        title: '提示',
+        content: '当前账户未绑定手机号,请您进行手机号绑定操作',
+        showCancel:false,
+        confirmText: '去绑定',
+        confirmColor:'#00AADD',
+        success: function (res1) {
+            let url = `/pages/bindPhone/bindPhone`;
+            wx.navigateTo({
+              url
+            });
+        }
+      });
+      return;
+    }
+    wx.showLoading({
+      title: '努力加载中...',
+    })
+
+    if (!isLogin) {
+      console.info('xxxxxxxxxxxxxx2')
+      log.info('[首页]', '[未登陆跳转登录界面]');
+      let url = `/pages/login/phone_login/phone_login`;
+      wx.hideLoading();
+      wx.navigateTo({
+        url
+      });
+      // return;
+    } else {
     let api = getApp().globalData.postHeadAgreement
     let path = 'restapi/wechat/queryOccupyFeeOrder'
     let params = {
@@ -518,6 +558,7 @@ Page({
   try{
     const resultOrder = await wechat.request(api, path, paramsNew);
       if (resultOrder.data.code == 200) {
+        wx.hideLoading();
           if (resultOrder.data.result.total > 0) {
             wx.showModal({
               showCancel: false,
@@ -539,6 +580,7 @@ Page({
     }
     const result = await wechat.request(api, path, params);
     if (result.data.code == 200) {
+      wx.hideLoading();
       if (result.data.result.total > 0) { // 有占位费订单不启动扫码充电
         this.setData({
           showPopup:true
@@ -559,46 +601,6 @@ Page({
       }
     });
   }
-  console.info('xxxxxxxxxxxxxx')
-    let {
-      keywords
-    } = e.currentTarget.dataset;
-    let userInfo = wx.getStorageSync('userInfo');
-    let isLogin = wx.getStorageSync('isLogin');
-    let chargid = keywords.chargPileId;
-    let that = this;
-
-    if(isLogin && userInfo.bindingPhone==0){
-      console.info('xxxxxxxxxxxxxx1')
-      wx.showModal({
-        title: '提示',
-        content: '当前账户未绑定手机号,请您进行手机号绑定操作',
-        showCancel:false,
-        confirmText: '去绑定',
-        confirmColor:'#00AADD',
-        success: function (res1) {
-            let url = `/pages/bindPhone/bindPhone`;
-            wx.navigateTo({
-              url
-            });
-        }
-      });
-      return;
-    }
-    wx.showLoading({
-      title: '努力加载中...',
-    })
-
-    if (!isLogin) {
-      console.info('xxxxxxxxxxxxxx2')
-      log.info('[首页]', '[未登陆跳转登录界面]');
-      let url = `/pages/login/phone_login/phone_login`;
-      wx.hideLoading();
-      wx.navigateTo({
-        url
-      });
-      // return;
-    } else {
       log.info('[首页]', '[获取用户是否有未支付订单]', '[请求]', { userId: userInfo.userId });
       wx.request({
         url: getApp().globalData.postHeadAgreement + '/restapi/pileLog/wechatsettlement',

+ 2 - 2
pages/ucenter/zhanw/zhanw.wxml

@@ -26,11 +26,11 @@
       <view  class="inline-view">
         <view class='inlineView' decode='true'>
         <text space="nbsp">占位开始时间: </text>
-        <text class="gray2"> {{item.occupyBeginTime}}</text>
+        <text class="gray2"> {{item.occupyBeginTime || '-'}}</text>
         </view>
       </view>
       <view  class="inline-view">
-        <view class='inlineView' decode='true'><text space="nbsp">占位结束时间: </text>  <text class="gray2">{{item.occupyEndTime}}</text></view>
+        <view class='inlineView' decode='true'><text space="nbsp">占位结束时间: </text>  <text class="gray2">{{item.occupyEndTime || '-'}}</text></view>
       </view>
       <view style='line-height:0;' >
         <text class='inline gray1'>占位时长:</text>