XWookey 2 anos atrás
pai
commit
94ca9e9436

+ 3 - 0
app.json

@@ -44,6 +44,9 @@
       "desc": "你的位置信息将用于充电桩小程序位置效果展示"
     }
   },
+  "requiredPrivateInfos": [
+    "getLocation"
+  ],
   "networkTimeout": {
     "request": 300000,
     "connectSocket": 300000

+ 4 - 0
pages/chargemoney/chargemoney.wxml

@@ -46,5 +46,9 @@
   
 </view>
 
+<view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
+
 <button class='{{chargemoney_select>0?"chargemoney_button":"chargemoney_button_disable"}}' bindtap="{{chargemoney_select>0?'beginChargemoney':''}}">立即充值</button>
 <view class="foot"><text>点击立即充值即表示同意</text><text class='blue'>充值协议</text></view>

+ 1 - 1
pages/charging/charging.wxss

@@ -207,7 +207,7 @@ text.left {
   font-size: 24rpx;
   color: #434343;
   /* margin-top:60rpx; */
-  margin: 0 0 50rpx 0;
+ /*  margin: 0 0 50rpx 0; */
 }
 .context_view {
   width: 25%;

+ 4 - 0
pages/forget/forget.wxml

@@ -23,5 +23,9 @@
       下一步
     </button>
 
+    <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
+
   </view>
 </view>

+ 29 - 1
pages/index/index.js

@@ -9,6 +9,7 @@ let mapregionchange_makertap = false;
 
 Page({
   data: {
+    scanFlag:false,
     markers: [],
     latitude: 39.9088120620532,
     longitude: 116.39747668717192,
@@ -168,6 +169,8 @@ Page({
     }
   },
   onLoad(e) {
+    this.scanFlag = false;
+    wx.hideLoading();
     if (e.q) {
       //console.log(decodeURIComponent(e.q));
       //let charePileId = decodeURIComponent(e.q).replace("https://cdgl.pjnes.com/", "");
@@ -564,12 +567,23 @@ Page({
   },
   //打开扫一扫
   click_scan_control(e) {
+    if(this.scanFlag){
+      return;
+    }
+    this.scanFlag = true;
+    wx.showLoading({
+      title: '努力加载中...',
+    })
+
+  
     console.log("打开扫一扫");
     log.info('[首页]', '[打开扫一扫]');
     let that = this;
     if (!this.data.isLogin) {
       log.info('[首页]', '[未登陆跳转登录界面]');
       let url = `/pages/login/login`;
+      that.scanFlag = false;
+      wx.hideLoading();
       wx.navigateTo({
         url
       });
@@ -591,6 +605,8 @@ Page({
           } = data;
           log.info('[首页]', '[获取用户是否有未支付订单]', '[响应]', data);
           if (data && order && data.code == 200) {
+            that.scanFlag = false;
+            wx.hideLoading();
             log.info('[首页]', '[用户有未支付订单跳转订单支付界面]');
             wx.showModal({
               showCancel: false,
@@ -639,6 +655,8 @@ Page({
                     console.log(scanResult);
                     log.info('[首页]', '[获取扫一扫充电桩]', '[响应]', res.data);
                     if (!res.data || res.data.code == 500) {
+                      that.scanFlag = false;
+                      wx.hideLoading();
                       //没有该充电桩信息
                       wx.showModal({
                         showCancel: false,
@@ -665,26 +683,36 @@ Page({
                         });
                         log.info('[首页]', '[扫一扫充电桩空闲跳转去充电界面]');
                         let url = `/pages/scan_result/scan_result`;
+                        that.scanFlag = false;
+                        wx.hideLoading();
                         wx.navigateTo({
                           url
                         });
                       }
+                      that.scanFlag = false;
+                      wx.hideLoading();
                     }
                   },
                   fail(e) {
                     getApp().showNetworkError();
                   }
                 });
+              },
+              fail(e){
+                that.scanFlag = false;
+                wx.hideLoading();
               }
             });
           }
         },
         fail(e) {
+          that.scanFlag = false;
+          wx.hideLoading();
           getApp().showNetworkError();
         }
       });
     }
-
+    
   },
   //地图位移
   mapchange(e) {

+ 3 - 3
pages/index/index.wxml

@@ -41,10 +41,10 @@
         </view>
       </view>
       <view class='chargprice'>
-        <text class='inline yellow'>{{textData.chargprice}}</text>
-        <text decode="true" class='inline price'>&nbsp;元/度</text>
+        <text class='inline yellow'>{{textData.chargprice == null? '暂无电费' : textData.chargprice}}</text>
+        <text decode="true" class='inline price'>&nbsp;{{textData.chargprice == null? '' : '元/度'}}</text>
       </view>
-      <text class='inline border'>服务费:{{textData.serviceprice}}元/度</text>
+      <text class='inline border'>服务费:{{textData.serviceprice == null? '暂无服务费' : textData.serviceprice + ' 元/度'}}</text>
       <!-- <text class='inline border'>停车费:{{textData.stopprice}}元/小时</text> -->
     </view>
     <view class='navigation_info'>

+ 3 - 1
pages/login/login.wxml

@@ -20,6 +20,8 @@
     <text class='register_view'  bindtap='goToRegister'>注册账户</text>
     <text class='forget_view'  bindtap='goToForget'>忘记密码?</text>
     </view>
-    
+    <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
   </view>
 </view>

+ 3 - 2
pages/order/order.js

@@ -228,8 +228,9 @@ Page({
               //showCancel: false,
               //content: '获取订单成功'
               //});
-              var startDate = new Date(order.chargstarttime);
-              var endDate = new Date(order.chargendtime);
+              
+              var startDate = Util.parseDate(order.chargstarttime);
+              var endDate = Util.parseDate(order.chargendtime);
               var totalTime = Math.floor((endDate.getTime() - startDate.getTime()) / 60000);
               var totalTimeHour = Math.floor(totalTime / 60);
               var totalTimeMinute = totalTime % 60;

+ 7 - 0
pages/order/order.wxml

@@ -64,6 +64,13 @@
       <image src='/images/enter.png'></image>
     </view>
   </view>-->
+  
+  <view style="width: 100%;margin-top:50rpx">
+    <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+  </view>
+
 </view>
+
+    
 <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>

+ 4 - 0
pages/outmoney/outmoney.wxml

@@ -10,4 +10,8 @@
       <text>{{remarkArrayIndex==null?'请选择':remarkArray[remarkArrayIndex].text}}</text>
   </picker>
 </view>
+
+<view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
 <button class='{{checkPass?"outmoney_button":"outmoney_button_disable"}}' bindtap="{{checkPass?'beginOutMoney':''}}" >立即提现</button>

+ 3 - 1
pages/register/register.wxml

@@ -41,6 +41,8 @@
     <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'getUserProfile':''}}">
       注册
     </button>
-
+    <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
   </view>
 </view>

+ 5 - 0
pages/reset_password/reset_password.wxml

@@ -17,6 +17,11 @@
       </view>
     </view>
     <view class="errorMsg"><text>{{errorMsg}}</text></view>
+
+    <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
+    
     <button class='{{checkPass?"login_button":"login_button_disable"}}' bindtap="{{checkPass?'resetPassword':''}}">
       确认
     </button>

+ 3 - 0
pages/scan_result/scan_result.wxml

@@ -71,3 +71,6 @@
   </view>
   <button wx:if="{{chargPile}}" class='charg_button' bindtap="beginCharge" >开始充电</button>
 
+  <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>

+ 2 - 2
pages/search_result/search_result.wxml

@@ -54,9 +54,9 @@
     <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 wx:if="{{!userInfo.flag}}">实时参考电费:{{item.chargprice ==null ? '暂无电费' : 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>
+    <text decode='true' wx:if="{{!userInfo.flag}}">实时参考服务费:{{item.serviceprice ==null ? '暂无服务费' : item.serviceprice + ' 元/度'}}</text>
     <view id="{{item.id}}" class='navigation' bindtap="getRoute">
       <image src='/images/navigation.png'></image>
     </view>

+ 5 - 0
pages/ucenter/center/center.wxml

@@ -50,6 +50,11 @@
         <input placeholder='请输入邮箱' maxlength='48' bindinput='inputEmail' type='text' placeholder-class='placeholder' value='{{email}}'></input>
       </view>
     </view>
+
+    <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
+    
     <view class="errorMsg">
       <text>{{errorMsg}}</text>
     </view>

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

@@ -43,8 +43,8 @@ Page({
   formatCharginglogs(charginglogs) {
     charginglogs.forEach((item, index) => {
       try {
-        var startDate = new Date(item.chargstarttime);
-        var endDate = new Date(item.chargendtime);
+        var startDate = Util.parseDate(item.chargstarttime);
+        var endDate = Util.parseDate(item.chargendtime)
         var totalTime = Math.round((endDate.getTime() - startDate.getTime()) / 60000);
         var totalTimeHour = Math.floor(totalTime / 60);
         var totalTimeMinute = totalTime % 60;

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

@@ -13,6 +13,9 @@
 
   </view>
 
+  <view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
   <!-- <view class='title1'>
     <text class='blod'>常见问题</text>
   </view> -->

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

@@ -156,9 +156,4 @@ image.advice{
   line-height: 56rpx;
   min-height: 56rpx;
   display: block;
-}
-
-.adContainer {
-  width: 100%;
-  height:400rpx;
 }

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

@@ -12,9 +12,12 @@
       <image src='/images/enter.png'></image>
     </view>
   </view>
-  <view class="banner">
+  <!-- <view class="banner">
     <image src='/banner/banner1.png'></image>
-  </view>
+  </view> -->
+  <view style="width: 100%;">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>
   <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>

+ 4 - 1
pages/ucenter/purse/purse.wxml

@@ -17,4 +17,7 @@
     <image src='/images/out_a.png'></image>
     <text>提现</text>
   </view>
-</view>
+</view>
+<view style="width: 100%;margin-top:50rpx">
+        <ad unit-id="adunit-8eb13875bcf592b0" ad-intervals="30"></ad>
+    </view>

+ 2 - 2
project.config.json

@@ -20,7 +20,7 @@
     "compileHotReLoad": false,
     "useMultiFrameRuntime": true,
     "useApiHook": true,
-    "useApiHostProcess": true,
+    "useApiHostProcess": false,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
@@ -37,7 +37,7 @@
     "minifyWXSS": true
   },
   "compileType": "miniprogram",
-  "libVersion": "2.22.1",
+  "libVersion": "2.25.1",
   "appid": "wx6e03e5ada030b1aa",
   "projectname": "%E5%85%85%E7%94%B5%E6%A1%A9",
   "isGameTourist": false,

+ 1 - 0
utils/amap.js

@@ -1,6 +1,7 @@
 let amapFile = require("./amap-wx");
 // 高德开发者key
 let key = '2ff0325d74a2d6edbdaf5338cc4eb37f';
+key = 'b341f312e851b5410ca79a84c25f4e19';
 let myAmapFun = new amapFile.AMapWX({
   key
 });

+ 6 - 0
utils/util.js

@@ -2,6 +2,12 @@
  * 工具类
  */
 class Util {
+
+  static parseDate(date){
+    var time = date==null?"": Date.parse(date.replace(/-/g, '/'));
+    return new Date(time);
+  }
+
   static formatTime(date) {
     let year = date.getFullYear();
     let month = date.getMonth() + 1;