xvying 3 years ago
parent
commit
8b7b1f1725

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

@@ -4,10 +4,10 @@ require('./config$');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/use_bike/use_bike?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/authorization/authorization?hash=55a54d58d54db023cdd93414867929a95382a8fa');
-require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/buy-card/buy-card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/pay_success/pay_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/depoSuce/depoSuce?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');

+ 1 - 1
.tea/entryFiles-production/index$.worker.js

@@ -33,10 +33,10 @@ require('../../app');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/use_bike/use_bike?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/authorization/authorization?hash=55a54d58d54db023cdd93414867929a95382a8fa');
-require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/buy-card/buy-card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/pay_success/pay_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/depoSuce/depoSuce?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');

BIN
img/notice.png


+ 17 - 4
pages/balance/balance.js

@@ -31,7 +31,7 @@ Page({
       isShow: false
     })
   },
-    skipXieyi:function(){
+  skipXieyi: function () {
     my.navigateTo({
       url: '/pages/agreement/agreement',
     })
@@ -76,7 +76,7 @@ Page({
   },
   //立即充值
   pay: util.throttle(function (e) {
-    var reg = new RegExp("^([1-9]|[1-9]\\d|1000)$");
+    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)
@@ -97,12 +97,25 @@ Page({
         inputValue: null
       })
     } else {
+
+
       if (app.globalData.req) {
-        let data = {
+        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,
-          area_id: my.getStorageSync({ 'key': 'home' }).data.id,
           config_id: self.data.id
         }
+        }
+
         app.request('/rechange/pay', data, 'POST', app.globalData.req).then(res => {
           if (res.status == 200) {
             my.tradePay({

+ 1 - 1
pages/buy-card/buy-card.js

@@ -72,7 +72,7 @@ Page({
       info: false
     })
     var area_id = ''
-    if (my.getStorageSync({ 'key': 'home' }).data.id != undefined) {
+    if (my.getStorageSync({ 'key': 'home' }).data) {
       area_id = my.getStorageSync({ 'key': 'home' }).data.id
     } else {
       my.showToast({

+ 34 - 0
pages/index/index.acss

@@ -339,4 +339,38 @@ bottom: 350rpx;
 .no-pay-order text{
   display: inline-block;
   margin: 0 10rpx;
+}
+
+
+.inform {
+  display: flex;
+  align-items: center;
+  width: 94%;
+  left: 3%;
+  height: 68rpx;
+  background: white;
+  position: fixed;
+  z-index: 1000;
+  font-size: 26rpx;
+  justify-content: space-between;
+  border-radius: 10rpx;
+  top: 250rpx;
+}
+
+.inform-img {
+  display: flex;
+  height: 100%;
+  align-items: center;
+
+}
+
+.marquee {
+  width: 80%;
+  height: 70rpx;
+  overflow: hidden;
+  line-height: 70rpx;
+}
+
+.marqueeTitle {
+  height: 70rpx;
 }

+ 14 - 0
pages/index/index.axml

@@ -69,6 +69,20 @@
       </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}}">
+    <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>
+    <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}}">

+ 49 - 12
pages/index/index.js

@@ -79,9 +79,9 @@ Page({
     stop_type: '',
     marqueePace: 0.6, //滚动速度
     marqueeDistance: 520, //初始滚动距离 用到
-    size: 26, //用到
-    marqueeWidth: 520, //用到
-    length: '',
+     size: 26, //通知公告用到
+    marqueeWidth: 560, //通知公告用到
+    length: '',//通知公告
     swiperCurrent: 0,
     midbolear: '',
     per_money: '',
@@ -116,6 +116,7 @@ Page({
       console.log('YYYYYYYYYYYYY')
       that.location()
       that.getUser()
+      that.userState()
     })
     // that.location();
     // testToken = setInterval(function () {
@@ -215,6 +216,47 @@ Page({
       });
     }
   },
+  //通知公告
+    getNotice(id){
+    let data = {
+      'area_id': id
+    }
+    app.request("/index/an", data, "GET").then(res => {
+      console.log(res)
+      if(200 == res.status && res.data.id){
+        this.setData({notice:res.data})
+        var length = res.data.description.length * this.data.size; //计算文字的长度
+        this.setData({
+          length: length
+        })
+        if (this.data.length > this.data.marqueeWidth) {
+          this.noticeRun();
+        } else {
+          this.setData({
+            marqueeDistance: 0
+          })
+        }
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  noticeRun: function () {
+    var that = this;
+    mytime = setInterval(function () {
+      if (-that.data.marqueeDistance < that.data.length) {
+        that.setData({
+          marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
+        })
+      } else {
+        clearInterval(mytime);
+        that.setData({
+          marqueeDistance: that.data.marqueeWidth
+        });
+        that.noticeRun();
+      }
+    }, 6)
+  },
   //定位当前位置
   posi: util.throttle(function () {
     //点击定位  
@@ -273,7 +315,7 @@ Page({
           var data = res.data;
           console.log(data, '区域')
           let id = data.id
-          that.userState()
+         this.getNotice(id)
           if (data.points != []) {
             that.setData({
               id: data.id,
@@ -464,7 +506,7 @@ Page({
           return;
         } else {
           //没有押金没有免押券
-          if (userStatus.is_deposit == 0 && that.data.setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
+          if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
             console.log('没有押金没有免押券')
             my.navigateTo({
               url: '/pages/ride_zige/ride_zige',
@@ -619,11 +661,7 @@ Page({
   //用户状态
   userState: function (id) {
     var that = this;
-
-    var data = {
-      'area_id': id
-    }
-    app.request("/user/status", data, "GET").then(res => {
+    app.request("/user/status","GET").then(res => {
       console.log(res)
       if (res.status == 200) {
         console.log(res, 'XYYING================')
@@ -746,10 +784,9 @@ Page({
           }
         }
       } else if (data.id == 3 && !setting) {
-        wx.showModal({
+        my.alert({
           title: '提示',
           content: '您附近暂无运营区,暂不可用车',
-          showCancel: false
         })
       } else if (data.id == 4) {
         if (userStatus.is_bind_mobile == 0) {

+ 13 - 4
pages/mine/mine.js

@@ -91,7 +91,7 @@ Page({
     let that = this
     this.getUser();
     var area_id = ''
-    if (my.getStorageSync({ 'key': 'home' }).data.id != undefined) {
+    if (my.getStorageSync({ 'key': 'home' }).data= undefined) {
       area_id = my.getStorageSync({ 'key': 'home' }).data.id
     }
     var data = {
@@ -138,9 +138,18 @@ Page({
     })
   },
   rideZige: function () {
-    my.navigateTo({
-      url: '/pages/ride_zige/ride_zige',
-    })
+    console.log(my.getStorageSync({ 'key': 'home' }).data)
+    if (!my.getStorageSync({ 'key': 'home' }).data) {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区',
+      })
+    } else {
+      my.navigateTo({
+        url: '/pages/ride_zige/ride_zige',
+      })
+    }
+
   },
   setUp: function () {
     my.navigateTo({

+ 4 - 4
pages/parking/parking.json

@@ -1,5 +1,5 @@
-{
-  "usingComponents": {},
-  "defaultTitle": "查找还车点",
-  "disableScroll": true
+{
+  "usingComponents": {},
+  "defaultTitle": "查找还车点",
+  "disableScroll": true
 }

+ 10 - 10
pages/pay/pay.acss

@@ -428,7 +428,7 @@ margin-bottom:50rpx!important;
     margin-top: -260rpx;
     position: fixed;
     top: 50%;
-    width: 260px;
+    width: 70%;
     /* height: 260px; */
     padding-bottom: 30rpx;
     z-index: 8888;
@@ -511,13 +511,13 @@ vertical-align: middle;
   color: var(--orgFont);text-align: right;
 }
 .colse-type{
-margin: 0 20rpx;
-height: 70rpx;
-line-height: 70rpx;
-padding: 0 50rpx;
-border-radius: 12rpx;
-font-size: 28rpx;
-/* font-weight: 600; */
-color: var(--orgFont);
-background-color: hsl(37, 51%, 92%);
+  margin: 0 20rpx;
+  /* min-height: 70rpx; */
+  line-height: 42rpx;
+  padding: 10px 50rpx;
+  border-radius: 12rpx;
+  font-size: 28rpx;
+  /* font-weight: 600; */
+  color: var(--orgFont);
+  background-color: hsl(37, 51%, 92%);
 }

+ 3 - 3
pages/pay/pay.axml

@@ -20,16 +20,16 @@
 			含里程{{date.orders.use_bike_distance_length_text||'--'}}公里,含时长{{date.orders.use_bike_time_length_text||'--'}}</view>
 		<view a:if="{{rent}}">
 			<text>骑行卡</text>
-			<text style="color:#ff0000;">- ¥{{date.user_card.card_preferential_money||'--'}}</text>
+			<text style="color:#2979ff;">- ¥{{date.user_card.card_preferential_money||'--'}}</text>
 		</view>
 		<view a:if="{{rent}}">
 			<text>优惠券</text>
-			<text style="color:#ff0000;">- ¥{{date.user_coupon.coupon_preferential_money||'--'}}</text>
+			<text style="color:#2979ff;">- ¥{{date.user_coupon.coupon_preferential_money||'--'}}</text>
 		</view>
 		<view onTap="notice">
 			<text>调度费用<text class="iconfont icon-guize"
 					style="display:inline-block;color:var(--orgFont);margin-left:10rpx;"></text></text>
-			<text>¥{{date.orders.dispatch_money||'--'}}</text>
+			<text style="color:#ff0000;">¥{{date.orders.dispatch_money||'--'}}</text>
 		</view>
 	</view>
 	<view class='maskLayer' a:if="{{payment_type}}" catchtouchmove="true" onTap="cancel"></view>

+ 1 - 1
pages/ride_zige/ride_zige.axml

@@ -8,7 +8,7 @@
     <view class="frame-cha" onTap="closeFrame"><text class="iconfont icon-cha"></text></view>
   </view>
   <view class="zige-tips">
-    <view class="title">—— · 购买骑行资格 · ——</view>
+    <view class="title">—— · 获取骑行资格 · ——</view>
     <view class="text">卡费不可退,不可抵用车费?</view>
   </view>
 

+ 2 - 33
pages/ride_zige/ride_zige.js

@@ -15,7 +15,7 @@ Page({
     let deposit = my.getStorageSync({ 'key': 'userState' }).data
     this.setData({
       deposit: my.getStorageSync({ 'key': 'userState' }).data,
-      depositMoney: my.getStorageSync({ 'key': 'setting' }).data.deposit
+      depositMoney: deposit.deposit
     })
 
     this.getCard()
@@ -170,37 +170,7 @@ Page({
   },
   //立即退还
   sureBack: util.throttle(function (e) {
-    let setting = my.getStorageSync({ 'key': 'setting' }).data
-    var that = this;
-    if (setting.deposit_delay_setting.status == true) {
-      my.confirm({
-        title: '退还押金',
-        content: '您这笔退款预计一到三天内到账是否确认退款',
-        showCancel: true, //是否显示取消按钮
-        cancelButtonText: "取消", //默认是“取消”
-        cancelColor: '#000000', //取消文字的颜色
-        confirmButtonText: "确认", //默认是“确定”
-        confirmColor: '#FF0000', //确定文字的颜色
-        success: function (res) {
-          if (res.confirm == false) {
-            //点击取消,默认隐藏弹框
-          } else {
-            //点击确定
-            app.request('/deposit/refund-job', '', 'POST').then(res => {
-              console.log(res, '退还押金');
-              if (res.status == 200) {
-                my.reLaunch({
-                  url: '/pages/refund_success/refund_success?number=' + that.data.setting.deposit_delay_setting.day,
-                })
-              }
-            }).catch(err => {
-              console.log('0000')
-            })
-          }
-        }
-      })
-    } else {
-      app.request('/deposit/refund', '', 'POST').then(res => {
+   app.request('/deposit/refund', '', 'POST').then(res => {
         console.log(res);
         if (res.status == 200) {
           my.showToast({
@@ -215,7 +185,6 @@ Page({
           // this.getState()
         }
       })
-    }
   }, 1000),
   onReady: function () {
 

+ 6 - 0
pages/use_bike/use_bike.acss

@@ -79,6 +79,12 @@
   margin-top: 10rpx;
   margin-bottom: 70rpx;
 }
+.bike_no{
+  /* margin-bottom: 70rpx; */
+  margin-top: 15rpx;
+  font-size: 30rpx;
+  color: #999;
+}
 
 .open_bike {
   height: 100rpx;

+ 1 - 0
pages/use_bike/use_bike.axml

@@ -71,6 +71,7 @@
       <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>
     <!-- 骑行第二步 -->

+ 19 - 6
pages/use_bike/use_bike.js

@@ -61,10 +61,15 @@ Page({
   },
   onShow: function () {
     let that = this
+     that.setData({
+      polygons1:[],
+      polygons:[]
+    })
     my.setNavigationBar({
       title: app.globalData.title
     })
     clearInterval(locationTerval);
+    that.userState()
     that.posiLoca()
     app.login().then(res => {
       that.chushiPosiloc()
@@ -191,10 +196,8 @@ Page({
   //用户状态
   userState: function (area_id) {
     var that = this;
-    var data = {
-      'area_id': area_id
-    }
-    app.request("/user/status", data, "GET").then(res => {
+   
+    app.request("/user/status","GET").then(res => {
       console.log(res, 'zhuangtai')
       if (res.status == 200) {
         my.setStorageSync({ 'key': 'userState', data: res.data });
@@ -204,9 +207,17 @@ Page({
           })
           that.chushi()
         }
+         /**
+        * 未支付直接调转支付
+        * mead
+        */
+        if(res.data.is_pay_order){
+          my.navigateTo({
+            url: '/pages/pay/pay?order=' + res.data.is_pay_order,
+          })
+        }
       } else {
         if (this.data.bikeInfo.is_link == 0) {
-
           my.alert({
             title: '提示',
             content: '当前车子已下线请换辆车子骑行吧~',
@@ -287,7 +298,6 @@ Page({
             area_id: res.data.id
           })
           let area_id = res.data.id
-          that.userState(area_id)
           that.ban_stop(area_id)
           console.log(data, '区域')
           my.setStorageSync({ 'key': 'home', data: data });
@@ -659,6 +669,9 @@ Page({
     let that = this
     var userStatus = my.getStorageSync({ 'key': 'userState' }).data;
     var setting = my.getStorageSync({ 'key': 'setting' }).data;
+    console.log(userStatus,'旭颖')
+    console.log(setting,'旭颖')
+
     //未绑定手机号
     if (userStatus.is_bind_mobile == 0) {
       my.navigateTo({

+ 3 - 3
pages/use_bike/use_bike.json

@@ -1,4 +1,4 @@
-{
-  "usingComponents": {},
-  "disableScroll": true
+{
+  "usingComponents": {},
+  "disableScroll": true
 }

+ 83 - 81
pages/weizhang/weizhang.js

@@ -1,81 +1,83 @@
-var app = getApp()
-Page({
-  data: {
-    arr: [],
-    pages: 1,//当前页面
-    links: '',//下一页地址
-  },
-  onLoad: function (options) {
-
-  },
-  detail(e) {
-    my.navigateTo({
-      url: '../weizhang_detail/weizhang_detail?no=' + e.currentTarget.dataset.id,
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-    var that = this;
-
-    that.getList()
-  },
-  getList: function () {
-    var that = this;
-
-    my.showLoading({
-      content: '加载中...',
-    })
-    let data = { page: that.data.pages }
-    app.request('/punishment_orders', data, 'GET').then(res => {
-      if (res.status == 200) {
-        console.log(res)
-        let arr1 = res.data.data
-        var arr = that.data.arr.concat(arr1);
-        if (arr1.length == 0) {
-          my.showToast({
-            content: '暂无更多~',
-            icon: 'none'
-          })
-        } else {
-          that.setData({
-            arr,
-            links: res.data.meta.pagination.links
-          })
-        }
-      }
-      my.hideLoading({
-        complete: (res) => { },
-      })
-    })
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-    if (this.data.links == null) {
-      my.showToast({
-        content: '暂无更多',
-        icon: 'none'
-      })
-      return
-    } else {
-      let page = this.data.pages++
-      page++
-      this.setData({
-        pages: page
-      })
-      this.getList()
-    }
-  },
-  onShareAppMessage: function () {
-
-  }
-})
+var app = getApp()
+Page({
+  data: {
+    arr: [],
+    pages: 1,//当前页面
+    links: '',//下一页地址
+  },
+  onLoad: function (options) {
+
+  },
+  detail(e) {
+    my.navigateTo({
+      url: '../weizhang_detail/weizhang_detail?no=' + e.currentTarget.dataset.id,
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    var that = this;
+    that.setData({
+      arr: []
+    })
+    that.getList()
+  },
+  getList: function () {
+    var that = this;
+
+    my.showLoading({
+      content: '加载中...',
+    })
+    let data = { page: that.data.pages }
+    app.request('/punishment_orders', data, 'GET').then(res => {
+      if (res.status == 200) {
+        console.log(res)
+        let arr1 = res.data.data
+        var arr = that.data.arr.concat(arr1);
+        if (arr1.length == 0) {
+          my.showToast({
+            content: '暂无更多~',
+            icon: 'none'
+          })
+        } else {
+          that.setData({
+            arr,
+            links: res.data.meta.pagination.links
+          })
+        }
+      }
+      my.hideLoading({
+        complete: (res) => { },
+      })
+    })
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+    if (this.data.links == null) {
+      my.showToast({
+        content: '暂无更多',
+        icon: 'none'
+      })
+      return
+    } else {
+      let page = this.data.pages++
+      page++
+      this.setData({
+        pages: page
+      })
+      this.getList()
+    }
+  },
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 4
service/bluetooth.js

@@ -818,10 +818,10 @@ function BluetoothOperate() {
       },
       fail: (err) => {
         this.log('initBluetooth:', err.errMsg);
-        my.showToast({
-          content: '蓝牙初始化失败',
-          icon: 'none',
-        })
+        // my.showToast({
+        //   content: '蓝牙初始化失败',
+        //   icon: 'none',
+        // })
       },
       complete: () => {
         cb && cb();