Browse Source

first-zhifubao

xvying 3 years ago
parent
commit
fa23bb08c7
59 changed files with 2668 additions and 2611 deletions
  1. 7 0
      .tea/entryFiles-production/config$.js
  2. 4 0
      .tea/entryFiles-production/importScripts$.js
  3. 39 0
      .tea/entryFiles-production/index$.web.js
  4. 0 0
      .tea/entryFiles-production/index$.worker.js
  5. 9 4
      app.js
  6. 52 52
      app.json
  7. 1 1
      pages/account_details/account_details.acss
  8. 78 78
      pages/account_details/account_details.js
  9. 1 1
      pages/account_details/account_details.json
  10. 1 1
      pages/agreement/agreement.axml
  11. 3 3
      pages/agreement/agreement.json
  12. 1 1
      pages/authorization/authorization.axml
  13. 197 197
      pages/balance/balance.js
  14. 1 1
      pages/breakdown/breakdown.json
  15. 1 1
      pages/buy-card/buy-card.acss
  16. 2 2
      pages/buy-card/buy-card.js
  17. 1 1
      pages/buy-card/buy-card.json
  18. 4 4
      pages/change_mobile/change_mobile.js
  19. 1 1
      pages/change_mobile/change_mobile.json
  20. 1 1
      pages/charge_rule/charge_rule.json
  21. 1 1
      pages/coupon/coupon.json
  22. 1 1
      pages/depoSuce/depoSuce.json
  23. 4 4
      pages/index/index.js
  24. 137 132
      pages/inputcode/inputcode.js
  25. 1 1
      pages/inputcode/inputcode.json
  26. 1 1
      pages/logs/logs.json
  27. 1 1
      pages/mine/mine.js
  28. 1 1
      pages/mine/mine.json
  29. 1 1
      pages/mine_card/mine_card.json
  30. 1 1
      pages/mine_data/mine_data.json
  31. 1 1
      pages/my_account/my_account.json
  32. 280 280
      pages/parking/parking.js
  33. 1 1
      pages/parking/parking.json
  34. 7 7
      pages/pay/pay.js
  35. 1 1
      pages/pay/pay.json
  36. 1 1
      pages/pay_success/pay_success.json
  37. 1 1
      pages/phone_verif/phone_verif.js
  38. 180 180
      pages/real_name/real_name.js
  39. 1 1
      pages/real_name/real_name.json
  40. 80 80
      pages/refund_success/refund_success.js
  41. 1 1
      pages/refund_success/refund_success.json
  42. 1 1
      pages/ride_rule/ride_rule.json
  43. 47 47
      pages/ride_zige/ride_zige.axml
  44. 235 239
      pages/ride_zige/ride_zige.js
  45. 1 1
      pages/ride_zige/ride_zige.json
  46. 2 1
      pages/trip/trip.acss
  47. 2 2
      pages/trip/trip.axml
  48. 116 116
      pages/trip/trip.js
  49. 1 1
      pages/trip/trip.json
  50. 1 1
      pages/trip_detail/trip_detail.axml
  51. 2 2
      pages/trip_detail/trip_detail.js
  52. 990 990
      pages/use_bike/use_bike.js
  53. 1 1
      pages/user_rules/user_rules.axml
  54. 1 1
      pages/weizhang/weizhang.acss
  55. 81 81
      pages/weizhang/weizhang.js
  56. 1 1
      pages/weizhang/weizhang.json
  57. 78 78
      pages/weizhang_detail/weizhang_detail.js
  58. 1 1
      pages/weizhang_detail/weizhang_detail.json
  59. 0 0
      utils/qqmap-wx-jssdk.min.js

+ 7 - 0
.tea/entryFiles-production/config$.js

@@ -0,0 +1,7 @@
+
+const g = typeof global !== 'undefined' ? global : self;
+g.appXAppJson = {
+  "app": {
+    "$homepage": "pages/index/index"
+  }
+};

+ 4 - 0
.tea/entryFiles-production/importScripts$.js

@@ -0,0 +1,4 @@
+if(!self.Map || !self.Set || !self.Symbol) {
+    importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
+     }
+     importScripts(`https://appx/af-appx.worker.min.js`);

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

@@ -0,0 +1,39 @@
+require('@alipay/appx-compiler/lib/sjsEnvInit');
+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/buy-card/buy-card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/pay_success/pay_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/depoSuce/depoSuce?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/charge_rule/charge_rule?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/use_bike/use_bike?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/balance/balance?hash=55a54d58d54db023cdd93414867929a95382a8fa');
+require('../../pages/change_mobile/change_mobile?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/authorization/authorization?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/trip/trip?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/coupon/coupon?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/breakdown/breakdown?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/weizhang/weizhang?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/mine_card/mine_card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/ride_zige/ride_zige?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/refund_success/refund_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/my_account/my_account?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/ride_rule/ride_rule?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/account_details/account_details?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/trip_detail/trip_detail?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/real_name/real_name?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/set_up/set_up?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/mine/mine?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/phone_verif/phone_verif?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/phonelogin/phonelogin?hash=55a54d58d54db023cdd93414867929a95382a8fa');
+require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/logs/logs?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../components/foottip/foottip?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/mine_data/mine_data?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/user_rules/user_rules?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/weizhang_detail/weizhang_detail?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/agreement/agreement?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/parking/parking?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');

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


+ 9 - 4
app.js

@@ -10,7 +10,10 @@ App({
     }else if(cha>data1){
       my.removeStorageSync('token')
       this.token()
+
     }
+      this.token()
+
  
     // 登录
     var that = this;
@@ -181,14 +184,14 @@ App({
             },
             fail: (err) => {
               my.showToast({
-                content: err,
+                content: err.data.message || err.data,
                 icon: 'none',
                 mask: true,
                 duration: 3000,
 
               });
-         
-              reject("请求失败")
+         console.log(err,'qingqiushibai')
+              reject(err,"请求失败")
             },
             complete: () => {
               that.globalData.req = true
@@ -271,7 +274,9 @@ App({
             my.setStorageSync({'key':'session_key',data:res.data.session_key});
             my.setStorageSync({'key':'token_time',data:res.data.exp});
             my.setStorageSync({'key':'user_ID',data:res.data.user.id});
-          }
+          },err:(err=>{
+            console.log(err,'登录错误---------------------------------')
+          })
         })
        
       }

+ 52 - 52
app.json

@@ -1,53 +1,53 @@
-{
-  "pages": [
-    "pages/index/index",
-    "pages/test/test",
-
-    "pages/pay/pay",
-    "pages/buy-card/buy-card",
-    "pages/pay_success/pay_success",
-    "pages/depoSuce/depoSuce",
-    "pages/charge_rule/charge_rule",
-    "pages/use_bike/use_bike",
-    "pages/balance/balance",
-    "pages/change_mobile/change_mobile",
-    "pages/authorization/authorization",
-    "pages/trip/trip",
-    "pages/coupon/coupon",
-    "pages/breakdown/breakdown",
-    "pages/weizhang/weizhang",
-    "pages/mine_card/mine_card",
-    "pages/ride_zige/ride_zige",
-    "pages/refund_success/refund_success",
-    "pages/my_account/my_account",
-    "pages/ride_rule/ride_rule",
-    "pages/account_details/account_details",
-    "pages/trip_detail/trip_detail",
-    "pages/real_name/real_name",
-    "pages/set_up/set_up",
-    "pages/mine/mine",
-    "pages/phone_verif/phone_verif",
-    "pages/phonelogin/phonelogin",
-    "pages/inputcode/inputcode",
-    "pages/logs/logs",
-    "components/foottip/foottip",
-    "pages/mine_data/mine_data",
-    "pages/user_rules/user_rules",
-    "pages/weizhang_detail/weizhang_detail",
-    "pages/agreement/agreement",
-    "pages/parking/parking"
-  ],
-  "window": {
-    "backgroundTextStyle": "light",
-    "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "禹见你",
-    "navigationBarTextStyle": "black"
-  },
-  "style": "v2",
-  "sitemapLocation": "sitemap.json",
-  "permission": {
-    "scope.userLocation": {
-      "desc": "你的位置信息将用于小程序位置接口的效果展示"
-    }
-  }
+{
+  "pages": [
+    "pages/index/index",
+    "pages/test/test",
+
+    "pages/pay/pay",
+    "pages/buy-card/buy-card",
+    "pages/pay_success/pay_success",
+    "pages/depoSuce/depoSuce",
+    "pages/charge_rule/charge_rule",
+    "pages/use_bike/use_bike",
+    "pages/balance/balance",
+    "pages/change_mobile/change_mobile",
+    "pages/authorization/authorization",
+    "pages/trip/trip",
+    "pages/coupon/coupon",
+    "pages/breakdown/breakdown",
+    "pages/weizhang/weizhang",
+    "pages/mine_card/mine_card",
+    "pages/ride_zige/ride_zige",
+    "pages/refund_success/refund_success",
+    "pages/my_account/my_account",
+    "pages/ride_rule/ride_rule",
+    "pages/account_details/account_details",
+    "pages/trip_detail/trip_detail",
+    "pages/real_name/real_name",
+    "pages/set_up/set_up",
+    "pages/mine/mine",
+    "pages/phone_verif/phone_verif",
+    "pages/phonelogin/phonelogin",
+    "pages/inputcode/inputcode",
+    "pages/logs/logs",
+    "components/foottip/foottip",
+    "pages/mine_data/mine_data",
+    "pages/user_rules/user_rules",
+    "pages/weizhang_detail/weizhang_detail",
+    "pages/agreement/agreement",
+    "pages/parking/parking"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "defaultTitle": "禹见你",
+    "navigationBarTextStyle": "black"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  }
 }

+ 1 - 1
pages/account_details/account_details.acss

@@ -39,7 +39,7 @@ background-color: #ffff;
   }
 .none{
   text-align: center;
-  margin-top: 40%;
+  padding-top: 40%;
   }
   .none image{
     height: 100rpx;

+ 78 - 78
pages/account_details/account_details.js

@@ -1,79 +1,79 @@
-var app = getApp()
-const util = require('../../utils/utils.js')
-Page({
-
-  data: {
-    accountList: [],
-    links: '',//下一页地址
-    pages: 1,//当前页地址
-  },
-
-  onLoad: function (options) {
-    var that = this;
-    that.getList()
-  },
-  //获取订单列表
-  getList: function () {
-    let that = this
-    let data = {
-      page: that.data.pages
-    }
-    app.request("/user/wallerLogList", data, "GET").then(res => {
-      if (res.statusCode == 200) {
-        let arr = res.data.data
-          var accountList = that.data.accountList.concat(arr);
-        if (arr.length == 0) {
-          my.showToast({
-            content: '暂无更多~',
-            icon: 'none'
-          })
-        }else{
-        
-          that.setData({
-            accountList,
-            links: res.data.meta.pagination.links
-          })
-        }
-        my.hideLoading({
-          complete: (res) => { },
-        })
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  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()
+const util = require('../../utils/utils.js')
+Page({
+
+  data: {
+    accountList: [],
+    links: '',//下一页地址
+    pages: 1,//当前页地址
+  },
+
+  onLoad: function (options) {
+    var that = this;
+    that.getList()
+  },
+  //获取订单列表
+  getList: function () {
+    let that = this
+    let data = {
+      page: that.data.pages
+    }
+    app.request("/user/wallerLogList", data, "GET").then(res => {
+      if (res.status == 200) {
+        let arr = res.data.data
+          var accountList = that.data.accountList.concat(arr);
+        if (arr.length == 0) {
+          my.showToast({
+            content: '暂无更多~',
+            icon: 'none'
+          })
+        }else{
+        
+          that.setData({
+            accountList,
+            links: res.data.meta.pagination.links
+          })
+        }
+        my.hideLoading({
+          complete: (res) => { },
+        })
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  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 () {
+
+  }
 })

+ 1 - 1
pages/account_details/account_details.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "账户明细"
+  "defaultTitle": "账户明细"
 
 }

+ 1 - 1
pages/agreement/agreement.axml

@@ -9,7 +9,7 @@
       </view>
       <view>
         <view>本隐私政策主要包括以下内容:</view>
-        <view>1、 本隐私政策中个人信息的定义与范围(包括:姓名、手机号码 用户密码、身份证号码、性别、年龄、征信信息、车辆信息、位置信息、行程信息、通话记录、录音录像、订单信息及交易状态、支付信息、设备信息、IP地址、手机充值记录)。
+        <view>1、 本隐私政策中个人信息的定义与范围(包括:姓名、手机号码 用户密码、身份证号码、性别、年龄、征信信息、车辆信息、位置信息、defaultTitle信息、通话记录、录音录像、订单信息及交易状态、支付信息、设备信息、IP地址、手机充值记录)。
         </view>
         <view>2、{{title}}平台各业务功能收集个人信息的范围、收集方式、所收集个人信息与业务功能的关联。</view>
         <view>3、{{title}}可能调用的手机权限、对应的业务功能、调用目的调用前是否询问以及用户关闭相应权限的方式。</view>

+ 3 - 3
pages/agreement/agreement.json

@@ -1,4 +1,4 @@
-{
-  "usingComponents": {},
-  "navigationBarTitleText": "用户协议"
+{
+  "usingComponents": {},
+  "defaultTitle": "用户协议"
 }

+ 1 - 1
pages/authorization/authorization.axml

@@ -4,7 +4,7 @@
   <image src="../../img/logo.png" class="logo" mode="widthFix"></image>
   <view class="text">欢迎使用‘禹’见你</view>
 
-    <button class="wxlogin" open-type="getAuthorize" onGetAuthorize="getUserPhoneNumber" onTap="getUserPhoneNumber" onError="onAuthError" scope='phoneNumber'>微信一键登录</button>
+    <button class="wxlogin" open-type="getAuthorize" onGetAuthorize="getUserPhoneNumber" onError="onAuthError" scope='phoneNumber'>微信一键登录</button>
   
   <!-- <view class="phonelogin" onTap="phoneLogin">手机号注册/登录</view> -->
   <!-- <foottip>登录即代表同意</foottip> -->

+ 197 - 197
pages/balance/balance.js

@@ -1,198 +1,198 @@
-// 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
-    })
-  },
-  //获取余额
-  getBalance: util.throttle(function (e) {
-    app.request("/me", '', "GET").then(res => {
-      200 == res.statusCode && 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]|[1-9]\\d|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) {
-        let 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.statusCode == 200) {
-            my.tradePay({
-              tradeNO: res.data.tradeNo,
-              success(resp) {
-                my.navigateTo({
-                  url: '/pages/mine/mine',
-                })
-              },
-              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.statusCode == 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 () {
-
-  }
+// 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
+    })
+  },
+  //获取余额
+  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]|[1-9]\\d|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) {
+        let 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({
+              tradeNO: res.data.tradeNo,
+              success(resp) {
+                my.navigateTo({
+                  url: '/pages/mine/mine',
+                })
+              },
+              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 () {
+
+  }
 })

+ 1 - 1
pages/breakdown/breakdown.json

@@ -2,6 +2,6 @@
   "usingComponents": {
   
   },
-  "navigationBarTitleText": "我要报修"
+  "defaultTitle": "我要报修"
 
 }

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

@@ -519,7 +519,7 @@ font-weight: bold;
   align-items: center;
   justify-content: center;
   width: 100%;
-  margin-top: 30%;
+  padding-top: 30%;
   height: 90%;
 }
 

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

@@ -87,8 +87,8 @@ Page({
         'area_id': area_id
       }
       app.request("/card_riding/pay", data, "POST", app.globalData.req).then(res => {
-        console.log(res)
-        if (res.statusCode == 200) {
+        console.log(res,'------')
+        if (res.status == 200) {
           that.setData({
             no: res.data.no
           })

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

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "购买骑行卡"
+  "defaultTitle": "购买骑行卡"
 }

+ 4 - 4
pages/change_mobile/change_mobile.js

@@ -60,7 +60,7 @@ Page({
       }
       app.request('/verification-code', data, 'POST').then(res => {
         console.log(res)
-        if (res.statusCode == 200) {
+        if (res.status == 200) {
           if (!timer) {
             timer = setInterval(() => {
               if (currentTime > 0 && currentTime <= 60) {
@@ -119,13 +119,13 @@ Page({
           code: this.data.smsVal
         }
         app.request('/user/bind-mobile', data, 'POST', app.globalData.req).then(res => {
-          if (res.statusCode == 200) {
+          if (res.status == 200) {
             my.showToast({
               content: '换绑成功',
               icon: 'none'
             })
           }
-          if (res.statusCode == 422) {
+          if (res.status == 422) {
             console.log(res)
             my.showToast({
               content: res.data.errors.mobile[0],
@@ -152,7 +152,7 @@ Page({
         encryptedData: e.detail.encryptedData
       }
       app.request('/user/bind-wechat-mobile', data, 'POST').then(res => {
-        if (res.statusCode == 200) {
+        if (res.status == 200) {
           console.log(res.data, '手机号')
           if (res.data.is_bind_mobile==true) {
             my.showToast({

+ 1 - 1
pages/change_mobile/change_mobile.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "更换手机号"
+  "defaultTitle": "更换手机号"
 
 }

+ 1 - 1
pages/charge_rule/charge_rule.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "计费规则"
+  "defaultTitle": "计费规则"
 }

+ 1 - 1
pages/coupon/coupon.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "优惠券"
+  "defaultTitle": "优惠券"
 }

+ 1 - 1
pages/depoSuce/depoSuce.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "押金管理"
+  "defaultTitle": "押金管理"
 }

+ 4 - 4
pages/index/index.js

@@ -185,7 +185,7 @@ Page({
         })
       } else if (type == 'phone') {
         my.makePhoneCall({
-          phoneNumber: detail,
+          number: detail,
         })
       } else if (type == 'toMiniProgram') {
         my.navigateToMiniProgram({
@@ -609,7 +609,7 @@ Page({
   },
   kefu: util.throttle(function () {
     my.makePhoneCall({
-      phoneNumber: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+      number: my.getStorageSync({'key':'home'}).data.customer_service_phone,
     })
   }, 1500),
   //用户状态
@@ -749,7 +749,7 @@ Page({
     let setting = my.getStorageSync({'key':'setting'}).data
     var userStatus = that.data.userStatus;
     //未绑定手机号
-    if (userStatus.is_bind_mobile == 1) {
+    if (userStatus.is_bind_mobile == 0) {
       my.navigateTo({
         url: '/pages/authorization/authorization',
       })
@@ -800,7 +800,7 @@ Page({
   // 客服
   kefu: function () {
     my.makePhoneCall({
-      phoneNumber: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+      number: my.getStorageSync({'key':'home'}).data.customer_service_phone,
     })
   },
 

+ 137 - 132
pages/inputcode/inputcode.js

@@ -1,133 +1,138 @@
-// pages/scancode/scancode.js
-var app = getApp();
-const util = require('../../utils/utils.js')
-Page({
-  data: {
-    inputLen: 9,
-    isFocus: true,
-    code: '',
-    submitState: 0,//未输入车辆编号
-  },
-  onFocus: function (e) {
-    let that=this
-    console.log(e, 'pppp')
-    that.setData({
-      code: e.detail.value
-    });
-    if (that.data.code.length == 9) {
-      that.setData({
-        submitState: 1
-      });
-    }
-  },
-  // setValue: function (e) {
-  //   var that = this;
-  //   that.setData({
-  //     code: e.detail.value
-  //   });
-  //   if (that.data.code.length == 9) {
-  //     that.setData({
-  //       submitState: 1
-  //     });
-  //   }
-  // },
-  sureSubmit: util.throttle(function () {
-    my.showLoading()
-    var that = this;
-    if (that.data.code != '') {
-      that.getBikeMessage()
-
-    } else {
-      my.showToast({
-        content: '请输入车牌号',
-        icon: 'none',
-        duration: 2000
-      })
-    }
-  }, 1500),
-
-  //获取车辆信息
-  getBikeMessage: function () {
-    var that = this;
-    app.request('/bike/' + that.data.code, '', 'GET').then(res => {
-      console.log(res, '车辆信息--------------------')
-      my.hideLoading()
-      if (res.statusCode == 200) {
-
-        if (res.data.is_link == 0) {
-
-          my.alert({
-            title: '提示',
-            content: '当前车子已下线请换辆车子骑行吧~',
-            success: function (res) {
-              my.reLaunch({
-                url: '/pages/index/index',
-              })
-            }
-          })
-          return;
-        } else if (res.data.put_status == 0) {
-          my.alert({
-            title: '提示',
-            content: '当前车子还未投放请换辆车子骑行吧~',
-          })
-          return;
-        } else if (res.data.is_low_battery_power == 0) {
-          my.alert({
-            title: '提示',
-            content: '当前车子电量过低请换辆车子骑行吧~',
-          })
-          return;
-        } else if (res.data.is_trouble == 1) {
-          my.alert({
-            title: '提示',
-            content: '当前车子出现故障请换辆车子骑行吧~',
-          })
-          return;
-        } else if (res.data.is_riding == 1) {
-          my.alert({
-            title: '提示',
-            content: '当前车子正在骑行请换辆车子骑行吧~',
-          })
-          return;
-        } else {
-          console.log(that.data.code, 'that.data.code')
-          my.reLaunch({
-            url: '/pages/use_bike/use_bike?code=' + that.data.code,
-          })
-        }
-      } else {
-        my.alert({
-          title: '提示',
-          content: res.data.message,
-        })
-      }
-    })
-
-  },
-  onLoad: function (options) {
-
-  },
-
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+// pages/scancode/scancode.js
+var app = getApp();
+const util = require('../../utils/utils.js')
+Page({
+  data: {
+    inputLen: 9,
+    isFocus: true,
+    code: '',
+    submitState: 0,//未输入车辆编号
+  },
+  onFocus: function (e) {
+    let that=this
+    console.log(e, 'pppp')
+    that.setData({
+      code: e.detail.value
+    });
+    if (that.data.code.length == 9) {
+      that.setData({
+        submitState: 1
+      });
+    }
+  },
+  // setValue: function (e) {
+  //   var that = this;
+  //   that.setData({
+  //     code: e.detail.value
+  //   });
+  //   if (that.data.code.length == 9) {
+  //     that.setData({
+  //       submitState: 1
+  //     });
+  //   }
+  // },
+  sureSubmit: util.throttle(function () {
+    my.showLoading()
+    var that = this;
+    if (that.data.code != '') {
+      that.getBikeMessage()
+
+    } else {
+      my.showToast({
+        content: '请输入车牌号',
+        icon: 'none',
+        duration: 2000
+      })
+    }
+  }, 1500),
+
+  //获取车辆信息
+  getBikeMessage: function () {
+    var that = this;
+     my.hideLoading()
+     console.log( '车辆信息--------------------')
+    app.request('/bike/' + that.data.code, '', 'GET').then(res => {
+      console.log(res, '车辆信息--------------------')
+     
+      if (res.status == 200) {
+ console.log(res,'找不到车7878')
+        if (res.data.is_link == 0) {
+
+          my.alert({
+            title: '提示',
+            content: '当前车子已下线请换辆车子骑行吧~',
+            success: function (res) {
+              my.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          })
+          return;
+        } else if (res.data.put_status == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子还未投放请换辆车子骑行吧~',
+          })
+          return;
+        } else if (res.data.is_low_battery_power == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子电量过低请换辆车子骑行吧~',
+          })
+          return;
+        } else if (res.data.is_trouble == 1) {
+          my.alert({
+            title: '提示',
+            content: '当前车子出现故障请换辆车子骑行吧~',
+          })
+          return;
+        } else if (res.data.is_riding == 1) {
+          my.alert({
+            title: '提示',
+            content: '当前车子正在骑行请换辆车子骑行吧~',
+          })
+          return;
+        } else {
+          console.log(that.data.code, 'that.data.code')
+          my.reLaunch({
+            url: '/pages/use_bike/use_bike?code=' + that.data.code,
+          })
+        }
+      } else {
+       
+        my.alert({
+          title: '提示',
+          content: res.data.message,
+        })
+      }
+    }).catch(err=>{
+  console.log(err,'找不到车12121')
+    })
+
+  },
+  onLoad: function (options) {
+
+  },
+
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 1 - 1
pages/inputcode/inputcode.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "输入编号开锁"
+  "defaultTitle": "输入编号开锁"
 
 }

+ 1 - 1
pages/logs/logs.json

@@ -1,4 +1,4 @@
 {
-  "navigationBarTitleText": "查看启动日志",
+  "defaultTitle": "查看启动日志",
   "usingComponents": {}
 }

+ 1 - 1
pages/mine/mine.js

@@ -15,7 +15,7 @@ Page({
     if (token != '') {
       app.request("/me", '', "GET").then(res => {
         console.log(res)
-        200 == res.statusCode && my.setStorageSync({'key':"userInfo",data:res.data})
+        200 == res.status && my.setStorageSync({'key':"userInfo",data:res.data})
         this.setData({
           userInfo: res.data,
           deposit: my.getStorageSync({'key':'userState'}).data,

+ 1 - 1
pages/mine/mine.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "个人中心"
+  "defaultTitle": "个人中心"
 
 }

+ 1 - 1
pages/mine_card/mine_card.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "我的卡"
+  "defaultTitle": "我的卡"
 }

+ 1 - 1
pages/mine_data/mine_data.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "个人中心"
+  "defaultTitle": "个人中心"
 }

+ 1 - 1
pages/my_account/my_account.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "我的账号"
+  "defaultTitle": "我的账号"
 }

+ 280 - 280
pages/parking/parking.js

@@ -1,281 +1,281 @@
-var QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js');
-var app = getApp();
-var qqmapsdk = new QQMapWX({
-  key: app.globalData.mapKey // 必填
-});
-Page({
-  data: {
-    longitude: '',
-    latitude: '',
-    suggestion:[],
-    show:false,
-    value:'',
-    parking:false,
-    controls:[],
-    animationData:{},
-    address:'',
-    area:[],
-    polygons:[],
-    areaTop:[],
-    home_polygons: [],
-    markers:[],
-    img:app.globalData.imgUrl
-  },
-  onLoad: function(options) {
-    var that = this;
-    my.getLocation({
-      type: 'gcj02',
-      success: (res) => {
-        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
-        var latitude = res.latitude
-        var longitude = res.longitude
-        that.setData({
-          longitude: longitude,
-          latitude: latitude
-        })
-      },
-      fail: function(err) {
-        console.log(err)
-      }
-    })
-    that.setData({ home_polygons: my.getStorageSync({'key':'home'}).data, polygons: that.data.polygons.concat(my.getStorageSync({'key':'home'}).data)})
-    var data = {
-      'area_id': my.getStorageSync({'key':'home'}).data.id
-    }
-    app.request('/parking/stop-sites', data, 'GET').then(res => {
-      // console.log(res)
-      if (res.statusCode == 200) {
-        var data = res.data
-        that.setData({
-          polygons: that.data.polygons.concat(data.polygons),
-          markers: data.centres
-        })
-        console.log(that.data.polygons)
-      }
-    })
-  },
-  parkingArea:function(){
-    var that = this;
-    my.getLocation({
-      type: 'gcj02',
-      success: function(resp) {
-        var data = {
-          'lat': that.data.latitude,
-          'lng': that.data.longitude,
-          'area_id': my.getStorageSync({'key':'home'}).data.id,
-          'location_lat':resp.latitude,
-          'location_lng':resp.longitude
-        }
-        var markers = that.data.markers;
-        app.request('/parking/nearby', data, 'GET').then(res => {
-          console.log(res)
-          if(res.data.points!=''){
-            that.setData({area:res.data.points,areaTop:res.data.points[0]})
-          }
-          if (res.statusCode == 200) {
-            var data1 = res.data
-            if(data1.polygons.length>0){
-              var array = data1.points;
-              var marker = {};
-              marker.latitude = that.data.latitude;
-              marker.longitude = that.data.longitude;
-              marker.zIndex = 1111;
-              marker.width = 15;
-              marker.height = 27;
-              marker.type = 3;
-              marker.iconPath = '/img/map.png';
-              array = array.concat(marker)
-              that.setData({ polygons: that.data.polygons.concat(data1.polygons), markers: markers.concat(array), parking:true})
-              console.log(that.data.polygons)
-              console.log(that.data.markers)
-            }else{
-              my.showToast({
-                content: '当前目的地附近暂无还车点',
-                icon:'none'
-              })
-              that.setData({ parking:false})
-              var marker = {};
-              marker.latitude = that.data.latitude;
-              marker.longitude = that.data.longitude;
-              marker.zIndex = 1111;
-              marker.width = 15;
-              marker.height = 27;
-              marker.type = 3;
-              marker.iconPath = '/img/map.png';
-              that.setData({ markers: markers.concat(marker) })
-            }
-          }else{
-            var marker = {};
-            marker.latitude = that.data.latitude;
-            marker.longitude = that.data.longitude;
-            marker.zIndex = 1111;
-            marker.width = 15;
-              marker.height = 27;
-              marker.type = 3;
-              marker.iconPath = '/img/map.png';
-            that.setData({ markers: markers.concat(marker) })
-          }
-        })
-      },
-    })
-  },
-  stop(e){
-    var that = this;
-    var area = this.data.area;
-    var markers = that.data.markers;
-    for (let item of markers) {
-      // console.log(item)
-      if (item.id == e.markerId) {
-        if(item.type==2){
-          item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/orange-stop.png'
-        }
-        if (item.type == 1) {
-          item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/ban-stop.png'
-        }
-      } else {
-        if(item.type==2){
-          if (item.iconPath == '/img/map.png') {
-          } else {
-            item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/stop1.png'
-          }
-        }
-        if (item.type == 1) {
-          item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/ban-stop.png'
-        }
-      }
-    }
-    that.setData({ markers })
-    for (let item of area) {
-      if (item.id == e.markerId) {
-        if(item.type==2){
-          that.setData({ areaTop: item })
-        }
-      }
-    }
-  },
-  selected(e){
-    var that = this;
-    var city = that.data.suggestion;
-    var index = e.currentTarget.dataset.index;
-    that.setData({
-      value:city[index].title,
-      latitude: city[index].latitude,
-      longitude:city[index].longitude,
-      show:false,
-      address: city[index].addr
-    })
-    // this.pointer();
-    that.parkingArea()
-    var animation = my.createAnimation({
-      duration: 1000,//动画的持续时间
-    })
-    this.animation = animation; //将animation变量赋值给当前动画
-    var time1 = setTimeout(function () {
-      that.slideIn();//调用动画--滑入
-      clearTimeout(time1);
-      time1 = null;
-    }, 100)
-  },
-  slideIn: function () {
-    this.animation.translateY(0).step() // 在y轴偏移,然后用step()完成一个动画
-    this.setData({
-      //动画实例的export方法导出动画数据传递给组件的animation属性
-      animationData: this.animation.export()
-    })
-  },
-  slideDown: function () {
-    this.animation.translateY(300).step()
-    this.setData({
-      animationData: this.animation.export(),
-    })
-  },
-  bindregionchange() {
-
-  },
-  location:function(e){
-    console.log(this.data.areaTop)
-    var latitude = this.data.areaTop.latitude;
-    var longitude = this.data.areaTop.longitude;
-    var address = this.data.areaTop.description;
-    var name = this.data.areaTop.name;
-    my.openLocation({//​使用微信内置地图查看位置。
-      latitude: latitude,//要去的纬度-地址
-      longitude: longitude,//要去的经度-地址
-      name: name,
-      address: address
-    })
-  },
-  input(e) {
-    var _this = this;
-    //调用关键词提示接口
-    if (e.detail.value == '') {
-      _this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
-        suggestion: [],
-        show:false,
-        parking:false
-      });
-      return;
-    }
-    if (this.data.value != e.detail.value && e.detail.value!='') {
-      // _this.setData({:false})
-      var animation = my.createAnimation({
-        duration: 1000,//动画的持续时间
-      })
-      this.animation = animation; //将animation变量赋值给当前动画
-      var time1 = setTimeout(function () {
-        _this.slideDown();//调用动画--滑入
-        clearTimeout(time1);
-        time1 = null;
-      }, 100)
-    }
-    _this.setData({ value: e.detail.value })
-    var location=_this.data.latitude+','+_this.data.longitude
-    qqmapsdk.getSuggestion({
-      //获取输入框值并设置keyword参数
-      keyword: e.detail.value, //用户输入的关键词,可设置固定值,如keyword:'KFC'
-      page_size:20,
-      //region:'北京', //设置城市名,限制关键词所示的地域范围,非必填参数
-      location:location,
-      region_fix:1,
-      success: function(res) { //搜索成功后的回调
-        var sug = [];
-        for (var i = 0; i < res.data.length; i++) {
-          sug.push({ // 获取返回结果,放到sug数组中
-            title: res.data[i].title,
-            id: res.data[i].id,
-            addr: res.data[i].address,
-            city: res.data[i].city,
-            district: res.data[i].district,
-            latitude: res.data[i].location.lat,
-            longitude: res.data[i].location.lng
-          });
-        }
-        _this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
-          suggestion: sug,
-          show:true
-        });
-      }
-    });
-  },
-  onReady: function() {
-
-  },
-  onShow: function() {
-
-  },
-  onHide: function() {
-
-  },
-  onUnload: function() {
-
-  },
-  onPullDownRefresh: function() {
-
-  },
-  onReachBottom: function() {
-
-  },
-  onShareAppMessage: function() {
-    
-  }
+var QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js');
+var app = getApp();
+var qqmapsdk = new QQMapWX({
+  key: app.globalData.mapKey // 必填
+});
+Page({
+  data: {
+    longitude: '',
+    latitude: '',
+    suggestion:[],
+    show:false,
+    value:'',
+    parking:false,
+    controls:[],
+    animationData:{},
+    address:'',
+    area:[],
+    polygons:[],
+    areaTop:[],
+    home_polygons: [],
+    markers:[],
+    img:app.globalData.imgUrl
+  },
+  onLoad: function(options) {
+    var that = this;
+    my.getLocation({
+      type: 'gcj02',
+      success: (res) => {
+        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
+        var latitude = res.latitude
+        var longitude = res.longitude
+        that.setData({
+          longitude: longitude,
+          latitude: latitude
+        })
+      },
+      fail: function(err) {
+        console.log(err)
+      }
+    })
+    that.setData({ home_polygons: my.getStorageSync({'key':'home'}).data, polygons: that.data.polygons.concat(my.getStorageSync({'key':'home'}).data)})
+    var data = {
+      'area_id': my.getStorageSync({'key':'home'}).data.id
+    }
+    app.request('/parking/stop-sites', data, 'GET').then(res => {
+      // console.log(res)
+      if (res.status == 200) {
+        var data = res.data
+        that.setData({
+          polygons: that.data.polygons.concat(data.polygons),
+          markers: data.centres
+        })
+        console.log(that.data.polygons)
+      }
+    })
+  },
+  parkingArea:function(){
+    var that = this;
+    my.getLocation({
+      type: 'gcj02',
+      success: function(resp) {
+        var data = {
+          'lat': that.data.latitude,
+          'lng': that.data.longitude,
+          'area_id': my.getStorageSync({'key':'home'}).data.id,
+          'location_lat':resp.latitude,
+          'location_lng':resp.longitude
+        }
+        var markers = that.data.markers;
+        app.request('/parking/nearby', data, 'GET').then(res => {
+          console.log(res)
+          if(res.data.points!=''){
+            that.setData({area:res.data.points,areaTop:res.data.points[0]})
+          }
+          if (res.status == 200) {
+            var data1 = res.data
+            if(data1.polygons.length>0){
+              var array = data1.points;
+              var marker = {};
+              marker.latitude = that.data.latitude;
+              marker.longitude = that.data.longitude;
+              marker.zIndex = 1111;
+              marker.width = 15;
+              marker.height = 27;
+              marker.type = 3;
+              marker.iconPath = '/img/map.png';
+              array = array.concat(marker)
+              that.setData({ polygons: that.data.polygons.concat(data1.polygons), markers: markers.concat(array), parking:true})
+              console.log(that.data.polygons)
+              console.log(that.data.markers)
+            }else{
+              my.showToast({
+                content: '当前目的地附近暂无还车点',
+                icon:'none'
+              })
+              that.setData({ parking:false})
+              var marker = {};
+              marker.latitude = that.data.latitude;
+              marker.longitude = that.data.longitude;
+              marker.zIndex = 1111;
+              marker.width = 15;
+              marker.height = 27;
+              marker.type = 3;
+              marker.iconPath = '/img/map.png';
+              that.setData({ markers: markers.concat(marker) })
+            }
+          }else{
+            var marker = {};
+            marker.latitude = that.data.latitude;
+            marker.longitude = that.data.longitude;
+            marker.zIndex = 1111;
+            marker.width = 15;
+              marker.height = 27;
+              marker.type = 3;
+              marker.iconPath = '/img/map.png';
+            that.setData({ markers: markers.concat(marker) })
+          }
+        })
+      },
+    })
+  },
+  stop(e){
+    var that = this;
+    var area = this.data.area;
+    var markers = that.data.markers;
+    for (let item of markers) {
+      // console.log(item)
+      if (item.id == e.markerId) {
+        if(item.type==2){
+          item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/orange-stop.png'
+        }
+        if (item.type == 1) {
+          item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/ban-stop.png'
+        }
+      } else {
+        if(item.type==2){
+          if (item.iconPath == '/img/map.png') {
+          } else {
+            item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/stop1.png'
+          }
+        }
+        if (item.type == 1) {
+          item.iconPath = 'http://resource.bike.hanyiyun.com/weapp/ban-stop.png'
+        }
+      }
+    }
+    that.setData({ markers })
+    for (let item of area) {
+      if (item.id == e.markerId) {
+        if(item.type==2){
+          that.setData({ areaTop: item })
+        }
+      }
+    }
+  },
+  selected(e){
+    var that = this;
+    var city = that.data.suggestion;
+    var index = e.currentTarget.dataset.index;
+    that.setData({
+      value:city[index].title,
+      latitude: city[index].latitude,
+      longitude:city[index].longitude,
+      show:false,
+      address: city[index].addr
+    })
+    // this.pointer();
+    that.parkingArea()
+    var animation = my.createAnimation({
+      duration: 1000,//动画的持续时间
+    })
+    this.animation = animation; //将animation变量赋值给当前动画
+    var time1 = setTimeout(function () {
+      that.slideIn();//调用动画--滑入
+      clearTimeout(time1);
+      time1 = null;
+    }, 100)
+  },
+  slideIn: function () {
+    this.animation.translateY(0).step() // 在y轴偏移,然后用step()完成一个动画
+    this.setData({
+      //动画实例的export方法导出动画数据传递给组件的animation属性
+      animationData: this.animation.export()
+    })
+  },
+  slideDown: function () {
+    this.animation.translateY(300).step()
+    this.setData({
+      animationData: this.animation.export(),
+    })
+  },
+  bindregionchange() {
+
+  },
+  location:function(e){
+    console.log(this.data.areaTop)
+    var latitude = this.data.areaTop.latitude;
+    var longitude = this.data.areaTop.longitude;
+    var address = this.data.areaTop.description;
+    var name = this.data.areaTop.name;
+    my.openLocation({//​使用微信内置地图查看位置。
+      latitude: latitude,//要去的纬度-地址
+      longitude: longitude,//要去的经度-地址
+      name: name,
+      address: address
+    })
+  },
+  input(e) {
+    var _this = this;
+    //调用关键词提示接口
+    if (e.detail.value == '') {
+      _this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
+        suggestion: [],
+        show:false,
+        parking:false
+      });
+      return;
+    }
+    if (this.data.value != e.detail.value && e.detail.value!='') {
+      // _this.setData({:false})
+      var animation = my.createAnimation({
+        duration: 1000,//动画的持续时间
+      })
+      this.animation = animation; //将animation变量赋值给当前动画
+      var time1 = setTimeout(function () {
+        _this.slideDown();//调用动画--滑入
+        clearTimeout(time1);
+        time1 = null;
+      }, 100)
+    }
+    _this.setData({ value: e.detail.value })
+    var location=_this.data.latitude+','+_this.data.longitude
+    qqmapsdk.getSuggestion({
+      //获取输入框值并设置keyword参数
+      keyword: e.detail.value, //用户输入的关键词,可设置固定值,如keyword:'KFC'
+      page_size:20,
+      //region:'北京', //设置城市名,限制关键词所示的地域范围,非必填参数
+      location:location,
+      region_fix:1,
+      success: function(res) { //搜索成功后的回调
+        var sug = [];
+        for (var i = 0; i < res.data.length; i++) {
+          sug.push({ // 获取返回结果,放到sug数组中
+            title: res.data[i].title,
+            id: res.data[i].id,
+            addr: res.data[i].address,
+            city: res.data[i].city,
+            district: res.data[i].district,
+            latitude: res.data[i].location.lat,
+            longitude: res.data[i].location.lng
+          });
+        }
+        _this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
+          suggestion: sug,
+          show:true
+        });
+      }
+    });
+  },
+  onReady: function() {
+
+  },
+  onShow: function() {
+
+  },
+  onHide: function() {
+
+  },
+  onUnload: function() {
+
+  },
+  onPullDownRefresh: function() {
+
+  },
+  onReachBottom: function() {
+
+  },
+  onShareAppMessage: function() {
+    
+  }
 })

+ 1 - 1
pages/parking/parking.json

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

+ 7 - 7
pages/pay/pay.js

@@ -140,7 +140,7 @@ Page({
         app.request(url + '/pay', data, 'POST').then(res => {
           console.log(res)
           //获取支付参数
-          if (res.statusCode == 200) {
+          if (res.status == 200) {
             if (res.data.pay_order_status == true) {
               my.reLaunch({
                 url: '/pages/index/index',
@@ -191,7 +191,7 @@ Page({
         console.log(res)
         app.request('/order/retry-close-lock?order_no=' + that.data.date.orders.no + '&bike_no=' + that.data.date.orders.bike_no, '', 'GET').then(res => {
           console.log(res)
-          if (res.statusCode == 200) {
+          if (res.status == 200) {
             my.hideLoading()
             if (res.data.status == 1) {
               my.showToast({
@@ -230,7 +230,7 @@ Page({
     console.log(that.data.coupon)
     app.request('/coupon/getCouponsByOrder?order_no=' + that.data.order, '', 'GET').then(res => {
       console.log(res)
-      if (res.statusCode == 200) {
+      if (res.status == 200) {
         that.setData({
           coupon: res.data
         })
@@ -337,7 +337,7 @@ Page({
     })
     app.request(url + '/pay-show?order_no=' + that.data.order + '&coupon_user_bags_id=' + id, '', 'GET').then(res => {
       console.log(res)
-      if (res.statusCode == 200) {
+      if (res.status == 200) {
         my.hideLoading()
         that.setData({
           date: res.data,
@@ -386,7 +386,7 @@ Page({
       app.request(url + '/pay', data, 'POST').then(res => {
         console.log(res)
         //获取支付参数
-        if (res.statusCode == 200) {
+        if (res.status == 200) {
           if (that.data.index == 1) {
             my.tradePay({
               tradeNO: res.data.tradeNo,
@@ -441,7 +441,7 @@ Page({
   },
   phone: function (e) {
     my.makePhoneCall({
-      phoneNumber: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
     })
   },
   onReady: function () {
@@ -467,7 +467,7 @@ Page({
     })
     app.request(url + '/pay-show?order_no=' + that.data.order + '&is_first=true', '', 'GET').then(res => {
       console.log(res)
-      if (res.statusCode == 200) {
+      if (res.status == 200) {
 
         that.setData({
           date: res.data,

+ 1 - 1
pages/pay/pay.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "订单支付",
+  "defaultTitle": "订单支付",
   "navigationStyle":"custom",
   "enablePullDownRefresh": true
 }

+ 1 - 1
pages/pay_success/pay_success.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "支付成功"
+  "defaultTitle": "支付成功"
 }
  

+ 1 - 1
pages/phone_verif/phone_verif.js

@@ -29,7 +29,7 @@ Page({
       that.setData({
         currentTime:60
       })
-      if (res.statusCode == 200) {
+      if (res.status == 200) {
       that.countDown()
         
       }

+ 180 - 180
pages/real_name/real_name.js

@@ -1,181 +1,181 @@
-// pages/real_name/real_name.js
-const app = getApp();
-const util = require('../../utils/utils.js');
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    frameShow: false,
-    cardVal: '',//身份证号
-    nameVal: '',//姓名
-    mobile:''
-
-  },
-  onLoad: function (options) {
-    this.setData({
-      mobile: my.getStorageSync({'key':'userInfo'}).data.mobile
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  },
-  frameClose: function () {
-    let that = this
-    that.setData({
-      frameShow: false
-    })
-  },
-  //验证名字
-  ckName(e) {
-    this.setData({
-      nameVal: e.detail.value
-    })
-  },
-  name(e) {
-    this.setData({
-      nameVal: e.detail.value
-    })
-  },
-  namefirm(e) {
-    this.setData({
-      nameVal: e.detail.value
-    })
-  },
-  //验证身份证号
-  ckCard(e) {
-    this.setData({
-      cardVal: e.detail.value
-    })
-  },
-  input(e) {
-    this.setData({
-      cardVal: e.detail.value
-    })
-  },
-  valuefirm(e) {
-    this.setData({
-      cardVal: e.detail.value
-    })
-  },
-  // sureSubmit:function(){
-  //   my.reLaunch({
-  //     url: '/pages/index/index',
-  //   })
-  // },
-  changeMobile: function () {
-    my.navigateTo({
-      url: '/pages/my_account/my_account',
-    })
-  },
-  //提交申请按钮
-  sureSubmit: util.throttle(function () {
-    let reg = /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/;
-    let reg1 = /^[\u4E00-\u9FA5]{2,4}$/;
-    var that = this;
-    if (!reg1.test(this.data.nameVal)) {
-      my.showToast({
-        content: '请输入正确的姓名',
-        icon: 'none',
-        duration: 2000
-      })
-    } else if (!reg.test(this.data.cardVal)) {
-      my.showToast({
-        content: '请输入正确的身份证号',
-        icon: 'none',
-        duration: 2000
-      })
-    } else {
-      that.checkIDCard(that.data.cardVal)
-    }
-  }, 1000),
-  // 一键获取手机号
-  checkIDCard(idcode) {
-    // 加权因子
-    var that = this;
-    var weight_factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
-    // 校验码
-    var check_code = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
-    var code = idcode + ''
-    var last = idcode[17] //最后一位
-    var seventeen = code.substring(0, 17)
-    // ISO 7064:1983.MOD 11-2
-    // 判断最后一位校验码是否正确
-    var arr = seventeen.split('')
-    var len = arr.length
-    var num = 0
-    for (var i = 0; i < len; i++) {
-      num = num + arr[i] * weight_factor[i]
-    }
-    // 获取余数
-    var resisue = num % 11
-    var last_no = check_code[resisue]
-    var idcard_patter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/
-    // 判断格式是否正确
-    var format = idcard_patter.test(idcode)
-    console.log(format)
-    console.log(last)
-    console.log(last_no)
-    // 返回验证结果,校验码和格式同时正确才算是合法的身份证号码
-    if (last == last_no && format == true) {
-      my.showLoading({
-        content: '认证中...',
-        mask: true
-      })
-      if (app.globalData.req) {
-        let data = {
-          card_id: that.data.cardVal,
-          name: that.data.nameVal
-        }
-        app.request('/user/real-name-authentication', data, 'POST', app.globalData.req).then(res => {
-          console.log(res)
-          if (res.statusCode == 200) {
-            my.hideLoading()
-           my.alert({
-             title:'提示',
-             content:'实名认证成功,祝您用车愉快',
-             showCancel:false,
-             success (res) {
-                my.navigateBack()
-            }
-          })
-         
-          
-          }
-        }).catch(err => {
-          console.log(err)
-        })
-      } else {
-        my.showToast({
-          content: '您的操作过于频繁,请稍后再试~',
-          icon: 'none'
-        })
-      }
-    } else {
-      my.showToast({
-        content: '身份证号输入有误~',
-        icon: 'none'
-      })
-    }
-
-  },
+// pages/real_name/real_name.js
+const app = getApp();
+const util = require('../../utils/utils.js');
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    frameShow: false,
+    cardVal: '',//身份证号
+    nameVal: '',//姓名
+    mobile:''
+
+  },
+  onLoad: function (options) {
+    this.setData({
+      mobile: my.getStorageSync({'key':'userInfo'}).data.mobile
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+  frameClose: function () {
+    let that = this
+    that.setData({
+      frameShow: false
+    })
+  },
+  //验证名字
+  ckName(e) {
+    this.setData({
+      nameVal: e.detail.value
+    })
+  },
+  name(e) {
+    this.setData({
+      nameVal: e.detail.value
+    })
+  },
+  namefirm(e) {
+    this.setData({
+      nameVal: e.detail.value
+    })
+  },
+  //验证身份证号
+  ckCard(e) {
+    this.setData({
+      cardVal: e.detail.value
+    })
+  },
+  input(e) {
+    this.setData({
+      cardVal: e.detail.value
+    })
+  },
+  valuefirm(e) {
+    this.setData({
+      cardVal: e.detail.value
+    })
+  },
+  // sureSubmit:function(){
+  //   my.reLaunch({
+  //     url: '/pages/index/index',
+  //   })
+  // },
+  changeMobile: function () {
+    my.navigateTo({
+      url: '/pages/my_account/my_account',
+    })
+  },
+  //提交申请按钮
+  sureSubmit: util.throttle(function () {
+    let reg = /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/;
+    let reg1 = /^[\u4E00-\u9FA5]{2,4}$/;
+    var that = this;
+    if (!reg1.test(this.data.nameVal)) {
+      my.showToast({
+        content: '请输入正确的姓名',
+        icon: 'none',
+        duration: 2000
+      })
+    } else if (!reg.test(this.data.cardVal)) {
+      my.showToast({
+        content: '请输入正确的身份证号',
+        icon: 'none',
+        duration: 2000
+      })
+    } else {
+      that.checkIDCard(that.data.cardVal)
+    }
+  }, 1000),
+  // 一键获取手机号
+  checkIDCard(idcode) {
+    // 加权因子
+    var that = this;
+    var weight_factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
+    // 校验码
+    var check_code = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
+    var code = idcode + ''
+    var last = idcode[17] //最后一位
+    var seventeen = code.substring(0, 17)
+    // ISO 7064:1983.MOD 11-2
+    // 判断最后一位校验码是否正确
+    var arr = seventeen.split('')
+    var len = arr.length
+    var num = 0
+    for (var i = 0; i < len; i++) {
+      num = num + arr[i] * weight_factor[i]
+    }
+    // 获取余数
+    var resisue = num % 11
+    var last_no = check_code[resisue]
+    var idcard_patter = /^[1-9][0-9]{5}([1][9][0-9]{2}|[2][0][0|1][0-9])([0][1-9]|[1][0|1|2])([0][1-9]|[1|2][0-9]|[3][0|1])[0-9]{3}([0-9]|[X])$/
+    // 判断格式是否正确
+    var format = idcard_patter.test(idcode)
+    console.log(format)
+    console.log(last)
+    console.log(last_no)
+    // 返回验证结果,校验码和格式同时正确才算是合法的身份证号码
+    if (last == last_no && format == true) {
+      my.showLoading({
+        content: '认证中...',
+        mask: true
+      })
+      if (app.globalData.req) {
+        let data = {
+          card_id: that.data.cardVal,
+          name: that.data.nameVal
+        }
+        app.request('/user/real-name-authentication', data, 'POST', app.globalData.req).then(res => {
+          console.log(res)
+          if (res.status == 200) {
+            my.hideLoading()
+           my.alert({
+             title:'提示',
+             content:'实名认证成功,祝您用车愉快',
+             showCancel:false,
+             success (res) {
+                my.navigateBack()
+            }
+          })
+         
+          
+          }
+        }).catch(err => {
+          console.log(err)
+        })
+      } else {
+        my.showToast({
+          content: '您的操作过于频繁,请稍后再试~',
+          icon: 'none'
+        })
+      }
+    } else {
+      my.showToast({
+        content: '身份证号输入有误~',
+        icon: 'none'
+      })
+    }
+
+  },
 })

+ 1 - 1
pages/real_name/real_name.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "实名认证"
+  "defaultTitle": "实名认证"
 }

+ 80 - 80
pages/refund_success/refund_success.js

@@ -1,81 +1,81 @@
-const util = require('../../utils/utils.js')
-let videoAd = null;
-var app = getApp();
-Page({
-  data: {
-    img:app.globalData.imgUrl,
-    number:''
-  },
-  onLoad: function (options) {
-    this.setData({number:options.number})
-    // if (my.createRewardedVideoAd) {
-    //   videoAd = my.createRewardedVideoAd({
-    //     adUnitId: 'adunit-edc5c4664389a87a'
-    //   })
-    //   videoAd.onLoad(() => {})
-    //   videoAd.onError((err) => {})
-    //   videoAd.onClose((res) => {
-    //     if (res && res.isEnded || res === undefined) {
-    //       app.request('/deposit/refund', '', 'POST').then(res => {
-    //         console.log(res);
-    //         if (res.statusCode == 200) {
-    //           my.showToast({
-    //             content: '加速成功,稍后到账',
-    //             icon:'none'
-    //           })
-    //         }
-    //       })
-    //     } else {
-    //       my.showToast({
-    //         content: '加速失败!',
-    //         icon:'none'
-    //       })
-    //     }
-    //   })
-    // }
-  },
-  home: util.throttle(function (e) {
-    if(app.globalData.compatible){
-      my.reLaunch({
-        url: '/pages/compatible/index/index',
-      })
-    }else{
-      my.reLaunch({
-        url: '/pages/index/index',
-      })
-    }
-  },1000),
-  ad(){
-    if (videoAd) {
-      videoAd.show().catch(() => {
-        // 失败重试
-        videoAd.load()
-          .then(() => videoAd.show())
-          .catch(err => {
-            console.log('激励视频 广告显示失败')
-          })
-      })
-    }
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-    
-  }
+const util = require('../../utils/utils.js')
+let videoAd = null;
+var app = getApp();
+Page({
+  data: {
+    img:app.globalData.imgUrl,
+    number:''
+  },
+  onLoad: function (options) {
+    this.setData({number:options.number})
+    // if (my.createRewardedVideoAd) {
+    //   videoAd = my.createRewardedVideoAd({
+    //     adUnitId: 'adunit-edc5c4664389a87a'
+    //   })
+    //   videoAd.onLoad(() => {})
+    //   videoAd.onError((err) => {})
+    //   videoAd.onClose((res) => {
+    //     if (res && res.isEnded || res === undefined) {
+    //       app.request('/deposit/refund', '', 'POST').then(res => {
+    //         console.log(res);
+    //         if (res.status == 200) {
+    //           my.showToast({
+    //             content: '加速成功,稍后到账',
+    //             icon:'none'
+    //           })
+    //         }
+    //       })
+    //     } else {
+    //       my.showToast({
+    //         content: '加速失败!',
+    //         icon:'none'
+    //       })
+    //     }
+    //   })
+    // }
+  },
+  home: util.throttle(function (e) {
+    if(app.globalData.compatible){
+      my.reLaunch({
+        url: '/pages/compatible/index/index',
+      })
+    }else{
+      my.reLaunch({
+        url: '/pages/index/index',
+      })
+    }
+  },1000),
+  ad(){
+    if (videoAd) {
+      videoAd.show().catch(() => {
+        // 失败重试
+        videoAd.load()
+          .then(() => videoAd.show())
+          .catch(err => {
+            console.log('激励视频 广告显示失败')
+          })
+      })
+    }
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+    
+  }
 })

+ 1 - 1
pages/refund_success/refund_success.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "申请成功"
+  "defaultTitle": "申请成功"
 }

+ 1 - 1
pages/ride_rule/ride_rule.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "骑行须知"
+  "defaultTitle": "骑行须知"
 }

+ 47 - 47
pages/ride_zige/ride_zige.axml

@@ -1,48 +1,48 @@
-<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-text"> 退回后您将无法使用车辆且账户将被冻结,至缴纳押金或购买免押金卡后再次使用</view>
-      <view class="frame-buttom" onTap="sureBack">立即退还</view>
-    </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" >
-      <view class="item-left">
-        <view class="card-title">
-         <text>{{item.name}}</text><text class="tip">特惠精选</text></view>
-        <view class="card-text">有效期{{item.effective_days}}天</view>
-      </view>
-      <view class="item-right">
-        <view class="card-title">{{item.discounted_price}}元</view>
-        <view class="card-text">原价{{item.price}}</view>
-      </view>
-    </view>
-  </view>
-  <view class="card-list" >
-    <view class="list-title">交押金用车</view>
-    <view class="card-item" class="{{currentItem==0 ? 'active' :'card-item'}}"   data-id='0' onTap="changeCard">
-      <view class="item-left">
-        <view class="card-title">押金</view>
-        <view class="card-text">随时可退 | 极速到账</view>
-      </view>
-      <view class="item-right">
-        <view class="card-title">{{deposit.deposit_type==1? '已缴纳' : depositMoney + '元'}}</view>
-      </view>
-    </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="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-text"> 退回后您将无法使用车辆且账户将被冻结,至缴纳押金或购买免押金卡后再次使用</view>
+      <view class="frame-buttom" onTap="sureBack">立即退还</view>
+    </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" >
+      <view class="item-left">
+        <view class="card-title">
+         <text>{{item.name}}</text><text class="tip">特惠精选</text></view>
+        <view class="card-text">有效期{{item.effective_days}}天</view>
+      </view>
+      <view class="item-right">
+        <view class="card-title">{{item.discounted_price}}元</view>
+        <view class="card-text">原价{{item.price}}</view>
+      </view>
+    </view>
+  </view>
+  <view class="card-list" >
+    <view class="list-title">交押金用车</view>
+    <view class="card-item" class="{{currentItem==0 ? 'active' :'card-item'}}"   data-id="0" onTap="changeCard">
+      <view class="item-left">
+        <view class="card-title">押金</view>
+        <view class="card-text">随时可退 | 极速到账</view>
+      </view>
+      <view class="item-right">
+        <view class="card-title">{{deposit.deposit_type==1? '已缴纳' : depositMoney + '元'}}</view>
+      </view>
+    </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>

+ 235 - 239
pages/ride_zige/ride_zige.js

@@ -1,240 +1,236 @@
-// pages/ride_zige/ride_zige.js
-const util = require('../../utils/utils');
-var app = getApp()
-var url = ''
-Page({
-  data: {
-    currentItem: 0,
-    cardList: [],//骑行卡列表
-    deposit: '',//骑行卡
-    depositMoney: '',//押金金额
-    frame: false,//确认退还退押金弹框
-
-  },
-  onLoad: function (options) {
-    let deposit = my.getStorageSync({'key':'userState'}).data
-    this.setData({
-      deposit: my.getStorageSync({'key':'userState'}).data,
-      depositMoney: my.getStorageSync({'key':'setting'}).data.deposit
-    })
-
-    this.getCard()
-    // this.getState()
-  },
-
-  //获取免押金卡列表
-  getCard() {
-    my.showLoading({})
-    let data = {
-      area_id: my.getStorageSync({'key':'home'}).data.id
-    }
-    if (my.getStorageSync({'key':'home'}).data.id == undefined) {
-      my.hideLoading()
-      my.showToast({
-        content: '您附近没有运营区域',
-        icon: 'none'
-      })
-    } else {
-      //免押金卡
-      app.request('/deposit_card/index', data, 'GET').then(res => {
-
-        console.log(res.data);
-        this.setData({
-          cardList: res.data.data
-        })
-        my.hideLoading({
-          complete: (res) => { },
-        })
-        console.log(this.data.cardList)
-      })
-    }
-
-  },
-  //选择骑行卡类型
-  changeCard: function (e) {
-    let that = this
-    let id = e.currentTarget.dataset.id
-    that.setData({
-      currentItem: id
-    })
-    // if(id==0){
-    // }else if (that.data.deposit.is_deposit == 1 && that.data.deposit.deposit_type == 1) {
-    //   my.showToast({
-    //     content: '您已缴纳押金无需购买免押金卡',
-    //     icon: 'none'
-    //   })
-    //   return;
-    // }
-  },
-  //立即支付
-  pay: util.throttle(function (e) {
-    console.log('支付')
-    var that = this;
-    let url = '';
-    var data = '';
-    if (app.globalData.req) {
-      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
-        }
-      }
-      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.statusCode == 200) {
-            console.log(res)
-            my.requestPayment({
-              timeStamp: res.data.timeStamp.toString(),
-              nonceStr: res.data.nonceStr,
-              package: res.data.package,
-              signType: res.data.signType,
-              paySign: res.data.paySign,
-              success(res) {
-                console.log(res)
-                let init = '';
-                if (that.data.depShow) {
-                  init = "购买成功"
-                } else {
-                  init = "支付成功"
-                }
-                my.showToast({
-                  content: init,
-                  icon: 'none',
-                  duration: 1000,
-                  success: function () {
-                    my.reLaunch({
-                      url: '/pages/depochenSuce/depoSuce',
-                    })
-                  }
-                })
-                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
-            })
-          }
-        })
-      }
-    } else {
-      my.showToast({
-        content: '您的操作过于频繁,请稍后再试~',
-        icon: 'none'
-      })
-    }
-
-  }, 1000),
-  //退还押金
-  backDeposit: function () {
-    this.setData({
-      frame: true
-    })
-  },
-  closeFrame: function () {
-    this.setData({
-      frame: false
-    })
-  },
-  //立即退还
-  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.statusCode == 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 => {
-        console.log(res);
-        if (res.statusCode == 200) {
-          my.showToast({
-            content: '申请成功,1个工作日内到账!',
-            icon: 'none'
-          })
-          setTimeout(function(){
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          },1500)
-          // this.getState()
-        }
-      })
-    }
-  }, 1000),
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+// pages/ride_zige/ride_zige.js
+const util = require('../../utils/utils');
+var app = getApp()
+var url = ''
+Page({
+  data: {
+    currentItem: 0,
+    cardList: [],//骑行卡列表
+    deposit: '',//骑行卡
+    depositMoney: '',//押金金额
+    frame: false,//确认退还退押金弹框
+
+  },
+  onLoad: function (options) {
+    let deposit = my.getStorageSync({'key':'userState'}).data
+    this.setData({
+      deposit: my.getStorageSync({'key':'userState'}).data,
+      depositMoney: my.getStorageSync({'key':'setting'}).data.deposit
+    })
+
+    this.getCard()
+    // this.getState()
+  },
+
+  //获取免押金卡列表
+  getCard() {
+    my.showLoading({})
+    let data = {
+      area_id: my.getStorageSync({'key':'home'}).data.id
+    }
+    if (my.getStorageSync({'key':'home'}).data.id == undefined) {
+      my.hideLoading()
+      my.showToast({
+        content: '您附近没有运营区域',
+        icon: 'none'
+      })
+    } else {
+      //免押金卡
+      app.request('/deposit_card/index', data, 'GET').then(res => {
+
+        console.log(res.data);
+        this.setData({
+          cardList: res.data.data
+        })
+        my.hideLoading({
+          complete: (res) => { },
+        })
+        console.log(this.data.cardList)
+      })
+    }
+
+  },
+  //选择骑行卡类型
+  changeCard: function (e) {
+    let that = this
+    let id = e.currentTarget.dataset.id
+    that.setData({
+      currentItem: id
+    })
+    // if(id==0){
+    // }else if (that.data.deposit.is_deposit == 1 && that.data.deposit.deposit_type == 1) {
+    //   my.showToast({
+    //     content: '您已缴纳押金无需购买免押金卡',
+    //     icon: 'none'
+    //   })
+    //   return;
+    // }
+  },
+  //立即支付
+  pay: util.throttle(function (e) {
+    console.log('支付')
+    var that = this;
+    let url = '';
+    var data = '';
+    if (app.globalData.req) {
+      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
+        }
+      }
+      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)
+           my.tradePay({
+            tradeNO: res.data.tradeNo,
+              success(res) {
+                console.log(res)
+                let init = '';
+                if (that.data.depShow) {
+                  init = "购买成功"
+                } else {
+                  init = "支付成功"
+                }
+                my.showToast({
+                  content: init,
+                  icon: 'none',
+                  duration: 1000,
+                  success: function () {
+                    my.reLaunch({
+                      url: '/pages/depochenSuce/depoSuce',
+                    })
+                  }
+                })
+                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
+            })
+          }
+        })
+      }
+    } else {
+      my.showToast({
+        content: '您的操作过于频繁,请稍后再试~',
+        icon: 'none'
+      })
+    }
+
+  }, 1000),
+  //退还押金
+  backDeposit: function () {
+    this.setData({
+      frame: true
+    })
+  },
+  closeFrame: function () {
+    this.setData({
+      frame: false
+    })
+  },
+  //立即退还
+  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 => {
+        console.log(res);
+        if (res.status == 200) {
+          my.showToast({
+            content: '申请成功,1个工作日内到账!',
+            icon: 'none'
+          })
+          setTimeout(function(){
+            my.reLaunch({
+              url: '/pages/index/index',
+            })
+          },1500)
+          // this.getState()
+        }
+      })
+    }
+  }, 1000),
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 1 - 1
pages/ride_zige/ride_zige.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "获取骑行资格"
+  "defaultTitle": "获取骑行资格"
 }

+ 2 - 1
pages/trip/trip.acss

@@ -3,6 +3,7 @@
 page{
   background-color: #f2f3f5;
   padding-bottom: 30rpx;
+  /* height: 100%; */
 }
 .trip-list{
 margin: 0 20rpx;
@@ -97,7 +98,7 @@ margin-top: 30rpx;
 }
 .none{
 text-align: center;
-margin-top: 40%;
+padding-top: 40%;
 }
 .none image{
   height: 100rpx;

+ 2 - 2
pages/trip/trip.axml

@@ -6,8 +6,8 @@
         <view class="title-right"> 
         <text a:if="{{item.status==1}}">骑行中</text>
           <text a:if="{{item.status==2}}" style="color:#18D5B9;">待支付</text>
-          <text a:if="{{item.status==3}}">行程完成</text>
-          <text a:if="{{item.status==4}}" style="color:#F4915B;">行程关闭</text>
+          <text a:if="{{item.status==3}}">defaultTitle完成</text>
+          <text a:if="{{item.status==4}}" style="color:#F4915B;">defaultTitle关闭</text>
           <text a:if="{{item.status==0}}">临时停车</text>
           <text class="iconfont icon-iconfontjiantou2"></text></view>
       </view>

+ 116 - 116
pages/trip/trip.js

@@ -1,117 +1,117 @@
-// pages/trip/trip.js
-var app = getApp()
-const util = require('../../utils/utils.js')
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    orderList: [],
-    pages: 1,//页码
-    links:'',//下一页地址
-  },
-  onLoad: function (options) {
-    this.initial()
-  },
-  initial: util.throttle(function (e) {
-    var that = this;
-    my.showLoading({
-      content: '加载中...',
-      mask: true
-    })
-
-    if (app.globalData.req) {
-      that.getOrder()
-    }
-
-  }, 1000),
-  //获取订单列表
-  getOrder: function () {
-    let that = this
-    let data = {
-      page: that.data.pages
-    }
-    app.request('/orders', data, 'GET', app.globalData.req).then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        let arr=res.data.data
-        var orderList =that.data.orderList.concat(arr);
-        if(arr.length==0){
-          my.showToast({
-            content: '暂无更多~',
-            icon:'none'
-          })
-        }else{
-          
-          that.setData({
-            orderList,
-            links:res.data.meta.pagination.links
-          })
-        }
-      
-        my.hideLoading({
-          complete: (res) => { },
-        })
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-
-  //跳转订单详情页面
-
-  tripDetail: function (e) {
-    console.log(e, 'ppppppp')
-    let status = e.currentTarget.dataset.index.status
-    let order_no = e.currentTarget.dataset.index.no
-    if (status == 2) {
-      my.navigateTo({
-        url: '/pages/pay/pay?order=' + order_no,
-      })
-    } else {
-      my.navigateTo({
-        url: '/pages/trip_detail/trip_detail?order_no=' + order_no,
-      })
-    }
-
-  },
-  //下拉刷新
-  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.getOrder()
-    }
-    
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-
-  onShareAppMessage: function () {
-
-  },
-
+// pages/trip/trip.js
+var app = getApp()
+const util = require('../../utils/utils.js')
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    orderList: [],
+    pages: 1,//页码
+    links:'',//下一页地址
+  },
+  onLoad: function (options) {
+    this.initial()
+  },
+  initial: util.throttle(function (e) {
+    var that = this;
+    my.showLoading({
+      content: '加载中...',
+      mask: true
+    })
+
+    if (app.globalData.req) {
+      that.getOrder()
+    }
+
+  }, 1000),
+  //获取订单列表
+  getOrder: function () {
+    let that = this
+    let data = {
+      page: that.data.pages
+    }
+    app.request('/orders', data, 'GET', app.globalData.req).then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        let arr=res.data.data
+        var orderList =that.data.orderList.concat(arr);
+        if(arr.length==0){
+          my.showToast({
+            content: '暂无更多~',
+            icon:'none'
+          })
+        }else{
+          
+          that.setData({
+            orderList,
+            links:res.data.meta.pagination.links
+          })
+        }
+      
+        my.hideLoading({
+          complete: (res) => { },
+        })
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+
+  //跳转订单详情页面
+
+  tripDetail: function (e) {
+    console.log(e, 'ppppppp')
+    let status = e.currentTarget.dataset.index.status
+    let order_no = e.currentTarget.dataset.index.no
+    if (status == 2) {
+      my.navigateTo({
+        url: '/pages/pay/pay?order=' + order_no,
+      })
+    } else {
+      my.navigateTo({
+        url: '/pages/trip_detail/trip_detail?order_no=' + order_no,
+      })
+    }
+
+  },
+  //下拉刷新
+  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.getOrder()
+    }
+    
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+
+  onShareAppMessage: function () {
+
+  },
+
 })

+ 1 - 1
pages/trip/trip.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "行程列表"
+  "defaultTitle": "行程列表"
 }

+ 1 - 1
pages/trip_detail/trip_detail.axml

@@ -1,6 +1,6 @@
 <view class="trip-detail">
   <view class="top-map">
-    <view class="top-map-title">本单实际行程信息</view>
+    <view class="top-map-title">本单实际defaultTitle信息</view>
     <map name="" id="map" markers="{{markers}}" latitude="{{latitude}}" longitude="{{longitude}}"
       polyline="{{polyline}}"></map>
   </view>

+ 2 - 2
pages/trip_detail/trip_detail.js

@@ -83,7 +83,7 @@ Page({
     console.log(that.data.url)
     app.request('/order?order_no=' + order_no+'&include=locations','','GET').then(res=>{
       console.log(res)
-      if(res.statusCode == 200){
+      if(res.status == 200){
         my.hideLoading()
         that.setData({ date: res.data });
         let points = res.data.locations.data;
@@ -130,7 +130,7 @@ Page({
   //不认可收费
   noAgree:function(){
     my.makePhoneCall({
-      phoneNumber:my.getStorageSync({'key':'home'}).data.customer_service_phone,
+      number:my.getStorageSync({'key':'home'}).data.customer_service_phone,
     })
   },
   onReady: function () {

+ 990 - 990
pages/use_bike/use_bike.js

@@ -1,991 +1,991 @@
-
-var app = getApp()
-var interval;
-var inter1;
-var locationTerval;
-var huancheTime;
-var coundDown;//运动中不可锁车倒计时
-var linshiStop;//临时停车倒计时
-const util = require('../../utils/utils.js');
-var interval;
-//蓝牙操作方法
-var BluetoothOperate = require('../../service/bluetooth.js');
-const { content } = require('../../service/dataTransition.js');
-let bluetoothOperate = new BluetoothOperate();
-let machineNO = "" //设备编号
-let key = "" //蓝牙密钥
-let operateType = ''  //'open'开锁 'close'上锁 'bell'寻铃 'temporaryClose'临时锁车 'temporaryOpen'临时锁车开车
-
-Page({
-  data: {
-    nowBikeStatus: '',//当前车辆的状态
-    money: {time_money:0,dispatch_money:0,total_money:0},//骑行费用
-    steps: 1,//开锁步骤
-    parkStatus: 0,//骑行中:0,临时停车:1,点击结束用车:2
-    frame: false,//车辆未开锁弹框
-    code: '',//车辆编码
-    bikeMessage: '',//车辆信息
-    times: '00:00', //当前骑行时间
-    estimate_money: '--', //预计金额
-    minute: '', //骑行总时间秒
-    data: [],
-    box_no: '',
-    screenHeight: '',
-    change: false,
-    timing: 5,
-    isShow: false,
-    minute1: '',
-    parke: true,
-    timeout: 15,
-    retry: '',
-    bikePosition: false,
-    battery_power: '--',
-    huanche_timeout: 0,
-    img: app.globalData.imgUrl,
-    title: app.globalData.title,
-    stopmMinute: 30,//临时停车时间
-    stopMiao: 0,
-    chaButton: 0,//0 不显示 1显示
-    markers: [],
-    polygons: [],
-    polygons1: [],
-    zoom: 18,
-    temporaryTime: '',//临时锁车时间
-    background: false,//位置权限弹框
-    location: false,//位置权限弹框
-    coundDownTime: 5,//运动中不可锁车倒计时
-    countTimeShow: false,
-    dispatch_money:0,//调度费
-
-  },
-  onShow: function () {
-    let that = this
-    that.posiLoca()
-    if (that.data.order != undefined) {
-      that.chushi()
-    }
-  },
-  onLoad: function (options) {
-    let that = this
-    let token = my.getStorageSync({'key':'token'}).data
-    let data = Math.round(new Date().getTime() / 1000).toString();;
-    let tokenTime = my.getStorageSync({'key':'token_time'}).data
-    let cha = data - tokenTime
-    let data1 = 60 * 60 * 24
-    if (!token) {
-      that.token()
-    } else if (cha > data1) {
-      my.removeStorageSync({'key':'token'}).data
-      that.token()
-    } else {
-      console.log(options, 'order_no')
-      let home = my.getStorageSync({'key':'home'}).data
-      that.posiLoca();
-      let area_id = home.id
-      that.ban_stop(area_id)
-      if (options.order != undefined) {
-        that.setData({
-          order: options.order,
-        })
-        that.chushi()
-      }
-      if (options.code != undefined) {
-        that.setData({
-          code: options.code
-        })
-        this.getBikeMessage(options)
-      }
-
-      this.setData({
-        code: options.code
-      })
-    }
-    my.onLocationChange(function (res) {
-      console.log(res, '实时监听位置')
-      that.setData({
-        longitude: res.longitude,
-        latitude: res.latitude,
-      })
-    })
-    my.startLocationUpdate({
-      success: (res) => {
-        console.log(res, '启动位置跟踪')
-      },
-
-    })
-  },
-   //获取token
-   token: function () {
-    my.login({
-      success: function (res) {
-        var data = {
-          'code': res.code,
-          'appid': app.globalData.appid,
-          'invite_user_id': app.globalData.id,
-          'language': 'zh'
-        };
-        app.request('/auth/weapp-login', data, 'post').then(res => {
-          my.setStorageSync({'key':'token',data:res.data.token});
-          my.setStorageSync({'key':'session_key',data:res.data.session_key});
-          my.setStorageSync({'key':'token_time',data:res.data.exp});
-          my.setStorageSync({'key':'user_ID', data:res.data.user.id});
-        })
-      }})
-  },
-  //停车区域
-  ban_stop: function (area_id) {
-    var that = this;
-    let home = my.getStorageSync({'key':'home'}).data
-    that.setData({
-      polygons1: that.data.polygons1.concat(home)
-    })
-    var data1 = {
-      'area_id': area_id
-    }
-    app.request('/parking/stop-sites', data1, 'GET').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        var data = res.data
-        console.log(data)
-        that.setData({
-          markers: that.data.markers.concat(data.centres),
-          polygons: that.data.polygons1.concat(data.polygons),
-          // polygons:data.polygons,
-        })
-      }
-    })
-  },
-  //初始化信息
-  chushi: function () {
-    my.showLoading()
-    var that = this;
-    var date = Date.parse(new Date()) / 1000;
-    app.request('/pages/ride-order?no=' + that.data.order, '', 'GET').then(res => {
-      console.log(res, ',---------')
-      if (res.statusCode == 200) {
-        my.hideLoading()
-        my.setStorageSync({'key':'bike_status',data: res.data.status})
-
-        if (res.data.start_use_bike_time <= 0) {
-          that.setData({
-            minute: 0
-          })
-        } else {
-          that.setData({
-            minute: date - res.data.start_use_bike_time
-          })
-        }
-        that.terval()
-        my.showToast({
-          content: '刷新成功',
-          icon: 'none'
-        })
-        that.setData({
-          data: res.data,
-          code: res.data.bike_no,
-          temporaryTime: res.data.pause_bike_time
-        })
-        let userStatus = my.getStorageSync({'key':'userState'}).data;
-        let setting = my.getStorageSync({'key':'setting'}).data;
-        let bike_status = my.getStorageSync({'key':'bike_status'}).data;
-        //有正在骑行中的订单的订单
-        if (userStatus.is_ride_order != false && bike_status == 1) {
-          //骑行中
-          console.log('ppppp')
-          that.setData({
-            steps: 3
-          })
-        } else if (bike_status == 0 && userStatus.is_ride_order != false) {
-          // 临时停车
-          that.setData({
-            parkStatus: 1,
-            steps: 3
-          })
-          that.stopDownTime()
-        }
-        app.request('/bike/' + that.data.code, '', 'GET').then(res => {
-          console.log(res)
-          200 == res.statusCode && that.setData({
-            battery_power: res.data.battery_power,
-            box_no: res.data.box_no,
-            bikeMessage: res.data,
-          })
-        })
-        if (res.data.status == 0) {
-          that.setData({
-            bolear: 0
-          })
-        } else if (res.data.status == 1) {
-          that.setData({
-            bolear: 1
-          })
-        } else if (res.data.status == 2) {
-          clearInterval(interval),
-            // clearInterval(interval1);
-            // clearInterval(locationTerval);
-            my.reLaunch({
-              url: '../payment/payment?order=' + res.data.no
-            })
-        } else {
-          my.reLaunch({
-            url: '../index/index',
-          })
-        }
-        // that.bikeLocation();
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  //获取当前位置
-  posiLoca: function () {
-    var that = this;
-    my.showLoading({
-      content: '正在定位...',
-      icon: 'none'
-    })
-    // locationTerval = setInterval(function () {
-    my.getLocation({
-      type: 'gcj02',
-      success: (res) => {
-        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
-        var latitude = res.latitude
-        var longitude = res.longitude
-        my.hideLoading()
-        that.setData({
-          longitude: longitude,
-          latitude: latitude,
-        })
-      },
-      fail: function (err) {
-        console.log(err)
-        my.hideLoading()
-        my.getSetting({
-          success: function (res) {
-            // console.log(res)
-            var statu = res.authSetting;
-            if (statu['scope.userLocation'] == false) {
-              that.setData({
-                background: true,
-                location: true
-              })
-            }
-          }
-        })
-      }
-    })
-    // },)
-  },
-  //获取蓝牙秘钥
-  getSecretKey(box_no) {
-    //     if (!box_no) box_no = this._bikeMainId
-    //     let that = this;
-    //     if(box_no== my.getStorageSync('box_no')) return;
-    return new Promise(function (res, rej) {
-      let param = {
-        box_no: box_no, //我公司是通过设备编号获取的密钥
-      };
-      app.request('/blu/get-key', param, 'GET').then(resp => {
-        key = resp.data.key
-        res(resp.data.key);
-        my.setStorageSync({'key':'box_no',data: box_no})
-      })
-    });
-  },
-  //行车时间计时
-  terval: function () {
-    var that = this;
-    clearInterval(interval)
-    clearInterval(huancheTime)
-    var times = ''; //秒数
-    var minute = 0; //分钟 
-    var minute1 = '0'; //分钟
-    var hour = 0; //小时
-    var hour1 = '0'; //小时
-    var time = that.data.minute //获取当前已骑行的秒数  
-    console.log(time)
-    var setting = my.getStorageSync({'key':'setting'}).data;
-    var no_money_time = time;
-    var close_bike_time = setting.close_bike_time;
-    if (no_money_time < close_bike_time) {
-      that.setData({
-        huanche_timeout: close_bike_time - no_money_time
-      })
-      huancheTime = setInterval(() => {
-        var no_money_time1 = that.data.huanche_timeout - 1
-        that.setData({
-          huanche_timeout: no_money_time1
-        })
-        if (no_money_time1 == 0) {
-          that.setData({
-            huanche_timeout: -1
-          })
-          clearInterval(huancheTime)
-        }
-      }, 1000);
-    } else {
-      that.setData({
-        huanche_timeout: -1
-      })
-    }
-    if (time > 60) { //秒数大于60 分钟= 秒数/60  秒数=  -1*60  40
-      minute = parseInt(time / 60);
-      times = time - minute * 60;
-      //minute代表分钟  times 代表秒数
-    } else {
-      minute = parseInt(time / 60);
-      times = time;
-    }
-    interval = setInterval(function () {
-      //定时器 秒数一秒加1
-      times++
-      if (times > 59) { //如果秒数大于59 让分钟加1 秒数归0
-        minute = minute + 1
-        times = 0
-      }
-      if (times < 10) { //如果秒数小于10 加一个0
-        times = '0' + times
-      }
-      if (minute < 10) { //如果分钟小于10 加一个0
-        minute1 = '0' + minute
-      } else {
-        minute1 = minute
-      }
-      if (minute > 59) {
-        //分钟大于59 让小时+1
-        hour = parseInt(minute / 60)
-        minute1 = minute - hour * 60;
-        if (hour < 10) {
-          hour1 = '0' + hour;
-        } else {
-          hour1 = hour
-        }
-      }
-      if (minute1 < 10 && hour > 0) { //如果分钟小于10 加一个0
-        minute1 = '0' + minute1
-      } else {
-        minute1 = minute1
-      }
-      if (hour > 0) {
-        //如果小时大于0 显示 时分
-        that.setData({
-          times: hour1 + ':' + minute1 + ':' + times
-        })
-      } else {
-        //else 显示 分秒
-        that.setData({
-          times: minute1 + ':' + times
-        })
-      }
-      // that.setData({ times: minute1 + ':' + times})
-      //计算钱   分钟除以5*5   判断秒数>30  minute = minute+1
-      //不满12分钟按12分钟算   并且大于30秒   
-      var per_money = setting.per_money;
-      var per_minute = setting.per_minute;
-      // console.log(minute)
-      // console.log(minute1)
-      if (setting.starting_price_time > minute) {
-        that.setData({
-          estimate_money: setting.starting_price
-        })
-      } else {
-        
-        //起步价+(分钟数-起步时长)/ 一块钱可骑多少分钟 * 钱数
-        var time = minute - setting.starting_price_time;
-        let money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
-        // if (money == NaN) {
-        //   money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
-        // }
-        // if (minute > 0) {
-          that.setData({
-            estimate_money: money
-          })
-        // } else {
-        //   if (times >= 30) {
-        //     that.setData({
-        //       estimate_money: Math.ceil(1 / per_minute * Number(per_money))
-        //     })
-        //   }
-        // }
-      }
-    }, 1000)
-  },
-
-  //获取车辆信息
-  getBikeMessage: function (options) {
-    var that = this;
-    let code = options.code
-    app.request('/bike/' + code, '', 'GET').then(res => {
-      console.log(res, '车辆信息--------------------')
-      machineNO = res.data.box_no
-      200 == res.statusCode && that.setData({
-        bikeMessage: res.data,
-        battery_power: res.data.battery_power,
-        steps: 1
-      }),
-        my.hideLoading()
-      if (res.statusCode == 200) {
-        if (res.data.is_link == 0) {
-          my.alert({
-            title: '提示',
-            content: '当前车子已下线请换辆车子骑行吧~',
-            success: function (res) {
-                my.reLaunch({
-                  url: '/pages/index/index',
-                })
-            }
-          })
-          return;
-        } else if (res.data.put_status == 0) {
-          my.alert({
-            title: '提示',
-            content: '当前车子还未投放请换辆车子骑行吧~',
-            success: function (res) {
-                my.reLaunch({
-                  url: '/pages/index/index',
-                })
-            }
-          })
-          return;
-        } else if (res.data.is_low_battery_power == 0) {
-          my.alert({
-            title: '提示',
-            content: '当前车子电量过低请换辆车子骑行吧~',
-            success: function (res) {
-                my.reLaunch({
-                  url: '/pages/index/index',
-                })
-            }
-          })
-          return;
-        } else if (res.data.is_trouble == 1) {
-          my.alert({
-            title: '提示',
-            content: '当前车子出现故障请换辆车子骑行吧~',
-            success: function (res) {
-                my.reLaunch({
-                  url: '/pages/index/index',
-                })
-            }
-          })
-          return;
-        } else if (res.data.is_riding == 1) {
-          my.alert({
-            title: '提示',
-            content: '当前车子正在骑行请换辆车子骑行吧~',
-            success: function (res) {
-                my.reLaunch({
-                  url: '/pages/index/index',
-                })
-            }
-          })
-          return;
-        } else {
-          let box_no = res.data.box_no
-
-          that.getSecretKey(box_no)
-        }
-      } else {
-        setTimeout(function () {
-          my.reLaunch({
-            url: '/pages/index/index',
-          })
-        }, 2000)
-
-      }
-    })
-
-  },
-  //检测用户是否完成实名认证,是否有待支付订单违章记录等
-  jiance: function () {
-    let that = this
-    var userStatus = my.getStorageSync({'key':'userState'}).data;
-    var setting = my.getStorageSync({'key':'setting'}).data;
-    if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
-      my.navigateTo({
-        url: '/pages/real_name/real_name',
-      })
-    }//是否缴纳押金 
-    else if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
-      my.navigateTo({
-        url: '/pages/ride_zige/ride_zige',
-      })
-    } else if (userStatus.is_ride_order == false) {
-      my.reLaunch({
-        url: '/pages/index/index',
-      })
-    }
-    else {
-      that.setData({
-        steps: 2
-      })
-    }
-  },
-  //倒计时
-
-  //临时停车倒计时
-  stopDownTime() {
-    let that = this
-    let endTime = Date.parse(new Date()); //date日期类型
-    let startTime
-    if (!that.data.temporaryTime || that.data.temporaryTime == null) {
-      startTime = endTime
-    } else {
-      let data1 = that.data.temporaryTime
-      let data2 = data1.replace(/-/g, '/')
-      let data3 = new Date(data2)
-      startTime = data3.getTime()
-    }
-    let totleTime = 1800
-    clearInterval(linshiStop)
-    console.log(endTime, 'endTime')
-    console.log(startTime, 'startTime')
-    let date3 = endTime - startTime;
-    console.log(date3, 'date3')
-    //计算出相差天数
-    var days = Math.floor(date3 / (24 * 3600 * 1000));
-    //计算出小时数
-    var leave1 = date3 % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
-    var hours = Math.floor(leave1 / (3600 * 1000));
-    //计算相差分钟数
-    var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
-    var minutes = Math.floor(leave2 / (60 * 1000));
-    //计算相差秒数
-    var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
-    var seconds = Math.round(leave3 / 1000);
-    console.log(minutes, 'minutes')
-
-    let chaTime = totleTime - minutes * 60
-    console.log(chaTime, 'chaTime')
-    linshiStop = setInterval(function () {
-      let test = 30 * 60 * 1000
-      console.log(test,'test')
-      if (date3 > test) {
-        that.setData({
-          stopMiao: 0,
-          stopmMinute: 0
-        })
-        clearInterval(linshiStop)
-      } else if (chaTime <= 0) {
-        that.setData({
-          stopMiao: 0,
-          stopmMinute: 0
-        })
-        clearInterval(linshiStop)
-      } else {
-        console.log(minutes, 'pppp')
-        chaTime--
-
-        let fen = parseInt(chaTime / 60);
-        let miao = parseInt(chaTime % 60);
-        that.setData({
-          stopMiao: miao,
-          stopmMinute: fen
-        })
-      }
-
-    }, 1000)
-
-  },
-  //开锁方法
-  openBike() {
-    var that = this;
-    my.showLoading({
-      content: '开锁中...',
-      mask: true
-    })
-    var data = {
-      bike_no: that.data.code,
-      lat: that.data.latitude,
-      lng: that.data.longitude,
-      area_id: my.getStorageSync({'key':'home'}).data.id,
-    }
-    //蓝牙开锁
-    operateType = 'open'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-    });
-    app.request('/bike/open-lock', data, 'POST', app.globalData.req).then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        that.setData({
-          steps: 3,
-          order: res.data.no
-        })
-        that.terval()
-        my.hideLoading()
-      } else {
-        // that.setData({
-        //   steps: 3
-        // })
-        // that.terval()
-      }
-    })
-
-
-  },
-  //开锁失败重试开锁
-  retryOpenBike: function () {
-    var that = this;
-    console.log('重试开锁')
-    //蓝牙重试开锁
-    my.showLoading({
-      content: '开锁中...',
-      mask: true
-    })
-    operateType = 'open'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-
-    });
-    let data = {
-      order_no: that.data.order,
-      bike_no: that.data.code
-    }
-    app.request('/order/retry-open-lock', data, 'GET').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        my.hideLoading()
-        if (res.data.status == 1) {
-          that.setData({
-            frame: false
-          })
-          my.hideLoading()
-          my.showToast({
-            content: '开锁成功',
-            icon: 'none'
-          })
-        }
-      }
-    })
-  },
-  openBikeClick: function () {
-    let that = this
-    that.setData({
-      steps: 2
-    })
-
-  },
-  go_setting: util.throttle(function () {
-    //点击去设置位置权限
-    this.setData({
-      background: false,
-      location: false
-    })
-    my.openSetting({
-      success: function (res) {
-      }
-    })
-  }, 1500),
-
-  //点击已开启位置权限
-  open: util.throttle(function () {
-    this.setData({
-      background: false,
-      location: false
-    })
-
-  }, 1500),
-  //寻铃
-  clickBell: util.throttle(function (e) {
-    //点击响铃
-    var that = this;
-    my.showLoading({
-      content: '找车中...',
-      mask: true
-    })
-    //蓝牙寻铃找车
-    operateType = 'bell'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-      //flag == true 操作成功
-      //flag == false 操作失败
-      //end
-    });
-    app.request('/order/retry-bell-lock?order_no=' + that.data.order + '&bike_no=' + that.data.code, '', 'GET').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        res.data.is_ok == true && my.showToast({
-          content: '找车成功',
-          icon: 'none',
-          duration: 2000
-        })
-        res.data.is_ok == false && my.showToast({
-          content: '找车失败请重试',
-          icon: 'none',
-          duration: 2000
-        })
-      }
-    })
-  }, 1000),
-  //立即开锁
-  konwOpenBike: util.throttle(function () {
-    var that = this;
-    // that.jiance()
-    if (that.data.deposit == true) return;
-    that.openBike()
-  }, 1000),
-  //临时锁车
-  parkBike: function () {
-
-    let that = this
-    my.showLoading({
-      content: '正在临时锁车',
-    })
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-    //蓝牙临时锁车
-    operateType = 'temporaryClose'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-      //flag == true 操作成功
-      //flag == false 操作失败
-      //end
-    });
-    //代表要临时停车
-    app.request('/bike/temporary-close-lock', data, 'POST').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        my.hideLoading()
-        my.showToast({
-          content: '停车成功',
-          icon: 'none'
-        })
-        that.setData({
-          parkStatus: 1,
-          // nowBikeStatus:1
-        })
-        my.setStorageSync({'key':'nowBikeStatus',data:1})
-        that.stopDownTime()
-        // that.getBikeMessage()
-      } else if (res.statusCode == 450) {
-        my.showToast({
-          content: '运动中不能关锁,请稍后重试',
-          icon: 'none',
-          duration: 5000,
-          mask: true
-        })
-        my.hideLoading()
-      }
-    })
-  },
-  //结束临时锁车
-  openPark: function () {
-    let that = this
-    my.showLoading({
-      content: '解锁中',
-    })
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-    // clearInterval(inter1)
-    // 蓝牙临时开车
-    operateType = 'temporaryOpen'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-      //flag == true 操作成功
-      //flag == false 操作失败
-      //end
-    });
-    app.request('/bike/temporary-open-lock', data, 'POST').then(res => {
-      // that.inter1()
-      if (res.statusCode == 200) {
-        my.hideLoading()
-        my.showToast({
-          content: '开车成功',
-          icon: 'none'
-        })
-        clearInterval(linshiStop)
-        my.setStorageSync({'key':'stopMiao',data: 0})
-        my.setStorageSync({'key':'stopmMinute',data:30})
-        that.setData({
-          stopMiao: 0,
-          stopmMinute: 30,
-          parkStatus: 0,
-          nowBikeStatus: 0
-        })
-        my.setStorageSync({'key':'nowBikeStatus',data: 0})
-      }
-    })
-
-  },
-  endUseBike: function () {
-    let that = this
-    my.showLoading({
-      content: '加载中...'
-    })
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-
-    app.request('/order/expect-order-money', data, 'POST').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        my.hideLoading()
-      let data=res.data.dispatch_money
-      res.data.time_money = parseFloat(res.data.time_money)
-      let data1=parseFloat(data)
-      console.log(data1,'ppppppppppppppppppp')
-        that.setData({
-          dispatch_money:data1,
-          money: res.data,
-          chaButton: 1,
-          parkStatus: 2
-        })
-
-      }
-    })
-  },
-  //确定结束用车
-  sureEndUseBike: util.throttle(function () {
-
-    my.showLoading({
-      content: '结算中...',
-      mask: true
-    })
-    var that = this;
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-    app.request('/bike/check-is-riding-area', data, 'POST').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        clearInterval(linshiStop);
-        my.setStorageSync({'key':'stopMiao',data: 0})
-        my.setStorageSync({'key':'stopmMinute',data: 30})
-        my.hideNavigationBarLoading(), my.hideLoading()
-        that.closeLock(data)
-      } else if (res.statusCode == 450) {
-        my.showToast({
-          content: '运动中不能关锁,请稍后重试',
-          icon: 'none',
-          duration: 5000,
-          mask: true
-        })
-        my.hideLoading()
-      }
-    }).catch(err => {
-      my.hideLoading()
-      console.log(err)
-    })
-  }, 1000),
-  closeLock: function (data) {
-    var that = this;
-    //蓝牙锁车操作 确定结束用车
-    operateType = 'close'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-      //flag == true 操作成功
-      //flag == false 操作失败
-      //end
-    });
-    app.request('/bike/close-lock', data, 'POST').then(res => {
-      console.log(res)
-      if (res.statusCode == 200) {
-        console.log('锁车成功')
-        clearInterval(interval);
-        clearInterval(linshiStop);
-        my.setStorageSync({'key':'stopMiao',data: 0})
-        my.setStorageSync({'key':'stopmMinute',data:30})
-        my.hideLoading()
-        my.reLaunch({
-          url: '../pay/pay?order=' + res.data.no
-        })
-      } else if (res.statusCode == 450) {
-        //运动中不能锁车请5s后重试
-        my.showToast({
-          content: '运动中不能关锁,请稍后重试',
-          icon: 'none',
-          duration: 5000,
-          mask: true
-        })
-        my.hideLoading()
-
-      }
-
-    }).catch(err => {
-      console.log(err)
-    })
-
-  },
-
-  //取消锁车
-  cancelEndBike: function () {
-    console.log(my.getStorageSync({'key':'nowBikeStatus'}).data)
-    let that = this
-    that.setData({
-      chaButton: 0,
-      parkStatus: my.getStorageSync({'key':'nowBikeStatus'}).data
-    })
-  },
-  //计价规则
-  chargeRule: function () {
-    my.navigateTo({
-      url: '/pages/charge_rule/charge_rule',
-    })
-  },
-  //骑行须知
-  bikeKnow: function () {
-    my.navigateTo({
-      url: '/pages/ride_rule/ride_rule',
-    })
-  },
-  //骑行优惠券
-  bikeCoupon: function () {
-    my.navigateTo({
-      url: '/pages/buy-card/buy-card',
-    })
-  },
-  //客服
-  keFu: function () {
-    my.makePhoneCall({
-      phoneNumber: my.getStorageSync({'key':'home'}).data.customer_service_phone,
-    })
-  },
-  //车辆为未开锁弹框
-  //打开
-  frameClose: function () {
-    let that = this
-    that.setData({
-      frame: false
-    })
-  },
-  //关闭弹框
-  frameShow: function () {
-    let that = this
-    that.setData({
-      frame: true
-    })
-  },
-  //故障上报
-  guzhang: function () {
-    my.navigateTo({
-      url: '/pages/breakdown/breakdown',
-    })
-  },
-  //附近还车点
-  findPark: function () {
-    my.navigateTo({
-      url: '/pages/parking/parking',
-    })
-  },
-
-  onUnload: function () {
-    // 停止位置跟踪
-    my.stopLocationUpdate({
-      success: (res) => {
-        console.log("onUnload stopLocationUpdate success", res)
-      },
-      fail: (err) => {
-        console.log("onUnload stopLocationUpdate fail", err)
-      }
-    })
-  }
+
+var app = getApp()
+var interval;
+var inter1;
+var locationTerval;
+var huancheTime;
+var coundDown;//运动中不可锁车倒计时
+var linshiStop;//临时停车倒计时
+const util = require('../../utils/utils.js');
+var interval;
+//蓝牙操作方法
+var BluetoothOperate = require('../../service/bluetooth.js');
+const { content } = require('../../service/dataTransition.js');
+let bluetoothOperate = new BluetoothOperate();
+let machineNO = "" //设备编号
+let key = "" //蓝牙密钥
+let operateType = ''  //'open'开锁 'close'上锁 'bell'寻铃 'temporaryClose'临时锁车 'temporaryOpen'临时锁车开车
+
+Page({
+  data: {
+    nowBikeStatus: '',//当前车辆的状态
+    money: {time_money:0,dispatch_money:0,total_money:0},//骑行费用
+    steps: 1,//开锁步骤
+    parkStatus: 0,//骑行中:0,临时停车:1,点击结束用车:2
+    frame: false,//车辆未开锁弹框
+    code: '',//车辆编码
+    bikeMessage: '',//车辆信息
+    times: '00:00', //当前骑行时间
+    estimate_money: '--', //预计金额
+    minute: '', //骑行总时间秒
+    data: [],
+    box_no: '',
+    screenHeight: '',
+    change: false,
+    timing: 5,
+    isShow: false,
+    minute1: '',
+    parke: true,
+    timeout: 15,
+    retry: '',
+    bikePosition: false,
+    battery_power: '--',
+    huanche_timeout: 0,
+    img: app.globalData.imgUrl,
+    title: app.globalData.title,
+    stopmMinute: 30,//临时停车时间
+    stopMiao: 0,
+    chaButton: 0,//0 不显示 1显示
+    markers: [],
+    polygons: [],
+    polygons1: [],
+    zoom: 18,
+    temporaryTime: '',//临时锁车时间
+    background: false,//位置权限弹框
+    location: false,//位置权限弹框
+    coundDownTime: 5,//运动中不可锁车倒计时
+    countTimeShow: false,
+    dispatch_money:0,//调度费
+
+  },
+  onShow: function () {
+    let that = this
+    that.posiLoca()
+    if (that.data.order != undefined) {
+      that.chushi()
+    }
+  },
+  onLoad: function (options) {
+    let that = this
+    let token = my.getStorageSync({'key':'token'}).data
+    let data = Math.round(new Date().getTime() / 1000).toString();;
+    let tokenTime = my.getStorageSync({'key':'token_time'}).data
+    let cha = data - tokenTime
+    let data1 = 60 * 60 * 24
+    if (!token) {
+      that.token()
+    } else if (cha > data1) {
+      my.removeStorageSync({'key':'token'}).data
+      that.token()
+    } else {
+      console.log(options, 'order_no')
+      let home = my.getStorageSync({'key':'home'}).data
+      that.posiLoca();
+      let area_id = home.id
+      that.ban_stop(area_id)
+      if (options.order != undefined) {
+        that.setData({
+          order: options.order,
+        })
+        that.chushi()
+      }
+      if (options.code != undefined) {
+        that.setData({
+          code: options.code
+        })
+        this.getBikeMessage(options)
+      }
+
+      this.setData({
+        code: options.code
+      })
+    }
+    my.onLocationChange(function (res) {
+      console.log(res, '实时监听位置')
+      that.setData({
+        longitude: res.longitude,
+        latitude: res.latitude,
+      })
+    })
+    my.startLocationUpdate({
+      success: (res) => {
+        console.log(res, '启动位置跟踪')
+      },
+
+    })
+  },
+   //获取token
+   token: function () {
+    my.login({
+      success: function (res) {
+        var data = {
+          'code': res.code,
+          'appid': app.globalData.appid,
+          'invite_user_id': app.globalData.id,
+          'language': 'zh'
+        };
+        app.request('/auth/weapp-login', data, 'post').then(res => {
+          my.setStorageSync({'key':'token',data:res.data.token});
+          my.setStorageSync({'key':'session_key',data:res.data.session_key});
+          my.setStorageSync({'key':'token_time',data:res.data.exp});
+          my.setStorageSync({'key':'user_ID', data:res.data.user.id});
+        })
+      }})
+  },
+  //停车区域
+  ban_stop: function (area_id) {
+    var that = this;
+    let home = my.getStorageSync({'key':'home'}).data
+    that.setData({
+      polygons1: that.data.polygons1.concat(home)
+    })
+    var data1 = {
+      'area_id': area_id
+    }
+    app.request('/parking/stop-sites', data1, 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        var data = res.data
+        console.log(data)
+        that.setData({
+          markers: that.data.markers.concat(data.centres),
+          polygons: that.data.polygons1.concat(data.polygons),
+          // polygons:data.polygons,
+        })
+      }
+    })
+  },
+  //初始化信息
+  chushi: function () {
+    my.showLoading()
+    var that = this;
+    var date = Date.parse(new Date()) / 1000;
+    app.request('/pages/ride-order?no=' + that.data.order, '', 'GET').then(res => {
+      console.log(res, ',---------')
+      if (res.status == 200) {
+        my.hideLoading()
+        my.setStorageSync({'key':'bike_status',data: res.data.status})
+
+        if (res.data.start_use_bike_time <= 0) {
+          that.setData({
+            minute: 0
+          })
+        } else {
+          that.setData({
+            minute: date - res.data.start_use_bike_time
+          })
+        }
+        that.terval()
+        my.showToast({
+          content: '刷新成功',
+          icon: 'none'
+        })
+        that.setData({
+          data: res.data,
+          code: res.data.bike_no,
+          temporaryTime: res.data.pause_bike_time
+        })
+        let userStatus = my.getStorageSync({'key':'userState'}).data;
+        let setting = my.getStorageSync({'key':'setting'}).data;
+        let bike_status = my.getStorageSync({'key':'bike_status'}).data;
+        //有正在骑行中的订单的订单
+        if (userStatus.is_ride_order != false && bike_status == 1) {
+          //骑行中
+          console.log('ppppp')
+          that.setData({
+            steps: 3
+          })
+        } else if (bike_status == 0 && userStatus.is_ride_order != false) {
+          // 临时停车
+          that.setData({
+            parkStatus: 1,
+            steps: 3
+          })
+          that.stopDownTime()
+        }
+        app.request('/bike/' + that.data.code, '', 'GET').then(res => {
+          console.log(res)
+          200 == res.status && that.setData({
+            battery_power: res.data.battery_power,
+            box_no: res.data.box_no,
+            bikeMessage: res.data,
+          })
+        })
+        if (res.data.status == 0) {
+          that.setData({
+            bolear: 0
+          })
+        } else if (res.data.status == 1) {
+          that.setData({
+            bolear: 1
+          })
+        } else if (res.data.status == 2) {
+          clearInterval(interval),
+            // clearInterval(interval1);
+            // clearInterval(locationTerval);
+            my.reLaunch({
+              url: '../payment/payment?order=' + res.data.no
+            })
+        } else {
+          my.reLaunch({
+            url: '../index/index',
+          })
+        }
+        // that.bikeLocation();
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  //获取当前位置
+  posiLoca: function () {
+    var that = this;
+    my.showLoading({
+      content: '正在定位...',
+      icon: 'none'
+    })
+    // locationTerval = setInterval(function () {
+    my.getLocation({
+      type: 'gcj02',
+      success: (res) => {
+        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
+        var latitude = res.latitude
+        var longitude = res.longitude
+        my.hideLoading()
+        that.setData({
+          longitude: longitude,
+          latitude: latitude,
+        })
+      },
+      fail: function (err) {
+        console.log(err)
+        my.hideLoading()
+        my.getSetting({
+          success: function (res) {
+            // console.log(res)
+            var statu = res.authSetting;
+            if (statu['scope.userLocation'] == false) {
+              that.setData({
+                background: true,
+                location: true
+              })
+            }
+          }
+        })
+      }
+    })
+    // },)
+  },
+  //获取蓝牙秘钥
+  getSecretKey(box_no) {
+    //     if (!box_no) box_no = this._bikeMainId
+    //     let that = this;
+    //     if(box_no== my.getStorageSync('box_no')) return;
+    return new Promise(function (res, rej) {
+      let param = {
+        box_no: box_no, //我公司是通过设备编号获取的密钥
+      };
+      app.request('/blu/get-key', param, 'GET').then(resp => {
+        key = resp.data.key
+        res(resp.data.key);
+        my.setStorageSync({'key':'box_no',data: box_no})
+      })
+    });
+  },
+  //行车时间计时
+  terval: function () {
+    var that = this;
+    clearInterval(interval)
+    clearInterval(huancheTime)
+    var times = ''; //秒数
+    var minute = 0; //分钟 
+    var minute1 = '0'; //分钟
+    var hour = 0; //小时
+    var hour1 = '0'; //小时
+    var time = that.data.minute //获取当前已骑行的秒数  
+    console.log(time)
+    var setting = my.getStorageSync({'key':'setting'}).data;
+    var no_money_time = time;
+    var close_bike_time = setting.close_bike_time;
+    if (no_money_time < close_bike_time) {
+      that.setData({
+        huanche_timeout: close_bike_time - no_money_time
+      })
+      huancheTime = setInterval(() => {
+        var no_money_time1 = that.data.huanche_timeout - 1
+        that.setData({
+          huanche_timeout: no_money_time1
+        })
+        if (no_money_time1 == 0) {
+          that.setData({
+            huanche_timeout: -1
+          })
+          clearInterval(huancheTime)
+        }
+      }, 1000);
+    } else {
+      that.setData({
+        huanche_timeout: -1
+      })
+    }
+    if (time > 60) { //秒数大于60 分钟= 秒数/60  秒数=  -1*60  40
+      minute = parseInt(time / 60);
+      times = time - minute * 60;
+      //minute代表分钟  times 代表秒数
+    } else {
+      minute = parseInt(time / 60);
+      times = time;
+    }
+    interval = setInterval(function () {
+      //定时器 秒数一秒加1
+      times++
+      if (times > 59) { //如果秒数大于59 让分钟加1 秒数归0
+        minute = minute + 1
+        times = 0
+      }
+      if (times < 10) { //如果秒数小于10 加一个0
+        times = '0' + times
+      }
+      if (minute < 10) { //如果分钟小于10 加一个0
+        minute1 = '0' + minute
+      } else {
+        minute1 = minute
+      }
+      if (minute > 59) {
+        //分钟大于59 让小时+1
+        hour = parseInt(minute / 60)
+        minute1 = minute - hour * 60;
+        if (hour < 10) {
+          hour1 = '0' + hour;
+        } else {
+          hour1 = hour
+        }
+      }
+      if (minute1 < 10 && hour > 0) { //如果分钟小于10 加一个0
+        minute1 = '0' + minute1
+      } else {
+        minute1 = minute1
+      }
+      if (hour > 0) {
+        //如果小时大于0 显示 时分
+        that.setData({
+          times: hour1 + ':' + minute1 + ':' + times
+        })
+      } else {
+        //else 显示 分秒
+        that.setData({
+          times: minute1 + ':' + times
+        })
+      }
+      // that.setData({ times: minute1 + ':' + times})
+      //计算钱   分钟除以5*5   判断秒数>30  minute = minute+1
+      //不满12分钟按12分钟算   并且大于30秒   
+      var per_money = setting.per_money;
+      var per_minute = setting.per_minute;
+      // console.log(minute)
+      // console.log(minute1)
+      if (setting.starting_price_time > minute) {
+        that.setData({
+          estimate_money: setting.starting_price
+        })
+      } else {
+        
+        //起步价+(分钟数-起步时长)/ 一块钱可骑多少分钟 * 钱数
+        var time = minute - setting.starting_price_time;
+        let money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
+        // if (money == NaN) {
+        //   money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
+        // }
+        // if (minute > 0) {
+          that.setData({
+            estimate_money: money
+          })
+        // } else {
+        //   if (times >= 30) {
+        //     that.setData({
+        //       estimate_money: Math.ceil(1 / per_minute * Number(per_money))
+        //     })
+        //   }
+        // }
+      }
+    }, 1000)
+  },
+
+  //获取车辆信息
+  getBikeMessage: function (options) {
+    var that = this;
+    let code = options.code
+    app.request('/bike/' + code, '', 'GET').then(res => {
+      console.log(res, '车辆信息--------------------')
+      machineNO = res.data.box_no
+      200 == res.status && that.setData({
+        bikeMessage: res.data,
+        battery_power: res.data.battery_power,
+        steps: 1
+      }),
+        my.hideLoading()
+      if (res.status == 200) {
+        if (res.data.is_link == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子已下线请换辆车子骑行吧~',
+            success: function (res) {
+                my.reLaunch({
+                  url: '/pages/index/index',
+                })
+            }
+          })
+          return;
+        } else if (res.data.put_status == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子还未投放请换辆车子骑行吧~',
+            success: function (res) {
+                my.reLaunch({
+                  url: '/pages/index/index',
+                })
+            }
+          })
+          return;
+        } else if (res.data.is_low_battery_power == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子电量过低请换辆车子骑行吧~',
+            success: function (res) {
+                my.reLaunch({
+                  url: '/pages/index/index',
+                })
+            }
+          })
+          return;
+        } else if (res.data.is_trouble == 1) {
+          my.alert({
+            title: '提示',
+            content: '当前车子出现故障请换辆车子骑行吧~',
+            success: function (res) {
+                my.reLaunch({
+                  url: '/pages/index/index',
+                })
+            }
+          })
+          return;
+        } else if (res.data.is_riding == 1) {
+          my.alert({
+            title: '提示',
+            content: '当前车子正在骑行请换辆车子骑行吧~',
+            success: function (res) {
+                my.reLaunch({
+                  url: '/pages/index/index',
+                })
+            }
+          })
+          return;
+        } else {
+          let box_no = res.data.box_no
+
+          that.getSecretKey(box_no)
+        }
+      } else {
+        setTimeout(function () {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }, 2000)
+
+      }
+    })
+
+  },
+  //检测用户是否完成实名认证,是否有待支付订单违章记录等
+  jiance: function () {
+    let that = this
+    var userStatus = my.getStorageSync({'key':'userState'}).data;
+    var setting = my.getStorageSync({'key':'setting'}).data;
+    if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
+      my.navigateTo({
+        url: '/pages/real_name/real_name',
+      })
+    }//是否缴纳押金 
+    else if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
+      my.navigateTo({
+        url: '/pages/ride_zige/ride_zige',
+      })
+    } else if (userStatus.is_ride_order == false) {
+      my.reLaunch({
+        url: '/pages/index/index',
+      })
+    }
+    else {
+      that.setData({
+        steps: 2
+      })
+    }
+  },
+  //倒计时
+
+  //临时停车倒计时
+  stopDownTime() {
+    let that = this
+    let endTime = Date.parse(new Date()); //date日期类型
+    let startTime
+    if (!that.data.temporaryTime || that.data.temporaryTime == null) {
+      startTime = endTime
+    } else {
+      let data1 = that.data.temporaryTime
+      let data2 = data1.replace(/-/g, '/')
+      let data3 = new Date(data2)
+      startTime = data3.getTime()
+    }
+    let totleTime = 1800
+    clearInterval(linshiStop)
+    console.log(endTime, 'endTime')
+    console.log(startTime, 'startTime')
+    let date3 = endTime - startTime;
+    console.log(date3, 'date3')
+    //计算出相差天数
+    var days = Math.floor(date3 / (24 * 3600 * 1000));
+    //计算出小时数
+    var leave1 = date3 % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
+    var hours = Math.floor(leave1 / (3600 * 1000));
+    //计算相差分钟数
+    var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
+    var minutes = Math.floor(leave2 / (60 * 1000));
+    //计算相差秒数
+    var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
+    var seconds = Math.round(leave3 / 1000);
+    console.log(minutes, 'minutes')
+
+    let chaTime = totleTime - minutes * 60
+    console.log(chaTime, 'chaTime')
+    linshiStop = setInterval(function () {
+      let test = 30 * 60 * 1000
+      console.log(test,'test')
+      if (date3 > test) {
+        that.setData({
+          stopMiao: 0,
+          stopmMinute: 0
+        })
+        clearInterval(linshiStop)
+      } else if (chaTime <= 0) {
+        that.setData({
+          stopMiao: 0,
+          stopmMinute: 0
+        })
+        clearInterval(linshiStop)
+      } else {
+        console.log(minutes, 'pppp')
+        chaTime--
+
+        let fen = parseInt(chaTime / 60);
+        let miao = parseInt(chaTime % 60);
+        that.setData({
+          stopMiao: miao,
+          stopmMinute: fen
+        })
+      }
+
+    }, 1000)
+
+  },
+  //开锁方法
+  openBike() {
+    var that = this;
+    my.showLoading({
+      content: '开锁中...',
+      mask: true
+    })
+    var data = {
+      bike_no: that.data.code,
+      lat: that.data.latitude,
+      lng: that.data.longitude,
+      area_id: my.getStorageSync({'key':'home'}).data.id,
+    }
+    //蓝牙开锁
+    operateType = 'open'
+    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+    });
+    app.request('/bike/open-lock', data, 'POST', app.globalData.req).then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        that.setData({
+          steps: 3,
+          order: res.data.no
+        })
+        that.terval()
+        my.hideLoading()
+      } else {
+        // that.setData({
+        //   steps: 3
+        // })
+        // that.terval()
+      }
+    })
+
+
+  },
+  //开锁失败重试开锁
+  retryOpenBike: function () {
+    var that = this;
+    console.log('重试开锁')
+    //蓝牙重试开锁
+    my.showLoading({
+      content: '开锁中...',
+      mask: true
+    })
+    operateType = 'open'
+    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+
+    });
+    let data = {
+      order_no: that.data.order,
+      bike_no: that.data.code
+    }
+    app.request('/order/retry-open-lock', data, 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        my.hideLoading()
+        if (res.data.status == 1) {
+          that.setData({
+            frame: false
+          })
+          my.hideLoading()
+          my.showToast({
+            content: '开锁成功',
+            icon: 'none'
+          })
+        }
+      }
+    })
+  },
+  openBikeClick: function () {
+    let that = this
+    that.setData({
+      steps: 2
+    })
+
+  },
+  go_setting: util.throttle(function () {
+    //点击去设置位置权限
+    this.setData({
+      background: false,
+      location: false
+    })
+    my.openSetting({
+      success: function (res) {
+      }
+    })
+  }, 1500),
+
+  //点击已开启位置权限
+  open: util.throttle(function () {
+    this.setData({
+      background: false,
+      location: false
+    })
+
+  }, 1500),
+  //寻铃
+  clickBell: util.throttle(function (e) {
+    //点击响铃
+    var that = this;
+    my.showLoading({
+      content: '找车中...',
+      mask: true
+    })
+    //蓝牙寻铃找车
+    operateType = 'bell'
+    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+      //flag == true 操作成功
+      //flag == false 操作失败
+      //end
+    });
+    app.request('/order/retry-bell-lock?order_no=' + that.data.order + '&bike_no=' + that.data.code, '', 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        res.data.is_ok == true && my.showToast({
+          content: '找车成功',
+          icon: 'none',
+          duration: 2000
+        })
+        res.data.is_ok == false && my.showToast({
+          content: '找车失败请重试',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  }, 1000),
+  //立即开锁
+  konwOpenBike: util.throttle(function () {
+    var that = this;
+    // that.jiance()
+    if (that.data.deposit == true) return;
+    that.openBike()
+  }, 1000),
+  //临时锁车
+  parkBike: function () {
+
+    let that = this
+    my.showLoading({
+      content: '正在临时锁车',
+    })
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+    //蓝牙临时锁车
+    operateType = 'temporaryClose'
+    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+      //flag == true 操作成功
+      //flag == false 操作失败
+      //end
+    });
+    //代表要临时停车
+    app.request('/bike/temporary-close-lock', data, 'POST').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        my.hideLoading()
+        my.showToast({
+          content: '停车成功',
+          icon: 'none'
+        })
+        that.setData({
+          parkStatus: 1,
+          // nowBikeStatus:1
+        })
+        my.setStorageSync({'key':'nowBikeStatus',data:1})
+        that.stopDownTime()
+        // that.getBikeMessage()
+      } else if (res.status == 450) {
+        my.showToast({
+          content: '运动中不能关锁,请稍后重试',
+          icon: 'none',
+          duration: 5000,
+          mask: true
+        })
+        my.hideLoading()
+      }
+    })
+  },
+  //结束临时锁车
+  openPark: function () {
+    let that = this
+    my.showLoading({
+      content: '解锁中',
+    })
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+    // clearInterval(inter1)
+    // 蓝牙临时开车
+    operateType = 'temporaryOpen'
+    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+      //flag == true 操作成功
+      //flag == false 操作失败
+      //end
+    });
+    app.request('/bike/temporary-open-lock', data, 'POST').then(res => {
+      // that.inter1()
+      if (res.status == 200) {
+        my.hideLoading()
+        my.showToast({
+          content: '开车成功',
+          icon: 'none'
+        })
+        clearInterval(linshiStop)
+        my.setStorageSync({'key':'stopMiao',data: 0})
+        my.setStorageSync({'key':'stopmMinute',data:30})
+        that.setData({
+          stopMiao: 0,
+          stopmMinute: 30,
+          parkStatus: 0,
+          nowBikeStatus: 0
+        })
+        my.setStorageSync({'key':'nowBikeStatus',data: 0})
+      }
+    })
+
+  },
+  endUseBike: function () {
+    let that = this
+    my.showLoading({
+      content: '加载中...'
+    })
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+
+    app.request('/order/expect-order-money', data, 'POST').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        my.hideLoading()
+      let data=res.data.dispatch_money
+      res.data.time_money = parseFloat(res.data.time_money)
+      let data1=parseFloat(data)
+      console.log(data1,'ppppppppppppppppppp')
+        that.setData({
+          dispatch_money:data1,
+          money: res.data,
+          chaButton: 1,
+          parkStatus: 2
+        })
+
+      }
+    })
+  },
+  //确定结束用车
+  sureEndUseBike: util.throttle(function () {
+
+    my.showLoading({
+      content: '结算中...',
+      mask: true
+    })
+    var that = this;
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+    app.request('/bike/check-is-riding-area', data, 'POST').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        clearInterval(linshiStop);
+        my.setStorageSync({'key':'stopMiao',data: 0})
+        my.setStorageSync({'key':'stopmMinute',data: 30})
+        my.hideNavigationBarLoading(), my.hideLoading()
+        that.closeLock(data)
+      } else if (res.status == 450) {
+        my.showToast({
+          content: '运动中不能关锁,请稍后重试',
+          icon: 'none',
+          duration: 5000,
+          mask: true
+        })
+        my.hideLoading()
+      }
+    }).catch(err => {
+      my.hideLoading()
+      console.log(err)
+    })
+  }, 1000),
+  closeLock: function (data) {
+    var that = this;
+    //蓝牙锁车操作 确定结束用车
+    operateType = 'close'
+    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+      //flag == true 操作成功
+      //flag == false 操作失败
+      //end
+    });
+    app.request('/bike/close-lock', data, 'POST').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        console.log('锁车成功')
+        clearInterval(interval);
+        clearInterval(linshiStop);
+        my.setStorageSync({'key':'stopMiao',data: 0})
+        my.setStorageSync({'key':'stopmMinute',data:30})
+        my.hideLoading()
+        my.reLaunch({
+          url: '../pay/pay?order=' + res.data.no
+        })
+      } else if (res.status == 450) {
+        //运动中不能锁车请5s后重试
+        my.showToast({
+          content: '运动中不能关锁,请稍后重试',
+          icon: 'none',
+          duration: 5000,
+          mask: true
+        })
+        my.hideLoading()
+
+      }
+
+    }).catch(err => {
+      console.log(err)
+    })
+
+  },
+
+  //取消锁车
+  cancelEndBike: function () {
+    console.log(my.getStorageSync({'key':'nowBikeStatus'}).data)
+    let that = this
+    that.setData({
+      chaButton: 0,
+      parkStatus: my.getStorageSync({'key':'nowBikeStatus'}).data
+    })
+  },
+  //计价规则
+  chargeRule: function () {
+    my.navigateTo({
+      url: '/pages/charge_rule/charge_rule',
+    })
+  },
+  //骑行须知
+  bikeKnow: function () {
+    my.navigateTo({
+      url: '/pages/ride_rule/ride_rule',
+    })
+  },
+  //骑行优惠券
+  bikeCoupon: function () {
+    my.navigateTo({
+      url: '/pages/buy-card/buy-card',
+    })
+  },
+  //客服
+  keFu: function () {
+    my.makePhoneCall({
+      number: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+    })
+  },
+  //车辆为未开锁弹框
+  //打开
+  frameClose: function () {
+    let that = this
+    that.setData({
+      frame: false
+    })
+  },
+  //关闭弹框
+  frameShow: function () {
+    let that = this
+    that.setData({
+      frame: true
+    })
+  },
+  //故障上报
+  guzhang: function () {
+    my.navigateTo({
+      url: '/pages/breakdown/breakdown',
+    })
+  },
+  //附近还车点
+  findPark: function () {
+    my.navigateTo({
+      url: '/pages/parking/parking',
+    })
+  },
+
+  onUnload: function () {
+    // 停止位置跟踪
+    my.stopLocationUpdate({
+      success: (res) => {
+        console.log("onUnload stopLocationUpdate success", res)
+      },
+      fail: (err) => {
+        console.log("onUnload stopLocationUpdate fail", err)
+      }
+    })
+  }
 })

+ 1 - 1
pages/user_rules/user_rules.axml

@@ -66,7 +66,7 @@
     怎样使用骑行卡?
   </view>
   <view class="text">
-    使用“遇”见你电单车服务并结束行程后,若用户账户内有满足使用规则的骑行卡,用户可在车费支付时使用该骑行卡。
+    使用“遇”见你电单车服务并结束defaultTitle后,若用户账户内有满足使用规则的骑行卡,用户可在车费支付时使用该骑行卡。
   </view>
 
   <view class="title">

+ 1 - 1
pages/weizhang/weizhang.acss

@@ -12,7 +12,7 @@
   flex-direction: column;
   align-items: center;
   justify-content: center;
-  margin-top: 45%;
+  padding-top: 45%;
 }
 .none text{
   padding-top: 30rpx;

+ 81 - 81
pages/weizhang/weizhang.js

@@ -1,81 +1,81 @@
-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.statusCode == 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.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 () {
+
+  }
+})

+ 1 - 1
pages/weizhang/weizhang.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "违约列表"
+  "defaultTitle": "违约列表"
 }

+ 78 - 78
pages/weizhang_detail/weizhang_detail.js

@@ -1,79 +1,79 @@
-var app = getApp();
-const util = require('../../utils/utils.js')
-Page({
-  data: {
-    detail:[],
-    order_no:''
-  },
-  onLoad: function (options) {
-    console.log(options)
-    my.showLoading({
-      content: '加载中...',
-      mask:true
-    })
-    app.request('/punishment_order?no='+options.no, '', 'GET').then(res => {
-      if (res.statusCode == 200) {
-        console.log(res)
-        // this.data.detail = res.data
-        this.setData({detail:res.data,order_no:options.no})
-      }
-      my.hideLoading({
-        complete: (res) => {},
-      })
-    })
-  },
-  pay:util.throttle(function() {
-    var data = {
-      no:this.data.order_no
-    }
-      app.request('/punishment_order/pay', data, 'POST').then(res => {
-        if (res.statusCode == 200) {
-          console.log(res)
-          my.requestPayment({ //调用微信支付
-            timeStamp: res.data.timeStamp.toString(),
-            nonceStr: res.data.nonceStr,
-            package: res.data.package,
-            signType: res.data.signType,
-            paySign: res.data.paySign,
-            success(resp) {
-              console.log(resp)
-              my.showToast({
-                content: '支付成功',
-                success:function(){
-                  my.navigateBack()
-                }
-              })
-            },
-            fail(err) {
-              // console.log(err)
-              // my.showToast({
-              //   title: '支付失败',
-              //   icon: 'none'
-              // })
-            }
-          })
-        }
-      })
-  },2000),
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+var app = getApp();
+const util = require('../../utils/utils.js')
+Page({
+  data: {
+    detail:[],
+    order_no:''
+  },
+  onLoad: function (options) {
+    console.log(options)
+    my.showLoading({
+      content: '加载中...',
+      mask:true
+    })
+    app.request('/punishment_order?no='+options.no, '', 'GET').then(res => {
+      if (res.status == 200) {
+        console.log(res)
+        // this.data.detail = res.data
+        this.setData({detail:res.data,order_no:options.no})
+      }
+      my.hideLoading({
+        complete: (res) => {},
+      })
+    })
+  },
+  pay:util.throttle(function() {
+    var data = {
+      no:this.data.order_no
+    }
+      app.request('/punishment_order/pay', data, 'POST').then(res => {
+        if (res.status == 200) {
+          console.log(res)
+          my.requestPayment({ //调用微信支付
+            timeStamp: res.data.timeStamp.toString(),
+            nonceStr: res.data.nonceStr,
+            package: res.data.package,
+            signType: res.data.signType,
+            paySign: res.data.paySign,
+            success(resp) {
+              console.log(resp)
+              my.showToast({
+                content: '支付成功',
+                success:function(){
+                  my.navigateBack()
+                }
+              })
+            },
+            fail(err) {
+              // console.log(err)
+              // my.showToast({
+              //   title: '支付失败',
+              //   icon: 'none'
+              // })
+            }
+          })
+        }
+      })
+  },2000),
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 1 - 1
pages/weizhang_detail/weizhang_detail.json

@@ -1,4 +1,4 @@
 {
   "usingComponents": {},
-  "navigationBarTitleText": "罚单详情"
+  "defaultTitle": "罚单详情"
 }

File diff suppressed because it is too large
+ 0 - 0
utils/qqmap-wx-jssdk.min.js


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