xvying 3 years ago
parent
commit
fb8299456e
76 changed files with 3854 additions and 3196 deletions
  1. 4 0
      .kaitian/project-ide.json
  2. 2 2
      .tea/entryFiles-development/index$.web.js
  3. 2 2
      .tea/entryFiles-development/index$.worker.js
  4. 2 2
      .tea/entryFiles-production/index$.web.js
  5. 0 0
      .tea/entryFiles-production/index$.worker.js
  6. 0 100
      app.acss
  7. 373 161
      app.js
  8. 53 52
      app.json
  9. 0 12
      components/foottip/foottip.acss
  10. 38 38
      components/foottip/foottip.js
  11. BIN
      img/zhi.png
  12. BIN
      img/zhi1.png
  13. 23 23
      pages/agreement/agreement.axml
  14. 7 0
      pages/authorization/authorization.acss
  15. 9 6
      pages/authorization/authorization.axml
  16. 7 2
      pages/authorization/authorization.js
  17. 1 1
      pages/authorization/authorization.json
  18. 10 2
      pages/balance/balance.acss
  19. 55 53
      pages/balance/balance.axml
  20. 206 197
      pages/balance/balance.js
  21. 4 4
      pages/balance/balance.json
  22. 2 1
      pages/breakdown/breakdown.acss
  23. 51 51
      pages/breakdown/breakdown.axml
  24. 323 323
      pages/breakdown/breakdown.js
  25. 4 2
      pages/buy-card/buy-card.acss
  26. 15 11
      pages/buy-card/buy-card.js
  27. 4 2
      pages/change_mobile/change_mobile.acss
  28. 15 14
      pages/change_mobile/change_mobile.axml
  29. 208 205
      pages/change_mobile/change_mobile.js
  30. 3 0
      pages/charge_rule/charge_rule.acss
  31. 2 0
      pages/coupon/coupon.acss
  32. 1 0
      pages/depoSuce/depoSuce.acss
  33. 2 0
      pages/index/index.acss
  34. 176 143
      pages/index/index.js
  35. 2 3
      pages/index/index.json
  36. 29 19
      pages/inputcode/inputcode.acss
  37. 1 10
      pages/inputcode/inputcode.axml
  38. 133 137
      pages/inputcode/inputcode.js
  39. 7 1
      pages/mine/mine.acss
  40. 65 64
      pages/mine/mine.axml
  41. 175 117
      pages/mine/mine.js
  42. 1 1
      pages/mine_card/mine_card.acss
  43. 2 1
      pages/mine_data/mine_data.acss
  44. 14 13
      pages/mine_data/mine_data.axml
  45. 1 0
      pages/my_account/my_account.acss
  46. 2 2
      pages/parking/parking.acss
  47. 51 48
      pages/parking/parking.axml
  48. 287 280
      pages/parking/parking.js
  49. 7 7
      pages/pay/pay.acss
  50. 123 123
      pages/pay/pay.axml
  51. 22 19
      pages/pay/pay.js
  52. 1 0
      pages/pay_success/pay_success.acss
  53. 1 0
      pages/phonelogin/phonelogin.acss
  54. 10 8
      pages/phonelogin/phonelogin.axml
  55. 72 67
      pages/phonelogin/phonelogin.js
  56. 8 3
      pages/real_name/real_name.acss
  57. 51 51
      pages/real_name/real_name.axml
  58. 1 0
      pages/refund_success/refund_success.acss
  59. 6 1
      pages/ride_zige/ride_zige.acss
  60. 2 2
      pages/ride_zige/ride_zige.axml
  61. 40 35
      pages/ride_zige/ride_zige.js
  62. 77 0
      pages/test/test.acss
  63. 50 5
      pages/test/test.axml
  64. 3 1
      pages/trip/trip.acss
  65. 36 36
      pages/trip/trip.axml
  66. 4 2
      pages/trip_detail/trip_detail.acss
  67. 50 50
      pages/trip_detail/trip_detail.axml
  68. 5 1
      pages/use_bike/use_bike.acss
  69. 170 170
      pages/use_bike/use_bike.axml
  70. 465 243
      pages/use_bike/use_bike.js
  71. 3 0
      pages/user_rules/user_rules.acss
  72. 86 86
      pages/user_rules/user_rules.axml
  73. 1 0
      pages/weizhang/weizhang.acss
  74. 79 78
      pages/weizhang_detail/weizhang_detail.js
  75. 109 103
      service/bluetooth.js
  76. 0 0
      utils/qqmap-wx-jssdk.min.js

+ 4 - 0
.kaitian/project-ide.json

@@ -0,0 +1,4 @@
+{
+  "ignoreHttpDomainCheck": true,
+  "ignoreWebViewDomainCheck": true
+}

+ 2 - 2
.tea/entryFiles-development/index$.web.js

@@ -4,6 +4,8 @@ require('./config$');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/authorization/authorization?hash=55a54d58d54db023cdd93414867929a95382a8fa');
 require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/buy-card/buy-card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/pay_success/pay_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
@@ -12,7 +14,6 @@ require('../../pages/charge_rule/charge_rule?hash=32d7d2807ed4e666ef03b4b3fe8c38
 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');
@@ -29,7 +30,6 @@ 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');

+ 2 - 2
.tea/entryFiles-development/index$.worker.js

@@ -35,6 +35,8 @@ require('../../app');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/authorization/authorization?hash=55a54d58d54db023cdd93414867929a95382a8fa');
 require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/buy-card/buy-card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/pay_success/pay_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
@@ -43,7 +45,6 @@ require('../../pages/charge_rule/charge_rule?hash=32d7d2807ed4e666ef03b4b3fe8c38
 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');
@@ -60,7 +61,6 @@ 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');

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

@@ -4,6 +4,8 @@ require('./config$');
 require('../../components/foottip/foottip?hash=ec7c5687c7f2ffa836caf3a93e877914426baff6');
 require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/test/test?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/inputcode/inputcode?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
+require('../../pages/authorization/authorization?hash=55a54d58d54db023cdd93414867929a95382a8fa');
 require('../../pages/pay/pay?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/buy-card/buy-card?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
 require('../../pages/pay_success/pay_success?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
@@ -12,7 +14,6 @@ require('../../pages/charge_rule/charge_rule?hash=32d7d2807ed4e666ef03b4b3fe8c38
 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');
@@ -29,7 +30,6 @@ 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');

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


File diff suppressed because it is too large
+ 0 - 100
app.acss


+ 373 - 161
app.js

@@ -1,59 +1,5 @@
 App({
   onLaunch: function () {
-    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){
-      this.token()
-    }else if(cha>data1){
-      my.removeStorageSync('token')
-      this.token()
-
-    }
-      this.token()
-
- 
-    // 登录
-    var that = this;
-    my.getSystemInfo({
-      success: res => {
-        console.log(res)
-        var system = res.system.trim().split(/\s+/)[1];
-        // var intNumber = system.substring(0, system.indexOf("."));
-        // if (res.platform == 'ios' && intNumber < 13 || res.SDKVersion < '2.1.0') {
-        //   console.log('低版本')
-        //   that.globalData.compatible = true;
-        //   my.reLaunch({
-        //     url: '/pages/compatible/index/index',
-        //   })
-        // }
-        // that.globalData.platform = res.platform
-        // that.globalData.version = res.version
-        // console.log(res.safeArea.bottom)
-        // console.log('手机信息res' + res.model)
-        // if (res.model == 'iPhone X' || res.model == 'iPhone XR' || res.model == 'iPhone XS Max') {
-        //   that.globalData.screenHeight = 'xSeries'
-        // } else if (res.safeArea.bottom >= 780) {
-        //   that.globalData.screenHeight = 'xSeries'
-        // }
-      }
-    })
-    if (my.getStorageSync({'key':'midTimes'}).data != '') {
-      var time = my.getStorageSync({'key':'midTimes'}).data;
-      var timestamp = Date.parse(new Date()) / 1000;
-      if (time <= timestamp) {
-        console.log('midtimes过期')
-        my.setStorageSync({'key':'midTimes',data:''})
-      }
-    }
-    var time = my.getStorageSync({'key':'token_time'}).data;
-    var timestamp = Date.parse(new Date());
-    if (time <= timestamp / 1000) {
-      console.log('token过期')
-      my.removeStorageSync('token_time')
-    }
     if (my.canIUse('getUpdateManager')) {
       const updateManager = my.getUpdateManager()
       updateManager.onCheckForUpdate(function (res) {
@@ -63,9 +9,9 @@ App({
               title: '更新提示',
               content: '新版本已经准备好,是否重启应用?',
               success: function (res) {
-                
-                  updateManager.applyUpdate()
-                
+
+                updateManager.applyUpdate()
+
               }
             })
           })
@@ -80,13 +26,10 @@ App({
     } else {
       my.alert({
         title: '提示',
-        content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+        content: '当前支付宝版本过低,无法使用该功能,请升级到最新支付宝版本后重试。'
       })
     }
-   //登录
-
-
-
+    console.log(my.getStorageSync({ 'key': 'token' }).data, 'XXXXXXXXXXXXXXXXXXXXX')
 
   },
   globalData: {
@@ -101,14 +44,16 @@ App({
     id: 0,
     times: 60,
     invalid: false,
+    scanLength: 9,//车辆编码数
     compatible: '',
     title: '禹见你', //全局修改此小程序名称
-    logoUrl: '/img/dingding.png', //logo图片路径 网络图片/本地图片 dejin.png  shanxianLg.png  yuzhouLg.png dingding.png
+    logoUrl: '../../img/logo.png', //logo图片路径 网络图片/本地图片 dejin.png  shanxianLg.png  yuzhouLg.png dingding.png
     appid: '2021002147603404', //小程序的appid wxc5f328a92356183f--遇见你appid
     merchant_id: '1',
     url: 'https://api.mtu.ximengnaikang.com/api', //线上域名
     // url: 'http://api.yutu.site.ximengnaikang.com/api', //本地域名
     mapKey: 'GTLBZ-F6BKO-5EDWH-SDHIX-K2ART-O2FRQ' //地图key值
+
   },
   request(api, params, method, req1) {
     var that = this;
@@ -116,7 +61,7 @@ App({
     if (req1) {
       that.globalData.req = false;
     }
-    if (my.getStorageSync({'key':'token'}).data != '' || my.getStorageSync({'key':'token'}).data != undefined) {
+    if (my.getStorageSync({ 'key': 'token' }).data != '' || my.getStorageSync({ 'key': 'token' }).data != undefined) {
       if (req1 == true || req1 == undefined) {
         return new Promise((resolve, reject) => {
           my.request({
@@ -126,18 +71,17 @@ App({
               'content-type': 'application/json',
               'Accept': 'application/json',
               'Cache-Control': 'no-cache',
-              'Authorization': my.getStorageSync({'key':'token'}).data,
+              'Authorization': my.getStorageSync({ 'key': 'token' }).data,
               'merchant-id': this.globalData.merchant_id,
-               'source-type': 'alipay'
+              'source-type': 'alipay'
             },
             method: method,
             success: (res) => {
-              resolve(res)
               // console.log(res)
               if (res.status == 450) {
                 return;
               }
-               if (res.status != 200) {
+              if (res.status != 200) {
                 if (res.data.message == '订单不存在或订单已结算') {
                   if (this.globalData.compatible) {
                     my.reLaunch({
@@ -168,30 +112,36 @@ App({
                   })
                 }
               }
-              if (res.status == 401) {
+
+              console.log(res, 'token-------------------------------------------')
+              resolve(res)
+            },
+            fail: (err) => {
+
+              if (err.status == 401) {
                 var timeout;
-                my.removeStorageSync('token')
-                my.removeStorageSync('token_time') 
+                console.log('token过期')
+                
+                my.removeStorageSync({key:'token'})
+                my.removeStorageSync({key:'token_time'})
                 // this.token()
                 my.reLaunch({
                   url: '/pages/index/index',
                 })
-              } else if (res.status == 404) {
+              } else if (err.status == 404) {
                 my.navigateTo({
                   url: '/pages/undefind/undefind',
                 })
+              } else {
+                my.showToast({
+                  content: err.data.message || err.data,
+                  icon: 'none',
+                  mask: true,
+                  duration: 3000,
+                });
               }
-            },
-            fail: (err) => {
-              my.showToast({
-                content: err.data.message || err.data,
-                icon: 'none',
-                mask: true,
-                duration: 3000,
-
-              });
-         console.log(err,'qingqiushibai')
-              reject(err,"请求失败")
+              console.log(err, 'qingqiushibai')
+              reject(err, "请求失败")
             },
             complete: () => {
               that.globalData.req = true
@@ -201,85 +151,347 @@ App({
       }
     }
   },
-  token:function(){
-    let that=this
-    my.getAuthCode({
-      success: function (res) {
-        my.getSystemInfo({
-          success(res) {
-            console.log(arr)
-          var  arr = [{
-                label: '品牌',
-                type: 'brand',
-                value: res.brand
-              },
-              {
-                label: '型号',
-                type: 'model',
-                value: res.model
-              },
-              {
-                label: '系统平台',
-                type: 'platform',
-                value: res.platform
-              },
-              {
-                label: '系统版本',
-                type: 'system',
-                value: res.system
-              },
-              {
-                label: '微信版本',
-                type: 'version',
-                value: res.version
-              },
-              {
-                label: '小程序版本',
-                type: 'SDKVersion',
-                value: res.SDKVersion
-              },
-              {
-                label: '定位状态',
-                type: 'locationEnabled',
-                value: res.locationEnabled ? '开' : '关'
-              },
-              {
-                label: '定位授权',
-                type: 'locationAuthorized',
-                value: res.locationAuthorized ? '已授权' : '未授权'
-              }
-            ]
+  login() {
+    let that = this
+    let token = my.getStorageSync({ 'key': 'token' }).data
+    let data = Math.round(new Date() / 1000);
+    let tokenTime = my.getStorageSync({ 'key': 'token_time' }).data;
+    let cha = data - tokenTime
+    let data1 = 60 * 60 * 24
+    return new Promise((resolve, reject) => {
+      if (token && cha < data1) {
+        console.log(Math.round(new Date() / 1000), 'test--------')
+
+        console.log(cha, 'test--------')
+        console.log(data1, 'test-data1-------')
+
+        return resolve();
+
+      } else {
+        my.getAuthCode({
+          success: (res) => {
+            // 发送 res.code 到后台换取 openId, sessionKey, unionId
+            if (res.authCode) {
+              console.log(res.authCode)
+              // var data = {
+              //   'code': res.authCode,
+              //   'appid': that.globalData.appid,
+              //   // 'phone_detail': JSON.stringify(arr),
+              //   'phone_detail': '',
+              //   'invite_user_id': that.globalData.id,
+              //   'language': 'zh'
+              // };
+              var data = {
+                'code': res.authCode,
+                'appid': that.globalData.appid,
+                'type': 1
+              };
+              my.request({
+                url: that.globalData.url + '/auth/weapp-login',
+                data: data,
+                headers: {
+                  'content-type': 'application/json',
+                  'Accept': 'application/json',
+                  'Cache-Control': 'no-cache',
+                  // 'Authorization': my.getStorageSync({ 'key': 'token' }).data,
+                  'merchant-id': that.globalData.merchant_id,
+                  'source-type': 'alipay'
+                },
+                method: 'POST',
+                success: (res) => {
+                  console.log(res, 'token')
+                  if (res.status == 401) {
+                    my.showToast({
+                      content: '登陆失败,请重新登录',
+                      icon: 'none'
+                    })
+                    setTimeout(function () {
+                      my.reLaunch({
+                        url: '/pages/authorization/authorization',
+                      })
+                    }, 1000)
+                  } else if (res.status != 200) {
+                    console.log(res, 'cesgu---------------')
+                    my.showToast({
+                      content: '登录失败,请刷新',
+                      icon: 'none'
+                    })
+                  } else {
+                    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 });
+                  }
+
+                  resolve()
+                }, fail: (err) => {
+                  my.showToast({
+                    // content: err.message,
+                    content: '121212',
+                    icon: 'none'
+                  })
+                }
+              })
+            } else {
+              my.showToast({
+                content: res.errMsg,
+                icon: none,
+              })
+            }
           }
         })
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
-        console.log(res.code)
-        var data = {
-        'code': res.authCode,
-          'appid': that.globalData.appid,
-          'type': 1
-        };
-        my.request({
-          url: that.globalData.url + '/auth/weapp-login',
-            data: data,
-            headers: {
-              'content-type': 'application/json',
-              'Accept': 'application/json',
-              'Cache-Control': 'no-cache',
-              'Authorization': my.getStorageSync({'key':'token'}).data,
-              'merchant-id': that.globalData.merchant_id
-            },
-          method:'POST',
-          success:(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});
-          },err:(err=>{
-            console.log(err,'登录错误---------------------------------')
-          })
-        })
-       
       }
     })
-  }
-})
+  },
+})
+// App({
+//   onLaunch: function () {
+
+//     // 登录
+//     var that = this;
+//     my.getSystemInfo({
+//       success: res => {
+//         console.log(res)
+//         var system = res.system.trim().split(/\s+/)[1];
+
+//       }
+//     })
+//     if (my.getStorageSync({'key':'midTimes'}).data != '') {
+//       var time = my.getStorageSync({'key':'midTimes'}).data;
+//       var timestamp = Date.parse(new Date()) / 1000;
+//       if (time <= timestamp) {
+//         console.log('midtimes过期')
+//         my.setStorageSync({'key':'midTimes',data:''})
+//       }
+//     }
+//     var time = my.getStorageSync({'key':'token_time'}).data;
+//     var timestamp = Date.parse(new Date());
+//     if (time <= timestamp / 1000) {
+//       console.log('token过期')
+//       my.removeStorageSync('token_time')
+//     }
+//     if (my.canIUse('getUpdateManager')) {
+//       const updateManager = my.getUpdateManager()
+//       updateManager.onCheckForUpdate(function (res) {
+//         if (res.hasUpdate) {
+//           updateManager.onUpdateReady(function () {
+//             my.alert({
+//               title: '更新提示',
+//               content: '新版本已经准备好,是否重启应用?',
+//               success: function (res) {
+
+//                   updateManager.applyUpdate()
+
+//               }
+//             })
+//           })
+//           updateManager.onUpdateFailed(function () {
+//             my.alert({
+//               title: '已经有新版本了哟~',
+//               content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
+//             })
+//           })
+//         }
+//       })
+//     } else {
+//       my.alert({
+//         title: '提示',
+//         content: '当前支付宝版本过低,无法使用该功能,请升级到最新支付宝版本后重试。'
+//       })
+//     }
+//    //登录
+//   },
+//   globalData: {
+//     statusBarHeight: my.getSystemInfoSync()['statusBarHeight'],
+//     windowHeight: my.getSystemInfoSync()['windowHeight'],
+//     imgUrl: 'http://resource.bike.hanyiyun.com/',
+//     screenHeight: '',
+//     login: false,
+//     platform: '',
+//     version: '',
+//     req: true,
+//     id: 0,
+//     times: 60,
+//     invalid: false,
+//     compatible: '',
+//     title: '禹见你', //全局修改此小程序名称
+//     logoUrl: '../../img/logo.png', //logo图片路径 网络图片/本地图片 dejin.png  shanxianLg.png  yuzhouLg.png dingding.png
+//     appid: '2021002147603404', //小程序的appid wxc5f328a92356183f--遇见你appid
+//     merchant_id: '1',
+//     url: 'https://api.mtu.ximengnaikang.com/api', //线上域名
+//     // url: 'http://api.yutu.site.ximengnaikang.com/api', //本地域名
+//     mapKey: 'GTLBZ-F6BKO-5EDWH-SDHIX-K2ART-O2FRQ' //地图key值
+//   },
+//   request(api, params, method, req1) {
+//     var that = this;
+//     if (req1 == false) return;
+//     if (req1) {
+//       that.globalData.req = false;
+//     }
+//     if (my.getStorageSync({'key':'token'}).data != '' || my.getStorageSync({'key':'token'}).data != undefined) {
+//       if (req1 == true || req1 == undefined) {
+//         return new Promise((resolve, reject) => {
+//           my.request({
+//             url: this.globalData.url + api,
+//             data: params,
+//             headers: {
+//               'content-type': 'application/json',
+//               'Accept': 'application/json',
+//               'Cache-Control': 'no-cache',
+//               'Authorization': my.getStorageSync({'key':'token'}).data,
+//               'merchant-id': this.globalData.merchant_id,
+//                'source-type': 'alipay'
+//             },
+//             method: method,
+//             success: (res) => {
+//               resolve(res)
+//               // console.log(res)
+//               if (res.status == 450) {
+//                 return;
+//               }
+//                if (res.status != 200) {
+//                 if (res.data.message == '订单不存在或订单已结算') {
+//                   if (this.globalData.compatible) {
+//                     my.reLaunch({
+//                       url: '/pages/compatible/index/index',
+//                     })
+//                   } else {
+//                     my.reLaunch({
+//                       url: '/pages/index/index',
+//                     })
+//                   }
+//                   return false;
+//                 } else if (res.data.message == '运动中不能关锁') {
+//                   return false;
+//                 }
+//                 if (res.message != undefined) {
+//                   my.showToast({
+//                     content: res.message,
+//                     icon: 'none',
+//                     duration: 3000,
+//                     mask: true
+//                   })
+//                 } else if (res.data.message != undefined) {
+//                   my.showToast({
+//                     content: res.data.message,
+//                     icon: 'none',
+//                     duration: 3000,
+//                     mask: true
+//                   })
+//                 }
+//               }
+//               if (res.status == 401) {
+//                 var timeout;
+//                 my.removeStorageSync('token')
+//                 my.removeStorageSync('token_time') 
+//                 // this.token()
+//                 my.reLaunch({
+//                   url: '/pages/index/index',
+//                 })
+//               } else if (res.status == 404) {
+//                 my.navigateTo({
+//                   url: '/pages/undefind/undefind',
+//                 })
+//               }
+//             },
+//             fail: (err) => {
+//               my.showToast({
+//                 content: err.data.message || err.data,
+//                 icon: 'none',
+//                 mask: true,
+//                 duration: 3000,
+
+//               });
+//          console.log(err,'qingqiushibai')
+//               reject(err,"请求失败")
+//             },
+//             complete: () => {
+//               that.globalData.req = true
+//             }
+//           })
+//         })
+//       }
+//     }
+//   },
+//   token:function(){
+//     let that=this
+//     my.getAuthCode({
+//       success: function (res) {
+//         my.getSystemInfo({
+//           success(res) {
+//             console.log(arr)
+//           var  arr = [{
+//                 label: '品牌',
+//                 type: 'brand',
+//                 value: res.brand
+//               },
+//               {
+//                 label: '型号',
+//                 type: 'model',
+//                 value: res.model
+//               },
+//               {
+//                 label: '系统平台',
+//                 type: 'platform',
+//                 value: res.platform
+//               },
+//               {
+//                 label: '系统版本',
+//                 type: 'system',
+//                 value: res.system
+//               },
+//               {
+//                 label: '支付宝版本',
+//                 type: 'version',
+//                 value: res.version
+//               },
+//               {
+//                 label: '小程序版本',
+//                 type: 'SDKVersion',
+//                 value: res.SDKVersion
+//               },
+//               {
+//                 label: '定位状态',
+//                 type: 'locationEnabled',
+//                 value: res.locationEnabled ? '开' : '关'
+//               },
+//               {
+//                 label: '定位授权',
+//                 type: 'locationAuthorized',
+//                 value: res.locationAuthorized ? '已授权' : '未授权'
+//               }
+//             ]
+//           }
+//         })
+//         // 发送 res.code 到后台换取 openId, sessionKey, unionId
+//         console.log(res.code)
+//         var data = {
+//         'code': res.authCode,
+//           'appid': that.globalData.appid,
+//           'type': 1
+//         };
+//         my.request({
+//           url: that.globalData.url + '/auth/weapp-login',
+//             data: data,
+//             headers: {
+//               'content-type': 'application/json',
+//               'Accept': 'application/json',
+//               'Cache-Control': 'no-cache',
+//               'Authorization': my.getStorageSync({'key':'token'}).data,
+//               'merchant-id': that.globalData.merchant_id
+//             },
+//           method:'POST',
+//           success:(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});
+//           },err:(err=>{
+//             console.log(err,'登录错误---------------------------------')
+//           })
+//         })
+
+//       }
+//     })
+//   }
+// })

+ 53 - 52
app.json

@@ -1,53 +1,54 @@
-{
-  "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": "你的位置信息将用于小程序位置接口的效果展示"
-    }
-  }
+{
+  "pages": [
+    "pages/index/index",
+    "pages/test/test",
+    "pages/inputcode/inputcode",
+
+    "pages/authorization/authorization",
+    "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/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/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",
+    "allowsBounceVertical":"YES"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  }
 }

+ 0 - 12
components/foottip/foottip.acss

@@ -1,13 +1 @@
 /* required by usingComponents */
-.button-tips{
-  position: fixed;
-  width: 100%;
-  bottom: 50rpx;
-  text-align: center;
-  font-size: 24rpx;
-  color: #999999;
-  left: 0;
-}
-.button-tips .xieyi{
-  color: #333333;
-}

+ 38 - 38
components/foottip/foottip.js

@@ -1,39 +1,39 @@
-// components/foottip/foottip.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-
-  },
-  onLoad: function (options) {
-
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  },
-  skipXieyi:function(){
-    my.navigateTo({
-      url: '/pages/agreement/agreement',
-    })
-  }
+// components/foottip/foottip.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+  onLoad: function (options) {
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+  skipXieyi:function(){
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  }
 })

BIN
img/zhi.png


BIN
img/zhi1.png


+ 23 - 23
pages/agreement/agreement.axml

@@ -1,24 +1,24 @@
-<!--隐私条款-->
-<view class="privacy">
-  <view class="priCon">
-    <view class="priTitle">隐私服务协议</view>
-    <view class="line"></view>
-    <view class="passage">
-      <view>
-        {{title}}平台重视对用户隐私的保护。请您务必认真阅读本政策,在确认充分了解并同意后使用{{title}}。如果您或者您的 监护人不同意本隐私政策的任何内容,您应该立即停止使用。 当您开始使用{{title}}平台,即表示您/您的监护人已经同意 我们按照本政策来收集、保存、使用、共享、保护您的个人信息。
-      </view>
-      <view>
-        <view>本隐私政策主要包括以下内容:</view>
-        <view>1、 本隐私政策中个人信息的定义与范围(包括:姓名、手机号码 用户密码、身份证号码、性别、年龄、征信信息、车辆信息、位置信息、defaultTitle信息、通话记录、录音录像、订单信息及交易状态、支付信息、设备信息、IP地址、手机充值记录)。
-        </view>
-        <view>2、{{title}}平台各业务功能收集个人信息的范围、收集方式、所收集个人信息与业务功能的关联。</view>
-        <view>3、{{title}}可能调用的手机权限、对应的业务功能、调用目的调用前是否询问以及用户关闭相应权限的方式。</view>
-        <view>4、个人信息的保存期限、存放地域、安全保护措施及安全事件处置等。</view>
-        <view>5、个人信息的使用规则。</view>
-        <view>6、何种情况下个人信息会被共享、转让、公开披露。</view>
-        <view>7、用户享有的访问、 更正、删除个人信息,撤回同意及投诉渠道。</view>
-        <view>8、未成年人保护。</view>
-      </view>
-    </view>
-  </view>
+<!--隐私条款-->
+<view class="privacy">
+  <view class="priCon">
+    <view class="priTitle">隐私服务协议</view>
+    <view class="line"></view>
+    <view class="passage">
+      <view>
+        {{title}}平台重视对用户隐私的保护。请您务必认真阅读本政策,在确认充分了解并同意后使用{{title}}。如果您或者您的 监护人不同意本隐私政策的任何内容,您应该立即停止使用。 当您开始使用{{title}}平台,即表示您/您的监护人已经同意 我们按照本政策来收集、保存、使用、共享、保护您的个人信息。
+      </view>
+      <view>
+        <view>本隐私政策主要包括以下内容:</view>
+        <view>1、 本隐私政策中个人信息的定义与范围(包括:姓名、手机号码 用户密码、身份证号码、性别、年龄、征信信息、车辆信息、位置信息、头像信息、通话记录、录音录像、订单信息及交易状态、支付信息、设备信息、IP地址、手机充值记录)。
+        </view>
+        <view>2、{{title}}平台各业务功能收集个人信息的范围、收集方式、所收集个人信息与业务功能的关联。</view>
+        <view>3、{{title}}可能调用的手机权限、对应的业务功能、调用目的调用前是否询问以及用户关闭相应权限的方式。</view>
+        <view>4、个人信息的保存期限、存放地域、安全保护措施及安全事件处置等。</view>
+        <view>5、个人信息的使用规则。</view>
+        <view>6、何种情况下个人信息会被共享、转让、公开披露。</view>
+        <view>7、用户享有的访问、 更正、删除个人信息,撤回同意及投诉渠道。</view>
+        <view>8、未成年人保护。</view>
+      </view>
+    </view>
+  </view>
 </view>

+ 7 - 0
pages/authorization/authorization.acss

@@ -27,6 +27,7 @@ page{
   margin: 0 auto;
   border-radius: 12rpx;
   margin-top: 150rpx;
+  line-height: 85rpx;
   background-color: var(--greenButton)!important;
 }
 .phonelogin{
@@ -50,4 +51,10 @@ button{
 background-color: transparent;
 outline: none;
 width: 90%!important;
+}
+.zhi1{
+  height: 70rpx;
+width: 70rpx;
+display: inline-block;
+vertical-align: middle;
 }

+ 9 - 6
pages/authorization/authorization.axml

@@ -1,11 +1,14 @@
 
 <view class="authorization">
   <view class="tip" onTap="noSign">暂不登录</view>
-  <image src="../../img/logo.png" class="logo" mode="widthFix"></image>
-  <view class="text">欢迎使用‘禹’见你</view>
+  <image src="{{logoUrl}}" class="logo" mode="widthFix"></image>
+  <view class="text">欢迎使用{{title}}</view>
 
-    <button class="wxlogin" open-type="getAuthorize" onGetAuthorize="getUserPhoneNumber" onError="onAuthError" scope='phoneNumber'>微信一键登录</button>
-  
-  <!-- <view class="phonelogin" onTap="phoneLogin">手机号注册/登录</view> -->
-  <!-- <foottip>登录即代表同意</foottip> -->
+    <button class="wxlogin" open-type="getAuthorize" onGetAuthorize="getUserPhoneNumber" onError="onAuthError" scope='phoneNumber'>
+    <image src="../../img/zhi1.png" class="zhi1"></image>
+    支付授权手机号登录</button>
+
+  <view class="button-tips" onTap="skipXieyi">
+    <text>登录即代表同意<text class="xieyi">《{{title}}用户协议》</text>  
+  </view>
 </view>

+ 7 - 2
pages/authorization/authorization.js

@@ -19,7 +19,7 @@ Page({
     this.setData({
       logoUrl: app.globalData.logoUrl
     })
-    my.removeStorageSync('token');
+    my.removeStorageSync({key:'token'});
     my.getAuthCode({
       success: function (res) {
         my.getSystemInfo({
@@ -46,7 +46,7 @@ Page({
               value: res.system
             },
             {
-              label: '微信版本',
+              label: '支付宝版本',
               type: 'version',
               value: res.version
             },
@@ -99,6 +99,11 @@ Page({
       }
     })
   },
+    skipXieyi:function(){
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
   onGotUserInfo: function (e) {
     console.log(e)
     if (e.detail.errMsg == "getUserInfo:fail auth deny") {

+ 1 - 1
pages/authorization/authorization.json

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

+ 10 - 2
pages/balance/balance.acss

@@ -1,5 +1,8 @@
 /* required by usingComponents */
 /* pages/balance/balance.wxss */
+page{
+  background: #ffffff;
+}
 .balance-top {
   height: 80rpx;
   text-align: center;
@@ -72,7 +75,11 @@
   background-color: #ffe02d;
 
 }
-
+@media (max-height: 500px) {
+   .bottom-card {
+        display: none;
+    }
+}
 .bottom-card {
   position: fixed;
   bottom: 0;
@@ -80,6 +87,7 @@
   padding: 50rpx 0;
   padding-bottom: 120rpx;
   width: 100%;
+  z-index: 333;
   box-shadow: 0 0 15px #f6f6f6;
 }
 
@@ -167,7 +175,7 @@
   height: 70rpx;
   /* width: 80%; */
   border: solid 1rpx var(--globleColor);
-  padding: 0 20rpx;
+  /* padding: 0 20rpx; */
   border-radius: 12rpx;
 
 }

+ 55 - 53
pages/balance/balance.axml

@@ -1,54 +1,56 @@
-<view class="balance">
-  <view class="balance-top">
-   注意:余额不可退还
-  </view>
-  <view class="chongzhi">
-    <view class="card">
-      <view class="yue" onTap="frameShow">
-        <text>车费余额</text>
-        <!-- <text class="iconfont icon-iconfontjiantou2"></text> -->
-      </view>
-      <view class="balance-num">
-        <text class="money">{{balance|parseFloat}}</text>
-        <text class="yuan">元</text>
-      </view>
-    </view>
-    <view class="money-list">
-      <view  class="{{currentNow==index ? 'active' : 'money-item'}}"  a:for="{{moneyList}}" a:key="{{index}}"  a:key='key' onTap="changeMoney" data-idx="{{index}}">
-        <text>{{index==Index?'充':''}}{{item.recharge_money}}元</text>
-        <text a:if="{{item.give_money!=0}}">送{{item.give_money}}元</text>
-        </view>
-        <view  class="{{currentNow==-1 ? 'active' : 'money-item'}}"  onTap="changeMoney"  data-idx="-1">
-        <text>自定义</text>
-        </view>
-    </view>
-    <view class="zidingyi" a:if="{{currentNow==-1}}">
- <input type="number" bindfocus="enter" bindinput="ckInp" value="{{inputValue}}" type="number" placeholder="自定义金额(1—1000内整数)" placeholder-class="no-input"/></view>
-  </view>
-  <view class="bottom-card">
-    <view class="bottom-list">
-      <view class="bottom-item1" onTap="pay">充值</view>
-    </view>
-    <foottip>充值即代表同意</foottip>
-  </view>
-  <!-- 自定义充值金额弹框 -->
-
-  <!-- 车费余额弹框 -->
-  <view class="frame" a:if="{{isShow==true}}" onTap="hideFrame">
-    <view class="frame-content">
-     <view class="frame-title">
-       车费余额0元,包含:
-     </view>
-     <view class="money-detail">
-       <view class="detail-item">
-         <view class="detail-nums">0</view>
-         <view class="detail-text">个人充值金额</view>
-       </view>
-       <view class="detail-item">
-        <view class="detail-nums">0</view>
-         <view class="detail-text">平台赠送金额</view>
-       </view>
-     </view>
-    </view>
-  </view>
+<view class="balance">
+  <view class="balance-top">
+   注意:余额不可退还
+  </view>
+  <view class="chongzhi">
+    <view class="card">
+      <view class="yue" onTap="frameShow">
+        <text>车费余额</text>
+        <!-- <text class="iconfont icon-iconfontjiantou2"></text> -->
+      </view>
+      <view class="balance-num">
+        <text class="money">{{balance|parseFloat}}</text>
+        <text class="yuan">元</text>
+      </view>
+    </view>
+    <view class="money-list">
+      <view  class="{{currentNow==index ? 'active' : 'money-item'}}"  a:for="{{moneyList}}" a:key="{{index}}"  a:key='key' onTap="changeMoney" data-idx="{{index}}">
+        <text>{{index==Index?'充':''}}{{item.recharge_money}}元</text>
+        <text a:if="{{item.give_money!=0}}">送{{item.give_money}}元</text>
+        </view>
+        <view  class="{{currentNow==-1 ? 'active' : 'money-item'}}"  onTap="changeMoney"  data-idx="-1">
+        <text>自定义</text>
+        </view>
+    </view>
+    <view class="zidingyi" a:if="{{currentNow==-1}}">
+ <input type="number" onFocus="enter" onInput="ckInp" value="{{inputValue}}" type="number" placeholder="自定义金额(1—1000内整数)" placeholder-class="no-input"/></view>
+  </view>
+  <view class="bottom-card">
+    <view class="bottom-list">
+      <view class="bottom-item1" onTap="pay">充值</view>
+    </view>
+   <view class="button-tips" onTap="skipXieyi">
+    <text>充值即代表同意<text class="xieyi">《禹见你用户协议》</text>  
+  </view>
+  </view>
+  <!-- 自定义充值金额弹框 -->
+
+  <!-- 车费余额弹框 -->
+  <view class="frame" a:if="{{isShow==true}}" onTap="hideFrame">
+    <view class="frame-content">
+     <view class="frame-title">
+       车费余额0元,包含:
+     </view>
+     <view class="money-detail">
+       <view class="detail-item">
+         <view class="detail-nums">0</view>
+         <view class="detail-text">个人充值金额</view>
+       </view>
+       <view class="detail-item">
+        <view class="detail-nums">0</view>
+         <view class="detail-text">平台赠送金额</view>
+       </view>
+     </view>
+    </view>
+  </view>
 </view>

+ 206 - 197
pages/balance/balance.js

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

+ 4 - 4
pages/balance/balance.json

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

+ 2 - 1
pages/breakdown/breakdown.acss

@@ -120,7 +120,7 @@ page {
 .active {
   border: solid 1rpx var(--globleColor);
   color: var(--globleColor);
-  background-color: #fff7d3;
+  background-color: var(--fillColor);
 }
 
 .input-problem {
@@ -234,6 +234,7 @@ page {
   width: 70%;
   margin: 0 auto;
   background-color: var(--globleColor);
+   color: var(--fontColor);
   text-align: center;
   height: 100rpx;
   line-height: 100rpx;

+ 51 - 51
pages/breakdown/breakdown.axml

@@ -1,52 +1,52 @@
-<view class="breakdown">
-  <view class="card_no">
-    <view class="card-left">
-      <view class="card-title" class="{{cardTitle==0 ? 'card-title' : 'card-title1'}}"> 上传车辆编号</view>
-      <input type="text" confirm-type="done" class="input-no" value="{{bike_no}}" placeholder="点击手动输入车辆编码"
-        placeholder-class="no-placeholder" bindinput="inputBikeNo" />
-    </view>
-    <view class="card-right" a:if="{{cardTitle==0}}" onTap="saoma"><text
-        class="iconfont icon-17-saoma"></text><text>扫码</text></view>
-  </view>
-  <view class="problem">
-    <view class="problem-title">问题类型</view>
-    <swiper class="problem-bike" indicator-dots='true' indicator-active-color='var(--globleColor)'>
-      <swiper-item class="item1">
-        <image src="../../img/bike-show.jpg"></image>
-      </swiper-item>
-      <swiper-item class="item1">
-        <image src="../../img/bike-show.jpg"></image>
-      </swiper-item>
-    </swiper>
-    <view class="option">
-      <view class="option-item-left" class="{{currentProblem==index ? 'active' : 'option-item-left'}}"
-        a:for="{{bikeError}}" a:key='key' onTap="selectProblem" data-index="{{index}}">{{item.name}}</view>
-    </view>
-    <view class="input-problem">
-      <textarea placeholder="请填写问题描述" placeholder-class="placeholder" bindinput="input" bindblur='blur'
-        bindconfirm='firm' maxlength="240"></textarea>
-      <text class="count">{{currentNum}}/240</text>
-    </view>
-  </view>
-  <view class="bike-photo">
-    <view class="card-title">请拍摄车辆照片</view>
-    <!-- -->
-    <view a:for="{{arr}}" class='photoList'>
-      <image src='{{item}}' style='width:130rpx;height:130rpx;margin:10rpx;' mode='aspectFill' onTap="imgYu"
-        data-index='{{index}}' mode="aspectFill"></image>
-      <view class="cha-icon">
-        <text class="iconfont icon-cha" style=" font-size: 24rpx;" onTap='delete1' data-index="{{index}}"></text>
-      </view>
-    </view>
-    <view class="photo-image" onTap='photo'>+</view>
-
-    <view class="photo">
-      <view class="photo-left">
-        <view class="photo-title">照片示例</view>
-        <view class="photo-text">请上传相关照片或(全车含编号)</view>
-      </view>
-      <view class="photo-right"></view>
-    </view>
-  </view>
-  <view class="problem-bt" onTap="submitForm">提交</view>
+<view class="breakdown">
+  <view class="card_no">
+    <view class="card-left">
+      <view class="card-title" class="{{cardTitle==0 ? 'card-title' : 'card-title1'}}"> 上传车辆编号</view>
+      <input type="text" confirm-type="done" class="input-no" value="{{bike_no}}" placeholder="点击手动输入车辆编码"
+        placeholder-class="no-placeholder" onInput="inputBikeNo" />
+    </view>
+    <view class="card-right" a:if="{{cardTitle==0}}" onTap="saoma"><text
+        class="iconfont icon-17-saoma"></text><text>扫码</text></view>
+  </view>
+  <view class="problem">
+    <view class="problem-title">问题类型</view>
+    <swiper class="problem-bike" indicator-dots='true' indicator-active-color='var(--globleColor)'>
+      <swiper-item class="item1">
+        <image src="../../img/bike-show.jpg"></image>
+      </swiper-item>
+      <swiper-item class="item1">
+        <image src="../../img/bike-show.jpg"></image>
+      </swiper-item>
+    </swiper>
+    <view class="option">
+      <view  class="{{currentProblem==index ? 'active' : 'option-item-left'}}"
+        a:for="{{bikeError}}" a:key='index' onTap="selectProblem" data-index="{{index}}">{{item.name}}</view>
+    </view>
+    <view class="input-problem">
+      <textarea placeholder="请填写问题描述" placeholder-class="placeholder" onInput="input" onBlur='blur'
+       onConfirm='firm'></textarea>
+      <!-- <text class="count">{{currentNum}}/240</text> -->
+    </view>
+  </view>
+  <view class="bike-photo">
+    <view class="card-title">请拍摄车辆照片</view>
+    <!-- -->
+    <view a:for="{{arr}}" class='photoList'>
+      <image src='{{item}}' style='width:130rpx;height:130rpx;margin:10rpx;' mode='aspectFill' onTap="imgYu"
+        data-index='{{index}}' mode="aspectFill"></image>
+      <view class="cha-icon">
+        <text class="iconfont icon-cha" style=" font-size: 24rpx;" onTap='delete1' data-index="{{index}}"></text>
+      </view>
+    </view>
+    <view class="photo-image" onTap='photo'>+</view>
+
+    <view class="photo">
+      <view class="photo-left">
+        <view class="photo-title">照片示例</view>
+        <view class="photo-text">请上传相关照片或(全车含编号)</view>
+      </view>
+      <view class="photo-right"></view>
+    </view>
+  </view>
+  <view class="problem-bt" onTap="submitForm">提交</view>
 </view>

+ 323 - 323
pages/breakdown/breakdown.js

@@ -1,324 +1,324 @@
-// pages/breakdown/breakdown.js
-var app = getApp();
-const util = require('../../utils/utils.js');
-var img = app.globalData.imgUrl;
-Page({
-
-  data: {
-    bikeError: [{
-      id: 1,
-      name: '刹车'
-    }, {
-      id: 2,
-      name: '车胎'
-    }, {
-      id: 3,
-      name: '链条'
-    },
-    {
-      id: 4,
-      name: '车座'
-    },
-    {
-      id: 5,
-      name: '二维码'
-    },
-    {
-      id: 6,
-      name: '其他'
-    },
-    ],
-    cardTitle: 0,
-    currentProblem: 0,
-  
-    count: 0, //已上传图片数
-    arr: [],//图片列表
-    currentNum: 0,//已输入的字数
-    value: '',
-    bike_no: '',//车辆编号
-    problemName:'',//故障名称
-    photos:[],
-
-  },
-  onLoad: function (options) {
-    let index=this.data.currentProblem
-    console.log(this.data.bikeError[index],'8989')
-
-    let name=this.data.bikeError[index].name
-    this.setData({
-      problemName:name
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  //扫描二维码获取车牌号
-  saoma: function () {
-    var that = this;
-    my.scanCode({
-      onlyFromCamera: true,
-      success: function (res) {
-        // console.log(res)
-        var index = res.result.lastIndexOf("\=");
-        var code = res.result.substring(index + 1, res.result.length);
-        console.log(code.length)
-        console.log(code)
-        if (code.length == 9) {
-          that.setData({
-            bike_no: code
-          })
-        } else {
-          my.showToast({
-            content: '请扫描正确的车辆二维码!',
-            icon: 'none'
-          })
-        }
-
-      },
-      fail: function (err) {
-        my.showToast({
-          content: '扫码失败~',
-          icon: 'none'
-        })
-      }
-    })
-  },
-  //选择故障类型
-  selectProblem: function (e) {
-  console.log(e)
-  let index=e.target.dataset.index
-  let name=this.data.bikeError[index].name
-    this.setData({
-      currentProblem: e.target.dataset.index,
-      problemName:name
-    })
-    
-  },
-  //输入车辆编号
-  inputBikeNo: function (e) {
-    console.log(e, '--------------------')
-    if (e.detail.value) {
-      this.setData({
-        cardTitle: 1,
-        bike_no:e.detail.value
-      })
-    } else {
-      this.setData({
-        cardTitle: 0
-      })
-    }
-  },
-  //输入问题
-  input: function (e) {
-
-    if (e.detail.cursor == 240) {
-      my.showToast({
-        content: '最多只能输入240个字符',
-        icon: 'none'
-      })
-    } else {
-      console.log(e,'wenti')
-      this.setData({
-        value: e.detail.value,
-        currentNum: e.detail.cursor,
-      })
-    }
-  },
-  //失去焦点时触发获取value
-  blur: function (e) {
-    this.setData({
-      value: e.detail.value
-    })
-  },
-  //点击小键盘上的完成时触发获取value
-  firm: function (e) {
-    this.setData({
-      value: e.detail.value
-    })
-  },
-  //拍照
-  photo: function () {
-    var that = this;
-    var number = 3 - that.data.arr.length;
-    console.log(number)
-    if (number >= 0) {
-      my.chooseImage({
-        count: 1, // 默认9
-        sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
-        sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
-        success: function (res) {
-          console.log(res)
-          let count = that.data.count + 1;
-          that.setData({
-            count
-          })
-          // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
-          var tempFilePaths = res.tempFilePaths
-          that.setData({
-            arr: that.data.arr.concat(tempFilePaths)
-          })
-
-          that.uploadimg({
-            url: app.globalData.url + '/upload/image',
-            path: tempFilePaths
-          });
-        }
-      })
-    } else {
-      my.showToast({
-        title: '最多能上传4张图片',
-        icon: 'none'
-      })
-    }
-  },
-  //上传图片
-  uploadimg: function (data) {
-    var that = this,
-      i = data.i ? data.i : 0, //当前上传的哪张图片
-      success = data.success ? data.success : 0, //上传成功的个数
-      fail = data.fail ? data.fail : 0; //上传失败的个数
-    my.uploadFile({
-      url: data.url,
-      filePath: data.path[i],
-      header: {
-        'content-type': 'application/x-www-form-urlencoded',
-        'Authorization': my.getStorageSync({'key':'token'}).data,
-        'merchant-id': app.globalData.merchant_id
-      },
-      name: 'file', //这里根据自己的实际情况改
-      formData: {
-        type: 'trouble'
-      }, //这里是上传图片时一起上传的数据
-      success: (resp) => {
-        success++; //图片上传成功,图片上传成功的变量+1
-        console.log(resp)
-        var data = JSON.parse(resp.data)
-        var photo1 = [];
-        if (data.length > 1) {
-          for (var i = 0; i < data.length; i++) {
-            photo1.push(data[i].id)
-          }
-        } else {
-          photo1.push(data.id)
-        }
-        that.setData({
-          photos: that.data.photos.concat(photo1)
-        })
-        //这里可能有BUG,失败也会执行这里,所以这里应该是后台返回过来的状态码为成功时,这里的success才+1
-      },
-      fail: (res) => {
-        fail++; //图片上传失败,图片上传失败的变量+1
-        console.log('fail:' + i + "fail:" + fail);
-      },
-      complete: () => {
-        i++; //这个图片执行完上传后,开始上传下一张
-        if (i == data.path.length) { //当图片传完时,停止调用          
-          //console.log('执行完毕');
-          //console.log('成功:' + success + " 失败:" + fail);
-        } else { //若图片还没有传完,则继续调用函数
-          //console.log(i);
-          data.i = i;
-          data.success = success;
-          data.fail = fail;
-          that.uploadimg(data);
-        }
-      }
-    });
-  },
-  //点击提交问题保修
-  submitForm: util.throttle(function () {
-    //点击提交
-    // this.setData({show:true})
-    var that = this;
-    if (this.data.value == '') {
-      my.alert({
-        title: '提示',
-        content: '问题描述不能为空'
-      })
-      return;
-    } else if (this.data.value.length < 2) {
-      my.alert({
-        title: '提示',
-        content: '请输入不少于2个字的描述',
-      })
-      return;
-    } else if (that.data.problemName == '') {
-      my.alert({
-        title: '提示',
-        content: '请选择故障部位',
-      })
-      return;
-    }else if (that.data.bike_no.length != 9) {
-      console.log(that.data.bike_no,'bike_No')
-      my.showToast({
-        content: '车牌号输入不正确',
-        icon:'none'
-      })
-      return;
-    } else {
-      var tu = '';
-      if (that.data.photos != '') {
-        var photo = that.data.photos;
-        var photo1 = [];
-        for (var i = 0; i < photo.length; i++) {
-          photo1.push(photo[i])
-        }
-        console.log(photo1)
-        tu = photo1.toString();
-        console.log(tu)
-      }
-      if (app.globalData.req) {
-        var data = {
-          bike_no: that.data.bike_no,
-          area_id: my.getStorageSync({'key':'home'}).data.id,
-          trouble_part: that.data.problemName,
-          trouble_description: that.data.value,
-          trouble_imgs: tu
-        }
-        console.log(data)
-        app.request('/trouble', data, 'POST', app.globalData.req).then(res => {
-          console.log(res)
-          if (res.data.is_up_trouble == true) {
-          my.showToast({
-            content: '报修成功',
-            success:{
-            
-            }
-          })
-          setTimeout(function(){
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          },1500)
-          }
-        }).catch(err => {
-          console.log(err)
-        })
-      } else {
-        my.showToast({
-          content: '您的操作过于频繁,请稍后再试~',
-          icon: 'none'
-        })
-      }
-
-    }
-  }, 1000),
-//删除照片
-delete1: function (e) {
-  var that = this;
-  var index = e.currentTarget.dataset.index;
-  var list = that.data.arr;
-  var photos = that.data.photos
-  console.log(photos)
-  list.splice(index, 1);
-  photos.splice(index, 1);
-  that.setData({
-    arr: list,
-    photos,
-    count:photos.length
-  })
-},
+// pages/breakdown/breakdown.js
+var app = getApp();
+const util = require('../../utils/utils.js');
+var img = app.globalData.imgUrl;
+Page({
+
+  data: {
+    bikeError: [{
+      id: 1,
+      name: '刹车'
+    }, {
+      id: 2,
+      name: '车胎'
+    }, {
+      id: 3,
+      name: '链条'
+    },
+    {
+      id: 4,
+      name: '车座'
+    },
+    {
+      id: 5,
+      name: '二维码'
+    },
+    {
+      id: 6,
+      name: '其他'
+    },
+    ],
+    cardTitle: 0,
+    currentProblem: 0,
+  
+    count: 0, //已上传图片数
+    arr: [],//图片列表
+    currentNum: 0,//已输入的字数
+    value: '',
+    bike_no: '',//车辆编号
+    problemName:'',//故障名称
+    photos:[],
+
+  },
+  onLoad: function (options) {
+    let index=this.data.currentProblem
+    console.log(this.data.bikeError[index],'8989')
+
+    let name=this.data.bikeError[index].name
+    this.setData({
+      problemName:name
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  //扫描二维码获取车牌号
+  saoma: function () {
+    var that = this;
+    my.scan({
+      onlyFromCamera: true,
+      success: function (res) {
+        // console.log(res)
+        var index = res.result.lastIndexOf("\=");
+        var code = res.result.substring(index + 1, res.result.length);
+        console.log(code.length)
+        console.log(code)
+        if (code.length == 9) {
+          that.setData({
+            bike_no: code
+          })
+        } else {
+          my.showToast({
+            content: '请扫描正确的车辆二维码!',
+            icon: 'none'
+          })
+        }
+
+      },
+      fail: function (err) {
+        my.showToast({
+          content: '扫码失败~',
+          icon: 'none'
+        })
+      }
+    })
+  },
+  //选择故障类型
+  selectProblem: function (e) {
+  console.log(e)
+  let index=e.currentTarget.dataset.index
+  let name=this.data.bikeError[index].name
+    this.setData({
+      currentProblem: e.currentTarget.dataset.index,
+      problemName:name
+    })
+    
+  },
+  //输入车辆编号
+  inputBikeNo: function (e) {
+    console.log(e, '--------------------')
+    if (e.detail.value) {
+      this.setData({
+        cardTitle: 1,
+        bike_no:e.detail.value
+      })
+    } else {
+      this.setData({
+        cardTitle: 0
+      })
+    }
+  },
+  //输入问题
+  input: function (e) {
+
+    if (e.detail.cursor == 240) {
+      my.showToast({
+        content: '最多只能输入240个字符',
+        icon: 'none'
+      })
+    } else {
+      console.log(e,'wenti')
+      this.setData({
+        value: e.detail.value,
+        currentNum: e.detail.cursor,
+      })
+    }
+  },
+  //失去焦点时触发获取value
+  blur: function (e) {
+    this.setData({
+      value: e.detail.value
+    })
+  },
+  //点击小键盘上的完成时触发获取value
+  firm: function (e) {
+    this.setData({
+      value: e.detail.value
+    })
+  },
+  //拍照
+  photo: function () {
+    var that = this;
+    var number = 3 - that.data.arr.length;
+    console.log(number)
+    if (number >= 0) {
+      my.chooseImage({
+        count: 1, // 默认9
+        sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
+        sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+        success: function (res) {
+          console.log(res)
+          let count = that.data.count + 1;
+          that.setData({
+            count
+          })
+          // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
+          var tempFilePaths = res.tempFilePaths
+          that.setData({
+            arr: that.data.arr.concat(tempFilePaths)
+          })
+
+          that.uploadimg({
+            url: app.globalData.url + '/upload/image',
+            path: tempFilePaths
+          });
+        }
+      })
+    } else {
+      my.showToast({
+        title: '最多能上传4张图片',
+        icon: 'none'
+      })
+    }
+  },
+  //上传图片
+  uploadimg: function (data) {
+    var that = this,
+      i = data.i ? data.i : 0, //当前上传的哪张图片
+      success = data.success ? data.success : 0, //上传成功的个数
+      fail = data.fail ? data.fail : 0; //上传失败的个数
+    my.uploadFile({
+      url: data.url,
+      filePath: data.path[i],
+      header: {
+        'content-type': 'application/x-www-form-urlencoded',
+        'Authorization': my.getStorageSync({'key':'token'}).data,
+        'merchant-id': app.globalData.merchant_id
+      },
+      name: 'file', //这里根据自己的实际情况改
+      formData: {
+        type: 'trouble'
+      }, //这里是上传图片时一起上传的数据
+      success: (resp) => {
+        success++; //图片上传成功,图片上传成功的变量+1
+        console.log(resp)
+        var data = JSON.parse(resp.data)
+        var photo1 = [];
+        if (data.length > 1) {
+          for (var i = 0; i < data.length; i++) {
+            photo1.push(data[i].id)
+          }
+        } else {
+          photo1.push(data.id)
+        }
+        that.setData({
+          photos: that.data.photos.concat(photo1)
+        })
+        //这里可能有BUG,失败也会执行这里,所以这里应该是后台返回过来的状态码为成功时,这里的success才+1
+      },
+      fail: (res) => {
+        fail++; //图片上传失败,图片上传失败的变量+1
+        console.log('fail:' + i + "fail:" + fail);
+      },
+      complete: () => {
+        i++; //这个图片执行完上传后,开始上传下一张
+        if (i == data.path.length) { //当图片传完时,停止调用          
+          //console.log('执行完毕');
+          //console.log('成功:' + success + " 失败:" + fail);
+        } else { //若图片还没有传完,则继续调用函数
+          //console.log(i);
+          data.i = i;
+          data.success = success;
+          data.fail = fail;
+          that.uploadimg(data);
+        }
+      }
+    });
+  },
+  //点击提交问题保修
+  submitForm: util.throttle(function () {
+    //点击提交
+    // this.setData({show:true})
+    var that = this;
+    if (this.data.value == '') {
+      my.alert({
+        title: '提示',
+        content: '问题描述不能为空'
+      })
+      return;
+    } else if (this.data.value.length < 2) {
+      my.alert({
+        title: '提示',
+        content: '请输入不少于2个字的描述',
+      })
+      return;
+    } else if (that.data.problemName == '') {
+      my.alert({
+        title: '提示',
+        content: '请选择故障部位',
+      })
+      return;
+    }else if (that.data.bike_no.length != 9) {
+      console.log(that.data.bike_no,'bike_No')
+      my.showToast({
+        content: '车牌号输入不正确',
+        icon:'none'
+      })
+      return;
+    } else {
+      var tu = '';
+      if (that.data.photos != '') {
+        var photo = that.data.photos;
+        var photo1 = [];
+        for (var i = 0; i < photo.length; i++) {
+          photo1.push(photo[i])
+        }
+        console.log(photo1)
+        tu = photo1.toString();
+        console.log(tu)
+      }
+      if (app.globalData.req) {
+        var data = {
+          bike_no: that.data.bike_no,
+          area_id: my.getStorageSync({'key':'home'}).data.id,
+          trouble_part: that.data.problemName,
+          trouble_description: that.data.value,
+          trouble_imgs: tu
+        }
+        console.log(data)
+        app.request('/trouble', data, 'POST', app.globalData.req).then(res => {
+          console.log(res)
+          if (res.data.is_up_trouble == true) {
+          my.showToast({
+            content: '报修成功',
+            success:{
+            
+            }
+          })
+          setTimeout(function(){
+            my.reLaunch({
+              url: '/pages/index/index',
+            })
+          },1500)
+          }
+        }).catch(err => {
+          console.log(err)
+        })
+      } else {
+        my.showToast({
+          content: '您的操作过于频繁,请稍后再试~',
+          icon: 'none'
+        })
+      }
+
+    }
+  }, 1000),
+//删除照片
+delete1: function (e) {
+  var that = this;
+  var index = e.currentTarget.dataset.index;
+  var list = that.data.arr;
+  var photos = that.data.photos
+  console.log(photos)
+  list.splice(index, 1);
+  photos.splice(index, 1);
+  that.setData({
+    arr: list,
+    photos,
+    count:photos.length
+  })
+},
 })

+ 4 - 2
pages/buy-card/buy-card.acss

@@ -32,7 +32,7 @@ page {
   position: relative;
   padding: 30rpx;
   border-radius: 20rpx;
-  background: #ffe98f;
+  background: var(--fillColor);
   border: solid 5rpx var(--globleColor);
 }
 
@@ -90,7 +90,7 @@ page {
   padding: 20rpx 0;
   border-radius: 30rpx;
   margin-top: 30rpx;
-  background: #ffe98f;
+  background: var(--fillColor);
   border: solid 5rpx var(--globleColor);
 }
 .right-tips{
@@ -120,6 +120,7 @@ border-radius:50rpx;
 line-height: 100rpx;
 font-size: 32rpx;
 font-weight: bold;
+ color: var(--fontColor);
 }
 .box .top {
   width: 92%;
@@ -452,6 +453,7 @@ font-weight: bold;
   font-size: 28rpx;
   background:var(--globleColor);
   border-radius: 40rpx;
+   color: var(--fontColor);
 }
 
 .model .view .content {

+ 15 - 11
pages/buy-card/buy-card.js

@@ -87,7 +87,7 @@ Page({
         'area_id': area_id
       }
       app.request("/card_riding/pay", data, "POST", app.globalData.req).then(res => {
-        console.log(res,'------')
+        console.log(res, '------')
         if (res.status == 200) {
           that.setData({
             no: res.data.no
@@ -95,16 +95,20 @@ Page({
           my.tradePay({
             tradeNO: res.data.tradeNo,
             success: function (res) {
-              my.showToast({
-                content: '购买成功,请用车',
-                icon: 'none',
-                mask: true,
-                success: function () {
-                  my.reLaunch({
-                    url: '/pages/index/index',
-                  })
-                }
-              })
+              if (res.resultCode == 9000) {
+                my.showToast({
+                  content: '购买成功,请用车',
+                  icon: 'none',
+                  mask: true,
+                  success: function () {
+                    my.reLaunch({
+                      url: '/pages/index/index',
+                    })
+                  }
+                })
+              } else {
+                return
+              }
             },
             fail(err) {
               console.log(err)

+ 4 - 2
pages/change_mobile/change_mobile.acss

@@ -15,7 +15,7 @@ page {
 }
 
 .list-item {
-  height: 100rpx;
+  /* height: 100rpx; */
   /* line-height: 100rpx; */
   font-size: 28rpx;
   border-bottom: solid 1rpx #e5e5e5;
@@ -28,10 +28,11 @@ page {
   top:20rpx;
   width: 200rpx!important;
   font-size: 28rpx!important;
-  padding:10rpx 0rpx!important;
+  /* padding:10rpx 0rpx!important; */
   z-index: 999;
   /* margin-top: 10rpx; */
   background-color: var(--globleColor);
+  color: var(--fontColor);
 }
 
 
@@ -75,6 +76,7 @@ page {
   margin: 0 auto;
   text-align: center;
   background-color: var(--globleColor);
+   color: var(--fontColor);
   border-radius: 40rpx;
   font-size: 28rpx;
   font-weight: 500;

+ 15 - 14
pages/change_mobile/change_mobile.axml

@@ -1,15 +1,16 @@
-<view class="mine-data">
-  <view class="mine-data-list">
-    <view class="list-item">
-      <input type="text" placeholder="新手机号" class="new-phone" placeholder-class="no-num" bindblur="ckPhone" value="{{phoneVal}}" type="number" bindinput="ckPhone"/>
-      <button class="wxlogin" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">一键获取</button>
-    </view>
-    <view class="list-item" a:if="{{codeIshow==true}}">
-      <input type="text" name="" id="" placeholder="验证码" class="code" placeholder-class="no-num"/>
-      <view class="get-yanzheng" onTap="{{code == '获取验证码' ? 'getCode' : ''}}" disabled="{{codeDisable}}">{{code}}</view>
-    </view>
-  </view>
-  <view class="change" onTap="verify">更换</view>
-
-
+<view class="mine-data">
+  <view class="mine-data-list">
+    <view class="list-item">
+      <input type="text" placeholder="新手机号" class="new-phone" placeholder-class="no-num" onBlur="ckPhone" value="{{phoneVal}}" type="number" onInput="ckPhone"/>
+      <button class="wxlogin" open-type="getAuthorize" onGetAuthorize="getPhoneNumber" onError="onAuthError" scope='phoneNumber'>一键获取</button>
+    
+    </view>
+    <view class="list-item" a:if="{{codeIshow==true}}">
+      <input type="text" name="" id="" placeholder="验证码" class="code" placeholder-class="no-num"/>
+      <view class="get-yanzheng" onTap="{{code == '获取验证码' ? 'getCode' : ''}}" disabled="{{codeDisable}}">{{code}}</view>
+    </view>
+  </view>
+  <view class="change" onTap="verify">更换</view>
+
+
 </view>

+ 208 - 205
pages/change_mobile/change_mobile.js

@@ -1,206 +1,209 @@
-// pages/change_mobile/change_mobile.js
-var app = getApp();
-const util = require('../../utils/utils.js');
-let timer1 = null;
-var arr = [];
-
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    smsVal: '', //输入的短信验证码
-    phoneVal: '', //输入的手机号码
-    code: '获取验证码', //获取短信验证码
-    currentTime: 60, //倒计时秒数
-    codeDisabled: false, //是否禁用按钮
-    timer: null, //定时器
-    codeIshow:true,//获取验证码是否显示
-  },
-  onLoad: function (options) {
-    // this.setData({
-    //   phoneVal: my.getStorageSync('userInfo').mobile
-    // })
-  },
-  //验证手机号
-  ckPhone(e) {
-    this.setData({
-      phoneVal: e.detail.value
-    })
-  },
-
-  //验证短信验证码
-  ckSms(e) {
-    this.setData({
-      smsVal: e.detail.value
-    })
-  },
-  change: function () {
-    my.navigateTo({
-      url: '/pages/mine/mine',
-    })
-  },
-  //获取验证码 
-  getCode: util.throttle(function () {
-    let self = this
-    let currentTime = self.data.currentTime
-    let timer = self.data.timer
-    if (self.data.phoneVal.length != 11) {
-      my.showToast({
-        content: '请输入正确的手机号',
-        icon: 'none',
-        duration: 2000
-      })
-    } else {
-      // 调用短信验证码接口
-      let data = {
-        mobile: this.data.phoneVal,
-        type: 2
-      }
-      app.request('/verification-code', data, 'POST').then(res => {
-        console.log(res)
-        if (res.status == 200) {
-          if (!timer) {
-            timer = setInterval(() => {
-              if (currentTime > 0 && currentTime <= 60) {
-                currentTime--;
-              }
-              if (currentTime !== 0) {
-                self.setData({
-                  code: "重新发送" + "(" + currentTime + ")",
-                  codeDisabled: true,
-                })
-              } else {
-                clearInterval(timer);
-                self.setData({
-                  code: '获取验证码',
-                  codeDisabled: false,
-                  currentTime: 60,
-                  timer: null,
-                })
-              }
-            }, 1000)
-          }
-        }
-      })
-      //60秒倒计时
-
-    }
-  }, 1000),
-  verify: util.throttle(function () {
-    let reg = 11 && /^[1](([3][0-9])|([4][5-9])|([5][0-3,5-9])|([6][5,6])|([7][0-8])|([8][0-9])|([9][1,8,9]))[0-9]{8}$/;
-    let reg1 = /^\d{4}$/
-    if (!reg1.test(this.data.smsVal)) {
-      my.showToast({
-        content: '请输入短信验证码',
-        icon: 'none',
-        duration: 2000
-      })
-    }
-    if (!reg.test(this.data.phoneVal)) {
-      my.showToast({
-        content: '请输入正确的手机号',
-        icon: 'none',
-        duration: 2000
-      })
-      return;
-    } else if (!this.data.smsVal) {
-      my.showToast({
-        content: '短信验证码不能为空',
-        icon: 'none',
-        duration: 2000
-      })
-      return;
-    } else {
-      if (app.globalData.req) {
-        let data = {
-          mobile: this.data.phoneVal,
-          code: this.data.smsVal
-        }
-        app.request('/user/bind-mobile', data, 'POST', app.globalData.req).then(res => {
-          if (res.status == 200) {
-            my.showToast({
-              content: '换绑成功',
-              icon: 'none'
-            })
-          }
-          if (res.status == 422) {
-            console.log(res)
-            my.showToast({
-              content: res.data.errors.mobile[0],
-              icon: 'none',
-              duration: 2000
-            })
-          }
-        })
-      } else {
-        my.showToast({
-          content: '您的操作过于频繁,请稍后再试~',
-          icon: 'none'
-        })
-      }
-    }
-  }, 1000),
-  //获取手机号
-  getPhoneNumber: function (e) {
-    let that = this
-    if (e.detail.errMsg == "getPhoneNumber:ok") {
-      let data = {
-        session_key: my.getStorageSync({'key':'setting'}).data,
-        iv: e.detail.iv,
-        encryptedData: e.detail.encryptedData
-      }
-      app.request('/user/bind-wechat-mobile', data, 'POST').then(res => {
-        if (res.status == 200) {
-          console.log(res.data, '手机号')
-          if (res.data.is_bind_mobile==true) {
-            my.showToast({
-              content: '当前手机号已绑定',
-              icon:'none'
-            })
-            return
-          } else {
-            that.setData({
-              phoneVal: e.detail.value,
-              codeIshow:false
-            })
-          }
-        }
-      })
-    } else {
-      my.showToast({
-        content: '获取手机号失败',
-        icon: 'none',
-        duration: 2000
-      })
-    }
-  },
-
-
-
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-
-  onShareAppMessage: function () {
-
-  },
-
+// pages/change_mobile/change_mobile.js
+var app = getApp();
+const util = require('../../utils/utils.js');
+let timer1 = null;
+var arr = [];
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    smsVal: '', //输入的短信验证码
+    phoneVal: '', //输入的手机号码
+    code: '获取验证码', //获取短信验证码
+    currentTime: 60, //倒计时秒数
+    codeDisabled: false, //是否禁用按钮
+    timer: null, //定时器
+    codeIshow: true,//获取验证码是否显示
+  },
+  onLoad: function (options) {
+    // this.setData({
+    //   phoneVal: my.getStorageSync('userInfo').mobile
+    // })
+  },
+  //验证手机号
+  ckPhone(e) {
+    this.setData({
+      phoneVal: e.detail.value
+    })
+  },
+
+  //验证短信验证码
+  ckSms(e) {
+    this.setData({
+      smsVal: e.detail.value
+    })
+  },
+  change: function () {
+    my.navigateTo({
+      url: '/pages/mine/mine',
+    })
+  },
+  //获取验证码 
+  getCode: util.throttle(function () {
+    let self = this
+    let currentTime = self.data.currentTime
+    let timer = self.data.timer
+    if (self.data.phoneVal.length != 11) {
+      my.showToast({
+        content: '请输入正确的手机号',
+        icon: 'none',
+        duration: 2000
+      })
+    } else {
+      // 调用短信验证码接口
+      let data = {
+        mobile: this.data.phoneVal,
+        type: 2
+      }
+      app.request('/verification-code', data, 'POST').then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          if (!timer) {
+            timer = setInterval(() => {
+              if (currentTime > 0 && currentTime <= 60) {
+                currentTime--;
+              }
+              if (currentTime !== 0) {
+                self.setData({
+                  code: "重新发送" + "(" + currentTime + ")",
+                  codeDisabled: true,
+                })
+              } else {
+                clearInterval(timer);
+                self.setData({
+                  code: '获取验证码',
+                  codeDisabled: false,
+                  currentTime: 60,
+                  timer: null,
+                })
+              }
+            }, 1000)
+          }
+        }
+      })
+      //60秒倒计时
+
+    }
+  }, 1000),
+  verify: util.throttle(function () {
+    let reg = 11 && /^[1](([3][0-9])|([4][5-9])|([5][0-3,5-9])|([6][5,6])|([7][0-8])|([8][0-9])|([9][1,8,9]))[0-9]{8}$/;
+    let reg1 = /^\d{4}$/
+    if (!reg1.test(this.data.smsVal)) {
+      my.showToast({
+        content: '请输入短信验证码',
+        icon: 'none',
+        duration: 2000
+      })
+    }
+    if (!reg.test(this.data.phoneVal)) {
+      my.showToast({
+        content: '请输入正确的手机号',
+        icon: 'none',
+        duration: 2000
+      })
+      return;
+    } else if (!this.data.smsVal) {
+      my.showToast({
+        content: '短信验证码不能为空',
+        icon: 'none',
+        duration: 2000
+      })
+      return;
+    } else {
+      if (app.globalData.req) {
+        let data = {
+          mobile: this.data.phoneVal,
+          code: this.data.smsVal
+        }
+        app.request('/user/bind-mobile', data, 'POST', app.globalData.req).then(res => {
+          if (res.status == 200) {
+
+            my.showToast({
+              content: '换绑成功',
+              icon: 'none'
+            })
+
+          }
+
+        }).catch(err => {
+          if (err.status == 422) {
+            console.log(res)
+            my.showToast({
+              content: res.data.errors.mobile[0],
+              icon: 'none',
+              duration: 2000
+            })
+          }
+        })
+      } else {
+        my.showToast({
+          content: '您的操作过于频繁,请稍后再试~',
+          icon: 'none'
+        })
+      }
+    }
+  }, 1000),
+  //获取手机号
+  getPhoneNumber: function (e) {
+    let that = this
+    my.getPhoneNumber({
+      success: (res) => {
+        let encryptedData = JSON.parse(res.response).response;
+        //userObject.phoneInfo = res.response;
+        console.log(res, 'xying');
+        //手机号解密请求
+        // phoneAuth(res.response);
+        let data = {
+          session_key: encryptedData
+        }
+        app.request('/user/bind-wechat-mobile', data, 'POST', app.globalData.req).then(res => {
+          if (res.status == 200) {
+            console.log(res.data, '手机号')
+            if (res.data.is_bind_mobile == true) {
+              my.showToast({
+                content: '当前手机号已绑定',
+                icon: 'none'
+              })
+              return
+            } else {
+              that.setData({
+                phoneVal: res.data.user.mobile,
+                // codeIshow: false
+              })
+            }
+          }
+        })
+
+      }
+    })
+
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+
+  onShareAppMessage: function () {
+
+  },
+
 })

+ 3 - 0
pages/charge_rule/charge_rule.acss

@@ -1,5 +1,8 @@
 /* required by usingComponents */
 /* pages/charge_rule/charge_rule.wxss */
+page{
+  background: #ffffff;
+}
 .box {
   /* width: 100%; */
   display: flex;

+ 2 - 0
pages/coupon/coupon.acss

@@ -13,6 +13,7 @@ text-align: center;
 border-radius: 8rpx;
 font-size: 34rpx;
 background-color: var(--globleColor);
+ color: var(--fontColor);
 }
 .coupon-item{
   background-color: #fff;
@@ -87,6 +88,7 @@ input{
   line-height: 80rpx;
   text-align: center;
   background-color: var(--globleColor);
+   color: var(--fontColor);
   margin: 0 30rpx;
   margin-top: 40rpx;
   border-radius: 40rpx;

+ 1 - 0
pages/depoSuce/depoSuce.acss

@@ -19,5 +19,6 @@
   border-radius: 12rpx;
   text-align: center;
   background: var(--globleColor);
+   color: var(--fontColor);
 
 }

+ 2 - 0
pages/index/index.acss

@@ -254,6 +254,7 @@ font-size: 30rpx;
   font-weight: bold;
   font-size: 34rpx;
   background-color: var(--globleColor);
+  color: var(--fontColor);
 }
 
 .iconfont {
@@ -268,6 +269,7 @@ font-size: 30rpx;
   font-weight: 300;
   display: inline-block;
   margin-right: 20rpx;
+   color: var(--fontColor);
 }
 /* 未支付订单弹框 */
 .pay-frame{

+ 176 - 143
pages/index/index.js

@@ -2,8 +2,9 @@
 // 获取应用实例
 //获取应用实例
 const app = getApp();
-var token = my.getStorageSync({'key':'token'}).data;
+var token = my.getStorageSync({ 'key': 'token' }).data;
 const util = require('../../utils/utils.js');
+const { content } = require('/utils/dataTransition.js');
 var mytime = null;
 let testToken = ''
 Page({
@@ -91,45 +92,42 @@ Page({
 
   onLoad: function (query) {
     var that = this;
-    console.log(query)
+    console.log(my.getStorageSync({ 'key': 'token' }).data, 'yyyyyyyyyyyyyyy')
     my.setNavigationBar({
       title: app.globalData.title
     })
-    // if (query.scene) {
-    //   app.globalData.id = query.scene
-    // }
     this.setData({
       height1: app.globalData.statusBarHeight,
       screenHeight: app.globalData.screenHeight
     })
-    my.getSystemInfo({
-      success: (res) => {
-      }
-    })
   },
   onShow: function () {
     var that = this;
     my.setNavigationBar({
       title: app.globalData.title
     })
-    token = my.getStorageSync({'key':'token'}).data
+    token = my.getStorageSync({ 'key': 'token' }).data
     this.setData({
       show: false,
-      midbolear: my.getStorageSync({'key':'midTimes'}).data,
+      midbolear: my.getStorageSync({ 'key': 'midTimes' }).data,
       polygons: []
     })
-    that.location();
-    testToken = setInterval(function () {
-      let token=my.getStorageSync({'key':'token'}).data
-      if (token) {
-        console.log('0000')
-        clearInterval(testToken)
-        that.userState();
-        that.getUser();
-      } else {
-        console.log(token,'1')
-      }
-    }, 1000)
+    app.login().then(res => {
+      console.log('YYYYYYYYYYYYY')
+      that.location()
+      that.getUser()
+    })
+    // that.location();
+    // testToken = setInterval(function () {
+    //   let token=my.getStorageSync({'key':'token'}).data
+    //   if (token) {
+    //     console.log('0000')
+    //     clearInterval(testToken)
+
+    //   } else {
+    //     console.log(token,'1')
+    //   }
+    // }, 1000)
     my.hideBackHome();
   },
   detail: function () {
@@ -274,6 +272,8 @@ Page({
         if (res.status == 200) {
           var data = res.data;
           console.log(data, '区域')
+          let id = data.id
+          that.userState()
           if (data.points != []) {
             that.setData({
               id: data.id,
@@ -289,35 +289,26 @@ Page({
               })
           }
           clearInterval(mytime)
-          setTimeout(function () {
-            // that.notice();
-          }, 500)
-          if (res.data.status_code == 423) {
-            my.getLocation({
-              success: function (res) {
-                my.alert({
-                  title: '提示',
-                  content: '您附近暂无运营区域~',
-                })
-                var setting = {
-                  is_deposit: 1
-                }
-                that.setData({
-                  setting
-                })
-              },
-              fail: function (err) {
-                that.setData({
-                  location: true
-                })
-              }
-            })
-          }
-          my.setStorageSync({'key':'setting',data:data.setting})
-          my.setStorageSync({'key':'home',data: data})
+          my.setStorageSync({ 'key': 'home', data: data })
         }
+        if (data) {
+          my.setStorageSync({ 'key': 'setting', data: data.setting })
+
+        } else {
+          my.removeStorageSync({ key: 'setting' })
+          my.removeStorageSync({ key: 'home' })
+        }
+
       }).catch(err => {
         console.log(err)
+        if (err.data.message == "该附近暂无运营区域") {
+          my.removeStorageSync({ key: 'setting' })
+          my.removeStorageSync({ key: 'home' })
+        }
+        my.alert({
+          title: '提示',
+          content: err.data.message,
+        })
       })
     }
   },
@@ -388,16 +379,16 @@ Page({
       })
     } else {
       this.location(),
-       my.showToast({
-        content: '刷新成功',
-        icon: 'none'
-      })
+        my.showToast({
+          content: '刷新成功',
+          icon: 'none'
+        })
     }
   }, 1500),
   //    //点击去实名认证
   authentication: util.throttle(function () {
-    var state = my.getStorageSync({'key':'userState'}).data
-    if (state.is_bind_mobile == 0) {
+    var state = my.getStorageSync({ 'key': 'userState' }).data
+    if (state.is_bind_mobile == 1) {
       my.navigateTo({
         url: '/pages/real_name/real_name?state1=1&index=0',
       })
@@ -417,19 +408,28 @@ Page({
     var that = this;
     console.log('ooooooo')
     var userStatus = that.data.userStatus;
-    if (!userStatus) {
-      my.navigateTo({
-        url: '/pages/authorization/authorization',
+    var setting = my.getStorageSync({ 'key': 'setting' }).data
+    if (!setting) {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区,暂不可用车'
       })
     } else {
-      that.jiance('scan');
+      if (!userStatus) {
+        my.navigateTo({
+          url: '/pages/authorization/authorization',
+        })
+      }
+      else {
+        that.jiance('scan');
+      }
     }
   }, 1500),
   //扫码用车检测不可用车条件
   jiance: function (source) {
     var that = this;
     var userStatus = that.data.userStatus;
-    var setting = my.getStorageSync({'key':'setting'}).data
+    var setting = my.getStorageSync({ 'key': 'setting' }).data
     //未绑定手机号
     if (userStatus.is_bind_mobile == 0) {
       my.navigateTo({
@@ -473,32 +473,36 @@ Page({
             //   url: '/pages/inputcode/inputcode',
             // })
           } else {
-           that.saoMa()
+            that.saoMa()
           }
         }
       }
     }
   },
   //扫码事件
-  saoMa:function(){
-    let that=this
+  saoMa: function () {
+    let that = this
     this.setData({
       scanCodeErr: false
     })
     my.scan({
       onlyFromCamera: true,
       success: function (res) {
+        let scanLength = app.globalData.scanLength
         console.log(res, '扫码结果')
-        var index = res.result.lastIndexOf("\=");
-        var code = res.result.substring(index + 1, res.result.length);
-        console.log(code.length)
-        if (code.length == 9) {
+        var index = res.code.lastIndexOf("\=");
+        console.log(index, '----------')
+        var code = res.code.substring(index + 1, res.code.length);
+        console.log(code)
+        console.log(app.globalData)
+
+        if (code.length == scanLength) {
           that.getBikeMessage(code)
           // my.navigateTo({
           //   url: '/pages/use_bike/use_bike?code=' + code,
           // })
         } else {
-          console.log(res,'错误码')
+          console.log(res, '错误码')
           // my.showModal({
           //   title:'提示',
           //   content:'非法码,请核对车码',
@@ -517,65 +521,65 @@ Page({
       }
     })
   },
-    //获取车辆信息
-    getBikeMessage: function (code) {
-      var that = this;
-      app.request('/bike/' + code, '', 'GET').then(res => {
-        console.log(res, '车辆信息--------------------')
-        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: '当前车子还未投放请换辆车子骑行吧~',
-              
-            })
-            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 {
-            my.reLaunch({
-              url: '/pages/use_bike/use_bike?code=' + code,
-            })
-          }
-        }else{
+  //获取车辆信息
+  getBikeMessage: function (code) {
+    var that = this;
+    app.request('/bike/' + code, '', 'GET').then(res => {
+      console.log(res, '车辆信息--------------------')
+      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: res.data.message,
+            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 {
+          my.reLaunch({
+            url: '/pages/use_bike/use_bike?code=' + code,
           })
         }
-      })
-  
-    },
+      } else {
+        my.alert({
+          title: '提示',
+          content: res.data.message,
+        })
+      }
+    })
+
+  },
   //去支付未支付订单
   go_pay: util.throttle(function () {
     //点击去支付
@@ -609,25 +613,26 @@ Page({
   },
   kefu: util.throttle(function () {
     my.makePhoneCall({
-      number: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
     })
   }, 1500),
   //用户状态
-  userState: function () {
+  userState: function (id) {
     var that = this;
 
     var data = {
-      'area_id': that.data.id
+      'area_id': id
     }
     app.request("/user/status", data, "GET").then(res => {
       console.log(res)
       if (res.status == 200) {
+        console.log(res, 'XYYING================')
         that.setData({
           userStatus: res.data,
           is_pay_order: res.data.is_pay_order,
           is_ride_order: res.data.is_ride_order,
           is_punishment: res.data.is_punishment,
-        }), my.setStorageSync({'key':'userState',data: res.data})
+        }), my.setStorageSync({ 'key': 'userState', data: res.data })
       }
     }).catch(err => {
       console.log(err)
@@ -635,12 +640,12 @@ Page({
 
   },
   getUser() {
-      app.request("/me", '', "GET").then(res => {
-        console.log(res)
-        200 == res.status && my.setStorageSync({'key':'userInfo',data:res.data})
-      }).catch(err => {
-        console.log(err)
-      })
+    app.request("/me", '', "GET").then(res => {
+      console.log(res)
+      200 == res.status && my.setStorageSync({ 'key': 'userInfo', data: res.data })
+    }).catch(err => {
+      console.log(err)
+    })
   },
   go_setting: util.throttle(function () {
     //点击去设置位置权限
@@ -708,11 +713,14 @@ Page({
 
   //底部跳转页面按钮(用户未授权和未实名认证的时候不可以跳转)
   skipPage: function (e) {
-    console.log(e, 'oooooo')
-    let data = e.currentTarget.dataset.id
+    let data = e.target.dataset.id
     let that = this
+    console.log(that.data, 'oooooo')
+
     var userStatus = that.data.userStatus;
-    console.log(that.data.latitude)
+    var setting = my.getStorageSync({ 'key': 'setting' }).data
+
+    console.log(!setting, '运营区检测')
     if (!that.data.latitude && !that.data.longitude) {
       that.setData({
         background: true,
@@ -720,16 +728,41 @@ Page({
       })
     } else {
       if (data.id == 2) {
-        console.log(that.data.userStatus,'')
-        if (!userStatus) {
+        console.log(that.data.userStatus, '')
+        if (!setting) {
+          my.alert({
+            title: '提示',
+            content: '您附近暂无运营区,暂不可用车'
+          })
+        }
+        else {
+          if (!userStatus) {
+            my.navigateTo({
+              url: '/pages/authorization/authorization',
+            })
+          }
+          else {
+            that.jiance1();
+          }
+        }
+      } else if (data.id == 3 && !setting) {
+        wx.showModal({
+          title: '提示',
+          content: '您附近暂无运营区,暂不可用车',
+          showCancel: false
+        })
+      } else if (data.id == 4) {
+        if (userStatus.is_bind_mobile == 0) {
           my.navigateTo({
             url: '/pages/authorization/authorization',
           })
         } else {
-          that.jiance1();
+          my.navigateTo({
+            url: data.url,
+          })
         }
-
-      } else {
+      }
+      else {
         if (!userStatus) {
           my.navigateTo({
             url: '/pages/authorization/authorization',
@@ -746,7 +779,7 @@ Page({
   //输码开锁检测
   jiance1: function (source) {
     var that = this;
-    let setting = my.getStorageSync({'key':'setting'}).data
+    let setting = my.getStorageSync({ 'key': 'setting' }).data
     var userStatus = that.data.userStatus;
     //未绑定手机号
     if (userStatus.is_bind_mobile == 0) {
@@ -800,7 +833,7 @@ Page({
   // 客服
   kefu: function () {
     my.makePhoneCall({
-      number: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
     })
   },
 

+ 2 - 3
pages/index/index.json

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

+ 29 - 19
pages/inputcode/inputcode.acss

@@ -1,5 +1,7 @@
 /* required by usingComponents */
+
 /* pages/scancode/scancode.wxss */
+
 .top-img {
   text-align: center;
   margin-top: 50rpx;
@@ -13,12 +15,13 @@
 
 .title {
   text-align: center;
-  font-size:34rpx;
+  font-size: 34rpx;
   font-weight: 500;
   margin-top: 40rpx;
 }
 
 .btm_center {
+  text-align: center;
   /* border: 1px solid #ff0; */
   margin-top: 20rpx;
   padding: 30rpx;
@@ -47,26 +50,33 @@
   border: none;
   margin: 0;
 }
-.buttom,.sure-buttom{
-height: 100rpx;
-/* background-color: var(--globleColor); */
-background-color: #eeeeee;
-font-size: 34rpx;
-width: 70%;
-color: #ffffff;
-text-align: center;
-line-height: 100rpx;
-margin: 0 auto;
-border-radius:50rpx;
+
+.buttom, .sure-buttom {
+  height: 100rpx;
+  /* background-color: var(--globleColor); */
+  background-color: #eeeeee;
+  font-size: 34rpx;
+  width: 70%;
+  color: #ffffff;
+  text-align: center;
+  line-height: 100rpx;
+  margin: 0 auto;
+  border-radius: 50rpx;
+  margin-top: 30rpx;
 }
-.sure-buttom{
-  background-color:var(--globleColor);
-  color: #333333;
+
+.sure-buttom {
+  background-color: var(--globleColor);
   font-weight: 600;
+   color: var(--fontColor);
 }
-.code-number{
-  height: 70rpx;
-line-height: 70rpx;
-  background-color:var(--globleColor);
 
+.code-number {
+  width: 100%;
+  height: 70rpx;
+  line-height: 70rpx;
+  padding-left: 30rpx;
+  background-color: #ffffff;
+  border-radius: 12rpx;
+  border: solid 1rpx var(--globleColor)
 }

+ 1 - 10
pages/inputcode/inputcode.axml

@@ -6,16 +6,7 @@
   <view class="title">请输入 9 位车辆编码</view>
   <view class="btm_center">
     <!-- <input type="number" bindblur="code" bindinput="code" bindconfirm="code"></input> -->
-     <input type="number" onInput="onFocus" focus="{{isFocus}}" class="code-number" value="{{code}}" style="width:95%"></input>
-    <!-- <view class="query_num_block">
-      <input class="num_item_block" a:for="{{inputLen}}" a:key="index" disabled onTap='onFocus'
-        value="{{code.length>=index+1?code[index]:''}}" type='number'/>
-    </view>
-    <input name="password" password="{{true}}" class='hidden_ipt' maxlength="{{inputLen}}" focus="{{isFocus}}"
-      bindinput="setValue" type='number'></input> -->
+     <input type="number" onInput="onFocus" focus="{{isFocus}}" class="code-number" value="{{code}}" style="width:90%"></input>
   </view>
-
-
-
   <view onTap="sureSubmit" class="{{submitState==0 ? 'buttom' : 'sure-buttom'}}">确定</view>
 </view>

+ 133 - 137
pages/inputcode/inputcode.js

@@ -1,138 +1,134 @@
-// 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 () {
-
-  }
+// 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()
+    app.request('/bike/' + that.data.code, '', 'GET').then(res => {
+      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: '当前车子还未投放请换辆车子骑行吧~',
+          })
+          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 () {
+
+  }
 })

+ 7 - 1
pages/mine/mine.acss

@@ -1,5 +1,8 @@
 /* required by usingComponents */
 /* pages/mine/mine.wxss */
+page{
+  background: #ffffff;
+}
 .mine {
   padding: 30rpx;
   border-top: solid 1rpx #f2f3f5;
@@ -31,7 +34,10 @@
   font-size: 34rpx;
   font-weight: bold;
 }
-
+/* .tongbu{
+  display: block;
+  font-size:28rpx;
+} */
 .iconfont {
   height: 100rpx;
   line-height: 100rpx;

+ 65 - 64
pages/mine/mine.axml

@@ -1,65 +1,66 @@
-<view class="mine">
-  <view class="mine-top" onTap="mineData">
-    <view class="avator">
-      <!-- <image src="../../img/avator.jpg"></image> -->
-      <open-data type="userAvatarUrl" class="avator-image"></open-data>
-    </view>
-    <view class="mine-phone">{{userInfo.mobile}}</view>
-    <view class="iconfont icon-iconfontjiantou2"></view>
-  </view>
-  <view class="mine-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==2}}">
-    {{deposit.deposit_expire_time}}
-  </view>
-  <view class="mine-tab">
-    <view class="mine-tab-item" onTap="balance">
-      <view class="tab-num">¥{{userInfo.wallet_money | parseFloat}}</view>
-      <view class="tab-text">余额</view>
-    </view>
-    <view class="mine-tab-item" onTap="coupon">
-      <view class="tab-num">{{userInfo.coupon_count ? userInfo.coupon_count :'0'}}</view>
-      <view class="tab-text">优惠券</view>
-    </view>
-    <view class="mine-tab-item" onTap="myCard">
-      <view class="tab-num">{{userInfo.user.deposit_type==2 ? 1 : 0}}</view>
-      <view class="tab-text">我的卡</view>
-    </view>
-    <view class="mine-tab-item" onTap="rideZige" >
-      <view class="tab-num"><text class="zige">{{deposit.is_deposit==0 && setting.is_deposit != 0 && deposit.is_coupon_deposit_free == false ? '去获取':'已获得'}}</text></view>
-      <view class="tab-text">骑行资格</view>
-    </view>
-  </view>
-  <view class="mine-card" a:if="{{show==true}}">
-    <view class="card-left">
-      <view class="left-title">购买骑行卡套餐</view>
-      <view class="left-text">买卡用车更划算</view>
-    </view>
-    <view class="card-right" onTap="buyCard">购买</view>
-  </view>
-  <view class="mine-list">
-    <!-- <view class="list-item">
-      <text class="zhifufen">开通微信支付分,享免充值用车</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
-      <text class="right-text">去开通</text>
-
-    </view> -->
-    <view class="list-item" onTap="trip"> 
-      <text class="iconfont icon-weizhi list-icon"></text>
-      <text>行程</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
-    </view>
-    <view class="list-item" onTap="accountDetails">
-      <text  class="iconfont icon-tongqian list-icon"></text>
-      <text>账户明细</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
-    </view>
-    <view class="list-item" onTap="weizhang">
-      <text  class="iconfont icon-shejiwenzhang list-icon"></text>
-      <text>违约用车记录</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text></view>
-    <view class="list-item" onTap="setUp">
-      <text  class="iconfont icon-shezhi list-icon"></text>
-      <text>设置</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
-    </view>
-  </view>
+<view class="mine">
+  <view class="mine-top" onTap="mineData">
+    <view class="avator">
+      <image src="{{userInfo.user.avatar}}" class="avator-image" mode="widthFix"></image>
+      <!-- <open-data type="userAvatarUrl" class="avator-image"></open-data> -->
+    </view>
+    <view class="mine-phone">
+    <text>{{userInfo.mobile}}</text></view>
+    <view class="iconfont icon-iconfontjiantou2"></view>
+  </view>
+  <view class="mine-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==2}}">
+    {{deposit.deposit_expire_time}}
+  </view>
+  <view class="mine-tab">
+    <view class="mine-tab-item" onTap="balance">
+      <view class="tab-num">¥{{userInfo.wallet_money | parseFloat}}</view>
+      <view class="tab-text">余额</view>
+    </view>
+    <view class="mine-tab-item" onTap="coupon">
+      <view class="tab-num">{{userInfo.coupon_count ? userInfo.coupon_count :'0'}}</view>
+      <view class="tab-text">优惠券</view>
+    </view>
+    <view class="mine-tab-item" onTap="myCard">
+      <view class="tab-num">{{userInfo.user.deposit_type==2 ? 1 : 0}}</view>
+      <view class="tab-text">我的卡</view>
+    </view>
+    <view class="mine-tab-item" onTap="rideZige" >
+      <view class="tab-num"><text class="zige">{{deposit.is_deposit==0 && setting.is_deposit != 0 && deposit.is_coupon_deposit_free == false ? '去获取':'已获得'}}</text></view>
+      <view class="tab-text">骑行资格</view>
+    </view>
+  </view>
+  <view class="mine-card" a:if="{{show==true}}">
+    <view class="card-left">
+      <view class="left-title">购买骑行卡套餐</view>
+      <view class="left-text">买卡用车更划算</view>
+    </view>
+    <view class="card-right" onTap="buyCard">购买</view>
+  </view>
+  <view class="mine-list">
+    <!-- <view class="list-item">
+      <text class="zhifufen">开通微信支付分,享免充值用车</text>
+      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
+      <text class="right-text">去开通</text>
+
+    </view> -->
+    <view class="list-item" onTap="trip"> 
+      <text class="iconfont icon-weizhi list-icon"></text>
+      <text>行程</text>
+      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
+    </view>
+    <view class="list-item" onTap="accountDetails">
+      <text  class="iconfont icon-tongqian list-icon"></text>
+      <text>账户明细</text>
+      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
+    </view>
+    <view class="list-item" onTap="weizhang">
+      <text  class="iconfont icon-shejiwenzhang list-icon"></text>
+      <text>违约用车记录</text>
+      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text></view>
+    <view class="list-item" onTap="setUp">
+      <text  class="iconfont icon-shezhi list-icon"></text>
+      <text>设置</text>
+      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
+    </view>
+  </view>
 </view>

+ 175 - 117
pages/mine/mine.js

@@ -1,118 +1,176 @@
-// pages/mine/mine.js
-var app=getApp()
-Page({
-  data: {
-    userInfo: '',//用户信息
-    deposit: '',//是否缴纳押金 未缴纳0 已缴纳1
-    arr:[],
-    show:false,
-    setting:'',//设置
-  },
-  onLoad: function (options) {
-  },
-  getUser() {
-    let token=my.getStorageSync({'key':'token'}).data
-    if (token != '') {
-      app.request("/me", '', "GET").then(res => {
-        console.log(res)
-        200 == res.status && my.setStorageSync({'key':"userInfo",data:res.data})
-        this.setData({
-          userInfo: res.data,
-          deposit: my.getStorageSync({'key':'userState'}).data,
-          setting:my.getStorageSync({'key':'setting'}).data
-        })
-      }).catch(err => {
-        console.log(err)
-      })
-    }
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-    let that=this
-    this.getUser();
-    var area_id = ''
-    if (my.getStorageSync({'key':'home'}).data.id != undefined) {
-      area_id = my.getStorageSync({'key':'home'}).data.id
-    }
-    var data = {
-      'area_id': area_id
-    }
-    app.request("/card_riding/user_card", data, "GET").then(res => {
-      console.log(res)
-      that.setData({ arr: res.data.user_card, show: res.data.is_card_begin })
-    })
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  },
-  adDetail: function () {
-    my.navigateTo({
-      url: '/pages/ride_zige/ride_zige',
-    })
-  },
-  balance: function () {
-    my.navigateTo({
-      url: '/pages/balance/balance',
-    })
-  },
-  coupon: function () {
-    my.navigateTo({
-      url: '/pages/coupon/coupon',
-    })
-  },
-  myCard: function () {
-    my.navigateTo({
-      url: '/pages/mine_card/mine_card',
-    })
-  },
-  rideZige: function () {
-      my.navigateTo({
-        url: '/pages/ride_zige/ride_zige',
-      })
-  },
-  setUp: function () {
-    my.navigateTo({
-      url: '/pages/set_up/set_up',
-    })
-  },
-  mineData: function () {
-    my.navigateTo({
-      url: '/pages/mine_data/mine_data',
-    })
-  },
-  trip: function () {
-    my.navigateTo({
-      url: '/pages/trip/trip',
-    })
-  },
-  accountDetails: function () {
-    my.navigateTo({
-      url: '/pages/account_details/account_details',
-    })
-  },
-  weizhang: function () {
-    my.navigateTo({
-      url: '/pages/weizhang/weizhang',
-    })
-  },
-  buyCard: function () {
-    my.navigateTo({
-      // url: '/pages/ride_zige/ride_zige',
-      url: '/pages/buy-card/buy-card'
-    })
-  }
+// pages/mine/mine.js
+var app = getApp()
+Page({
+  data: {
+    userInfo: '',//用户信息
+    deposit: '',//是否缴纳押金 未缴纳0 已缴纳1
+    arr: [],
+    show: false,
+    setting: '',//设置
+    src: '',//用户头像地址
+  },
+  onLoad: function (options) {
+    // 页面加载完成
+    my.getAuthCode({
+      scopes: 'auth_user',
+      success: (res) => {
+        my.getAuthUserInfo({
+          success: (userInfo) => {
+            //my.alert({content: userInfo.avatar});
+            this.setData({ src: userInfo.avatar });
+            console.log(userInfo, 'userInfo')
+            if (userInfo) {
+              let sex = 0
+              if (userInfo.gender == "m") {
+                let sex = 1
+              }
+              else if (userInfo.gender == "f") {
+                let sex = 2
+              }
+              else {
+                let sex = 0
+              }
+              var data = {
+                'area_id': userInfo.area_id,
+                'avatar': userInfo.avatar,
+                'city': userInfo.city,
+                'gender': 0,
+                'nickName': userInfo.nickName,
+                'province': userInfo.province,
+                'language': '中国'
+              }
+              this.userInfo(data)
+            }
+
+          }
+        });
+      },
+    });
+  },
+  //同步用户信息
+  userInfo: function (data) {
+    let that=this
+    app.request("/auth/weapp-userinfo-sync", data, "POST").then(res => {
+      console.log(res,'shouquan yonghuxinxi')
+      if (res.status == 200) {
+        // my.showToast({
+        //   content: '授权成功',
+        //   icon: 'none'
+        // })
+        my.setStorageSync({'key':'userInfo',data:res.data.user})
+        // wx.navigateBack()
+        that.setData({ userInfo: res.data })
+      } else {
+        // my.showToast({
+        //   content: '登陆失败请重试',
+        //   icon: 'none'
+        // })
+      }
+    })
+  },
+  getUser() {
+    let token = my.getStorageSync({ 'key': 'token' }).data
+    if (token != '') {
+      app.request("/me", '', "GET").then(res => {
+        console.log(res)
+        200 == res.status && my.setStorageSync({ 'key': "userInfo", data: res.data})
+        this.setData({
+          userInfo: res.data,
+          deposit: my.getStorageSync({ 'key': 'userState' }).data,
+          setting: my.getStorageSync({ 'key': 'setting' }).data
+        })
+      }).catch(err => {
+        console.log(err)
+      })
+    }
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    let that = this
+    this.getUser();
+    var area_id = ''
+    if (my.getStorageSync({ 'key': 'home' }).data.id != undefined) {
+      area_id = my.getStorageSync({ 'key': 'home' }).data.id
+    }
+    var data = {
+      'area_id': area_id
+    }
+    app.request("/card_riding/user_card", data, "GET").then(res => {
+      console.log(res)
+      that.setData({ arr: res.data.user_card, show: res.data.is_card_begin })
+    })
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+  adDetail: function () {
+    my.navigateTo({
+      url: '/pages/ride_zige/ride_zige',
+    })
+  },
+  balance: function () {
+    my.navigateTo({
+      url: '/pages/balance/balance',
+    })
+  },
+  coupon: function () {
+    my.navigateTo({
+      url: '/pages/coupon/coupon',
+    })
+  },
+  myCard: function () {
+    my.navigateTo({
+      url: '/pages/mine_card/mine_card',
+    })
+  },
+  rideZige: function () {
+    my.navigateTo({
+      url: '/pages/ride_zige/ride_zige',
+    })
+  },
+  setUp: function () {
+    my.navigateTo({
+      url: '/pages/set_up/set_up',
+    })
+  },
+  mineData: function () {
+    my.navigateTo({
+      url: '/pages/mine_data/mine_data',
+    })
+  },
+  trip: function () {
+    my.navigateTo({
+      url: '/pages/trip/trip',
+    })
+  },
+  accountDetails: function () {
+    my.navigateTo({
+      url: '/pages/account_details/account_details',
+    })
+  },
+  weizhang: function () {
+    my.navigateTo({
+      url: '/pages/weizhang/weizhang',
+    })
+  },
+  buyCard: function () {
+    my.navigateTo({
+      // url: '/pages/ride_zige/ride_zige',
+      url: '/pages/buy-card/buy-card'
+    })
+  }
 })

+ 1 - 1
pages/mine_card/mine_card.acss

@@ -2,7 +2,7 @@
 /* pages/mine_card/mine_card.wxss */
 page{
   border-top: solid 1rpx #f2f3f5;
-
+background: #fff;
 }
 .card {
   margin: 30rpx;

+ 2 - 1
pages/mine_data/mine_data.acss

@@ -2,9 +2,10 @@
 /* pages/mine_data/mine_data.wxss */
 page{
   background-color: #f2f3f5;
+  padding-top: 20rpx
 }
 .mine-data{
-margin-top: 20rpx;
+/* margin-top: 20rpx; */
 }
 .mine-data-list{
   background-color: #fff;

+ 14 - 13
pages/mine_data/mine_data.axml

@@ -1,14 +1,15 @@
-<view class="mine-data">
-  <view class="mine-data-list" >
-    <view class="list-item" onTap="myAccount">
-      <text>手机号</text>
-      <text class="iconfont icon-iconfontjiantou2"></text>
-    </view>
-    <view class="list-item" onTap="realName">
-      <text>电单车实名认证</text>
-      <text class="iconfont" style="color:var(--orgFont)" a:if="{{userState.is_card_certified==0}}">未实名</text>
-      <text class="iconfont" style="color:var(--orgFont)" a:if="{{userState.is_card_certified==1}}">已认证</text>
-      <text class="iconfont icon-iconfontjiantou2" a:else></text>
-    </view>
-  </view>
+<view class="mine-data">
+  <view class="mine-data-list" >
+    <view class="list-item" onTap="myAccount">
+      <text>手机号</text>
+      <text class="iconfont icon-iconfontjiantou2"></text>
+    </view>
+    <view class="list-item" onTap="realName">
+      <text>电单车实名认证</text>
+      <text class="iconfont icon-iconfontjiantou2" a:if="{{userState.is_card_certified!==1}}"></text>
+      <text class="iconfont" style="color:var(--orgFont)" a:if="{{userState.is_card_certified==0}}">未实名</text>
+      <text class="iconfont" style="color:var(--orgFont)" a:if="{{userState.is_card_certified==1}}">已认证</text>
+      
+    </view>
+  </view>
 </view>

+ 1 - 0
pages/my_account/my_account.acss

@@ -37,4 +37,5 @@ font-size: 34rpx;
 font-weight: 500;
 margin-top:150rpx;
 background-color: var(--globleColor);
+ color: var(--fontColor);
 }

+ 2 - 2
pages/parking/parking.acss

@@ -40,7 +40,7 @@ map{
 }
 .search input{
   width: 75%;
-  height: 100%;
+  /* height: 100%; */
   font-size: 26rpx;
   color: #707070;
 }
@@ -177,7 +177,7 @@ map{
 .bottom .view .bikeBorder{
   width: 24px;
   height: 28px;
-  border: #0000FF 2rpx solid;
+  border:  #e67674 2rpx solid;
   background: #C0D2EF;
   box-sizing: border-box;
 }

+ 51 - 48
pages/parking/parking.axml

@@ -1,49 +1,52 @@
-<view class="box">
-  <view class="background" a:if="{{show}}" catchtouchmove="true"></view>
-  <view class="search">
-    <image src="{{img}}weapp/search.png" style="width:48rpx;height:48rpx;margin-right:44rpx;"></image>
-    <input placeholder="请输入目的地查看附近还车点" bindinput="input" value="{{value}}" placeholder-class="place"></input>
-  </view>
-  <view class="list" a:if="{{show && suggestion!=''}}">
-    <view a:for="{{suggestion}}" class="city_list" onTap="selected" data-index="{{index}}" a:key="key">
-      <image src="{{img}}weapp/location_city.png"></image>
-      <view>
-        <text class="title">{{item.title}}</text>
-        <text class="title1">{{item.addr}}</text>
-      </view>
-    </view>
-  </view>
-  <view class="parking" a:if="{{parking}}" animation="{{animationData}}">
-    <view class="view view1">
-      <text class="title">{{areaTop.name}}</text>
-      <view>
-        <text>{{areaTop.location_distance}}</text>
-        <text style="padding-left:16rpx;margin-left:16rpx;border-left:2rpx solid #ccc;">{{areaTop.description}}</text>
-      </view>
-    </view>
-    <view onTap="location" data-item="{{item}}" class="view view2">
-      <image src="../../img/go.png" style="width:100rpx;height:100rpx"></image>
-    </view>
-  </view>
-  <map id="map" longitude='{{longitude}}' latitude='{{latitude}}' scale='16' markers="{{markers}}" bindmarkertap="stop"
-    show-location="true" data-markers="{{markers}}" controls="{{controls}}" polygons="{{polygons}}">
-
-  </map>
-  <view class="bottom">
-    <view class="view">
-      <view class="bikeBorder"></view>
-      <text>骑行区</text>
-    </view>
-    <view class="view">
-      <view class="parkBorder">
-        <image src="http://resource.bike.hanyiyun.com/yunwei/parkShow.png"></image>
-      </view>
-      <text>停车区</text>
-    </view>
-    <view class="view">
-      <view class="noPark">
-      <image src="http://resource.bike.hanyiyun.com/yunwei/forbid.png"></image></view>
-      <text>禁停区</text>
-    </view>
-  </view>
+
+<view class="box">
+  <view class="background" a:if="{{show}}" catchtouchmove="true"></view>
+  <view class="search">
+    <image src="{{img}}weapp/search.png" style="width:48rpx;height:48rpx;margin-right:44rpx;"></image>
+    <input placeholder="请输入目的地查看附近还车点" onInput="input" value="{{value}}" placeholder-class="place"></input>
+  </view>
+  <view class="list" a:if="{{show && suggestion!=''}}">
+    <view a:for="{{suggestion}}" class="city_list" onTap="selected" data-index="{{index}}" a:key="key">
+      <image src="{{img}}weapp/location_city.png"></image>
+      <view>
+        <text class="title">{{item.title}}</text>
+        <text class="title1">{{item.addr}}</text>
+      </view>
+    </view>
+  </view>
+  <view class="parking" a:if="{{parking}}" animation="{{animationData}}">
+    <view class="view view1">
+      <text class="title">{{areaTop.name}}</text>
+      <view>
+        <text>{{areaTop.location_distance}}</text>
+        <text style="padding-left:16rpx;margin-left:16rpx;border-left:2rpx solid #ccc;">{{areaTop.description}}</text>
+      </view>
+    </view>
+    <view onTap="location" data-item="{{item}}" class="view view2">
+      <image src="../../img/go.png" style="width:100rpx;height:100rpx"></image>
+    </view>
+  </view>
+  <map id="map" longitude='{{longitude}}' latitude='{{latitude}}' scale='16' markers="{{markers}}" onMarkerTap=""="stop"
+    show-location="true" data-markers="{{markers}}" controls="{{controls}}"  polygon="{{polygons}}">
+    <!-- <map name="map" id="map" show-location="true" longitude='{{longitude}}' latitude='{{latitude}}' scale='16'
+    markers="{{markers}}" data-markers="{{markers}}" controls="{{controls}}" polygon="{{polygons}}">
+  </map> -->
+  </map>
+  <view class="bottom">
+    <view class="view">
+      <view class="bikeBorder"></view>
+      <text>骑行区</text>
+    </view>
+    <view class="view">
+      <view class="parkBorder">
+        <image src="http://resource.bike.hanyiyun.com/yunwei/parkShow.png"></image>
+      </view>
+      <text>停车区</text>
+    </view>
+    <view class="view">
+      <view class="noPark">
+      <image src="http://resource.bike.hanyiyun.com/yunwei/forbid.png"></image></view>
+      <text>禁停区</text>
+    </view>
+  </view>
 </view>

+ 287 - 280
pages/parking/parking.js

@@ -1,281 +1,288 @@
-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() {
-    
-  }
+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)
+      }
+    })
+    if(!my.getStorageSync({'key':'home'}).data){
+    my.showToast({
+        content: '附近暂无运营区',
+        icon: 'none'
+      })
+    }else{
+    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() {
+    
+  }
 })

+ 7 - 7
pages/pay/pay.acss

@@ -31,18 +31,18 @@
   align-items: center; */
   padding-bottom: 100rpx;
 }
-.pay-top{
-  height: 300rpx;
+ .pay-top{
+  height:250rpx;
   background: var(--globleColor);
 }
 .pay-top{
 font-size: 32rpx;
 font-weight: 600;
-padding-top: 100rpx;
-}
-.pay-top .pay-money{
+padding-top: 50rpx;
+} 
+.pay-money{
   /* height: 110rpx; */
-  margin-top:80rpx;
+  /* padding-top:80rpx; */
   text-align: center;
   /* line-height: 150rpx; */
   /* margin-top: 100rpx; */
@@ -287,7 +287,7 @@ margin-bottom:50rpx!important;
   margin-top: 80rpx;
   font-family:PingFang-SC-Regular;
   /* font-weight:400; */
-  columns: #333333;
+   color: var(--fontColor);
   font-weight: bold;
   /* margin-right: 42rpx; */
 }

+ 123 - 123
pages/pay/pay.axml

@@ -1,124 +1,124 @@
-<view class="box" style="padding-bottom:{{date.system_off_lock.is_system_off_lock ? '250rpx' : '150rpx'}}">
-	<view class="home" style="top:{{statusbar}}px">
-		<image src="../../img/with-home.png" onTap="backHome"></image>
-		<text>费用详情</text>
-	</view>
-	<view class="pay-top">
-		<view class="pay-money"><text>¥{{date.orders.order_wait_pay_money||'--'}}</text></view>
-	</view>
-	<view class="list" style="  margin-top: -50rpx;">
-		<view class="title">费用详情</view>
-
-		<view>
-			<text>时长费用</text>
-			<text>¥{{date.orders.time_money||'--'}}</text>
-		</view>
-		<view class="shichang">
-			含里程{{date.orders.use_bike_distance_length_text||'--'}}公里,含时长{{date.orders.use_bike_time_length_text||'--'}}</view>
-		<view a:if="{{rent}}">
-			<text>骑行卡</text>
-			<text style="color:#ff0000;">- ¥{{date.user_card.card_preferential_money||'--'}}</text>
-		</view>
-		<view a:if="{{rent}}">
-			<text>优惠券</text>
-			<text style="color:#ff0000;">- ¥{{date.user_coupon.coupon_preferential_money||'--'}}</text>
-		</view>
-		<view onTap="notice">
-			<text>调度费用<text class="iconfont icon-guize"
-					style="display:inline-block;color:var(--orgFont);margin-left:10rpx;"></text></text>
-			<text>¥{{date.orders.dispatch_money||'--'}}</text>
-		</view>
-	</view>
-	<view class='maskLayer' a:if="{{payment_type}}" catchtouchmove="true" onTap="cancel"></view>
-	<view class="mode payment_type" a:if="{{payment_type}}" catchtouchmove="true">
-		<image src="/img/guanbi.png" style="width:48rpx;height:48rpx;" class="cancel" onTap='cancel'></image>
-		<view class="top">
-			<text>支付方式</text>
-		</view>
-		<view class="view" onTap="{{bolear ? 'check1':''}}">
-			<view class="left">
-				<image src="{{img}}weapp/purse.png" style="width:36rpx;height:36rpx;"></image>
-				<view><text style="font-size:28rpx;">余额支付</text><text
-						style="color:#999999;font-size:24rpx;">(¥{{balance||'--'}})</text></view>
-			</view>
-			<view class="right" onTap="{{bolear==false ? 'to_recharge' : ''}}">
-				<text a:if="{{bolear==false}}">余额不足去充值</text>
-				<image
-					src="{{check1==true ? 'http://resource.bike.hanyiyun.com/weapp/true.png' : 'http://resource.bike.hanyiyun.com/weapp/false.png'}}"
-					style="width:30rpx;height:30rpx;" a:if="{{bolear==true}}"></image>
-			</view>
-		</view>
-		<view class="view" onTap="check2">
-			<view class="left">
-				<image src="{{img}}weapp/vx.png" style="width:36rpx;height:34rpx"></image>
-				<text style="font-size:28rpx;">微信支付</text>
-			</view>
-			<view class="right">
-				<image
-					src="{{check2==true ? 'http://resource.bike.hanyiyun.com/weapp/true.png' : 'http://resource.bike.hanyiyun.com/weapp/false.png'}}"
-					style="width:30rpx;height:30rpx;"></image>
-			</view>
-		</view>
-		<view class="view1" onTap="queding">
-			<text>确定</text>
-		</view>
-	</view>
-
-	<view class="payment" onTap="payment_type">
-		<text style="padding-left: 7.5%;">支付方式</text>
-		<text style="padding-right: 10.5%;" a:if="{{check2 && index==1}}">微信支付</text>
-		<text style="padding-right: 10.5%;" a:if="{{check1 && index==2}}">余额支付</text>
-		<image src="/img/you.png" style="width:48rpx;height:48rpx;"></image>
-	</view>
-	<view class="colse-type" a:if="{{date.system_off_lock.is_system_off_lock}}">
-			<text>提示:{{date.system_off_lock.system_off_lock_text}}</text>
-		</view>
-	<view class="bt-wenti">
-		<view class="kefu" onTap="phone">
-			<image src="../../img/kefu.png"></image>
-			<text>客服热线</text>
-		</view>
-		<view class="kaisuo" onTap="retryClose">
-			<text>重试关锁</text>
-		</view>
-	</view>
-	<!-- <view class="box_bottom">
-		<view>
-			
-			<image src="/img/you.png" style="width:48rpx;height:48rpx;"></image>
-			<text>客服热线</text>
-		</view>
-		<view  style="height:60rpx;" a:if="{{rent}}">
-			<text>关锁失败</text>
-			<text style="padding-right:4.5%;">重试关锁</text>
-			<image src="/img/you.png" style="width:48rpx;height:48rpx;" class="right"></image>
-		</view>
-	</view> -->
-	<!-- <view class="system_off_lock" >
-		<text>1212{{date.system_off_lock.system_off_lock_text}}</text>
-	</view> -->
-	<view class="fixed">
-		<view class="btn"
-			onTap="{{date.orders.order_wait_pay_money=='0.00' || date.orders.pay_status==1 ? 'home' : disable==true ? '' : 'payment'}}">
-			<text>{{date.orders.order_wait_pay_money=='0.00' || date.orders.pay_status==1? '返回首页' : '立即支付'}}</text>
-		</view>
-	</view>
-
-	<view class="notice_background" a:if="{{notice}}"></view>
-	<view class="notice_model" a:if="{{notice}}">
-		<view class="title1">
-			<text>调度费收费规则</text>
-		</view>
-		<view class="content">
-			<text>在运营区域外还车或禁停区还车,将收取30元调度费;</text>
-			<text>在运营区内还车:离最近的还车点{{setting.min_limit_km||'--'}}m内<block a:if="{{setting.min_dispatching_fee>0}}">
-					{{setting.min_dispatching_fee||'--'}}元</block>
-				<block a:else>免费</block>
-				,超出{{setting.min_limit_km||'--'}}m,每超出{{setting.over_limit_per_km||'--'}}m增加{{setting.over_limit_per_km_money||'--'}}元;最高收取{{setting.max_dispatching_fee||'--'}}元。
-			</text>
-		</view>
-		<view class="btn" onTap="notice_false">
-			<text>我知道了</text>
-		</view>
-	</view>
+<view class="box" style="padding-bottom:{{date.system_off_lock.is_system_off_lock ? '250rpx' : '150rpx'}}">
+	<!-- <view class="home" style="top:{{statusbar}}px">
+		<image src="../../img/with-home.png" onTap="backHome"></image>
+		<text>费用详情</text>
+	</view> -->
+	<view class="pay-top">
+		<view class="pay-money"><text>¥{{date.orders.order_wait_pay_money||'--'}}</text></view>
+	</view>
+	<view class="list" style="  margin-top: -100rpx;">
+		<view class="title">费用详情</view>
+
+		<view>
+			<text>时长费用</text>
+			<text>¥{{date.orders.time_money||'--'}}</text>
+		</view>
+		<view class="shichang">
+			含里程{{date.orders.use_bike_distance_length_text||'--'}}公里,含时长{{date.orders.use_bike_time_length_text||'--'}}</view>
+		<view a:if="{{rent}}">
+			<text>骑行卡</text>
+			<text style="color:#ff0000;">- ¥{{date.user_card.card_preferential_money||'--'}}</text>
+		</view>
+		<view a:if="{{rent}}">
+			<text>优惠券</text>
+			<text style="color:#ff0000;">- ¥{{date.user_coupon.coupon_preferential_money||'--'}}</text>
+		</view>
+		<view onTap="notice">
+			<text>调度费用<text class="iconfont icon-guize"
+					style="display:inline-block;color:var(--orgFont);margin-left:10rpx;"></text></text>
+			<text>¥{{date.orders.dispatch_money||'--'}}</text>
+		</view>
+	</view>
+	<view class='maskLayer' a:if="{{payment_type}}" catchtouchmove="true" onTap="cancel"></view>
+	<view class="mode payment_type" a:if="{{payment_type}}" catchtouchmove="true">
+		<image src="/img/guanbi.png" style="width:48rpx;height:48rpx;" class="cancel" onTap='cancel'></image>
+		<view class="top">
+			<text>支付方式</text>
+		</view>
+		<view class="view" onTap="{{bolear ? 'check1':''}}">
+			<view class="left">
+				<image src="{{img}}weapp/purse.png" style="width:36rpx;height:36rpx;"></image>
+				<view><text style="font-size:28rpx;">余额支付</text><text
+						style="color:#999999;font-size:24rpx;">(¥{{balance||'--'}})</text></view>
+			</view>
+			<view class="right" onTap="{{bolear==false ? 'to_recharge' : ''}}">
+				<text a:if="{{bolear==false}}">余额不足去充值</text>
+				<image
+					src="{{check1==true ? 'http://resource.bike.hanyiyun.com/weapp/true.png' : 'http://resource.bike.hanyiyun.com/weapp/false.png'}}"
+					style="width:30rpx;height:30rpx;" a:if="{{bolear==true}}"></image>
+			</view>
+		</view>
+		<view class="view" onTap="check2">
+			<view class="left">
+				<image src="../../img/zhi.png" style="width:36rpx;height:34rpx"></image>
+				<text style="font-size:28rpx;">支付宝支付</text>
+			</view>
+			<view class="right">
+				<image
+					src="{{check2==true ? 'http://resource.bike.hanyiyun.com/weapp/true.png' : 'http://resource.bike.hanyiyun.com/weapp/false.png'}}"
+					style="width:30rpx;height:30rpx;"></image>
+			</view>
+		</view>
+		<view class="view1" onTap="queding">
+			<text>确定</text>
+		</view>
+	</view>
+
+	<view class="payment" onTap="payment_type">
+		<text style="padding-left: 7.5%;">支付方式</text>
+		<text style="padding-right: 10.5%;" a:if="{{check2 && index==1}}">支付宝支付</text>
+		<text style="padding-right: 10.5%;" a:if="{{check1 && index==2}}">余额支付</text>
+		<image src="/img/you.png" style="width:48rpx;height:48rpx;"></image>
+	</view>
+	<view class="colse-type" a:if="{{date.system_off_lock.is_system_off_lock}}">
+			<text>提示:{{date.system_off_lock.system_off_lock_text}}</text>
+		</view>
+	<view class="bt-wenti">
+		<view class="kefu" onTap="phone">
+			<image src="../../img/kefu.png"></image>
+			<text>客服热线</text>
+		</view>
+		<view class="kaisuo" onTap="retryClose">
+			<text>重试关锁</text>
+		</view>
+	</view>
+	<!-- <view class="box_bottom">
+		<view>
+			
+			<image src="/img/you.png" style="width:48rpx;height:48rpx;"></image>
+			<text>客服热线</text>
+		</view>
+		<view  style="height:60rpx;" a:if="{{rent}}">
+			<text>关锁失败</text>
+			<text style="padding-right:4.5%;">重试关锁</text>
+			<image src="/img/you.png" style="width:48rpx;height:48rpx;" class="right"></image>
+		</view>
+	</view> -->
+	<!-- <view class="system_off_lock" >
+		<text>1212{{date.system_off_lock.system_off_lock_text}}</text>
+	</view> -->
+	<view class="fixed">
+		<view class="btn"
+			onTap="{{date.orders.order_wait_pay_money=='0.00' || date.orders.pay_status==1 ? 'home' : disable==true ? '' : 'payment'}}">
+			<text>{{date.orders.order_wait_pay_money=='0.00' || date.orders.pay_status==1? '返回首页' : '立即支付'}}</text>
+		</view>
+	</view>
+
+	<view class="notice_background" a:if="{{notice}}"></view>
+	<view class="notice_model" a:if="{{notice}}">
+		<view class="title1">
+			<text>调度费收费规则</text>
+		</view>
+		<view class="content">
+			<text>在运营区域外还车或禁停区还车,将收取30元调度费;</text>
+			<text>在运营区内还车:离最近的还车点{{setting.min_limit_km||'--'}}m内<block a:if="{{setting.min_dispatching_fee>0}}">
+					{{setting.min_dispatching_fee||'--'}}元</block>
+				<block a:else>免费</block>
+				,超出{{setting.min_limit_km||'--'}}m,每超出{{setting.over_limit_per_km||'--'}}m增加{{setting.over_limit_per_km_money||'--'}}元;最高收取{{setting.max_dispatching_fee||'--'}}元。
+			</text>
+		</view>
+		<view class="btn" onTap="notice_false">
+			<text>我知道了</text>
+		</view>
+	</view>
 </view>

+ 22 - 19
pages/pay/pay.js

@@ -11,7 +11,7 @@ Page({
     bolear: '', //判断当前余额够不够本次消费 够为true 不够为false
     check1: '',
     check2: '',
-    index: '', //记录当前选择的是余额还是微信支付
+    index: '', //记录当前选择的是余额还是支付宝支付
     disable: false,
     timing: '',
     rent: '',
@@ -147,17 +147,17 @@ Page({
               })
             } else {
               if (that.data.index == 1) {
-                my.requestPayment({ //调用微信支付
-                  timeStamp: res.data.timeStamp.toString(),
-                  nonceStr: res.data.nonceStr,
-                  package: res.data.package,
-                  signType: res.data.signType,
-                  paySign: res.data.paySign,
+                my.tradePay({
+                  tradeNO: res.data.tradeNo,
                   success(resp) {
-                    console.log(resp)
-                    my.reLaunch({
-                      url: '/pages/index/index',
-                    })
+                    console.log(resp, 'zhifubao')
+                    if (resp.resultCode == 9000) {
+                      my.reLaunch({
+                        url: '/pages/index/index',
+                      })
+                    } else {
+                      return
+                    }
                   },
                   fail(err) {
 
@@ -212,7 +212,7 @@ Page({
     })
   },
   check2: function () {
-    //选择微信支付
+    //选择支付宝支付
     this.setData({
       check1: false,
       check2: true
@@ -391,10 +391,15 @@ Page({
             my.tradePay({
               tradeNO: res.data.tradeNo,
               success(resp) {
-                console.log(resp)
-                my.reLaunch({
-                  url: '/pages/pay_success/pay_success',
-                })
+                console.log(resp, 'zhifubao')
+                if (resp.resultCode == 9000) {
+                  my.reLaunch({
+                    url: '/pages/pay_success/pay_success',
+                  })
+                } else {
+                  return
+                }
+
               },
               fail(err) {
                 // console.log(err)
@@ -414,9 +419,7 @@ Page({
               disable: false
             })
           } else {
-            my.reLaunch({
-              url: '/pages/pay_success/pay_success?order=' + that.data.date.orders.no,
-            })
+
           }
         } else {
           that.setData({

+ 1 - 0
pages/pay_success/pay_success.acss

@@ -104,6 +104,7 @@ border-radius: 12rpx;
 margin-top: 100rpx;
 margin-bottom: 50rpx;
 font-size: 32rpx;
+ color: var(--fontColor);
 }
 .home{
 width: 80%;

+ 1 - 0
pages/phonelogin/phonelogin.acss

@@ -47,4 +47,5 @@ margin-top:100rpx;
 }
 .next-step{
   background-color: var(--globleColor);
+    color: var(--fontColor);
 }

+ 10 - 8
pages/phonelogin/phonelogin.axml

@@ -1,8 +1,10 @@
-<view class="phone-login">
-  <view class="title">欢迎使用遇见你</view>
-  <input type="text" class="input-phone" placeholder="请输入手机号码" placeholder-class="no-input" bindinput="inputNumber"/>
-  <view class="tips">
-   <text> 手机号已不再使用</text><text class="iconfont icon-iconfontjiantou2"></text></view>
-   <view class="{{phoneNumber.length==11 ? 'next-step':'next'}}" onTap="nextStep">下一步</view>
-   <foottip>登录即代表同意</foottip>
-</view>
+<view class="phone-login">
+  <view class="title">欢迎使用遇见你</view>
+  <input type="text" class="input-phone" placeholder="请输入手机号码" placeholder-class="no-input" onInput="inputNumber"/>
+  <view class="tips">
+   <text> 手机号已不再使用</text><text class="iconfont icon-iconfontjiantou2"></text></view>
+   <view class="{{phoneNumber.length==11 ? 'next-step':'next'}}" onTap="nextStep">下一步</view>
+   <view class="button-tips" onTap="skipXieyi">
+    <text>登录即代表同意</text><text class="xieyi">《禹见你用户协议》</text>  
+  </view>
+</view>

+ 72 - 67
pages/phonelogin/phonelogin.js

@@ -1,68 +1,73 @@
-// pages/phonelogin/phonelogin.js
-var app = getApp()
-const util = require('../../utils/utils.js');
-Page({
-  data: {
-    phoneStatus: '',
-    phoneNumber: ''
-  },
-  inputNumber: function (e) {
-    let that = this
-    that.setData({
-      phoneNumber: e.detail.value
-    })
-
-  },
-  nextStep: util.throttle(function () {
-    let self = this
-    if (self.data.phoneNumber.length != 11) {
-      my.showToast({
-        content: '请输入正确的手机号',
-        icon: 'none',
-        duration: 2000
-      })
-    } else {
-      // 调用短信验证码接口
-      let data = {
-        mobile: self.data.phoneNumber,
-        type: 2
-      }
-      app.request('/verification-code', data, 'POST').then(res => {
-        console.log(res)
-        let phoneNumber = self.data.phoneNumber
-        if (res.status == 200) {
-          my.navigateTo({
-            url: '/pages/phone_verif/phone_verif?phoneNumber=' + phoneNumber,
-          })
-        }
-      })
-      //60秒倒计时
-
-    }
-  }, 1000),
-
-  onLoad: function (options) {
-
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+// pages/phonelogin/phonelogin.js
+var app = getApp()
+const util = require('../../utils/utils.js');
+Page({
+  data: {
+    phoneStatus: '',
+    phoneNumber: ''
+  },
+  inputNumber: function (e) {
+    let that = this
+    that.setData({
+      phoneNumber: e.detail.value
+    })
+
+  },
+  nextStep: util.throttle(function () {
+    let self = this
+    if (self.data.phoneNumber.length != 11) {
+      my.showToast({
+        content: '请输入正确的手机号',
+        icon: 'none',
+        duration: 2000
+      })
+    } else {
+      // 调用短信验证码接口
+      let data = {
+        mobile: self.data.phoneNumber,
+        type: 2
+      }
+      app.request('/verification-code', data, 'POST').then(res => {
+        console.log(res)
+        let phoneNumber = self.data.phoneNumber
+        if (res.status == 200) {
+          my.navigateTo({
+            url: '/pages/phone_verif/phone_verif?phoneNumber=' + phoneNumber,
+          })
+        }
+      })
+      //60秒倒计时
+
+    }
+  }, 1000),
+    skipXieyi:function(){
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
+
+  onLoad: function (options) {
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 8 - 3
pages/real_name/real_name.acss

@@ -43,10 +43,10 @@
 
 .form {
   margin-top: 30rpx;
-  /* height: 100rpx;
-  line-height: 100rpx; */
+  height: 100rpx;
+  line-height: 100rpx;
   background-color: #f2f2f4;
-  padding: 30rpx;
+  padding:0 30rpx;
   display: flex;
   font-size: 30rpx;
 
@@ -59,6 +59,9 @@
 
 input {
   flex: 1;
+  /* line-height: 100rpx; */
+  height:90rpx;
+  background-color: #f2f2f4;
 
 }
 
@@ -75,6 +78,7 @@ input {
   margin: 0 auto;
   margin-top: 100rpx;
   background-color: var(--globleColor);
+   color: var(--fontColor);
 }
 
 .frame {
@@ -179,4 +183,5 @@ input {
   width: 60%;
   font-size: 34rpx;
   font-weight: 500;
+ color: var(--fontColor);
 }

+ 51 - 51
pages/real_name/real_name.axml

@@ -1,52 +1,52 @@
-<view class="real_name">
-  <view class="top-tips">
-    <text>当前登录手机号为{{mobile}},如果登错,请更换</text>
-    <text class="change-phone" onTap="changeMobile">更换号码</text>
-  </view>
-  <view class="content">
-    <view class="title">请完善您的认证信息</view>
-    <view class="text1">
-      所有信息仅用于保障您的资金安全,请提供真是信息
-    </view>
-    <view class="form">
-      <view class="left">真实姓名</view>
-      <input type="text" placeholder="请输入姓名" placeholder-class="no-input" bindblur="ckName" value="{{nameVal}}"
-        bindinput="name" bindconfirm="namefirm" />
-    </view>
-    <view class="form">
-      <view class="left">身份证号</view>
-      <input placeholder="请输入身份证号" placeholder-class="no-input" bindblur="ckCard" value="{{cardVal}}" bindinput="input"
-        bindconfirm="valuefirm" type="idcard" />
-    </view>
-    <view class="submit" onTap="sureSubmit">确认并提交</view>
-  </view>
-  <view class="frame" a:if="{{frameShow==true}}">
-
-    <view class="frame-content">
-      <view class="frame-cha"><text class="iconfont icon-cha" onTap="frameClose"></text></view>
-      <view class="frame-title">Hi 恭喜获得以下奖励</view>
-      <view class="card">
-        <view class="card-left">
-          <view class="card-title">注册奖励</view>
-          <view class="card-text1">2天免押骑行</view>
-        </view>
-        <view class="card-right">
-          <image src="../../img/dun.png"></image>
-        </view>
-      </view>
-      <view class="card1">
-        <view class="card-left">
-          <view class="card-title">注册奖励</view>
-          <view class="card-text1">2天免押骑行</view>
-        </view>
-        <view class="card-right">
-          <view class="card-text1">电单车</view>
-        </view>
-      </view>
-      <view class="wancheng">
-        <view class="wan-tip">仅差一步就可以用车了</view>
-        <view class="wan-submit" onTap="frameClose">完成认证享优惠</view>
-      </view>
-    </view>
-  </view>
+<view class="real_name">
+  <view class="top-tips">
+    <text>当前登录手机号为{{mobile}},如果登错,请更换</text>
+    <text class="change-phone" onTap="changeMobile">更换号码</text>
+  </view>
+  <view class="content">
+    <view class="title">请完善您的认证信息</view>
+    <view class="text1">
+      所有信息仅用于保障您的资金安全,请提供真是信息
+    </view>
+    <view class="form">
+      <view class="left">真实姓名</view>
+      <input type="text" placeholder="请输入姓名" placeholder-class="no-input" onBlur="ckName" value="{{nameVal}}"
+        onInput="name" onConfirm="namefirm" />
+    </view>
+    <view class="form">
+      <view class="left">身份证号</view>
+      <input placeholder="请输入身份证号" placeholder-class="no-input" onBlur="ckCard" value="{{cardVal}}" onInput="input"
+        onConfirm="valuefirm" type="idcard" />
+    </view>
+    <view class="submit" onTap="sureSubmit">确认并提交</view>
+  </view>
+  <view class="frame" a:if="{{frameShow==true}}">
+
+    <view class="frame-content">
+      <view class="frame-cha"><text class="iconfont icon-cha" onTap="frameClose"></text></view>
+      <view class="frame-title">Hi 恭喜获得以下奖励</view>
+      <view class="card">
+        <view class="card-left">
+          <view class="card-title">注册奖励</view>
+          <view class="card-text1">2天免押骑行</view>
+        </view>
+        <view class="card-right">
+          <image src="../../img/dun.png"></image>
+        </view>
+      </view>
+      <view class="card1">
+        <view class="card-left">
+          <view class="card-title">注册奖励</view>
+          <view class="card-text1">2天免押骑行</view>
+        </view>
+        <view class="card-right">
+          <view class="card-text1">电单车</view>
+        </view>
+      </view>
+      <view class="wancheng">
+        <view class="wan-tip">仅差一步就可以用车了</view>
+        <view class="wan-submit" onTap="frameClose">完成认证享优惠</view>
+      </view>
+    </view>
+  </view>
 </view>

+ 1 - 0
pages/refund_success/refund_success.acss

@@ -33,4 +33,5 @@ text-align: center;
 line-height:80rpx;
 border-radius: 15rpx;
 font-size: 32rpx;
+ color: var(--fontColor);
 }

+ 6 - 1
pages/ride_zige/ride_zige.acss

@@ -1,5 +1,8 @@
 /* required by usingComponents */
 /* pages/ride_zige/ride_zige.wxss */
+page{
+  background: #ffffff;
+}
 .zige-tips {
   text-align: center;
   padding: 20rpx;
@@ -46,7 +49,7 @@
 }
 
 .active {
-  background-color: #fffbef;
+  background-color: var(--fillColor);
   border: solid 1rpx var(--globleColor);
 }
 
@@ -111,6 +114,7 @@
   border-radius: 50rpx;
   font-size: 34rpx;
   font-weight: bold;
+   color: var(--fontColor);
 }
 
 .zige-frame {
@@ -154,6 +158,7 @@
   background-color: var(--globleColor);
   margin-top: 30rpx;
   font-size: 28rpx;
+   color: var(--fontColor);
 }
 
 .frame-title .iconfont {

+ 2 - 2
pages/ride_zige/ride_zige.axml

@@ -29,9 +29,9 @@
       </view>
     </view>
   </view>
-  <view class="card-list" >
+  <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="card-item" class="{{currentItem==0 ? 'active' :'card-item'}}"   onTap="changeCard" data-id="0" >
       <view class="item-left">
         <view class="card-title">押金</view>
         <view class="card-text">随时可退 | 极速到账</view>

+ 40 - 35
pages/ride_zige/ride_zige.js

@@ -12,10 +12,10 @@ Page({
 
   },
   onLoad: function (options) {
-    let deposit = my.getStorageSync({'key':'userState'}).data
+    let deposit = my.getStorageSync({ 'key': 'userState' }).data
     this.setData({
-      deposit: my.getStorageSync({'key':'userState'}).data,
-      depositMoney: my.getStorageSync({'key':'setting'}).data.deposit
+      deposit: my.getStorageSync({ 'key': 'userState' }).data,
+      depositMoney: my.getStorageSync({ 'key': 'setting' }).data.deposit
     })
 
     this.getCard()
@@ -26,9 +26,9 @@ Page({
   getCard() {
     my.showLoading({})
     let data = {
-      area_id: my.getStorageSync({'key':'home'}).data.id
+      area_id: my.getStorageSync({ 'key': 'home' }).data.id
     }
-    if (my.getStorageSync({'key':'home'}).data.id == undefined) {
+    if (my.getStorageSync({ 'key': 'home' }).data.id == undefined) {
       my.hideLoading()
       my.showToast({
         content: '您附近没有运营区域',
@@ -54,6 +54,7 @@ Page({
   changeCard: function (e) {
     let that = this
     let id = e.currentTarget.dataset.id
+    console.log(e,'pppppp')
     that.setData({
       currentItem: id
     })
@@ -78,22 +79,22 @@ Page({
         console.log(11111)
         url = "/deposit/pay";
         data = {
-          area_id: my.getStorageSync({'key':'home'}).data.id
+          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,
+          area_id: my.getStorageSync({ 'key': 'home' }).data.id,
           id: that.data.currentItem
         }
       }
-      if (my.getStorageSync({'key':'setting'}).data == '') {
+      if (my.getStorageSync({ 'key': 'setting' }).data == '') {
         my.alert({
           title: '提示',
           content: '您附近暂无运营区域~',
           success: function (res) {
-              my.navigateBack()
+            my.navigateBack()
           }
         })
       } else {
@@ -101,29 +102,33 @@ Page({
           console.log(res)
           if (res.status == 200) {
             console.log(res)
-           my.tradePay({
-            tradeNO: res.data.tradeNo,
+            my.tradePay({
+              tradeNO: res.data.tradeNo,
               success(res) {
                 console.log(res)
-                let init = '';
-                if (that.data.depShow) {
-                  init = "购买成功"
+                if (res.resultCode == 9000) {
+                  let init = '';
+                  if (that.data.depShow) {
+                    init = "购买成功"
+                  } else {
+                    init = "支付成功"
+                  }
+                  my.showToast({
+                    content: init,
+                    icon: 'none',
+                    duration: 1000,
+                    success: function () {
+                      my.reLaunch({
+                        url: '/pages/depochenSuce/depoSuce',
+                      })
+                    }
+                  })
+                  that.setData({
+                    depoSuce: true
+                  })
                 } else {
-                  init = "支付成功"
+                  return
                 }
-                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)
@@ -164,8 +169,8 @@ Page({
     })
   },
   //立即退还
-  sureBack:util.throttle(function (e) {
-    let setting=my.getStorageSync({'key':'setting'}).data
+  sureBack: util.throttle(function (e) {
+    let setting = my.getStorageSync({ 'key': 'setting' }).data
     var that = this;
     if (setting.deposit_delay_setting.status == true) {
       my.confirm({
@@ -177,18 +182,18 @@ Page({
         confirmButtonText: "确认", //默认是“确定”
         confirmColor: '#FF0000', //确定文字的颜色
         success: function (res) {
-          if (res.confirm==false) {
+          if (res.confirm == false) {
             //点击取消,默认隐藏弹框
           } else {
             //点击确定
             app.request('/deposit/refund-job', '', 'POST').then(res => {
-              console.log(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=>{
+            }).catch(err => {
               console.log('0000')
             })
           }
@@ -202,11 +207,11 @@ Page({
             content: '申请成功,1个工作日内到账!',
             icon: 'none'
           })
-          setTimeout(function(){
+          setTimeout(function () {
             my.reLaunch({
               url: '/pages/index/index',
             })
-          },1500)
+          }, 1500)
           // this.getState()
         }
       })

+ 77 - 0
pages/test/test.acss

@@ -0,0 +1,77 @@
+/* required by usingComponents */
+/* pages/trip_detail/trip_detail.wxss */
+page {
+  background-color: #f2f3f5;
+  padding-top: 20rpx;
+}
+
+.trip-detail {
+  padding: 0 20rpx;
+
+}
+
+.top-map {
+  padding: 30rpx;
+  border-radius: 12rpx;
+  font-weight: 500;
+  margin-bottom: 30rpx;
+  background-color: #ffffff;
+}
+
+.top-map-title {
+  font-size: 32rpx;
+  font-weight: 500;
+  margin-bottom: 30rpx;
+}
+
+#map {
+height: 250rpx;
+ width: 100%;
+  
+}
+
+.bike-no {
+  float: right;
+}
+
+.bill-detail {
+  font-size: 30rpx;
+  font-weight: 500;
+  margin-top: 30rpx;
+  margin-bottom: 20rpx;
+}
+.bill-dec{
+  font-size: 26rpx;
+  color: #999999;
+  margin-bottom: 40rpx;
+}
+.total-money{
+  text-align: right;
+  padding-bottom: 40rpx;
+  border-bottom: solid 1rpx #f2f3f5;
+  margin-bottom: 40rpx;
+  font-size: 30rpx;
+}
+.total-num{
+  font-size: 40rpx;
+  display: inline-block;
+  margin: 0 5rpx;
+}
+.guize{
+height: 80rpx;
+width:45%;
+text-align: center;
+margin: 0 auto;
+border-radius: 10rpx;
+line-height: 80rpx;
+margin-top: 70rpx;
+border: solid 2rpx #999999;
+font-size: 28rpx;
+}
+.problem{
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  font-size: 24rpx;
+  color: #999999;
+}

+ 50 - 5
pages/test/test.axml

@@ -1,6 +1,51 @@
-<view>
- <button open-type="getAuthorize"
-        onGetAuthorize="onGetAuthorize" onError="onAuthError" scope='phoneNumber'>
-    授权手机号
-</button>
+<view class="trip-detail">
+  <view class="top-map">
+    <view class="top-map-title">本单实际信息</view>
+    <map name="" id="map" markers="{{markers}}" latitude="{{latitude}}" longitude="{{longitude}}"
+      polyline="{{polyline}}"></map>
+  </view>
+  <view class="top-map">
+    <view class="top-map-title">
+      <text>车辆编号</text>
+      <text class="bike-no">{{date.bike_no}}</text>
+    </view>
+    <view class="bill-detail">账单信息</view>
+    <view class="bill-dec">用车时间:{{date.start_use_bike_time}}</view>
+    <view class="bill-detail">
+      <text>时长费用</text>
+      <text class="bike-no">{{date.time_money}}元</text>
+    </view>
+    <view class="bill-detail">
+      <text>优惠金额</text>
+      <text class="bike-no">{{date.preferential_money}}元</text>
+    </view>
+    <view class="bill-detail">
+      <text>里程费用</text>
+      <text class="bike-no">{{date.distance_money}}元</text>
+    </view>
+    <!-- <view class="bill-detail">
+      <text>骑行卡</text>
+      <text class="bike-no">{{date.distance_money}}元</text>
+    </view> -->
+    <view class="bill-detail">
+      <text>调度费</text>
+      <text class="bike-no">{{date.dispatch_money}}元</text>
+    </view>
+    <!-- <view class="bill-detail">
+      <text>优惠金额</text>
+      <text class="bike-no">{{data.preferential_money}}元</text>
+    </view> -->
+    <view class="bill-dec">含里程{{date.use_bike_distance_length}},含时长{{date.use_bike_time_length}}钟</view>
+    <view class="total-money">本单费用<text class="total-num">{{date.total_money}}</text>元</view>
+    <view class="bill-detail">
+      <text>支付方式</text>
+      <text class="bike-no">{{date.pay_type==1 ? '支付宝支付' : '余额支付'}}</text>
+    </view>
+    <view class="bill-detail">
+      <text>订单状态</text>
+      <text class="bike-no">已完成</text>
+    </view>
+    <view class="guize" onTap="chargeRule">计费规则</view>
+    <view class="problem" onTap="noAgree">不认可收费</view>
+  </view>
 </view>

+ 3 - 1
pages/trip/trip.acss

@@ -3,10 +3,12 @@
 page{
   background-color: #f2f3f5;
   padding-bottom: 30rpx;
-  /* height: 100%; */
+  padding-top: 10rpx;
+  height: 100%;
 }
 .trip-list{
 margin: 0 20rpx;
+height: 100%;
 }
 .trip-list-item{
   border-radius: 6rpx;

+ 36 - 36
pages/trip/trip.axml

@@ -1,37 +1,37 @@
-<view class="trip">
-  <view class="trip-list">
-    <view class="trip-list-item" onTap="tripDetail" a:for="{{orderList}}" a:key='index' data-index="{{item}}"> 
-      <view class="title">
-        <view class="title-left">电单车</view>
-        <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}}">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>
-      <view class="time">
-        <image src="../../img/time.png" class="time-image"></image>
-        <view class="time-text">车辆编号:{{item.bike_no}}</view>
-      </view>
-      <view class="dizhi">
-        <view class="dizhi-left">
-          <view class="dian1"></view>
-          <view class="dian2"></view>
-          <view class="xian"></view>
-        </view>
-        <view class="dizhi-right">
-          <view class="place">开始时间:{{item.start_use_bike_time}}</view>
-          <view class="place">结束时间:{{item.end_use_bike_time}}</view>
-        </view>
-        <view class="time">{{item.use_bike_time_length}}</view>
-      </view>
-    </view>
-  </view>
-  <view class="none" a:if="{{orderList.length==0}}">
-    <image src="../../img/nocard.png"></image>
-    <view class="more">暂无数据</view>
-  </view>
-  
+<view class="trip">
+  <view class="trip-list">
+    <view class="trip-list-item" onTap="tripDetail" a:for="{{orderList}}" a:key='index' data-index="{{item}}"> 
+      <view class="title">
+        <view class="title-left">电单车</view>
+        <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==0}}">临时停车</text>
+          <text class="iconfont icon-iconfontjiantou2" style="font-size:28rpx"></text></view>
+      </view>
+      <view class="time">
+        <image src="../../img/time.png" class="time-image"></image>
+        <view class="time-text">车辆编号:{{item.bike_no}}</view>
+      </view>
+      <view class="dizhi">
+        <view class="dizhi-left">
+          <view class="dian1"></view>
+          <view class="dian2"></view>
+          <view class="xian"></view>
+        </view>
+        <view class="dizhi-right">
+          <view class="place">开始时间:{{item.start_use_bike_time}}</view>
+          <view class="place">结束时间:{{item.end_use_bike_time}}</view>
+        </view>
+        <view class="time">{{item.use_bike_time_length}}</view>
+      </view>
+    </view>
+  </view>
+  <view class="none" a:if="{{orderList.length==0}}">
+    <image src="../../img/nocard.png"></image>
+    <view class="more">暂无数据</view>
+  </view>
+  
 </view>

+ 4 - 2
pages/trip_detail/trip_detail.acss

@@ -2,6 +2,7 @@
 /* pages/trip_detail/trip_detail.wxss */
 page {
   background-color: #f2f3f5;
+  padding-top: 20rpx;
 }
 
 .trip-detail {
@@ -11,9 +12,9 @@ page {
 
 .top-map {
   padding: 30rpx;
-  margin-top: 20rpx;
   border-radius: 12rpx;
   font-weight: 500;
+  margin-bottom: 30rpx;
   background-color: #ffffff;
 }
 
@@ -24,7 +25,8 @@ page {
 }
 
 #map {
-  width: 100%;
+height: 300rpx;
+ width: 100%;
   
 }
 

+ 50 - 50
pages/trip_detail/trip_detail.axml

@@ -1,51 +1,51 @@
-<view class="trip-detail">
-  <view class="top-map">
-    <view class="top-map-title">本单实际defaultTitle信息</view>
-    <map name="" id="map" markers="{{markers}}" latitude="{{latitude}}" longitude="{{longitude}}"
-      polyline="{{polyline}}"></map>
-  </view>
-  <view class="top-map">
-    <view class="top-map-title">
-      <text>车辆编号</text>
-      <text class="bike-no">{{date.bike_no}}</text>
-    </view>
-    <view class="bill-detail">账单信息</view>
-    <view class="bill-dec">用车时间:{{date.start_use_bike_time}}</view>
-    <view class="bill-detail">
-      <text>时长费用</text>
-      <text class="bike-no">{{date.time_money}}元</text>
-    </view>
-    <view class="bill-detail">
-      <text>优惠金额</text>
-      <text class="bike-no">{{date.preferential_money}}元</text>
-    </view>
-    <view class="bill-detail">
-      <text>里程费用</text>
-      <text class="bike-no">{{date.distance_money}}元</text>
-    </view>
-    <!-- <view class="bill-detail">
-      <text>骑行卡</text>
-      <text class="bike-no">{{date.distance_money}}元</text>
-    </view> -->
-    <view class="bill-detail">
-      <text>调度费</text>
-      <text class="bike-no">{{date.dispatch_money}}元</text>
-    </view>
-    <!-- <view class="bill-detail">
-      <text>优惠金额</text>
-      <text class="bike-no">{{data.preferential_money}}元</text>
-    </view> -->
-    <view class="bill-dec">含里程{{date.use_bike_distance_length}},含时长{{date.use_bike_time_length}}钟</view>
-    <view class="total-money">本单费用<text class="total-num">{{date.total_money}}</text>元</view>
-    <view class="bill-detail">
-      <text>支付方式</text>
-      <text class="bike-no">{{date.pay_type==1 ? '微信支付' : '余额支付'}}</text>
-    </view>
-    <view class="bill-detail">
-      <text>订单状态</text>
-      <text class="bike-no">已完成</text>
-    </view>
-    <view class="guize" onTap="chargeRule">计费规则</view>
-    <view class="problem" onTap="noAgree">不认可收费</view>
-  </view>
+<view class="trip-detail">
+  <view class="top-map">
+    <view class="top-map-title">本单实际信息</view>
+    <map name="" id="map" markers="{{markers}}" latitude="{{latitude}}" longitude="{{longitude}}"
+      polyline="{{polyline}}"></map>
+  </view>
+  <view class="top-map">
+    <view class="top-map-title">
+      <text>车辆编号</text>
+      <text class="bike-no">{{date.bike_no}}</text>
+    </view>
+    <view class="bill-detail">账单信息</view>
+    <view class="bill-dec">用车时间:{{date.start_use_bike_time}}</view>
+    <view class="bill-detail">
+      <text>时长费用</text>
+      <text class="bike-no">{{date.time_money}}元</text>
+    </view>
+    <view class="bill-detail">
+      <text>优惠金额</text>
+      <text class="bike-no">{{date.preferential_money}}元</text>
+    </view>
+    <view class="bill-detail">
+      <text>里程费用</text>
+      <text class="bike-no">{{date.distance_money}}元</text>
+    </view>
+    <!-- <view class="bill-detail">
+      <text>骑行卡</text>
+      <text class="bike-no">{{date.distance_money}}元</text>
+    </view> -->
+    <view class="bill-detail">
+      <text>调度费</text>
+      <text class="bike-no">{{date.dispatch_money}}元</text>
+    </view>
+    <!-- <view class="bill-detail">
+      <text>优惠金额</text>
+      <text class="bike-no">{{data.preferential_money}}元</text>
+    </view> -->
+    <view class="bill-dec">含里程{{date.use_bike_distance_length}},含时长{{date.use_bike_time_length}}钟</view>
+    <view class="total-money">本单费用<text class="total-num">{{date.total_money}}</text>元</view>
+    <view class="bill-detail">
+      <text>支付方式</text>
+      <text class="bike-no">{{date.pay_type==1 ? '支付宝支付' : '余额支付'}}</text>
+    </view>
+    <view class="bill-detail">
+      <text>订单状态</text>
+      <text class="bike-no">已完成</text>
+    </view>
+    <view class="guize" onTap="chargeRule">计费规则</view>
+    <view class="problem" onTap="noAgree">不认可收费</view>
+  </view>
 </view>

+ 5 - 1
pages/use_bike/use_bike.acss

@@ -29,7 +29,7 @@
 
 .use-bike-bottom {
   position: fixed;
-  z-index: 99999999999;
+  z-index: 99999;
   background-color: #fff;
   width: 100%;
   bottom: 0;
@@ -88,6 +88,7 @@
   font-size: 32rpx;
   font-weight: 600;
   background-color: var(--globleColor);
+   color: var(--fontColor);
   margin: 0 auto;
 }
 .lanya{
@@ -191,6 +192,7 @@
   text-align: center;
   border: solid 1rpx var(--globleColor);
   background-color: var(--globleColor);
+   color: var(--fontColor);
 }
 .bell-image{
   height: 40rpx;
@@ -251,6 +253,7 @@
 .step3-bottom-right {
   flex: 1;
   background-color: var(--globleColor);
+   color: var(--fontColor);
   border-radius: 50rpx;
 }
 
@@ -340,6 +343,7 @@
   margin-left: 50rpx;
   border-radius: 50rpx;
   background-color: var(--globleColor);
+   color: var(--fontColor);
 }
 /* 未开启位置权限 */
 .pay-frame{

+ 170 - 170
pages/use_bike/use_bike.axml

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

+ 465 - 243
pages/use_bike/use_bike.js

@@ -19,7 +19,7 @@ let operateType = ''  //'open'开锁 'close'上锁 'bell'寻铃 'temporaryClose'
 Page({
   data: {
     nowBikeStatus: '',//当前车辆的状态
-    money: {time_money:0,dispatch_money:0,total_money:0},//骑行费用
+    money: { time_money: 0, dispatch_money: 0, total_money: 0 },//骑行费用
     steps: 1,//开锁步骤
     parkStatus: 0,//骑行中:0,临时停车:1,点击结束用车:2
     frame: false,//车辆未开锁弹框
@@ -55,87 +55,263 @@ Page({
     location: false,//位置权限弹框
     coundDownTime: 5,//运动中不可锁车倒计时
     countTimeShow: false,
-    dispatch_money:0,//调度费
+    dispatch_money: 0,//调度费
+    area_id: '',//区域id
 
   },
   onShow: function () {
     let that = this
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    clearInterval(locationTerval);
     that.posiLoca()
+    app.login().then(res => {
+      that.chushiPosiloc()
+      if (that.data.code) {
+        that.getBikeMessage()
+      }
+    })
     if (that.data.order != undefined) {
       that.chushi()
     }
   },
-  onLoad: function (options) {
+  //初始化位之信息并获取区域
+  chushiPosiloc: function () {
     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) {
+    my.showLoading({
+      content: '正在定位...',
+    })
+    my.getLocation({
+      type: 'gcj02',
+      success: (res) => {
+        console.log('经纬度为:+++++++++++2323++++++++++' + res.latitude + '++++++++' + res.longitude)
+        var latitude = res.latitude
+        var longitude = res.longitude
+        my.hideLoading()
         that.setData({
-          order: options.order,
+          longitude: longitude,
+          latitude: latitude,
         })
-        that.chushi()
-      }
-      if (options.code != undefined) {
-        that.setData({
-          code: options.code
+        that.home()
+      },
+      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
+              })
+            }
+          }
         })
-        this.getBikeMessage(options)
       }
-
-      this.setData({
-        code: options.code
+    })
+  },
+  onLoad: function (options) {
+    let that = this
+    if (options.query) {
+      console.log('扫码加载')
+      var code1 = decodeURIComponent(options.query.qrCode)
+      var index = code1.lastIndexOf("\=");
+      let code = code1.substring(index + 1, code1.length);
+      that.setData({
+        code: code
       })
-    }
-    my.onLocationChange(function (res) {
-      console.log(res, '实时监听位置')
+    } else if (options.order != undefined) {
       that.setData({
-        longitude: res.longitude,
-        latitude: res.latitude,
+        order: options.order,
       })
-    })
-    my.startLocationUpdate({
-      success: (res) => {
-        console.log(res, '启动位置跟踪')
-      },
+    } else {
+      that.setData({
+        code: options.code
+      })
+    }
+    // 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
+    //   })
+    // }
+  },
+  //获取token
+  // token: function () {
+  //   my.getAuthCode({
+  //     success: function (res) {
+  //       var data = {
+  //         'code': res.authCode,
+  //         'appid': app.globalData.appid,
+  //         'type': 1
+  //       };
+  //       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 });
+  //       })
+  //     }
+  //   })
+  // },
+  //用户状态
+  userState: function (area_id) {
+    var that = this;
+    var data = {
+      'area_id': area_id
+    }
+    app.request("/user/status", data, "GET").then(res => {
+      console.log(res, 'zhuangtai')
+      if (res.status == 200) {
+        my.setStorageSync({ 'key': 'userState', data: res.data });
+        if (res.data.is_ride_order) {
+          that.setData({
+            order: res.data.is_ride_order,
+          })
+          that.chushi()
+        }
+      } else {
+        if (this.data.bikeInfo.is_link == 0) {
+
+          my.alert({
+            title: '提示',
+            content: '当前车子已下线请换辆车子骑行吧~',
+            success: function (res) {
+              my.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          })
+          return;
+        } else if (this.data.bikeMessage.put_status == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子还未投放请换辆车子骑行吧~',
+            success: function (res) {
+              wx.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          })
+          return;
+        } else if (this.data.bikeMessage.is_low_battery_power == 0) {
+          my.alertal({
+            title: '提示',
+            content: '当前车子电量过低请换辆车子骑行吧~',
+            success: function (res) {
+              wx.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          })
+          return;
+        } else if (this.data.bikeMessage.is_trouble == 1) {
+          my.alert({
+            title: '提示',
+            content: '当前车子出现故障请换辆车子骑行吧~',
+            success: function (res) {
+              wx.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          })
+          return;
+        } else if (this.data.bikeMessage.is_riding == 1) {
+          my.alert({
+            title: '提示',
+            content: '当前车子正在骑行请换辆车子骑行吧~',
+            success: function (res) {
+              wx.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          })
+          return;
+        }
+      }
+    }).catch(err => {
+      console.log(err)
     })
   },
-   //获取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});
+  //骑行区禁停区车辆
+  home: function () {
+    //请求首页接口和一些设置。
+    console.log('测试')
+    var that = this;
+    if (that.data.longitude != '' && that.data.latitude != '') {
+      //116.411027
+      var data = {
+        'lat': that.data.latitude,
+        'lng': that.data.longitude
+      }
+      app.request("/pages/home?include=setting", data, "POST").then(res => {
+        console.log(res, '骑行区域')
+
+        if (res.status == 200) {
+          var data = res.data;
+          that.setData({
+            area_id: res.data.id
+          })
+          let area_id = res.data.id
+          that.userState(area_id)
+          that.ban_stop(area_id)
+          console.log(data, '区域')
+          my.setStorageSync({ 'key': 'home', data: data });
+
+        }
+        console.log(data, 'tdada')
+        if (data) {
+          my.setStorageSync({ 'key': 'setting', data: data.setting });
+
+        } else {
+          my.removeStorageSync({ key: 'setting' })
+        }
+      }).catch(err => {
+        console.log(err)
+        my.alert({
+          title: '提示',
+          content: err.data.message,
         })
-      }})
+      })
+    }
   },
+
+
   //停车区域
   ban_stop: function (area_id) {
     var that = this;
-    let home = my.getStorageSync({'key':'home'}).data
+    let home = my.getStorageSync({ 'key': 'home' }).data
     that.setData({
       polygons1: that.data.polygons1.concat(home)
     })
@@ -150,7 +326,6 @@ Page({
         that.setData({
           markers: that.data.markers.concat(data.centres),
           polygons: that.data.polygons1.concat(data.polygons),
-          // polygons:data.polygons,
         })
       }
     })
@@ -164,7 +339,7 @@ Page({
       console.log(res, ',---------')
       if (res.status == 200) {
         my.hideLoading()
-        my.setStorageSync({'key':'bike_status',data: res.data.status})
+        my.setStorageSync({ 'key': 'bike_status', data: res.data.status })
 
         if (res.data.start_use_bike_time <= 0) {
           that.setData({
@@ -185,9 +360,9 @@ Page({
           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;
+        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) {
           //骑行中
@@ -222,10 +397,10 @@ Page({
         } else if (res.data.status == 2) {
           clearInterval(interval),
             // clearInterval(interval1);
-            // clearInterval(locationTerval);
-            my.reLaunch({
-              url: '../payment/payment?order=' + res.data.no
-            })
+            clearInterval(locationTerval);
+          my.reLaunch({
+            url: '../payment/payment?order=' + res.data.no
+          })
         } else {
           my.reLaunch({
             url: '../index/index',
@@ -240,41 +415,21 @@ Page({
   //获取当前位置
   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
-              })
-            }
-          }
-        })
-      }
-    })
-    // },)
+    locationTerval = setInterval(function () {
+      my.getLocation({
+        type: 'gcj02',
+        success: (res) => {
+          console.log('经纬度为:+++++++++++2323++++++++++' + res.latitude + '++++++++' + res.longitude)
+          var latitude = res.latitude
+          var longitude = res.longitude
+          my.hideLoading()
+          that.setData({
+            longitude: longitude,
+            latitude: latitude,
+          })
+        },
+      })
+    }, 5000)
   },
   //获取蓝牙秘钥
   getSecretKey(box_no) {
@@ -288,7 +443,7 @@ Page({
       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})
+        my.setStorageSync({ 'key': 'box_no', data: box_no })
       })
     });
   },
@@ -298,13 +453,13 @@ Page({
     clearInterval(interval)
     clearInterval(huancheTime)
     var times = ''; //秒数
-    var minute = 0; //分钟 
+    var minute = 0; //分钟
     var minute1 = '0'; //分钟
     var hour = 0; //小时
     var hour1 = '0'; //小时
-    var time = that.data.minute //获取当前已骑行的秒数  
+    var time = that.data.minute //获取当前已骑行的秒数
     console.log(time)
-    var setting = my.getStorageSync({'key':'setting'}).data;
+    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) {
@@ -379,7 +534,7 @@ Page({
       }
       // that.setData({ times: minute1 + ':' + times})
       //计算钱   分钟除以5*5   判断秒数>30  minute = minute+1
-      //不满12分钟按12分钟算   并且大于30秒   
+      //不满12分钟按12分钟算   并且大于30秒
       var per_money = setting.per_money;
       var per_minute = setting.per_minute;
       // console.log(minute)
@@ -389,7 +544,7 @@ Page({
           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));
@@ -397,9 +552,9 @@ Page({
         //   money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
         // }
         // if (minute > 0) {
-          that.setData({
-            estimate_money: money
-          })
+        that.setData({
+          estimate_money: money
+        })
         // } else {
         //   if (times >= 30) {
         //     that.setData({
@@ -412,79 +567,79 @@ Page({
   },
 
   //获取车辆信息
-  getBikeMessage: function (options) {
+  getBikeMessage: function () {
     var that = this;
-    let code = options.code
-    app.request('/bike/' + code, '', 'GET').then(res => {
+    app.request('/bike/' + that.data.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()
+      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.setData({
+          bikeMessage: res.data,
+          battery_power: res.data.battery_power,
+          steps: 1
+        }),
+          key = res.data.key
+        // 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)
-        }
+        // that.getSecretKey(box_no)
+        // }
       } else {
         setTimeout(function () {
           my.reLaunch({
@@ -499,20 +654,33 @@ Page({
   //检测用户是否完成实名认证,是否有待支付订单违章记录等
   jiance: function () {
     let that = this
-    var userStatus = my.getStorageSync({'key':'userState'}).data;
-    var setting = my.getStorageSync({'key':'setting'}).data;
+    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',
-      })
-    }//是否缴纳押金 
+      if (userStatus.is_bind_mobile == 0) {
+        wx.navigateTo({
+          url: '/pages/authorization/authorization',
+        })
+        //未实名认证
+      } else
+        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 if (userStatus.is_ride_order !== false) {
+      console.log(userStatus, 'yyyyyyyyyyyyyyy')
+      my.alert({
+        title: '提示',
+        content: '您有一个正在骑行中的订单',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
       })
     }
     else {
@@ -559,7 +727,7 @@ Page({
     console.log(chaTime, 'chaTime')
     linshiStop = setInterval(function () {
       let test = 30 * 60 * 1000
-      console.log(test,'test')
+      console.log(test, 'test')
       if (date3 > test) {
         that.setData({
           stopMiao: 0,
@@ -598,12 +766,8 @@ Page({
       bike_no: that.data.code,
       lat: that.data.latitude,
       lng: that.data.longitude,
-      area_id: my.getStorageSync({'key':'home'}).data.id,
+      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) {
@@ -612,6 +776,10 @@ Page({
           order: res.data.no
         })
         that.terval()
+        //蓝牙开锁
+        operateType = 'open'
+        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+        });
         my.hideLoading()
       } else {
         // that.setData({
@@ -632,10 +800,7 @@ Page({
       content: '开锁中...',
       mask: true
     })
-    operateType = 'open'
-    bluetoothOperate.start(operateType, machineNO, key, (flag) => {
 
-    });
     let data = {
       order_no: that.data.order,
       bike_no: that.data.code
@@ -649,6 +814,9 @@ Page({
             frame: false
           })
           my.hideLoading()
+          operateType = 'open'
+          bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+          });
           my.showToast({
             content: '开锁成功',
             icon: 'none'
@@ -659,10 +827,63 @@ Page({
   },
   openBikeClick: function () {
     let that = this
-    that.setData({
-      steps: 2
-    })
-
+    if (this.data.bikeMessage.is_link == 0) {
+      my.alert({
+        title: '提示',
+        content: '当前车子已下线请换辆车子骑行吧~',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+      return;
+    } else if (this.data.bikeMessage.put_status == 0) {
+      my.alert({
+        title: '提示',
+        content: '当前车子还未投放请换辆车子骑行吧~',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+      return;
+    } else if (this.data.bikeMessage.is_low_battery_power == 0) {
+      my.alert({
+        title: '提示',
+        content: '当前车子电量过低请换辆车子骑行吧~',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+      return;
+    } else if (this.data.bikeMessage.is_trouble == 1) {
+      my.alert({
+        title: '提示',
+        content: '当前车子出现故障请换辆车子骑行吧~',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+      return;
+    } else if (this.data.bikeMessage.is_riding == 1) {
+      my.alert({
+        title: '提示',
+        content: '当前车子正在骑行请换辆车子骑行吧~',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+      return;
+    }
+    that.jiance()
   },
   go_setting: util.throttle(function () {
     //点击去设置位置权限
@@ -675,14 +896,12 @@ Page({
       }
     })
   }, 1500),
-
   //点击已开启位置权限
   open: util.throttle(function () {
     this.setData({
       background: false,
       location: false
     })
-
   }, 1500),
   //寻铃
   clickBell: util.throttle(function (e) {
@@ -735,18 +954,19 @@ Page({
       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()
+        //蓝牙临时锁车
+        operateType = 'temporaryClose'
+        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+          //flag == true 操作成功
+          //flag == false 操作失败
+          //end
+        });
         my.showToast({
           content: '停车成功',
           icon: 'none'
@@ -755,7 +975,7 @@ Page({
           parkStatus: 1,
           // nowBikeStatus:1
         })
-        my.setStorageSync({'key':'nowBikeStatus',data:1})
+        my.setStorageSync({ 'key': 'nowBikeStatus', data: 1 })
         that.stopDownTime()
         // that.getBikeMessage()
       } else if (res.status == 450) {
@@ -798,15 +1018,15 @@ Page({
           icon: 'none'
         })
         clearInterval(linshiStop)
-        my.setStorageSync({'key':'stopMiao',data: 0})
-        my.setStorageSync({'key':'stopmMinute',data:30})
+        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})
+        my.setStorageSync({ 'key': 'nowBikeStatus', data: 0 })
       }
     })
 
@@ -827,12 +1047,12 @@ Page({
       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')
+        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,
+          dispatch_money: data1,
           money: res.data,
           chaButton: 1,
           parkStatus: 2
@@ -859,10 +1079,12 @@ Page({
       console.log(res)
       if (res.status == 200) {
         clearInterval(linshiStop);
-        my.setStorageSync({'key':'stopMiao',data: 0})
-        my.setStorageSync({'key':'stopmMinute',data: 30})
+        my.setStorageSync({ 'key': 'stopMiao', data: 0 })
+        my.setStorageSync({ 'key': 'stopmMinute', data: 30 })
         my.hideNavigationBarLoading(), my.hideLoading()
         that.closeLock(data)
+        //订单结束关闭蓝牙
+        bluetoothOperate.end((flag) => { });
       } else if (res.status == 450) {
         my.showToast({
           content: '运动中不能关锁,请稍后重试',
@@ -879,25 +1101,27 @@ Page({
   }, 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.setStorageSync({ 'key': 'stopMiao', data: 0 })
+        my.setStorageSync({ 'key': 'stopmMinute', data: 30 })
         my.hideLoading()
+
         my.reLaunch({
           url: '../pay/pay?order=' + res.data.no
         })
+        //蓝牙锁车操作 确定结束用车
+        operateType = 'close'
+        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+          //flag == true 操作成功
+          //flag == false 操作失败
+          //end
+        });
       } else if (res.status == 450) {
         //运动中不能锁车请5s后重试
         my.showToast({
@@ -909,20 +1133,18 @@ Page({
         my.hideLoading()
 
       }
-
     }).catch(err => {
       console.log(err)
     })
 
   },
-
   //取消锁车
   cancelEndBike: function () {
-    console.log(my.getStorageSync({'key':'nowBikeStatus'}).data)
+    console.log(my.getStorageSync({ 'key': 'nowBikeStatus' }).data)
     let that = this
     that.setData({
       chaButton: 0,
-      parkStatus: my.getStorageSync({'key':'nowBikeStatus'}).data
+      parkStatus: my.getStorageSync({ 'key': 'nowBikeStatus' }).data
     })
   },
   //计价规则
@@ -946,7 +1168,7 @@ Page({
   //客服
   keFu: function () {
     my.makePhoneCall({
-      number: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
     })
   },
   //车辆为未开锁弹框
@@ -976,16 +1198,16 @@ Page({
       url: '/pages/parking/parking',
     })
   },
-
   onUnload: function () {
+    clearInterval(locationTerval)
     // 停止位置跟踪
-    my.stopLocationUpdate({
-      success: (res) => {
-        console.log("onUnload stopLocationUpdate success", res)
-      },
-      fail: (err) => {
-        console.log("onUnload stopLocationUpdate fail", err)
-      }
-    })
+    // my.stopLocationUpdate({
+    //   success: (res) => {
+    //     console.log("onUnload stopLocationUpdate success", res)
+    //   },
+    //   fail: (err) => {
+    //     console.log("onUnload stopLocationUpdate fail", err)
+    //   }
+    // })
   }
 })

+ 3 - 0
pages/user_rules/user_rules.acss

@@ -1,5 +1,8 @@
 /* required by usingComponents */
 /* pages/user_rules/user_rules.wxss */
+page{
+  height: 100%
+}
 .use_rule{
   padding:0 30rpx;
 }

+ 86 - 86
pages/user_rules/user_rules.axml

@@ -1,87 +1,87 @@
-<!--pages/user_rules/user_rules.wxml-->
-<view class="use_rule">
-  <view class="rule-title">
-    免押金卡
-  </view>
-  <view class="title">
-    什么是免押金卡?
-  </view>
-  <view class="text">
-    免押金卡是遇见你平台推出的,在用户使用“”见你电单车服务时,用于免交押金的电子卡。
-  </view>
-  <view class="title">
-    怎样获得免押金卡?
-  </view>
-
-  <view class="text">
-    1.“”见你平台会不定期向用户赠送免押金卡,届时平台会以短信方式通知用户;
-  </view>
-  <view class="text">
-    2.用户可在“”见你小程序【获取押金资格】页面或平台推出的其他入口进行购买;
-  </view>
-  <view class="text">
-    3.平台赠送或用户购买后,可在【我的账户-我的卡】中进行查看。
-  </view>
-  <view class="title">
-    怎样使用免押金卡?
-  </view>
-  <view class="text">
-    使用“”见你电单车服务时,若用户账户内有可用的免押金卡,用户无需交纳押金亦可用车。
-  </view>
-  <view class="title">
-    免押金卡有哪些使用限制?
-  </view>
-  <view class="text">
-    1.免押金卡有有效期限制,有效期自用户购买/获得时进行起算,请您在有效期内及时使用;
-  </view>
-  <view class="text">
-    2.免押金卡有城市/区域使用限制,请您在购买前、使用时充分了解相应限制规则;
-  </view>
-  <view class="text">
-    3.鉴于商品的特殊性,非因平台原因及不可抗力事件,平台不接受用户购买免押金卡后的退卡申请。
-  </view>
-  <view class="rule-title">
-    骑行卡
-  </view>
-  <view class="title">
-    什么是骑行卡?
-  </view>
-  <view class="text">
-    骑行卡是“遇”见你平台推出的,在用户使用“遇”见你电单车服务时,可直接抵扣车费的电子卡。
-  </view>
-  <view class="title">
-    怎样获得骑行卡?
-  </view>
-  <view class="text">
-    1.“”见你平台会不定期向用户赠送骑行卡,届时平台以短信或App内信息通知等方式通知用户;
-  </view>
-  <view class="text">
-    2. 用户可在“遇”见你小程序内【“遇”见你商城】或平台推出的其它入口进行购买;
-  </view>
-
-  <view class="text">
-    3.平台赠送或用户购买后,可在【我的账户-我的卡】中进行查看。
-  </view>
-  <view class="title">
-    怎样使用骑行卡?
-  </view>
-  <view class="text">
-    使用“遇”见你电单车服务并结束defaultTitle后,若用户账户内有满足使用规则的骑行卡,用户可在车费支付时使用该骑行卡。
-  </view>
-
-  <view class="title">
-
-    骑行卡有哪些使用限制?
-  </view>
-  <view class="text">
-    1.骑行卡有有效期限制,有效期自用户购买/获得时进行起算,请您在有效期内及时使用;
-  </view>
-
-  <view class="text">
-    2.骑行卡有城市/区域使用、订单金额等限制,请您在购买前、使用时充分了解相应限制规则;
-  </view>
-  <view class="text">
-    3.鉴于商品的特殊性,非因平台原因及不可抗力事件,平台不接受用户购买骑行卡后的退卡申
-  </view>
-
+<!--pages/user_rules/user_rules.wxml-->
+<view class="use_rule">
+  <view class="rule-title">
+    免押金卡
+  </view>
+  <view class="title">
+    什么是免押金卡?
+  </view>
+  <view class="text">
+    免押金卡是遇见你平台推出的,在用户使用“”见你电单车服务时,用于免交押金的电子卡。
+  </view>
+  <view class="title">
+    怎样获得免押金卡?
+  </view>
+
+  <view class="text">
+    1.“”见你平台会不定期向用户赠送免押金卡,届时平台会以短信方式通知用户;
+  </view>
+  <view class="text">
+    2.用户可在“”见你小程序【获取押金资格】页面或平台推出的其他入口进行购买;
+  </view>
+  <view class="text">
+    3.平台赠送或用户购买后,可在【我的账户-我的卡】中进行查看。
+  </view>
+  <view class="title">
+    怎样使用免押金卡?
+  </view>
+  <view class="text">
+    使用“”见你电单车服务时,若用户账户内有可用的免押金卡,用户无需交纳押金亦可用车。
+  </view>
+  <view class="title">
+    免押金卡有哪些使用限制?
+  </view>
+  <view class="text">
+    1.免押金卡有有效期限制,有效期自用户购买/获得时进行起算,请您在有效期内及时使用;
+  </view>
+  <view class="text">
+    2.免押金卡有城市/区域使用限制,请您在购买前、使用时充分了解相应限制规则;
+  </view>
+  <view class="text">
+    3.鉴于商品的特殊性,非因平台原因及不可抗力事件,平台不接受用户购买免押金卡后的退卡申请。
+  </view>
+  <view class="rule-title">
+    骑行卡
+  </view>
+  <view class="title">
+    什么是骑行卡?
+  </view>
+  <view class="text">
+    骑行卡是“禹”见你平台推出的,在用户使用“禹”见你电单车服务时,可直接抵扣车费的电子卡。
+  </view>
+  <view class="title">
+    怎样获得骑行卡?
+  </view>
+  <view class="text">
+    1.“”见你平台会不定期向用户赠送骑行卡,届时平台以短信或App内信息通知等方式通知用户;
+  </view>
+  <view class="text">
+    2. 用户可在“禹”见你小程序内【“禹”见你商城】或平台推出的其它入口进行购买;
+  </view>
+
+  <view class="text">
+    3.平台赠送或用户购买后,可在【我的账户-我的卡】中进行查看。
+  </view>
+  <view class="title">
+    怎样使用骑行卡?
+  </view>
+  <view class="text">
+    使用“禹”见你电单车服务并结束后,若用户账户内有满足使用规则的骑行卡,用户可在车费支付时使用该骑行卡。
+  </view>
+
+  <view class="title">
+
+    骑行卡有哪些使用限制?
+  </view>
+  <view class="text">
+    1.骑行卡有有效期限制,有效期自用户购买/获得时进行起算,请您在有效期内及时使用;
+  </view>
+
+  <view class="text">
+    2.骑行卡有城市/区域使用、订单金额等限制,请您在购买前、使用时充分了解相应限制规则;
+  </view>
+  <view class="text">
+    3.鉴于商品的特殊性,非因平台原因及不可抗力事件,平台不接受用户购买骑行卡后的退卡申
+  </view>
+
 </view>

+ 1 - 0
pages/weizhang/weizhang.acss

@@ -21,6 +21,7 @@
 }
 page{
   background-color: #f2f3f5;
+  padding-top: 10rpx;
   
 }
 .trip-list{

+ 79 - 78
pages/weizhang_detail/weizhang_detail.js

@@ -1,79 +1,80 @@
-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 () {
-
-  }
+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.tradePay({
+          tradeNO: res.data.tradeNo,
+          success(resp) {
+            console.log(resp, 'zhifubao')
+            if (resp.resultCode == 9000) {
+              my.showToast({
+                content: '支付成功',
+                success: function () {
+                  my.navigateBack()
+                }
+              })
+
+            } else {
+              return
+            }
+          },
+          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 () {
+
+  }
 })

+ 109 - 103
service/bluetooth.js

@@ -7,7 +7,7 @@ let util = require('./util.js');
  * 注:电池锁等获取设备状态的功能暂只兼容了WA-206的设备
  */
 
-function BluetoothOperate(){
+function BluetoothOperate() {
   let _machineNO = null; //当前类保留的设备编号
   let _operateType = null; //操作
   let _discoveryDevicesTimer = null;
@@ -45,9 +45,9 @@ function BluetoothOperate(){
     _key = key;
     _callBack = cb;
     this.log(machineNO, _machineNO, 'operate:', _operateType); //对比两个设备编号
-    _initBluetooth(()=>{ //初始化
+    _initBluetooth(() => { //初始化
       //若存在该设备编号表面与前面的操作一致,直接使用deviceId进行连接
-      if (machineNO == _machineNO && _deviceId && _operateType) { 
+      if (machineNO == _machineNO && _deviceId && _operateType) {
         _startConnectDevices(); //进入直接连接步骤
       } else {
         _machineNO = machineNO;
@@ -129,7 +129,7 @@ function BluetoothOperate(){
       return false;
   }
 
-  this.getMachinevoltage = () =>{
+  this.getMachinevoltage = () => {
     return _machinevoltage / 1000;
   }
 
@@ -164,26 +164,26 @@ function BluetoothOperate(){
   }
 
   //开启蓝牙搜索,下一步打开监听事件
-  const _startBluetoothDevicesDiscovery = () =>{
+  const _startBluetoothDevicesDiscovery = () => {
     my.startBluetoothDevicesDiscovery({
       allowDuplicatesKey: false,
       services: ['FEF6', 'FEF5'],
       success: (res) => {
         this.log('蓝牙搜索启用成功!');
         this.log(res.errMsg);
-        if (res.isDiscovering){
+        if (res.isDiscovering) {
           _onBluetoothDeviceFound();
-        }else{
-          this.log('没有开启定位服务','isDiscovering = false');
+        } else {
+          this.log('没有开启定位服务', 'isDiscovering = false');
         }
       },
       fail: (err) => {
-        if (err.errMsg.indexOf('not init') > -1){
+        if (err.errMsg.indexOf('not init') > -1) {
           _initBluetooth(() => {
             _startBluetoothDevicesDiscovery();
           });
         } else {
-          this.end(()=>{
+          this.end(() => {
             _callBack && _callBack(false);
           });
           this.log('startBluetoothDevicesDiscovery error:', err.errMsg);
@@ -191,16 +191,16 @@ function BluetoothOperate(){
       }
     })
   }
-  
+
   //蓝牙搜索监听事件
   const _onBluetoothDeviceFound = () => {
     _repeatDiscoveryMachine();
     my.onBluetoothDeviceFound((res) => {
       let device = res.devices[0];
-      if (device && device.advertisData && device.advertisData.byteLength != 0 ){
+      if (device && device.advertisData && device.advertisData.byteLength != 0) {
         let machineNO = dataTransition.encrypt(dataTransition.ab2hex(device.advertisData).slice(4, 13));
         this.log('搜索到的设备编号:' + machineNO + ",目标:" + _machineNO);
-        if(machineNO == _machineNO){
+        if (machineNO == _machineNO) {
           _stopBluetoothDevicesDiscovery();
           clearInterval(_discoveryDevicesTimer);
           _discoveryDevicesTimer = null;
@@ -220,12 +220,12 @@ function BluetoothOperate(){
   //定时器
   const _repeatDiscoveryMachine = () => {
     let discoveryDevicesTime = 0;
-    if (_discoveryDevicesTimer){
+    if (_discoveryDevicesTimer) {
       clearInterval(_discoveryDevicesTimer);
       _discoveryDevicesTimer = null;
     }
     _discoveryDevicesTimer = setInterval(() => {
-      if (discoveryDevicesTime > 14){
+      if (discoveryDevicesTime > 14) {
         clearInterval(_discoveryDevicesTimer);
         _discoveryDevicesTimer = null;
         discoveryDevicesTime = 0;
@@ -233,30 +233,33 @@ function BluetoothOperate(){
         my.hideLoading();
 
         _stopBluetoothDevicesDiscovery();
-        my.confirm({
-          title: '温馨提示',
-          content: '搜索设备失败,请尝试重新打开定位与蓝牙,是否重新搜索?',
-          success: (res) => {
-            if (res.confirm==false) {
-              this.end(() => {
-                _callBack && _callBack(false);
-              });
-            } else { //蒙层和confirm
-              my.showToast({
-                content: '请稍候',
-                icon: 'loading',
-                mask: true,
-                duration: 1000000
-              })
-              _startBluetoothDevicesDiscovery();
-            }
-          }
-        })
-      }else{
+        this.end(() => {
+          _callBack && _callBack(false);
+        });
+        // my.confirm({
+        //   title: '温馨提示',
+        //   content: '搜索设备失败,请尝试重新打开定位与蓝牙,是否重新搜索?',
+        //   success: (res) => {
+        //     if (res.confirm==false) {
+        //       this.end(() => {
+        //         _callBack && _callBack(false);
+        //       });
+        //     } else { //蒙层和confirm
+        //       my.showToast({
+        //         content: '请稍候',
+        //         icon: 'loading',
+        //         mask: true,
+        //         duration: 1000000
+        //       })
+        //       _startBluetoothDevicesDiscovery();
+        //     }
+        //   }
+        // })
+      } else {
         discoveryDevicesTime++;
         console.log('搜索时间:', discoveryDevicesTime)
       }
-    },1000)
+    }, 1000)
   }
 
   //通过deviceId连接蓝牙设备
@@ -275,41 +278,44 @@ function BluetoothOperate(){
           this.log('createBLEConnection error:', err.errMsg);
           if (err.errCode != -1 && err.errCode != 10000) {
             if (err.errCode == 10006 || err.errCode == 10003 || err.errCode == 10012) {
-              my.confirm({
-                title: '温馨提示',
-                content: '连接失败,请尝试: (1)重新打开手机定位 (2)点击重试',
-                confirmText: '重试',
-                success: (res) => {
-                  if (res.confirm==false) {
-                    this.end(() => {
-                      _callBack && _callBack(false);
-                    });
-                  } else {
-                    this.log('正在重连...');
-                    //这里加一个
-                    my.closeBLEConnection({
-                      deviceId: _deviceId,
-                      complete: () => {
-                        my.closeBluetoothAdapter({
-                          success: () => {
-                            my.openBluetoothAdapter({
-                              success: () => {
-                                this.log('重连之前,重启蓝牙适配器成功!')
-                                if(_reConnect >= 2){
-                                  _startBluetoothDevicesDiscovery();
-                                } else {
-                                  _reConnect++;
-                                  _startConnectDevices();
-                                }
-                              }
-                            })
-                          }
-                        });
-                      },
-                    })
-                  }
-                }
-              })
+              this.end(() => {
+                _callBack && _callBack(false);
+              });
+              // my.confirm({
+              //   title: '温馨提示',
+              //   content: '连接失败,请尝试: (1)重新打开手机定位 (2)点击重试',
+              //   confirmText: '重试',
+              //   success: (res) => {
+              //     if (res.confirm == false) {
+              //       this.end(() => {
+              //         _callBack && _callBack(false);
+              //       });
+              //     } else {
+              //       this.log('正在重连...');
+              //       //这里加一个
+              //       my.closeBLEConnection({
+              //         deviceId: _deviceId,
+              //         complete: () => {
+              //           my.closeBluetoothAdapter({
+              //             success: () => {
+              //               my.openBluetoothAdapter({
+              //                 success: () => {
+              //                   this.log('重连之前,重启蓝牙适配器成功!')
+              //                   if (_reConnect >= 2) {
+              //                     _startBluetoothDevicesDiscovery();
+              //                   } else {
+              //                     _reConnect++;
+              //                     _startConnectDevices();
+              //                   }
+              //                 }
+              //               })
+              //             }
+              //           });
+              //         },
+              //       })
+              //     }
+              //   }
+              // })
             }
           } else if (err.errMsg.indexOf('not init') > -1) { //入口之一,判断无初始化直接执行
             _initBluetooth(() => {
@@ -364,11 +370,11 @@ function BluetoothOperate(){
           success: (res) => {
             this.log('特征值:', res.errMsg);
             res.characteristics.forEach((item) => {
-              if(item.properties.write)
+              if (item.properties.write)
                 _characteristicId_write = item.uuid;
-              if(!item.properties.write && item.properties.notify)
+              if (!item.properties.write && item.properties.notify)
                 _characteristicId_notify = item.uuid;
-              
+
             })
             this.log('特征值读:', _characteristicId_notify, '特征值写:', _characteristicId_write);
 
@@ -425,7 +431,7 @@ function BluetoothOperate(){
   }
 
   //发送信息
-  const _writeBLECharacteristicValue = (value,cb) => {
+  const _writeBLECharacteristicValue = (value, cb) => {
     setTimeout(() => {
       my.writeBLECharacteristicValue({
         deviceId: _deviceId,
@@ -464,7 +470,7 @@ function BluetoothOperate(){
       serviceId: _serviceId,
       characteristicId: _characteristicId_notify,
       success: () => {
-        if (_listenerTime != -1){ //超时安全判断
+        if (_listenerTime != -1) { //超时安全判断
           _listenerTimer = setTimeout(() => {
             if (_listenerTime == 0) {
               this.log('未接收到回复信息!自动重发一次!');
@@ -477,7 +483,7 @@ function BluetoothOperate(){
                 content: '未接收到回复信息!',
                 confirmText: '重试',
                 success: (res) => {
-                  if (res.confirm==true) {
+                  if (res.confirm == true) {
                     my.showToast({
                       content: '请稍后',
                       icon: 'loading',
@@ -501,7 +507,7 @@ function BluetoothOperate(){
           _listenerTime = -1;
           let data = dataTransition.ab2hex(res.value)
           this.log('********notify收到的数据:', data);
-          if(data.slice(0,4) == 'aa10'){
+          if (data.slice(0, 4) == 'aa10') {
             this.log('指令发送成功:');
           } else if (data.slice(0, 4) == 'aa30') {
             this.log('CRC校验失败');
@@ -510,9 +516,9 @@ function BluetoothOperate(){
               _callBack && _callBack(false);
             });
             //end
-          } else if (data.slice(0, 3) == 'aa0' && _dataLen == 0){
+          } else if (data.slice(0, 3) == 'aa0' && _dataLen == 0) {
             //设备版本号
-            _machineVerson = data.slice(2,4); 
+            _machineVerson = data.slice(2, 4);
             //16进制流水号
             _sequenceId_16 = data.slice(6, 8); //0a
             //计算数据包长度
@@ -548,18 +554,18 @@ function BluetoothOperate(){
   //解析存储车辆状态
   const _analysisSystem = (systemState) => {
     //16进制转换为10进制
-    let decimalState = parseInt(systemState,16);
+    let decimalState = parseInt(systemState, 16);
     //10进制转换为2进制
     let binaryState = parseInt(decimalState).toString(2);
 
-    if (binaryState.length < 8){
+    if (binaryState.length < 8) {
       let supplyNum = 8 - binaryState.length;
-      while(supplyNum > 0){
+      while (supplyNum > 0) {
         binaryState = '0' + binaryState;
         supplyNum--;
       }
     }
-    
+
     //字符串拆分成为数组
     let stateArray = Array.prototype.slice.call(binaryState);
 
@@ -569,9 +575,9 @@ function BluetoothOperate(){
 
   //拼接数据,判断数据并发送
   const _connectData = (data) => {
-    this.log('拼接内容:',data);
+    this.log('拼接内容:', data);
     _dataContent += data;
-    this.log('内容长度', _dataContent.length,'接收到的数据长度', _dataLen,'*2');
+    this.log('内容长度', _dataContent.length, '接收到的数据长度', _dataLen, '*2');
     if (_dataContent.length == _dataLen * 2) { //接收完该长度的字节和校验CRC成功之后再发送ACK
       let dc = _dataContent;
       let dcArr = [];
@@ -583,7 +589,7 @@ function BluetoothOperate(){
         let value = dataTransition.hexStringToArrayBuffer(`aa12${_systemState}${_sequenceId_16}00000000`);
         this.log(`返回的确认数据${dataTransition.ab2hex(value)}`);
         //分析数据返回的内容 
-        _analysisBLEContent(dc,value);
+        _analysisBLEContent(dc, value);
       } else {
         this.log('CRC16校验失败', dataTransition.getCRC16(contentArr) + "_应为:" + _CRC16);
         util.showModal_nocancel('CRC16校验失败,请重试。');
@@ -603,7 +609,7 @@ function BluetoothOperate(){
 
   //解析蓝牙发送内容
   const _analysisBLEContent = (content, reply) => {
-    
+
     this.log('解析数据数据***************', content);
     if (content.indexOf('020101') > -1) {
       if (!_connected) {
@@ -637,12 +643,12 @@ function BluetoothOperate(){
         _hasReceive = true;
         _writeBLECharacteristicValue(reply, () => {
           this.log('上锁成功,开始回调ctrl_cb');
-          this.end(()=>{
+          this.end(() => {
             _callBack && _callBack(true);
           });
         });
       }
-    } else if(content.indexOf('0300840100') > -1){
+    } else if (content.indexOf('0300840100') > -1) {
       //响铃成功
       if (_sendCommandTimer) { //每次都将清楚等待任务
         clearTimeout(_sendCommandTimer);
@@ -657,7 +663,7 @@ function BluetoothOperate(){
           });
         });
       }
-    } else if(content.indexOf('0300870100') > -1){
+    } else if (content.indexOf('0300870100') > -1) {
       //临时关锁成功
       if (_sendCommandTimer) { //每次都将清楚等待任务
         clearTimeout(_sendCommandTimer);
@@ -672,7 +678,7 @@ function BluetoothOperate(){
           });
         });
       }
-    } else if(content.indexOf('0300850100') > -1){
+    } else if (content.indexOf('0300850100') > -1) {
       //开电池锁成功
       if (_sendCommandTimer) { //每次都将清楚等待任务
         clearTimeout(_sendCommandTimer);
@@ -698,7 +704,7 @@ function BluetoothOperate(){
       }
       this.log('鉴权失败:', _sendData);
       util.showModal_nocancel('鉴权失败!')
-      this.end(()=>{
+      this.end(() => {
         _callBack && _callBack(false);
       });
       //end
@@ -723,14 +729,14 @@ function BluetoothOperate(){
 
   const _analysisVoltage = (content) => {
     //判断81 :终端电池电压
-    if (content.indexOf('02010181') > -1){
+    if (content.indexOf('02010181') > -1) {
       //这之后两位表示电池电压:81,两位表示长度:02,加上020101共十位
-      let startN = content.indexOf('020101') + 10; 
+      let startN = content.indexOf('020101') + 10;
       //后四位表示电压值:16进制
       let voltageData = content.slice(startN, startN + 4);
 
-      let voltage = parseInt(voltageData,16);
-      if(_machineVerson == '02')
+      let voltage = parseInt(voltageData, 16);
+      if (_machineVerson == '02')
         _machinevoltage = voltage * 10;
       else
         _machinevoltage = voltage;
@@ -761,12 +767,12 @@ function BluetoothOperate(){
     this.log(`发送${type}指令`, data);
     _sendCtrl(data);
 
-    _sendCommandTimer = setTimeout(()=>{ //可能出现发送消息后没有收到应答,将再次发送
+    _sendCommandTimer = setTimeout(() => { //可能出现发送消息后没有收到应答,将再次发送
       if (_sendCommandTime == 0) {
         this.log('设备未响应,自动重发')
         _sendCommandTime++;
         _ctrl(_operateType);
-      }else{
+      } else {
         this.log('设备未响应')
         my.hideLoading();
         util.showModal('设备未响应,是否重新发送指令?', () => {
@@ -775,13 +781,13 @@ function BluetoothOperate(){
             content: '开锁中',
           })
           _ctrl(_operateType);
-        },() => {
-          this.end(()=>{
+        }, () => {
+          this.end(() => {
             _callBack && _callBack(false);
           });
         })
       }
-    },5000)
+    }, 5000)
   }
 
   const _stopBluetoothDevicesDiscovery = () => {
@@ -826,7 +832,7 @@ function BluetoothOperate(){
   this.log = (...str) => {
     let now = new Date();
     now = util.formatTime(now)
-    console.log(now , ...str);
+    console.log(now, ...str);
     _logList.push(str.join(','))
   }
 }

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