xvying 3 years ago
parent
commit
609fec1a78

+ 1 - 0
.tea/entryFiles-development/index$.web.js

@@ -5,6 +5,7 @@ require('./config$');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/recharge-active/recharge-active?hash=55a54d58d54db023cdd93414867929a95382a8fa');
 require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/use_bike/use_bike?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');

+ 1 - 0
.tea/entryFiles-development/index$.worker.js

@@ -39,6 +39,7 @@ require('../../app');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/recharge-active/recharge-active?hash=55a54d58d54db023cdd93414867929a95382a8fa');
 require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/use_bike/use_bike?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');

+ 1 - 0
.tea/entryFiles-production/index$.web.js

@@ -4,6 +4,7 @@ require('./config$');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/recharge-active/recharge-active?hash=55a54d58d54db023cdd93414867929a95382a8fa');
 require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/use_bike/use_bike?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');

File diff suppressed because it is too large
+ 0 - 0
.tea/entryFiles-production/index$.worker.js


+ 2 - 1
app.json

@@ -2,6 +2,7 @@
   "pages": [
     "pages/index/index",
     "pages/test/test",
+    "pages/recharge-active/recharge-active",
     "pages/pay/pay",
     "pages/inputcode/inputcode",
     "pages/use_bike/use_bike",
@@ -41,7 +42,7 @@
     "navigationBarBackgroundColor": "#fff",
     "defaultTitle": "禹见你",
     "navigationBarTextStyle": "black",
-    "allowsBounceVertical":"YES"
+    "allowsBounceVertical": "YES"
   },
   "style": "v2",
   "sitemapLocation": "sitemap.json",

BIN
img/active-rules.png


BIN
img/recharge-icon2.png


BIN
img/recharge-top.png


+ 1 - 1
pages/balance/balance.axml

@@ -14,7 +14,7 @@
       </view>
     </view>
     <view class="money-list">
-      <view  class="{{currentNow==index ? 'active' : 'money-item'}}"  a:for="{{moneyList}}" a:key="{{index}}"  a:key='key' onTap="changeMoney" data-idx="{{index}}">
+      <view  class="{{currentNow==index ? 'active' : 'money-item'}}"  a:for="{{moneyList}}" a:key="{{index}}" onTap="changeMoney" data-idx="{{index}}">
         <text>{{index==Index?'充':''}}{{item.recharge_money}}元</text>
         <text a:if="{{item.give_money!=0}}">送{{item.give_money}}元</text>
         </view>

+ 27 - 28
pages/index/index.axml

@@ -1,16 +1,17 @@
 <view class="index">
   <!-- 开锁失败弹框 -->
   <view class="open-err" a:if="{{scanCodeErr==true}}">
-    <view class="err-content" >
-
+    <view class="err-content">
+      
       <image src="../../img/fail.png" class="err-image"></image>
       <view class="err-text">无效码,请核对车码</view>
       <view class="err-button">
-        <view class="err-left"  onTap="goInputCode">去输码</view>
+        <view class="err-left" onTap="goInputCode">去输码</view>
         <view class="err-right" onTap="saoMa">继续扫码</view>
       </view>
     </view>
-    <view class="err-cha" onTap="cancelErrFrame"><text class="iconfont icon-cha"></text></view>
+    <view class="err-cha" onTap="cancelErrFrame">
+      <text class="iconfont icon-cha"></text></view>
   </view>
   <!-- 屏幕中间广告弹框 -->
   <view class="ad-frame" a:if="{{adFrame==true}}">
@@ -21,7 +22,8 @@
         </swiper-item>
       </swiper>
     </view>
-    <view class="ad-frame-close" onTap="closeAdframe"><text class="iconfont icon-cha"></text></view>
+    <view class="ad-frame-close" onTap="closeAdframe">
+      <text class="iconfont icon-cha"></text></view>
   </view>
   <!-- 有未支付订单,进行中的订单 违章记录 -->
   <view class="no-pay-order" a:if="{{is_pay_order!==false}}" onTap="go_pay">
@@ -29,14 +31,12 @@
     <text>您有未支付订单</text>
     <text class="iconfont icon-iconfontjiantou2"></text>
   </view>
-  <view class="no-pay-order" a:if="{{is_ride_order!==false}}" style="background-color:var(--globleColor)"
-    onTap="goUseBike">
+  <view class="no-pay-order" a:if="{{is_ride_order!==false}}" style="background-color:var(--globleColor)" onTap="goUseBike">
     <text class="iconfont icon-wenhao"></text>
     <text>您有一个正在骑行的订单</text>
     <text class="iconfont icon-iconfontjiantou2"></text>
   </view>
-  <view class="no-pay-order" a:if="{{is_punishment!==false}}" style="background-color:#f56464"
-    onTap="havePunishment">
+  <view class="no-pay-order" a:if="{{is_punishment!==false}}" style="background-color:#f56464" onTap="havePunishment">
     <text class="iconfont icon-wenhao"></text>
     <text>您有一条违章记录</text>
     <text class="iconfont icon-iconfontjiantou2"></text>
@@ -57,43 +57,40 @@
       </view>
     </view>
   </view>
-
+  
   <!-- 轮播图 -->
   <view class="ad-swiper" a:if="{{ads!=[]}}">
-    <swiper class="ad-swiper-list" indicator-dots='true' indicator-color='var(--globleColor)' autoplay='true'
-      interval="5000" current="{{currentSwiper}}" bindchange="swiperChange">
+    <swiper class="ad-swiper-list" indicator-dots='true' indicator-color='var(--globleColor)' autoplay='true' interval="5000" 
+      current="{{currentSwiper}}" onTap="swiperChange">
       <swiper-item a:for="{{ads}}" a:key="key" class="ad-swiper-item">
-        <image src="{{item.surface}}" style="width:100%;height:100%;" onTap="swiper" data-index="{{index}}"
-          data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}"
-          a:if="{{item.type!='wxTencentAdvertisement'}}"></image>
+        <image mode="widthFix" src="{{item.surface}}" style="width:100%;height:100%;" onTap="swiper" data-index="{{index}}" data-type="{{item.type}}" 
+          data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}" a:if="{{item.type!='wxTencentAdvertisement'}}"></image>
       </swiper-item>
     </swiper>
   </view>
   <!-- 通知公告 -->
-  <view class="inform" style="top:{{ads.length>0? '250rpx' : '30rpx'}}" bindtap="tap_notice" a:if="{{notice.id}}"
-    data-id="{{notice.id}}">
+  <!-- a:if="{{notice.id}}"  -->
+  <view class="inform" style="top:{{ads.length>0? '250rpx' : '30rpx'}}" onTap="tap_notice" a:if="{{notice.id}}" data-id="{{notice.id}}">
     <view class="inform-img">
       <image src="../../img/notice.png" class="inform-image" style="width:48rpx;height:48rpx;padding-left:20rpx;">
       </image>
     </view>
     <view class='marquee' style='width:{{marqueeWidth}}rpx;'>
-      <view class='marqueeTitle'
-        style="width:{{length}}rpx;transform:translateX( {{marqueeDistance}}rpx);font-size: {{size}}rpx;">
-        {{notice.description}}</view>
+      <view class='marqueeTitle' style="width:{{length}}rpx;transform:translateX( {{marqueeDistance}}rpx);font-size: {{size}}rpx;">
+        {{notice.description}}
+      </view>
     </view>
     <image src="../../img/more.png" style="width:48rpx;height:48rpx;"></image>
   </view>
   <!-- 地图 -->
-  <map name="map" id="map" show-location="true" longitude='{{longitude}}' latitude='{{latitude}}' scale='{{zoom}}'
-    markers="{{markers}}" data-markers="{{markers}}" controls="{{controls}}" polygon="{{polygons}}">
+  <map name="map" id="map" show-location="true" longitude='{{longitude}}' latitude='{{latitude}}' scale='{{zoom}}' markers="{{markers}}" 
+    data-markers="{{markers}}" controls="{{controls}}" polygon="{{polygons}}">
   </map>
   <view class="map-icon">
     <view class="kefu" onTap="findPark">
       <image src="../../img/park.png"></image>
     </view>
-    <!-- <view class="kefu" onTap="kefu">
-      <image src="../../img/kefu.png"></image>
-    </view> -->
+    <!--<view class="kefu" onTap="kefu"><image src="../../img/kefu.png"></image></view> -->
     <view class="kefu" onTap="posi">
       <image src="../../img/position.png"></image>
     </view>
@@ -101,16 +98,18 @@
   <!-- 底部按钮 -->
   <view class="bottom-bt" catchtouchmove='ture'>
     <view class="tab">
-       <view class="tab-item" onTap="kefu">
+      <view class="tab-item" onTap="kefu">
         <text class="iconfont icon-kefu"></text>
         <view>在线客服</view>
       </view>
-      <view class="tab-item" a:for="{{cardBottom}}" a:key='key' onTap="skipPage" data-id="{{item}}" >
+      <view class="tab-item" a:for="{{cardBottom}}" a:key='key' onTap="skipPage" data-id="{{item}}">
         <text class="iconfont {{item.icon}}"></text>
         <view>{{item.name}}</view>
       </view>
     </view>
-    <view class="scan" onTap="sweepCode"><text class="iconfont scanicon icon-17-saoma"></text><text>扫码用车</text>
+    <view class="scan" onTap="sweepCode">
+      <text class="iconfont scanicon icon-17-saoma"></text>
+      <text>扫码用车</text>
     </view>
   </view>
 </view>

+ 71 - 41
pages/index/index.js

@@ -864,56 +864,86 @@ Page({
 
     var userStatus = that.data.userStatus;
     var setting = my.getStorageSync({ 'key': 'setting' }).data
-
-    console.log(!setting, '运营区检测')
-    if (!that.data.latitude && !that.data.longitude) {
+    if (data.id == 2 && !that.data.latitude && !that.data.longitude) {
       that.setData({
         background: true,
         location: true
       })
-    } else {
-      if (data.id == 2) {
-        console.log(that.data.userStatus, '')
-        if (!setting) {
-          my.alert({
-            title: '提示',
-            content: '您附近暂无运营区,暂不可用车'
-          })
-        }
-        else {
-          if (!userStatus) {
-            my.navigateTo({
-              url: '/pages/authorization/authorization',
-            })
-          }
-          else {
-            that.jiance1();
-          }
-        }
-      } else if (data.id == 4) {
-        if (userStatus.is_bind_mobile == 0) {
-          my.navigateTo({
-            url: '/pages/authorization/authorization',
-          })
-        } else {
-          my.navigateTo({
-            url: data.url,
-          })
-        }
+      return
+    }
+    if (data.id == 2 && !setting) {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区,暂不可用车'
+      })
+
+      return
+    }
+    if (data.id == 2 && setting) {
+      if (!userStatus) {
+        my.navigateTo({
+          url: '/pages/authorization/authorization',
+        })
       }
       else {
-        if (!userStatus) {
-          my.navigateTo({
-            url: '/pages/authorization/authorization',
-          })
-        } else {
-          my.navigateTo({
-            url: data.url,
-          })
-        }
+        that.jiance1();
       }
+    } else {
+      my.navigateTo({
+        url: data.url,
+      })
     }
 
+
+
+    // if (!that.data.latitude && !that.data.longitude) {
+    //   that.setData({
+    //     background: true,
+    //     location: true
+    //   })
+    // } else {
+    //   if (data.id == 2) {
+    //     console.log(that.data.userStatus, '')
+    //     if (!setting) {
+    //       my.alert({
+    //         title: '提示',
+    //         content: '您附近暂无运营区,暂不可用车'
+    //       })
+    //     }
+    //     else {
+    //       if (!userStatus) {
+    //         my.navigateTo({
+    //           url: '/pages/authorization/authorization',
+    //         })
+    //       }
+    //       else {
+    //         that.jiance1();
+    //       }
+    //     }
+    //   } else if (data.id == 4) {
+    //     if (userStatus.is_bind_mobile == 0) {
+    //       my.navigateTo({
+    //         url: '/pages/authorization/authorization',
+    //       })
+    //     } else {
+    //       my.navigateTo({
+    //         url: data.url,
+    //       })
+    //     }
+    //   }
+    //   else {
+    //     if (!userStatus) {
+    //       my.navigateTo({
+    //         url: '/pages/authorization/authorization',
+    //       })
+    //     } else {
+    //       my.navigateTo({
+    //         url: data.url,
+    //       })
+    //     }
+    //   }
+    // }
+
   },
   //输码开锁检测
   jiance1: function (source) {

+ 14 - 15
pages/mine/mine.axml

@@ -2,15 +2,18 @@
   <view class="mine-top" onTap="mineData">
     <view class="avator">
       <image src="{{userInfo.user.avatar}}" class="avator-image" mode="widthFix"></image>
-      <!-- <open-data type="userAvatarUrl" class="avator-image"></open-data> -->
+      <!--<open-data type="userAvatarUrl" class="avator-image"></open-data> -->
     </view>
     <view class="mine-phone">
-    <text>{{userInfo.mobile}}</text></view>
+      <text>{{userInfo.mobile}}</text></view>
     <view class="iconfont icon-iconfontjiantou2"></view>
   </view>
   <view class="mine-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==2}}">
     {{deposit.deposit_expire_time}}
   </view>
+  <view class="mine-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==6}}">
+    您已获得终身免押资格!
+  </view>
   <view class="mine-tab">
     <view class="mine-tab-item" onTap="balance">
       <view class="tab-num">¥{{userInfo.wallet_money | parseFloat}}</view>
@@ -24,8 +27,9 @@
       <view class="tab-num">{{userInfo.user.deposit_type==2 ? 1 : 0}}</view>
       <view class="tab-text">我的卡</view>
     </view>
-    <view class="mine-tab-item" onTap="rideZige" >
-      <view class="tab-num"><text class="zige">{{deposit.is_deposit==0 && setting.is_deposit != 0 && deposit.is_coupon_deposit_free == false ? '去获取':'已获得'}}</text></view>
+    <view class="mine-tab-item" onTap="rideZige">
+      <view class="tab-num">
+        <text class="zige">{{deposit.is_deposit==0 && setting.is_deposit != 0 && deposit.is_coupon_deposit_free == false ? '去获取':'已获得'}}</text></view>
       <view class="tab-text">骑行资格</view>
     </view>
   </view>
@@ -37,33 +41,28 @@
     <view class="card-right" onTap="buyCard">购买</view>
   </view>
   <view class="mine-list">
-    <!-- <view class="list-item">
-      <text class="zhifufen">开通微信支付分,享免充值用车</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
-      <text class="right-text">去开通</text>
-
-    </view> -->
-    <view class="list-item" a:if="{{userInfo.user.is_deposit == 1 &&  userInfo.user.deposit_type==1}}" onTap="backDeposit"> 
+    <!--<view class="list-item"><text class="zhifufen">开通微信支付分,享免充值用车</text><text class="iconfont icon-iconfontjiantou2 right-arrow"></text><text class="right-text">去开通</text></view> -->
+    <view class="list-item" a:if="{{userInfo.user.is_deposit == 1 &&  userInfo.user.deposit_money==1}}" onTap="backDeposit">
       <text class="iconfont icon-tongqian list-icon"></text>
       <text>退还押金</text>
       <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
     </view>
-    <view class="list-item" onTap="trip"> 
+    <view class="list-item" onTap="trip">
       <text class="iconfont icon-weizhi list-icon"></text>
       <text>行程</text>
       <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
     </view>
     <view class="list-item" onTap="accountDetails">
-      <text  class="iconfont icon-tongqian list-icon"></text>
+      <text class="iconfont icon-tongqian list-icon"></text>
       <text>账户明细</text>
       <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
     </view>
     <view class="list-item" onTap="weizhang">
-      <text  class="iconfont icon-shejiwenzhang list-icon"></text>
+      <text class="iconfont icon-shejiwenzhang list-icon"></text>
       <text>违约用车记录</text>
       <text class="iconfont icon-iconfontjiantou2 right-arrow"></text></view>
     <view class="list-item" onTap="setUp">
-      <text  class="iconfont icon-shezhi list-icon"></text>
+      <text class="iconfont icon-shezhi list-icon"></text>
       <text>设置</text>
       <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
     </view>

+ 156 - 0
pages/recharge-active/recharge-active.acss

@@ -0,0 +1,156 @@
+/* pages/balance/balance.wxss */
+page {
+  /* height: 100vh; */
+
+}
+
+.balance {
+  background-repeat: no-repeat;
+  background-position: top center;
+  background-size: 100% 100%;
+  height: 100%;
+  background-color: #f6f2f3;
+  text-align: center;
+  padding-bottom: 150rpx;
+}
+
+.icon1 {
+  height: 150rpx;
+  margin-top: 50rpx;
+  width: 60%;
+}
+
+.icon2 {
+  width: 90%;
+  margin-top: -110rpx;
+  /* height: 100rpx; */
+}
+
+.content {
+  width: 85%;
+  margin: 0 auto;
+  min-height: 600rpx;
+  margin-top: -250rpx;
+  border: solid 6rpx #ffc97e;
+  background-color: #feebd6;
+  border-radius: 12rpx;
+  padding-bottom: 30rpx;
+  color: #590204;
+  padding-top: 180rpx;
+
+}
+
+.card-list {
+  display: flex;
+  background-color: #f6f2f3;
+  width:85%;
+  margin: 0 auto;
+  padding: 20rpx;
+  background-color: #d92424;
+  border: solid 4rpx #ffc97e;
+  border-radius: 12rpx;
+  margin-bottom: 30rpx;
+}
+
+.left {
+  padding-right: 30rpx;
+  padding-left: 10rpx;
+  line-height: 50rpx;
+  font-size: 35rpx;
+  font-weight: 550;
+  color: #fff;
+  border-right: dashed 2px #ffc97e;
+}
+
+.right {
+
+  flex: 1;
+  color: #fff;
+  font-size: 30rpx;
+  text-align: center;
+  line-height: 45rpx;
+  padding: 0 20rpx;
+}
+
+.font {
+  font-size: 36rpx;
+  display: inline-block;
+  margin: 0 5rpx;
+}
+
+.money {
+  font-size: 36rpx;
+  color: #fff;
+  margin-bottom: 15rpx;
+}
+
+.left text {
+  display: block;
+
+}
+
+.time {
+  font-size: 28rpx;
+}
+
+.icon3 {
+  width: 50%;
+  height: 100rpx;
+}
+
+.icon4 {
+  width: 50%;
+  height: 100rpx;
+  margin-top: 20rpx;
+}
+
+.rules {
+  padding: 30rpx;
+  text-align: left;
+  line-height: 38rpx;
+  font-size: 26rpx;
+  text-align: justify;
+}
+.rules-child{
+  display: flex;
+}
+.rules view {
+  margin-top: 10rpx;
+}
+
+.red {
+  color: red;
+}
+
+.content-1 {
+  border: solid 6rpx #ffc97e;
+  background-color: #feebd6;
+  border-radius: 12rpx;
+
+  width: 80%;
+  margin: 0 auto;
+  margin-top: 40rpx;
+}
+
+.button {
+  position: fixed;
+  bottom: 0;
+  height: 140rpx;
+  background-color: #feebd6;
+  width: 100%;
+  border-top: solid 2rpx #ffc97e;
+}
+
+.buy {
+  width: 80%;
+  margin: 0 auto;
+  /* border: solid 6rpx #ffc97e; */
+  /* margin-top: 50rpx; */
+  height: 90rpx;
+  line-height: 90rpx;
+  margin-top: 25rpx;
+  color: #fff;
+  background-color: #349995;
+  border-radius: 12rpx;
+  /* color: #ffc97e; */
+}

+ 39 - 0
pages/recharge-active/recharge-active.axml

@@ -0,0 +1,39 @@
+<view class="balance" style="background-image:url('https://resource.mtu.ximengnaikang.com/huodongbeijing.png')">
+  <image src="../../img/recharge-top.png" class="icon1" mode="widthFix"></image>
+  <image src="../../img/recharge-icon2.png" class="icon2" mode="aspectFit"></image>
+  <view class="content">
+    <view class="card">
+      <view class="card-list" a:for="{{moneyList}}" a:key="{{index}}" onTap="changeMoney" data-idx="{{index}}">
+        <view class="left">
+          <text>充</text>
+          <text>值</text>
+        </view>
+        <view class="right">
+          <view class="money">
+            <text>{{index==Index?'充':''}}</text>
+            <text class="font">{{item.recharge_money}}</text>元
+            <text a:if="{{item.give_money!=0}}">送
+              <text class="font">{{item.give_money}}</text>元</text>
+          </view>
+          <view>再送终身免押金卡</view>
+        </view>
+      </view>
+      
+    </view>
+    <image src="../../img/active-rules.png" class="icon3" mode="aspectFit"></image>
+    <view class="rules">
+      
+      <view>1.充值成功后,充值的余额即可到账,可在我的-钱包中查</view>
+      <view>2.
+        <text class="red">充值金额仅可用于支付骑行订单(除调度费),不可退款,不可转赠</text></view>
+      <view>3. 请仔细阅读活动规则,在进行操作。如有疑问,请联系客服0374-6666671</view>
+      <view>4. 活动解释权归平台所有</view>
+      <view>5. 活动时间:2021.1.1-2021.1.7</view>
+    </view>
+  </view>
+  <view class="button">
+    <view class="buy" onTap="pay">立即充值</view>
+  </view>
+  
+  
+</view>

+ 220 - 0
pages/recharge-active/recharge-active.js

@@ -0,0 +1,220 @@
+// pages/balance/balance.js
+const app = getApp();
+const util = require('../../utils/utils')
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+    isShow: false,
+    inpurShow: false,
+    money: '', //选择的金额
+    inputValue: null, //输入框内金额(10~1000)
+    currentNow: 0, //当前选择金额
+    moneyList: [], //可选择的金额列表
+    id: '',
+    Index: 0,
+    title: app.globalData.title,
+    balance: '',
+    index1: ''
+
+  },
+  frameShow: function () {
+    // this.setData({
+    //   isShow: true
+    // })
+  },
+  hideFrame: function () {
+    this.setData({
+      isShow: false
+    })
+  },
+  skipXieyi: function () {
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
+  //获取余额
+  getBalance: util.throttle(function (e) {
+    app.request("/me", '', "GET").then(res => {
+      200 == res.status && my.setStorageSync({ 'key': "userInfo", data: res.data }), this.setData({
+        balance: res.data.wallet_money
+      })
+    })
+  }, 1000),
+  //验证输入金额
+  ckInp(e) {
+    var self = this
+    this.setData({
+      money: e.detail.value,
+      id: 0
+    })
+  },
+  //选择充值金额
+  changeMoney: function (e) {
+    this.setData({
+      money: null
+    })
+    let idx = e.currentTarget.dataset.idx
+    if (idx == -1) {
+      this.setData({
+        currentNow: idx,
+
+        index1: idx
+      })
+    } else {
+      this.setData({
+        currentNow: idx,
+        money: this.data.moneyList[idx].recharge_money,
+        id: this.data.moneyList[idx].id,
+        Index: idx
+      })
+    }
+
+  },
+  //立即充值
+  pay: util.throttle(function (e) {
+    var reg = new RegExp("^([1-9]|[0-9]{0,3}|1000)$");
+    // var reg = new RegExp("^[1-9]\d{0,3}|10000$")
+    var self = this;
+    console.log(self.data.money)
+    console.log(self.data.inputValue)
+    if (self.data.money == '' && self.data.inputValue == null) {
+      my.showToast({
+        content: '请选择或者输入充值金额',
+        icon: 'none',
+        duration: 2000
+      })
+    } else if (!reg.test(self.data.money)) {
+      my.showToast({
+        content: '请输入1-1000的整数',
+        icon: 'none',
+        duration: 2000,
+      })
+      self.setData({
+        inputValue: null
+      })
+    } else {
+
+
+      if (app.globalData.req) {
+        console.log(self.data.id, 'area_id')
+        console.log(self.data.id, 'area_id')
+        let data = {}
+        if (my.getStorageSync({ 'key': 'home' }).data) {
+          data = {
+            money: self.data.inputValue || self.data.money,
+            area_id: my.getStorageSync({ 'key': 'home' }).data.id,
+            config_id: self.data.id
+          }
+        }else{
+          data = {
+          money: self.data.inputValue || self.data.money,
+          config_id: self.data.id
+        }
+        }
+
+        app.request('/rechange/pay', data, 'POST', app.globalData.req).then(res => {
+          if (res.status == 200) {
+            my.tradePay({
+              tradeNO: res.data.tradeNo,
+              success(resp) {
+                if (resp.resultCode == 9000) {
+                  my.navigateTo({
+                    url: '/pages/index/index',
+                  })
+                } else {
+                  return
+                }
+              },
+              fail: function () {
+                // my.showToast({
+                //   content: '支付失败',
+                //   icon: 'none'
+                // })
+              }
+            })
+          }
+        })
+      } else {
+        my.showToast({
+          content: '您的操作过于频繁,请稍后再试~',
+          icon: 'none'
+        })
+      }
+    }
+  }, 1000),
+
+
+  onLoad: function (options) {
+    this.getBalance()
+    var that = this;
+    var data = {
+      'area_id': my.getStorageSync({ 'key': 'home' }).data.id
+    }
+    my.showLoading({
+      content: '加载中...',
+      mask: true
+    })
+    app.request('/pages/recharge', data, 'Get').then(res => {
+      if (res.status == 200) {
+        console.log(res)
+        my.hideLoading({
+          complete: (res) => { },
+        })
+        if (res.data.data != '') {
+          that.setData({
+            moneyList: res.data.data,
+            money: res.data.data[0].recharge_money,
+            id: res.data.data[0].id
+          })
+        }
+      }
+    })
+  },
+
+  onReady: function () {
+
+  },
+
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 5 - 0
pages/recharge-active/recharge-active.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "foottip": "/components/foottip/foottip"  
+  }
+}

+ 14 - 10
pages/ride_zige/ride_zige.axml

@@ -1,26 +1,30 @@
 <view class="ride_zige">
   <view class="zige-frame" a:if="{{frame==true}}">
     <view class="frame-content">
-      <view class="frame-title"><text class="iconfont icon-guize"></text> 提示</view>
+      <view class="frame-title">
+        <text class="iconfont icon-guize"></text> 提示</view>
       <view class="frame-text"> 退回后您将无法使用车辆且账户将被冻结,至缴纳押金或购买免押金卡后再次使用</view>
       <view class="frame-buttom" onTap="sureBack">立即退还</view>
     </view>
-    <view class="frame-cha" onTap="closeFrame"><text class="iconfont icon-cha"></text></view>
+    <view class="frame-cha" onTap="closeFrame">
+      <text class="iconfont icon-cha"></text></view>
   </view>
   <view class="zige-tips">
     <view class="title">—— · 获取骑行资格 · ——</view>
     <view class="text">卡费不可退,不可抵用车费?</view>
   </view>
-
+  
   <view class="card-list" a:if="{{cardList.length}}">
     <view class="jingxuan">为你精选</view>
     <view class="mine-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==2}}">
-    {{deposit.deposit_expire_time}}
-  </view>
-    <view class="{{currentItem==item.id ? 'active' :'card-item'}}" a:for="{{cardList}}" a:key='{{index}}' data-id="{{item.id}}" onTap="changeCard" >
+      {{deposit.deposit_expire_time}}
+    </view>
+    <view class="{{currentItem==item.id ? 'active' :'card-item'}}" a:for="{{cardList}}" a:key='{{index}}' data-id="{{item.id}}" 
+      onTap="changeCard">
       <view class="item-left">
         <view class="card-title">
-         <text>{{item.name}}</text><text class="tip">特惠精选</text></view>
+          <text>{{item.name}}</text>
+          <text class="tip">特惠精选</text></view>
         <view class="card-text">有效期{{item.effective_days}}天</view>
       </view>
       <view class="item-right">
@@ -31,7 +35,7 @@
   </view>
   <view class="card-list">
     <view class="list-title">交押金用车</view>
-    <view class="card-item" class="{{ currentItem==0 ? 'active' :'card-item'}}"   onTap="changeCard" data-id='0' >
+    <view class="card-item" class="{{ currentItem==0 ? 'active' :'card-item'}}"   onTap="changeCard" data-id='0'>
       <view class="item-left">
         <view class="card-title">押金</view>
         <view class="card-text">随时可退 | 极速到账</view>
@@ -42,7 +46,7 @@
     </view>
   </view>
   <view class="button" onTap='pay' a:if="{{deposit.deposit_type!==1}}">立即支付</view>
-  <!-- <view class="button">缴纳押金</view>   -->
-  <view class="button" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==1}}" onTap="backDeposit">退还押金</view>
+  <!--<view class="button">缴纳押金</view>   -->
+  <view class="button" a:if="{{deposit.is_deposit==1 && deposit.deposit>0}}" onTap="backDeposit">退还押金</view>
   
 </view>

+ 88 - 88
pages/ride_zige/ride_zige.js

@@ -12,10 +12,10 @@ Page({
 
   },
   onLoad: function (options) {
-    let deposit = my.getStorageSync({ 'key': 'userState' }).data
+
     this.setData({
       deposit: my.getStorageSync({ 'key': 'userState' }).data,
-      depositMoney: deposit.deposit
+      depositMoney: my.getStorageSync({ 'key': 'setting' }).data.deposit
     })
 
     this.getCard()
@@ -54,7 +54,7 @@ Page({
   changeCard: function (e) {
     let that = this
     let id = e.currentTarget.dataset.id
-    console.log(e,'pppppp')
+    console.log(e, 'pppppp')
     that.setData({
       currentItem: id
     })
@@ -73,82 +73,82 @@ Page({
     var that = this;
     let url = '';
     var data = '';
-    
-      console.log(that.data.depShow)
-      if (that.data.currentItem == 0) { //缴纳押金
-        console.log(11111)
-        url = "/deposit/pay";
-        data = {
-          area_id: my.getStorageSync({ 'key': 'home' }).data.id
-        }
-      } else { //购买免押金卡
-        console.log(2222)
-        url = "/deposit_card/pay";
-        data = {
-          area_id: my.getStorageSync({ 'key': 'home' }).data.id,
-          id: that.data.currentItem
-        }
+
+    console.log(that.data.depShow)
+    if (that.data.currentItem == 0) { //缴纳押金
+      console.log(11111)
+      url = "/deposit/pay";
+      data = {
+        area_id: my.getStorageSync({ 'key': 'home' }).data.id
       }
-      if (my.getStorageSync({ 'key': 'setting' }).data == '') {
-        my.alert({
-          title: '提示',
-          content: '您附近暂无运营区域~',
-          success: function (res) {
-            my.navigateBack()
-          }
-        })
-      } else {
-        app.request(url, data, 'POST', app.globalData.req).then(res => {
+    } else { //购买免押金卡
+      console.log(2222)
+      url = "/deposit_card/pay";
+      data = {
+        area_id: my.getStorageSync({ 'key': 'home' }).data.id,
+        id: that.data.currentItem
+      }
+    }
+    if (my.getStorageSync({ 'key': 'setting' }).data == '') {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区域~',
+        success: function (res) {
+          my.navigateBack()
+        }
+      })
+    } else {
+      app.request(url, data, 'POST', app.globalData.req).then(res => {
+        console.log(res)
+        if (res.status == 200) {
           console.log(res)
-          if (res.status == 200) {
-            console.log(res)
-            my.tradePay({
-              tradeNO: res.data.tradeNo,
-              success(res) {
-                console.log(res)
-                if (res.resultCode == 9000) {
-                  let init = '';
-                  if (that.data.depShow) {
-                    init = "购买成功"
-                  } else {
-                    init = "支付成功"
-                  }
-                  my.showToast({
-                    content: init,
-                    icon: 'none',
-                    duration: 1000,
-                    success: function () {
-                      my.reLaunch({
-                        url: '/pages/pay_success/pay_success',
-                      })
-                    }
-                  })
-                  that.setData({
-                    depoSuce: true
-                  })
+          my.tradePay({
+            tradeNO: res.data.tradeNo,
+            success(res) {
+              console.log(res)
+              if (res.resultCode == 9000) {
+                let init = '';
+                if (that.data.depShow) {
+                  init = "购买成功"
                 } else {
-                  return
+                  init = "支付成功"
                 }
-              },
-              fail(err) {
-                // console.log(err)
-                // my.showToast({
-                //   content: '支付失败',
-                //   icon: 'none'
-                // })
-                // that.setData({
-                //   depoSuce: true
-                // })
+                my.showToast({
+                  content: init,
+                  icon: 'none',
+                  duration: 1000,
+                  success: function () {
+                    my.reLaunch({
+                      url: '/pages/pay_success/pay_success',
+                    })
+                  }
+                })
+                that.setData({
+                  depoSuce: true
+                })
+              } else {
+                return
               }
-            })
-          } else {
-            console.log(res)
-            that.setData({
-              depoSuce: true
-            })
-          }
-        })
-      }
+            },
+            fail(err) {
+              // console.log(err)
+              // my.showToast({
+              //   content: '支付失败',
+              //   icon: 'none'
+              // })
+              // that.setData({
+              //   depoSuce: true
+              // })
+            }
+          })
+        } else {
+          console.log(res)
+          that.setData({
+            depoSuce: true
+          })
+        }
+      })
+    }
 
 
   }, 1000),
@@ -165,21 +165,21 @@ Page({
   },
   //立即退还
   sureBack: util.throttle(function (e) {
-   app.request('/deposit/refund', '', 'POST').then(res => {
-        console.log(res);
-        if (res.status == 200) {
-          my.showToast({
-            content: '押金退回申请成功,请注意查收!',
-            icon: 'none'
+    app.request('/deposit/refund', '', 'POST').then(res => {
+      console.log(res);
+      if (res.status == 200) {
+        my.showToast({
+          content: '押金退回申请成功,请注意查收!',
+          icon: 'none'
+        })
+        setTimeout(function () {
+          my.reLaunch({
+            url: '/pages/index/index',
           })
-          setTimeout(function () {
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          }, 1500)
-          // this.getState()
-        }
-      })
+        }, 1500)
+        // this.getState()
+      }
+    })
   }, 1000),
   onReady: function () {
 

+ 17 - 17
pages/use_bike/use_bike.acss

@@ -1,6 +1,6 @@
 /* pages/use_bike/use_bike.wxss */
 #map {
-  height: calc(100vh - 295px);
+  height: calc(100vh - 495rpx);
   z-index: 8;
   /* z-index: 999999999999999999; */
   width: 100%;
@@ -34,11 +34,17 @@
   background-color: #fff;
   width: 100%;
   bottom: 0;
-  height: 600rpx;
+  /* height: 600rpx; */
   left: 0;
   padding-bottom: 30rpx;
   border-radius: 40rpx 40rpx 0 0;
 }
+
+/* .warning-lists{
+  height: 280rpx;
+  overflow-y: scroll;
+} */
+
 .bike-tip {
   position: fixed;
   z-index: 99999;
@@ -119,8 +125,8 @@
 }
 .bottom-list {
   display: flex;
-  height: 100rpx;
-  line-height: 100rpx;
+  height: 50rpx;
+  /* line-height: 40rpx; */
   text-align: center;
   font-size: 26rpx;
   color: #666666;
@@ -131,7 +137,12 @@
   flex: 1;
 }
 
-.step3-title,
+.step3-title {
+  height: 120rpx;
+  line-height: 120rpx;
+  border-bottom: solid 1rpx #f1f1f1;
+}
+
 .step2-title {
   height: 120rpx;
   line-height: 120rpx;
@@ -140,7 +151,7 @@
 
 .step2-content {
   /* margin: 30rpx 0; */
-  margin-top: 20rpx;
+  margin-top: 10rpx;
   display: flex;
 }
 
@@ -526,14 +537,3 @@
 .ad-swiper-list{
   height: 200rpx;
 }
-
-/* 动态绑定地图样式 */
-.map1{
-  height: calc(100vh - 80px)!important;
-}
-.map2{
-  height: calc(100vh - 375px)!important;
-}
-.map3{
-  height: calc(100vh - 270px)!important;
-}

+ 127 - 127
pages/use_bike/use_bike.axml

@@ -5,28 +5,28 @@
       <view class="text1">定位失败,请确认是否已开启</view>
       <view class="text2" style="margin-bottom:44rpx;">位置权限</view>
       <view class="view">
-        <view class="view1"  style="border-right:1rpx solid #f4f4f4;color:#999999;" onTap="open">
+        <view class="view1" style="border-right:1rpx solid #f4f4f4;color:#999999;" onTap="open">
           <view>已开启</view>
         </view>
-        <view class="view1" style="color:#18D4B8;"  onTap="go_setting">
+        <view class="view1" style="color:#18D4B8;" onTap="go_setting">
           <view>去设置</view>
         </view>
       </view>
     </view>
-   
+    
   </view>
-
+  
   <!-- 车辆未开锁弹框 -->
-  <view class="frame"  hidden="{{!frame}}">
+  <view class="frame" hidden="{{!frame}}">
     <view class="frame-content">
       <view class="frame-title">
         <text class="iconfont icon-cha cha" onTap="frameClose"></text>
         <text class="frame-kefu" onTap="keFu">联系客服</text>
       </view>
-
+      
       <image src="../../img/suo.jpg" mode="widthFix" class="suo"></image>
       <view class="frame-con">
-        <!-- <image src="../../img/lanya.jpg" mode="widthFix" class="lanya"></image> -->
+        <!--<image src="../../img/lanya.jpg" mode="widthFix" class="lanya"></image> -->
         <view class="frame-bt">
           <view class="frame-left" onTap="guzhang">故障上报</view>
           <view class="frame-right" onTap="retryOpenBike">重新开锁</view>
@@ -35,170 +35,170 @@
     </view>
   </view>
   <!-- 地图显示停车区域-->
-  <map name="" id="map" show-location="true" longitude='{{longitude}}' latitude='{{latitude}}' scale='{{zoom}}' enable-zoom='true'
-    markers="{{markers}}" data-markers="{{markers}}" controls="{{controls}}" polygon="{{polygons}}" >
+  <map name="" id="map" show-location="true" longitude='{{longitude}}' latitude='{{latitude}}' scale='{{zoom}}' enable-zoom='true' 
+    markers="{{markers}}" data-markers="{{markers}}" controls="{{controls}}" polygon="{{polygons}}">
   </map>
   <view class="map-icon">
     <view class="kefu" onTap="findPark">
       <image src="../../img/park.png"></image>
     </view>
   </view>
-  <!-- <view class="bike-tip" onTap="bikeKnow">
-    <text class="tip-text">车辆静止30分钟将自动锁车</text> 
+  <!--<view class="bike-tip" onTap="bikeKnow"><text class="tip-text">车辆静止30分钟将自动锁车</text>
+</view> -->
 
-  </view> -->
-  
   <!-- 公告栏 -->
-  <view class="ad-list">
+  <view class="ad-list" a:if="{{ steps==3 || !notice.id && ads.length==0}}">
     <image src="../../img/mess.png" alt="" class="mess" />
     <swiper class="swiper" autoplay='true' vertical='true' interval='10000'>
       <swiper-item class="swiper-item">
         <view class="ad-item">不在还车点换车,将收取调度费</view>
       </swiper-item>
-      <!-- <swiper-item class="swiper-item">
-        <view class="ad-item">车辆静止三十分钟后将自动还车~</view>
-      </swiper-item> -->
+      <!--<swiper-item class="swiper-item"><view class="ad-item">车辆静止三十分钟后将自动还车~</view></swiper-item> -->
       <swiper-item class="swiper-item" a:if="{{bikeMessage.activity}}">
         <view class="ad-item">{{bikeMessage.activity}}</view>
       </swiper-item>
     </swiper>
-    <!-- <image src="../../img/change.png" class="change"></image> -->
+    <!--<image src="../../img/change.png" class="change"></image> -->
   </view>
   <!-- 轮播图 -->
   <view class="ad-swiper" a:if="{{ads.length>0 && steps!=3}}">
-    <swiper class="ad-swiper-list" indicator-dots='{{ads.length > 1 ? true : false}}'
-      indicator-color='var(--globleColor)' autoplay='true' interval="5000" current="{{currentSwiper}}"
-      bindchange="swiperChange">
+    <swiper class="ad-swiper-list" indicator-dots='{{ads.length > 1 ? true : false}}' indicator-color='var(--globleColor)' 
+      autoplay='true' interval="5000" current="{{currentSwiper}}" onTap="swiperChange">
       <swiper-item a:for="{{ads}}" a:key="key" class="ad-swiper-item">
-        <image src="{{item.surface}}" style="width:100%;height:100%;" bindtap="swiper" data-index="{{index}}"
-          data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}"
-          a:if="{{item.type!='wxTencentAdvertisement'}}"></image>
+        <image mode="widthFix" src="{{item.surface}}" style="width:100%;height:200rpx;" onTap="swiper" data-index="{{index}}" data-type="{{item.type}}" 
+          data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}" a:if="{{item.type!='wxTencentAdvertisement'}}"></image>
       </swiper-item>
     </swiper>
   </view>
-
-  <view class="inform" style="top:{{ads.length>0 && steps!==3 ? '250rpx' : steps==3 ? '60px' : '30rpx'}}"
-    bindtap="tap_notice" a:if="{{notice.id}}" data-id="{{notice.id}}">
+  
+  <view class="inform" style="top:{{ads.length>0 && steps!==3 ? '220rpx' : steps==3 ? '60px' : '30rpx'}}" onTap="tap_notice" 
+    a:if="{{notice.id}}" data-id="{{notice.id}}">
     <view class="inform-img">
       <image src="../../img/notice.png" class="inform-image" style="width:48rpx;height:48rpx;padding-left:20rpx;">
       </image>
     </view>
     <view class='marquee' style='width:{{marqueeWidth}}rpx;'>
       <view class='marqueeTitle' style="width:{{length}}rpx;transform:translateX( {{marqueeDistance}}rpx);">
-        {{notice.description}}</view>
+        {{notice.description}}
+      </view>
     </view>
     <image src="../../img/more.png" style="width:48rpx;height:48rpx;"></image>
   </view>
   <view class="use-bike-bottom" catchtouchmove='ture' a:if="{{frame == false}}">
-
-
-
-
-  <view class="use-bike-bottom" catchtouchmove='ture'>
-    <!-- 骑行第一步 -->
-    <view class="step1" a:if="{{steps==1}}">
-      <image src="../../img/home.png" class="back-home" bindtap="backHome"></image>
-      <view class="bottom-title1">{{bikeMessage.riding_bike_mileage||'--'}}公里</view>
-      <view class="bottom-title2">剩余电量可行驶</view>
-      
-      <view class="open_bike" onTap="openBikeClick">点击开锁</view>
-      <view class="bike_no">NO:{{bikeMessage.bike_no}}</view>
-      <view class="lanya">打开蓝牙,体验快速开锁</view>
-    </view>
-    <!-- 骑行第二步 -->
-    <view class="step2" a:if="{{steps==2}}">
-      <image src="../../img/home.png" class="back-home" bindtap="backHome"></image>
-      <view class="step2-title">温馨提示</view>
-      <view class="step2-content" a:if="{{setting.is_whole_area_huanche!==1}}">
-        <view class="step2-left">
-          <image src="../../img/park2.png" mode="widthFix"></image>
-        </view>
-        <view class="step2-right">
-          <view class="step2-text">还车点</view>
-          <view class="step2-text1">请在还车点内还车,否则将收取调度费</view>
-        </view>
+    
+    
+    
+    
+    <view class="use-bike-bottom" catchtouchmove='ture'>
+      <!-- 骑行第一步 -->
+      <view class="step1" a:if="{{steps==1}}">
+        <image src="../../img/home.png" class="back-home" onTap="backHome"></image>
+        <view class="bottom-title1">{{bikeMessage.riding_bike_mileage||'--'}}公里</view>
+        <view class="bottom-title2">剩余电量可行驶</view>
+        
+        <view class="open_bike" onTap="openBikeClick">点击开锁</view>
+        <view class="bike_no">NO:{{bikeMessage.bike_no}}</view>
+        <view class="lanya">打开蓝牙,体验快速开锁</view>
       </view>
-      <view class="step2-content">
-        <view class="step2-left">
-          <image src="../../img/park1.jpg" mode="widthFix"></image>
+      <!-- 骑行第二步 -->
+      <view class="step2" a:if="{{steps==2}}">
+        <image src="../../img/home.png" class="back-home" onTap="backHome"></image>
+        <view class="step2-title">温馨提示</view>
+        <view class="step2-content" a:if="{{setting.is_whole_area_huanche!==1}}">
+          <view class="step2-left">
+            <image src="../../img/park2.png" mode="widthFix"></image>
+          </view>
+          <view class="step2-right">
+            <view class="step2-text">还车点</view>
+            <view class="step2-text1">请在还车点内还车,否则将收取调度费</view>
+          </view>
         </view>
-        <view class="step2-right">
-          <view class="step2-text">服务区</view>
-          <view class="step2-text1">请勿骑出运营区,否则车辆将断电</view>
+        <view class="step2-content">
+          <view class="step2-left">
+            <image src="../../img/park1.jpg" mode="widthFix"></image>
+          </view>
+          <view class="step2-right">
+            <view class="step2-text">服务区</view>
+            <view class="step2-text1">请勿骑出运营区,否则车辆将断电</view>
+          </view>
         </view>
+        <view class="open_bike" onTap="konwOpenBike">我知道了,立即开锁</view>
       </view>
-      <view class="open_bike" onTap="konwOpenBike">我知道了,立即开锁</view>
-    </view>
-    <!-- 骑行第三步 -->
-
-    <view class="step3" a:if="{{steps==3}}">
-      <view class="step3-title" style="font-size:30rpx;color:var(--orgFont)" a:if="{{dispatch_money!==0}}">
-         <view class="step3-title-left">
-         <text class="iconfont icon-guize"></text> 您当前不在还车区,还车将收取{{dispatch_money}}元调度费
+      <!-- 骑行第三步 -->
+      
+      <view class="step3" a:if="{{steps==3}}">
+        <view class="step3-title" style="font-size:30rpx;color:var(--orgFont)" a:if="{{dispatch_money!==0}}">
+          <view class="step3-title-left">
+            <text class="iconfont icon-guize"></text> 您当前不在还车区,还车将收取{{dispatch_money}}元调度费
+          </view>
         </view>
-      </view>
-      <view class="step3-title" a:else>
-        <view class="step3-title-left">
-          剩余电量可行驶<text class="title-left-num">{{bikeMessage.riding_bike_mileage||'--'}}</text>公里
+        <view class="step3-title" a:else>
+          <view class="step3-title-left">
+            剩余电量可行驶
+            <text class="title-left-num">{{bikeMessage.riding_bike_mileage||'--'}}</text>公里
+          </view>
+          <view class="step3-title-right" onTap="frameShow" a:if="{{parkStatus==0 || parkStatus==2}}">车辆未开锁</view>
+          <view class="bell" onTap="clickBell" a:if="{{parkStatus==1}}">
+            <image class="bell-image" src="../../img/bell1.png"></image></view>
         </view>
-        <view class="step3-title-right" onTap="frameShow" a:if="{{parkStatus==0 || parkStatus==2}}">车辆未开锁</view>
-        <view class="bell" onTap="clickBell" a:if="{{parkStatus==1}}"> <image class="bell-image" src="../../img/bell1.png"></image></view>
-      </view>
-     
-      <!-- 骑行中 -->
-      <view class="steps3-list" a:if="{{parkStatus==0}}">
-        <view class="step3-list-item">
-          <view class="step3-item-num">{{times}}</view>
-          <view class="step3-item-text">骑行时长</view>
+        
+        <!-- 骑行中 -->
+        <view class="steps3-list" a:if="{{parkStatus==0}}">
+          <view class="step3-list-item">
+            <view class="step3-item-num">{{times}}</view>
+            <view class="step3-item-text">骑行时长</view>
+          </view>
+          <view class="step3-list-item">
+            <view class="step3-item-num">{{battery_power}}%</view>
+            <view class="step3-item-text">剩余电量</view>
+          </view>
+          <view class="step3-list-item">
+            <view class="step3-item-num">¥{{estimate_money}}</view>
+            <view class="step3-item-text">预估费用</view>
+          </view>
         </view>
-        <view class="step3-list-item">
-          <view class="step3-item-num">{{battery_power}}%</view>
-          <view class="step3-item-text">剩余电量</view>
+        <!-- 临时停车 -->
+        <view class="step3-parking" a:if="{{parkStatus==1}}">
+          <view class="step3-park-title1">临时锁车</view>
+          <view class="step3-park-text" a:if="{{stopmMinute!==0 && stopMiao!==0}}">可锁车{{stopmMinute || '--'}}分{{stopMiao || '--'}}秒</view>
         </view>
-        <view class="step3-list-item">
-          <view class="step3-item-num">¥{{estimate_money}}</view>
-          <view class="step3-item-text">预估费用</view>
+        <!-- 结束用车显示费用信息 -->
+        <view class="steps3-list" a:if="{{parkStatus==2}}" style="width:70%;margin:0 auto">
+          <!--<view class="step3-list-item"><view class="step3-item-num" style="color:var(--globleColor)"><text style="font-size:26rpx">¥</text>{{money.total_money}}</view><view class="step3-item-text">时长费用</view></view> -->
+          <view class="step3-list-item">
+            <view class="step3-item-num">
+              <text style="font-size:26rpx">¥</text>{{money.time_money}}</view>
+            <view class="step3-item-text">骑行费用</view>
+          </view>
+          <view class="step3-list-item">
+            <view class="step3-item-num">
+              <text style="font-size:26rpx">¥</text>{{dispatch_money}}</view>
+            <view class="step3-item-text">调度费</view>
+          </view>
         </view>
-      </view>
-      <!-- 临时停车 -->
-      <view class="step3-parking" a:if="{{parkStatus==1}}">
-        <view class="step3-park-title1">临时锁车</view>
-        <view class="step3-park-text" a:if="{{stopmMinute!==0 && stopMiao!==0}}">可锁车{{stopmMinute || '--'}}分{{stopMiao || '--'}}秒</view>
-      </view>
-      <!-- 结束用车显示费用信息 -->
-         <view class="steps3-list" a:if="{{parkStatus==2}}" style="width:70%;margin:0 auto">
-        <!-- <view class="step3-list-item">
-          <view class="step3-item-num" style="color:var(--globleColor)"><text style="font-size:26rpx">¥</text>{{money.total_money}}</view>
-          <view class="step3-item-text">时长费用</view>
-        </view> -->
-        <view class="step3-list-item">
-          <view class="step3-item-num" ><text style="font-size:26rpx">¥</text>{{money.time_money}}</view>
-          <view class="step3-item-text">骑行费用</view>
-        </view>
-        <view class="step3-list-item">
-          <view class="step3-item-num"><text style="font-size:26rpx">¥</text>{{dispatch_money}}</view>
-          <view class="step3-item-text">调度费</view>
+        <view class="step3-bottom">
+          <view class="step3-bottom-left" onTap="parkBike" a:if="{{parkStatus==0 && chaButton==0}}">临时锁车</view>
+          <view class="step3-bottom-left" a:if="{{parkStatus==1 && chaButton==0}}" onTap="openPark">解锁</view>
+          <view class="step3-cha" onTap="cancelEndBike" a:if="{{chaButton==1}}">
+            <text class="iconfont icon-cha"></text></view>
+          <view class="step3-bottom-right" onTap="endUseBike" a:if="{{parkStatus!==2 && chaButton==0}}">结束用车</view>
+          <view class="step3-bottom-right" onTap="sureEndUseBike" a:if="{{chaButton==1}}">确认结束</view>
         </view>
       </view>
-      <view class="step3-bottom">
-        <view class="step3-bottom-left" onTap="parkBike" a:if="{{parkStatus==0 && chaButton==0}}">临时锁车</view>
-        <view class="step3-bottom-left" a:if="{{parkStatus==1 && chaButton==0}}" onTap="openPark">解锁</view>
-        <view class="step3-cha" onTap="cancelEndBike" a:if="{{chaButton==1}}"><text
-            class="iconfont icon-cha"></text></view>
-        <view class="step3-bottom-right" onTap="endUseBike" a:if="{{parkStatus!==2 && chaButton==0}}">结束用车</view>
-        <view class="step3-bottom-right" onTap="sureEndUseBike" a:if="{{chaButton==1}}">确认结束</view>
+      <view class="bottom-list">
+        <view class="bottom-list-item" onTap="chargeRule">
+          <text class="iconfont icon-bianmaguize buttom-icon"></text>
+          <text>计费规则</text></view>
+        <view class="bottom-list-item" onTap="keFu">
+          <text class="iconfont icon-kefu buttom-icon"></text>
+          <text>联系客服</text></view>
+        <view class="bottom-list-item" onTap="bikeKnow">
+          <text class="iconfont icon-guize buttom-icon"></text>
+          <text>骑行须知</text></view>
+        <view class="bottom-list-item" onTap="bikeCoupon">
+          <text class="iconfont icon-coupon buttom-icon"></text>
+          <text>特惠购卡</text></view>
       </view>
     </view>
-    <view class="bottom-list">
-      <view class="bottom-list-item" onTap="chargeRule"><text
-          class="iconfont icon-bianmaguize buttom-icon"></text><text>计费规则</text></view>
-      <view class="bottom-list-item" onTap="keFu"><text
-          class="iconfont icon-kefu buttom-icon"></text><text>联系客服</text></view>
-      <view class="bottom-list-item" onTap="bikeKnow"><text
-          class="iconfont icon-guize buttom-icon"></text><text>骑行须知</text></view>
-      <view class="bottom-list-item" onTap="bikeCoupon"><text
-          class="iconfont icon-coupon buttom-icon"></text><text>特惠购卡</text></view>
-    </view>
-  </view>
-
-</view>
+    
+  </view>

+ 53 - 35
pages/use_bike/use_bike.js

@@ -145,41 +145,11 @@ Page({
   },
   onLoad: function (options) {
     let that = this
-    // if (options != null && options instanceof Object && options.hasOwnProperty('q')) {
-    //   var code1 = decodeURIComponent(options.q)
-    //   var index = code1.lastIndexOf("\=");
-    //   let code = code1.substring(index + 1, code1.length);
-    //   that.setData({
-    //     code: code
-    //   })
-    // } else if (options != null && options instanceof Object && options.hasOwnProperty('order') && options.order.length > 20) {
-    //   that.setData({
-    //     order: options.order,
-    //   })
-    // } else if (options != null && options instanceof Object && options.hasOwnProperty('code')) {
-    //   that.setData({
-    //     code: options.code
-    //   })
-    // } else {
-    //   my.alert({
-    //     title: '提示',
-    //     content: '车牌号有误,请重试~',
-    //     success: function (res) {
-    //       my.reLaunch({
-    //         url: '/pages/index/index',
-    //       })
-    //     }
-    //   })
-    //   return
-    // }
+
     if (app.globalData.scanCode) {
-      // console.log('扫码加载')
-      // var code1 = decodeURIComponent(options.query.qrCode)
-      // var index = code1.lastIndexOf("\=");
-      // let code = code1.substring(index + 1, code1.length);
+
       that.setData({
         code: app.globalData.scanCode
-        // code: '410100100'
       })
     } else if (options.order != undefined) {
       that.setData({
@@ -264,7 +234,7 @@ Page({
 
     let isCache = getCache('ads:' + id)
     if (isCache) {
-      if (isCache != '') return
+      if (isCache == '') return
       if (isCache != null && isCache instanceof Object && isCache.hasOwnProperty('header')) {
         that.setData({
           ads: isCache.header
@@ -282,7 +252,7 @@ Page({
     app.request("/ads?area_id=" + area_id + "&position[]=mid&position[]=header&position[]=footer", '', "GET").then(res => {
       if (res.status == 200) {
         setCache('ads:' + id, res.data)
-        if (res.data != '') return
+        if (res.data == '') return
         if (res.data.header) {
           that.setData({
             ads: res.data.header
@@ -299,7 +269,55 @@ Page({
       // console.log(err)
     })
   },
+  //点击广告页
+  swiper: util.throttle(function (e) {
 
+    var type = e.currentTarget.dataset.type;
+    var index = e.currentTarget.dataset.index;
+    var name = e.currentTarget.dataset.name;
+    var detail = e.currentTarget.dataset.detail;
+    var id = e.currentTarget.dataset.id;
+    if (type != 'clilk_null') {
+      if (type == 'wxUrl') {
+        console.log(e, 'pppp')
+        my.navigateTo({
+          url: '/' + detail,
+        })
+      } else if (type == 'phone') {
+
+        my.makePhoneCall({
+          number: detail,
+        })
+      } else if (type == 'toMiniProgram') {
+        my.navigateToMiniProgram({
+          appId: detail,
+          extraData: {
+            foo: 'bar'
+          },
+          // envVersion: 'develop',
+          success(res) {
+            // 打开成功
+          }
+        })
+      } else {
+        my.navigateTo({
+          url: '../swiper/swiper?type=' + type + '&url=' + id + '&name=' + name + '&detail=' + detail,
+        })
+      }
+    }
+  }, 1000),
+  //点击轮播图
+  swiperChange: function (e) {
+    if (this.data.currentSwiper == 0 && this.data.swiperCurrent > 1) { //卡死时,重置current为正确索引
+      this.setData({
+        currentSwiper: this.data.swiperCurrent
+      });
+    } else { //正常轮转时,记录正确页码索引
+      this.setData({
+        swiperCurrent: e.detail.current
+      });
+    }
+  },
 
 
 
@@ -571,7 +589,7 @@ Page({
         that.home()
       },
       fail: function (err) {
-       my.hideLoading()
+        my.hideLoading()
         if (err.error == 11) {
           my.showAuthGuide({
             authType: 'LBS',

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