xvying пре 2 година
родитељ
комит
a1c652981d
100 измењених фајлова са 13606 додато и 13281 уклоњено
  1. BIN
      .DS_Store
  2. 3 3
      .mini-ide/compileMode.json
  3. 0 120
      app.acss
  4. 298 295
      app.js
  5. 51 53
      app.json
  6. 1 1
      components/foottip/foottip.acss
  7. 38 38
      components/foottip/foottip.js
  8. BIN
      img/binride.png
  9. BIN
      img/dui.png
  10. 46 46
      pages/account_details/account_details.acss
  11. 49 27
      pages/agreement/agreement.acss
  12. 151 23
      pages/agreement/agreement.axml
  13. 4 1
      pages/agreement/agreement.js
  14. 94 59
      pages/authorization/authorization.acss
  15. 19 13
      pages/authorization/authorization.axml
  16. 167 160
      pages/authorization/authorization.js
  17. 4 4
      pages/authorization/authorization.json
  18. 183 183
      pages/balance/balance.acss
  19. 55 55
      pages/balance/balance.axml
  20. 219 219
      pages/balance/balance.js
  21. 4 4
      pages/balance/balance.json
  22. 243 243
      pages/breakdown/breakdown.acss
  23. 51 51
      pages/breakdown/breakdown.axml
  24. 323 323
      pages/breakdown/breakdown.js
  25. 535 535
      pages/buy-card/buy-card.acss
  26. 6 9
      pages/buy-card/buy-card.axml
  27. 175 173
      pages/buy-card/buy-card.js
  28. 83 83
      pages/change_mobile/change_mobile.acss
  29. 15 15
      pages/change_mobile/change_mobile.axml
  30. 208 208
      pages/change_mobile/change_mobile.js
  31. 56 56
      pages/charge_rule/charge_rule.acss
  32. 46 46
      pages/charge_rule/charge_rule.axml
  33. 37 37
      pages/charge_rule/charge_rule.js
  34. 125 125
      pages/coupon/coupon.acss
  35. 93 93
      pages/coupon/coupon.js
  36. 23 23
      pages/depoSuce/depoSuce.acss
  37. 375 375
      pages/index/index.acss
  38. 116 114
      pages/index/index.axml
  39. 1067 1061
      pages/index/index.js
  40. 2 2
      pages/index/index.json
  41. 81 81
      pages/inputcode/inputcode.acss
  42. 11 11
      pages/inputcode/inputcode.axml
  43. 133 133
      pages/inputcode/inputcode.js
  44. 9 9
      pages/logs/logs.acss
  45. 155 155
      pages/mine/mine.acss
  46. 69 69
      pages/mine/mine.axml
  47. 190 190
      pages/mine/mine.js
  48. 58 58
      pages/mine_card/mine_card.acss
  49. 52 52
      pages/mine_card/mine_card.js
  50. 26 26
      pages/mine_data/mine_data.acss
  51. 14 14
      pages/mine_data/mine_data.axml
  52. 40 40
      pages/my_account/my_account.acss
  53. 45 45
      pages/my_account/my_account.js
  54. 196 196
      pages/parking/parking.acss
  55. 51 51
      pages/parking/parking.axml
  56. 287 287
      pages/parking/parking.js
  57. 4 4
      pages/parking/parking.json
  58. 522 522
      pages/pay/pay.acss
  59. 126 126
      pages/pay/pay.axml
  60. 553 553
      pages/pay/pay.js
  61. 6 6
      pages/pay/pay.json
  62. 119 119
      pages/pay_success/pay_success.acss
  63. 54 54
      pages/phone_verif/phone_verif.acss
  64. 50 50
      pages/phonelogin/phonelogin.acss
  65. 10 10
      pages/phonelogin/phonelogin.axml
  66. 72 72
      pages/phonelogin/phonelogin.js
  67. 186 186
      pages/real_name/real_name.acss
  68. 51 51
      pages/real_name/real_name.axml
  69. 155 155
      pages/recharge-active/recharge-active.acss
  70. 38 38
      pages/recharge-active/recharge-active.axml
  71. 219 219
      pages/recharge-active/recharge-active.js
  72. 4 4
      pages/recharge-active/recharge-active.json
  73. 37 37
      pages/refund_success/refund_success.acss
  74. 64 64
      pages/ride_rule/ride_rule.acss
  75. 184 184
      pages/ride_zige/ride_zige.acss
  76. 51 51
      pages/ride_zige/ride_zige.axml
  77. 204 204
      pages/ride_zige/ride_zige.js
  78. 43 43
      pages/set_up/set_up.acss
  79. 55 55
      pages/set_up/set_up.js
  80. 76 76
      pages/test/test.acss
  81. 50 50
      pages/test/test.axml
  82. 10 10
      pages/test/test.js
  83. 107 107
      pages/trip/trip.acss
  84. 36 36
      pages/trip/trip.axml
  85. 113 113
      pages/trip/trip.js
  86. 76 76
      pages/trip_detail/trip_detail.acss
  87. 50 50
      pages/trip_detail/trip_detail.axml
  88. 157 157
      pages/trip_detail/trip_detail.js
  89. 634 539
      pages/use_bike/use_bike.acss
  90. 234 203
      pages/use_bike/use_bike.axml
  91. 1495 1385
      pages/use_bike/use_bike.js
  92. 3 3
      pages/use_bike/use_bike.json
  93. 24 24
      pages/user_rules/user_rules.acss
  94. 86 86
      pages/user_rules/user_rules.axml
  95. 115 115
      pages/weizhang/weizhang.acss
  96. 83 83
      pages/weizhang/weizhang.js
  97. 77 77
      pages/weizhang_detail/weizhang_detail.acss
  98. 79 79
      pages/weizhang_detail/weizhang_detail.js
  99. 73 73
      project.config.json
  100. 839 839
      service/bluetooth.js

+ 3 - 3
.mini-ide/compileMode.json

@@ -1,10 +1,10 @@
 {
-  "current": null,
   "modes": [
     {
       "title": "二维码编译",
       "page": "pages/use_bike/use_bike",
-      "query": "qrCode=https%3A%2F%2Fcode.mtu.ximengnaikang.com%3Fp%3D1%26no%3D410100100"
+      "query": "qrCode=https%3A%2F%2Fcode.mtu.ximengnaikang.com%3Fp%3D1%26no%3D411311155"
     }
-  ]
+  ],
+  "current": null
 }

Разлика између датотеке није приказан због своје велике величине
+ 0 - 120
app.acss


+ 298 - 295
app.js

@@ -1,295 +1,298 @@
-App({
-  onLaunch: function (options) {
-    if (options.query) {
-      console.log('扫码加载')
-      var code1 = decodeURIComponent(options.query.qrCode)
-      var index = code1.lastIndexOf("\=");
-      let code = code1.substring(index + 1, code1.length);
-      this.globalData.scanCode = code
-      console.log(code, 'ceode-------------------------------------')
-    }
-
-
-    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: '当前支付宝版本过低,无法使用该功能,请升级到最新支付宝版本后重试。'
-      })
-    }
-    console.log(my.getStorageSync({ 'key': 'token' }).data, 'XXXXXXXXXXXXXXXXXXXXX')
-
-  },
-  globalData: {
-    statusBarHeight: my.getSystemInfoSync()['statusBarHeight'],
-    windowHeight: my.getSystemInfoSync()['windowHeight'],
-    imgUrl: 'http://resource.bike.hanyiyun.com/',
-    screenHeight: '',
-    login: false,
-    scanCode: '',//扫描普通二维码跳转小程序解析出的车牌号码
-    platform: '',
-    version: '',
-    req: true,
-    id: 0,
-    times: 60,
-    invalid: false,
-    scanLength: 9,//车辆编码数
-    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) => {
-          // console.log(res)
-          if (res.status == 450) {
-            return;
-          }
-          if (res.status != 200) {
-            let data = {
-              response: res,
-              'url': api,
-              'data': params,
-              'merchant-id': this.globalData.merchant_id,
-              'authorization':my.getStorageSync({ 'key': 'token' }).data,
-              type: 'success',
-              user: my.getStorageSync({ 'key': 'userInfo' }).data ? my.getStorageSync({ 'key': 'userInfo' }).data.user : '',
-              version: '1.2.2'
-            }
-            my.request({
-              url: this.globalData.url + '/logs', //仅为示例,并非真实的接口地址
-              data: { data: data },
-              method: 'POST',
-              header: {
-                'content-type': 'application/json', // 默认值
-                'merchant-id': this.globalData.merchant_id
-              },
-              success(res) {
-                console.log(res.data)
-              }
-            })
-          }
-          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
-              })
-            }
-          }
-
-          console.log(res, 'token-------------------------------------------')
-          resolve(res)
-        },
-        fail: (err) => {
-
-          if (err.status == 401) {
-            var timeout;
-            console.log('token过期')
-
-            my.removeStorageSync({ key: 'token' })
-            my.removeStorageSync({ key: 'token_time' })
-            // this.token()
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          } 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,
-            });
-          }
-          console.log(err, 'qingqiushibai')
-          let data = {
-            response: res,
-            'url': api,
-            'data': params,
-            'merchant-id': this.globalData.merchant_id,
-            'authorization': my.getStorageSync({'key':'token'}).data,
-            type: 'success',
-            user: my.getStorageSync({ 'key': 'userInfo' }).data ? my.getStorageSync({ 'key': 'userInfo' }).data.user : '',
-            version: '1.2.2'
-          }
-          my.request({
-            url: this.globalData.url + '/logs', //仅为示例,并非真实的接口地址
-            data: { data: data },
-            method: 'POST',
-            header: {
-              'content-type': 'application/json', // 默认值
-              'merchant-id': this.globalData.merchant_id
-            },
-            success(res) {
-              console.log(res.data)
-            }
-          })
-          reject(err, "请求失败")
-        },
-        complete: () => {
-          that.globalData.req = true
-        }
-      })
-    })
-  },
-
-  login() {
-    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 || 0;
-    let cha = data - tokenTime
-    let data1 = 60 * 60 * 4
-    return new Promise((resolve, reject) => {
-      if (token && cha < data1) {
-        console.log(Math.round(new Date() / 1000), 'test--------')
-        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,
-                '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: res.data.message,
-                      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.alert({
-                    title: '提示',
-                    content: '可能网络不太好,请重试!',
-                    success: () => {
-                      my.reLaunch({
-                        url: '/pages/error/error?error=0'
-                      });
-                    }
-                  })
-                 
-                }
-              })
-            } else {
-              my.showToast({
-                content: res.errMsg,
-                icon: none,
-              })
-            }
-          }
-        })
-      }
-    })
-  },
-})
+App({
+  onLaunch: function (options) {
+    if (options.query) {
+      console.log('扫码加载')
+      var code1 = decodeURIComponent(options.query.qrCode)
+      var index = code1.lastIndexOf("\=");
+      let code = code1.substring(index + 1, code1.length);
+      this.globalData.scanCode = code
+      console.log(code, 'ceode-------------------------------------')
+    }
+
+
+    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: '当前支付宝版本过低,无法使用该功能,请升级到最新支付宝版本后重试。'
+      })
+    }
+    console.log(my.getStorageSync({ 'key': 'token' }).data, 'XXXXXXXXXXXXXXXXXXXXX')
+
+  },
+  globalData: {
+    statusBarHeight: my.getSystemInfoSync()['statusBarHeight'],
+    windowHeight: my.getSystemInfoSync()['windowHeight'],
+    imgUrl: 'http://resource.bike.hanyiyun.com/',
+    screenHeight: '',
+    login: false,
+    scanCode: '',//扫描普通二维码跳转小程序解析出的车牌号码
+    platform: '',
+    version: '',
+    req: true,
+    id: 0,
+    times: 60,
+    invalid: false,
+     title: '禹见你', //全局修改此小程序名称
+    company:'禹州市途娱科技有限公司',
+    company_1:'途娱科技',
+    scanLength: 9,//车辆编码数
+    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) => {
+          // console.log(res)
+          if (res.status == 450) {
+            return;
+          }
+          if (res.status != 200) {
+            let data = {
+              response: res,
+              'url': api,
+              'data': params,
+              'merchant-id': this.globalData.merchant_id,
+              'authorization':my.getStorageSync({ 'key': 'token' }).data,
+              type: 'success',
+              user: my.getStorageSync({ 'key': 'userInfo' }).data ? my.getStorageSync({ 'key': 'userInfo' }).data.user : '',
+              version: '1.2.2'
+            }
+            my.request({
+              url: this.globalData.url + '/logs', //仅为示例,并非真实的接口地址
+              data: { data: data },
+              method: 'POST',
+              header: {
+                'content-type': 'application/json', // 默认值
+                'merchant-id': this.globalData.merchant_id
+              },
+              success(res) {
+                console.log(res.data)
+              }
+            })
+          }
+          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
+              })
+            }
+          }
+
+          console.log(res, 'token-------------------------------------------')
+          resolve(res)
+        },
+        fail: (err) => {
+
+          if (err.status == 401) {
+            var timeout;
+            console.log('token过期')
+
+            my.removeStorageSync({ key: 'token' })
+            my.removeStorageSync({ key: 'token_time' })
+            // this.token()
+            my.reLaunch({
+              url: '/pages/index/index',
+            })
+          } 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,
+            });
+          }
+          console.log(err, 'qingqiushibai')
+          let data = {
+            response: res,
+            'url': api,
+            'data': params,
+            'merchant-id': this.globalData.merchant_id,
+            'authorization': my.getStorageSync({'key':'token'}).data,
+            type: 'success',
+            user: my.getStorageSync({ 'key': 'userInfo' }).data ? my.getStorageSync({ 'key': 'userInfo' }).data.user : '',
+            version: '1.2.2'
+          }
+          my.request({
+            url: this.globalData.url + '/logs', //仅为示例,并非真实的接口地址
+            data: { data: data },
+            method: 'POST',
+            header: {
+              'content-type': 'application/json', // 默认值
+              'merchant-id': this.globalData.merchant_id
+            },
+            success(res) {
+              console.log(res.data)
+            }
+          })
+          reject(err, "请求失败")
+        },
+        complete: () => {
+          that.globalData.req = true
+        }
+      })
+    })
+  },
+
+  login() {
+    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 || 0;
+    let cha = data - tokenTime
+    let data1 = 60 * 60 * 4
+    return new Promise((resolve, reject) => {
+      if (token && cha < data1) {
+        console.log(Math.round(new Date() / 1000), 'test--------')
+        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,
+                '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: res.data.message,
+                      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.alert({
+                    title: '提示',
+                    content: '可能网络不太好,请重试!',
+                    success: () => {
+                      my.reLaunch({
+                        url: '/pages/error/error?error=0'
+                      });
+                    }
+                  })
+                 
+                }
+              })
+            } else {
+              my.showToast({
+                content: res.errMsg,
+                icon: none,
+              })
+            }
+          }
+        })
+      }
+    })
+  },
+})

+ 51 - 53
app.json

@@ -1,54 +1,52 @@
-{
-  "pages": [
-    "pages/index/index",
-    "pages/test/test",
-    "pages/recharge-active/recharge-active",
-    "pages/pay/pay",
-    "pages/inputcode/inputcode",
-    "pages/use_bike/use_bike",
-    "pages/authorization/authorization",
-    "pages/buy-card/buy-card",
-    "pages/pay_success/pay_success",
-    "pages/depoSuce/depoSuce",
-    "pages/charge_rule/charge_rule",
-    "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": "你的位置信息将用于小程序位置接口的效果展示"
-    }
-  }
+{
+  "pages": [
+    "pages/index/index",
+    "pages/test/test",
+    "pages/recharge-active/recharge-active",
+    "pages/pay/pay",
+    "pages/inputcode/inputcode",
+    "pages/use_bike/use_bike",
+    "pages/authorization/authorization",
+    "pages/buy-card/buy-card",
+    "pages/pay_success/pay_success",
+    "pages/depoSuce/depoSuce",
+    "pages/charge_rule/charge_rule",
+    "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": {
+    "titleBarColor": "#fff",
+    "defaultTitle": "禹见你",
+    "allowsBounceVertical": "YES"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "permission": {
+    "scope.userLocation": {
+      "desc": "你的位置信息将用于小程序位置接口的效果展示"
+    }
+  }
 }

+ 1 - 1
components/foottip/foottip.acss

@@ -1 +1 @@
-/* required by usingComponents */
+/* required by usingComponents */

+ 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',
+    })
+  }
 })



+ 46 - 46
pages/account_details/account_details.acss

@@ -1,47 +1,47 @@
-/* pages/account_details/account_details.wxss */
-page {
-  background-color: #f2f3f5;
-}
-.account-detail{
-  margin: 20rpx;
-}
-.title{
-  height: 70rpx;
-  font-size: 28rpx;
-  color: #999999;
-  line-height: 70rpx;
-}
-.list-card{
-padding: 30rpx;
-border-radius: 12rpx;
-background-color: #ffff;
-}
-.card-title{
-  font-size: 28rpx;
-  font-weight: 500;
-}
-.money{
-  float: right;
-  font-size: 34rpx;
-}
-.from{
-  margin-top: 20rpx;
-  color: #999999;
-  font-size: 24rpx;
-}
-.more{
-  text-align: center;
-  font-size: 26rpx;
-  color: #999999;
-  height: 100rpx;
-  line-height:100rpx;
-  margin-top: 30rpx;
-  }
-.none{
-  text-align: center;
-  padding-top: 40%;
-  }
-  .none image{
-    height: 100rpx;
-    width: 100rpx;
+/* pages/account_details/account_details.wxss */
+page {
+  background-color: #f2f3f5;
+}
+.account-detail{
+  margin: 20rpx;
+}
+.title{
+  height: 70rpx;
+  font-size: 28rpx;
+  color: #999999;
+  line-height: 70rpx;
+}
+.list-card{
+padding: 30rpx;
+border-radius: 12rpx;
+background-color: #ffff;
+}
+.card-title{
+  font-size: 28rpx;
+  font-weight: 500;
+}
+.money{
+  float: right;
+  font-size: 34rpx;
+}
+.from{
+  margin-top: 20rpx;
+  color: #999999;
+  font-size: 24rpx;
+}
+.more{
+  text-align: center;
+  font-size: 26rpx;
+  color: #999999;
+  height: 100rpx;
+  line-height:100rpx;
+  margin-top: 30rpx;
+  }
+.none{
+  text-align: center;
+  padding-top: 40%;
+  }
+  .none image{
+    height: 100rpx;
+    width: 100rpx;
   }

+ 49 - 27
pages/agreement/agreement.acss

@@ -1,28 +1,50 @@
-/* required by usingComponents */
-/* pages/agreement/agreement.wxss */
-.priCon{
-  width:93%;
-  margin:0 auto;
-}
-.priTitle{
-  font-size:32rpx;
-  color:#2a2a2a;
-  margin:34rpx 0 19rpx;
-}
-.line{
-  width:100rpx;
-  height:4rpx;
-  background:#2a2a2a;
-}
-.passage{
-  font-size:24rpx;
-  text-align: justify;
-  color:#2a2a2a;
-}
-.passage view{
-  line-height:1.5;
-  margin-top:10rpx;
-}
-.passage>view:first-child{
-  margin:21rpx 0 44rpx;
+/* pages/agreement/agreement.wxss */
+.priCon{
+  width:93%;
+  margin:0 auto;
+}
+.priTitle{
+  font-size:32rpx;
+  text-align: center;
+  color: #000;
+  font-weight: 550;
+  font-size: 32rpx;
+  margin-bottom: 20rpx;
+}
+.title{
+font-weight: 550;
+font-size: 28rpx;
+margin-bottom: 20rpx;
+color: #000;
+}
+.title_1{
+  font-weight: 550;
+  font-size: 28rpx;
+  margin-bottom: 20rpx;
+  color: #000;
+  display: inline;
+  text-decoration:underline;
+}
+.footer{
+  text-align: right;
+  font-weight: 550;
+  font-size: 32rpx;
+  color: #000;
+}
+.line{
+  width:100rpx;
+  height:4rpx;
+  background:#2a2a2a;
+}
+.passage{
+  font-size:24rpx;
+  text-align: justify;
+  color:#2a2a2a;
+}
+.passage view{
+  line-height:1.8;
+  margin-bottom:20rpx;
+}
+.passage>view:first-child{
+  margin:21rpx 0 44rpx;
 }

+ 151 - 23
pages/agreement/agreement.axml

@@ -1,24 +1,152 @@
-<!--隐私条款-->
-<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 class="privacy">
+  <view class="priCon">
+    <view class="priTitle">{{title}}电单车用户使用协议</view>
+
+    <view class="passage">
+      <view>欢迎您与{{company}}(简称“{{company_1}}”或“本公司”)共同签署本《{{title}}电单车用户使用协议》(下称“本协议”),本协议是关于您注册并使用{{title}}电单车平台(包括但不限于通过PC端或移动智能终端等版本)以及您通过{{title}}电单车平台获得相关信息、建议及/或服务等相关事宜所订立的协议。</view>
+      <view class="title">
+        1、提示条款
+      </view>
+      <view>1.1 您在申请注册流程中点击同意本协议之前,应当认真阅读本协议。请您务必审慎阅读、充分理解各条款内容,特别是免除或者限制责任的条款、法律适用和争议解决条款。<view class="title_1"> 免除或者限制责任的条款将以粗体或下划线标识,您应重点阅读。</view>如您对协议有任何疑问,可向{{title}}电单车平台客服咨询。</view>
+      <view>1.2 当您按照注册页面提示填写信息、阅读并同意本协议且完成全部注册程序后,即表示您已充分阅读、理解并接受本协议的全部内容,并与{{company_1}}达成一致,成为{{title}}电单车平台的用户。<view class="title_1">阅读本协议的过程中,如果您不同意本协议或其中任何条款约定,您应立即停止注册程序。</view>
+      </view>
+      <view class="title">
+        2、服务内容
+      </view>
+      <view>2.1 {{title}}电单车平台是{{company}}拥有合法权益的,为使用{{title}}电单车平台进行电动自行车出租的电动自行车所有权人和用户提供相关信息技术服务的网络平台。</view>
+
+      <view>2.2 {{title}}电单车平台授权电动自行车所有权人使用“{{title}}电单车”商标、标识,{{title}}电单车平台即不是电动自行车的所有权人也不是出租人。
+      </view>
+
+      <view class="title_1">2.3 为避免误解,特澄清如下:{{title}}电单车平台提供的并不是电动自行车租赁服务,而是为您和电动自行车出租人之间提供信息及技术支持,协助您与电动自行车出租人之间达成租车服务协议的网络信息技术平台。{{title}}电单车平台不对租车服务过程中产生的纠纷或争议承担责任,也不对任何一方使用租车服务过程中可能遭受的损失承担责任,双方应自行解决相关事宜。</view>
+
+      <view>2.4 对于您使用电动自行车出租人提供的服务所支付的费用,将由出租人向您提供相应的发票。</view>
+      <view class="title">
+        3、用户注册、认证及会员服务
+      </view>
+      <view>3.1 用户资格</view>
+      <view>您需确认,在您开始用户认证程序从而具备使用{{title}}电单车共享平台服务的资格前,您应具备中华人民共和国法律规定的与您行为相适应的民事行为能力 <view class="title_1">(特别提示,用户应为符合骑行电动自行车上路的年龄(16周岁以上)及身体条件健康的人士。用户如未满16周岁或患有包括但不限于影响骑行的如癫痫、心脏病、高血压、暂时性眩晕、视力障碍、听觉障碍、残疾等各种疾病的,不得使用本服务。)若您不具备前述与您行为相适应的民事行为能力,则您及您的监护人应依照法律规定承担因此而导致的一切后果。</view>
+      </view>
+      <view>3.2 账户说明</view>
+      <view>您作为访客通过手机验证等程序注册{{title}}电单车平台后,您即为{{title}}电单车平台的用户并拥有自己的账户。但是仅在完成了用户认证程序成为{{title}}电单车平台的认证用户后,您方可使用{{title}}电单车服务。当您按照用户认证程序提示填写信息、阅读并同意本协议且完成全部认证程序后,您可获得{{title}}电单车平台认证用户账户。<view class="title_1">由于认证用户的账户关联认证用户的信用信息,您不得转让该账户,也不得许可或协助他人通过您的认证用户账户使用租车服务,否则由此产生的一切责任均由您承担连带责任。</view>
+      </view>
+      <view>3.3 认证信息管理</view>
+      <view>在用户认证过程中,您应按{{title}}电单车平台页面的提示,准确、真实、完整地提供您的信息(包括您的真实姓名、您个人的身份证号等),且有义务保持您提供信息的真实性及有效性。如果您的认证信息有所变更,您应当及时更新您提供的信息,本公司将依法不时地对您的信息进行检查核实,您应当配合提供最及时、真实、完整的信息。如本公司按您最后一次提供的信息与您联系未果、您未按本公司的要求及时提供信息、您提供的信息存在明显不实的,您将承担因此对您自身、他人及本公司造成的全部损失与不利后果。 上述用户认证的审核和通过均由本公司最终决定。本公司可以根据用户上传的文件对其文件的真实性、合法性进行合理的质询和怀疑,并给与用户不通过认证的结果而无需提供任何原因。</view>
+      <view>3.4会员服务</view>
+      <view>购买会员卡即可成为{{title}}电单车会员,享受免押金租车服务。会员有权利选择不继续接受{{title}}电单车的会员服务,会员可申请取消会员服务,但此取消行为将无法获得已交纳的会员服务费的退还或其他任何形式的任何补偿/赔偿。</view>
+      <view class="title">4、账户安全规范</view>
+      <view>4.1 您的账户由您自行设置并由您保管,本公司任何时候均不会主动要求您提供您的账户信息。因此,请务必保管好您的账户,账户安全由您自行负责,请确保您在每个上网时段结束时退出登录并以正确步骤离开{{title}}电单车平台。如果您的账户因您主动泄露或遭受他人攻击、诈骗等行为而造成的任何损失及后果,该等损失和后果均由您自行承担。</view>
+      <view>4.2 除本公司存在过错外,您应对您账户项下的所有行为和结果(包括但不限于租赁电动自行车、退还电动自行车、发布信息、披露信息、开放通讯录等)负责,无论该等行为和结果是否对您自身或第三方造成任何损害。</view>
+      <view class="title_1">4.3 如发现任何未经授权使用您账户登录{{title}}电单车平台或其他可能导致您账户遭窃、遗失的情况,建议您立即通知{{title}}电单车平台。您应理解本公司对您的任何请求采取行动均需要合理时间,除本公司存在过错外,本公司对在采取行动前已经产生的后果不承担任何责任。</view>
+
+      <view class="title">5、{{title}}电单车平台服务及规范</view>
+      <view>5.1 经认证的用户可通过{{title}}电单车平台使用租车服务并应确保您不会利用{{title}}电单车平台进行任何违法行为或下述行为:</view>
+      <view>(a) 利用技术手段故意访问、记录、盗取、传播{{title}}电单车平台的数据和相关信息;</view>
+      <view>(a) 利用技术手段故意访问、记录、盗取、传播{{title}}电单车平台的数据和相关信息;</view>
+      <view>(c) 干扰或破坏{{title}}电单车平台、其服务器或其网络;</view>
+      <view>(d) 未经合法授权而截取、篡改、收集、储存、使用、传播或删除其他用户的个人信息或提供的其他信息;</view>
+      <view>(e) 其他未经合法授权的行为。</view>
+      <view>5.2 您应确保您在{{title}}电单车平台上所发布和传播的内容不得包含下述信息:</view>
+      <view>(a) 违反宪法确定的基本原则的;</view>
+      <view>(b) 危害国家统一、主权和领土完整的;</view>
+      <view>(c) 泄露国家秘密,危害国家安全,损害国家荣誉和利益的;</view>
+      <view>(d) 煽动民族仇恨、民族歧视,破坏民族团结,侵害民族风俗、习惯的;</view>
+      <view>(e) 违背国家宗教政策,宣扬邪教、迷信的;</view>
+      <view>(f) 扰乱社会秩序,破坏社会稳定的;</view>
+      <view>(g) 宣扬淫秽、赌博、暴力、教唆犯罪的;</view>
+      <view>(h) 侮辱、诽谤、恐吓、涉及他人隐私等侵害他人合法权益的;</view>
+      <view>(i) 侵犯他人知识产权或涉及第三方商业秘密及其他专有权利的;</view>
+      <view>(j) 存在可能破坏、篡改、删除、影响{{title}}电单车平台任何系统正常运行或未经授权秘密获取;</view>
+      <view>(k) {{title}}电单车平台及其他用户的数据、个人资料的病毒、木马、爬虫等恶意软件、程序代码的;</view>
+      <view>(l) 危害社会公德,诋毁民族优秀文化的;</view>
+      <view>(m) 有国家法律、法规或政策禁止的其他内容。</view>
+      <view class="title">6、不可抗力</view>
+      <view>本公司依法律规定承担基础保障义务,但无法对由于信息网络基础设施、信息网络设备维护、连接故障,电脑、通讯或其他系统的故障,电力故障,罢工,暴乱,火灾,洪水,风暴,爆炸,战争,政府行为,司法行政机关的命令或因第三方原因而给您造成的损害结果承担责任。</view>
+      <view class="title">7、知识产权</view>
+      <view>7.1 {{title}}电单车平台的一切知识产权(包括但不限于版权、商标权、专利权、商业秘密),以及相关的所有信息内容,包括但不限于:文字表述及其组合、图标、图饰、图表、色彩、接口设计、版面框架、有关数据、印刷材料、或电子文件等均受中华人民共和国著作权法、商标法、专利法、反不正当竞争法和相应的国际条约以及其他知识产权法律法规的保护,除涉及第三方授权的软件或技术外,本公司享有上述知识产权。</view>
+      <view>7.2 未经本公司书面同意,用户不得为任何营利性或非营利性的目的自行实施、利用、转让或许可任何三方实施、利用、转让上述知识产权,本公司保留追究上述未经许可行为的权利。</view>
+      <view class="title">8、免责声明</view>
+      <view>
+        <view class="title_1"> 8.1 用户明确同意其使用本公司网络服务所存在的风险将完全由其自己承担,因其使用本公司网络服务而产生的一切后果也由其自己承担,本公司对用户不承担任何责任。</view>
+      </view>
+      <view>
+        <view class="title_1">8.2 本公司对网络服务不作任何类型的担保,包括但不限于网络服务的及时性、安全性、准确性,对在任何情况下因使用或不能使用本网络服务所产生的直接、间接、偶然、特殊及后续的损害及风险,本公司不承担任何责任。</view>
+      </view>
+      <view>
+        <view class="title_1">8.3 用户同意,对于本公司向用户提供的下列产品或者服务的质量缺陷本身及其引发的任何损失,本公司无需承担任何责任:</view>
+      </view>
+      <view>
+        <view class="title_1">(a) 本公司向用户免费提供的各项网络服务;</view>
+      </view>
+      <view>
+        <view class="title_1">(b) 本公司向用户赠送的任何产品或者服务;</view>
+      </view>
+      <view>
+        <view class="title_1">(c) 本公司向用户附赠的各种产品或者服务。</view>
+      </view>
+      <view>
+        <view class="title_1">8.4 用户理解安全骑行的重要性,且保证在任何可能引起安全隐患的情况下均不得使用{{title}}电单车平台,并同意一切因使用{{title}}电单车平台服务而导致的安全隐患和因此产生的纠纷和交通事故,均应由电动自行车所有权人承担责任,本公司概不负责赔偿。</view>
+      </view>
+      <view>
+        <view class="title_1">8.5 用户同意并理解{{title}}电单车平台提供本协议所列的服务,但无须对用户使用服务相关行为所造成的损失负担任何责任。</view>
+      </view>
+      <view>
+        <view class="title_1">8.6 我们使用第三方电子支付服务供应商(以下简称“电子支付服务商”),将您的第三方电子支付账户关联到您在{{title}}电单车平台的个人帐户。处理您使用服务相关的付款时,除了受到本协议的约束之外,还要受电子支付服务商及信用卡/借记卡发卡行的条款和政策的约束。我们对于电子支付服务商或银行发生的错误不承担责任。我们将获取与您使用服务相关的特定交易明细。在使用这些信息时我们将严格遵守相关法律法规和公司的各项政策。</view>
+      </view>
+      <view class="title">9、隐私保护</view>
+      <view>9.1 保护用户隐私是本公司的一项基本政策,本公司保证不对外公开或向非本公司关联企业的第三方提供单个用户的注册数据及用户在使用网络服务时存储在{{title}}电单车平台的非公开内容,但下列情况除外:</view>
+      <view>(a) 事先获得用户的明确授权;</view>
+      <view>(b) 根据有关的法律法规要求;</view>
+      <view>(c) 按照相关政府主管部门的要求;</view>
+      <view>(d) 为维护社会公众的利益;</view>
+      <view>(e) 为维护本公司的合法权益。</view>
+      <view>9.2 在不透露单个用户隐私数据的前提下,本公司有权对整个用户数据库进行分析并在合法范围内对用户数据库进行商业上的利用。</view>
+      <view class="title">10、违约</view>
+      <view>10.1 发生如下情形之一的,视为您违约:</view>
+      <view>(a) 如{{company_1}}在用户认证信息复核过程中发现用户提供的认证信息不全、无效或虚假;</view>
+      <view>(b) 如用户发生危及交易安全或账户安全的行为;</view>
+      <view>(c) 如用户采用不正当手段谋取利益的行为,包括向本公司工作人员及/或其关联人士提供财物、消费、款待或商业机会,或通过其他手段谋取不正当利益;</view>
+      <view>(d) 如用户扰乱{{title}}电单车平台的秩序,以任何方式,刻意规避{{title}}电单车平台的各类规则或市场管控措施,或以不正当的方式获取、使用{{title}}电单车平台资源的行为;</view>
+      <view>(e) 如用户违反中国相关法律法规的规定;</view>
+      <view>(f) 如用户违反本协议的其他规定。</view>
+      <view>10.2 为适应互联网平台发展和满足海量用户对高效优质服务的需求,您理解并同意,本公司可在{{title}}电单车平台规则中约定违约认定的程序和标准。如:本公司可依据您的用户数据与海量用户数据的关系来认定您是否构成违约;您有义务对您的数据异常现象进行充分举证和合理解释,否则将被认定为违约。</view>
+      <view>10.3 为保障其他用户或{{title}}电单车平台的正当权益,维持市场正常运营秩序,在用户违规处理期间本公司按照本规则规定的情形对用户采取违规处理措施,本公司没有义务在采取违规处理前通知用户。</view>
+      <view>10.4 违约处理</view>
+      <view>(a) 停止租车服务:指停止认证用户通过{{title}}电单车平台租赁使用自行车、电动自行车的权利;</view>
+      <view>(b) 关闭账户:指删除用户的账户或停止用户的所有权限,并将用户列入黑名单,不再向用户提供任何服务;</view>
+      <view>(c) 公示警告:指在{{title}}电单车平台的管理系统等位置对其正在被执行的处理进行公示;</view>
+      <view>(d) 终止本协议。</view>
+      <view>本公司可将对您上述违约行为处理措施信息以及其他经国家行政或司法机关生效法律文书确认的违法信息在{{title}}电单车平台上予以公示。</view>
+      <view class="title">11、赔偿责任</view>
+      <view>11.1 如您的行为使本公司遭受损失(包括平台的直接经济损失、商誉损失及对外支付的赔偿金、和解款、律师费、诉讼费等间接经济损失),本公司有权调用个人所有信息(包括姓名、手机号、身份证号等信息)交于当地公安机关进行调查取证及索赔,您应赔偿本公司的上述全部损失。</view>
+      <view> <view class="title_1"> 11.2 如您的行为使本公司遭受第三人主张权利,本公司可在对第三人承担金钱给付等义务后就全部损失向您追偿。</view></view>
+      <view><view class="title_1">1.3 如您通过{{title}}电单车平台与电动自行车所有权人达成的服务协议,系由电动自行车所有权人履行并承担相关责任。对于您享受租车服务过程中产生的任何责任,均由电动自行车所有权人承担。</view></view>
+      <view class="title">12、协议的变更</view>
+      <view>由于互联网的高速发展,本公司保留不经事先通知为维修、升级或其他目的暂停或更改本服务任何部分的权利。本公司可能会根据需要不时修订或更新本协议及其相关补充和附件等文件,修订或更新后的协议和文本一经公布,立刻取代原协议和文件,并自动生效。<view class="title_1">如果您不接受相关修订或更新,请立刻停止使用{{title}}电单车服务;如您继续使用{{title}}电单车服务,即表示您已经充分接受该修订或更新。</view></view>
+      <view class="title">13、协议的终止</view>
+      <view>13.1 出现以下情况时,本公司可以根据本协议第14条的所列的方式通知您终止本协议:</view>
+      <view>(a) 您违反本协议约定,本公司依据违约条款终止本协议的;</view>
+      <view>(b) 您的用户行为存在异常,本公司合理怀疑您可能存在违反本协议约定的行为,如果不终止本协议则可能对{{title}}电单车平台或其他用户造成不利影响的;</view>
+      <view>(c) 您盗用他人账户、发布违禁信息、骗取他人财物、采取不正当手段谋利等行为,本公司据本协议对您的账户予以查封的;</view>
+      <view>(d) 除上述情形外,因您多次违反{{title}}电单车平台相关规定且情节严重,本公司依据本协议对您的账户予以查封的;</view>
+      <view>(e) 您停止使用账户达【2】年或更长,其它应当终止服务的情况。</view>
+      <view>13.2 协议终止后的处理</view>
+      <view>本协议终止后,除法律有明确规定外,本公司无义务向您或您指定的第三方披露您账户中的任何信息。本协议终止后,本公司仍享有下列权利:</view>
+      <view>(a) 继续保存您留存于{{title}}电单车平台的各类信息;</view>
+      <view>(b) 对于您过往的违约行为,本公司仍可依据本协议向您追究违约责任。</view>
+      <view class="title">14、通知送达</view>
+      <view>14.1 本协议项下本公司对于用户所有的通知均可通过{{title}}电单车平台公示的文案、网页公告、站内短信、{{title}}电单车平台弹出消息、客户端推送的消息、您预留于{{title}}电单车平台的联系方式发出的电子邮件、短信、函件等方式进行,该等通知于发送之日视为已送达收件人。</view>
+      <view>14.2 用户对于本公司的通知应当通过本公司对外正式公布的通信地址、传真号码、电子邮件地址等联系信息进行送达。该等通知以本公司实际收到日为送达日。</view>
+      <view class="title">15、法律适用、管辖及其他</view>
+      <view>15.1 本协议之订立、生效、解释、修订、补充、终止、执行与争议解决均适用中华人民共和国大陆地区法律;如法律无相关规定的,参照商业惯例及/或行业惯例。</view>
+      <view class="title_1">15.2 双方就本协议内容或其执行发生任何争议,双方应尽量友好协商解决;协商不成时,任何一方均可向本公司所在地的人民法院提起诉讼。</view>
+      <view>15.3 对于因不可抗力或因黑客攻击、通讯线路中断等本公司不能控制的原因导致的网络服务器中断或其他缺陷,导致用户不能正常使用本软件,本公司不承担任何责任,但将尽力减少因此给用户造成的损失或影响。</view>
+      <view>15.4 《本协议》自用户接受之时生效。</view>
+      <view class="footer">{{company}} </view>
+      <view></view>
+      <view></view>
+    
+    </view>
+  </view>
 </view>

+ 4 - 1
pages/agreement/agreement.js

@@ -1,7 +1,10 @@
 var app = getApp()
 Page({
   data: {
-    title:app.globalData.title
+    title:app.globalData.title,
+    company:app.globalData.company,
+    company_1:app.globalData.company_1
+    
   },
   onLoad: function (options) {
 

+ 94 - 59
pages/authorization/authorization.acss

@@ -1,60 +1,95 @@
-/* required by usingComponents */
-/* pages/authorization/authorization.wxss */
-page{
-  text-align: center;
-  text-align: center;
-}
-.tip{
-  position: fixed;
-  top: 40rpx;
-  right: 30rpx;
-  font-size: 28rpx;
-  color: #999999;
-}
-.logo{
-  height:200rpx;
-  width: 200rpx;
-  margin-top: 12%;
-}
-.text{
-  margin-top:20rpx;
-  font-size: 44rpx;
-}
-.wxlogin{
-  height: 85rpx;
-  color: #fff;
-  width: 90%;
-  margin: 0 auto;
-  border-radius: 12rpx;
-  margin-top: 150rpx;
-  line-height: 85rpx;
-  background-color: var(--greenButton)!important;
-}
-.phonelogin{
-  margin-top: 30rpx;
-  line-height: 85rpx;
-  color: #fd9b1c;
-}
-.button-tips{
-  position: fixed;
-  width: 100%;
-  bottom: 50rpx;
-  text-align: center;
-  font-size: 24rpx;
-  color: #999999;
-}
-.button-tips .xieyi{
-  color: #333333;
-}
-button{
-  border: none;
-background-color: transparent;
-outline: none;
-width: 90%!important;
-}
-.zhi1{
-  height: 70rpx;
-width: 70rpx;
-display: inline-block;
-vertical-align: middle;
+/* required by usingComponents */
+/* pages/authorization/authorization.wxss */
+page{
+  text-align: center;
+  text-align: center;
+}
+.tip{
+  position: fixed;
+  top: 40rpx;
+  right: 30rpx;
+  font-size: 28rpx;
+  color: #999999;
+}
+.logo{
+  height:200rpx;
+  width: 200rpx;
+  margin-top: 12%;
+}
+.text{
+  margin-top:20rpx;
+  font-size: 44rpx;
+}
+.wxlogin{
+  height: 85rpx;
+  color: #fff!important;
+  width: 90%;
+  margin: 0 auto;
+  border-radius: 12rpx;
+  margin-top: 150rpx;
+  line-height: 85rpx;
+  background-color: var(--greenButton)!important;
+}
+.wxlogin_1{
+  height: 85rpx;
+  color: #fff!important;
+  width: 90%;
+  margin: 0 auto;
+  border-radius: 12rpx;
+  margin-top: 150rpx;
+  line-height: 85rpx;
+  background-color: #cfcfcf !important;
+}
+.phonelogin{
+  margin-top: 30rpx;
+  line-height: 85rpx;
+  color: #fd9b1c;
+}
+.button-tips{
+  position: fixed;
+  width: 100%;
+  bottom: 50rpx;
+  text-align: center;
+  font-size: 24rpx;
+  color: #999999;
+}
+.button-tips .xieyi{
+  color: #333333;
+}
+button{
+  border: none;
+background-color: transparent;
+outline: none;
+width: 90%!important;
+}
+.zhi1{
+  height: 70rpx;
+width: 70rpx;
+display: inline-block;
+vertical-align: middle;
+}
+
+.footer {
+  margin-top: 40rpx;
+}
+
+.footer view {
+  display: inline-block;
+  vertical-align: middle;
+  font-size: 28rpx;
+}
+
+.select,
+.selected {
+  border: solid 2px var(--globleColor);
+  height: 35rpx;
+  width: 35rpx;
+  margin-right: 10rpx;
+  border-radius: 8rpx;
+}
+
+.dui {
+  height: 35rpx;
+  width: 35rpx;
+  margin: 0 auto;
 }

+ 19 - 13
pages/authorization/authorization.axml

@@ -1,14 +1,20 @@
-
-<view class="authorization">
-  <view class="tip" onTap="noSign">暂不登录</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'>
-    <image src="../../img/zhi1.png" class="zhi1"></image>
-    支付授权手机号登录</button>
-
-  <view class="button-tips" onTap="skipXieyi">
-    <text>登录即代表同意<text class="xieyi">《{{title}}用户协议》</text>  
-  </view>
+
+<view class="authorization">
+  <view class="tip" onTap="noSign">暂不登录</view>
+  <image src="{{logoUrl}}" class="logo" mode="widthFix"></image>
+  <view class="text">欢迎使用{{title}}</view>
+
+    <button class="wxlogin" a:if="{{ isAgree ==true }}" open-type="getAuthorize" onGetAuthorize="getUserPhoneNumber" onError="onAuthError" scope='phoneNumber'>
+    <image src="../../img/zhi1.png" class="zhi1"></image>
+    支付授权手机号登录</button>
+    <button class="wxlogin_1" a:else  disabled  open-type="getAuthorize" onGetAuthorize="getUserPhoneNumber" onError="onAuthError" scope='phoneNumber'>
+      <image src="../../img/zhi1.png" class="zhi1"></image>
+      支付授权手机号登录</button>
+
+    <view class="footer">
+      <view class="select" onTap="clickAgree">
+        <image  a:if="{{isAgree==true}}" class="dui" src="../../img/dui.png"></image>
+      </view>
+      <view>点击勾选并登录/注册即代表同意 <text onTap="skipXieyi" style="color: var(--globleColor);">《用户协议》</text></view>
+    </view>
 </view>

+ 167 - 160
pages/authorization/authorization.js

@@ -1,161 +1,168 @@
-const app = getApp()
-var arr = [];
-Page({
-  data: {
-    //测试.
-    versions: false,
-    token: '',
-    img: app.globalData.imgUrl,
-    title: app.globalData.title,
-    logoUrl: '',
-    bind_mobile: 0,
-    session_key: ''
-  },
-  onLoad: function (options) {
-    var that = this;
-    my.setNavigationBar({
-      title: app.globalData.title
-    })
-    this.setData({
-      logoUrl: app.globalData.logoUrl
-    })
-  },
-    skipXieyi:function(){
-    my.navigateTo({
-      url: '/pages/agreement/agreement',
-    })
-  },
-  onGotUserInfo: function (e) {
-    console.log(e)
-    if (e.detail.errMsg == "getUserInfo:fail auth deny") {
-      my.showToast({
-        content: '授权失败请重试',
-        icon: 'none'
-      })
-    } else {
-      my.showLoading({
-        content: '登陆中请稍等...',
-        mask: true
-      })
-      if (e.detail.rawData) {
-        var data = e.detail.userInfo
-        my.setStorageSync({ 'key': 'userInfo', data: data })
-        if (my.getStorageSync({ 'key': 'home' }).data.id != undefined) {
-          data.area_id = my.getStorageSync({ 'key': 'home' }).data.id
-        }
-        console.log(data)
-        app.request("/auth/weapp-userinfo-sync", data, "POST").then(res => {
-          if (res.status == 200) {
-            my.showToast({
-              content: '授权成功',
-              icon: 'none'
-            })
-            my.setStorageSync({ 'key': 'userInfo', data: res.data })
-            // my.navigateBack()
-            if (app.globalData.compatible) {
-              console.log(app.globalData.compatible)
-              my.redirectTo({
-                url: '/pages/compatible/index/index',
-              })
-            } else {
-              my.redirectTo({
-                url: '/pages/index/index',
-              })
-            }
-          } else {
-            my.showToast({
-              content: '登陆失败请重试',
-              icon: 'none'
-            })
-            my.redirectTo({
-              url: '/pages/index/index',
-            })
-          }
-        })
-      } else {
-        my.showToast({
-          content: '授权失败',
-          icon: 'none'
-        })
-      }
-    }
-  },
-  onAuthError: function () {
-    my.showToast({
-      content: '授权失败请重试',
-      type: 'none'
-    });
-  },
-
-  getUserPhoneNumber: function (e) {
-    console.log(e)
-    my.getPhoneNumber({
-      success: (res) => {
-        console.log(res, "KKKKKKKKKKK")
-        let encryptedData = JSON.parse(res.response).response;
-        //userObject.phoneInfo = res.response;
-        console.log(encryptedData);
-        //手机号解密请求
-        // phoneAuth(res.response);
-        //  my.alert({
-        //   title: encryptedData,
-        // });4nbLCy+uBSvO8waRPGv3/EsHNqpa68oN8bPAyJqGjCT6UAVIaMuwChCdRsJkrsKRT3lGHdqyaET7YL2IptOLp7pZYW6w4wl9BHDLmx6V9kRindBZMBTYKzp7ov99o/E6rG3fZZCXSNA59aiKMojMA+JIzMRuo3GRBOcq0YEml6I=
-        if (encryptedData.length == 172) return;
-        let data = {
-          phone_detail: JSON.stringify(arr),
-          type: '3',
-          session_key: encryptedData,
-          auth_id: this.data.auth_id
-        }
-        app.request('/auth/mobileLogin', data, 'POST', app.globalData.req).then(res => {
-          console.log(res, "PPPPppp")
-          my.setStorageSync({ key: 'userInfo', data: res.data.user })
-          my.setStorageSync({ key: 'token', data: res.data.token });
-          console.log(my.getStorageSync({ key: 'token' }))
-          // my.setStorageSync('token', res.data.token)
-          // my.setStorageSync('token_time', res.data.exp)
-          // my.setStorageSync('userInfo', res.data.user)
-          my.reLaunch({
-              url: '/pages/index/index',
-          })
-        })
-      },
-      fail: (res) => {
-        console.log(res, "error");
-      }
-    })
-  },
-  //手机号登陆
-  phoneLogin: function () {
-    my.navigateTo({
-      url: '/pages/phonelogin/phonelogin',
-    })
-  },
-  //暂不登录
-  noSign: function () {
-    my.reLaunch({
-      url: '/pages/index/index',
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-    my.hideBackHome()
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+const app = getApp()
+var arr = [];
+Page({
+  data: {
+    //测试.
+    versions: false,
+    token: '',
+    img: app.globalData.imgUrl,
+    title: app.globalData.title,
+    logoUrl: '',
+    bind_mobile: 0,
+    session_key: '',
+    isAgree:false,
+  },
+  onLoad: function (options) {
+    var that = this;
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    this.setData({
+      logoUrl: app.globalData.logoUrl
+    })
+  },
+    skipXieyi:function(){
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
+  onGotUserInfo: function (e) {
+    console.log(e)
+    if (e.detail.errMsg == "getUserInfo:fail auth deny") {
+      my.showToast({
+        content: '授权失败请重试',
+        icon: 'none'
+      })
+    } else {
+      my.showLoading({
+        content: '登陆中请稍等...',
+        mask: true
+      })
+      if (e.detail.rawData) {
+        var data = e.detail.userInfo
+        my.setStorageSync({ 'key': 'userInfo', data: data })
+        if (my.getStorageSync({ 'key': 'home' }).data.id != undefined) {
+          data.area_id = my.getStorageSync({ 'key': 'home' }).data.id
+        }
+        console.log(data)
+        app.request("/auth/weapp-userinfo-sync", data, "POST").then(res => {
+          if (res.status == 200) {
+            my.showToast({
+              content: '授权成功',
+              icon: 'none'
+            })
+            my.setStorageSync({ 'key': 'userInfo', data: res.data })
+            // my.navigateBack()
+            if (app.globalData.compatible) {
+              console.log(app.globalData.compatible)
+              my.redirectTo({
+                url: '/pages/compatible/index/index',
+              })
+            } else {
+              my.redirectTo({
+                url: '/pages/index/index',
+              })
+            }
+          } else {
+            my.showToast({
+              content: '登陆失败请重试',
+              icon: 'none'
+            })
+            my.redirectTo({
+              url: '/pages/index/index',
+            })
+          }
+        })
+      } else {
+        my.showToast({
+          content: '授权失败',
+          icon: 'none'
+        })
+      }
+    }
+  },
+  onAuthError: function () {
+    my.showToast({
+      content: '授权失败请重试',
+      type: 'none'
+    });
+  },
+
+  getUserPhoneNumber: function (e) {
+    console.log(e)
+    my.getPhoneNumber({
+      success: (res) => {
+        console.log(res, "KKKKKKKKKKK")
+        let encryptedData = JSON.parse(res.response).response;
+        //userObject.phoneInfo = res.response;
+        console.log(encryptedData);
+        //手机号解密请求
+        // phoneAuth(res.response);
+        //  my.alert({
+        //   title: encryptedData,
+        // });4nbLCy+uBSvO8waRPGv3/EsHNqpa68oN8bPAyJqGjCT6UAVIaMuwChCdRsJkrsKRT3lGHdqyaET7YL2IptOLp7pZYW6w4wl9BHDLmx6V9kRindBZMBTYKzp7ov99o/E6rG3fZZCXSNA59aiKMojMA+JIzMRuo3GRBOcq0YEml6I=
+        if (encryptedData.length == 172) return;
+        let data = {
+          phone_detail: JSON.stringify(arr),
+          type: '3',
+          session_key: encryptedData,
+          auth_id: this.data.auth_id
+        }
+        app.request('/auth/mobileLogin', data, 'POST', app.globalData.req).then(res => {
+          console.log(res, "PPPPppp")
+          my.setStorageSync({ key: 'userInfo', data: res.data.user })
+          my.setStorageSync({ key: 'token', data: res.data.token });
+          console.log(my.getStorageSync({ key: 'token' }))
+          // my.setStorageSync('token', res.data.token)
+          // my.setStorageSync('token_time', res.data.exp)
+          // my.setStorageSync('userInfo', res.data.user)
+          my.reLaunch({
+              url: '/pages/index/index',
+          })
+        })
+      },
+      fail: (res) => {
+        console.log(res, "error");
+      }
+    })
+  },
+  //手机号登陆
+  phoneLogin: function () {
+    my.navigateTo({
+      url: '/pages/phonelogin/phonelogin',
+    })
+  },
+  //暂不登录
+  noSign: function () {
+    my.reLaunch({
+      url: '/pages/index/index',
+    })
+  },
+   //点击同意用户协议
+   clickAgree(){
+    this.setData({
+      isAgree:!this.data.isAgree
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    my.hideBackHome()
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 4 - 4
pages/authorization/authorization.json

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

+ 183 - 183
pages/balance/balance.acss

@@ -1,184 +1,184 @@
-/* required by usingComponents */
-/* pages/balance/balance.wxss */
-page{
-  background: #ffffff;
-}
-.balance-top {
-  height: 80rpx;
-  text-align: center;
-  font-size: 24rpx;
-  background-color: #fff2e2;
-  color: #fa5207;
-  line-height: 80rpx;
-
-}
-
-.chongzhi {
-  padding: 30rpx 40rpx;
-}
-
-.card {
-  padding: 50rpx;
-  border-radius: 20rpx;
-  background: linear-gradient(to right, #ffd514, #ffe330);
-  margin-bottom: 10rpx;
-}
-
-.balance-num {
-  margin-top: 10rpx;
-  font-size: 26rpx;
-}
-
-.iconfont {
-  font-size: 24rpx;
-  display: inline-block;
-  margin-left: 6rpx;
-}
-
-.yue {
-  font-size: 28rpx;
-}
-
-.money {
-  font-size: 60rpx;
-  font-weight: bold;
-}
-
-.yuan {
-  font-size: 30rpx;
-  font-weight: 600;
-  display: inline-block;
-  margin-left: 4rpx;
-}
-
-.money-list {
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: space-between;
-  flex-direction: row;
-}
-
-.money-item,
-.active {
-  flex: 0 0 45%;
-  margin-top: 30rpx;
-  height: 120rpx;
-  border-radius: 20rpx;
-  line-height: 120rpx;
-  border: solid 1rpx #ffce3b;
-  text-align: center;
-  box-shadow: 0 0 15px #fffce1;
-}
-
-.active {
-
-  background-color: #ffe02d;
-
-}
-@media (max-height: 500px) {
-   .bottom-card {
-        display: none;
-    }
-}
-.bottom-card {
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  padding: 50rpx 0;
-  padding-bottom: 120rpx;
-  width: 100%;
-  z-index: 333;
-  box-shadow: 0 0 15px #f6f6f6;
-}
-
-.bottom-list {
-
-  text-align: center;
-
-  color: #fff;
-  font-size: 32rpx;
-  font-weight: 600;
-}
-
-.bottom-item1 {
-  width: 70%;
-  margin: 0 auto;
-  height: 100rpx;
-  line-height: 100rpx;
-  border-radius: 50rpx;
-  background-color: var(--globleColor);
-}
-
-.bottom-item2 {
-  flex: 0 0 36%;
-  margin-right: 10%;
-  height: 100rpx;
-  border-radius: 50rpx;
-  line-height: 100rpx;
-  background-color: var(--greenButton);
-}
-
-.frame {
-  height: 100vh;
-  width: 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  background-color: rgba(0, 0, 0, 0.6);
-
-}
-
-.frame-content {
-  padding: 80rpx 50rpx;
-  width: 70%;
-  margin: 0 auto;
-  margin-top: 40%;
-  background-color: #fff;
-  opacity: 1;
-  font-size: 28rpx;
-}
-
-.frame-title {
-  margin-left: 50rpx;
-  color: #909090;
-}
-
-.money-detail {
-  display: flex;
-  margin-top: 20rpx;
-}
-
-.detail-item {
-  flex: 1;
-  padding: 20rpx 0;
-  text-align: center;
-}
-
-.detail-item:first-child {
-  border-right: solid 1rpx #d6d6d6;
-}
-
-.detail-nums {
-  font-size: 40rpx;
-  font-weight: 600;
-
-}
-
-.detail-text {
-  margin-top: 10rpx;
-  color: #333333;
-}
-.zidingyi{
-  margin-top: 50rpx;
-}
-.zidingyi input{
-  height: 70rpx;
-  /* width: 80%; */
-  border: solid 1rpx var(--globleColor);
-  /* padding: 0 20rpx; */
-  border-radius: 12rpx;
-
-}
-.no-input{
-  font-size: 26rpx;
+/* required by usingComponents */
+/* pages/balance/balance.wxss */
+page{
+  background: #ffffff;
+}
+.balance-top {
+  height: 80rpx;
+  text-align: center;
+  font-size: 24rpx;
+  background-color: #fff2e2;
+  color: #fa5207;
+  line-height: 80rpx;
+
+}
+
+.chongzhi {
+  padding: 30rpx 40rpx;
+}
+
+.card {
+  padding: 50rpx;
+  border-radius: 20rpx;
+  background: linear-gradient(to right, #ffd514, #ffe330);
+  margin-bottom: 10rpx;
+}
+
+.balance-num {
+  margin-top: 10rpx;
+  font-size: 26rpx;
+}
+
+.iconfont {
+  font-size: 24rpx;
+  display: inline-block;
+  margin-left: 6rpx;
+}
+
+.yue {
+  font-size: 28rpx;
+}
+
+.money {
+  font-size: 60rpx;
+  font-weight: bold;
+}
+
+.yuan {
+  font-size: 30rpx;
+  font-weight: 600;
+  display: inline-block;
+  margin-left: 4rpx;
+}
+
+.money-list {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+  flex-direction: row;
+}
+
+.money-item,
+.active {
+  flex: 0 0 45%;
+  margin-top: 30rpx;
+  height: 120rpx;
+  border-radius: 20rpx;
+  line-height: 120rpx;
+  border: solid 1rpx #ffce3b;
+  text-align: center;
+  box-shadow: 0 0 15px #fffce1;
+}
+
+.active {
+
+  background-color: #ffe02d;
+
+}
+@media (max-height: 500px) {
+   .bottom-card {
+        display: none;
+    }
+}
+.bottom-card {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  padding: 50rpx 0;
+  padding-bottom: 120rpx;
+  width: 100%;
+  z-index: 333;
+  box-shadow: 0 0 15px #f6f6f6;
+}
+
+.bottom-list {
+
+  text-align: center;
+
+  color: #fff;
+  font-size: 32rpx;
+  font-weight: 600;
+}
+
+.bottom-item1 {
+  width: 70%;
+  margin: 0 auto;
+  height: 100rpx;
+  line-height: 100rpx;
+  border-radius: 50rpx;
+  background-color: var(--globleColor);
+}
+
+.bottom-item2 {
+  flex: 0 0 36%;
+  margin-right: 10%;
+  height: 100rpx;
+  border-radius: 50rpx;
+  line-height: 100rpx;
+  background-color: var(--greenButton);
+}
+
+.frame {
+  height: 100vh;
+  width: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background-color: rgba(0, 0, 0, 0.6);
+
+}
+
+.frame-content {
+  padding: 80rpx 50rpx;
+  width: 70%;
+  margin: 0 auto;
+  margin-top: 40%;
+  background-color: #fff;
+  opacity: 1;
+  font-size: 28rpx;
+}
+
+.frame-title {
+  margin-left: 50rpx;
+  color: #909090;
+}
+
+.money-detail {
+  display: flex;
+  margin-top: 20rpx;
+}
+
+.detail-item {
+  flex: 1;
+  padding: 20rpx 0;
+  text-align: center;
+}
+
+.detail-item:first-child {
+  border-right: solid 1rpx #d6d6d6;
+}
+
+.detail-nums {
+  font-size: 40rpx;
+  font-weight: 600;
+
+}
+
+.detail-text {
+  margin-top: 10rpx;
+  color: #333333;
+}
+.zidingyi{
+  margin-top: 50rpx;
+}
+.zidingyi input{
+  height: 70rpx;
+  /* width: 80%; */
+  border: solid 1rpx var(--globleColor);
+  /* padding: 0 20rpx; */
+  border-radius: 12rpx;
+
+}
+.no-input{
+  font-size: 26rpx;
 }

+ 55 - 55
pages/balance/balance.axml

@@ -1,56 +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}}" 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 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}}" 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>

+ 219 - 219
pages/balance/balance.js

@@ -1,220 +1,220 @@
-// pages/balance/balance.js
-const app = getApp();
-const util = require('../../utils/utils')
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-
-    isShow: false,
-    inpurShow: false,
-    money: '', //选择的金额
-    inputValue: null, //输入框内金额(10~1000)
-    currentNow: 0, //当前选择金额
-    moneyList: [], //可选择的金额列表
-    id: '',
-    Index: 0,
-    title: app.globalData.title,
-    balance: '',
-    index1: ''
-
-  },
-  frameShow: function () {
-    // this.setData({
-    //   isShow: true
-    // })
-  },
-  hideFrame: function () {
-    this.setData({
-      isShow: false
-    })
-  },
-  skipXieyi: function () {
-    my.navigateTo({
-      url: '/pages/agreement/agreement',
-    })
-  },
-  //获取余额
-  getBalance: util.throttle(function (e) {
-    app.request("/me", '', "GET").then(res => {
-      200 == res.status && my.setStorageSync({ 'key': "userInfo", data: res.data }), this.setData({
-        balance: res.data.wallet_money
-      })
-    })
-  }, 1000),
-  //验证输入金额
-  ckInp(e) {
-    var self = this
-    this.setData({
-      money: e.detail.value,
-      id: 0
-    })
-  },
-  //选择充值金额
-  changeMoney: function (e) {
-    this.setData({
-      money: null
-    })
-    let idx = e.currentTarget.dataset.idx
-    if (idx == -1) {
-      this.setData({
-        currentNow: idx,
-
-        index1: idx
-      })
-    } else {
-      this.setData({
-        currentNow: idx,
-        money: this.data.moneyList[idx].recharge_money,
-        id: this.data.moneyList[idx].id,
-        Index: idx
-      })
-    }
-
-  },
-  //立即充值
-  pay: util.throttle(function (e) {
-    var reg = new RegExp("^([1-9]|[0-9]{0,3}|1000)$");
-    // var reg = new RegExp("^[1-9]\d{0,3}|10000$")
-    var self = this;
-    console.log(self.data.money)
-    console.log(self.data.inputValue)
-    if (self.data.money == '' && self.data.inputValue == null) {
-      my.showToast({
-        content: '请选择或者输入充值金额',
-        icon: 'none',
-        duration: 2000
-      })
-    } else if (!reg.test(self.data.money)) {
-      my.showToast({
-        content: '请输入1-1000的整数',
-        icon: 'none',
-        duration: 2000,
-      })
-      self.setData({
-        inputValue: null
-      })
-    } else {
-
-
-      if (app.globalData.req) {
-        console.log(self.data.id, 'area_id')
-        console.log(self.data.id, 'area_id')
-        let data = {}
-        if (my.getStorageSync({ 'key': 'home' }).data) {
-          data = {
-            money: self.data.inputValue || self.data.money,
-            area_id: my.getStorageSync({ 'key': 'home' }).data.id,
-            config_id: self.data.id
-          }
-        }else{
-          data = {
-          money: self.data.inputValue || self.data.money,
-          config_id: self.data.id
-        }
-        }
-
-        app.request('/rechange/pay', data, 'POST', app.globalData.req).then(res => {
-          if (res.status == 200) {
-            my.tradePay({
-              tradeNO: res.data.tradeNo,
-              success(resp) {
-                if (resp.resultCode == 9000) {
-                  my.navigateTo({
-                    url: '/pages/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 () {
-
-  }
+// pages/balance/balance.js
+const app = getApp();
+const util = require('../../utils/utils')
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+    isShow: false,
+    inpurShow: false,
+    money: '', //选择的金额
+    inputValue: null, //输入框内金额(10~1000)
+    currentNow: 0, //当前选择金额
+    moneyList: [], //可选择的金额列表
+    id: '',
+    Index: 0,
+    title: app.globalData.title,
+    balance: '',
+    index1: ''
+
+  },
+  frameShow: function () {
+    // this.setData({
+    //   isShow: true
+    // })
+  },
+  hideFrame: function () {
+    this.setData({
+      isShow: false
+    })
+  },
+  skipXieyi: function () {
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
+  //获取余额
+  getBalance: util.throttle(function (e) {
+    app.request("/me", '', "GET").then(res => {
+      200 == res.status && my.setStorageSync({ 'key': "userInfo", data: res.data }), this.setData({
+        balance: res.data.wallet_money
+      })
+    })
+  }, 1000),
+  //验证输入金额
+  ckInp(e) {
+    var self = this
+    this.setData({
+      money: e.detail.value,
+      id: 0
+    })
+  },
+  //选择充值金额
+  changeMoney: function (e) {
+    this.setData({
+      money: null
+    })
+    let idx = e.currentTarget.dataset.idx
+    if (idx == -1) {
+      this.setData({
+        currentNow: idx,
+
+        index1: idx
+      })
+    } else {
+      this.setData({
+        currentNow: idx,
+        money: this.data.moneyList[idx].recharge_money,
+        id: this.data.moneyList[idx].id,
+        Index: idx
+      })
+    }
+
+  },
+  //立即充值
+  pay: util.throttle(function (e) {
+    var reg = new RegExp("^([1-9]|[0-9]{0,3}|1000)$");
+    // var reg = new RegExp("^[1-9]\d{0,3}|10000$")
+    var self = this;
+    console.log(self.data.money)
+    console.log(self.data.inputValue)
+    if (self.data.money == '' && self.data.inputValue == null) {
+      my.showToast({
+        content: '请选择或者输入充值金额',
+        icon: 'none',
+        duration: 2000
+      })
+    } else if (!reg.test(self.data.money)) {
+      my.showToast({
+        content: '请输入1-1000的整数',
+        icon: 'none',
+        duration: 2000,
+      })
+      self.setData({
+        inputValue: null
+      })
+    } else {
+
+
+      if (app.globalData.req) {
+        console.log(self.data.id, 'area_id')
+        console.log(self.data.id, 'area_id')
+        let data = {}
+        if (my.getStorageSync({ 'key': 'home' }).data) {
+          data = {
+            money: self.data.inputValue || self.data.money,
+            area_id: my.getStorageSync({ 'key': 'home' }).data.id,
+            config_id: self.data.id
+          }
+        }else{
+          data = {
+          money: self.data.inputValue || self.data.money,
+          config_id: self.data.id
+        }
+        }
+
+        app.request('/rechange/pay', data, 'POST', app.globalData.req).then(res => {
+          if (res.status == 200) {
+            my.tradePay({
+              tradeNO: res.data.tradeNo,
+              success(resp) {
+                if (resp.resultCode == 9000) {
+                  my.navigateTo({
+                    url: '/pages/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"  
+  }
 }

+ 243 - 243
pages/breakdown/breakdown.acss

@@ -1,244 +1,244 @@
-/* required by usingComponents */
-/* pages/breakdown/breakdown.wxss */
-page {
-  background-color: #f7f7f7;
-}
-
-.breakdown {
-  padding: 30rpx 40rpx;
-}
-
-.card_no {
-  background-color: #ffffff;
-  padding: 20rpx 30rpx;
-  border-radius: 15rpx;
-  display: flex;
-}
-
-.card-left {
-  flex: 1;
-  width: 200rpx;
-}
-
-.card-title {
-  font-size: 32rpx;
-  font-weight: bold;
-}
-
-.card-title1 {
-  font-size: 28rpx;
-  color: #999999;
-}
-
-.input-no {
-  margin-top: 10rpx;
-  font-size: 32rpx;
-  font-weight: bold;
-}
-
-.no-placeholder {
-  font-size: 28rpx;
-  color: #999999;
-  font-weight: bold;
-}
-
-
-.card-right {
-  flex: 0 0 230rpx;
-  width: 300rpx;
-  height: 90rpx;
-  color: #fff;
-  line-height: 90rpx;
-  text-align: center;
-  border-radius: 50rpx;
-  font-size: 32rpx;
-  font-weight: 600;
-  background-color: #1a1a1a;
-}
-
-.iconfont {
-  display: inline-block;
-  margin-right: 10rpx;
-}
-
-.problem {
-  margin-top: 20rpx;
-  background-color: #fff;
-  padding: 20rpx 0;
-  border-radius: 15rpx;
-}
-
-.problem-title {
-  font-size: 32rpx;
-  font-weight: bold;
-  padding: 0 30rpx;
-}
-
-.problem-bike {
-  height: 350rpx;
-  margin-top: 20rpx;
-  padding: 0 30rpx;
-}
-
-.item1 {
-  background-color: #fff;
-  text-align: center;
-}
-
-.item1 image {
-  width: 90%;
-  height: 250rpx;
-  margin: 0 auto;
-  margin-top: 50rpx;
-}
-
-.item2 {
-  background-color: rgb(228, 216, 49);
-}
-
-.option {
-  display: flex;
-  flex-wrap: wrap;
-  margin-top: 30rpx;
-  text-align: center;
-}
-
-.option-item-left,
-.active {
-  flex: 0 0 40%;
-  width: 45%;
-  border: solid 1rpx #d0d0d0;
-  height: 60rpx;
-  line-height: 60rpx;
-  border-radius: 50rpx;
-  margin: 0 4%;
-  margin-bottom: 20rpx;
-  font-size: 26rpx;
-  color: #343434;
-}
-
-.active {
-  border: solid 1rpx var(--globleColor);
-  color: var(--globleColor);
-  background-color: var(--fillColor);
-}
-
-.input-problem {
-
-  margin: 20rpx 30rpx;
-  position: relative;
-}
-
-.input-problem textarea {
-  border: solid 1rpx #d0d0d0;
-  border-radius: 15rpx;
-  width: auto;
-  height: 150rpx;
-  padding: 10rpx 20rpx;
-  font-size: 26rpx;
-}
-
-.count {
-  position: absolute;
-  bottom: 14rpx;
-  right: 31rpx;
-  color: #999;
-  font-size: 24rpx;
-}
-
-.placeholder {
-  color: #818181;
-  font-size: 24rpx;
-}
-
-.bike-photo {
-  margin-top: 20rpx;
-  background-color: #fff;
-  border-radius: 15rpx;
-  padding: 20rpx 30rpx;
-}
-
-.photo {
-  display: flex;
-  background-color: #f6f6f6;
-  border-radius: 15rpx;
-  padding: 30rpx 20rpx;
-  margin-top: 30rpx;
-}
-
-.photo-image {
-  height: 150rpx;
-  display: inline-block;
-  vertical-align: middle;
-  width: 150rpx;
-  border-radius: 15rpx;
-  line-height: 130rpx;
-  text-align: center;
-  font-size: 100rpx;
-  font-weight: 500;
-  color: #cfcfcf;
-  border: solid 1rpx #d0d0d0;
-  margin-top: 20rpx;
-
-}
-
-.photoList {
-  position: relative;
-  display: inline-block;
-  vertical-align: middle;
-  height: 150rpx;
-  width: 150rpx;
-  margin-top: 20rpx;
-  margin-right: 5rpx;
-}
-
-.cha-icon {
-  position: absolute;
-  right: 0;
-  bottom: 0;
-  color: #fff;
-  /* text-align: center; */
-  line-height:40rpx;
-  font-size: 400;
-  height:40rpx;
-  display: inline-block;
-  z-index: 999;
-  /* width: 40rpx; */
-  padding-left: 10rpx;
-  background-color: rgba(0, 0, 0, 0.7);
-}
-
-.photo-left {
-  flex: 1;
-}
-
-.photo-title {
-  color: #6f6f6f;
-  font-size: 30rpx;
-  font-weight: bold;
-}
-
-.photo-text {
-  color: #9f9f9f;
-  font-size: 24rpx;
-  margin-top: 20rpx;
-}
-
-.photo-right {
-  flex: 0 0 120rpx;
-  height: 120rpx;
-  background-color: bisque;
-}
-
-.problem-bt {
-  width: 70%;
-  margin: 0 auto;
-  background-color: var(--globleColor);
-   color: var(--fontColor);
-  text-align: center;
-  height: 100rpx;
-  line-height: 100rpx;
-  border-radius: 50rpx;
-  margin-top: 50rpx;
-  font-size: 34rpx;
+/* required by usingComponents */
+/* pages/breakdown/breakdown.wxss */
+page {
+  background-color: #f7f7f7;
+}
+
+.breakdown {
+  padding: 30rpx 40rpx;
+}
+
+.card_no {
+  background-color: #ffffff;
+  padding: 20rpx 30rpx;
+  border-radius: 15rpx;
+  display: flex;
+}
+
+.card-left {
+  flex: 1;
+  width: 200rpx;
+}
+
+.card-title {
+  font-size: 32rpx;
+  font-weight: bold;
+}
+
+.card-title1 {
+  font-size: 28rpx;
+  color: #999999;
+}
+
+.input-no {
+  margin-top: 10rpx;
+  font-size: 32rpx;
+  font-weight: bold;
+}
+
+.no-placeholder {
+  font-size: 28rpx;
+  color: #999999;
+  font-weight: bold;
+}
+
+
+.card-right {
+  flex: 0 0 230rpx;
+  width: 300rpx;
+  height: 90rpx;
+  color: #fff;
+  line-height: 90rpx;
+  text-align: center;
+  border-radius: 50rpx;
+  font-size: 32rpx;
+  font-weight: 600;
+  background-color: #1a1a1a;
+}
+
+.iconfont {
+  display: inline-block;
+  margin-right: 10rpx;
+}
+
+.problem {
+  margin-top: 20rpx;
+  background-color: #fff;
+  padding: 20rpx 0;
+  border-radius: 15rpx;
+}
+
+.problem-title {
+  font-size: 32rpx;
+  font-weight: bold;
+  padding: 0 30rpx;
+}
+
+.problem-bike {
+  height: 350rpx;
+  margin-top: 20rpx;
+  padding: 0 30rpx;
+}
+
+.item1 {
+  background-color: #fff;
+  text-align: center;
+}
+
+.item1 image {
+  width: 90%;
+  height: 250rpx;
+  margin: 0 auto;
+  margin-top: 50rpx;
+}
+
+.item2 {
+  background-color: rgb(228, 216, 49);
+}
+
+.option {
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: 30rpx;
+  text-align: center;
+}
+
+.option-item-left,
+.active {
+  flex: 0 0 40%;
+  width: 45%;
+  border: solid 1rpx #d0d0d0;
+  height: 60rpx;
+  line-height: 60rpx;
+  border-radius: 50rpx;
+  margin: 0 4%;
+  margin-bottom: 20rpx;
+  font-size: 26rpx;
+  color: #343434;
+}
+
+.active {
+  border: solid 1rpx var(--globleColor);
+  color: var(--globleColor);
+  background-color: var(--fillColor);
+}
+
+.input-problem {
+
+  margin: 20rpx 30rpx;
+  position: relative;
+}
+
+.input-problem textarea {
+  border: solid 1rpx #d0d0d0;
+  border-radius: 15rpx;
+  width: auto;
+  height: 150rpx;
+  padding: 10rpx 20rpx;
+  font-size: 26rpx;
+}
+
+.count {
+  position: absolute;
+  bottom: 14rpx;
+  right: 31rpx;
+  color: #999;
+  font-size: 24rpx;
+}
+
+.placeholder {
+  color: #818181;
+  font-size: 24rpx;
+}
+
+.bike-photo {
+  margin-top: 20rpx;
+  background-color: #fff;
+  border-radius: 15rpx;
+  padding: 20rpx 30rpx;
+}
+
+.photo {
+  display: flex;
+  background-color: #f6f6f6;
+  border-radius: 15rpx;
+  padding: 30rpx 20rpx;
+  margin-top: 30rpx;
+}
+
+.photo-image {
+  height: 150rpx;
+  display: inline-block;
+  vertical-align: middle;
+  width: 150rpx;
+  border-radius: 15rpx;
+  line-height: 130rpx;
+  text-align: center;
+  font-size: 100rpx;
+  font-weight: 500;
+  color: #cfcfcf;
+  border: solid 1rpx #d0d0d0;
+  margin-top: 20rpx;
+
+}
+
+.photoList {
+  position: relative;
+  display: inline-block;
+  vertical-align: middle;
+  height: 150rpx;
+  width: 150rpx;
+  margin-top: 20rpx;
+  margin-right: 5rpx;
+}
+
+.cha-icon {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  color: #fff;
+  /* text-align: center; */
+  line-height:40rpx;
+  font-size: 400;
+  height:40rpx;
+  display: inline-block;
+  z-index: 999;
+  /* width: 40rpx; */
+  padding-left: 10rpx;
+  background-color: rgba(0, 0, 0, 0.7);
+}
+
+.photo-left {
+  flex: 1;
+}
+
+.photo-title {
+  color: #6f6f6f;
+  font-size: 30rpx;
+  font-weight: bold;
+}
+
+.photo-text {
+  color: #9f9f9f;
+  font-size: 24rpx;
+  margin-top: 20rpx;
+}
+
+.photo-right {
+  flex: 0 0 120rpx;
+  height: 120rpx;
+  background-color: bisque;
+}
+
+.problem-bt {
+  width: 70%;
+  margin: 0 auto;
+  background-color: var(--globleColor);
+   color: var(--fontColor);
+  text-align: center;
+  height: 100rpx;
+  line-height: 100rpx;
+  border-radius: 50rpx;
+  margin-top: 50rpx;
+  font-size: 34rpx;
 }

+ 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" 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 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.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
-  })
-},
+// 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
+  })
+},
 })

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

@@ -1,536 +1,536 @@
-/* required by usingComponents */
-/* pages/buy-card/buy-card.wxss */
-page {
-  /* height: 100%; */
-  background: #f2f3f5;
-}
-
-.box {
-  /* width: 100%; */
-  /* height: 100%; */
-  /* display: flex;
-  flex-direction: column;
-  align-items: center; */
-  padding-bottom: 20rpx;
-}
-
-.card {
-  margin: 30rpx;
-}
-
-.card-list1 {
-  position: relative;
-  border: solid 5rpx #eceaea;
-  background-color: #fff;
-  padding: 30rpx;
-  /* background: #ffe98f;
-  border: solid 5rpx var(--globleColor); */
-  border-radius: 20rpx;
-
-}
-.active{
-  position: relative;
-  padding: 30rpx;
-  border-radius: 20rpx;
-  background: var(--fillColor);
-  border: solid 5rpx var(--globleColor);
-}
-
-.card-title {
-  font-size: 30rpx;
-  color: #333333;
-  font-weight: 500;
-}
-
-.card-tips {
-  font-size: 26rpx;
-  color: #7a7878;
-  margin-top: 10rpx;
-}
-
-.card-money {
-  font-size: 26rpx;
-  margin-top: 30rpx;
-
-}
-
-.money-num {
-  font-size: 50rpx;
-  font-weight: bold;
-}
-
-.yuanjia {
-  color: #442c2c6c;
-  display: inline-block;
-  margin-left: 10rpx;
-  text-decoration: line-through;
-}
-
-.card-list {
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: space-between;
-  flex-direction: row;
-}
-.card-content{
-  margin:30rpx;
-}
-.card-list-item {
-  position: relative;
-  flex: 0 0 45%;
-  border: solid 5rpx #eceaea;
-  padding: 20rpx 0;
-  border-radius: 30rpx;
-  background-color: #fff;
-  margin-top: 30rpx;
-}
-.active1{
-  position: relative;
-  flex: 0 0 45%;
-  padding: 20rpx 0;
-  border-radius: 30rpx;
-  margin-top: 30rpx;
-  background: var(--fillColor);
-  border: solid 5rpx var(--globleColor);
-}
-.right-tips{
-  position: absolute;
-  height:40rpx;
-  padding: 0 30rpx;
-  font-size: 22rpx;
-  line-height: 40rpx;
-  color: #ffffff;
-  font-weight: bold;
-  background-color:rgb(235, 58, 4);
-  border-radius: 0 20rpx ;
-  top: 0;
-  right: 0;
-}
-.item-money{
-  margin-top: 10rpx;
-}
-.buy-buttom{
-height: 100rpx;
-width: 80%;
-margin: 0 auto;
-margin-top: 50rpx;
-background-color: var(--globleColor);
-text-align: center;
-border-radius:50rpx;
-line-height: 100rpx;
-font-size: 32rpx;
-font-weight: bold;
- color: var(--fontColor);
-}
-.box .top {
-  width: 92%;
-  display: flex;
-  flex-direction: column;
-  font-size: 28rpx;
-  color: darkgray;
-  margin:0 30rpx;
-}
-
-.box .top text:nth-of-type(1) {
-  font-size: 48rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: rgba(42, 42, 42, 1);
-  padding: 50rpx 0rpx 30rpx 0rpx;
-}
-
-.box .top text:nth-of-type(2) {
-  font-size: 32rpx;
-  font-family: PingFang SC;
-  font-weight: 400;
-  color: rgba(153, 153, 153, 1);
-  padding-bottom: 6rpx;
-}
-
-.box .hot {
-  /* padding-top: ; */
-  width: 690rpx;
-  padding: 30rpx 0;
-  /* height:296rpx; */
-  background: rgba(255, 255, 255, 1);
-  border-radius: 20rpx;
-  background-size: 100% 100%;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  box-sizing: border-box;
-  padding-left: 47rpx;
-  margin-top: 30rpx;
-}
-
-.box .hot .title {
-  font-size: 38rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: rgba(42, 42, 42, 1);
-}
-
-.box .hot .frequency {
-  font-size: 32rpx;
-  font-family: PingFang SC;
-  color: rgba(153, 153, 153, 1);
-}
-
-.box .hot .info {
-  display: flex;
-  align-items: flex-end;
-  padding: 19rpx 0rpx;
-}
-
-.box .hot .info text:nth-of-type(1) {
-  font-size: 46rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: rgba(42, 42, 42, 1);
-}
-
-.box .hot .info text:nth-of-type(2) {
-  font-size: 26rpx;
-  font-family: PingFang SC;
-  color: rgba(153, 153, 153, 1);
-  padding-left: 19rpx;
-  padding-bottom: 6rpx;
-  text-decoration: line-through;
-}
-
-.box .hot .buy {
-  width: 160rpx;
-  height: 70rpx;
-  margin-bottom: 20rpx;
-  background: #5E5D5D;
-  /* background:var(--globleColor); */
-  border-radius: 40rpx;
-  display: flex;
-  /* margin-left: 20rpx; */
-  align-items: center;
-  justify-content: center;
-  font-size: 32rpx;
-  font-family: PingFang SC;
-  color: rgba(255, 255, 255, 1);
-}
-
-.box .hot .info .buy text {
-  font-size: 26rpx;
-  color: #ffffff;
-}
-
-
-.list {
-  display: flex;
-  flex-direction: column;
-  margin-top: 10rpx;
-}
-
-.tip text {
-  /* width: 100rpx; */
-  display: inline-block;
-  padding: 0 5rpx;
-  font-size: 22rpx;
-  border: solid 1rpx rgba(153, 153, 153, 1);
-  color: rgba(153, 153, 153, 1);
-  border-radius: 8rpx;
-}
-
-.list .view {
-  padding: 30rpx 0;
-  width: 690rpx;
-  /* height:206rpx; */
-  background: rgba(255, 255, 255, 1);
-  border-radius: 20rpx;
-  margin-top: 20rpx;
-  position: relative;
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-  box-sizing: border-box;
-  padding-left: 48rpx;
-}
-
-.list .view .text {
-  font-size: 32rpx;
-  font-family: PingFang SC;
-  color: rgba(94, 93, 93, 1);
-  padding-bottom: 20rpx;
-}
-
-.list .view .money {
-  display: flex;
-  align-items: flex-end;
-}
-
-.list .view .money text:nth-of-type(1) {
-  font-size: 46rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: rgba(42, 42, 42, 1);
-}
-
-.list .view .money text:nth-of-type(2) {
-  font-size: 26rpx;
-  font-family: PingFang SC;
-  color: rgba(153, 153, 153, 1);
-  padding-left: 34rpx;
-  padding-bottom: 6rpx;
-  text-decoration: line-through;
-}
-
-.list .view .buy {
-  width: 140rpx;
-  height: 50rpx;
-  background: #5E5D5D;
-  border-radius: 40rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 26rpx;
-  font-family: PingFang SC;
-  color: rgba(255, 255, 255, 1);
-  position: absolute;
-  top: 88rpx;
-  right: 20rpx;
-}
-
-.list .view .position {
-  width: 186rpx;
-  height: 42rpx;
-  background: rgba(24, 213, 185, 1);
-  border-radius: 0px 20rpx 0px 39rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 26rpx;
-  font-family: PingFang SC;
-  color: rgba(255, 255, 255, 1);
-  position: absolute;
-  top: 0rpx;
-  right: 0rpx;
-}
-
-.box .btn {
-  width: 100%;
-  height: 160rpx;
-  background: rgba(255, 255, 255, 1);
-  box-shadow: 0px 0px 52rpx 0px rgba(210, 210, 210, 1);
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  position: fixed;
-  bottom: 0rpx;
-  left: 0rpx;
-}
-
-.btn .money {
-  display: flex;
-  align-items: flex-end;
-  margin-left: 30rpx;
-}
-
-.btn .money text:nth-of-type(1) {
-  font-size: 60rpx;
-  font-family: PingFang SC;
-  font-weight: 800;
-  color: rgba(42, 42, 42, 1);
-}
-
-.btn .money text:nth-of-type(2) {
-  font-size: 30rpx;
-  font-family: PingFang-SC-Medium;
-  font-weight: Medium;
-  color: #2A2A2A;
-  padding-left: 20rpx;
-  padding-bottom: 6rpx;
-}
-
-.btn .form {
-  width: 214rpx;
-  height: 70rpx;
-  background: rgba(24, 213, 185, 1);
-  border-radius: 35rpx 35rpx 35rpx 35rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 36rpx;
-  font-family: PingFang SC;
-  color: rgba(255, 255, 255, 1);
-  margin-right: 30rpx;
-}
-
-.box .rule {
-  width: 92%;
-  display: flex;
-  flex-direction: column;
-}
-
-.rule .title {
-  font-size: 46rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: rgba(42, 42, 42, 1);
-  padding: 106rpx 0rpx 46rpx 0rpx;
-}
-
-.rule view {
-  display: flex;
-  flex-direction: column;
-  height: 548rpx;
-  justify-content: space-between;
-  padding-bottom: 66rpx;
-}
-
-.rule view text {
-  font-size: 28rpx;
-  font-family: PingFang-SC-Regular;
-  font-weight: Regular;
-  color: #5E5D5D;
-}
-
-.background {
-  width: 100%;
-  height: 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: #000000;
-  opacity: .6;
-  z-index: 88;
-}
-
-.model {
-  width: 100%;
-  height: 62%;
-  position: fixed;
-  left: 0;
-  bottom: 0;
-  z-index: 99;
-  background: white;
-}
-
-.model .view {
-  width: 100%;
-  height: 100%;
-  position: relative;
-  padding-top: 80rpx;
-  padding-bottom: 120rpx;
-  box-sizing: border-box;
-}
-
-.model .view .title {
-  position: absolute;
-  top: 0rpx;
-  height: 80rpx;
-  line-height: 80rpx;
-  text-align: center;
-  width: 100%;
-  border-bottom: 2rpx solid #F4F4F4;
-  z-index: 99;
-}
-
-.model .view .btn1 {
-  position: absolute;
-  bottom: 0rpx;
-  width: 100%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  height: 120rpx;
-  background: #F4F4F4;
-  z-index: 99;
-}
-
-.model .view .btn1 text {
-  width: 80%;
-  height: 80rpx;
-  line-height: 80rpx;
-  text-align: center;
-  color: white;
-  font-size: 28rpx;
-  background:var(--globleColor);
-  border-radius: 40rpx;
-   color: var(--fontColor);
-}
-
-.model .view .content {
-  height: 100%;
-  overflow-y: scroll;
-  display: flex;
-  flex-direction: column;
-  width: 95%;
-  margin: 0 auto;
-}
-
-.model .view .content text {
-  padding-top: 20rpx;
-  font-size: 26rpx;
-}
-
-.model .view .content .title1 {
-  font-size: 30rpx;
-  font-weight: 800;
-}
-
-.model .view .content .count_a {
-  display: flex;
-  align-items: center;
-}
-
-.model .view .content .count_a text:nth-of-type(1) {
-  font-size: 32rpx;
-  font-weight: 800;
-}
-
-.model .view .content .count_a text:nth-of-type(2) {
-  font-size: 26rpx;
-  color: #5E5D5D;
-  padding-left: 14rpx;
-}
-
-.model .view .content .count_b {
-  display: flex;
-  align-items: flex-end;
-}
-
-.model .view .content .count_b text:nth-of-type(1) {
-  font-size: 34rpx;
-  font-weight: 800;
-  color: red;
-}
-
-.model .view .content .count_b text:nth-of-type(2) {
-  font-size: 26rpx;
-  padding-left: 10rpx;
-  text-decoration: line-through;
-}
-
-.over1 {
-  position: fixed;
-  top: 39%;
-  right: 5%;
-  z-index: 99;
-}
-
-.none {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  width: 100%;
-  padding-top: 30%;
-  height: 90%;
-}
-
-.none image {
-  height: 200rpx;
-  width: 200rpx;
-}
-
-.none text {
-  /* padding-right: 70rpx; */
-  padding-top: 50rpx;
+/* required by usingComponents */
+/* pages/buy-card/buy-card.wxss */
+page {
+  /* height: 100%; */
+  background: #f2f3f5;
+}
+
+.box {
+  /* width: 100%; */
+  /* height: 100%; */
+  /* display: flex;
+  flex-direction: column;
+  align-items: center; */
+  padding-bottom: 20rpx;
+}
+
+.card {
+  margin: 30rpx;
+}
+
+.card-list1 {
+  position: relative;
+  border: solid 5rpx #eceaea;
+  background-color: #fff;
+  padding: 30rpx;
+  /* background: #ffe98f;
+  border: solid 5rpx var(--globleColor); */
+  border-radius: 20rpx;
+
+}
+.active{
+  position: relative;
+  padding: 30rpx;
+  border-radius: 20rpx;
+  background: var(--fillColor);
+  border: solid 5rpx var(--globleColor);
+}
+
+.card-title {
+  font-size: 30rpx;
+  color: #333333;
+  font-weight: 500;
+}
+
+.card-tips {
+  font-size: 26rpx;
+  color: #7a7878;
+  margin-top: 10rpx;
+}
+
+.card-money {
+  font-size: 26rpx;
+  margin-top: 30rpx;
+
+}
+
+.money-num {
+  font-size: 50rpx;
+  font-weight: bold;
+}
+
+.yuanjia {
+  color: #442c2c6c;
+  display: inline-block;
+  margin-left: 10rpx;
+  text-decoration: line-through;
+}
+
+.card-list {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+  flex-direction: row;
+}
+.card-content{
+  margin:30rpx;
+}
+.card-list-item {
+  position: relative;
+  flex: 0 0 45%;
+  border: solid 5rpx #eceaea;
+  padding: 20rpx 0;
+  border-radius: 30rpx;
+  background-color: #fff;
+  margin-top: 30rpx;
+}
+.active1{
+  position: relative;
+  flex: 0 0 45%;
+  padding: 20rpx 0;
+  border-radius: 30rpx;
+  margin-top: 30rpx;
+  background: var(--fillColor);
+  border: solid 5rpx var(--globleColor);
+}
+.right-tips{
+  position: absolute;
+  height:40rpx;
+  padding: 0 30rpx;
+  font-size: 22rpx;
+  line-height: 40rpx;
+  color: #ffffff;
+  font-weight: bold;
+  background-color:rgb(235, 58, 4);
+  border-radius: 0 20rpx ;
+  top: 0;
+  right: 0;
+}
+.item-money{
+  margin-top: 10rpx;
+}
+.buy-buttom{
+height: 100rpx;
+width: 80%;
+margin: 0 auto;
+margin-top: 50rpx;
+background-color: var(--globleColor);
+text-align: center;
+border-radius:50rpx;
+line-height: 100rpx;
+font-size: 32rpx;
+font-weight: bold;
+ color: var(--fontColor);
+}
+.box .top {
+  width: 92%;
+  display: flex;
+  flex-direction: column;
+  font-size: 28rpx;
+  color: darkgray;
+  margin:0 30rpx;
+}
+
+.box .top text:nth-of-type(1) {
+  font-size: 48rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: rgba(42, 42, 42, 1);
+  padding: 50rpx 0rpx 30rpx 0rpx;
+}
+
+.box .top text:nth-of-type(2) {
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  font-weight: 400;
+  color: rgba(153, 153, 153, 1);
+  padding-bottom: 6rpx;
+}
+
+.box .hot {
+  /* padding-top: ; */
+  width: 690rpx;
+  padding: 30rpx 0;
+  /* height:296rpx; */
+  background: rgba(255, 255, 255, 1);
+  border-radius: 20rpx;
+  background-size: 100% 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  box-sizing: border-box;
+  padding-left: 47rpx;
+  margin-top: 30rpx;
+}
+
+.box .hot .title {
+  font-size: 38rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: rgba(42, 42, 42, 1);
+}
+
+.box .hot .frequency {
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  color: rgba(153, 153, 153, 1);
+}
+
+.box .hot .info {
+  display: flex;
+  align-items: flex-end;
+  padding: 19rpx 0rpx;
+}
+
+.box .hot .info text:nth-of-type(1) {
+  font-size: 46rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: rgba(42, 42, 42, 1);
+}
+
+.box .hot .info text:nth-of-type(2) {
+  font-size: 26rpx;
+  font-family: PingFang SC;
+  color: rgba(153, 153, 153, 1);
+  padding-left: 19rpx;
+  padding-bottom: 6rpx;
+  text-decoration: line-through;
+}
+
+.box .hot .buy {
+  width: 160rpx;
+  height: 70rpx;
+  margin-bottom: 20rpx;
+  background: #5E5D5D;
+  /* background:var(--globleColor); */
+  border-radius: 40rpx;
+  display: flex;
+  /* margin-left: 20rpx; */
+  align-items: center;
+  justify-content: center;
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  color: rgba(255, 255, 255, 1);
+}
+
+.box .hot .info .buy text {
+  font-size: 26rpx;
+  color: #ffffff;
+}
+
+
+.list {
+  display: flex;
+  flex-direction: column;
+  margin-top: 10rpx;
+}
+
+.tip text {
+  /* width: 100rpx; */
+  display: inline-block;
+  padding: 0 5rpx;
+  font-size: 22rpx;
+  border: solid 1rpx rgba(153, 153, 153, 1);
+  color: rgba(153, 153, 153, 1);
+  border-radius: 8rpx;
+}
+
+.list .view {
+  padding: 30rpx 0;
+  width: 690rpx;
+  /* height:206rpx; */
+  background: rgba(255, 255, 255, 1);
+  border-radius: 20rpx;
+  margin-top: 20rpx;
+  position: relative;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  box-sizing: border-box;
+  padding-left: 48rpx;
+}
+
+.list .view .text {
+  font-size: 32rpx;
+  font-family: PingFang SC;
+  color: rgba(94, 93, 93, 1);
+  padding-bottom: 20rpx;
+}
+
+.list .view .money {
+  display: flex;
+  align-items: flex-end;
+}
+
+.list .view .money text:nth-of-type(1) {
+  font-size: 46rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: rgba(42, 42, 42, 1);
+}
+
+.list .view .money text:nth-of-type(2) {
+  font-size: 26rpx;
+  font-family: PingFang SC;
+  color: rgba(153, 153, 153, 1);
+  padding-left: 34rpx;
+  padding-bottom: 6rpx;
+  text-decoration: line-through;
+}
+
+.list .view .buy {
+  width: 140rpx;
+  height: 50rpx;
+  background: #5E5D5D;
+  border-radius: 40rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 26rpx;
+  font-family: PingFang SC;
+  color: rgba(255, 255, 255, 1);
+  position: absolute;
+  top: 88rpx;
+  right: 20rpx;
+}
+
+.list .view .position {
+  width: 186rpx;
+  height: 42rpx;
+  background: rgba(24, 213, 185, 1);
+  border-radius: 0px 20rpx 0px 39rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 26rpx;
+  font-family: PingFang SC;
+  color: rgba(255, 255, 255, 1);
+  position: absolute;
+  top: 0rpx;
+  right: 0rpx;
+}
+
+.box .btn {
+  width: 100%;
+  height: 160rpx;
+  background: rgba(255, 255, 255, 1);
+  box-shadow: 0px 0px 52rpx 0px rgba(210, 210, 210, 1);
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  position: fixed;
+  bottom: 0rpx;
+  left: 0rpx;
+}
+
+.btn .money {
+  display: flex;
+  align-items: flex-end;
+  margin-left: 30rpx;
+}
+
+.btn .money text:nth-of-type(1) {
+  font-size: 60rpx;
+  font-family: PingFang SC;
+  font-weight: 800;
+  color: rgba(42, 42, 42, 1);
+}
+
+.btn .money text:nth-of-type(2) {
+  font-size: 30rpx;
+  font-family: PingFang-SC-Medium;
+  font-weight: Medium;
+  color: #2A2A2A;
+  padding-left: 20rpx;
+  padding-bottom: 6rpx;
+}
+
+.btn .form {
+  width: 214rpx;
+  height: 70rpx;
+  background: rgba(24, 213, 185, 1);
+  border-radius: 35rpx 35rpx 35rpx 35rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 36rpx;
+  font-family: PingFang SC;
+  color: rgba(255, 255, 255, 1);
+  margin-right: 30rpx;
+}
+
+.box .rule {
+  width: 92%;
+  display: flex;
+  flex-direction: column;
+}
+
+.rule .title {
+  font-size: 46rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: rgba(42, 42, 42, 1);
+  padding: 106rpx 0rpx 46rpx 0rpx;
+}
+
+.rule view {
+  display: flex;
+  flex-direction: column;
+  height: 548rpx;
+  justify-content: space-between;
+  padding-bottom: 66rpx;
+}
+
+.rule view text {
+  font-size: 28rpx;
+  font-family: PingFang-SC-Regular;
+  font-weight: Regular;
+  color: #5E5D5D;
+}
+
+.background {
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: #000000;
+  opacity: .6;
+  z-index: 88;
+}
+
+.model {
+  width: 100%;
+  height: 62%;
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  z-index: 99;
+  background: white;
+}
+
+.model .view {
+  width: 100%;
+  height: 100%;
+  position: relative;
+  padding-top: 80rpx;
+  padding-bottom: 120rpx;
+  box-sizing: border-box;
+}
+
+.model .view .title {
+  position: absolute;
+  top: 0rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  width: 100%;
+  border-bottom: 2rpx solid #F4F4F4;
+  z-index: 99;
+}
+
+.model .view .btn1 {
+  position: absolute;
+  bottom: 0rpx;
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 120rpx;
+  background: #F4F4F4;
+  z-index: 99;
+}
+
+.model .view .btn1 text {
+  width: 80%;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  color: white;
+  font-size: 28rpx;
+  background:var(--globleColor);
+  border-radius: 40rpx;
+   color: var(--fontColor);
+}
+
+.model .view .content {
+  height: 100%;
+  overflow-y: scroll;
+  display: flex;
+  flex-direction: column;
+  width: 95%;
+  margin: 0 auto;
+}
+
+.model .view .content text {
+  padding-top: 20rpx;
+  font-size: 26rpx;
+}
+
+.model .view .content .title1 {
+  font-size: 30rpx;
+  font-weight: 800;
+}
+
+.model .view .content .count_a {
+  display: flex;
+  align-items: center;
+}
+
+.model .view .content .count_a text:nth-of-type(1) {
+  font-size: 32rpx;
+  font-weight: 800;
+}
+
+.model .view .content .count_a text:nth-of-type(2) {
+  font-size: 26rpx;
+  color: #5E5D5D;
+  padding-left: 14rpx;
+}
+
+.model .view .content .count_b {
+  display: flex;
+  align-items: flex-end;
+}
+
+.model .view .content .count_b text:nth-of-type(1) {
+  font-size: 34rpx;
+  font-weight: 800;
+  color: red;
+}
+
+.model .view .content .count_b text:nth-of-type(2) {
+  font-size: 26rpx;
+  padding-left: 10rpx;
+  text-decoration: line-through;
+}
+
+.over1 {
+  position: fixed;
+  top: 39%;
+  right: 5%;
+  z-index: 99;
+}
+
+.none {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  padding-top: 30%;
+  height: 90%;
+}
+
+.none image {
+  height: 200rpx;
+  width: 200rpx;
+}
+
+.none text {
+  /* padding-right: 70rpx; */
+  padding-top: 50rpx;
 }

+ 6 - 9
pages/buy-card/buy-card.axml

@@ -54,16 +54,13 @@
           </view>
         </view>
         <text class="title1">使用规则</text>
-        <text>1.电单车骑行卡适用城市范围以卡面标注城市为准,所购买或领取骑行卡标注城市中的特殊区域<text style="color:red;">(如封闭园区、景区等)</text>骑行卡不适用。</text>
-        <text>2.当前无骑行卡,用户购买或领取电单车骑行卡后,对应<text
-            style="color:red;">骑行卡的优惠权益立即生效</text>,购卡当天产生的未支付骑行订单可使用,但需在电单车骑行卡生效期内使用。</text>
-        <text>3.骑行卡无法抵扣因<text style="color:red;">不在运营区域或还车点还车时产生的调度费用</text>,请确保规范骑行。</text>
-        <text>4.请在有效期内使用,骑行卡<text style="color:red;">使用完毕或超出有效期</text>即视为无效。</text>
-        <text>5.电单车骑行卡生效期间,每次骑行最多可抵扣<text
+         <text>1.用户购买电单车骑行卡后,对应<text style="color:red;">骑行卡的优惠权益立即生效</text>。</text>
+        <text>2.骑行卡<text style="color:red;">无法抵扣订单调度费</text>。</text>
+        <text>3.请在有效期内使用,骑行卡<text style="color:red;">使用完毕或超出有效期</text>即视为无效。</text>
+        <text>4.电单车骑行卡生效期间,每次骑行最多可抵扣<text
             style="color:red;">{{infoDetail.deduction_money}}</text>元骑行费用,超出部分依据计费规则计费。</text>
-        <text>6.如当前已有次卡或月卡,需等当前拥有的卡<text style="color:red;">过期后才能</text>购买次卡。</text>
-        <text>7.骑行卡获得后<text style="color:red;">立即生效</text>,一旦购买,不退还购买费用,不能转赠。</text>
-        <text style="padding-bottom:20rpx;">8.骑行卡只适用于<text style="color:red;">分时租赁</text>,不支持日租用车使用。</text>
+        <text>5.骑行卡<text style="color:red;">一旦购买,不能退还,不能转赠</text>。</text>
+        <text style="padding-bottom:20rpx;">6.骑行卡只适用于<text style="color:red;">分时租赁</text>,不支持日租用车使用。</text>
       </view>
       <view class="btn1" onTap="form">
         <text>{{infoDetail.now_price}}元购买</text>

+ 175 - 173
pages/buy-card/buy-card.js

@@ -1,174 +1,176 @@
-var app = getApp();
-const util = require('../../utils/utils.js');
-Page({
-  data: {
-    hot: false,
-    index1: null,
-    money: '',
-    arr: [],
-    info: false,
-    id: '',
-    no: '',
-    infoDetail: [],
-    hotInfo: [],
-    img: app.globalData.imgUrl,
-    currentCard: 1
-  },
-  onLoad: function (options) {
-    var that = this;
-    var area_id = ''
-    my.showLoading({
-      content: '加载中...',
-    })
-    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/index", data, "GET").then(res => {
-      console.log(res)
-      my.hideLoading()
-      if (res.data.data == '') {
-        return;
-      }
-      var arr1 = res.data.data.shift()
-      console.log(arr1)
-      console.log(res.data.data)
-      that.setData({
-        hotInfo: arr1,
-        arr: res.data.data,
-        hot: true
-      })
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  background: function () {
-    this.setData({
-      info: false
-    })
-  },
-  buy: function (e) {
-    var id = e.currentTarget.dataset.id;
-    var index = e.currentTarget.dataset.index;
-    var arr = this.data.arr;
-    this.setData({
-      id,
-      info: true,
-      infoDetail: arr[index]
-    })
-  },
-  buy1: function () {
-    this.setData({
-      id: this.data.hotInfo.id,
-      info: true,
-      infoDetail: this.data.hotInfo
-    })
-  },
-  form: util.throttle(function () {
-    var that = this;
-    that.setData({
-      info: false
-    })
-    var area_id = ''
-    if (my.getStorageSync({ 'key': 'home' }).data) {
-      area_id = my.getStorageSync({ 'key': 'home' }).data.id
-    } else {
-      my.showToast({
-        content: '当前地区暂无运营区域',
-        icon: 'none'
-      })
-      return;
-    }
-    if (app.globalData.req) {
-      var data = {
-        'card_riding_id': that.data.id,
-        'area_id': area_id
-      }
-      app.request("/card_riding/pay", data, "POST", app.globalData.req).then(res => {
-        console.log(res, '------')
-        if (res.status == 200) {
-          that.setData({
-            no: res.data.no
-          })
-          my.tradePay({
-            tradeNO: res.data.tradeNo,
-            success: function (res) {
-              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)
-              // my.showToast({
-              //   content: '支付失败',
-              //   icon: 'none'
-              // })
-              // var data = {
-              //   no: that.data.no
-              // }
-              // app.request("/card_riding/no_pay", data, "POST").then(res => {
-              //   console.log(res)
-              // })
-            }
-          })
-        }
-      })
-    } else {
-      my.showToast({
-        content: '您的操作过于频繁,请稍后再试~',
-        icon: 'none'
-      })
-    }
-
-  }, 1000),
-  //选择卡
-  changeCard: function (e) {
-    console.log(e.currentTarget.dataset.id.id)
-    this.setData({
-      id: e.currentTarget.dataset.id.id,
-      // info: true,
-      infoDetail: e.currentTarget.dataset.id,
-      currentCard: e.currentTarget.dataset.id.id
-    }
-    )
-  },
-  buyButtom: function () {
-    this.setData({
-      info: true,
-    })
-  },
-  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: {
+    hot: false,
+    index1: null,
+    money: '',
+    arr: [],
+    info: false,
+    id: '',
+    no: '',
+    infoDetail: [],
+    hotInfo: [],
+    img: app.globalData.imgUrl,
+    currentCard: 1
+  },
+  onLoad: function (options) {
+    var that = this;
+    var area_id = ''
+    my.showLoading({
+      content: '加载中...',
+    })
+    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/index", data, "GET").then(res => {
+      console.log(res)
+      my.hideLoading()
+      if (res.data.data == '') {
+        return;
+      }
+      var arr1 = res.data.data.shift()
+      console.log(arr1)
+      console.log(res.data.data)
+      that.setData({
+        hotInfo: arr1,
+        arr: res.data.data,
+        hot: true,
+        infoDetail: arr1,
+        id:arr1.id
+      })
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  background: function () {
+    this.setData({
+      info: false
+    })
+  },
+  buy: function (e) {
+    var id = e.currentTarget.dataset.id;
+    var index = e.currentTarget.dataset.index;
+    var arr = this.data.arr;
+    this.setData({
+      id,
+      info: true,
+      infoDetail: arr[index]
+    })
+  },
+  buy1: function () {
+    this.setData({
+      id: this.data.hotInfo.id,
+      info: true,
+      infoDetail: this.data.hotInfo
+    })
+  },
+  form: util.throttle(function () {
+    var that = this;
+    that.setData({
+      info: false
+    })
+    var area_id = ''
+    if (my.getStorageSync({ 'key': 'home' }).data) {
+      area_id = my.getStorageSync({ 'key': 'home' }).data.id
+    } else {
+      my.showToast({
+        content: '当前地区暂无运营区域',
+        icon: 'none'
+      })
+      return;
+    }
+    if (app.globalData.req) {
+      var data = {
+        'card_riding_id': that.data.id,
+        'area_id': area_id
+      }
+      app.request("/card_riding/pay", data, "POST", app.globalData.req).then(res => {
+        console.log(res, '------')
+        if (res.status == 200) {
+          that.setData({
+            no: res.data.no
+          })
+          my.tradePay({
+            tradeNO: res.data.tradeNo,
+            success: function (res) {
+              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)
+              // my.showToast({
+              //   content: '支付失败',
+              //   icon: 'none'
+              // })
+              // var data = {
+              //   no: that.data.no
+              // }
+              // app.request("/card_riding/no_pay", data, "POST").then(res => {
+              //   console.log(res)
+              // })
+            }
+          })
+        }
+      })
+    } else {
+      my.showToast({
+        content: '您的操作过于频繁,请稍后再试~',
+        icon: 'none'
+      })
+    }
+
+  }, 1000),
+  //选择卡
+  changeCard: function (e) {
+    console.log(e.currentTarget.dataset.id.id)
+    this.setData({
+      id: e.currentTarget.dataset.id.id,
+      // info: true,
+      infoDetail: e.currentTarget.dataset.id,
+      currentCard: e.currentTarget.dataset.id.id
+    }
+    )
+  },
+  buyButtom: function () {
+    this.setData({
+      info: true,
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 83 - 83
pages/change_mobile/change_mobile.acss

@@ -1,84 +1,84 @@
-/* required by usingComponents */
-/* pages/change_mobile/change_mobile.wxss */
-/* pages/mine_data/mine_data.wxss */
-page {
-  background-color: #f2f3f5;
-}
-
-.mine-data {
-  margin-top: 20rpx;
-}
-
-.mine-data-list {
-  background-color: #fff;
-  padding: 0 40rpx;
-}
-
-.list-item {
-  /* height: 100rpx; */
-  /* line-height: 100rpx; */
-  font-size: 28rpx;
-  border-bottom: solid 1rpx #e5e5e5;
-  position: relative;
-}
-
-.wxlogin{
-  position: absolute;
-  right: 0;
-  top:20rpx;
-  width: 200rpx!important;
-  font-size: 28rpx!important;
-  /* padding:10rpx 0rpx!important; */
-  z-index: 999;
-  /* margin-top: 10rpx; */
-  background-color: var(--globleColor);
-  color: var(--fontColor);
-}
-
-
-.list-item:last-child {
-  border: none;
-  display: flex;
-}
-
-.new-phone {
-  height: 100rpx;
-  line-height: 100rpx;
-  /* background-color: rosybrown; */
-}
-
-.code {
-  flex: 0 0 70%;
-  height: 100rpx;
-  /* line-height:20rpx; */
-
-}
-
-.get-yanzheng {
-  flex: 1;
-  text-align: center;
-  border-left: solid 1rpx #999999;
-  height: 30rpx;
-  line-height: 30rpx;
-  font-size: 26rpx;
-  color: #999999;
-  margin-top: 35rpx;
-}
-.no-num{
-  font-size: 28rpx;
-  color: #d8d5d5;
-
-}
-.change{
-  height: 70rpx;
-  width: 200rpx;
-  line-height: 70rpx;
-  margin: 0 auto;
-  text-align: center;
-  background-color: var(--globleColor);
-   color: var(--fontColor);
-  border-radius: 40rpx;
-  font-size: 28rpx;
-  font-weight: 500;
-  margin-top: 100rpx;
+/* required by usingComponents */
+/* pages/change_mobile/change_mobile.wxss */
+/* pages/mine_data/mine_data.wxss */
+page {
+  background-color: #f2f3f5;
+}
+
+.mine-data {
+  margin-top: 20rpx;
+}
+
+.mine-data-list {
+  background-color: #fff;
+  padding: 0 40rpx;
+}
+
+.list-item {
+  /* height: 100rpx; */
+  /* line-height: 100rpx; */
+  font-size: 28rpx;
+  border-bottom: solid 1rpx #e5e5e5;
+  position: relative;
+}
+
+.wxlogin{
+  position: absolute;
+  right: 0;
+  top:20rpx;
+  width: 200rpx!important;
+  font-size: 28rpx!important;
+  /* padding:10rpx 0rpx!important; */
+  z-index: 999;
+  /* margin-top: 10rpx; */
+  background-color: var(--globleColor);
+  color: var(--fontColor);
+}
+
+
+.list-item:last-child {
+  border: none;
+  display: flex;
+}
+
+.new-phone {
+  height: 100rpx;
+  line-height: 100rpx;
+  /* background-color: rosybrown; */
+}
+
+.code {
+  flex: 0 0 70%;
+  height: 100rpx;
+  /* line-height:20rpx; */
+
+}
+
+.get-yanzheng {
+  flex: 1;
+  text-align: center;
+  border-left: solid 1rpx #999999;
+  height: 30rpx;
+  line-height: 30rpx;
+  font-size: 26rpx;
+  color: #999999;
+  margin-top: 35rpx;
+}
+.no-num{
+  font-size: 28rpx;
+  color: #d8d5d5;
+
+}
+.change{
+  height: 70rpx;
+  width: 200rpx;
+  line-height: 70rpx;
+  margin: 0 auto;
+  text-align: center;
+  background-color: var(--globleColor);
+   color: var(--fontColor);
+  border-radius: 40rpx;
+  font-size: 28rpx;
+  font-weight: 500;
+  margin-top: 100rpx;
 }

+ 15 - 15
pages/change_mobile/change_mobile.axml

@@ -1,16 +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" 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 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 - 208
pages/change_mobile/change_mobile.js

@@ -1,209 +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'
-            })
-
-          }
-
-        }).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 () {
-
-  },
-
+// 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 () {
+
+  },
+
 })

+ 56 - 56
pages/charge_rule/charge_rule.acss

@@ -1,57 +1,57 @@
-/* required by usingComponents */
-/* pages/charge_rule/charge_rule.wxss */
-page{
-  background: #ffffff;
-}
-.box {
-  /* width: 100%; */
-  display: flex;
-  flex-direction: column;
-  /* align-items: center; */
-  padding: 0 50rpx;
-}
-
-.tip {
-  font-size: 30rpx;
-  text-align: center;
-  color: #A3A3A3;
-  margin: 50rpx 0;
-}
-
-.rules-title {
-  font-size: 34rpx;
-  font-weight: 600;
-  display: flex;
-  margin: 30rpx 0;
-}
-
-.rules-title .left {
-  flex: 1;
-}
-
-.rules-title .right {
-  flex: 1;
-  text-align: right;
-
-}
-
-.rules-text {
-  font-size: 28rpx;
-  color: #A3A3A3;
-  line-height: 40rpx;
-  margin-bottom: 30rpx;
-}
-.row{
-  padding: 5rpx 0;
-}
-.row .rl{
-  width: 70%;
-  display: inline-block;
-  color: #555;
-}
-.row .rr{
-  width: 30%;
-  text-align: right;
-  display: inline-block;
-  color: #555;
+/* required by usingComponents */
+/* pages/charge_rule/charge_rule.wxss */
+page{
+  background: #ffffff;
+}
+.box {
+  /* width: 100%; */
+  display: flex;
+  flex-direction: column;
+  /* align-items: center; */
+  padding: 0 50rpx;
+}
+
+.tip {
+  font-size: 30rpx;
+  text-align: center;
+  color: #A3A3A3;
+  margin: 50rpx 0;
+}
+
+.rules-title {
+  font-size: 34rpx;
+  font-weight: 600;
+  display: flex;
+  margin: 30rpx 0;
+}
+
+.rules-title .left {
+  flex: 1;
+}
+
+.rules-title .right {
+  flex: 1;
+  text-align: right;
+
+}
+
+.rules-text {
+  font-size: 28rpx;
+  color: #A3A3A3;
+  line-height: 40rpx;
+  margin-bottom: 30rpx;
+}
+.row{
+  padding: 5rpx 0;
+}
+.row .rl{
+  width: 70%;
+  display: inline-block;
+  color: #555;
+}
+.row .rr{
+  width: 30%;
+  text-align: right;
+  display: inline-block;
+  color: #555;
 }

+ 46 - 46
pages/charge_rule/charge_rule.axml

@@ -1,47 +1,47 @@
-<view class="box">
-  <view class="tip">———
-    <text style="color:#333333">{{setting ? homeName : '--'}}</text>———</view>
-  <view a:if="{{setting.is_deposit}}">
-    <view class="rules-title">
-      <view class="left">骑行押金</view>
-      <view class="right">{{setting ? setting.deposit : '--'}}元</view>
-    </view>
-    <view class="rules-text">押金随时可退</view>
-  </view>
-  <view>
-    <view class="rules-title">
-      <view class="left">时长费</view>
-    </view>
-    <view class="rules-text">
-      <view class="row">
-        <view class="rl">起步价</view>
-        <view class="rr">{{setting ? setting.starting_price : '--'}}元({{setting ? setting.starting_price_time : '--'}}分钟)</view>
-      </view>
-      <view class="row">
-        <view class="rl">时长费</view>
-        <view class="rr">{{setting ? setting.per_money : '--'}}元/{{setting ? setting.per_minute : '--'}}分钟</view>
-      </view>
-      <text>临时停车正常计费</text>
-    </view>
-  </view>
-  <view>
-    <view class="rules-title">
-      <view class="left">车辆调度费</view>
-      
-    </view>
-    <view class="rules-text">
-      <view class="row">
-        <view class="rl">运营区外调度费</view>
-        <view class="rr">{{setting ? 30 : '--'}}元</view>
-      </view>
-      <view class="row">
-        <view class="rl">运营区内调度费</view>
-        <view class="rr"></view>
-      </view>
-      <view a:if="{{setting.min_dispatching_fee == 0}}">1、距离最近停车点{{setting.min_limit_km}}m内,免收调度费;</view>
-      <view a:if="{{setting.min_dispatching_fee > 0}}">1、距离最近停车点{{setting.min_limit_km}}m内,收{{setting.min_dispatching_fee}}元;</view>
-      <view>2、超出最近停车点{{setting ? setting.min_limit_km : '--'}}m时:每多{{setting ? setting.over_limit_per_km : '--'}}m,增加{{setting ? setting.over_limit_per_km_money: '--'}}元;{{setting ? setting.max_dispatching_fee :'--'}}元封顶。</view>
-    </view>
-  </view>
-  
+<view class="box">
+  <view class="tip">———
+    <text style="color:#333333">{{setting ? homeName : '--'}}</text>———</view>
+  <view a:if="{{setting.is_deposit}}">
+    <view class="rules-title">
+      <view class="left">骑行押金</view>
+      <view class="right">{{setting ? setting.deposit : '--'}}元</view>
+    </view>
+    <view class="rules-text">押金随时可退</view>
+  </view>
+  <view>
+    <view class="rules-title">
+      <view class="left">时长费</view>
+    </view>
+    <view class="rules-text">
+      <view class="row">
+        <view class="rl">起步价</view>
+        <view class="rr">{{setting ? setting.starting_price : '--'}}元({{setting ? setting.starting_price_time : '--'}}分钟)</view>
+      </view>
+      <view class="row">
+        <view class="rl">时长费</view>
+        <view class="rr">{{setting ? setting.per_money : '--'}}元/{{setting ? setting.per_minute : '--'}}分钟</view>
+      </view>
+      <text>临时停车正常计费</text>
+    </view>
+  </view>
+  <view>
+    <view class="rules-title">
+      <view class="left">车辆调度费</view>
+      
+    </view>
+    <view class="rules-text">
+      <view class="row">
+        <view class="rl">运营区外调度费</view>
+        <view class="rr">{{setting ? 30 : '--'}}元</view>
+      </view>
+      <view class="row">
+        <view class="rl">运营区内调度费</view>
+        <view class="rr"></view>
+      </view>
+      <view a:if="{{setting.min_dispatching_fee == 0}}">1、距离最近停车点{{setting.min_limit_km}}m内,免收调度费;</view>
+      <view a:if="{{setting.min_dispatching_fee > 0}}">1、距离最近停车点{{setting.min_limit_km}}m内,收{{setting.min_dispatching_fee}}元;</view>
+      <view>2、超出最近停车点{{setting ? setting.min_limit_km : '--'}}m时:每多{{setting ? setting.over_limit_per_km : '--'}}m,增加{{setting ? setting.over_limit_per_km_money: '--'}}元;{{setting ? setting.max_dispatching_fee :'--'}}元封顶。</view>
+    </view>
+  </view>
+  
 </view>

+ 37 - 37
pages/charge_rule/charge_rule.js

@@ -1,38 +1,38 @@
-var app = getApp()
-Page({
-  data: {
-    setting:'',
-    title: app.globalData.title,
-    homeName: '',
-  },
-  onLoad: function (options) {
-
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-    
-      this.setData({
-        setting: my.getStorageSync({ 'key': 'setting' }).data,
-        homeName: my.getStorageSync({ 'key': 'home' }).data.name,
-      })
-  
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+var app = getApp()
+Page({
+  data: {
+    setting:'',
+    title: app.globalData.title,
+    homeName: '',
+  },
+  onLoad: function (options) {
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    
+      this.setData({
+        setting: my.getStorageSync({ 'key': 'setting' }).data,
+        homeName: my.getStorageSync({ 'key': 'home' }).data.name,
+      })
+  
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 125 - 125
pages/coupon/coupon.acss

@@ -1,125 +1,125 @@
-/* required by usingComponents */
-/* pages/coupon/coupon.wxss */
-page{
-  background-color: #f2f3f5;
-}
-.coupon{
-  padding: 30rpx;
-}
-.coupon-dui{
-height: 100rpx;
-line-height:100rpx;
-text-align: center;
-border-radius: 8rpx;
-font-size: 34rpx;
-background-color: var(--globleColor);
- color: var(--fontColor);
-}
-.coupon-item{
-  background-color: #fff;
- 
-  margin-top: 30rpx;
-  display: flex;
-}
-.left{
-  flex:0 0 30%;
-  padding: 50rpx 0;
-  border-right: dashed 2rpx #ebebeb;
-  text-align: center;
-  color: var(--orgFont);
-  font-weight: 600;
-  font-size: 30rpx;
-}
-.num{
-  font-size: 50rpx;
-  font-weight: bold;
-}
-.right{
-  flex: 1;
-  padding: 40rpx 0;
-  padding-left: 10%;
-  /* text-align: center; */
-}
-.right-title{
-  font-size: 30rpx;
-}
-.right-text{
-  font-size: 24rpx;
-  color: var(--orgFont);
-  margin-top: 20rpx;
-}
-.frame{
-  height: 100vh;
-  width: 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  background-color: rgba(0, 0, 0, 0.6);
-
-}
-.frame-content{
-  border-radius: 12rpx;
-  padding:30rpx 50rpx  80rpx;
-  width: 70%;
-  margin: 0 auto;
-  margin-top: 45%;
-  background-color: #fff;
-  opacity: 1;
-  font-size: 28rpx;
-}
-.top{
-  height: 50rpx;
-  font-size: 30rpx;
-  color: #333333;
-  font-weight: 500;
-  margin-bottom: 20rpx;
-  text-align: right;
-}
-input{
-  border: solid 1rpx #ebebeb;
-  padding: 20rpx;
-  border-radius: 5rpx;
-}
-.no-input{
-  color: #cfcece;
-}
-.sure-button{
-  height: 80rpx;
-  line-height: 80rpx;
-  text-align: center;
-  background-color: var(--globleColor);
-   color: var(--fontColor);
-  margin: 0 30rpx;
-  margin-top: 40rpx;
-  border-radius: 40rpx;
-  font-size: 28rpx;
-}
-.no-card {
-  color: #979797;
-  text-align: center;
-  margin-top: 45%;
-  font-size: 26rpx;
-}
-.no-card image{
-  height: 150rpx;
-  width: 150rpx;
-  margin-bottom: 30rpx;
-}
-.tab{
-  display: flex;
-}
-.tab-item{
-  flex: 1;
-  text-align: center;
-  font-size: 28rpx;
-  color: #5e5d5d;
-}
-.tab-item1{
-  flex: 1;
-  text-align: center;
-  font-size: 32rpx;
-  height: 60rpx;
-  border-bottom:solid 2rpx var(--orgFont);
-  color:var(--orgFont);
-}
-
+/* required by usingComponents */
+/* pages/coupon/coupon.wxss */
+page{
+  background-color: #f2f3f5;
+}
+.coupon{
+  padding: 30rpx;
+}
+.coupon-dui{
+height: 100rpx;
+line-height:100rpx;
+text-align: center;
+border-radius: 8rpx;
+font-size: 34rpx;
+background-color: var(--globleColor);
+ color: var(--fontColor);
+}
+.coupon-item{
+  background-color: #fff;
+ 
+  margin-top: 30rpx;
+  display: flex;
+}
+.left{
+  flex:0 0 30%;
+  padding: 50rpx 0;
+  border-right: dashed 2rpx #ebebeb;
+  text-align: center;
+  color: var(--orgFont);
+  font-weight: 600;
+  font-size: 30rpx;
+}
+.num{
+  font-size: 50rpx;
+  font-weight: bold;
+}
+.right{
+  flex: 1;
+  padding: 40rpx 0;
+  padding-left: 10%;
+  /* text-align: center; */
+}
+.right-title{
+  font-size: 30rpx;
+}
+.right-text{
+  font-size: 24rpx;
+  color: var(--orgFont);
+  margin-top: 20rpx;
+}
+.frame{
+  height: 100vh;
+  width: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  background-color: rgba(0, 0, 0, 0.6);
+
+}
+.frame-content{
+  border-radius: 12rpx;
+  padding:30rpx 50rpx  80rpx;
+  width: 70%;
+  margin: 0 auto;
+  margin-top: 45%;
+  background-color: #fff;
+  opacity: 1;
+  font-size: 28rpx;
+}
+.top{
+  height: 50rpx;
+  font-size: 30rpx;
+  color: #333333;
+  font-weight: 500;
+  margin-bottom: 20rpx;
+  text-align: right;
+}
+input{
+  border: solid 1rpx #ebebeb;
+  padding: 20rpx;
+  border-radius: 5rpx;
+}
+.no-input{
+  color: #cfcece;
+}
+.sure-button{
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: center;
+  background-color: var(--globleColor);
+   color: var(--fontColor);
+  margin: 0 30rpx;
+  margin-top: 40rpx;
+  border-radius: 40rpx;
+  font-size: 28rpx;
+}
+.no-card {
+  color: #979797;
+  text-align: center;
+  margin-top: 45%;
+  font-size: 26rpx;
+}
+.no-card image{
+  height: 150rpx;
+  width: 150rpx;
+  margin-bottom: 30rpx;
+}
+.tab{
+  display: flex;
+}
+.tab-item{
+  flex: 1;
+  text-align: center;
+  font-size: 28rpx;
+  color: #5e5d5d;
+}
+.tab-item1{
+  flex: 1;
+  text-align: center;
+  font-size: 32rpx;
+  height: 60rpx;
+  border-bottom:solid 2rpx var(--orgFont);
+  color:var(--orgFont);
+}
+

+ 93 - 93
pages/coupon/coupon.js

@@ -1,94 +1,94 @@
-// pages/coupon/coupon.js
-var app = getApp()
-Page({
-  data: {
-    frameShow: false,//兑换码弹框
-    couponList: [],
-    status: 1,//优惠券状态// status=0 已过期 2已使用 1未使用
-    tabList: [
-    {
-      id: 1,
-      name: '未使用'
-    },
-    {
-      id: 2,
-      name: '已使用'
-    },
-    {
-      id: 0,
-      name: '已过期'
-    }]
-  },
-  couponCode: function () {
-    this.setData({
-      frameShow: true
-    })
-  },
-  closeFrame: function () {
-    let that = this
-    that.setData({
-      frameShow: false
-    })
-  },
-  sureSubmit: function () {
-    let that = this
-    that.setData({
-      frameShow: false
-    })
-  },
-  onLoad: function (options) {
-    var that = this;
-  
-   
-  that.getCoupon()
-  },
-  //获取优惠券列表
-  getCoupon: function () {
-    let that=this
-    // status=0 已过期 2已使用 1未使用
-    my.showLoading({
-      content: '加载中...',
-      mask: true
-    })
-    let data={
-      status:that.data.status
-    }
-    app.request('/coupon', data, 'GET').then(res => {
-      //已使用
-      console.log(res)
-      that.setData({ couponList: res.data.data })
-      my.hideLoading()
-    })
-  },
-  //当前选中tab
-  currentTab:function(e){
-    let that=this
-    console.log(e.currentTarget.dataset.id,'tab')
-    that.setData({
-      status:e.currentTarget.dataset.id
-    })
-    that.getCoupon()
-
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+// pages/coupon/coupon.js
+var app = getApp()
+Page({
+  data: {
+    frameShow: false,//兑换码弹框
+    couponList: [],
+    status: 1,//优惠券状态// status=0 已过期 2已使用 1未使用
+    tabList: [
+    {
+      id: 1,
+      name: '未使用'
+    },
+    {
+      id: 2,
+      name: '已使用'
+    },
+    {
+      id: 0,
+      name: '已过期'
+    }]
+  },
+  couponCode: function () {
+    this.setData({
+      frameShow: true
+    })
+  },
+  closeFrame: function () {
+    let that = this
+    that.setData({
+      frameShow: false
+    })
+  },
+  sureSubmit: function () {
+    let that = this
+    that.setData({
+      frameShow: false
+    })
+  },
+  onLoad: function (options) {
+    var that = this;
+  
+   
+  that.getCoupon()
+  },
+  //获取优惠券列表
+  getCoupon: function () {
+    let that=this
+    // status=0 已过期 2已使用 1未使用
+    my.showLoading({
+      content: '加载中...',
+      mask: true
+    })
+    let data={
+      status:that.data.status
+    }
+    app.request('/coupon', data, 'GET').then(res => {
+      //已使用
+      console.log(res)
+      that.setData({ couponList: res.data.data })
+      my.hideLoading()
+    })
+  },
+  //当前选中tab
+  currentTab:function(e){
+    let that=this
+    console.log(e.currentTarget.dataset.id,'tab')
+    that.setData({
+      status:e.currentTarget.dataset.id
+    })
+    that.getCoupon()
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 23 - 23
pages/depoSuce/depoSuce.acss

@@ -1,24 +1,24 @@
-/* required by usingComponents */
-.suce{
-  text-align: center;
-}
-.suce image{
-  margin-top:20%;
-  height:300rpx;
-  width:300rpx;
-}
-
-.btn{
-  height:100rpx;
-  width: 80%;
-  margin: 0 auto;
-  line-height: 100rpx;
-  margin-top: 15%;
-  font-size:30rpx;
-  font-weight:600;
-  border-radius: 12rpx;
-  text-align: center;
-  background: var(--globleColor);
-   color: var(--fontColor);
-
+/* required by usingComponents */
+.suce{
+  text-align: center;
+}
+.suce image{
+  margin-top:20%;
+  height:300rpx;
+  width:300rpx;
+}
+
+.btn{
+  height:100rpx;
+  width: 80%;
+  margin: 0 auto;
+  line-height: 100rpx;
+  margin-top: 15%;
+  font-size:30rpx;
+  font-weight:600;
+  border-radius: 12rpx;
+  text-align: center;
+  background: var(--globleColor);
+   color: var(--fontColor);
+
 }

+ 375 - 375
pages/index/index.acss

@@ -1,376 +1,376 @@
-/* required by usingComponents */
-/**index.wxss**/
-/* 开锁失败弹框 */
-.open-err{
-  position: fixed;
-  z-index: 9999999;
-  width: 100%;
-  height: 100%;
-  background-color: rgba(0, 0, 0, 0.7);
-}
-.err-content{
-  width: 70%;
-  background-color: #ffffff;
-  border-radius: 12rpx;
-  margin: 0 auto;
-  margin-top: 40%;
-  text-align: center;
-  padding: 50rpx 0;
-
-}
-
-.err-image{
-height: 160rpx;
-width: 160rpx;
-}
-.err-text{
-  height: 100rpx;
-  line-height:100rpx;
-  font-size: 30rpx;
-}
-.err-button{
-  display: flex;
-  text-align: center;
-  width: 80%;
-  margin: 0 auto;
-  height: 70rpx;
-  line-height: 70rpx;
-  margin-top: 50rpx;
-  border-radius: 12rpx;
-  font-size: 28rpx;
-  /* background-color: var(--globleColor); */
-}
-.err-left{
-  flex: 1;
-  margin-right: 20rpx;
-   /* background-color: var(--globleColor); */
-   border:solid 1rpx var(--globleColor);
-   border-radius: 12rpx;
-   color: var(--orgFont);
-}
-.err-right{
-  flex: 1;
-   background-color: var(--globleColor);
-   border-radius: 12rpx;
-}
-.err-cha{
-  height: 60rpx;
-  width: 60rpx;
-  color: #fff;
-  margin:0 auto;
-  margin-top: 50rpx;
-  border: solid 4rpx #fff;
-  text-align: center;
-  line-height: 60rpx;
-  border-radius: 50%;
-}
-.err-cha .iconfont{
-color: #fff;
-font-size: 28rpx;
-}
-/* .err-left{
-  flex: 1;
-}
-.err-right{
-  flex: 1;
-} */
-
-/* 屏幕中间广告弹框 */
-.ad-frame{
-  height: 100%;
-  width: 100%;
-  position: fixed;
-  background-color: rgba(0, 0, 0, 0.6);
-  top: 0;
-  left: 0;
-  z-index: 99999;
-}
-.ad-frame-content{
-  width: 70%;
-  height: 50%;
-  /* background-color: #fff; */
-  margin-left: 15%;
-  margin-top:20%;
-}
-.frame-middle{
-  height: 100%;
-  width: 100%;
-}
-.frame-middle image{
-  width: 100%;
-  height: 100%;
-}
-.ad-frame-close{
-  margin: 0 auto;
-  margin-top: 100rpx;
-  text-align: center;
-  width: 60rpx;
-  height: 60rpx;
-  line-height:60rpx;
-  border:solid 4rpx #fff;
-  border-radius: 50%;
-  
-}
-.ad-frame-close .icon-cha{
-color: #fff;
-font-weight: 300;
-font-size: 30rpx;
-}
-/* 轮播图 */
-.ad-swiper{
-  position: fixed;
-  top: 10rpx;
-  z-index: 9999;
-  height: 200rpx;
-  width: 94%;
-  left: 3%;
-  /* background-color: #fff; */
-}
-.ad-swiper-list{
-  height: 200rpx;
-}
-.ad-swiper-item{
-
-}
-
-/*       */
-.ad-list {
-  background-color: #333333;
-  opacity: 0.9;
-  height: 80rpx;
-  border-radius: 50rpx;
-  width: 90%;
-  left: 5%;
-  position: fixed;
-  top: 30rpx;
-  z-index: 9999;
-}
-
-.mess {
-  display: inline-block;
-  vertical-align: middle;
-  height: 40rpx;
-  width: 40rpx;
-
-  margin: 20rpx 30rpx 20rpx 30rpx;
-}
-
-.change {
-  display: inline-block;
-  vertical-align: top;
-  height: 50rpx;
-  width: 50rpx;
-  float: right;
-  margin: 15rpx 30rpx 15rpx 30rpx;
-}
-
-.swiper {
-  height: 80rpx;
-  position: fixed;
-  width: 68%;
-  left: 120rpx;
-  top: 30rpx;
-  z-index: 99999;
-}
-
-.swiper-item {
-  height: 80rpx;
-  line-height: 70rpx;
-
-}
-
-.ad-item {
-  display: inline-block;
-  color: #fff;
-  font-size: 26rpx;
-  vertical-align: middle;
-}
-
-#map {
-  height: 100vh;
-  width: 100%;
-  z-index: 3;
-}
-
-.map-icon {
-  position: fixed;
-  right:20rpx;
-  z-index: 999;
-  bottom: 400rpx;
-}
-
-.kefu {
-  height: 70rpx;
-  width: 70rpx;
-  bottom: 0rpx;
-  border-radius: 50%;
-  background-color: #fff;
-  margin-top: 50rpx;
-  text-align: center;
-}
-
-.kefu image {
-  height: 50rpx;
-  margin-top: 10rpx;
-  width: 50rpx;
-}
-
-
-.bottom-bt {
-  width: 100%;
-  /* height: 300rpx; */
-  /* padding: 30rpx; */
-  position: fixed;
-  z-index: 9999998;
-  bottom: 0;
-  border-radius: 30rpx 30rpx 0 0;
-  padding-bottom: 50rpx;
-  background-color: #f2f2f2;
-}
-
-.tab {
-  margin: 20rpx;
-  text-align: center;
-  padding: 30rpx;
-
-  display: flex;
-  background-color: #fff;
-  border-radius: 20rpx;
-  font-size: 24rpx;
-  color: #3a3a3a;
-}
-
-.tab-item {
-  flex: 1;
-}
-
-.scan {
-  margin-top: 30rpx;
-  height: 100rpx;
-  line-height: 100rpx;
-  text-align: center;
-  margin: 0 50rpx;
-  border-radius: 80rpx;
-  font-weight: bold;
-  font-size: 34rpx;
-  background-color: var(--globleColor);
-  color: var(--fontColor);
-}
-
-.iconfont {
-  font-size: 38rpx;
-  display: inline-block;
-  margin-bottom: 10rpx;
-  color: #333333;
-  font-weight: bold;
-}
-
-.scanicon {
-  font-weight: 300;
-  display: inline-block;
-  margin-right: 20rpx;
-   color: var(--fontColor);
-}
-/* 未支付订单弹框 */
-.pay-frame{
-  width: 100vh;
-  height: 100%;
-  position: fixed;
-  z-index: 999999999;
-  background-color: rgba(0, 0, 0, 0.6);
-}
-.topay {
-  width: 500rpx;
-  height: 300rpx;
-  background: rgba(255, 255, 255, 1);
-  border-radius: 20rpx;
-  position: fixed;
-  top: 41%;
-  left: 16%;
-  z-index: 8888;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-.topay .text1,
-.text2 {
-  font-size: 28rpx;
-  font-family: PingFang SC;
-  color: rgba(42, 42, 42, 1);
-}
-
-.topay .view {
-  display: flex;
-  position: absolute;
-  bottom: 0rpx;
-  width: 100%;
-  justify-content: space-between;
-  height: 70rpx;
-  border-top: 1rpx solid #f4f4f4;
-  padding: 10rpx 0rpx;
-}
-
-.topay .view .view1 {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 49.5%;
-}
-/* 新有未支付订单 */
-.no-pay-order{
-position: fixed;
-background-color: #7098F8;
-z-index: 9999;
-height: 70rpx;
-line-height: 70rpx;
-color: #fff;
-font-size: 28rpx;
-left: 20rpx;
-/* width: 300rpx; */
-padding: 0 20rpx;
-border-radius: 40rpx;
-bottom: 350rpx;
-}
-.no-pay-order .iconfont{
-  font-size: 28rpx;
-  color: #fff;
-}
-.no-pay-order text{
-  display: inline-block;
-  margin: 0 10rpx;
-}
-
-
-.inform {
-  display: flex;
-  align-items: center;
-  width: 94%;
-  left: 3%;
-  height: 68rpx;
-  background: white;
-  position: fixed;
-  z-index: 1000;
-  font-size: 26rpx;
-  justify-content: space-between;
-  border-radius: 10rpx;
-  top: 250rpx;
-}
-
-.inform-img {
-  display: flex;
-  height: 100%;
-  align-items: center;
-
-}
-
-.marquee {
-  width: 80%;
-  height: 70rpx;
-  overflow: hidden;
-  line-height: 70rpx;
-}
-
-.marqueeTitle {
-  height: 70rpx;
+/* required by usingComponents */
+/**index.wxss**/
+/* 开锁失败弹框 */
+.open-err{
+  position: fixed;
+  z-index: 9999999;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.7);
+}
+.err-content{
+  width: 70%;
+  background-color: #ffffff;
+  border-radius: 12rpx;
+  margin: 0 auto;
+  margin-top: 40%;
+  text-align: center;
+  padding: 50rpx 0;
+
+}
+
+.err-image{
+height: 160rpx;
+width: 160rpx;
+}
+.err-text{
+  height: 100rpx;
+  line-height:100rpx;
+  font-size: 30rpx;
+}
+.err-button{
+  display: flex;
+  text-align: center;
+  width: 80%;
+  margin: 0 auto;
+  height: 70rpx;
+  line-height: 70rpx;
+  margin-top: 50rpx;
+  border-radius: 12rpx;
+  font-size: 28rpx;
+  /* background-color: var(--globleColor); */
+}
+.err-left{
+  flex: 1;
+  margin-right: 20rpx;
+   /* background-color: var(--globleColor); */
+   border:solid 1rpx var(--globleColor);
+   border-radius: 12rpx;
+   color: var(--orgFont);
+}
+.err-right{
+  flex: 1;
+   background-color: var(--globleColor);
+   border-radius: 12rpx;
+}
+.err-cha{
+  height: 60rpx;
+  width: 60rpx;
+  color: #fff;
+  margin:0 auto;
+  margin-top: 50rpx;
+  border: solid 4rpx #fff;
+  text-align: center;
+  line-height: 60rpx;
+  border-radius: 50%;
+}
+.err-cha .iconfont{
+color: #fff;
+font-size: 28rpx;
+}
+/* .err-left{
+  flex: 1;
+}
+.err-right{
+  flex: 1;
+} */
+
+/* 屏幕中间广告弹框 */
+.ad-frame{
+  height: 100%;
+  width: 100%;
+  position: fixed;
+  background-color: rgba(0, 0, 0, 0.6);
+  top: 0;
+  left: 0;
+  z-index: 9999999;
+}
+.ad-frame-content{
+  width: 70%;
+  height: 55%;
+  /* background-color: #fff; */
+  margin-left: 15%;
+  margin-top:20%;
+}
+.frame-middle{
+  height: 100%;
+  width: 100%;
+}
+.frame-middle image{
+  width: 100%;
+  height: 100%;
+}
+.ad-frame-close{
+  margin: 0 auto;
+  margin-top: 100rpx;
+  text-align: center;
+  width: 60rpx;
+  height: 60rpx;
+  line-height:60rpx;
+  border:solid 4rpx #fff;
+  border-radius: 50%;
+  
+}
+.ad-frame-close .icon-cha{
+color: #fff;
+font-weight: 300;
+font-size: 30rpx;
+}
+/* 轮播图 */
+.ad-swiper{
+  position: fixed;
+  top: 10rpx;
+  z-index: 9999;
+  height: 200rpx;
+  width: 94%;
+  left: 3%;
+  /* background-color: #fff; */
+}
+.ad-swiper-list{
+  height: 200rpx;
+}
+.ad-swiper-item{
+
+}
+
+/*       */
+.ad-list {
+  background-color: #333333;
+  opacity: 0.9;
+  height: 80rpx;
+  border-radius: 50rpx;
+  width: 90%;
+  left: 5%;
+  position: fixed;
+  top: 30rpx;
+  z-index: 9999;
+}
+
+.mess {
+  display: inline-block;
+  vertical-align: middle;
+  height: 40rpx;
+  width: 40rpx;
+
+  margin: 20rpx 30rpx 20rpx 30rpx;
+}
+
+.change {
+  display: inline-block;
+  vertical-align: top;
+  height: 50rpx;
+  width: 50rpx;
+  float: right;
+  margin: 15rpx 30rpx 15rpx 30rpx;
+}
+
+.swiper {
+  height: 80rpx;
+  position: fixed;
+  width: 68%;
+  left: 120rpx;
+  top: 30rpx;
+  z-index: 99999;
+}
+
+.swiper-item {
+  height: 80rpx;
+  line-height: 70rpx;
+
+}
+
+.ad-item {
+  display: inline-block;
+  color: #fff;
+  font-size: 26rpx;
+  vertical-align: middle;
+}
+
+#map {
+  height: 100vh;
+  width: 100%;
+  z-index: 3;
+}
+
+.map-icon {
+  position: fixed;
+  right:20rpx;
+  z-index: 999;
+  bottom: 400rpx;
+}
+
+.kefu {
+  height: 70rpx;
+  width: 70rpx;
+  bottom: 0rpx;
+  border-radius: 50%;
+  background-color: #fff;
+  margin-top: 50rpx;
+  text-align: center;
+}
+
+.kefu image {
+  height: 50rpx;
+  margin-top: 10rpx;
+  width: 50rpx;
+}
+
+
+.bottom-bt {
+  width: 100%;
+  /* height: 300rpx; */
+  /* padding: 30rpx; */
+  position: fixed;
+  z-index: 9999998;
+  bottom: 0;
+  border-radius: 30rpx 30rpx 0 0;
+  padding-bottom: 50rpx;
+  background-color: #f2f2f2;
+}
+
+.tab {
+  margin: 20rpx;
+  text-align: center;
+  padding: 30rpx;
+
+  display: flex;
+  background-color: #fff;
+  border-radius: 20rpx;
+  font-size: 24rpx;
+  color: #3a3a3a;
+}
+
+.tab-item {
+  flex: 1;
+}
+
+.scan {
+  margin-top: 30rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  text-align: center;
+  margin: 0 50rpx;
+  border-radius: 80rpx;
+  font-weight: bold;
+  font-size: 34rpx;
+  background-color: var(--globleColor);
+  color: var(--fontColor);
+}
+
+.iconfont {
+  font-size: 38rpx;
+  display: inline-block;
+  margin-bottom: 10rpx;
+  color: #333333;
+  font-weight: bold;
+}
+
+.scanicon {
+  font-weight: 300;
+  display: inline-block;
+  margin-right: 20rpx;
+   color: var(--fontColor);
+}
+/* 未支付订单弹框 */
+.pay-frame{
+  width: 100vh;
+  height: 100%;
+  position: fixed;
+  z-index: 999999999;
+  background-color: rgba(0, 0, 0, 0.6);
+}
+.topay {
+  width: 500rpx;
+  height: 300rpx;
+  background: rgba(255, 255, 255, 1);
+  border-radius: 20rpx;
+  position: fixed;
+  top: 41%;
+  left: 16%;
+  z-index: 8888;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.topay .text1,
+.text2 {
+  font-size: 28rpx;
+  font-family: PingFang SC;
+  color: rgba(42, 42, 42, 1);
+}
+
+.topay .view {
+  display: flex;
+  position: absolute;
+  bottom: 0rpx;
+  width: 100%;
+  justify-content: space-between;
+  height: 70rpx;
+  border-top: 1rpx solid #f4f4f4;
+  padding: 10rpx 0rpx;
+}
+
+.topay .view .view1 {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 49.5%;
+}
+/* 新有未支付订单 */
+.no-pay-order{
+position: fixed;
+background-color: #7098F8;
+z-index: 9999;
+height: 70rpx;
+line-height: 70rpx;
+color: #fff;
+font-size: 28rpx;
+left: 20rpx;
+/* width: 300rpx; */
+padding: 0 20rpx;
+border-radius: 40rpx;
+bottom: 350rpx;
+}
+.no-pay-order .iconfont{
+  font-size: 28rpx;
+  color: #fff;
+}
+.no-pay-order text{
+  display: inline-block;
+  margin: 0 10rpx;
+}
+
+
+.inform {
+  display: flex;
+  align-items: center;
+  width: 94%;
+  left: 3%;
+  height: 68rpx;
+  background: white;
+  position: fixed;
+  z-index: 1000;
+  font-size: 26rpx;
+  justify-content: space-between;
+  border-radius: 10rpx;
+  top: 250rpx;
+}
+
+.inform-img {
+  display: flex;
+  height: 100%;
+  align-items: center;
+
+}
+
+.marquee {
+  width: 80%;
+  height: 70rpx;
+  overflow: hidden;
+  line-height: 70rpx;
+}
+
+.marqueeTitle {
+  height: 70rpx;
 }

+ 116 - 114
pages/index/index.axml

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

+ 1067 - 1061
pages/index/index.js

@@ -1,1061 +1,1067 @@
-// index.js
-// 获取应用实例
-//获取应用实例
-// const log = require('../../utils/log')
-const { getCache, setCache, CacheKeys } = require('../../utils/cache')
-const app = getApp();
-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({
-  data: {
-    cardBottom: [
-      {
-        id: 1,
-        name: '故障上报',
-        icon: 'icon-banshou',
-        url: '/pages/breakdown/breakdown'
-      },
-      {
-        id: 2,
-        name: '输码用车',
-        icon: 'icon-17-saoma',
-        url: '/pages/inputcode/inputcode'
-
-      },
-      {
-        id: 3,
-        name: '计费规则',
-        icon: 'icon-wenhao',
-        url: '/pages/charge_rule/charge_rule'
-      },
-      {
-        id: 4,
-        name: '个人中心',
-        icon: 'icon-wode',
-        url: '/pages/mine/mine'
-      }
-    ],
-    adFrame: false,//首页中间广告弹框
-    markers: [], //显示单车、停车的P
-    polygons: [], //区域
-    longitude: '', //113.786111
-    latitude: '', //34.78304
-    height1: '', //兼容自定义导航栏的高度
-    id: '', //停车区域的ID
-    stopP: false, //判断是否显示停车区域
-    polygons1: [], //可骑行区域 先用这个变量代表
-    controls: [], //地图上当前定位的箭头                     
-    background: false, //弹窗的背景颜色 
-    realname: false, //当前是否已经实名
-    deposit: false, //当前是否交押金
-    userStatus: '', //用户的一些状态 是否交押金等   0                                                                                           
-    scanfail: false, //扫码失败弹窗
-    is_pay_order: false, //检测当前是否有订单未支付
-    is_ride_order: false,//是否有骑行中订单
-    is_punishment: false,//有违章订单
-    code: '', //点击立即用车 把编号赋值给code
-    over: false, //关闭图标
-    over1: false, //扫码失败关闭图标
-    location: '', //是否有位置权限
-    screenHeight: '', //屏幕可视高度
-    box_no: '', //中控编号
-    abnormal: '', //提示账号异常
-    mid: [],//顶部广告
-    ads: [],//首页中间广告
-    currentSwiper: 0,
-    center_currentSwiper: 0,
-    bike_no: undefined,
-    stopShow: false,
-    stop_info: [],
-    notice: [], //公告内容
-    animationData: {},
-    tabbar_index: 0,
-    zoom: 18,
-    versions: false, //版本过低弹窗
-    chooseSize: false,
-    animationData1: {},
-    arrowDown: '',
-    stop_type: '',
-    marqueePace: 0.6, //滚动速度
-    marqueeDistance: 520, //初始滚动距离 用到
-    size: 26, //通知公告用到
-    marqueeWidth: 560, //通知公告用到
-    length: '',//通知公告
-    swiperCurrent: 0,
-    midbolear: '',
-    per_money: '',
-    img: app.globalData.imgUrl,
-    new_user_coupons: [],
-    scanCodeErr: false,//扫码失败弹框
-    isScan: false
-  },
-
-  onLoad: function (query) {
-    var that = this;
-    console.log(my.getStorageSync({ 'key': 'token' }).data, 'yyyyyyyyyyyyyyy')
-    my.setNavigationBar({
-      title: app.globalData.title
-    })
-    this.setData({
-      height1: app.globalData.statusBarHeight,
-      screenHeight: app.globalData.screenHeight
-    })
-    this.reloadMap()
-  },
-  onShow: function () {
-    var that = this;
-    my.setNavigationBar({
-      title: app.globalData.title
-    })
-    token = my.getStorageSync({ 'key': 'token' }).data
-    this.setData({
-      show: false,
-      midbolear: my.getStorageSync({ 'key': 'midTimes' }).data,
-      polygons: []
-    })
-    if (!this.data.isScan) {
-      app.login().then(res => {
-        console.log('YYYYYYYYYYYYY')
-        that.location()
-        that.getUser()
-        that.userState()
-      })
-    }
-    that.setData({
-      isScan: false
-    })
-  },
-  detail: function () {
-    var that = this;
-    if (that.data.mid[0].type == 'url') {
-      my.navigateTo({
-        url: '/' + that.data.mid[0].detail
-      })
-    }
-  },
-  //广告列表
-  adsList: function (id) {
-    var that = this;
-    var area_id = ''
-    if (id != undefined) {
-      area_id = id
-    } else {
-      area_id = 0
-    }
-
-    let isCache = getCache('ads:' + id)
-    if (isCache) {
-      if (isCache == '') return
-      if (isCache instanceof Object && isCache.hasOwnProperty('header')) {
-        that.setData({
-          ads: isCache.header
-        })
-      }
-      if (isCache instanceof Object && isCache.hasOwnProperty('mid')) {
-        that.setData({
-          mid: res.data.mid,
-          adFrame: true
-        })
-      }
-      return
-    }
-
-    app.request("/ads?area_id=" + area_id + "&position[]=mid&position[]=header&position[]=footer", '', "GET").then(res => {
-      console.log(res)
-      if (res.status == 200 && res.data != '') {
-        if (res.data.header) {
-          console.log(res.data, 'ppppppppppppppppppppppppp')
-          that.setData({
-            ads: res.data.header
-          })
-        }
-        if (res.data.mid) {
-
-          that.setData({
-            mid: res.data.mid,
-            adFrame: true
-          })
-        }
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  reloadMap(classname = 'bottom-bt') {
-    let query = my.createSelectorQuery();
-    let th = this;
-    query.select('.' + classname).boundingClientRect(function (rect) {
-      if (rect != null && rect instanceof Object && rect.hasOwnProperty('height')) {
-        let height = rect.height;
-        th.setData({ mapHeight: 'calc(100vh - ' + height + 'px)' });
-      }
-    }).exec();
-  },
-  //点击广告页
-  swiper: util.throttle(function (e) {
-    // console.log(e)
-    var type = e.currentTarget.dataset.type;
-    var index = e.currentTarget.dataset.index;
-    var name = e.currentTarget.dataset.name;
-    var detail = e.currentTarget.dataset.detail;
-    var id = e.currentTarget.dataset.id;
-    if (type != 'clilk_null') {
-      if (type == 'wxUrl') {
-        my.navigateTo({
-          url: '/' + detail,
-        })
-      } else if (type == 'phone') {
-        my.makePhoneCall({
-          number: detail,
-        })
-      } else if (type == 'toMiniProgram') {
-        my.navigateToMiniProgram({
-          appId: detail,
-          extraData: {
-            foo: 'bar'
-          },
-          // envVersion: 'develop',
-          success(res) {
-            // 打开成功
-          }
-        })
-      } else {
-        my.navigateTo({
-          url: '../swiper/swiper?type=' + type + '&url=' + id + '&name=' + name + '&detail=' + detail,
-        })
-      }
-    }
-  }, 1000),
-  //点击轮播图
-  swiperChange: function (e) {
-    if (this.data.currentSwiper == 0 && this.data.swiperCurrent > 1) { //卡死时,重置current为正确索引
-      this.setData({
-        currentSwiper: this.data.swiperCurrent
-      });
-    } else { //正常轮转时,记录正确页码索引
-      this.setData({
-        swiperCurrent: e.detail.current
-      });
-    }
-  },
-  //通知公告
-  getNotice(id) {
-    let data = {
-      'area_id': id
-    }
-
-    let isCache = getCache('Notice:' + id)
-    if (isCache) {
-      if (isCache instanceof Object && !isCache.hasOwnProperty('id')) return
-      this.setData({ notice: isCache })
-      var length = isCache.description.length * this.data.size; //计算文字的长度
-      this.setData({
-        length: length
-      })
-      if (this.data.length > this.data.marqueeWidth) {
-        this.noticeRun();
-      } else {
-        this.setData({
-          marqueeDistance: 0
-        })
-      }
-      return
-    }
-
-
-    app.request("/index/an", data, "GET").then(res => {
-      console.log(res)
-      if (200 == res.status && res.data.id) {
-        this.setData({ notice: res.data })
-        var length = res.data.description.length * this.data.size; //计算文字的长度
-        this.setData({
-          length: length
-        })
-        if (this.data.length > this.data.marqueeWidth) {
-          this.noticeRun();
-        } else {
-          this.setData({
-            marqueeDistance: 0
-          })
-        }
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  noticeRun: function () {
-    var that = this;
-    mytime = setInterval(function () {
-      if (-that.data.marqueeDistance < that.data.length) {
-        that.setData({
-          marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
-        })
-      } else {
-        clearInterval(mytime);
-        that.setData({
-          marqueeDistance: that.data.marqueeWidth
-        });
-        that.noticeRun();
-      }
-    }, 10)
-  },
-  //定位当前位置
-  posi: util.throttle(function () {
-    //点击定位  
-    //这是一段注
-    var that = this;
-    my.showLoading({
-      content: '定位中'
-    })
-    my.getLocation({
-      type: 'gcj02',
-      success: (res) => {
-        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
-        my.hideLoading()
-        that.setData({
-          longitude: res.longitude,
-          latitude: res.latitude
-        })
-      },
-      fail: function (err) {
-        console.log(err, '用户授权失败')
-        if (err.error == 11) {
-          my.showAuthGuide({
-            authType: 'LBS',
-            success: (res) => {
-
-            },
-            fail: (error) => {
-              my.alert({ content: '获取位置授权失败' });
-            },
-          });
-        }
-        my.hideLoading()
-        my.showToast({
-          content: '定位失败',
-          icon: 'none'
-        })
-      }
-      // fail: function (err) {
-      //   my.hideLoading()
-      //   console.log(err, '定位失败打印')
-      //   my.showToast({
-      //     content: '定位失败',
-      //     icon: 'none'
-      //   })
-      // }
-    })
-  }, 1000),
-  //点击扫描二维码
-  sweepCode: util.throttle(function () {
-    let that = this
-    console.log('点击扫码,‘iooooo')
-    if (!that.data.latitude && !that.data.longitude) {
-      that.setData({
-        background: true,
-        location: true
-      })
-    } else {
-      that.sweep_code()
-    }
-  }, 1500),
-  //骑行区禁停区车辆
-  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;
-          console.log(data, '区域')
-          let id = data.id
-          this.getNotice(id)
-          if (data.points != []) {
-            that.setData({
-              id: data.id,
-              polygons1: that.data.polygons.concat(data),
-              setting: data.setting,
-              per_money: Number(data.setting.starting_price),
-              polygons: []
-            })
-            if (!data.id) return
-            that.adsList(data.id),
-              that.ban_stop(data.id), that.setData({
-                polygons: that.data.polygons.concat(data)
-              })
-          }
-          if (res.status == 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': '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, 'lkkkkk')
-        // if (err.data.message == "该附近暂无运营区域") {
-        //   my.removeStorageSync({ key: 'setting' })
-        //   my.removeStorageSync({ key: 'home' })
-        // }
-        my.alert({
-          title: '提示',
-          content: err.data.message,
-        })
-      })
-    }
-  },
-  //停车区域
-  ban_stop: function (id) {
-    var that = this;
-    var data1 = {
-      'area_id': id
-    }
-    let isCache = getCache('BAN_STOP:' + id)
-    if (isCache) {
-      that.setData({
-        markers: that.data.markers.concat(isCache.centres),
-        polygons: that.data.polygons1.concat(isCache.polygons),
-      })
-      return
-    }
-    app.request('/parking/stop-sites', data1, 'GET').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        var data = res.data
-        console.log(data)
-        that.setData({
-          polygons2: data.polygons,
-          markers: that.data.markers.concat(data.centres),
-          polygons: that.data.polygons1.concat(data.polygons)
-        })
-      }
-    })
-  },
-  //附近车辆坐标
-  nearbyCars: function () {
-    //附近的车
-    var that = this;
-    that.setData({
-      markers: []
-    })
-    var data = {
-      "lat": that.data.latitude,
-      "lng": that.data.longitude
-    }
-    app.request("/bikes", data, "POST").then(res => {
-      // console.log(res)
-      if (res.status == 200) {
-        var makers = res.data
-        if (makers == '') {
-          my.showToast({
-            content: '附近暂无车辆',
-            icon: 'none'
-          })
-          that.setData({
-            markers: []
-          })
-        } else {
-          that.setData({
-            markers: makers
-          })
-        }
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-
-  //点击刷新
-  refresh: util.throttle(function () {
-
-    var that = this;
-    that.setData({
-      polygons: []
-    })
-    if (this.data.stopP == true) {
-      that.stopP(), my.showToast({
-        content: '刷新成功',
-        icon: 'none'
-      })
-    } else {
-      this.location(),
-        my.showToast({
-          content: '刷新成功',
-          icon: 'none'
-        })
-    }
-  }, 1500),
-  //    //点击去实名认证
-  authentication: util.throttle(function () {
-    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',
-      })
-    } else if (state.is_bind_mobile == 1) {
-      my.navigateTo({
-        url: '/pages/real_name/real_name?state2=2&index=1',
-      })
-    }
-    this.setData({
-      background: false,
-      realname: false,
-      over: false
-    })
-  }, 1500),
-  //点击扫码开锁
-  sweep_code: util.throttle(function () {
-    var that = this;
-    console.log('ooooooo')
-    var userStatus = that.data.userStatus;
-    var setting = my.getStorageSync({ 'key': 'setting' }).data
-    if (!setting) {
-      my.alert({
-        title: '提示',
-        content: '您附近暂无运营区,暂不可用车'
-      })
-    } else {
-      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
-    //未绑定手机号
-    if (userStatus.is_bind_mobile == 0) {
-      my.navigateTo({
-        url: '/pages/authorization/authorization',
-      })
-      //未实名认证
-    } else if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
-      my.navigateTo({
-        url: '/pages/real_name/real_name',
-      })
-    } else {
-      //有违章订单
-      if (userStatus.is_punishment) {
-        my.showToast({
-          content: '您当前有违章订单需要处理,请处理后再来用车吧',
-          icon: 'none'
-        })
-        return;
-      } else if (userStatus.is_ride_order != false && userStatus.is_ride_order != undefined) {
-        my.showToast({
-          content: '您有一个正在骑行中的订单',
-          icon: 'none'
-        })
-        return;
-      } else {
-        //有待支付骑行订单
-        if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
-          my.showToast({
-            content: '你有未支付订单,请先支付',
-            icon: 'none'
-          })
-          return;
-        } else {
-          //没有押金没有免押券
-          if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
-            console.log('没有押金没有免押券')
-            my.navigateTo({
-              url: '/pages/ride_zige/ride_zige',
-            })
-            // my.navigateTo({
-            //   url: '/pages/inputcode/inputcode',
-            // })
-          } else {
-            that.saoMa()
-          }
-        }
-      }
-    }
-  },
-  //扫码事件
-  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.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, '错误码')
-          // my.showModal({
-          //   title:'提示',
-          //   content:'非法码,请核对车码',
-          //   showCancel:false
-          // })
-          that.setData({
-            scanCodeErr: true
-          })
-        }
-      },
-      fail: function (err) {
-        console.log('tuihui')
-        // that.setData({
-        //   scanCodeErr: true
-        // })
-      }
-    })
-  },
-  //获取车辆信息
-  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 {
-        my.alert({
-          title: '提示',
-          content: res.data.message,
-        })
-      }
-    })
-
-  },
-  //去支付未支付订单
-  go_pay: util.throttle(function () {
-    //点击去支付
-    this.setData({
-      is_pay_order: false,
-    })
-    var pay_order = ''
-    if (this.data.userStatus.is_pay_order !== false && this.data.userStatus.is_pay_order !== undefined) {
-      pay_order = this.data.userStatus.is_pay_order
-    }
-    my.navigateTo({
-      url: '/pages/pay/pay?order=' + pay_order,
-    })
-  }, 1500),
-  //点击查看正在进行中的订单
-  goUseBike: function () {
-    console.log(this.data.is_ride_order, 'this.data.is_ride_order')
-    my.navigateTo({
-      url: '/pages/use_bike/use_bike?order=' + this.data.is_ride_order,
-    })
-  },
-  //有违章订单 
-  havePunishment: function () {
-    my.navigateTo({
-      url: '/pages/weizhang/weizhang',
-    })
-  },
-
-  onReady: function () {
-
-  },
-  kefu: util.throttle(function () {
-    my.makePhoneCall({
-      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
-    })
-  }, 1500),
-  //用户状态
-  userState: function (id) {
-    var that = this;
-    app.request("/user/status", "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 })
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-
-  },
-  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)
-    })
-  },
-  go_setting: util.throttle(function () {
-    //点击去设置位置权限
-    this.setData({
-      background: false,
-      location: false
-    })
-    my.openSetting({
-      success: function (res) {
-      }
-    })
-  }, 1500),
-
-  //点击已开启位置权限
-  open: util.throttle(function () {
-    this.setData({
-      background: false,
-      location: false
-    })
-  }, 1500),
-
-  location: function () {
-    //获取当前经纬度 如果未授权让用户去授权
-    console.log('dingwei')
-    var that = this;
-    my.showLoading({
-      content: '定位中...',
-      mask: true
-    })
-    my.getLocation({
-      type: 'gcj02',
-      success: (res) => {
-        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
-        that.setData({
-          longitude: res.longitude,
-          latitude: res.latitude,
-          show: false
-        })
-        console.log(res, 'ppp')
-        that.home(), that.nearbyCars()
-        if (that.data.stopP == false) {
-          console.log('false')
-        } else {
-          that.stop()
-        }
-        my.hideLoading()
-      },
-      fail: function (err) {
-        console.log(err, '用户授权失败')
-        if (err.error == 11) {
-
-          my.showAuthGuide({
-            authType: 'LBS',
-            success: (res) => {
-
-            },
-            fail: (error) => {
-              my.alert({ content: '获取位置授权失败' });
-            },
-          });
-
-        }
-        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
-              })
-            }
-          }
-        })
-      }
-    })
-  },
-
-  //底部跳转页面按钮(用户未授权和未实名认证的时候不可以跳转)
-  skipPage: function (e) {
-
-    let data = e.target.dataset.id
-    let that = this
-    console.log(that.data, 'oooooo')
-
-    var userStatus = that.data.userStatus;
-    var setting = my.getStorageSync({ 'key': 'setting' }).data
-    if (data.id == 2 && !that.data.latitude && !that.data.longitude) {
-      that.setData({
-        background: true,
-        location: true
-      })
-      return
-    }
-    if (data.id == 2 && !setting) {
-      my.alert({
-        title: '提示',
-        content: '您附近暂无运营区,暂不可用车'
-      })
-
-      return
-    }
-    if (data.id == 2 && setting) {
-      if (!userStatus) {
-        my.navigateTo({
-          url: '/pages/authorization/authorization',
-        })
-      }
-      else {
-        that.jiance1();
-      }
-    } else {
-      my.navigateTo({
-        url: data.url,
-      })
-    }
-
-
-
-    // if (!that.data.latitude && !that.data.longitude) {
-    //   that.setData({
-    //     background: true,
-    //     location: true
-    //   })
-    // } else {
-    //   if (data.id == 2) {
-    //     console.log(that.data.userStatus, '')
-    //     if (!setting) {
-    //       my.alert({
-    //         title: '提示',
-    //         content: '您附近暂无运营区,暂不可用车'
-    //       })
-    //     }
-    //     else {
-    //       if (!userStatus) {
-    //         my.navigateTo({
-    //           url: '/pages/authorization/authorization',
-    //         })
-    //       }
-    //       else {
-    //         that.jiance1();
-    //       }
-    //     }
-    //   } else if (data.id == 4) {
-    //     if (userStatus.is_bind_mobile == 0) {
-    //       my.navigateTo({
-    //         url: '/pages/authorization/authorization',
-    //       })
-    //     } else {
-    //       my.navigateTo({
-    //         url: data.url,
-    //       })
-    //     }
-    //   }
-    //   else {
-    //     if (!userStatus) {
-    //       my.navigateTo({
-    //         url: '/pages/authorization/authorization',
-    //       })
-    //     } else {
-    //       my.navigateTo({
-    //         url: data.url,
-    //       })
-    //     }
-    //   }
-    // }
-
-  },
-  //输码开锁检测
-  jiance1: function (source) {
-    var that = this;
-    let setting = my.getStorageSync({ 'key': 'setting' }).data
-    var userStatus = that.data.userStatus;
-    //未绑定手机号
-    if (userStatus.is_bind_mobile == 0) {
-      my.navigateTo({
-        url: '/pages/authorization/authorization',
-      })
-      //未实名认证
-    } else if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
-      my.navigateTo({
-        url: '/pages/real_name/real_name',
-      })
-    } else {
-      //有违章订单
-      if (that.data.userStatus.is_punishment) {
-        my.showToast({
-          content: '您当前有违章订单需要处理,请处理后再来用车吧',
-          icon: 'none'
-        })
-        return;
-      } else if (userStatus.is_ride_order != false && userStatus.is_ride_order != undefined) {
-        my.showToast({
-          content: '您有一个正在骑行中的订单',
-          icon: 'none'
-        })
-        return;
-      }
-      else {
-        //有待支付骑行订单
-        if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
-          my.showToast({
-            content: '你有未支付订单,请先支付',
-            icon: 'none'
-          })
-          return;
-        } else {
-          //没有押金没有免押券
-          if (userStatus.is_deposit == 0 && that.data.setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
-            console.log('没有押金没有免押券')
-            my.navigateTo({
-              url: '/pages/ride_zige/ride_zige',
-            })
-          } else {
-            my.navigateTo({
-              url: '/pages/inputcode/inputcode',
-            })
-          }
-        }
-      }
-    }
-  },
-  // 客服
-  kefu: function () {
-    my.makePhoneCall({
-      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
-    })
-  },
-
-  //附近还车点
-  findPark: function () {
-    my.navigateTo({
-      url: '/pages/parking/parking',
-    })
-  },
-  //关闭中间广告弹框
-  closeAdframe: function () {
-    this.setData({
-      adFrame: false
-    })
-  },
-  onHide: function () {
-    console.log('onHide')
-    this.setData({
-      bike_no: undefined,
-      background: false,
-      bluetooth: false,
-      location: false,
-      scanfail: false,
-      over1: false
-    })
-    // clearInterval(mytime)
-  },
-  // 去输码弹框
-  cancelErrFrame: function () {
-    this.setData({
-      scanCodeErr: false
-    })
-  },
-  goInputCode: function () {
-    my.navigateTo({
-      url: '/pages/inputcode/inputcode',
-    })
-  }
-})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+// index.js
+// 获取应用实例
+//获取应用实例
+// const log = require('../../utils/log')
+const { getCache, setCache, CacheKeys } = require('../../utils/cache')
+const app = getApp();
+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({
+  data: {
+    cardBottom: [
+      {
+        id: 1,
+        name: '故障上报',
+        icon: 'icon-banshou',
+        url: '/pages/breakdown/breakdown'
+      },
+      {
+        id: 2,
+        name: '输码用车',
+        icon: 'icon-17-saoma',
+        url: '/pages/inputcode/inputcode'
+
+      },
+      {
+        id: 3,
+        name: '计费规则',
+        icon: 'icon-wenhao',
+        url: '/pages/charge_rule/charge_rule'
+      },
+      {
+        id: 4,
+        name: '个人中心',
+        icon: 'icon-wode',
+        url: '/pages/mine/mine'
+      }
+    ],
+    adFrame: false,//首页中间广告弹框
+    markers: [], //显示单车、停车的P
+    polygons: [], //区域
+    longitude: '', //113.786111
+    latitude: '', //34.78304
+    height1: '', //兼容自定义导航栏的高度
+    id: '', //停车区域的ID
+    stopP: false, //判断是否显示停车区域
+    polygons1: [], //可骑行区域 先用这个变量代表
+    controls: [], //地图上当前定位的箭头                     
+    background: false, //弹窗的背景颜色 
+    realname: false, //当前是否已经实名
+    deposit: false, //当前是否交押金
+    userStatus: '', //用户的一些状态 是否交押金等   0                                                                                           
+    scanfail: false, //扫码失败弹窗
+    is_pay_order: false, //检测当前是否有订单未支付
+    is_ride_order: false,//是否有骑行中订单
+    is_punishment: false,//有违章订单
+    code: '', //点击立即用车 把编号赋值给code
+    over: false, //关闭图标
+    over1: false, //扫码失败关闭图标
+    location: '', //是否有位置权限
+    screenHeight: '', //屏幕可视高度
+    box_no: '', //中控编号
+    abnormal: '', //提示账号异常
+    mid: [],//顶部广告
+    ads: [],//首页中间广告
+    currentSwiper: 0,
+    center_currentSwiper: 0,
+    bike_no: undefined,
+    stopShow: false,
+    stop_info: [],
+    notice: [], //公告内容
+    animationData: {},
+    tabbar_index: 0,
+    zoom: 18,
+    versions: false, //版本过低弹窗
+    chooseSize: false,
+    animationData1: {},
+    arrowDown: '',
+    stop_type: '',
+    marqueePace: 0.6, //滚动速度
+    marqueeDistance: 520, //初始滚动距离 用到
+    size: 26, //通知公告用到
+    marqueeWidth: 560, //通知公告用到
+    length: '',//通知公告
+    swiperCurrent: 0,
+    midbolear: '',
+    per_money: '',
+    img: app.globalData.imgUrl,
+    new_user_coupons: [],
+    scanCodeErr: false,//扫码失败弹框
+    isScan: false
+  },
+
+  onLoad: function (query) {
+    var that = this;
+    console.log(my.getStorageSync({ 'key': 'token' }).data, 'yyyyyyyyyyyyyyy')
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    this.setData({
+      height1: app.globalData.statusBarHeight,
+      screenHeight: app.globalData.screenHeight
+    })
+    // this.reloadMap()
+  },
+  onShow: function () {
+    var that = this;
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    token = my.getStorageSync({ 'key': 'token' }).data
+    this.setData({
+      show: false,
+      midbolear: my.getStorageSync({ 'key': 'midTimes' }).data,
+      polygons: []
+    })
+    if (!this.data.isScan) {
+      app.login().then(res => {
+        console.log('YYYYYYYYYYYYY')
+        that.location()
+        that.getUser()
+        that.userState()
+      })
+    }
+    that.setData({
+      isScan: false
+    })
+  },
+  detail: function () {
+    var that = this;
+    if (that.data.mid[0].type == 'url') {
+      my.navigateTo({
+        url: '/' + that.data.mid[0].detail
+      })
+    }
+  },
+  //广告列表
+  adsList: function (id) {
+    var that = this;
+    var area_id = ''
+    if (id != undefined) {
+      area_id = id
+    } else {
+      area_id = 0
+    }
+    console.log(id, 'idididid')
+    let isCache = getCache('ads:' + id)
+
+    if (isCache) {
+      if (isCache == '') return
+      if (isCache instanceof Object && isCache.hasOwnProperty('header')) {
+  
+
+        that.setData({
+          ads: isCache.header
+        })
+      }
+      if (isCache instanceof Object && isCache.hasOwnProperty('mid')) {
+        that.setData({
+          mid: isCache.mid,
+          adFrame: true
+        })
+      }
+      return
+    }
+
+    app.request("/ads?area_id=" + area_id + "&position[]=mid&position[]=header&position[]=footer", '', "GET").then(res => {
+      console.log(res)
+      if (res.status == 200 && res.data != '') {
+        setCache('ads:' + id, res.data)
+        if (res.data.header) {
+          console.log(res.data, 'ppppppppppppppppppppppppp')
+          that.setData({
+            ads: res.data.header
+          })
+        }
+        if (res.data.mid) {
+
+          that.setData({
+            mid: res.data.mid,
+            adFrame: true
+          })
+        }
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  reloadMap(classname = 'bottom-bt') {
+    // let query = my.createSelectorQuery();
+    // let th = this;
+    // query.select('.' + classname).boundingClientRect(function (rect) {
+    //   if (rect != null && rect instanceof Object && rect.hasOwnProperty('height')) {
+    //     let height = rect.height;
+    //     th.setData({ mapHeight: 'calc(100vh - ' + height + 'px)' });
+    //   }
+    // }).exec();
+  },
+  //点击广告页
+  swiper: util.throttle(function (e) {
+    var type = e.currentTarget.dataset.type;
+    var index = e.currentTarget.dataset.index;
+    var name = e.currentTarget.dataset.name;
+    var detail = e.currentTarget.dataset.detail;
+    var id = e.currentTarget.dataset.id;
+    if (type != 'clilk_null') {
+      if (type == 'wxUrl') {
+        my.navigateTo({
+          url: '/' + detail,
+        })
+      } else if (type == 'phone') {
+        my.makePhoneCall({
+          number: detail,
+        })
+      } else if (type == 'toMiniProgram') {
+        my.navigateToMiniProgram({
+          appId: detail,
+          extraData: {
+            foo: 'bar'
+          },
+          // envVersion: 'develop',
+          success(res) {
+            // 打开成功
+          }
+        })
+      } else {
+        my.navigateTo({
+          url: '../swiper/swiper?type=' + type + '&url=' + id + '&name=' + name + '&detail=' + detail,
+        })
+      }
+    }
+  }, 1000),
+  //点击轮播图
+  swiperChange: function (e) {
+    if (this.data.currentSwiper == 0 && this.data.swiperCurrent > 1) { //卡死时,重置current为正确索引
+      this.setData({
+        currentSwiper: this.data.swiperCurrent
+      });
+    } else { //正常轮转时,记录正确页码索引
+      this.setData({
+        swiperCurrent: e.detail.current
+      });
+    }
+  },
+  //通知公告
+  getNotice(id) {
+    let data = {
+      'area_id': id
+    }
+
+    let isCache = getCache('Notice:' + id)
+    if (isCache) {
+      if (isCache instanceof Object && !isCache.hasOwnProperty('id')) return
+      this.setData({ notice: isCache })
+      var length = isCache.description.length * this.data.size; //计算文字的长度
+      this.setData({
+        length: length
+      })
+      if (this.data.length > this.data.marqueeWidth) {
+        this.noticeRun();
+      } else {
+        this.setData({
+          marqueeDistance: 0
+        })
+      }
+      return
+    }
+
+
+    app.request("/index/an", data, "GET").then(res => {
+      console.log(res)
+      if (200 == res.status && res.data.id) {
+        setCache('Notice:' + id, res.data)
+        this.setData({ notice: res.data })
+        var length = res.data.description.length * this.data.size; //计算文字的长度
+        this.setData({
+          length: length
+        })
+        if (this.data.length > this.data.marqueeWidth) {
+          this.noticeRun();
+        } else {
+          this.setData({
+            marqueeDistance: 0
+          })
+        }
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  noticeRun: function () {
+    var that = this;
+    mytime = setInterval(function () {
+      if (-that.data.marqueeDistance < that.data.length) {
+        that.setData({
+          marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
+        })
+      } else {
+        clearInterval(mytime);
+        that.setData({
+          marqueeDistance: that.data.marqueeWidth
+        });
+        that.noticeRun();
+      }
+    }, 10)
+  },
+  //定位当前位置
+  posi: util.throttle(function () {
+    //点击定位  
+    //这是一段注
+    var that = this;
+    my.showLoading({
+      content: '定位中'
+    })
+    my.getLocation({
+      type: 'gcj02',
+      success: (res) => {
+        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
+        my.hideLoading()
+        that.setData({
+          longitude: res.longitude,
+          latitude: res.latitude
+        })
+      },
+      fail: function (err) {
+        console.log(err, '用户授权失败')
+        if (err.error == 11) {
+          my.showAuthGuide({
+            authType: 'LBS',
+            success: (res) => {
+
+            },
+            fail: (error) => {
+              my.alert({ content: '获取位置授权失败' });
+            },
+          });
+        }
+        my.hideLoading()
+        my.showToast({
+          content: '定位失败',
+          icon: 'none'
+        })
+      }
+      // fail: function (err) {
+      //   my.hideLoading()
+      //   console.log(err, '定位失败打印')
+      //   my.showToast({
+      //     content: '定位失败',
+      //     icon: 'none'
+      //   })
+      // }
+    })
+  }, 1000),
+  //点击扫描二维码
+  sweepCode: util.throttle(function () {
+    let that = this
+    console.log('点击扫码,‘iooooo')
+    if (!that.data.latitude && !that.data.longitude) {
+      that.setData({
+        background: true,
+        location: true
+      })
+    } else {
+      that.sweep_code()
+    }
+  }, 1500),
+  //骑行区禁停区车辆
+  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;
+          console.log(data, '区域')
+          let id = data.id
+          this.getNotice(id)
+          if (data.points != []) {
+            that.setData({
+              id: data.id,
+              polygons1: that.data.polygons.concat(data),
+              setting: data.setting,
+              per_money: Number(data.setting.starting_price),
+              polygons: []
+            })
+            if (!data.id) return
+
+            that.adsList(data.id),
+              that.ban_stop(data.id), that.setData({
+                polygons: that.data.polygons.concat(data)
+              })
+          }
+          if (res.status == 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': '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, 'lkkkkk')
+        // if (err.data.message == "该附近暂无运营区域") {
+        //   my.removeStorageSync({ key: 'setting' })
+        //   my.removeStorageSync({ key: 'home' })
+        // }
+        my.alert({
+          title: '提示',
+          content: err.data.message,
+        })
+      })
+    }
+  },
+  //停车区域
+  ban_stop: function (id) {
+    var that = this;
+    var data1 = {
+      'area_id': id
+    }
+    let isCache = getCache('BAN_STOP:' + id)
+    if (isCache) {
+      that.setData({
+        markers: that.data.markers.concat(isCache.centres),
+        polygons: that.data.polygons1.concat(isCache.polygons),
+      })
+      return
+    }
+    app.request('/parking/stop-sites', data1, 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        var data = res.data
+        setCache('BAN_STOP:' + id, data)
+        that.setData({
+          polygons2: data.polygons,
+          markers: that.data.markers.concat(data.centres),
+          polygons: that.data.polygons1.concat(data.polygons)
+        })
+      }
+    })
+  },
+  //附近车辆坐标
+  nearbyCars: function () {
+    //附近的车
+    var that = this;
+    that.setData({
+      markers: []
+    })
+    var data = {
+      "lat": that.data.latitude,
+      "lng": that.data.longitude
+    }
+    app.request("/bikes", data, "POST").then(res => {
+      // console.log(res)
+      if (res.status == 200) {
+        var makers = res.data
+        if (makers == '') {
+          my.showToast({
+            content: '附近暂无车辆',
+            icon: 'none'
+          })
+          that.setData({
+            markers: []
+          })
+        } else {
+          that.setData({
+            markers: makers
+          })
+        }
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+
+  //点击刷新
+  refresh: util.throttle(function () {
+
+    var that = this;
+    that.setData({
+      polygons: []
+    })
+    if (this.data.stopP == true) {
+      that.stopP(), my.showToast({
+        content: '刷新成功',
+        icon: 'none'
+      })
+    } else {
+      this.location(),
+        my.showToast({
+          content: '刷新成功',
+          icon: 'none'
+        })
+    }
+  }, 1500),
+  //    //点击去实名认证
+  authentication: util.throttle(function () {
+    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',
+      })
+    } else if (state.is_bind_mobile == 1) {
+      my.navigateTo({
+        url: '/pages/real_name/real_name?state2=2&index=1',
+      })
+    }
+    this.setData({
+      background: false,
+      realname: false,
+      over: false
+    })
+  }, 1500),
+  //点击扫码开锁
+  sweep_code: util.throttle(function () {
+    var that = this;
+    console.log('ooooooo')
+    var userStatus = that.data.userStatus;
+    var setting = my.getStorageSync({ 'key': 'setting' }).data
+    if (!setting) {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区,暂不可用车'
+      })
+    } else {
+      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
+    //未绑定手机号
+    if (userStatus.is_bind_mobile == 0) {
+      my.navigateTo({
+        url: '/pages/authorization/authorization',
+      })
+      //未实名认证
+    } else if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
+      my.navigateTo({
+        url: '/pages/real_name/real_name',
+      })
+    } else {
+      //有违章订单
+      if (userStatus.is_punishment) {
+        my.showToast({
+          content: '您当前有违章订单需要处理,请处理后再来用车吧',
+          icon: 'none'
+        })
+        return;
+      } else if (userStatus.is_ride_order != false && userStatus.is_ride_order != undefined) {
+        my.showToast({
+          content: '您有一个正在骑行中的订单',
+          icon: 'none'
+        })
+        return;
+      } else {
+        //有待支付骑行订单
+        if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
+          my.showToast({
+            content: '你有未支付订单,请先支付',
+            icon: 'none'
+          })
+          return;
+        } else {
+          //没有押金没有免押券
+          if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
+            console.log('没有押金没有免押券')
+            my.navigateTo({
+              url: '/pages/ride_zige/ride_zige',
+            })
+            // my.navigateTo({
+            //   url: '/pages/inputcode/inputcode',
+            // })
+          } else {
+            that.saoMa()
+          }
+        }
+      }
+    }
+  },
+  //扫码事件
+  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.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, '错误码')
+          // my.showModal({
+          //   title:'提示',
+          //   content:'非法码,请核对车码',
+          //   showCancel:false
+          // })
+          that.setData({
+            scanCodeErr: true
+          })
+        }
+      },
+      fail: function (err) {
+        console.log('tuihui')
+        // that.setData({
+        //   scanCodeErr: true
+        // })
+      }
+    })
+  },
+  //获取车辆信息
+  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 {
+        my.alert({
+          title: '提示',
+          content: res.data.message,
+        })
+      }
+    })
+
+  },
+  //去支付未支付订单
+  go_pay: util.throttle(function () {
+    //点击去支付
+    this.setData({
+      is_pay_order: false,
+    })
+    var pay_order = ''
+    if (this.data.userStatus.is_pay_order !== false && this.data.userStatus.is_pay_order !== undefined) {
+      pay_order = this.data.userStatus.is_pay_order
+    }
+    my.navigateTo({
+      url: '/pages/pay/pay?order=' + pay_order,
+    })
+  }, 1500),
+  //点击查看正在进行中的订单
+  goUseBike: function () {
+    console.log(this.data.is_ride_order, 'this.data.is_ride_order')
+    my.navigateTo({
+      url: '/pages/use_bike/use_bike?order=' + this.data.is_ride_order,
+    })
+  },
+  //有违章订单 
+  havePunishment: function () {
+    my.navigateTo({
+      url: '/pages/weizhang/weizhang',
+    })
+  },
+
+  onReady: function () {
+
+  },
+  kefu: util.throttle(function () {
+    my.makePhoneCall({
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
+    })
+  }, 1500),
+  //用户状态
+  userState: function (id) {
+    var that = this;
+    app.request("/user/status", "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 })
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+
+  },
+  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)
+    })
+  },
+  go_setting: util.throttle(function () {
+    //点击去设置位置权限
+    this.setData({
+      background: false,
+      location: false
+    })
+    my.openSetting({
+      success: function (res) {
+      }
+    })
+  }, 1500),
+
+  //点击已开启位置权限
+  open: util.throttle(function () {
+    this.setData({
+      background: false,
+      location: false
+    })
+  }, 1500),
+
+  location: function () {
+    //获取当前经纬度 如果未授权让用户去授权
+    console.log('dingwei')
+    var that = this;
+    my.showLoading({
+      content: '定位中...',
+      mask: true
+    })
+    my.getLocation({
+      type: 'gcj02',
+      success: (res) => {
+        console.log('经纬度为:+++++++++++++++++++++' + res.latitude + '++++++++' + res.longitude)
+        that.setData({
+          longitude: res.longitude,
+          latitude: res.latitude,
+          show: false
+        })
+        console.log(res, 'ppp')
+        that.home(), that.nearbyCars()
+        if (that.data.stopP == false) {
+          console.log('false')
+        } else {
+          that.stop()
+        }
+        my.hideLoading()
+      },
+      fail: function (err) {
+        console.log(err, '用户授权失败')
+        if (err.error == 11) {
+
+          my.showAuthGuide({
+            authType: 'LBS',
+            success: (res) => {
+
+            },
+            fail: (error) => {
+              my.alert({ content: '获取位置授权失败' });
+            },
+          });
+
+        }
+        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
+              })
+            }
+          }
+        })
+      }
+    })
+  },
+
+  //底部跳转页面按钮(用户未授权和未实名认证的时候不可以跳转)
+  skipPage: function (e) {
+
+    let data = e.target.dataset.id
+    let that = this
+    console.log(that.data, 'oooooo')
+
+    var userStatus = that.data.userStatus;
+    var setting = my.getStorageSync({ 'key': 'setting' }).data
+    if (data.id == 2 && !that.data.latitude && !that.data.longitude) {
+      that.setData({
+        background: true,
+        location: true
+      })
+      return
+    }
+    if (data.id == 2 && !setting) {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区,暂不可用车'
+      })
+
+      return
+    }
+    if (data.id == 2 && setting) {
+      if (!userStatus) {
+        my.navigateTo({
+          url: '/pages/authorization/authorization',
+        })
+      }
+      else {
+        that.jiance1();
+      }
+    } else {
+      my.navigateTo({
+        url: data.url,
+      })
+    }
+
+
+
+    // if (!that.data.latitude && !that.data.longitude) {
+    //   that.setData({
+    //     background: true,
+    //     location: true
+    //   })
+    // } else {
+    //   if (data.id == 2) {
+    //     console.log(that.data.userStatus, '')
+    //     if (!setting) {
+    //       my.alert({
+    //         title: '提示',
+    //         content: '您附近暂无运营区,暂不可用车'
+    //       })
+    //     }
+    //     else {
+    //       if (!userStatus) {
+    //         my.navigateTo({
+    //           url: '/pages/authorization/authorization',
+    //         })
+    //       }
+    //       else {
+    //         that.jiance1();
+    //       }
+    //     }
+    //   } else if (data.id == 4) {
+    //     if (userStatus.is_bind_mobile == 0) {
+    //       my.navigateTo({
+    //         url: '/pages/authorization/authorization',
+    //       })
+    //     } else {
+    //       my.navigateTo({
+    //         url: data.url,
+    //       })
+    //     }
+    //   }
+    //   else {
+    //     if (!userStatus) {
+    //       my.navigateTo({
+    //         url: '/pages/authorization/authorization',
+    //       })
+    //     } else {
+    //       my.navigateTo({
+    //         url: data.url,
+    //       })
+    //     }
+    //   }
+    // }
+
+  },
+  //输码开锁检测
+  jiance1: function (source) {
+    var that = this;
+    let setting = my.getStorageSync({ 'key': 'setting' }).data
+    var userStatus = that.data.userStatus;
+    //未绑定手机号
+    if (userStatus.is_bind_mobile == 0) {
+      my.navigateTo({
+        url: '/pages/authorization/authorization',
+      })
+      //未实名认证
+    } else if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
+      my.navigateTo({
+        url: '/pages/real_name/real_name',
+      })
+    } else {
+      //有违章订单
+      if (that.data.userStatus.is_punishment) {
+        my.showToast({
+          content: '您当前有违章订单需要处理,请处理后再来用车吧',
+          icon: 'none'
+        })
+        return;
+      } else if (userStatus.is_ride_order != false && userStatus.is_ride_order != undefined) {
+        my.showToast({
+          content: '您有一个正在骑行中的订单',
+          icon: 'none'
+        })
+        return;
+      }
+      else {
+        //有待支付骑行订单
+        if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
+          my.showToast({
+            content: '你有未支付订单,请先支付',
+            icon: 'none'
+          })
+          return;
+        } else {
+          //没有押金没有免押券
+          if (userStatus.is_deposit == 0 && that.data.setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
+            console.log('没有押金没有免押券')
+            my.navigateTo({
+              url: '/pages/ride_zige/ride_zige',
+            })
+          } else {
+            my.navigateTo({
+              url: '/pages/inputcode/inputcode',
+            })
+          }
+        }
+      }
+    }
+  },
+  // 客服
+  kefu: function () {
+    my.makePhoneCall({
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
+    })
+  },
+
+  //附近还车点
+  findPark: function () {
+    my.navigateTo({
+      url: '/pages/parking/parking',
+    })
+  },
+  //关闭中间广告弹框
+  closeAdframe: function () {
+    this.setData({
+      adFrame: false
+    })
+  },
+  onHide: function () {
+    console.log('onHide')
+    this.setData({
+      bike_no: undefined,
+      background: false,
+      bluetooth: false,
+      location: false,
+      scanfail: false,
+      over1: false
+    })
+    clearInterval(mytime)
+  },
+  // 去输码弹框
+  cancelErrFrame: function () {
+    this.setData({
+      scanCodeErr: false
+    })
+  },
+  goInputCode: function () {
+    my.navigateTo({
+      url: '/pages/inputcode/inputcode',
+    })
+  },
+
+})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 2 - 2
pages/index/index.json

@@ -1,3 +1,3 @@
-{
-  "usingComponents": {}
+{
+  "usingComponents": {}
 }

+ 81 - 81
pages/inputcode/inputcode.acss

@@ -1,82 +1,82 @@
-/* required by usingComponents */
-
-/* pages/scancode/scancode.wxss */
-
-.top-img {
-  text-align: center;
-  margin-top: 50rpx;
-}
-
-.bike-image {
-  width: 500rpx;
-  height: 220rpx;
-  margin: 0 auto;
-}
-
-.title {
-  text-align: center;
-  font-size: 34rpx;
-  font-weight: 500;
-  margin-top: 40rpx;
-}
-
-.btm_center {
-  text-align: center;
-  /* border: 1px solid #ff0; */
-  margin-top: 20rpx;
-  padding: 30rpx;
-}
-
-.btm_center .query_num_block {
-  display: -webkit-flex;
-  display: flex;
-  justify-content: space-between;
-}
-
-.btm_center .num_item_block {
-  /* height: 55rpx;
-  width: 100rpx; */
-  padding: 5rpx 7rpx;
-  margin-left: 15rpx;
-  background-color: #eeeeee;
-  height: 70rpx;
-  text-align: center;
-  font-size: 34rpx;
-}
-
-.hidden_ipt {
-  height: 0rpx;
-  width: 0rpx;
-  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;
-  margin-top: 30rpx;
-}
-
-.sure-buttom {
-  background-color: var(--globleColor);
-  font-weight: 600;
-   color: var(--fontColor);
-}
-
-.code-number {
-  width: 100%;
-  height: 70rpx;
-  line-height: 70rpx;
-  padding-left: 30rpx;
-  background-color: #ffffff;
-  border-radius: 12rpx;
-  border: solid 1rpx var(--globleColor)
+/* required by usingComponents */
+
+/* pages/scancode/scancode.wxss */
+
+.top-img {
+  text-align: center;
+  margin-top: 50rpx;
+}
+
+.bike-image {
+  width: 500rpx;
+  height: 220rpx;
+  margin: 0 auto;
+}
+
+.title {
+  text-align: center;
+  font-size: 34rpx;
+  font-weight: 500;
+  margin-top: 40rpx;
+}
+
+.btm_center {
+  text-align: center;
+  /* border: 1px solid #ff0; */
+  margin-top: 20rpx;
+  padding: 30rpx;
+}
+
+.btm_center .query_num_block {
+  display: -webkit-flex;
+  display: flex;
+  justify-content: space-between;
+}
+
+.btm_center .num_item_block {
+  /* height: 55rpx;
+  width: 100rpx; */
+  padding: 5rpx 7rpx;
+  margin-left: 15rpx;
+  background-color: #eeeeee;
+  height: 70rpx;
+  text-align: center;
+  font-size: 34rpx;
+}
+
+.hidden_ipt {
+  height: 0rpx;
+  width: 0rpx;
+  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;
+  margin-top: 30rpx;
+}
+
+.sure-buttom {
+  background-color: var(--globleColor);
+  font-weight: 600;
+   color: var(--fontColor);
+}
+
+.code-number {
+  width: 100%;
+  height: 70rpx;
+  line-height: 70rpx;
+  padding-left: 30rpx;
+  background-color: #ffffff;
+  border-radius: 12rpx;
+  border: solid 1rpx var(--globleColor)
 }

+ 11 - 11
pages/inputcode/inputcode.axml

@@ -1,12 +1,12 @@
-<!--pages/inputcode/inputcode.wxml-->
-<view class="inputcode">
-  <view class="top-img">
-    <image src="../../img/bike.jpg" class="bike-image"></image>
-  </view>
-  <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:90%"></input>
-  </view>
-  <view onTap="sureSubmit" class="{{submitState==0 ? 'buttom' : 'sure-buttom'}}">确定</view>
+<!--pages/inputcode/inputcode.wxml-->
+<view class="inputcode">
+  <view class="top-img">
+    <image src="../../img/bike.jpg" class="bike-image"></image>
+  </view>
+  <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:90%"></input>
+  </view>
+  <view onTap="sureSubmit" class="{{submitState==0 ? 'buttom' : 'sure-buttom'}}">确定</view>
 </view>

+ 133 - 133
pages/inputcode/inputcode.js

@@ -1,134 +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()
-    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 () {
-
-  }
+// 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 () {
+
+  }
 })

+ 9 - 9
pages/logs/logs.acss

@@ -1,9 +1,9 @@
-/* required by usingComponents */
-.log-list {
-  display: flex;
-  flex-direction: column;
-  padding: 40rpx;
-}
-.log-item {
-  margin: 10rpx;
-}
+/* required by usingComponents */
+.log-list {
+  display: flex;
+  flex-direction: column;
+  padding: 40rpx;
+}
+.log-item {
+  margin: 10rpx;
+}

+ 155 - 155
pages/mine/mine.acss

@@ -1,155 +1,155 @@
-/* required by usingComponents */
-/* pages/mine/mine.wxss */
-page{
-  background: #ffffff;
-}
-.mine {
-  padding: 30rpx;
-  border-top: solid 1rpx #f2f3f5;
-
-}
-
-.mine-top {
-  display: flex;
-  margin-top: 50rpx;
-}
-
-.avator {
-  flex: 0 0 100rpx;
-  height: 100rpx;
-  border-radius: 50%;
-  overflow: hidden;
-}
-
-.avator-image {
-  height: 100rpx;
-  width: 100rpx;
-}
-
-.mine-phone {
-  flex: 1;
-  height: 100rpx;
-  line-height: 100rpx;
-  margin-left: 30rpx;
-  font-size: 34rpx;
-  font-weight: bold;
-}
-/* .tongbu{
-  display: block;
-  font-size:28rpx;
-} */
-.iconfont {
-  height: 100rpx;
-  line-height: 100rpx;
-  color: #cccccc;
-}
-
-.mine-ad {
-  height: 70rpx;
-  background-color: #feebe5;
-  line-height: 70rpx;
-  color: #ed3736;
-  font-size: 24rpx;
-  border-radius: 12rpx;
-  padding: 0 30rpx;
-  margin-top: 40rpx;
-}
-
-.mine-tab {
-  display: flex;
-  justify-content: space-between;
-  flex-direction: row;
-  flex-wrap: wrap;
-  margin-top: 70rpx;
-}
-
-.mine-tab-item {
-  flex: 1;
-  text-align: center;
-}
-
-.tab-num {
-  font-size: 36rpx;
-  font-weight: bold;
-}
-
-.tab-text {
-  margin-top: 10rpx;
-  font-size: 28rpx;
-}
-
-.mine-card {
-  padding: 40rpx;
-  margin-top: 50rpx;
-  border-radius: 12rpx;
-  background: linear-gradient(to right, #f9c500, #ff8705);
-}
-
-.card-left {
-  display: inline-block;
-  vertical-align: middle;
-  color: #fff;
-}
-
-.left-title {
-  font-size: 32rpx;
-  font-weight: bold;
-}
-
-.left-text {
-  font-size: 24rpx;
-  margin-top: 10rpx;
-}
-
-.card-right {
-  display: inline-block;
-  vertical-align: middle;
-  background-color: #fff;
-  height: 60rpx;
-  line-height: 60rpx;
-  padding: 0 30rpx;
-  float: right;
-  border-radius: 40rpx;
-  margin: 10rpx;
-  font-size: 26rpx;
-}
-.mine-list{
-  margin-top: 30rpx;
-  box-shadow: 0 0 15px #f5f4f4;
-  padding:0 30rpx;
-  margin-bottom: 100rpx;
-}
-.list-icon{
-  font-size:34rpx;
-  color: #333333;
-  font-weight: 500;
-  display: inline-block;
-  margin-right: 20rpx;
-}
-.list-item{
-  height: 100rpx;
-  line-height: 100rpx;
-  font-size: 28rpx;
-  border-bottom: solid 1rpx #e5e5e5;
-}
-.list-item:last-child{
-  border:none
-}
-.zhifufen{
-color: var(--greenButton);
-}
-.right-arrow{
-  font-size: 28rpx;
-  float: right;
-}
-.right-text{
-  float: right;
-  font-size: 22rpx;
-
-  color: #cccccc;
-}
-.zige{
-  font-size: 28rpx;
-  font-weight: 400;
-  color: #ed3736;
-}
+/* required by usingComponents */
+/* pages/mine/mine.wxss */
+page{
+  background: #ffffff;
+}
+.mine {
+  padding: 30rpx;
+  border-top: solid 1rpx #f2f3f5;
+
+}
+
+.mine-top {
+  display: flex;
+  margin-top: 50rpx;
+}
+
+.avator {
+  flex: 0 0 100rpx;
+  height: 100rpx;
+  border-radius: 50%;
+  overflow: hidden;
+}
+
+.avator-image {
+  height: 100rpx;
+  width: 100rpx;
+}
+
+.mine-phone {
+  flex: 1;
+  height: 100rpx;
+  line-height: 100rpx;
+  margin-left: 30rpx;
+  font-size: 34rpx;
+  font-weight: bold;
+}
+/* .tongbu{
+  display: block;
+  font-size:28rpx;
+} */
+.iconfont {
+  height: 100rpx;
+  line-height: 100rpx;
+  color: #cccccc;
+}
+
+.mine-ad {
+  height: 70rpx;
+  background-color: #feebe5;
+  line-height: 70rpx;
+  color: #ed3736;
+  font-size: 24rpx;
+  border-radius: 12rpx;
+  padding: 0 30rpx;
+  margin-top: 40rpx;
+}
+
+.mine-tab {
+  display: flex;
+  justify-content: space-between;
+  flex-direction: row;
+  flex-wrap: wrap;
+  margin-top: 70rpx;
+}
+
+.mine-tab-item {
+  flex: 1;
+  text-align: center;
+}
+
+.tab-num {
+  font-size: 36rpx;
+  font-weight: bold;
+}
+
+.tab-text {
+  margin-top: 10rpx;
+  font-size: 28rpx;
+}
+
+.mine-card {
+  padding: 40rpx;
+  margin-top: 50rpx;
+  border-radius: 12rpx;
+  background: linear-gradient(to right, #f9c500, #ff8705);
+}
+
+.card-left {
+  display: inline-block;
+  vertical-align: middle;
+  color: #fff;
+}
+
+.left-title {
+  font-size: 32rpx;
+  font-weight: bold;
+}
+
+.left-text {
+  font-size: 24rpx;
+  margin-top: 10rpx;
+}
+
+.card-right {
+  display: inline-block;
+  vertical-align: middle;
+  background-color: #fff;
+  height: 60rpx;
+  line-height: 60rpx;
+  padding: 0 30rpx;
+  float: right;
+  border-radius: 40rpx;
+  margin: 10rpx;
+  font-size: 26rpx;
+}
+.mine-list{
+  margin-top: 30rpx;
+  box-shadow: 0 0 15px #f5f4f4;
+  padding:0 30rpx;
+  margin-bottom: 100rpx;
+}
+.list-icon{
+  font-size:34rpx;
+  color: #333333;
+  font-weight: 500;
+  display: inline-block;
+  margin-right: 20rpx;
+}
+.list-item{
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  border-bottom: solid 1rpx #e5e5e5;
+}
+.list-item:last-child{
+  border:none
+}
+.zhifufen{
+color: var(--greenButton);
+}
+.right-arrow{
+  font-size: 28rpx;
+  float: right;
+}
+.right-text{
+  float: right;
+  font-size: 22rpx;
+
+  color: #cccccc;
+}
+.zige{
+  font-size: 28rpx;
+  font-weight: 400;
+  color: #ed3736;
+}

+ 69 - 69
pages/mine/mine.axml

@@ -1,70 +1,70 @@
-<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-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==6}}">
-    您已获得终身免押资格!
-  </view>
-  <view class="mine-tab">
-    <view class="mine-tab-item" onTap="balance">
-      <view class="tab-num">¥{{userInfo.wallet_money | parseFloat}}</view>
-      <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" a:if="{{userInfo.user.is_deposit == 1 &&  userInfo.user.deposit_money>0}}" onTap="backDeposit">
-      <text class="iconfont icon-tongqian list-icon"></text>
-      <text>退还押金</text>
-      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
-    </view>
-    <view class="list-item" onTap="trip">
-      <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-ad" onTap="adDetail" a:if="{{deposit.is_deposit==1 && deposit.deposit_type==6}}">
+    您已获得终身免押资格!
+  </view>
+  <view class="mine-tab">
+    <view class="mine-tab-item" onTap="balance">
+      <view class="tab-num">¥{{userInfo.wallet_money | parseFloat}}</view>
+      <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" a:if="{{userInfo.user.is_deposit == 1 &&  userInfo.user.deposit_money>0}}" onTap="backDeposit">
+      <text class="iconfont icon-tongqian list-icon"></text>
+      <text>退还押金</text>
+      <text class="iconfont icon-iconfontjiantou2 right-arrow"></text>
+    </view>
+    <view class="list-item" onTap="trip">
+      <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>

+ 190 - 190
pages/mine/mine.js

@@ -1,191 +1,191 @@
-// 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= 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 () {
-    console.log(my.getStorageSync({ 'key': 'home' }).data)
-    if (!my.getStorageSync({ 'key': 'home' }).data) {
-      my.alert({
-        title: '提示',
-        content: '您附近暂无运营区',
-      })
-    } else {
-      my.navigateTo({
-        url: '/pages/ride_zige/ride_zige',
-      })
-    }
-
-  },
-  setUp: function () {
-    my.navigateTo({
-      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'
-    })
-  },
-  //退还押金
-  backDeposit: function () {
-    my.navigateTo({
-      url: '/pages/ride_zige/ride_zige',
-    })
-  },
+// 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= 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 () {
+    console.log(my.getStorageSync({ 'key': 'home' }).data)
+    if (!my.getStorageSync({ 'key': 'home' }).data) {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区',
+      })
+    } else {
+      my.navigateTo({
+        url: '/pages/ride_zige/ride_zige',
+      })
+    }
+
+  },
+  setUp: function () {
+    my.navigateTo({
+      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'
+    })
+  },
+  //退还押金
+  backDeposit: function () {
+    my.navigateTo({
+      url: '/pages/ride_zige/ride_zige',
+    })
+  },
 })

+ 58 - 58
pages/mine_card/mine_card.acss

@@ -1,59 +1,59 @@
-/* required by usingComponents */
-/* pages/mine_card/mine_card.wxss */
-page{
-  border-top: solid 1rpx #f2f3f5;
-background: #fff;
-}
-.card {
-  margin: 30rpx;
-  padding: 30rpx;
-  background-color: #f2b80c;
-  border-radius: 12rpx;
-  color: #fff;
- 
-}
-
-.card {
-  display: flex;
-}
-
-.card-left {
-  flex: 1;
-}
-
-.card-title {
-  font-size: 40rpx;
-  font-weight: bold;
-}
-
-.card-text1 {
-  margin-top: 20rpx;
-  font-size: 28rpx;
-}
-
-.card-text2 {
-  margin-top: 50rpx;
-  font-size: 26rpx;
-}
-
-.card-right image {
-  height: 150rpx;
-  width: 150rpx;
-}
-.user-tip{
-text-align: center;
-font-size: 24rpx;
-color: var(--globleColor);
-}
-/* pages/my_card/my_card.wxss */
-.no-card {
-  color: #979797;
-  text-align: center;
-  margin-top: 45%;
-  font-size: 26rpx;
-}
-.no-card image{
-  height: 150rpx;
-  width: 150rpx;
-  margin-bottom: 30rpx;
+/* required by usingComponents */
+/* pages/mine_card/mine_card.wxss */
+page{
+  border-top: solid 1rpx #f2f3f5;
+background: #fff;
+}
+.card {
+  margin: 30rpx;
+  padding: 30rpx;
+  background-color: #f2b80c;
+  border-radius: 12rpx;
+  color: #fff;
+ 
+}
+
+.card {
+  display: flex;
+}
+
+.card-left {
+  flex: 1;
+}
+
+.card-title {
+  font-size: 40rpx;
+  font-weight: bold;
+}
+
+.card-text1 {
+  margin-top: 20rpx;
+  font-size: 28rpx;
+}
+
+.card-text2 {
+  margin-top: 50rpx;
+  font-size: 26rpx;
+}
+
+.card-right image {
+  height: 150rpx;
+  width: 150rpx;
+}
+.user-tip{
+text-align: center;
+font-size: 24rpx;
+color: var(--globleColor);
+}
+/* pages/my_card/my_card.wxss */
+.no-card {
+  color: #979797;
+  text-align: center;
+  margin-top: 45%;
+  font-size: 26rpx;
+}
+.no-card image{
+  height: 150rpx;
+  width: 150rpx;
+  margin-bottom: 30rpx;
 }

+ 52 - 52
pages/mine_card/mine_card.js

@@ -1,53 +1,53 @@
-// pages/mine_card/mine_card.js
-var app = getApp()
-Page({
-
-  data: {
-    cardList: []
-  },
-  onLoad: function (options) {
-    var that = this;
-    my.showLoading({
-      content: '加载中...',
-      mask: true
-    })
-    app.request("/card_riding/user_card", '', "GET").then(res => {
-      console.log(res)
-      my.hideLoading({
-        complete: (res) => { },
-      })
-      if (res.data.data == '') {
-        return;
-      }
-      that.setData({ cardList: res.data})
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  },
-  useRules: function () {
-    my.navigateTo({
-      url:'/pages/user_rules/user_rules',
-    })
-  }
+// pages/mine_card/mine_card.js
+var app = getApp()
+Page({
+
+  data: {
+    cardList: []
+  },
+  onLoad: function (options) {
+    var that = this;
+    my.showLoading({
+      content: '加载中...',
+      mask: true
+    })
+    app.request("/card_riding/user_card", '', "GET").then(res => {
+      console.log(res)
+      my.hideLoading({
+        complete: (res) => { },
+      })
+      if (res.data.data == '') {
+        return;
+      }
+      that.setData({ cardList: res.data})
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+  useRules: function () {
+    my.navigateTo({
+      url:'/pages/user_rules/user_rules',
+    })
+  }
 })

+ 26 - 26
pages/mine_data/mine_data.acss

@@ -1,27 +1,27 @@
-/* required by usingComponents */
-/* pages/mine_data/mine_data.wxss */
-page{
-  background-color: #f2f3f5;
-  padding-top: 20rpx
-}
-.mine-data{
-/* margin-top: 20rpx; */
-}
-.mine-data-list{
-  background-color: #fff;
-  padding: 0 40rpx;
-}
-.list-item{
-  height: 100rpx;
-  line-height: 100rpx;
-  font-size: 28rpx;
-  border-bottom: solid 1rpx #e5e5e5;
-}
-.list-item:last-child{
-  border: none;
-}
-.iconfont{
-float: right;
-font-size: 28rpx;
-color: #cccccc;
+/* required by usingComponents */
+/* pages/mine_data/mine_data.wxss */
+page{
+  background-color: #f2f3f5;
+  padding-top: 20rpx
+}
+.mine-data{
+/* margin-top: 20rpx; */
+}
+.mine-data-list{
+  background-color: #fff;
+  padding: 0 40rpx;
+}
+.list-item{
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  border-bottom: solid 1rpx #e5e5e5;
+}
+.list-item:last-child{
+  border: none;
+}
+.iconfont{
+float: right;
+font-size: 28rpx;
+color: #cccccc;
 }

+ 14 - 14
pages/mine_data/mine_data.axml

@@ -1,15 +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 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 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>

+ 40 - 40
pages/my_account/my_account.acss

@@ -1,41 +1,41 @@
-/* required by usingComponents */
-/* pages/my_mobile/my_mobile.wxss */
-.phone {
-  width: 100%;
-  /* height: auto; */
-}
-
-.phone-num {
-  text-align: center;
-  font-size: 34rpx;
-  font-weight: bold;
-  margin-top: 30rpx;
-  margin-bottom: 80rpx;
-}
-
-.tips {
-  display: flex;
-  width: 70%;
-  margin: 0 auto;
-  font-size: 28rpx;
-  line-height:46rpx;
-  color: #868686;
-  margin-top: 30rpx;
-}
-
-.left {
-  flex: 0 0 20rpx;
-}
-.change-mobile{
-width: 50%;
-height: 100rpx;
-line-height:100rpx;
-margin: 0 auto;
-border-radius: 50rpx;
-text-align: center;
-font-size: 34rpx;
-font-weight: 500;
-margin-top:150rpx;
-background-color: var(--globleColor);
- color: var(--fontColor);
+/* required by usingComponents */
+/* pages/my_mobile/my_mobile.wxss */
+.phone {
+  width: 100%;
+  /* height: auto; */
+}
+
+.phone-num {
+  text-align: center;
+  font-size: 34rpx;
+  font-weight: bold;
+  margin-top: 30rpx;
+  margin-bottom: 80rpx;
+}
+
+.tips {
+  display: flex;
+  width: 70%;
+  margin: 0 auto;
+  font-size: 28rpx;
+  line-height:46rpx;
+  color: #868686;
+  margin-top: 30rpx;
+}
+
+.left {
+  flex: 0 0 20rpx;
+}
+.change-mobile{
+width: 50%;
+height: 100rpx;
+line-height:100rpx;
+margin: 0 auto;
+border-radius: 50rpx;
+text-align: center;
+font-size: 34rpx;
+font-weight: 500;
+margin-top:150rpx;
+background-color: var(--globleColor);
+ color: var(--fontColor);
 }

+ 45 - 45
pages/my_account/my_account.js

@@ -1,46 +1,46 @@
-// pages/my_mobile/my_mobile.js
-Page({
-
-  data: {
-mobile:''
-  },
-
-  onLoad: function (options) {
-    this.setData({
-      mobile: my.getStorageSync({'key':'userInfo'}).data.mobile
-    })
-  },
-
-  onReady: function () {
-
-  },
-
-  onShow: function () {
-
-  },
-
-  onHide: function () {
-
-  },
-
-  onUnload: function () {
-
-  },
-
-  onPullDownRefresh: function () {
-
-  },
-
-  onReachBottom: function () {
-
-  },
-
-  onShareAppMessage: function () {
-
-  },
-  changeMbile:function(){
-    my.navigateTo({
-      url: '/pages/change_mobile/change_mobile',
-    })
-  }
+// pages/my_mobile/my_mobile.js
+Page({
+
+  data: {
+mobile:''
+  },
+
+  onLoad: function (options) {
+    this.setData({
+      mobile: my.getStorageSync({'key':'userInfo'}).data.mobile
+    })
+  },
+
+  onReady: function () {
+
+  },
+
+  onShow: function () {
+
+  },
+
+  onHide: function () {
+
+  },
+
+  onUnload: function () {
+
+  },
+
+  onPullDownRefresh: function () {
+
+  },
+
+  onReachBottom: function () {
+
+  },
+
+  onShareAppMessage: function () {
+
+  },
+  changeMbile:function(){
+    my.navigateTo({
+      url: '/pages/change_mobile/change_mobile',
+    })
+  }
 })

+ 196 - 196
pages/parking/parking.acss

@@ -1,197 +1,197 @@
-/* required by usingComponents */
-/* pages/parking/parking.wxss */
-page{
-  width: 100%;
-  height: 100vh;
-}
-.box{
-  width: 100%;
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  position: relative;
-}
-map{
-  width: 100%;
-  height: 100%;
-  position: relative;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
-.search{
-  width: 90%;
-  display: flex;
-  z-index: 999;
-  align-items: center;
-  background: #fff;
-  height: 80rpx;
-  margin: 0 auto;
-  justify-content: center;
-  position: fixed;
-  top: 40rpx;
-  border-radius: 10rpx;
-
-}
-.search .place{
-  font-size: 26rpx;
-  color: #707070;
-}
-.search input{
-  width: 75%;
-  /* height: 100%; */
-  font-size: 26rpx;
-  color: #707070;
-}
-.list{
-  width: 90%;
-  z-index: 999;
-  background: #fff;
-  position: fixed;
-  top: 140rpx;
-  overflow-y:  auto;
-  border-radius: 10rpx;
-  height: 1008rpx;
-}
-.list image{
-  width: 32rpx;
-  height: 32rpx;
-  margin-top: 16rpx;
-}
-.city_list{
-  display: flex;
-  align-items: center;
-  width: 82%;
-  font-size: 26rpx;
-  justify-content: space-around;
-  padding: 16rpx 0rpx;
-  border-bottom: 2rpx solid #E8E8E8;
-  margin-right: 26rpx;
-  margin: 0 auto;
-}
-.city_list view{
-  display: flex;
-  flex-direction: column;
-  overflow: hidden;
-  width: 90%;
-}
-.city_list view .title1{
-  font-size: 21rpx;
-  overflow: hidden;
-  white-space: nowrap;
-  text-overflow: ellipsis; 
-  color: #989898;
-}
-.city_list view .title{
-  font-size: 25rpx;
-  overflow: hidden;
-  white-space: nowrap;
-  text-overflow: ellipsis; 
-  color: black;
-  padding-top: 14rpx;
-}
-.city_list:last-of-type{
-  border: none;
-}
-.parking{
-  position: fixed;
-  bottom: 0rpx;
-  width: 100%;
-  left: 0rpx;
-  height: 270rpx;
-  background: #fff;
-  z-index: 999;
-  -webkit-transform:translateY(100%);
-  transform:translateY(100%);
-  display: flex;
-  align-items: center;
-  justify-content: space-around;
-}
-.background{
-  width: 100%;
-  height: 100%;
-  position: fixed;
-  z-index: 888;
-  background: #989898;
-  opacity: 0.5;
-}
-.parking .view{
-  display: flex;
-  flex-direction: column;
-}
-.parking .view1{
-  width: 65%;
-  display: flex;
-  padding-left: 25rpx;
-}
-.parking .view2{
-  width: 20%;
-  font-size: 24rpx;
-  color: #989898;
-  align-items: center;
-  justify-content: center;
-}
-.parking .view1 view{
-  width: 100%;
-  font-size: 24rpx;
-  color: #989898;
-  padding-top: 20rpx;
-}
-.parking .view1 .title{
-  font-size: 30rpx;
-  color: black;
-}
-.coverImage{
-  position: absolute;
-  top: 50%;
-  left: 50%;
-  z-index: 999;
-}
-.bottom image{
-  width: 18px;
-  margin: 3px 2px;
-  height: 20px;
-}
-.bottom{
-  width: 80%;
-  display: flex;
-  align-items: center;
-  justify-content: space-around;
-  position: fixed;
-  bottom: 30rpx;
-  left: 10%;
-  background: white;
-  padding: 15rpx 0rpx;
-  border-radius: 10rpx;
-}
-.bottom .view{
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  font-size: 26rpx;
-}
-.bottom .view text{
-  padding-top: 10rpx;
-}
-.bottom .view .bikeBorder{
-  width: 24px;
-  height: 28px;
-  border:  #e67674 2rpx solid;
-  background: #fee0e0;
-  box-sizing: border-box;
-}
-.parkBorder{
-  width: 24px;
-  height: 28px;
-  border: #22ac38 2rpx solid;
-  background: #d9ebdc;
-  box-sizing: border-box;
-}
-.noPark{
-  width: 24px;
-  height: 28px;
-  border: #FF0000 2rpx solid;
-  background: #FF000030;
-  box-sizing: border-box;
+/* required by usingComponents */
+/* pages/parking/parking.wxss */
+page{
+  width: 100%;
+  height: 100vh;
+}
+.box{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  position: relative;
+}
+map{
+  width: 100%;
+  height: 100%;
+  position: relative;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.search{
+  width: 90%;
+  display: flex;
+  z-index: 999;
+  align-items: center;
+  background: #fff;
+  height: 80rpx;
+  margin: 0 auto;
+  justify-content: center;
+  position: fixed;
+  top: 40rpx;
+  border-radius: 10rpx;
+
+}
+.search .place{
+  font-size: 26rpx;
+  color: #707070;
+}
+.search input{
+  width: 75%;
+  /* height: 100%; */
+  font-size: 26rpx;
+  color: #707070;
+}
+.list{
+  width: 90%;
+  z-index: 999;
+  background: #fff;
+  position: fixed;
+  top: 140rpx;
+  overflow-y:  auto;
+  border-radius: 10rpx;
+  height: 1008rpx;
+}
+.list image{
+  width: 32rpx;
+  height: 32rpx;
+  margin-top: 16rpx;
+}
+.city_list{
+  display: flex;
+  align-items: center;
+  width: 82%;
+  font-size: 26rpx;
+  justify-content: space-around;
+  padding: 16rpx 0rpx;
+  border-bottom: 2rpx solid #E8E8E8;
+  margin-right: 26rpx;
+  margin: 0 auto;
+}
+.city_list view{
+  display: flex;
+  flex-direction: column;
+  overflow: hidden;
+  width: 90%;
+}
+.city_list view .title1{
+  font-size: 21rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis; 
+  color: #989898;
+}
+.city_list view .title{
+  font-size: 25rpx;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis; 
+  color: black;
+  padding-top: 14rpx;
+}
+.city_list:last-of-type{
+  border: none;
+}
+.parking{
+  position: fixed;
+  bottom: 0rpx;
+  width: 100%;
+  left: 0rpx;
+  height: 270rpx;
+  background: #fff;
+  z-index: 999;
+  -webkit-transform:translateY(100%);
+  transform:translateY(100%);
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+}
+.background{
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  z-index: 888;
+  background: #989898;
+  opacity: 0.5;
+}
+.parking .view{
+  display: flex;
+  flex-direction: column;
+}
+.parking .view1{
+  width: 65%;
+  display: flex;
+  padding-left: 25rpx;
+}
+.parking .view2{
+  width: 20%;
+  font-size: 24rpx;
+  color: #989898;
+  align-items: center;
+  justify-content: center;
+}
+.parking .view1 view{
+  width: 100%;
+  font-size: 24rpx;
+  color: #989898;
+  padding-top: 20rpx;
+}
+.parking .view1 .title{
+  font-size: 30rpx;
+  color: black;
+}
+.coverImage{
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  z-index: 999;
+}
+.bottom image{
+  width: 18px;
+  margin: 3px 2px;
+  height: 20px;
+}
+.bottom{
+  width: 80%;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  position: fixed;
+  bottom: 30rpx;
+  left: 10%;
+  background: white;
+  padding: 15rpx 0rpx;
+  border-radius: 10rpx;
+}
+.bottom .view{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  font-size: 26rpx;
+}
+.bottom .view text{
+  padding-top: 10rpx;
+}
+.bottom .view .bikeBorder{
+  width: 24px;
+  height: 28px;
+  border:  #e67674 2rpx solid;
+  background: #fee0e0;
+  box-sizing: border-box;
+}
+.parkBorder{
+  width: 24px;
+  height: 28px;
+  border: #22ac38 2rpx solid;
+  background: #d9ebdc;
+  box-sizing: border-box;
+}
+.noPark{
+  width: 24px;
+  height: 28px;
+  border: #FF0000 2rpx solid;
+  background: #FF000030;
+  box-sizing: border-box;
 }

+ 51 - 51
pages/parking/parking.axml

@@ -1,52 +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="请输入目的地查看附近还车点" 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 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 - 287
pages/parking/parking.js

@@ -1,288 +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)
-      }
-    })
-    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() {
-    
-  }
+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() {
+    
+  }
 })

+ 4 - 4
pages/parking/parking.json

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

+ 522 - 522
pages/pay/pay.acss

@@ -1,523 +1,523 @@
-/* required by usingComponents */
-
- page{
-  width: 100%;
-  background: #F4F4F4;
-}
-.home{
-  position: fixed;
-  /* top: 30rpx; */
-  left: 20rpx;
-  height: 80rpx;
-  width: 100%;
-  text-align: center;
-}
-.home text{
- margin-left: -50rpx;
- line-height: 80rpx;
- font-size: 34rpx;
- font-weight: 500;
-}
-.home image{
-  height: 50rpx;
-  margin-top: 10rpx;
-  width: 50rpx;
-  float: left;
-}
-.box{
-  width: 100%;
-  /* display: flex;
-  flex-direction: column;
-  align-items: center; */
-  padding-bottom: 100rpx;
-}
- .pay-top{
-  height:250rpx;
-  background: var(--globleColor);
-}
-.pay-top{
-font-size: 32rpx;
-font-weight: 600;
-padding-top: 50rpx;
-} 
-.pay-money{
-  /* height: 110rpx; */
-  /* padding-top:80rpx; */
-  text-align: center;
-  /* line-height: 150rpx; */
-  /* margin-top: 100rpx; */
-  font-size: 60rpx;
-  font-weight: bold;
-  padding: 20rpx 0;
-}
-.box .title{
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  font-size: 28rpx;
-  font-weight: 400;
-  margin-bottom: 50rpx!important;
-}
-.box .title text:nth-of-type(1){
-  font-size:32rpx;
-  font-family:PingFang-SC-Regular;
-  font-weight:500;
-  color:rgba(42,42,42,1);
-  margin-top:29rpx;
-  margin-bottom: 15rpx; 
-}
-.box .title text:nth-of-type(2){
-  width:140rpx;
-  height:4rpx;
-  background:rgba(24,213,185,1);
-}
-.box .list{
-  display: flex;
-  margin: 0 20rpx;
-  flex-direction: column;
-
-  background: white;
-  border-radius: 10rpx;
-  align-items: center;
-  padding:  30rpx 0 20rpx;
-  
-}
-.box .list view{
-  display: flex;
-  width: 85%;
-  justify-content: space-between;
-  margin-bottom: 20rpx;
-  position: relative;
-}
-.box .list view .notice{
-  position: absolute;
-  left: 110rpx;
-  width: 28rpx;
-  height: 28rpx;
-  top: 4rpx;
-}
-.shichang{
-font-size: 28rpx;
-color: rgb(148, 147, 147);
-padding-bottom: 50rpx;
-border-bottom:solid 1rpx rgb(228, 225, 225);
-margin-bottom:50rpx!important;
-}
-.box .list view text{
-  font-size:28rpx;
-  font-family:PingFang-SC-Regular;
-  font-weight:500!important;
-  color:rgba(42,42,42,1);
-}
-.box .mode{
-  /* width: 100%; */
-  margin: 20rpx 30rpx;
-  display: flex;
-  flex-direction: column;
-  /* margin-top: 20rpx; */
-  align-items: center;
-  border-radius: 20rpx;
-  background: white;
-  padding-top: 20rpx;
-}
-.box .mode .view{
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  width: 85%;
-}
-.box .mode .view .left{
-  display: flex;
-  align-items: center;
-}
-.box .mode .view .left image{
-  margin-right: 24rpx;
-}
-.box .mode .view .left text{
-  font-size:24rpx;
-  font-family:PingFang-SC-Regular;
-  color:rgba(42,42,42,1);
-}
-.box .mode .view .right text{
-  font-size:24rpx;
-  font-family:PingFang-SC-Regular;
-  font-weight:400;
-  color:rgba(153,153,153,1);
-}
-.box .mode .view .right1{
-  display: flex;
-  align-items: center;
-  font-size:24rpx;
-  font-family:PingFang-SC-Regular;
-  font-weight:400;
-  color:rgba(153,153,153,1);
-  margin-right: -20rpx;
-}
-.box .mode .view:nth-of-type(1){
-  padding-bottom: 25rpx;
-  border-bottom: 2rpx solid #F4F4F4;
-}
-.box .mode .view:nth-of-type(2){
-  padding-top: 20rpx;
-  padding-bottom: 20rpx;
-  border-bottom: 2rpx solid #F4F4F4;
-}
-.box .mode .view:nth-of-type(3){
-  padding-top: 20rpx;
-  padding-bottom: 20rpx;
-  border-bottom: 2rpx solid #F4F4F4;
-}
-.box .mode .view:nth-of-type(4){
-  padding-top: 20rpx;
-  padding-bottom: 20rpx;
-  border-bottom: 2rpx solid #F4F4F4;
-}
-.box .payment{
-  /* width: 100%; */
-  margin: 20rpx;
-  display: flex;
-  align-items: center;
-  height: 100rpx;
-  background: white;
-  border-radius: 10rpx;
-  /* margin-top: 20rpx; */
-  justify-content: space-between;
-  position: relative;
-  font-size: 24rpx;
-  font-family: PingFang-SC-Regular;
-  font-weight: 400;
-}
-.box .payment image{
-  position: absolute;
-  right: 5%;
-}
-.box .money{
-  font-size:24rpx;
-  font-family:PingFang-SC-Regular;
-  font-weight:400;
-  color:rgba(42,42,42,1);
-  padding-left: 42rpx;
-}
-.box .money text{
-  font-size: 44rpx;
-  font-weight: 800;
-}
-.box .coupon_money{
-  width: 87%;
-  display: flex;
-  align-items: center;
-  font-size:22rpx;
-  font-family:PingFang SC;
-  font-weight:400;
-}
-.box .system_off_lock{
-  width:100%;
-  height:100rpx;
-  background:#FAF8DC;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  z-index: 999;
-  position: fixed;
-  bottom: 100rpx;
-  left: 0rpx;
-  color: #D58548;
-  font-size: 26rpx;
-}
-
-.box .payment_type{
-  position: fixed;
-  z-index: 9999;
-  left: 0rpx;
-  width: 100%;
-  bottom: 0rpx;
-  margin: 0 !important;
-  border-radius: 20rpx 30rpx 0rpx 0rpx !important;
-  padding-bottom: 30rpx;
-}
-.box .cancel{
-  position: absolute;
-  right: 35rpx;
-  top: 28rpx;
-}
-.box .payment_type .view1{
-  width: 85%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  background: var(--globleColor);
-  font-size: 28rpx;
-  height: 80rpx;
-  border-radius: 40rpx;
-  color: white;
-}
-.box .payment_type .view:nth-of-type(1){
-  padding-bottom: 30rpx !important;
-}
-.box .payment_type .view:nth-of-type(2){
-  padding: 40rpx 0rpx !important;
-}
-.box .payment_type .view:nth-of-type(3){
-  padding-top: 40rpx !important;
-  padding-bottom: 70rpx !important;
-  border: none !important;
-}
-.box .payment_type .top{
-  font-size:34rpx;
-  font-family:PingFang SC;
-  font-weight:bold;
-  color:rgba(42,42,42,1);
-  padding-top: 34rpx;
-  width: 85%;
-  padding-bottom: 30rpx;
-}
-.box .fixed{
-
-}
-.box .fixed .btn{
-  /* width:240rpx; */
-  height:100rpx;
-  line-height:100rpx;
-  background:var(--globleColor);
-  border-radius:20rpx;
-  width: 80%;
-  text-align: center;
-  margin: 0 auto;
-  font-size:32rpx;
-  margin-top: 80rpx;
-  font-family:PingFang-SC-Regular;
-  /* font-weight:400; */
-   color: var(--fontColor);
-  font-weight: bold;
-  /* margin-right: 42rpx; */
-}
-.box .di{
-  display: flex;
-  align-items: center;
-  margin-top: 30rpx;
-}
-.box .di text{
-  font-size:28rpx;
-  font-family:PingFang-SC-Regular;
-  font-weight:400;
-  color:var(--orgFont);
-  padding-left: 10rpx;
-}
-
-.repair{
-  position: fixed;
-  right: 0rpx;
-  bottom: 40%;
-}
-.maskLayer{
-  z-index: 8887;
-  position: fixed;
-  top: 0rpx;
-  left: 0rpx;
-  right: 0rpx;
-  bottom: 0rpx;
-  width: 100%;
-  height: 100%;
-  background: #333;
-  opacity: .5;
-}
-.choose{
-  z-index: 99999;
-  position: fixed;
-  bottom: 0rpx;
-  width: 100%;
-  display: flex;
-  flex-wrap: wrap;
-  border-radius:20rpx 20rpx 0px 0px;
-  background: #F1F1F1;
-}
-.choose .top{
-  width: 100%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  background: white;
-  border-radius:20rpx 20rpx 0px 0px;
-  padding-bottom: 20rpx;
-  position: relative;
-}
-.choose .hideModal{
-  position: absolute;
-  top: 18rpx;
-  right: 20rpx;
-  z-index: 9999;
-}
-.choose .top .title1{
-  font-size:34rpx;
-  font-family:PingFang SC;
-  font-weight:bold;
-  color:rgba(42,42,42,1);
-  padding-top: 34rpx;
-  width: 92%;
-  padding-bottom: 30rpx;
-}
-.choose .top .coupon{
-  width: 100%;
-  display: flex;
-  align-items: center;
-}
-.choose .top .coupon .view{
-  width: 50%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  font-size:28rpx;
-  font-family:PingFang SC;
-  font-weight:500;
-  color:rgba(42,42,42,1);
-}
-.choose .top .coupon .view .active{
-  width:86rpx;
-  height:17rpx;
-  background:linear-gradient(53deg,rgba(255,81,33,1) ,rgba(249,129,12,1),white);
-  margin-top: 15rpx;
-}
-.box .box_bottom{
-  /* width: 100%; */
-  border-radius: 20rpx;
-  background: white;
-  display: flex;
-  margin: 0 30rpx;
-  flex-direction: column;
-  align-items: center;
-  /* margin-top: 20rpx; */
-  padding-top: 30rpx;
-}
-.box .box_bottom view{
-  width: 85%;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  font-size: 24rpx;
-  position: relative;
-}
-.box .box_bottom view:nth-of-type(1){
-  padding: 0rpx 0rpx 25rpx 0rpx;
-}
-.box .box_bottom view{
-  padding: 20rpx 0rpx;
-  border-bottom: 2rpx solid #F4F4F4;
-}
-.box .box_bottom image{
-  margin-right: -20rpx;
-}
-.box .box_bottom .right{
-  position: absolute;
-  right: 0;
-}
-.box .notice_background{
-  z-index: 8887;
-  position: fixed;
-  top: 0rpx;
-  left: 0rpx;
-  right: 0rpx;
-  bottom: 0rpx;
-  width: 100%;
-  height: 100%;
-  background: #333;
-  opacity: .5;
-}
-.box .notice_model{
-    background-color: #fff;
-    left: 15%;
-    margin-top: -260rpx;
-    position: fixed;
-    top: 50%;
-    width: 70%;
-    /* height: 260px; */
-    padding-bottom: 30rpx;
-    z-index: 8888;
-    display: flex;
-    flex-direction: column;
-    color: #333;
-    align-items: center;
-    border-radius: 15rpx;line-height: 40rpx;
-}
-.box .notice_model .btn{
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  background: var(--globleColor);
-  border-radius: 40rpx;
-  height: 70rpx;
-  
-  color: white;
-  width: 80%;
-  font-size: 26rpx;
-  margin-top: 70rpx;
-}
-.box .no_dataYes{
-  width: 100%;
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  font-size:26rpx;
-  font-family:PingFang SC;
-  font-weight:500;
-  color:rgba(101,103,103,1);
-}
-.box .notice_model .title1{
-  font-size:32rpx;
-  font-family:PingFang SC;
-  font-weight:bold;
-  color:rgba(31,31,31,1);
-  width: 90%;
-  padding: 30rpx 0rpx;
-  display: flex;
-  justify-content: center;
-}
-.box .notice_model .content{
-  font-size: 26rpx;
-  color: #333;
-  width: 90%;
-  display: flex;
-  flex-direction: column;
-}
-.box .notice_model .content text{
-  padding-top: 30rpx;
-}
-.bt-wenti{
-  margin-top: 10rpx;
-  display: flex;
-  /* height: 100rpx; */
-  padding: 20rpx 50rpx;
-  font-size: 28rpx;
-  color: #333;
-font-size: 28rpx!important;
-
-}
-.kefu{
-  flex: 1;
-}
-.kefu image{
-height:30rpx;
-width: 30rpx;
-margin-right: 10rpx;
-display: inline-block;
-
-vertical-align: middle;
-
-}
-.kaisuo{
-  flex: 1;
-  font-size: 26rpx!important;
-  color: var(--orgFont);text-align: right;
-}
-.colse-type{
-  margin: 0 20rpx;
-  /* min-height: 70rpx; */
-  line-height: 42rpx;
-  padding: 10px 50rpx;
-  border-radius: 12rpx;
-  font-size: 28rpx;
-  /* font-weight: 600; */
-  color: var(--orgFont);
-  background-color: hsl(37, 51%, 92%);
+/* required by usingComponents */
+
+ page{
+  width: 100%;
+  background: #F4F4F4;
+}
+.home{
+  position: fixed;
+  /* top: 30rpx; */
+  left: 20rpx;
+  height: 80rpx;
+  width: 100%;
+  text-align: center;
+}
+.home text{
+ margin-left: -50rpx;
+ line-height: 80rpx;
+ font-size: 34rpx;
+ font-weight: 500;
+}
+.home image{
+  height: 50rpx;
+  margin-top: 10rpx;
+  width: 50rpx;
+  float: left;
+}
+.box{
+  width: 100%;
+  /* display: flex;
+  flex-direction: column;
+  align-items: center; */
+  padding-bottom: 100rpx;
+}
+ .pay-top{
+  height:250rpx;
+  background: var(--globleColor);
+}
+.pay-top{
+font-size: 32rpx;
+font-weight: 600;
+padding-top: 50rpx;
+} 
+.pay-money{
+  /* height: 110rpx; */
+  /* padding-top:80rpx; */
+  text-align: center;
+  /* line-height: 150rpx; */
+  /* margin-top: 100rpx; */
+  font-size: 60rpx;
+  font-weight: bold;
+  padding: 20rpx 0;
+}
+.box .title{
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  font-size: 28rpx;
+  font-weight: 400;
+  margin-bottom: 50rpx!important;
+}
+.box .title text:nth-of-type(1){
+  font-size:32rpx;
+  font-family:PingFang-SC-Regular;
+  font-weight:500;
+  color:rgba(42,42,42,1);
+  margin-top:29rpx;
+  margin-bottom: 15rpx; 
+}
+.box .title text:nth-of-type(2){
+  width:140rpx;
+  height:4rpx;
+  background:rgba(24,213,185,1);
+}
+.box .list{
+  display: flex;
+  margin: 0 20rpx;
+  flex-direction: column;
+
+  background: white;
+  border-radius: 10rpx;
+  align-items: center;
+  padding:  30rpx 0 20rpx;
+  
+}
+.box .list view{
+  display: flex;
+  width: 85%;
+  justify-content: space-between;
+  margin-bottom: 20rpx;
+  position: relative;
+}
+.box .list view .notice{
+  position: absolute;
+  left: 110rpx;
+  width: 28rpx;
+  height: 28rpx;
+  top: 4rpx;
+}
+.shichang{
+font-size: 28rpx;
+color: rgb(148, 147, 147);
+padding-bottom: 50rpx;
+border-bottom:solid 1rpx rgb(228, 225, 225);
+margin-bottom:50rpx!important;
+}
+.box .list view text{
+  font-size:28rpx;
+  font-family:PingFang-SC-Regular;
+  font-weight:500!important;
+  color:rgba(42,42,42,1);
+}
+.box .mode{
+  /* width: 100%; */
+  margin: 20rpx 30rpx;
+  display: flex;
+  flex-direction: column;
+  /* margin-top: 20rpx; */
+  align-items: center;
+  border-radius: 20rpx;
+  background: white;
+  padding-top: 20rpx;
+}
+.box .mode .view{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 85%;
+}
+.box .mode .view .left{
+  display: flex;
+  align-items: center;
+}
+.box .mode .view .left image{
+  margin-right: 24rpx;
+}
+.box .mode .view .left text{
+  font-size:24rpx;
+  font-family:PingFang-SC-Regular;
+  color:rgba(42,42,42,1);
+}
+.box .mode .view .right text{
+  font-size:24rpx;
+  font-family:PingFang-SC-Regular;
+  font-weight:400;
+  color:rgba(153,153,153,1);
+}
+.box .mode .view .right1{
+  display: flex;
+  align-items: center;
+  font-size:24rpx;
+  font-family:PingFang-SC-Regular;
+  font-weight:400;
+  color:rgba(153,153,153,1);
+  margin-right: -20rpx;
+}
+.box .mode .view:nth-of-type(1){
+  padding-bottom: 25rpx;
+  border-bottom: 2rpx solid #F4F4F4;
+}
+.box .mode .view:nth-of-type(2){
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
+  border-bottom: 2rpx solid #F4F4F4;
+}
+.box .mode .view:nth-of-type(3){
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
+  border-bottom: 2rpx solid #F4F4F4;
+}
+.box .mode .view:nth-of-type(4){
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
+  border-bottom: 2rpx solid #F4F4F4;
+}
+.box .payment{
+  /* width: 100%; */
+  margin: 20rpx;
+  display: flex;
+  align-items: center;
+  height: 100rpx;
+  background: white;
+  border-radius: 10rpx;
+  /* margin-top: 20rpx; */
+  justify-content: space-between;
+  position: relative;
+  font-size: 24rpx;
+  font-family: PingFang-SC-Regular;
+  font-weight: 400;
+}
+.box .payment image{
+  position: absolute;
+  right: 5%;
+}
+.box .money{
+  font-size:24rpx;
+  font-family:PingFang-SC-Regular;
+  font-weight:400;
+  color:rgba(42,42,42,1);
+  padding-left: 42rpx;
+}
+.box .money text{
+  font-size: 44rpx;
+  font-weight: 800;
+}
+.box .coupon_money{
+  width: 87%;
+  display: flex;
+  align-items: center;
+  font-size:22rpx;
+  font-family:PingFang SC;
+  font-weight:400;
+}
+.box .system_off_lock{
+  width:100%;
+  height:100rpx;
+  background:#FAF8DC;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 999;
+  position: fixed;
+  bottom: 100rpx;
+  left: 0rpx;
+  color: #D58548;
+  font-size: 26rpx;
+}
+
+.box .payment_type{
+  position: fixed;
+  z-index: 9999;
+  left: 0rpx;
+  width: 100%;
+  bottom: 0rpx;
+  margin: 0 !important;
+  border-radius: 20rpx 30rpx 0rpx 0rpx !important;
+  padding-bottom: 30rpx;
+}
+.box .cancel{
+  position: absolute;
+  right: 35rpx;
+  top: 28rpx;
+}
+.box .payment_type .view1{
+  width: 85%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background: var(--globleColor);
+  font-size: 28rpx;
+  height: 80rpx;
+  border-radius: 40rpx;
+  color: white;
+}
+.box .payment_type .view:nth-of-type(1){
+  padding-bottom: 30rpx !important;
+}
+.box .payment_type .view:nth-of-type(2){
+  padding: 40rpx 0rpx !important;
+}
+.box .payment_type .view:nth-of-type(3){
+  padding-top: 40rpx !important;
+  padding-bottom: 70rpx !important;
+  border: none !important;
+}
+.box .payment_type .top{
+  font-size:34rpx;
+  font-family:PingFang SC;
+  font-weight:bold;
+  color:rgba(42,42,42,1);
+  padding-top: 34rpx;
+  width: 85%;
+  padding-bottom: 30rpx;
+}
+.box .fixed{
+
+}
+.box .fixed .btn{
+  /* width:240rpx; */
+  height:100rpx;
+  line-height:100rpx;
+  background:var(--globleColor);
+  border-radius:20rpx;
+  width: 80%;
+  text-align: center;
+  margin: 0 auto;
+  font-size:32rpx;
+  margin-top: 80rpx;
+  font-family:PingFang-SC-Regular;
+  /* font-weight:400; */
+   color: var(--fontColor);
+  font-weight: bold;
+  /* margin-right: 42rpx; */
+}
+.box .di{
+  display: flex;
+  align-items: center;
+  margin-top: 30rpx;
+}
+.box .di text{
+  font-size:28rpx;
+  font-family:PingFang-SC-Regular;
+  font-weight:400;
+  color:var(--orgFont);
+  padding-left: 10rpx;
+}
+
+.repair{
+  position: fixed;
+  right: 0rpx;
+  bottom: 40%;
+}
+.maskLayer{
+  z-index: 8887;
+  position: fixed;
+  top: 0rpx;
+  left: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  width: 100%;
+  height: 100%;
+  background: #333;
+  opacity: .5;
+}
+.choose{
+  z-index: 99999;
+  position: fixed;
+  bottom: 0rpx;
+  width: 100%;
+  display: flex;
+  flex-wrap: wrap;
+  border-radius:20rpx 20rpx 0px 0px;
+  background: #F1F1F1;
+}
+.choose .top{
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  background: white;
+  border-radius:20rpx 20rpx 0px 0px;
+  padding-bottom: 20rpx;
+  position: relative;
+}
+.choose .hideModal{
+  position: absolute;
+  top: 18rpx;
+  right: 20rpx;
+  z-index: 9999;
+}
+.choose .top .title1{
+  font-size:34rpx;
+  font-family:PingFang SC;
+  font-weight:bold;
+  color:rgba(42,42,42,1);
+  padding-top: 34rpx;
+  width: 92%;
+  padding-bottom: 30rpx;
+}
+.choose .top .coupon{
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+.choose .top .coupon .view{
+  width: 50%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  font-size:28rpx;
+  font-family:PingFang SC;
+  font-weight:500;
+  color:rgba(42,42,42,1);
+}
+.choose .top .coupon .view .active{
+  width:86rpx;
+  height:17rpx;
+  background:linear-gradient(53deg,rgba(255,81,33,1) ,rgba(249,129,12,1),white);
+  margin-top: 15rpx;
+}
+.box .box_bottom{
+  /* width: 100%; */
+  border-radius: 20rpx;
+  background: white;
+  display: flex;
+  margin: 0 30rpx;
+  flex-direction: column;
+  align-items: center;
+  /* margin-top: 20rpx; */
+  padding-top: 30rpx;
+}
+.box .box_bottom view{
+  width: 85%;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 24rpx;
+  position: relative;
+}
+.box .box_bottom view:nth-of-type(1){
+  padding: 0rpx 0rpx 25rpx 0rpx;
+}
+.box .box_bottom view{
+  padding: 20rpx 0rpx;
+  border-bottom: 2rpx solid #F4F4F4;
+}
+.box .box_bottom image{
+  margin-right: -20rpx;
+}
+.box .box_bottom .right{
+  position: absolute;
+  right: 0;
+}
+.box .notice_background{
+  z-index: 8887;
+  position: fixed;
+  top: 0rpx;
+  left: 0rpx;
+  right: 0rpx;
+  bottom: 0rpx;
+  width: 100%;
+  height: 100%;
+  background: #333;
+  opacity: .5;
+}
+.box .notice_model{
+    background-color: #fff;
+    left: 15%;
+    margin-top: -260rpx;
+    position: fixed;
+    top: 50%;
+    width: 70%;
+    /* height: 260px; */
+    padding-bottom: 30rpx;
+    z-index: 8888;
+    display: flex;
+    flex-direction: column;
+    color: #333;
+    align-items: center;
+    border-radius: 15rpx;line-height: 40rpx;
+}
+.box .notice_model .btn{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background: var(--globleColor);
+  border-radius: 40rpx;
+  height: 70rpx;
+  
+  color: white;
+  width: 80%;
+  font-size: 26rpx;
+  margin-top: 70rpx;
+}
+.box .no_dataYes{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  font-size:26rpx;
+  font-family:PingFang SC;
+  font-weight:500;
+  color:rgba(101,103,103,1);
+}
+.box .notice_model .title1{
+  font-size:32rpx;
+  font-family:PingFang SC;
+  font-weight:bold;
+  color:rgba(31,31,31,1);
+  width: 90%;
+  padding: 30rpx 0rpx;
+  display: flex;
+  justify-content: center;
+}
+.box .notice_model .content{
+  font-size: 26rpx;
+  color: #333;
+  width: 90%;
+  display: flex;
+  flex-direction: column;
+}
+.box .notice_model .content text{
+  padding-top: 30rpx;
+}
+.bt-wenti{
+  margin-top: 10rpx;
+  display: flex;
+  /* height: 100rpx; */
+  padding: 20rpx 50rpx;
+  font-size: 28rpx;
+  color: #333;
+font-size: 28rpx!important;
+
+}
+.kefu{
+  flex: 1;
+}
+.kefu image{
+height:30rpx;
+width: 30rpx;
+margin-right: 10rpx;
+display: inline-block;
+
+vertical-align: middle;
+
+}
+.kaisuo{
+  flex: 1;
+  font-size: 26rpx!important;
+  color: var(--orgFont);text-align: right;
+}
+.colse-type{
+  margin: 0 20rpx;
+  /* min-height: 70rpx; */
+  line-height: 42rpx;
+  padding: 10px 50rpx;
+  border-radius: 12rpx;
+  font-size: 28rpx;
+  /* font-weight: 600; */
+  color: var(--orgFont);
+  background-color: hsl(37, 51%, 92%);
 }

+ 126 - 126
pages/pay/pay.axml

@@ -1,127 +1,127 @@
-<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.no||'--'}}</text>
-		</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:#2979ff;">- ¥{{date.user_card.card_preferential_money||'--'}}</text>
-		</view>
-		<view a:if="{{rent}}">
-			<text>优惠券</text>
-			<text style="color:#2979ff;">- ¥{{date.user_coupon.coupon_preferential_money||'--'}}</text>
-		</view>
-		<view onTap="notice">
-			<text>调度费用<text class="iconfont icon-guize"
-					style="display:inline-block;color:var(--orgFont);margin-left:10rpx;"></text></text>
-			<text style="color:#ff0000;">¥{{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 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.no||'--'}}</text>
+		</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:#2979ff;">- ¥{{date.user_card.card_preferential_money||'--'}}</text>
+		</view>
+		<view a:if="{{rent}}">
+			<text>优惠券</text>
+			<text style="color:#2979ff;">- ¥{{date.user_coupon.coupon_preferential_money||'--'}}</text>
+		</view>
+		<view onTap="notice">
+			<text>调度费用<text class="iconfont icon-guize"
+					style="display:inline-block;color:var(--orgFont);margin-left:10rpx;"></text></text>
+			<text style="color:#ff0000;">¥{{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>

+ 553 - 553
pages/pay/pay.js

@@ -1,554 +1,554 @@
-const util = require('../../utils/utils')
-var app = getApp()
-var url = ''
-var intervar;
-Page({
-  data: {
-    statusbar: '',//导航栏高度
-    order: '',//订单编号
-    date: [],
-    balance: '', //当前余额
-    bolear: '', //判断当前余额够不够本次消费 够为true 不够为false
-    check1: '',
-    check2: '',
-    index: '', //记录当前选择的是余额还是支付宝支付
-    disable: false,
-    timing: '',
-    rent: '',
-    screenHeight: '',
-    code: '',
-    chooseSize: false,
-    animationData1: {},
-    couponIndex: 0,
-    coupon_user_bags_id: 0,
-    coupon: [],
-    payment_type: false,
-    notice: false,
-    setting: my.getStorageSync({ 'key': 'setting' }).data,
-    img: app.globalData.imgUrl
-  },
-  catchtouchmove: function () {
-    return;
-  },
-  tap_coupon: function (e) {
-    this.setData({
-      couponIndex: e.currentTarget.dataset.index
-    })
-  },
-  payment_type: function () {
-    this.setData({
-      payment_type: true
-    })
-  },
-  cancel: function () {
-    console.log(this.data.index)
-    this.setData({
-      index: this.data.index,
-      payment_type: false
-    })
-    if (this.data.index == 2) {
-      this.setData({
-        check1: true,
-        check2: false
-      })
-    }
-    if (this.data.index == 1) {
-      this.setData({
-        check2: true,
-        check1: false
-      })
-    }
-  },
-  queding: function () {
-    if (this.data.check1) {
-      //判断当前是不是余额支付
-      this.setData({
-        check1: true,
-        check2: false,
-        index: 2,
-      })
-    } else {
-      this.setData({
-        check1: false,
-        check2: true,
-        index: 1,
-      })
-    }
-    this.setData({
-      payment_type: false
-    })
-  },
-  to_recharge: function () {
-    // console.log('去充值')
-    my.navigateTo({
-      url: '/pages/balance/balance',
-    })
-  },
-  notice: function () {
-    this.setData({
-      notice: true
-    })
-  },
-  notice_false: function () {
-    this.setData({
-      notice: false
-    })
-  },
-  onLoad: function (options) {
-    console.log(options)
-
-    var that = this;
-    this.setData({
-      screenHeight: app.globalData.screenHeight
-    })
-    // if (options.rent == 'rent') {
-
-    // } else {
-    url = '/order'
-    //  url = '/rent'
-    //   this.setData({
-    //     rent: true
-    //   })
-    // }
-    if (options != null &&  options.order.length > 20) {
-      this.setData({
-        order: options.order
-      })
-    } else {
-      my.alert({
-        title: '提示',
-        content: '订单号有误,请重试~',
-        showCancel: false,
-        success: function (res) {
-          my.reLaunch({
-            url: '/pages/index/index',
-          })
-        }
-      })
-    }
-
-
-
-  },
-  home: function () {
-    //点击返回首页
-    var that = this;
-
-    if (that.data.index != '') {
-      var data = {
-        pay_type: that.data.index,
-        order_no: that.data.order,
-        coupon_user_bags_id: that.data.coupon_user_bags_id
-      }
-      if (that.data.disable == true) {
-        my.showToast({
-          content: '您的操作过于频繁,请稍后再试~',
-          icon: 'none'
-        })
-        return;
-      }
-      that.setData({
-        disable: true
-      })
-      if (that.data.date.orders.pay_status == 1) {
-        my.reLaunch({
-          url: '/pages/index/index',
-        })
-        my.hideLoading()
-        return
-      }
-      app.request(url + '/pay', data, 'POST').then(res => {
-        console.log(res)
-        that.setData({
-          order: res.data.order_no
-        })
-        //获取支付参数
-        if (res.status == 200) {
-          this.setData({
-            order: res.data.order_no
-          })
-          if (res.data.pay_order_status == true) {
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          } else {
-            if (that.data.index == 1) {
-              my.tradePay({
-                tradeNO: res.data.tradeNo,
-                success(resp) {
-                  console.log(resp, 'zhifubao')
-                  if (resp.resultCode == 9000) {
-                    my.reLaunch({
-                      url: '/pages/index/index',
-                    })
-                  } else {
-                    return
-                  }
-                },
-                fail(err) {
-                  my.showToast({
-                    content: '支付失败',
-                    icon: 'none'
-                  })
-                }
-              })
-              that.setData({
-                disable: false
-              })
-            } else {
-              my.reLaunch({
-                url: '/pages/index/index',
-              })
-            }
-          }
-        }
-      })
-    }
-
-  },
-  retryClose: util.throttle(function () {
-    //点击关锁失败
-    var that = this;
-    my.showLoading({
-      content: '关锁中...',
-      mask: true
-    })
-    clearInterval(intervar)
-    my.getLocation({
-      type: 'gcj02',
-      success: function (res) {
-        console.log(res)
-        app.request('/order/retry-close-lock?order_no=' + that.data.date.orders.no + '&bike_no=' + that.data.date.orders.bike_no, '', 'GET').then(res => {
-          console.log(res)
-          if (res.status == 200) {
-            my.hideLoading()
-            if (res.data.status == 1) {
-              my.showToast({
-                content: '关锁成功',
-                icon: 'none'
-              })
-            }
-          }
-        })
-      },
-    })
-  }, 1000),
-  check1: function () {
-    //选择余额支付
-    this.setData({
-      check1: true,
-      check2: false
-    })
-  },
-  check2: function () {
-    //选择支付宝支付
-    this.setData({
-      check1: false,
-      check2: true
-    })
-  },
-  check4: function () {
-    //点击去购买骑行卡
-    my.navigateTo({
-      url: '/pages/buy-card/buy-card',
-    })
-  },
-  check3: function () {
-    var that = this;
-    // 创建一个动画实例
-    console.log(that.data.coupon)
-    app.request('/coupon/getCouponsByOrder?order_no=' + that.data.order, '', 'GET').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        that.setData({
-          coupon: res.data
-        })
-        var coupon = res.data.dataYes;
-        for (var i = 0; i < coupon.length; i++) {
-          if (coupon[i].id == that.data.date.user_coupon.coupon_user_bags_id) {
-            coupon[i].selected = true;
-          } else {
-            coupon[i].selected = false;
-          }
-        }
-        var couponYes = 'coupon.dataYes';
-        that.setData({
-          [couponYes]: coupon
-        })
-      }
-    })
-    var animation = my.createAnimation({
-      // 动画持续时间
-      duration: 400,
-      // 定义动画效果,当前是匀速
-      timingFunction: 'linear'
-    })
-    // 将该变量赋值给当前动画
-    that.animation = animation
-    // 先在y轴偏移,然后用step()完成一个动画
-    animation.translateY(300).step()
-    // 用setData改变当前动画
-    that.setData({
-      // 通过export()方法导出数据
-      animationData1: animation.export(),
-      // 改变view里面的Wx:if
-      chooseSize: true
-    })
-    // 设置setTimeout来改变y轴偏移量,实现有感觉的滑动
-    setTimeout(function () {
-      animation.translateY(0).step()
-      that.setData({
-        animationData1: animation.export()
-      })
-    }, 100)
-
-  },
-  hideModal: function (e) {
-    var that = this;
-    var animation = my.createAnimation({
-      duration: 400,
-      timingFunction: 'linear'
-    })
-    that.animation = animation
-    animation.translateY(360).step()
-    that.setData({
-      animationData1: animation.export()
-
-    })
-    // setTimeout(function () {
-    //   var query = my.createSelectorQuery();
-    //   query.select('.choose').boundingClientRect();
-    //   query.exec(function (res) {
-    //     console.log(res)
-    //     // that.setData({arrowDown:res[0].height+15})
-    //     animation.translateY(res[0].height).step()
-    //   })
-    //   that.setData({
-    //     animationData1: animation.export(),
-    //     chooseSize: false
-    //   })
-    // }, 400)
-  },
-  coupons: function (e) {
-    var id = e.currentTarget.dataset.id;
-    var index = e.currentTarget.dataset.index;
-    var coupons = this.data.coupon.dataYes;
-    var select = e.currentTarget.dataset.selected;
-    if (coupons[index].selected == true) {
-      for (var i = 0; i < coupons.length; i++) {
-        coupons[i].selected = false;
-      }
-    } else {
-      for (var i = 0; i < coupons.length; i++) {
-        coupons[i].selected = false;
-        coupons[index].selected = true
-      }
-    }
-    var couponList = 'coupon.dataYes';
-    this.setData({
-      coupon_user_bags_id: id,
-      // chooseSize: false,
-      [couponList]: coupons
-    })
-  },
-  srue: function () {
-    var that = this;
-    var coupon_yes = that.data.coupon.dataYes;
-    var id = ''
-    for (var i = 0; i < coupon_yes.length; i++) {
-      if (coupon_yes[i].selected == true) {
-        id = coupon_yes[i].id
-      }
-    }
-    my.showLoading({
-      content: '加载中...',
-      mask: true
-    })
-    app.request(url + '/pay-show?order_no=' + that.data.order + '&coupon_user_bags_id=' + id, '', 'GET').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        my.hideLoading()
-        that.setData({
-          date: res.data,
-          balance: res.data.wallet_money,
-          bolear: res.data.wallet_pay_status,
-          chooseSize: false
-        })
-        if (res.data.wallet_pay_status == false) {
-          that.setData({
-            check1: false,
-            check2: true,
-            index: 1
-          })
-        } else {
-          that.setData({
-            check1: true,
-            check2: false,
-            index: 2
-          })
-        }
-        console.log(that.data.index)
-        if (res.data.user_coupon.is_coupon) {
-          that.setData({
-            coupon_user_bags_id: res.data.user_coupon.coupon_user_bags_id
-          })
-        }
-      }
-    })
-  },
-  payment: util.throttle(function () {
-    my.showLoading({
-      content: '加载中',
-      icon: 'none',
-      mask: true
-    })
-    //点击立即支付
-    var that = this;
-    console.log(that.data.index)
-    if (that.data.index != '') {
-      var data = {
-        pay_type: that.data.index,
-        order_no: that.data.order,
-        coupon_user_bags_id: that.data.coupon_user_bags_id
-      }
-
-      app.request(url + '/pay', data, 'POST').then(res => {
-        console.log(res)
-        my.hideLoading()
-        //获取支付参数
-        if (res.status == 200) {
-
-          if (that.data.index == 1) {
-            my.tradePay({
-              tradeNO: res.data.tradeNo,
-              success(resp) {
-                console.log(resp, 'zhifubao')
-                if (resp.resultCode == 9000) {
-                  my.reLaunch({
-                    url: '/pages/pay_success/pay_success',
-                  })
-                } else {
-                  return
-                }
-
-              },
-              fail(err) {
-                my.hideLoading()
-                my.showToast({
-                  content: '支付失败',
-                  icon: 'none'
-                })
-              }
-            })
-            that.setData({
-              disable: false
-            })
-          } else {
-            my.reLaunch({
-              url: '/pages/pay_success/pay_success?order=' + that.data.date.orders.no,
-            })
-          }
-        }
-
-      }).catch(err => {
-        my.hideLoading()
-        my.showToast({
-          content: '请求失败,请重试',
-          icon: 'none'
-        })
-      })
-
-    } else {
-      my.hideLoading()
-      my.showToast({
-        content: '请选择支付方式',
-        icon: 'none'
-      })
-    }
-  }, 1500),
-  repair: function () {
-    my.navigateTo({
-      url: '/pages/repair/repair?bike_id=' + this.data.code,
-    })
-  },
-  phone: function (e) {
-    my.makePhoneCall({
-      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
-    })
-  },
-  onReady: function () {
-    // console.log(this.data.coupon.dataYes)
-  },
-  onShow: function () {
-    this.refresh()
-
-  },
-  refresh: function () {
-    my.showNavigationBarLoading();
-    var that = this;
-    my.showLoading({
-      content: '加载中...',
-      mask: true
-    })
-    if (that.data.order.length > 20) {
-      app.request(url + '/pay-show?order_no=' + that.data.order + '&is_first=true', '', 'GET').then(res => {
-        console.log(res, '支付页面数据')
-        console.log(this.data.disable, '支付页面数据')
-
-        if (res.status == 200) {
-
-          that.setData({
-            date: res.data,
-            balance: res.data.wallet_money,
-            bolear: res.data.wallet_pay_status,
-            code: res.data.orders.bike_no
-          })
-          my.hideLoading({
-            complete: (res) => { },
-          })
-          if (res.data.wallet_pay_status == false) {
-            that.setData({
-              check1: false,
-              check2: true,
-              index: 1
-            })
-          } else {
-            that.setData({
-              check1: true,
-              check2: false,
-              index: 2
-            })
-          }
-          if (res.data.user_coupon.is_coupon) {
-            that.setData({
-              coupon_user_bags_id: res.data.user_coupon.coupon_user_bags_id
-            })
-          }
-          my.hideNavigationBarLoading()
-          my.stopPullDownRefresh()
-        }
-      })
-    }
-    else {
-      my.hideLoading()
-      my.hideNavigationBarLoading()
-      my.stopPullDownRefresh()
-    }
-  },
-  onPullDownRefresh: function () {
-    this.refresh()
-  },
-  backHome: function () {
-    my.reLaunch({
-      url: '/pages/index/index',
-    })
-  },
-
-
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+const util = require('../../utils/utils')
+var app = getApp()
+var url = ''
+var intervar;
+Page({
+  data: {
+    statusbar: '',//导航栏高度
+    order: '',//订单编号
+    date: [],
+    balance: '', //当前余额
+    bolear: '', //判断当前余额够不够本次消费 够为true 不够为false
+    check1: '',
+    check2: '',
+    index: '', //记录当前选择的是余额还是支付宝支付
+    disable: false,
+    timing: '',
+    rent: '',
+    screenHeight: '',
+    code: '',
+    chooseSize: false,
+    animationData1: {},
+    couponIndex: 0,
+    coupon_user_bags_id: 0,
+    coupon: [],
+    payment_type: false,
+    notice: false,
+    setting: my.getStorageSync({ 'key': 'setting' }).data,
+    img: app.globalData.imgUrl
+  },
+  catchtouchmove: function () {
+    return;
+  },
+  tap_coupon: function (e) {
+    this.setData({
+      couponIndex: e.currentTarget.dataset.index
+    })
+  },
+  payment_type: function () {
+    this.setData({
+      payment_type: true
+    })
+  },
+  cancel: function () {
+    console.log(this.data.index)
+    this.setData({
+      index: this.data.index,
+      payment_type: false
+    })
+    if (this.data.index == 2) {
+      this.setData({
+        check1: true,
+        check2: false
+      })
+    }
+    if (this.data.index == 1) {
+      this.setData({
+        check2: true,
+        check1: false
+      })
+    }
+  },
+  queding: function () {
+    if (this.data.check1) {
+      //判断当前是不是余额支付
+      this.setData({
+        check1: true,
+        check2: false,
+        index: 2,
+      })
+    } else {
+      this.setData({
+        check1: false,
+        check2: true,
+        index: 1,
+      })
+    }
+    this.setData({
+      payment_type: false
+    })
+  },
+  to_recharge: function () {
+    // console.log('去充值')
+    my.navigateTo({
+      url: '/pages/balance/balance',
+    })
+  },
+  notice: function () {
+    this.setData({
+      notice: true
+    })
+  },
+  notice_false: function () {
+    this.setData({
+      notice: false
+    })
+  },
+  onLoad: function (options) {
+    console.log(options)
+
+    var that = this;
+    this.setData({
+      screenHeight: app.globalData.screenHeight
+    })
+    // if (options.rent == 'rent') {
+
+    // } else {
+    url = '/order'
+    //  url = '/rent'
+    //   this.setData({
+    //     rent: true
+    //   })
+    // }
+    if (options != null &&  options.order.length > 20) {
+      this.setData({
+        order: options.order
+      })
+    } else {
+      my.alert({
+        title: '提示',
+        content: '订单号有误,请重试~',
+        showCancel: false,
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+    }
+
+
+
+  },
+  home: function () {
+    //点击返回首页
+    var that = this;
+
+    if (that.data.index != '') {
+      var data = {
+        pay_type: that.data.index,
+        order_no: that.data.order,
+        coupon_user_bags_id: that.data.coupon_user_bags_id
+      }
+      if (that.data.disable == true) {
+        my.showToast({
+          content: '您的操作过于频繁,请稍后再试~',
+          icon: 'none'
+        })
+        return;
+      }
+      that.setData({
+        disable: true
+      })
+      if (that.data.date.orders.pay_status == 1) {
+        my.reLaunch({
+          url: '/pages/index/index',
+        })
+        my.hideLoading()
+        return
+      }
+      app.request(url + '/pay', data, 'POST').then(res => {
+        console.log(res)
+        that.setData({
+          order: res.data.order_no
+        })
+        //获取支付参数
+        if (res.status == 200) {
+          this.setData({
+            order: res.data.order_no
+          })
+          if (res.data.pay_order_status == true) {
+            my.reLaunch({
+              url: '/pages/index/index',
+            })
+          } else {
+            if (that.data.index == 1) {
+              my.tradePay({
+                tradeNO: res.data.tradeNo,
+                success(resp) {
+                  console.log(resp, 'zhifubao')
+                  if (resp.resultCode == 9000) {
+                    my.reLaunch({
+                      url: '/pages/index/index',
+                    })
+                  } else {
+                    return
+                  }
+                },
+                fail(err) {
+                  my.showToast({
+                    content: '支付失败',
+                    icon: 'none'
+                  })
+                }
+              })
+              that.setData({
+                disable: false
+              })
+            } else {
+              my.reLaunch({
+                url: '/pages/index/index',
+              })
+            }
+          }
+        }
+      })
+    }
+
+  },
+  retryClose: util.throttle(function () {
+    //点击关锁失败
+    var that = this;
+    my.showLoading({
+      content: '关锁中...',
+      mask: true
+    })
+    clearInterval(intervar)
+    my.getLocation({
+      type: 'gcj02',
+      success: function (res) {
+        console.log(res)
+        app.request('/order/retry-close-lock?order_no=' + that.data.date.orders.no + '&bike_no=' + that.data.date.orders.bike_no, '', 'GET').then(res => {
+          console.log(res)
+          if (res.status == 200) {
+            my.hideLoading()
+            if (res.data.status == 1) {
+              my.showToast({
+                content: '关锁成功',
+                icon: 'none'
+              })
+            }
+          }
+        })
+      },
+    })
+  }, 1000),
+  check1: function () {
+    //选择余额支付
+    this.setData({
+      check1: true,
+      check2: false
+    })
+  },
+  check2: function () {
+    //选择支付宝支付
+    this.setData({
+      check1: false,
+      check2: true
+    })
+  },
+  check4: function () {
+    //点击去购买骑行卡
+    my.navigateTo({
+      url: '/pages/buy-card/buy-card',
+    })
+  },
+  check3: function () {
+    var that = this;
+    // 创建一个动画实例
+    console.log(that.data.coupon)
+    app.request('/coupon/getCouponsByOrder?order_no=' + that.data.order, '', 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        that.setData({
+          coupon: res.data
+        })
+        var coupon = res.data.dataYes;
+        for (var i = 0; i < coupon.length; i++) {
+          if (coupon[i].id == that.data.date.user_coupon.coupon_user_bags_id) {
+            coupon[i].selected = true;
+          } else {
+            coupon[i].selected = false;
+          }
+        }
+        var couponYes = 'coupon.dataYes';
+        that.setData({
+          [couponYes]: coupon
+        })
+      }
+    })
+    var animation = my.createAnimation({
+      // 动画持续时间
+      duration: 400,
+      // 定义动画效果,当前是匀速
+      timingFunction: 'linear'
+    })
+    // 将该变量赋值给当前动画
+    that.animation = animation
+    // 先在y轴偏移,然后用step()完成一个动画
+    animation.translateY(300).step()
+    // 用setData改变当前动画
+    that.setData({
+      // 通过export()方法导出数据
+      animationData1: animation.export(),
+      // 改变view里面的Wx:if
+      chooseSize: true
+    })
+    // 设置setTimeout来改变y轴偏移量,实现有感觉的滑动
+    setTimeout(function () {
+      animation.translateY(0).step()
+      that.setData({
+        animationData1: animation.export()
+      })
+    }, 100)
+
+  },
+  hideModal: function (e) {
+    var that = this;
+    var animation = my.createAnimation({
+      duration: 400,
+      timingFunction: 'linear'
+    })
+    that.animation = animation
+    animation.translateY(360).step()
+    that.setData({
+      animationData1: animation.export()
+
+    })
+    // setTimeout(function () {
+    //   var query = my.createSelectorQuery();
+    //   query.select('.choose').boundingClientRect();
+    //   query.exec(function (res) {
+    //     console.log(res)
+    //     // that.setData({arrowDown:res[0].height+15})
+    //     animation.translateY(res[0].height).step()
+    //   })
+    //   that.setData({
+    //     animationData1: animation.export(),
+    //     chooseSize: false
+    //   })
+    // }, 400)
+  },
+  coupons: function (e) {
+    var id = e.currentTarget.dataset.id;
+    var index = e.currentTarget.dataset.index;
+    var coupons = this.data.coupon.dataYes;
+    var select = e.currentTarget.dataset.selected;
+    if (coupons[index].selected == true) {
+      for (var i = 0; i < coupons.length; i++) {
+        coupons[i].selected = false;
+      }
+    } else {
+      for (var i = 0; i < coupons.length; i++) {
+        coupons[i].selected = false;
+        coupons[index].selected = true
+      }
+    }
+    var couponList = 'coupon.dataYes';
+    this.setData({
+      coupon_user_bags_id: id,
+      // chooseSize: false,
+      [couponList]: coupons
+    })
+  },
+  srue: function () {
+    var that = this;
+    var coupon_yes = that.data.coupon.dataYes;
+    var id = ''
+    for (var i = 0; i < coupon_yes.length; i++) {
+      if (coupon_yes[i].selected == true) {
+        id = coupon_yes[i].id
+      }
+    }
+    my.showLoading({
+      content: '加载中...',
+      mask: true
+    })
+    app.request(url + '/pay-show?order_no=' + that.data.order + '&coupon_user_bags_id=' + id, '', 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        my.hideLoading()
+        that.setData({
+          date: res.data,
+          balance: res.data.wallet_money,
+          bolear: res.data.wallet_pay_status,
+          chooseSize: false
+        })
+        if (res.data.wallet_pay_status == false) {
+          that.setData({
+            check1: false,
+            check2: true,
+            index: 1
+          })
+        } else {
+          that.setData({
+            check1: true,
+            check2: false,
+            index: 2
+          })
+        }
+        console.log(that.data.index)
+        if (res.data.user_coupon.is_coupon) {
+          that.setData({
+            coupon_user_bags_id: res.data.user_coupon.coupon_user_bags_id
+          })
+        }
+      }
+    })
+  },
+  payment: util.throttle(function () {
+    my.showLoading({
+      content: '加载中',
+      icon: 'none',
+      mask: true
+    })
+    //点击立即支付
+    var that = this;
+    console.log(that.data.index)
+    if (that.data.index != '') {
+      var data = {
+        pay_type: that.data.index,
+        order_no: that.data.order,
+        coupon_user_bags_id: that.data.coupon_user_bags_id
+      }
+
+      app.request(url + '/pay', data, 'POST').then(res => {
+        console.log(res)
+        my.hideLoading()
+        //获取支付参数
+        if (res.status == 200) {
+
+          if (that.data.index == 1) {
+            my.tradePay({
+              tradeNO: res.data.tradeNo,
+              success(resp) {
+                console.log(resp, 'zhifubao')
+                if (resp.resultCode == 9000) {
+                  my.reLaunch({
+                    url: '/pages/pay_success/pay_success',
+                  })
+                } else {
+                  return
+                }
+
+              },
+              fail(err) {
+                my.hideLoading()
+                my.showToast({
+                  content: '支付失败',
+                  icon: 'none'
+                })
+              }
+            })
+            that.setData({
+              disable: false
+            })
+          } else {
+            my.reLaunch({
+              url: '/pages/pay_success/pay_success?order=' + that.data.date.orders.no,
+            })
+          }
+        }
+
+      }).catch(err => {
+        my.hideLoading()
+        my.showToast({
+          content: '请求失败,请重试',
+          icon: 'none'
+        })
+      })
+
+    } else {
+      my.hideLoading()
+      my.showToast({
+        content: '请选择支付方式',
+        icon: 'none'
+      })
+    }
+  }, 1500),
+  repair: function () {
+    my.navigateTo({
+      url: '/pages/repair/repair?bike_id=' + this.data.code,
+    })
+  },
+  phone: function (e) {
+    my.makePhoneCall({
+      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
+    })
+  },
+  onReady: function () {
+    // console.log(this.data.coupon.dataYes)
+  },
+  onShow: function () {
+    this.refresh()
+
+  },
+  refresh: function () {
+    my.showNavigationBarLoading();
+    var that = this;
+    my.showLoading({
+      content: '加载中...',
+      mask: true
+    })
+    if (that.data.order.length > 20) {
+      app.request(url + '/pay-show?order_no=' + that.data.order + '&is_first=true', '', 'GET').then(res => {
+        console.log(res, '支付页面数据')
+        console.log(this.data.disable, '支付页面数据')
+
+        if (res.status == 200) {
+
+          that.setData({
+            date: res.data,
+            balance: res.data.wallet_money,
+            bolear: res.data.wallet_pay_status,
+            code: res.data.orders.bike_no
+          })
+          my.hideLoading({
+            complete: (res) => { },
+          })
+          if (res.data.wallet_pay_status == false) {
+            that.setData({
+              check1: false,
+              check2: true,
+              index: 1
+            })
+          } else {
+            that.setData({
+              check1: true,
+              check2: false,
+              index: 2
+            })
+          }
+          if (res.data.user_coupon.is_coupon) {
+            that.setData({
+              coupon_user_bags_id: res.data.user_coupon.coupon_user_bags_id
+            })
+          }
+          my.hideNavigationBarLoading()
+          my.stopPullDownRefresh()
+        }
+      })
+    }
+    else {
+      my.hideLoading()
+      my.hideNavigationBarLoading()
+      my.stopPullDownRefresh()
+    }
+  },
+  onPullDownRefresh: function () {
+    this.refresh()
+  },
+  backHome: function () {
+    my.reLaunch({
+      url: '/pages/index/index',
+    })
+  },
+
+
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 6 - 6
pages/pay/pay.json

@@ -1,7 +1,7 @@
-{
-  "usingComponents": {},
-  "defaultTitle": "订单支付",
-  "navigationStyle":"custom",
-  "pullRefresh": true
-  
+{
+  "usingComponents": {},
+  "defaultTitle": "订单支付",
+  "navigationStyle":"custom",
+  "pullRefresh": true
+  
 }

+ 119 - 119
pages/pay_success/pay_success.acss

@@ -1,120 +1,120 @@
-/* required by usingComponents */
-/* pages/pay_success/pay_success.wxss */
-page {
-  /* background-color: #f3f3f5; */
-  color: #333333;
-  text-align: center;
-}
-
-.top-head {
-  height: 250rpx;
-  width: 100%;
-  /* background-color: var(--globleColor); */
-}
-
-.content {
-
-  margin: 0 80rpx;
-  margin-top: -150rpx;
-  
-}
-
-.content-first {
-  background-color: #ffffff;
-  border-radius: 12rpx;
-  padding: 30rpx;
-  text-align: center;
-
-}
-.paymoney{
-  text-align: center;
-  font-size:50rpx;
-  margin-bottom: 30rpx;
-  height:250rpx;
-  width:250rpx;
-  margin-top: 20%;
-
-}
-.content-title {
-  font-size: 40rpx;
-  font-weight: bold;
-  text-align: center;
-}
-
-.content-detail {
-  text-align: center;
-  font-size: 28rpx;
-  margin-top: 30rpx;
-}
-
-.money-detail {
-  margin-top: 30rpx;
-}
-
-.detail-first {
-  display: flex;
-  padding:10rpx;
-  font-size: 28rpx;
-}
-
-.detail-left {
-  flex: 1;
-  text-align: left;
-}
-
-.detail-right {
-  flex: 1;
-  text-align: right;
-}
-.text{
-}
-.text1{
-  color: #999999;
-}
-.detail-first1{
-  border-bottom: solid 1rpx #f3f3f3;
-  padding-bottom: 30rpx;
-}.detail-first2{
-
-  padding-top: 30rpx;
-}
-.problem{
-color: #999999;
-font-size: 26rpx;
-text-align: right;
-padding: 20rpx 10rpx;
-margin-bottom: 20rpx;
-}
-.baoxiu{
-  text-align: center;
-  height: 50rpx;
-  line-height: 50rpx;
-  font-size: 24rpx;
-  margin-top: 20rpx;
-  color: var(--globleColor);
-}
-.payButton{
-width: 50%;
-height: 80rpx;
-line-height: 80rpx;
-margin: 0 auto;
-text-align: center;
-background: var(--globleColor);
-border-radius: 12rpx;
-margin-top: 100rpx;
-margin-bottom: 50rpx;
-font-size: 32rpx;
- color: var(--fontColor);
-}
-.home{
-width: 80%;
-height: 100rpx;
-line-height: 100rpx;
-border-radius: 12rpx;
-margin: 0 auto;
-margin-top: 18%;
-font-size: 32rpx;
-text-align: center;
-font-weight: 600;
-background-color: var(--globleColor);
+/* required by usingComponents */
+/* pages/pay_success/pay_success.wxss */
+page {
+  /* background-color: #f3f3f5; */
+  color: #333333;
+  text-align: center;
+}
+
+.top-head {
+  height: 250rpx;
+  width: 100%;
+  /* background-color: var(--globleColor); */
+}
+
+.content {
+
+  margin: 0 80rpx;
+  margin-top: -150rpx;
+  
+}
+
+.content-first {
+  background-color: #ffffff;
+  border-radius: 12rpx;
+  padding: 30rpx;
+  text-align: center;
+
+}
+.paymoney{
+  text-align: center;
+  font-size:50rpx;
+  margin-bottom: 30rpx;
+  height:250rpx;
+  width:250rpx;
+  margin-top: 20%;
+
+}
+.content-title {
+  font-size: 40rpx;
+  font-weight: bold;
+  text-align: center;
+}
+
+.content-detail {
+  text-align: center;
+  font-size: 28rpx;
+  margin-top: 30rpx;
+}
+
+.money-detail {
+  margin-top: 30rpx;
+}
+
+.detail-first {
+  display: flex;
+  padding:10rpx;
+  font-size: 28rpx;
+}
+
+.detail-left {
+  flex: 1;
+  text-align: left;
+}
+
+.detail-right {
+  flex: 1;
+  text-align: right;
+}
+.text{
+}
+.text1{
+  color: #999999;
+}
+.detail-first1{
+  border-bottom: solid 1rpx #f3f3f3;
+  padding-bottom: 30rpx;
+}.detail-first2{
+
+  padding-top: 30rpx;
+}
+.problem{
+color: #999999;
+font-size: 26rpx;
+text-align: right;
+padding: 20rpx 10rpx;
+margin-bottom: 20rpx;
+}
+.baoxiu{
+  text-align: center;
+  height: 50rpx;
+  line-height: 50rpx;
+  font-size: 24rpx;
+  margin-top: 20rpx;
+  color: var(--globleColor);
+}
+.payButton{
+width: 50%;
+height: 80rpx;
+line-height: 80rpx;
+margin: 0 auto;
+text-align: center;
+background: var(--globleColor);
+border-radius: 12rpx;
+margin-top: 100rpx;
+margin-bottom: 50rpx;
+font-size: 32rpx;
+ color: var(--fontColor);
+}
+.home{
+width: 80%;
+height: 100rpx;
+line-height: 100rpx;
+border-radius: 12rpx;
+margin: 0 auto;
+margin-top: 18%;
+font-size: 32rpx;
+text-align: center;
+font-weight: 600;
+background-color: var(--globleColor);
 }

+ 54 - 54
pages/phone_verif/phone_verif.acss

@@ -1,55 +1,55 @@
-/* required by usingComponents */
-/* pages/phone_verif/phone_verif.wxss */
-.phone_verif {
-  padding: 0 40rpx;
-}
-
-.title {
-  font-size: 46rpx;
-  font-weight: 500;
-  margin-top: 50rpx;
-}
-
-.tip {
-  margin-top: 20rpx;
-  font-size: 26rpx;
-  color: #9c9c9c;
-}
-
-.num-list {
-  display: flex;
-  justify-content: space-between;
-  flex-direction: row;
-  flex-wrap: wrap;
-  margin-top:90rpx;
-}
-
-.item {
-  flex: 0 0 20%;
-  height: 130rpx;
-  background-color: #fbfbfb;
-  border: solid 1rpx #d7d7d7;
-}
-.time{
-  margin-top: 70rpx;
-  text-align: right;
-font-size: 26rpx;
-color: #919392;
-}
-.count-time{
-  color: #e4a03d;
-}
-.time1{
-  margin-top: 70rpx;
-  text-align: right;
-font-size: 26rpx;
-width: 150rpx;
-border-radius: 12rpx;
-text-align: center;
-height: 50rpx;
-line-height: 50rpx;
-color:var(--orgFont);
-float:right;
-border: solid 1rpx var(--orgFont);
-
+/* required by usingComponents */
+/* pages/phone_verif/phone_verif.wxss */
+.phone_verif {
+  padding: 0 40rpx;
+}
+
+.title {
+  font-size: 46rpx;
+  font-weight: 500;
+  margin-top: 50rpx;
+}
+
+.tip {
+  margin-top: 20rpx;
+  font-size: 26rpx;
+  color: #9c9c9c;
+}
+
+.num-list {
+  display: flex;
+  justify-content: space-between;
+  flex-direction: row;
+  flex-wrap: wrap;
+  margin-top:90rpx;
+}
+
+.item {
+  flex: 0 0 20%;
+  height: 130rpx;
+  background-color: #fbfbfb;
+  border: solid 1rpx #d7d7d7;
+}
+.time{
+  margin-top: 70rpx;
+  text-align: right;
+font-size: 26rpx;
+color: #919392;
+}
+.count-time{
+  color: #e4a03d;
+}
+.time1{
+  margin-top: 70rpx;
+  text-align: right;
+font-size: 26rpx;
+width: 150rpx;
+border-radius: 12rpx;
+text-align: center;
+height: 50rpx;
+line-height: 50rpx;
+color:var(--orgFont);
+float:right;
+border: solid 1rpx var(--orgFont);
+
 }

+ 50 - 50
pages/phonelogin/phonelogin.acss

@@ -1,51 +1,51 @@
-/* required by usingComponents */
-/* pages/phonelogin/phonelogin.wxss */
-.phone-login {
-  padding: 0 40rpx;
-}
-
-.title {
-  margin-top: 50rpx;
-  font-size:46rpx;
-}
-
-.input-phone {
-  margin-top: 70rpx;
-  height: 100rpx;
-  font-size: 30rpx;
-  font-weight: 500;
-  line-height: 100rpx;
-  border-bottom: solid 1rpx #efefef;
-}
-
-
-.tips {
-  margin-top: 30rpx;
-  color: #999999;
-  font-size: 24rpx;
-}
-
-.iconfont {
-  font-size: 24rpx;
-}
-
-.no-input {
-  color: #d7d7d7;
-}
-.next,.next-step{
-width: 100%;
-height: 100rpx;
-line-height: 100rpx;
-border-radius: 12rpx;
-text-align: center;
-margin-top:100rpx;
-
-}
-.next{
-  background-color: #cccccc;
-  color: #fff;
-}
-.next-step{
-  background-color: var(--globleColor);
-    color: var(--fontColor);
+/* required by usingComponents */
+/* pages/phonelogin/phonelogin.wxss */
+.phone-login {
+  padding: 0 40rpx;
+}
+
+.title {
+  margin-top: 50rpx;
+  font-size:46rpx;
+}
+
+.input-phone {
+  margin-top: 70rpx;
+  height: 100rpx;
+  font-size: 30rpx;
+  font-weight: 500;
+  line-height: 100rpx;
+  border-bottom: solid 1rpx #efefef;
+}
+
+
+.tips {
+  margin-top: 30rpx;
+  color: #999999;
+  font-size: 24rpx;
+}
+
+.iconfont {
+  font-size: 24rpx;
+}
+
+.no-input {
+  color: #d7d7d7;
+}
+.next,.next-step{
+width: 100%;
+height: 100rpx;
+line-height: 100rpx;
+border-radius: 12rpx;
+text-align: center;
+margin-top:100rpx;
+
+}
+.next{
+  background-color: #cccccc;
+  color: #fff;
+}
+.next-step{
+  background-color: var(--globleColor);
+    color: var(--fontColor);
 }

+ 10 - 10
pages/phonelogin/phonelogin.axml

@@ -1,10 +1,10 @@
-<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>
+<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 - 72
pages/phonelogin/phonelogin.js

@@ -1,73 +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),
-    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 () {
-
-  }
+// 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 () {
+
+  }
 })

+ 186 - 186
pages/real_name/real_name.acss

@@ -1,187 +1,187 @@
-/* required by usingComponents */
-/* pages/real_name/real_name.wxss */
-.top-tips {
-  background-color: #fef0e7;
-  height: 80rpx;
-  color: var(--orgFont);
-  line-height: 80rpx;
-  /* text-align: center; */
-  font-size: 22rpx;
-  padding: 0 30rpx;
-}
-
-.change-phone {
-  display: inline-block;
-  vertical-align: middle;
-  margin-top: 20rpx;
-  height: 40rpx;
-  line-height: 40rpx;
-  border-radius: 10rpx;
-  font-size: 22rpx;
-  padding: 0 10rpx;
-  float: right;
-
-  border: solid 1rpx var(--orgFont);
-  color: var(--orgFont);
-}
-
-.content {
-  padding: 50rpx;
-}
-
-.title {
-  font-size: 40rpx;
-  font-weight: 500;
-}
-
-.text1 {
-  font-size: 28rpx;
-  color: #949293;
-  margin-top: 20rpx;
-  margin-bottom: 70rpx;
-}
-
-.form {
-  margin-top: 30rpx;
-  height: 100rpx;
-  line-height: 100rpx;
-  background-color: #f2f2f4;
-  padding:0 30rpx;
-  display: flex;
-  font-size: 30rpx;
-
-}
-
-.left {
-  flex: 0 0 150rpx;
-  font-weight: 500;
-}
-
-input {
-  flex: 1;
-  /* line-height: 100rpx; */
-  height:90rpx;
-  background-color: #f2f2f4;
-
-}
-
-.no-input {
-  color: #cccccc;
-}
-
-.submit {
-  height: 100rpx;
-  text-align: center;
-  border-radius: 40rpx;
-  line-height: 100rpx;
-  width: 70%;
-  margin: 0 auto;
-  margin-top: 100rpx;
-  background-color: var(--globleColor);
-   color: var(--fontColor);
-}
-
-.frame {
-  height: 100vh;
-  width: 100%;
-  position: fixed;
-  top: 0;
-  left: 0;
-  z-index: 99;
-  background-color: rgba(0, 0, 0, 0.6);
-
-}
-
-.frame-content {
-  position: fixed;
-  /* padding-top: 70rpx; */
-  background-color: #f9f8f6;
-  border-radius: 50rpx 50rpx 0 0;
-  width: 100%;
-  bottom: 0;
-  left: 0;
-}
-.frame-cha{
-  height: 70rpx;
-  line-height: 70rpx;
-  font-size: 40rpx;
-  text-align: right;
-  margin-right: 50rpx;
-  color: #999999;
-}
-
-.frame-title {
-  text-align: center;
-  margin: 30rpx 0;
-  font-size: 34rpx;
-  color: #666666;
-}
-
-.card,
-.card1 {
-  margin: 0rpx 60rpx;
-  padding: 30rpx;
-  display: flex;
-  margin-top: 30rpx;
-  background-color: #f2b80c;
-  border-radius: 12rpx;
-  color: #fff;
-
-}
-
-.card1 {
-  background-color: #fff;
-  color: #333333;
-}
-
-
-.card-left {
-  flex: 1;
-}
-
-.card-title {
-  font-size: 40rpx;
-}
-
-.card-text1 {
-  margin-top: 20rpx;
-  font-size: 28rpx;
-}
-
-.card-text2 {
-  margin-top: 50rpx;
-  font-size: 26rpx;
-}
-
-.card-right image {
-  height: 100rpx;
-  width: 100rpx;
-}
-
-.wancheng {
-  margin-top: 30rpx;
-  background-color: #fff;
-  padding: 30rpx 0;
-  text-align: center;
-  border-radius: 50rpx 50rpx 0 0 ;
-  box-shadow: 0 0 15px #e3e2e0;
-
-}
-
-.wan-tip {
-  font-size: 24rpx;
-  color: #9a9a9a;
-}
-
-.wan-submit {
-  height: 100rpx;
-  line-height: 100rpx;
-  background-color: var(--globleColor);
-  margin: 0 auto;
-  margin-top: 30rpx;
-  border-radius: 50rpx;
-  width: 60%;
-  font-size: 34rpx;
-  font-weight: 500;
- color: var(--fontColor);
+/* required by usingComponents */
+/* pages/real_name/real_name.wxss */
+.top-tips {
+  background-color: #fef0e7;
+  height: 80rpx;
+  color: var(--orgFont);
+  line-height: 80rpx;
+  /* text-align: center; */
+  font-size: 22rpx;
+  padding: 0 30rpx;
+}
+
+.change-phone {
+  display: inline-block;
+  vertical-align: middle;
+  margin-top: 20rpx;
+  height: 40rpx;
+  line-height: 40rpx;
+  border-radius: 10rpx;
+  font-size: 22rpx;
+  padding: 0 10rpx;
+  float: right;
+
+  border: solid 1rpx var(--orgFont);
+  color: var(--orgFont);
+}
+
+.content {
+  padding: 50rpx;
+}
+
+.title {
+  font-size: 40rpx;
+  font-weight: 500;
+}
+
+.text1 {
+  font-size: 28rpx;
+  color: #949293;
+  margin-top: 20rpx;
+  margin-bottom: 70rpx;
+}
+
+.form {
+  margin-top: 30rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  background-color: #f2f2f4;
+  padding:0 30rpx;
+  display: flex;
+  font-size: 30rpx;
+
+}
+
+.left {
+  flex: 0 0 150rpx;
+  font-weight: 500;
+}
+
+input {
+  flex: 1;
+  /* line-height: 100rpx; */
+  height:90rpx;
+  background-color: #f2f2f4;
+
+}
+
+.no-input {
+  color: #cccccc;
+}
+
+.submit {
+  height: 100rpx;
+  text-align: center;
+  border-radius: 40rpx;
+  line-height: 100rpx;
+  width: 70%;
+  margin: 0 auto;
+  margin-top: 100rpx;
+  background-color: var(--globleColor);
+   color: var(--fontColor);
+}
+
+.frame {
+  height: 100vh;
+  width: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 99;
+  background-color: rgba(0, 0, 0, 0.6);
+
+}
+
+.frame-content {
+  position: fixed;
+  /* padding-top: 70rpx; */
+  background-color: #f9f8f6;
+  border-radius: 50rpx 50rpx 0 0;
+  width: 100%;
+  bottom: 0;
+  left: 0;
+}
+.frame-cha{
+  height: 70rpx;
+  line-height: 70rpx;
+  font-size: 40rpx;
+  text-align: right;
+  margin-right: 50rpx;
+  color: #999999;
+}
+
+.frame-title {
+  text-align: center;
+  margin: 30rpx 0;
+  font-size: 34rpx;
+  color: #666666;
+}
+
+.card,
+.card1 {
+  margin: 0rpx 60rpx;
+  padding: 30rpx;
+  display: flex;
+  margin-top: 30rpx;
+  background-color: #f2b80c;
+  border-radius: 12rpx;
+  color: #fff;
+
+}
+
+.card1 {
+  background-color: #fff;
+  color: #333333;
+}
+
+
+.card-left {
+  flex: 1;
+}
+
+.card-title {
+  font-size: 40rpx;
+}
+
+.card-text1 {
+  margin-top: 20rpx;
+  font-size: 28rpx;
+}
+
+.card-text2 {
+  margin-top: 50rpx;
+  font-size: 26rpx;
+}
+
+.card-right image {
+  height: 100rpx;
+  width: 100rpx;
+}
+
+.wancheng {
+  margin-top: 30rpx;
+  background-color: #fff;
+  padding: 30rpx 0;
+  text-align: center;
+  border-radius: 50rpx 50rpx 0 0 ;
+  box-shadow: 0 0 15px #e3e2e0;
+
+}
+
+.wan-tip {
+  font-size: 24rpx;
+  color: #9a9a9a;
+}
+
+.wan-submit {
+  height: 100rpx;
+  line-height: 100rpx;
+  background-color: var(--globleColor);
+  margin: 0 auto;
+  margin-top: 30rpx;
+  border-radius: 50rpx;
+  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" 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 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>

+ 155 - 155
pages/recharge-active/recharge-active.acss

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

+ 38 - 38
pages/recharge-active/recharge-active.axml

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

+ 219 - 219
pages/recharge-active/recharge-active.js

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

+ 4 - 4
pages/recharge-active/recharge-active.json

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

+ 37 - 37
pages/refund_success/refund_success.acss

@@ -1,37 +1,37 @@
-/* required by usingComponents */
-.scan{
-  margin-top: 60rpx;
-}
-page{
-  height: 100%;
-}
-.suce{
-  padding-top: 102rpx;
-  text-align: center;
-}
-.suce image{
-  width: 184rpx;
-  height: 198rpx;
-  margin-top: 10%;
-}
-ad{
-  position: fixed;
-  bottom: 0rpx;
-  left: 0rpx;
-  width: 100%;
-}
-.text{
-  margin-top: 60rpx;
-}
-.button{
-height: 80rpx;
-width: 350rpx;
-background-color: var(--globleColor);
-margin: 0 auto;
-margin-top: 50rpx;
-text-align: center;
-line-height:80rpx;
-border-radius: 15rpx;
-font-size: 32rpx;
- color: var(--fontColor);
-}
+/* required by usingComponents */
+.scan{
+  margin-top: 60rpx;
+}
+page{
+  height: 100%;
+}
+.suce{
+  padding-top: 102rpx;
+  text-align: center;
+}
+.suce image{
+  width: 184rpx;
+  height: 198rpx;
+  margin-top: 10%;
+}
+ad{
+  position: fixed;
+  bottom: 0rpx;
+  left: 0rpx;
+  width: 100%;
+}
+.text{
+  margin-top: 60rpx;
+}
+.button{
+height: 80rpx;
+width: 350rpx;
+background-color: var(--globleColor);
+margin: 0 auto;
+margin-top: 50rpx;
+text-align: center;
+line-height:80rpx;
+border-radius: 15rpx;
+font-size: 32rpx;
+ color: var(--fontColor);
+}

+ 64 - 64
pages/ride_rule/ride_rule.acss

@@ -1,65 +1,65 @@
-/* required by usingComponents */
-/* pages/ride_rule/ride_rule.wxss */
-page {
-  background-color: #fcfcfa;
-}
-
-.top {
-  width: 100%;
-  height: auto;
-}
-
-.content {
-  margin: 0 20rpx;
-}
-
-.title {
-  background-color: #2b2676;
-  height: 80rpx;
-  line-height: 80rpx;
-  width: 220rpx;
-  text-align: center;
-  font-size: 36rpx;
-  color: #ffffff;
-  font-weight: 600;
-  border-top-right-radius: 20rpx;
-}
-
-.child {
-  background-color: #ffffff;
-  border-radius: 10rpx;
-  padding: 20rpx;
-  margin-bottom: 50rpx;
-  box-shadow: 0 0 15px #e6e4e4;
-}
-
-.title2 {
-  color: #2b2676;
-  font-size: 32rpx;
-  font-weight: 600;
-  margin: 50rpx 0;
-}
-
-.text {
-  font-size: 28rpx;
-  line-height: 40rpx;
-  color: #333333;
-}
-
-.list {
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: space-between;
-  flex-direction: row;
-}
-
-.item {
-  flex: 0 0 30%;
-  margin-top: 30rpx;
-  height: 70rpx;
-  text-align: center;
-  line-height: 70rpx;
-  border: solid 1rpx var(--globleColor);
-  color: var(--globleColor);
-  font-size: 26rpx;
+/* required by usingComponents */
+/* pages/ride_rule/ride_rule.wxss */
+page {
+  background-color: #fcfcfa;
+}
+
+.top {
+  width: 100%;
+  height: auto;
+}
+
+.content {
+  margin: 0 20rpx;
+}
+
+.title {
+  background-color: #2b2676;
+  height: 80rpx;
+  line-height: 80rpx;
+  width: 220rpx;
+  text-align: center;
+  font-size: 36rpx;
+  color: #ffffff;
+  font-weight: 600;
+  border-top-right-radius: 20rpx;
+}
+
+.child {
+  background-color: #ffffff;
+  border-radius: 10rpx;
+  padding: 20rpx;
+  margin-bottom: 50rpx;
+  box-shadow: 0 0 15px #e6e4e4;
+}
+
+.title2 {
+  color: #2b2676;
+  font-size: 32rpx;
+  font-weight: 600;
+  margin: 50rpx 0;
+}
+
+.text {
+  font-size: 28rpx;
+  line-height: 40rpx;
+  color: #333333;
+}
+
+.list {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+  flex-direction: row;
+}
+
+.item {
+  flex: 0 0 30%;
+  margin-top: 30rpx;
+  height: 70rpx;
+  text-align: center;
+  line-height: 70rpx;
+  border: solid 1rpx var(--globleColor);
+  color: var(--globleColor);
+  font-size: 26rpx;
 }

+ 184 - 184
pages/ride_zige/ride_zige.acss

@@ -1,185 +1,185 @@
-/* required by usingComponents */
-/* pages/ride_zige/ride_zige.wxss */
-page{
-  background: #ffffff;
-}
-.zige-tips {
-  text-align: center;
-  padding: 20rpx;
-  background-color: #fef5cc;
-}
-
-.title {
-  font-size: 30rpx;
-  font-weight: bold;
-  color: #715321;
-}
-
-.text {
-  font-size: 24rpx;
-  color: #4f4218;
-  margin: 10rpx 0;
-
-}
-
-.card-list {
-  position: relative;
-  margin: 70rpx 30rpx;
-}
-
-.jingxuan {
-  position: absolute;
-  top: -80rpx;
-  left: -15rpx;
-  padding: 10rpx 20rpx;
-  color: #fff;
-  font-size: 24rpx;
-  border-radius: 20rpx 0;
-  background: linear-gradient(to right, #fe6061, #fc9918);
-}
-
-.card-item,
-.active {
-  padding: 40rpx 20rpx;
-  border-radius: 15rpx;
-  border: solid 1rpx #ededed;
-
-  display: flex;
-  margin-bottom: 30rpx;
-}
-
-.active {
-  background-color: var(--fillColor);
-  border: solid 1rpx var(--globleColor);
-}
-
-.item-left {
-  flex: 0 0 70%;
-}
-
-.item-right {
-  flex: 1;
-}
-
-.card-title {
-  font-size: 38rpx;
-  font-weight: bold;
-}
-
-.card-text {
-  margin-top: 10rpx;
-  font-size: 26rpx;
-  color: #989898;
-  /* text-decoration:line-through; 文字中间加横线*/
-}
-
-.mine-ad {
-  height: 70rpx;
-  background-color: #feebe5;
-  line-height: 70rpx;
-  color: #ed3736;
-  font-size: 24rpx;
-  border-radius: 12rpx;
-  padding: 0 30rpx;
-  margin-top: 40rpx;
-  margin-bottom: 20rpx;
-}
-
-.tip {
-  display: inline-block;
-  vertical-align: top;
-  border-radius: 10rpx;
-  font-size: 20rpx;
-  color: #fff;
-  background-color: #ff4003;
-  padding: 8rpx;
-  margin-left: 10rpx;
-}
-
-.list-title {
-  margin-bottom: 30rpx;
-  font-size: 32rpx;
-  font-weight: 500;
-}
-
-.button {
-  position: fixed;
-  width: 80%;
-  height: 100rpx;
-  text-align: center;
-  line-height: 100rpx;
-  background-color: var(--globleColor);
-  left: 10%;
-  bottom: 70rpx;
-  border-radius: 50rpx;
-  font-size: 34rpx;
-  font-weight: bold;
-   color: var(--fontColor);
-}
-
-.zige-frame {
-  position: fixed;
-  width: 100%;
-  height: 100%;
-  background: rgba(0, 0, 0, 0.6);
-  z-index: 99;
-}
-
-.frame-content {
-  width: 45%;
-  padding: 0 30px;
-  background: #fff;
-  margin: 0 auto;
-  margin-top: 40%;
-  border-radius: 15rpx;
-  padding-bottom: 30rpx;
-}
-
-.frame-title {
-  text-align: center;
-  font-size: 36rpx;
-  padding: 20rpx 0;
-  border-bottom: solid 1rpx var(--globleColor);
-
-}
-
-.frame-text {
-  font-size: 28rpx;
-  margin-top: 20rpx;
-  color: #333333;
-  line-height: 42rpx;
-}
-
-.frame-buttom {
-  text-align: center;
-  height: 70rpx;
-  line-height: 70rpx;
-  border-radius: 40rpx;
-  background-color: var(--globleColor);
-  margin-top: 30rpx;
-  font-size: 28rpx;
-   color: var(--fontColor);
-}
-
-.frame-title .iconfont {
-  color: var(--globleColor);
-  display: inline-block;
-  margin-right: 10rpx;
-}
-
-.frame-cha {
-  width:60rpx;
-  height: 60rpx;
-  margin: 0 auto;
-  line-height: 60rpx;
-  margin-top: 80rpx;
-  border: solid 5rpx #fff;
-  text-align: center;
-  border-radius: 50%;
-
-}
-.frame-cha .iconfont{
-  text-align: center;
-  color: #fff;
-  font-size: 30rpx;
+/* required by usingComponents */
+/* pages/ride_zige/ride_zige.wxss */
+page{
+  background: #ffffff;
+}
+.zige-tips {
+  text-align: center;
+  padding: 20rpx;
+  background-color: #fef5cc;
+}
+
+.title {
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #715321;
+}
+
+.text {
+  font-size: 24rpx;
+  color: #4f4218;
+  margin: 10rpx 0;
+
+}
+
+.card-list {
+  position: relative;
+  margin: 70rpx 30rpx;
+}
+
+.jingxuan {
+  position: absolute;
+  top: -80rpx;
+  left: -15rpx;
+  padding: 10rpx 20rpx;
+  color: #fff;
+  font-size: 24rpx;
+  border-radius: 20rpx 0;
+  background: linear-gradient(to right, #fe6061, #fc9918);
+}
+
+.card-item,
+.active {
+  padding: 40rpx 20rpx;
+  border-radius: 15rpx;
+  border: solid 1rpx #ededed;
+
+  display: flex;
+  margin-bottom: 30rpx;
+}
+
+.active {
+  background-color: var(--fillColor);
+  border: solid 1rpx var(--globleColor);
+}
+
+.item-left {
+  flex: 0 0 70%;
+}
+
+.item-right {
+  flex: 1;
+}
+
+.card-title {
+  font-size: 38rpx;
+  font-weight: bold;
+}
+
+.card-text {
+  margin-top: 10rpx;
+  font-size: 26rpx;
+  color: #989898;
+  /* text-decoration:line-through; 文字中间加横线*/
+}
+
+.mine-ad {
+  height: 70rpx;
+  background-color: #feebe5;
+  line-height: 70rpx;
+  color: #ed3736;
+  font-size: 24rpx;
+  border-radius: 12rpx;
+  padding: 0 30rpx;
+  margin-top: 40rpx;
+  margin-bottom: 20rpx;
+}
+
+.tip {
+  display: inline-block;
+  vertical-align: top;
+  border-radius: 10rpx;
+  font-size: 20rpx;
+  color: #fff;
+  background-color: #ff4003;
+  padding: 8rpx;
+  margin-left: 10rpx;
+}
+
+.list-title {
+  margin-bottom: 30rpx;
+  font-size: 32rpx;
+  font-weight: 500;
+}
+
+.button {
+  position: fixed;
+  width: 80%;
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  background-color: var(--globleColor);
+  left: 10%;
+  bottom: 70rpx;
+  border-radius: 50rpx;
+  font-size: 34rpx;
+  font-weight: bold;
+   color: var(--fontColor);
+}
+
+.zige-frame {
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  background: rgba(0, 0, 0, 0.6);
+  z-index: 99;
+}
+
+.frame-content {
+  width: 45%;
+  padding: 0 30px;
+  background: #fff;
+  margin: 0 auto;
+  margin-top: 40%;
+  border-radius: 15rpx;
+  padding-bottom: 30rpx;
+}
+
+.frame-title {
+  text-align: center;
+  font-size: 36rpx;
+  padding: 20rpx 0;
+  border-bottom: solid 1rpx var(--globleColor);
+
+}
+
+.frame-text {
+  font-size: 28rpx;
+  margin-top: 20rpx;
+  color: #333333;
+  line-height: 42rpx;
+}
+
+.frame-buttom {
+  text-align: center;
+  height: 70rpx;
+  line-height: 70rpx;
+  border-radius: 40rpx;
+  background-color: var(--globleColor);
+  margin-top: 30rpx;
+  font-size: 28rpx;
+   color: var(--fontColor);
+}
+
+.frame-title .iconfont {
+  color: var(--globleColor);
+  display: inline-block;
+  margin-right: 10rpx;
+}
+
+.frame-cha {
+  width:60rpx;
+  height: 60rpx;
+  margin: 0 auto;
+  line-height: 60rpx;
+  margin-top: 80rpx;
+  border: solid 5rpx #fff;
+  text-align: center;
+  border-radius: 50%;
+
+}
+.frame-cha .iconfont{
+  text-align: center;
+  color: #fff;
+  font-size: 30rpx;
 }

+ 51 - 51
pages/ride_zige/ride_zige.axml

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

+ 204 - 204
pages/ride_zige/ride_zige.js

@@ -1,205 +1,205 @@
-// pages/ride_zige/ride_zige.js
-const util = require('../../utils/utils');
-var app = getApp()
-var url = ''
-Page({
-  data: {
-    currentItem: 0,
-    cardList: [],//骑行卡列表
-    deposit: '',//骑行卡
-    depositMoney: '',//押金金额
-    frame: false,//确认退还退押金弹框
-
-  },
-  onLoad: function (options) {
-
-    this.setData({
-      deposit: my.getStorageSync({ 'key': 'userState' }).data,
-      depositMoney: my.getStorageSync({ 'key': 'setting' }).data.deposit
-    })
-
-    this.getCard()
-    // this.getState()
-  },
-
-  //获取免押金卡列表
-  getCard() {
-    my.showLoading({})
-    let data = {
-      area_id: my.getStorageSync({ 'key': 'home' }).data.id
-    }
-    if (my.getStorageSync({ 'key': 'home' }).data.id == undefined) {
-      my.hideLoading()
-      my.showToast({
-        content: '您附近没有运营区域',
-        icon: 'none'
-      })
-    } else {
-      //免押金卡
-      app.request('/deposit_card/index', data, 'GET').then(res => {
-
-        console.log(res.data);
-        this.setData({
-          cardList: res.data.data
-        })
-        my.hideLoading({
-          complete: (res) => { },
-        })
-        console.log(this.data.cardList)
-      })
-    }
-
-  },
-  //选择骑行卡类型
-  changeCard: function (e) {
-    let that = this
-    let id = e.currentTarget.dataset.id
-    console.log(e, 'pppppp')
-    that.setData({
-      currentItem: id
-    })
-    // if(id==0){
-    // }else if (that.data.deposit.is_deposit == 1 && that.data.deposit.deposit_type == 1) {
-    //   my.showToast({
-    //     content: '您已缴纳押金无需购买免押金卡',
-    //     icon: 'none'
-    //   })
-    //   return;
-    // }
-  },
-  //立即支付
-  pay: util.throttle(function (e) {
-    console.log('支付')
-    var that = this;
-    let url = '';
-    var data = '';
-
-    console.log(that.data.depShow)
-    if (that.data.currentItem == 0) { //缴纳押金
-      console.log(11111)
-      url = "/deposit/pay";
-      data = {
-        area_id: my.getStorageSync({ 'key': 'home' }).data.id
-      }
-    } else { //购买免押金卡
-      console.log(2222)
-      url = "/deposit_card/pay";
-      data = {
-        area_id: my.getStorageSync({ 'key': 'home' }).data.id,
-        id: that.data.currentItem
-      }
-    }
-    if (my.getStorageSync({ 'key': 'setting' }).data == '') {
-      my.alert({
-        title: '提示',
-        content: '您附近暂无运营区域~',
-        success: function (res) {
-          my.navigateBack()
-        }
-      })
-    } else {
-      app.request(url, data, 'POST', app.globalData.req).then(res => {
-        console.log(res)
-        if (res.status == 200) {
-          console.log(res)
-          my.tradePay({
-            tradeNO: res.data.tradeNo,
-            success(res) {
-              console.log(res)
-              if (res.resultCode == 9000) {
-                let init = '';
-                if (that.data.depShow) {
-                  init = "购买成功"
-                } else {
-                  init = "支付成功"
-                }
-                my.showToast({
-                  content: init,
-                  icon: 'none',
-                  duration: 1000,
-                  success: function () {
-                    my.reLaunch({
-                      url: '/pages/pay_success/pay_success',
-                    })
-                  }
-                })
-                that.setData({
-                  depoSuce: true
-                })
-              } else {
-                return
-              }
-            },
-            fail(err) {
-              // console.log(err)
-              // my.showToast({
-              //   content: '支付失败',
-              //   icon: 'none'
-              // })
-              // that.setData({
-              //   depoSuce: true
-              // })
-            }
-          })
-        } else {
-          console.log(res)
-          that.setData({
-            depoSuce: true
-          })
-        }
-      })
-    }
-
-
-  }, 1000),
-  //退还押金
-  backDeposit: function () {
-    this.setData({
-      frame: true
-    })
-  },
-  closeFrame: function () {
-    this.setData({
-      frame: false
-    })
-  },
-  //立即退还
-  sureBack: util.throttle(function (e) {
-    app.request('/deposit/refund', '', 'POST').then(res => {
-      console.log(res);
-      if (res.status == 200) {
-        my.showToast({
-          content: '押金退回申请成功,请注意查收!',
-          icon: 'none'
-        })
-        setTimeout(function () {
-          my.reLaunch({
-            url: '/pages/index/index',
-          })
-        }, 1500)
-        // this.getState()
-      }
-    })
-  }, 1000),
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  }
+// pages/ride_zige/ride_zige.js
+const util = require('../../utils/utils');
+var app = getApp()
+var url = ''
+Page({
+  data: {
+    currentItem: 0,
+    cardList: [],//骑行卡列表
+    deposit: '',//骑行卡
+    depositMoney: '',//押金金额
+    frame: false,//确认退还退押金弹框
+
+  },
+  onLoad: function (options) {
+
+    this.setData({
+      deposit: my.getStorageSync({ 'key': 'userState' }).data,
+      depositMoney: my.getStorageSync({ 'key': 'setting' }).data.deposit
+    })
+
+    this.getCard()
+    // this.getState()
+  },
+
+  //获取免押金卡列表
+  getCard() {
+    my.showLoading({})
+    let data = {
+      area_id: my.getStorageSync({ 'key': 'home' }).data.id
+    }
+    if (my.getStorageSync({ 'key': 'home' }).data.id == undefined) {
+      my.hideLoading()
+      my.showToast({
+        content: '您附近没有运营区域',
+        icon: 'none'
+      })
+    } else {
+      //免押金卡
+      app.request('/deposit_card/index', data, 'GET').then(res => {
+
+        console.log(res.data);
+        this.setData({
+          cardList: res.data.data
+        })
+        my.hideLoading({
+          complete: (res) => { },
+        })
+        console.log(this.data.cardList)
+      })
+    }
+
+  },
+  //选择骑行卡类型
+  changeCard: function (e) {
+    let that = this
+    let id = e.currentTarget.dataset.id
+    console.log(e, 'pppppp')
+    that.setData({
+      currentItem: id
+    })
+    // if(id==0){
+    // }else if (that.data.deposit.is_deposit == 1 && that.data.deposit.deposit_type == 1) {
+    //   my.showToast({
+    //     content: '您已缴纳押金无需购买免押金卡',
+    //     icon: 'none'
+    //   })
+    //   return;
+    // }
+  },
+  //立即支付
+  pay: util.throttle(function (e) {
+    console.log('支付')
+    var that = this;
+    let url = '';
+    var data = '';
+
+    console.log(that.data.depShow)
+    if (that.data.currentItem == 0) { //缴纳押金
+      console.log(11111)
+      url = "/deposit/pay";
+      data = {
+        area_id: my.getStorageSync({ 'key': 'home' }).data.id
+      }
+    } else { //购买免押金卡
+      console.log(2222)
+      url = "/deposit_card/pay";
+      data = {
+        area_id: my.getStorageSync({ 'key': 'home' }).data.id,
+        id: that.data.currentItem
+      }
+    }
+    if (my.getStorageSync({ 'key': 'setting' }).data == '') {
+      my.alert({
+        title: '提示',
+        content: '您附近暂无运营区域~',
+        success: function (res) {
+          my.navigateBack()
+        }
+      })
+    } else {
+      app.request(url, data, 'POST', app.globalData.req).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          console.log(res)
+          my.tradePay({
+            tradeNO: res.data.tradeNo,
+            success(res) {
+              console.log(res)
+              if (res.resultCode == 9000) {
+                let init = '';
+                if (that.data.depShow) {
+                  init = "购买成功"
+                } else {
+                  init = "支付成功"
+                }
+                my.showToast({
+                  content: init,
+                  icon: 'none',
+                  duration: 1000,
+                  success: function () {
+                    my.reLaunch({
+                      url: '/pages/pay_success/pay_success',
+                    })
+                  }
+                })
+                that.setData({
+                  depoSuce: true
+                })
+              } else {
+                return
+              }
+            },
+            fail(err) {
+              // console.log(err)
+              // my.showToast({
+              //   content: '支付失败',
+              //   icon: 'none'
+              // })
+              // that.setData({
+              //   depoSuce: true
+              // })
+            }
+          })
+        } else {
+          console.log(res)
+          that.setData({
+            depoSuce: true
+          })
+        }
+      })
+    }
+
+
+  }, 1000),
+  //退还押金
+  backDeposit: function () {
+    this.setData({
+      frame: true
+    })
+  },
+  closeFrame: function () {
+    this.setData({
+      frame: false
+    })
+  },
+  //立即退还
+  sureBack: util.throttle(function (e) {
+    app.request('/deposit/refund', '', 'POST').then(res => {
+      console.log(res);
+      if (res.status == 200) {
+        my.showToast({
+          content: '押金退回申请成功,请注意查收!',
+          icon: 'none'
+        })
+        setTimeout(function () {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }, 1500)
+        // this.getState()
+      }
+    })
+  }, 1000),
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  }
 })

+ 43 - 43
pages/set_up/set_up.acss

@@ -1,44 +1,44 @@
-/* required by usingComponents */
-/* pages/mine_data/mine_data.wxss */
-page {
-  background-color: #f2f3f5;
-}
-
-.mine-data {
-  margin-top: 20rpx;
-}
-
-.mine-data-list {
-  background-color: #fff;
-  padding: 0 40rpx;
-}
-
-.list-item {
-  height: 100rpx;
-  line-height: 100rpx;
-  font-size: 28rpx;
-  border-bottom: solid 1rpx #e5e5e5;
-}
-
-.list-item:last-child {
-  border: none;
-}
-
-.iconfont {
-  float: right;
-  font-size: 28rpx;
-  color: #cccccc;
-}
-.exit{
-width:60%;
-margin: 0 auto;
-margin-top: 80rpx;
-height: 80rpx;
-text-align: center;
-line-height: 80rpx;
-border: solid 1rpx var(--globleColor);
-color: var(--orgFont);
-background-color: #fff;
-font-size: 28rpx;
-border-radius: 50rpx;
+/* required by usingComponents */
+/* pages/mine_data/mine_data.wxss */
+page {
+  background-color: #f2f3f5;
+}
+
+.mine-data {
+  margin-top: 20rpx;
+}
+
+.mine-data-list {
+  background-color: #fff;
+  padding: 0 40rpx;
+}
+
+.list-item {
+  height: 100rpx;
+  line-height: 100rpx;
+  font-size: 28rpx;
+  border-bottom: solid 1rpx #e5e5e5;
+}
+
+.list-item:last-child {
+  border: none;
+}
+
+.iconfont {
+  float: right;
+  font-size: 28rpx;
+  color: #cccccc;
+}
+.exit{
+width:60%;
+margin: 0 auto;
+margin-top: 80rpx;
+height: 80rpx;
+text-align: center;
+line-height: 80rpx;
+border: solid 1rpx var(--globleColor);
+color: var(--orgFont);
+background-color: #fff;
+font-size: 28rpx;
+border-radius: 50rpx;
 }

+ 55 - 55
pages/set_up/set_up.js

@@ -1,56 +1,56 @@
-// pages/set_up/set_up.js
-var app=getApp()
-Page({
-  data: {
-
-  },
-  onLoad: function (options) {
-    my.setNavigationBar({
-      title: app.globalData.title
-    })
-  },
-  onReady: function () {
-
-  },
-  tuichu() {
-    my.confirm({
-      title: '提示',
-      content: '确定要退出当前账户吗?',
-      success: function (res) {
-        if (res.confirm==true) {
-          my.reLaunch({
-            url: '/pages/authorization/authorization',
-          })
-        }
-      }
-    })
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  },
-  agreement:function(){
-    my.navigateTo({
-      url: '/pages/agreement/agreement',
-    })
-  },
-  zhinan:function(){
-    my.navigateTo({
-      url: '/pages/ride_rule/ride_rule',
-    })
-  }
+// pages/set_up/set_up.js
+var app=getApp()
+Page({
+  data: {
+
+  },
+  onLoad: function (options) {
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+  },
+  onReady: function () {
+
+  },
+  tuichu() {
+    my.confirm({
+      title: '提示',
+      content: '确定要退出当前账户吗?',
+      success: function (res) {
+        if (res.confirm==true) {
+          my.reLaunch({
+            url: '/pages/authorization/authorization',
+          })
+        }
+      }
+    })
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+  agreement:function(){
+    my.navigateTo({
+      url: '/pages/agreement/agreement',
+    })
+  },
+  zhinan:function(){
+    my.navigateTo({
+      url: '/pages/ride_rule/ride_rule',
+    })
+  }
 })

+ 76 - 76
pages/test/test.acss

@@ -1,77 +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;
+/* 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 - 50
pages/test/test.axml

@@ -1,51 +1,51 @@
-<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 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>

+ 10 - 10
pages/test/test.js

@@ -1,10 +1,10 @@
-Page({
-  data: {},
-  onLoad() {},
-  onGetAuthorize:function(e){
-    console.log(e)
-  },
-  onAuthError:function(e){
-    console.log(e,'ppp')
-  }
-});
+Page({
+  data: {},
+  onLoad() {},
+  onGetAuthorize:function(e){
+    console.log(e)
+  },
+  onAuthError:function(e){
+    console.log(e,'ppp')
+  }
+});

+ 107 - 107
pages/trip/trip.acss

@@ -1,108 +1,108 @@
-/* required by usingComponents */
-/* pages/trip/trip.wxss */
-page{
-  background-color: #f2f3f5;
-  padding-bottom: 30rpx;
-  padding-top: 10rpx;
-  height: 100%;
-}
-.trip-list{
-margin: 0 20rpx;
-height: 100%;
-}
-.trip-list-item{
-  border-radius: 6rpx;
-  margin-top: 30rpx;
-  background-color: #ffffff;
-  padding: 20rpx;
-  font-size: 28rpx;
-}
-.title{
-  display: flex;
-}
-.title-left{
-  flex: 1;
-}
-.title-right{
-  flex: 1;
-  text-align: right;
-  color: #999999;
-}
-.time{
- margin-top: 20rpx;
- margin-bottom: 20rpx;
-
-}
-.place{
- margin-top: 10rpx;
- font-size: 26rpx;
-}
-.time-image{
-  display: inline-block;
-  vertical-align: middle;
-  height: 30rpx;
-width: 30rpx;
-}
-.time-text{
-  display: inline-block;
-  vertical-align: middle;
-  margin-left: 20rpx;
-
-}
-.time-right{
-  display: inline-block;
-  vertical-align: middle;
- float:right;
-}
-.dizhi{
-  display: flex;
-  position: relative;
-}
-.dizhi-left{
- flex: 0 0 30rpx; 
-}
-.dizhi-right{
-  flex: 1;
-  margin-left: 20rpx;
-}
-.dian1{
-  height: 15rpx;
-  width: 15rpx;
-  border-radius: 50%;
-  margin-top:20rpx;
-  margin-left: 10rpx;
-  background-color: #38df49;
-}
-.dian2{
-  height:15rpx;
-  width: 15rpx;
-  margin-top:30rpx;
-  margin-left: 10rpx;
-
-  border-radius: 50%;
-  background-color: #fd9b1c;
-  
-}
-.xian{
-  border-right: solid 1rpx #999999;
-  height: 30rpx;
-  position: absolute;
-  left: 16rpx;
-top: 35rpx;
-}
-.more{
-text-align: center;
-font-size: 26rpx;
-color: #999999;
-height: 100rpx;
-line-height:100rpx;
-margin-top: 30rpx;
-}
-.none{
-text-align: center;
-padding-top: 40%;
-}
-.none image{
-  height: 100rpx;
-  width: 100rpx;
+/* required by usingComponents */
+/* pages/trip/trip.wxss */
+page{
+  background-color: #f2f3f5;
+  padding-bottom: 30rpx;
+  padding-top: 10rpx;
+  height: 100%;
+}
+.trip-list{
+margin: 0 20rpx;
+height: 100%;
+}
+.trip-list-item{
+  border-radius: 6rpx;
+  margin-top: 30rpx;
+  background-color: #ffffff;
+  padding: 20rpx;
+  font-size: 28rpx;
+}
+.title{
+  display: flex;
+}
+.title-left{
+  flex: 1;
+}
+.title-right{
+  flex: 1;
+  text-align: right;
+  color: #999999;
+}
+.time{
+ margin-top: 20rpx;
+ margin-bottom: 20rpx;
+
+}
+.place{
+ margin-top: 10rpx;
+ font-size: 26rpx;
+}
+.time-image{
+  display: inline-block;
+  vertical-align: middle;
+  height: 30rpx;
+width: 30rpx;
+}
+.time-text{
+  display: inline-block;
+  vertical-align: middle;
+  margin-left: 20rpx;
+
+}
+.time-right{
+  display: inline-block;
+  vertical-align: middle;
+ float:right;
+}
+.dizhi{
+  display: flex;
+  position: relative;
+}
+.dizhi-left{
+ flex: 0 0 30rpx; 
+}
+.dizhi-right{
+  flex: 1;
+  margin-left: 20rpx;
+}
+.dian1{
+  height: 15rpx;
+  width: 15rpx;
+  border-radius: 50%;
+  margin-top:20rpx;
+  margin-left: 10rpx;
+  background-color: #38df49;
+}
+.dian2{
+  height:15rpx;
+  width: 15rpx;
+  margin-top:30rpx;
+  margin-left: 10rpx;
+
+  border-radius: 50%;
+  background-color: #fd9b1c;
+  
+}
+.xian{
+  border-right: solid 1rpx #999999;
+  height: 30rpx;
+  position: absolute;
+  left: 16rpx;
+top: 35rpx;
+}
+.more{
+text-align: center;
+font-size: 26rpx;
+color: #999999;
+height: 100rpx;
+line-height:100rpx;
+margin-top: 30rpx;
+}
+.none{
+text-align: center;
+padding-top: 40%;
+}
+.none image{
+  height: 100rpx;
+  width: 100rpx;
 }

+ 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}}">已完成</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 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>

+ 113 - 113
pages/trip/trip.js

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

+ 76 - 76
pages/trip_detail/trip_detail.acss

@@ -1,77 +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: 300rpx;
- 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;
+/* 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: 300rpx;
+ 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 - 50
pages/trip_detail/trip_detail.axml

@@ -1,51 +1,51 @@
-<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 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>

+ 157 - 157
pages/trip_detail/trip_detail.js

@@ -1,158 +1,158 @@
-// pages/trip/trip.js
-var app = getApp()
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    windowHeight:'',
-    height:'',
-    order:'',
-    date:[],
-    markers:[],
-    polyline:[],
-    latitude:'',
-    longitude:'',
-    url:'',
-    index:'',
-    img:app.globalData.imgUrl
-  },
-  onLoad: function (options) {
-    var that = this;
-    console.log(options,'传值')
-    let order_no=options.order_no
-    // my.getSystemInfo({
-    //   success: function (res) {
-    //     console.log(res.windowHeight);
-    //     that.setData({ windowHeight: res.windowHeight})
-    //   }
-    // })
-    // this.setData({order:options.order})
-    // if(options.index){
-    //   if (options.index == 0) {
-    //     that.setData({
-    //       url : '/order?order_no='
-    //     })
-    //   }
-    //   if (options.index == 1) {
-    //     that.setData({
-    //       url : '/rent/order?no='
-    //     })
-    //   }
-    //   this.setData({index:options.index})
-    // }
-    // if(options.index){
-    //   if (options.index == 'true') {
-    //     that.setData({
-    //       url : '/order?order_no='
-    //     })
-    //     this.setData({index:0})
-    //   }
-    //   if (options.index == 'false') {
-    //     that.setData({
-    //       url : '/rent/order?no='
-    //     })
-    //     this.setData({index:1})
-    //   }
-    // }
-    // var query = my.createSelectorQuery();
-    // query.select('.box').boundingClientRect();
-    // query.exec(function (res) {
-    //   console.log(res)
-    //   console.log(res[0].height)
-    //   that.setData({ height: res[0].height });
-    // })
-    // my.getLocation({
-    //   type:'gcj02',
-    //   success: function(res) {
-    //     var latitude = res.latitude
-    //     var longitude = res.longitude
-    //     that.setData({ longitude: longitude, latitude: latitude })
-    //   },
-    // })
-    // this.load(); 
-    this.getTrack(order_no);  //获取行车轨迹及订单信息
-  },
-   // 获取行车轨迹及订单信息
-   getTrack(order_no){
-    var that = this;
-    my.showLoading({
-      content: '加载中...',
-    })
-    console.log(that.data.url)
-    app.request('/order?order_no=' + order_no+'&include=locations','','GET').then(res=>{
-      console.log(res)
-      if(res.status == 200){
-        my.hideLoading()
-        that.setData({ date: res.data });
-        let points = res.data.locations.data;
-        var center = parseInt(points.length/2)
-        var obj = {};
-        obj.points = points;
-        obj.width = 2;
-        obj.color = '#f8c700';
-        obj.borderWidth = 1;
-        obj.borderColor = '#f8c700';
-        that.setData({ polyline: that.data.polyline.concat(obj) })
-        if (points.length>0){
-          var maker = [];
-          maker = maker.concat(points[0]);
-          maker = maker.concat(points[points.length - 1])
-          for (var i = 0; i < maker.length; i++) {
-            maker[i].width =32;
-            maker[i].height = 32;
-            maker[i].zIndex = 1111;
-          }
-          //在地图上显示两个坐标
-          maker[0].iconPath = 'http://resource.bike.hanyiyun.com/weapp/start1.png'
-          maker[1].iconPath = 'http://resource.bike.hanyiyun.com/weapp/end1.png'
-          that.setData({ markers: maker, longitude: points[center].longitude, latitude: points[center].latitude })
-        } else {
-          my.getLocation({
-            type: 'gcj02',
-            success: function (res) {
-              var latitude = res.latitude
-              var longitude = res.longitude
-              that.setData({ longitude: longitude, latitude: latitude })
-            },
-          })
-        }
-      }
-    })
-  },
-  //计费规则
-  chargeRule:function(){
-    my.navigateTo({
-      url:'/pages/charge_rule/charge_rule',
-    })
-  },
-  //不认可收费
-  noAgree:function(){
-    my.makePhoneCall({
-      number:my.getStorageSync({'key':'home'}).data.customer_service_phone,
-    })
-  },
-  onReady: function () {
-
-  },
-  onShow: function () {
-
-  },
-  onHide: function () {
-
-  },
-  onUnload: function () {
-
-  },
-  onPullDownRefresh: function () {
-
-  },
-  onReachBottom: function () {
-
-  },
-  onShareAppMessage: function () {
-
-  },
-
+// pages/trip/trip.js
+var app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    windowHeight:'',
+    height:'',
+    order:'',
+    date:[],
+    markers:[],
+    polyline:[],
+    latitude:'',
+    longitude:'',
+    url:'',
+    index:'',
+    img:app.globalData.imgUrl
+  },
+  onLoad: function (options) {
+    var that = this;
+    console.log(options,'传值')
+    let order_no=options.order_no
+    // my.getSystemInfo({
+    //   success: function (res) {
+    //     console.log(res.windowHeight);
+    //     that.setData({ windowHeight: res.windowHeight})
+    //   }
+    // })
+    // this.setData({order:options.order})
+    // if(options.index){
+    //   if (options.index == 0) {
+    //     that.setData({
+    //       url : '/order?order_no='
+    //     })
+    //   }
+    //   if (options.index == 1) {
+    //     that.setData({
+    //       url : '/rent/order?no='
+    //     })
+    //   }
+    //   this.setData({index:options.index})
+    // }
+    // if(options.index){
+    //   if (options.index == 'true') {
+    //     that.setData({
+    //       url : '/order?order_no='
+    //     })
+    //     this.setData({index:0})
+    //   }
+    //   if (options.index == 'false') {
+    //     that.setData({
+    //       url : '/rent/order?no='
+    //     })
+    //     this.setData({index:1})
+    //   }
+    // }
+    // var query = my.createSelectorQuery();
+    // query.select('.box').boundingClientRect();
+    // query.exec(function (res) {
+    //   console.log(res)
+    //   console.log(res[0].height)
+    //   that.setData({ height: res[0].height });
+    // })
+    // my.getLocation({
+    //   type:'gcj02',
+    //   success: function(res) {
+    //     var latitude = res.latitude
+    //     var longitude = res.longitude
+    //     that.setData({ longitude: longitude, latitude: latitude })
+    //   },
+    // })
+    // this.load(); 
+    this.getTrack(order_no);  //获取行车轨迹及订单信息
+  },
+   // 获取行车轨迹及订单信息
+   getTrack(order_no){
+    var that = this;
+    my.showLoading({
+      content: '加载中...',
+    })
+    console.log(that.data.url)
+    app.request('/order?order_no=' + order_no+'&include=locations','','GET').then(res=>{
+      console.log(res)
+      if(res.status == 200){
+        my.hideLoading()
+        that.setData({ date: res.data });
+        let points = res.data.locations.data;
+        var center = parseInt(points.length/2)
+        var obj = {};
+        obj.points = points;
+        obj.width = 2;
+        obj.color = '#f8c700';
+        obj.borderWidth = 1;
+        obj.borderColor = '#f8c700';
+        that.setData({ polyline: that.data.polyline.concat(obj) })
+        if (points.length>0){
+          var maker = [];
+          maker = maker.concat(points[0]);
+          maker = maker.concat(points[points.length - 1])
+          for (var i = 0; i < maker.length; i++) {
+            maker[i].width =32;
+            maker[i].height = 32;
+            maker[i].zIndex = 1111;
+          }
+          //在地图上显示两个坐标
+          maker[0].iconPath = 'http://resource.bike.hanyiyun.com/weapp/start1.png'
+          maker[1].iconPath = 'http://resource.bike.hanyiyun.com/weapp/end1.png'
+          that.setData({ markers: maker, longitude: points[center].longitude, latitude: points[center].latitude })
+        } else {
+          my.getLocation({
+            type: 'gcj02',
+            success: function (res) {
+              var latitude = res.latitude
+              var longitude = res.longitude
+              that.setData({ longitude: longitude, latitude: latitude })
+            },
+          })
+        }
+      }
+    })
+  },
+  //计费规则
+  chargeRule:function(){
+    my.navigateTo({
+      url:'/pages/charge_rule/charge_rule',
+    })
+  },
+  //不认可收费
+  noAgree:function(){
+    my.makePhoneCall({
+      number:my.getStorageSync({'key':'home'}).data.customer_service_phone,
+    })
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+
 })

+ 634 - 539
pages/use_bike/use_bike.acss

@@ -1,539 +1,634 @@
-/* pages/use_bike/use_bike.wxss */
-#map {
-  height: calc(100vh - 495rpx);
-  z-index: 8;
-  /* z-index: 999999999999999999; */
-  width: 100%;
-}
-.map-icon {
-  position: fixed;
-  right:20rpx;
-  z-index: 999;
-  bottom:650rpx;
-}
-
-.kefu {
-  height: 70rpx;
-  width: 70rpx;
-  bottom: 0rpx;
-  border-radius: 50%;
-  background-color: #fff;
-  margin-top: 50rpx;
-  text-align: center;
-}
-
-.kefu image {
-  height: 50rpx;
-  margin-top: 10rpx;
-  width: 50rpx;
-}
-
-.use-bike-bottom {
-  position: fixed;
-  z-index: 999999999;
-  background-color: #fff;
-  width: 100%;
-  bottom: 0;
-  /* height: 600rpx; */
-  left: 0;
-  padding-bottom: 30rpx;
-  border-radius: 40rpx 40rpx 0 0;
-}
-
-/* .warning-lists{
-  height: 280rpx;
-  overflow-y: scroll;
-} */
-
-.bike-tip {
-  position: fixed;
-  z-index: 99999;
-  top: 10rpx;
-  height: 70rpx;
-  width: 90%;
-  left: 5%;
-  border-radius: 40rpx;
-  font-size: 26rpx;
-  margin: 0 auto;
-  line-height: 70rpx;
-  color: #fff;
-  background: rgba(0, 0, 0, 0.8);
-}
-
-.bike-guifan {
-  font-size: 20rpx;
-  float: right;
-  margin-right: 20rpx;
-}
-
-.tip-text {
-  margin-left: 20rpx;
-}
-
-.step1,
-.step2 {
-  text-align: center;
-}
-
-.step1 .bottom-title1 {
-
-  margin-top: 70rpx;
-  font-size: 60rpx;
-}
-
-.step1 .bottom-title2 {
-  font-size: 32rpx;
-  color: #666666;
-  margin-top: 10rpx;
-  margin-bottom: 70rpx;
-}
-.step1 .bike_no{
-  /* margin-bottom: 70rpx; */
-  margin-top: 15rpx;
-  font-size: 30rpx;
-  color: #999;
-}
-
-.open_bike {
-  height: 100rpx;
-  line-height: 100rpx;
-  border-radius: 50rpx;
-  width: 60%;
-  font-size: 32rpx;
-  font-weight: 600;
-  background-color: var(--globleColor);
-  color: var(--fontColor);
-  margin: 0 auto;
-  margin-top: 20rpx;
-}
-.open_bike1{
-  height: 100rpx;
-  line-height: 100rpx;
-  border-radius: 50rpx;
-  width: 60%;
-  font-size: 32rpx;
-  font-weight: 600;
-  background-color:#999;
-  color: var(--fontColor);
-  margin: 0 auto;
-}
-.lanya{
-  font-size: 28rpx;
-  margin-top: 20rpx;
-  color: var(--globleColor);
-  margin-bottom: 30rpx;
-}
-.bottom-list {
-  display: flex;
-  height: 50rpx;
-  /* line-height: 40rpx; */
-  text-align: center;
-  font-size: 26rpx;
-  color: #666666;
-  margin-top: 15rpx;
-}
-
-.bottom-list-item {
-  flex: 1;
-}
-
-.step3-title {
-  height: 120rpx;
-  line-height: 120rpx;
-  border-bottom: solid 1rpx #f1f1f1;
-}
-
-.step2-title {
-  height: 120rpx;
-  line-height: 120rpx;
-  border-bottom: solid 1rpx #f1f1f1;
-}
-
-.step2-content {
-  /* margin: 30rpx 0; */
-  margin-top: 10rpx;
-  display: flex;
-}
-
-.step2-left {
-  flex: 0 0 23%;
-  /* background-color: #f1f1f1; */
-  text-align: right;
-  /* height: 150rpx; */
-}
-
-.step2-left image {
-  width: 100rpx;
-  margin-top: 15rpx;
-  height: auto;
-}
-
-.step2-right {
-  flex: 1;
-  text-align: left;
-  margin-left: 20rpx;
-}
-
-.step2-text {
-  font-size: 32rpx;
-  font-weight: 500;
-  line-height: 55rpx;
-}
-
-.step2-text1 {
-  font-size: 28rpx;
-  color: #666666;
-  line-height: 50rpx;
-}
-
-.step3-title {
-  display: flex;
-  padding: 0 40rpx;
-  font-size: 32rpx;
-  color: #484848;
-}
-
-.title-left-num {
-  display: inline-block;
-  margin: 0 5rpx;
-  font-weight: bold;
-  font-size: 38rpx;
-}
-
-.step3-title-left {
-  flex: 1;
-}
-
-.step3-title-right {
-  flex: 0 0 170rpx;
-  text-align: center;
-  height: 60rpx;
-  line-height: 60rpx;
-  margin-top: 30rpx;
-  font-size: 26rpx;
-  color: #999999;
-  border-radius: 40rpx;
-  border: solid 1rpx #e5e5e5;
-}
-.bell{
-  flex:0 0 50rpx;
-  height: 50rpx;
-  margin-top: 35rpx;
-  width:50rpx;
-  line-height: 50rpx;
-  border-radius: 50%;
-  text-align: center;
-  border: solid 1rpx var(--globleColor);
-  background-color: var(--globleColor);
-}
-.bell-image{
-  height: 40rpx;
-  width: 40rpx;
-  margin-top: 5rpx;
-}
-
-.steps3-list {
-  display: flex;
-  margin: 20rpx 0;
-}
-
-.step3-list-item {
-  flex: 1;
-  text-align: center;
-  padding: 30rpx 0;
-  margin-top: 10rpx;
-}
-
-.step3-item-num {
-  font-size: 44rpx;
-  font-weight: bold;
-}
-
-.step3-item-text {
-  color: #999999;
-  font-size: 28rpx;
-  margin-top: 10rpx;
-}
-
-.step3-bottom {
-  display: flex;
-  padding: 0 50rpx;
-  text-align: center;
-  height: 100rpx;
-  margin-top:40rpx;
-  font-size: 34rpx;
-  font-weight: bold;
-  line-height: 100rpx;
-
-  margin-bottom:55rpx;
-  color: var(--fontColor);
-
-}
-
-.step3-bottom-left {
-  flex: 1;
-  border-radius: 50rpx;
-  margin-right: 30rpx;
-  border: solid 1rpx var(--globleColor);
-  color: var(--orgFont);
-}
-
-.step3-cha {
-  flex: 0 0 100rpx;
-  border-radius: 50rpx;
-  margin-right: 30rpx;
-  text-align: center;
-  border: solid 1rpx var(--globleColor);
-  color: var(--orgFont);
-}
-
-.step3-bottom-right {
-  flex: 1;
-  background-color: var(--globleColor);
-  color: var(--fontColor);
-  border-radius: 50rpx;
-}
-
-.step3-parking {
-  text-align: center;
-  padding: 30rpx 0;
-  margin-top: 50rpx;
-}
-
-.step3-park-title1 {
-  font-size: 48rpx;
-  font-weight: bold;
-}
-
-.step3-park-text {
-  font-size: 28rpx;
-  color: #666666;
-  margin: 20rpx;
-  font-weight: 500;
-}
-
-.buttom-icon {
-  margin-right: 10rpx;
-}
-
-.frame {
-  background-color: rgba(0, 0, 0, 0.6);
-  position: fixed;
-  z-index: 9999999999999999;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100vh;
-}
-
-.frame-content {
-  position: fixed;
-  background-color: #fff;
-  width: 100%;
-  height: 500rpx;
-  border-radius: 40rpx 40rpx 0 0;
-  bottom: 0;
-  z-index: 99999999;
-  padding-bottom: 100rpx;
-  text-align: center;
-}
-
-.frame-title {
-  height: 100rpx;
-  line-height: 100rpx;
-  padding: 0 30rpx;
-  font-size: 28rpx;
-}
-.cha{
-  float: left;
-}
-.frame-kefu {
-  float: right;
-  font-size: 28rpx;
-}
-
-.suo {
-  width: 80%;
-  margin: 0 auto;
-}
-
-.frame-con {
-  padding: 0 30rpx;
-
-}
-
-
-
-.frame-bt {
-  display: flex;
-  height: 100rpx;
-  line-height: 100rpx;
-  text-align: center;
-  margin-top: 50rpx;
-  font-size: 32rpx;
-  font-weight: 500;
-}
-
-.frame-left {
-  flex: 0 0 250rpx;
-  border: solid 1rpx var(--globleColor);
-  border-radius: 50rpx;
-  color: var(--globleColor);
-
-}
-
-.frame-right {
-  flex: 1;
-  margin-left: 50rpx;
-  border-radius: 50rpx;
-  background-color: var(--globleColor);
-  color: var(--fontColor);
-}
-/* 未开启位置权限 */
-.pay-frame{
-  width: 100vh;
-  height: 100%;
-  position: fixed;
-  z-index: 999999999;
-  background-color: rgba(0, 0, 0, 0.6);
-}
-.topay {
-  width: 500rpx;
-  height: 300rpx;
-  background: rgba(255, 255, 255, 1);
-  border-radius: 20rpx;
-  position: fixed;
-  top: 41%;
-  left: 16%;
-  z-index: 8888;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-.topay .text1,
-.text2 {
-  font-size: 28rpx;
-  font-family: PingFang SC;
-  color: rgba(42, 42, 42, 1);
-}
-
-.topay .view {
-  display: flex;
-  position: absolute;
-  bottom: 0rpx;
-  width: 100%;
-  justify-content: space-between;
-  height: 70rpx;
-  border-top: 1rpx solid #f4f4f4;
-  padding: 10rpx 0rpx;
-}
-
-.topay .view .view1 {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 49.5%;
-}
-
-.ad-list {
-  background-color: #333333;
-  opacity: 0.9;
-  height: 70rpx;
-  border-radius: 50rpx;
-  width: 94%; 
-  left: 3%;
-  position: fixed;
-  top:30rpx;
-  z-index: 9998;
-}
-
-.mess {
-  display: inline-block;
-  vertical-align: middle;
-  height: 40rpx;
-  width:40rpx;
-
-  margin: 20rpx 30rpx 20rpx 30rpx;
-}
-
-.change {
-  display: inline-block;
-  vertical-align: top;
-  height: 50rpx;
-  width: 50rpx;
-  float: right;
-  margin: 15rpx 30rpx 15rpx 30rpx;
-}
-
-.ad-list .swiper {
-  height: 70rpx;
-  position: fixed;
-  width: 68%;
-  left: 120rpx;
-  top: 30rpx;
-  z-index: 99998;
-}
-
-.ad-list .swiper .swiper-item {
-  height: 70rpx;
-  line-height:70rpx;
-
-}
-
-.ad-item {
-  display: inline-block;
-  color: #fff;
-  font-size: 26rpx;
-  /* vertical-align: middle; */
-}
-.back-home{
-  height: 50rpx;
-  width:50rpx;
-  position: absolute;
-  top: 35rpx;
-  left: 30rpx;
-}
-.marquee {
-  width: 80%;
-  overflow: hidden;
-}
-
-.marqueeTitle {
-  color: #333333;
-  font-size: 26rpx;
-}
-
-.inform {
-  display: flex;
-  align-items: center;
-  width: 94%;
-  left: 3%;
-  height: 68rpx;
-  background: white;
-  color: #333333;
-  position: fixed;
-  z-index: 9999;
-  font-size: 26rpx;
-  justify-content: space-between;
-  border-radius: 10rpx;
-}
-
-.inform-img {
-  display: flex;
-  height: 100%;
-  align-items: center;
-}
-/* 轮播图 */
-.ad-swiper{
-  position: fixed;
-  top: 30rpx;
-  z-index: 9999;
-  height: 200rpx;
-  width: 94%;
-  left: 3%;
-  /* background-color: #fff; */
-}
-.ad-swiper-list{
-  height: 200rpx;
-}
+/* pages/use_bike/use_bike.wxss */
+#map {
+  height: calc(100vh - 495rpx);
+  z-index: 8;
+  /* z-index: 999999999999999999; */
+  width: 100%;
+}
+.map-icon {
+  position: fixed;
+  right:20rpx;
+  z-index: 999;
+  bottom:650rpx;
+}
+
+.kefu {
+  height: 70rpx;
+  width: 70rpx;
+  bottom: 0rpx;
+  border-radius: 50%;
+  background-color: #fff;
+  margin-top: 50rpx;
+  text-align: center;
+}
+
+.kefu image {
+  height: 50rpx;
+  margin-top: 10rpx;
+  width: 50rpx;
+}
+
+.use-bike-bottom {
+  position: fixed;
+  z-index: 999999999;
+  background-color: #fff;
+  width: 100%;
+  bottom: 0;
+  /* height: 600rpx; */
+  left: 0;
+  padding-bottom: 30rpx;
+  border-radius: 40rpx 40rpx 0 0;
+}
+
+/* .warning-lists{
+  height: 280rpx;
+  overflow-y: scroll;
+} */
+
+.bike-tip {
+  position: fixed;
+  z-index: 99999;
+  top: 10rpx;
+  height: 70rpx;
+  width: 90%;
+  left: 5%;
+  border-radius: 40rpx;
+  font-size: 26rpx;
+  margin: 0 auto;
+  line-height: 70rpx;
+  color: #fff;
+  background: rgba(0, 0, 0, 0.8);
+}
+
+.bike-guifan {
+  font-size: 20rpx;
+  float: right;
+  margin-right: 20rpx;
+}
+
+.tip-text {
+  margin-left: 20rpx;
+}
+
+.step1,
+.step2 {
+  text-align: center;
+}
+
+.step1 .bottom-title1 {
+
+  margin-top: 70rpx;
+  font-size: 60rpx;
+}
+
+.step1 .bottom-title2 {
+  font-size: 32rpx;
+  color: #666666;
+  margin-top: 10rpx;
+  margin-bottom: 70rpx;
+}
+.step1 .bike_no{
+  /* margin-bottom: 70rpx; */
+  margin-top: 15rpx;
+  font-size: 30rpx;
+  color: #999;
+}
+
+.open_bike {
+  height: 100rpx;
+  line-height: 100rpx;
+  border-radius: 50rpx;
+  width: 60%;
+  font-size: 32rpx;
+  font-weight: 600;
+  background-color: var(--globleColor);
+  color: var(--fontColor);
+  margin: 0 auto;
+  margin-top: 20rpx;
+}
+.open_bike1{
+  height: 100rpx;
+  line-height: 100rpx;
+  border-radius: 50rpx;
+  width: 60%;
+  font-size: 32rpx;
+  font-weight: 600;
+  background-color:#999;
+  color: var(--fontColor);
+  margin: 0 auto;
+}
+.lanya{
+  font-size: 28rpx;
+  margin-top: 20rpx;
+  color: var(--globleColor);
+  margin-bottom: 30rpx;
+}
+.bottom-list {
+  display: flex;
+  height: 50rpx;
+  /* line-height: 40rpx; */
+  text-align: center;
+  font-size: 26rpx;
+  color: #666666;
+  margin-top: 15rpx;
+}
+
+.bottom-list-item {
+  flex: 1;
+}
+
+.step3-title {
+  height: 120rpx;
+  line-height: 120rpx;
+  border-bottom: solid 1rpx #f1f1f1;
+}
+
+.step2-title {
+  height: 120rpx;
+  line-height: 120rpx;
+  border-bottom: solid 1rpx #f1f1f1;
+}
+
+.step2-content {
+  /* margin: 30rpx 0; */
+  margin-top: 10rpx;
+  display: flex;
+}
+
+.step2-left {
+  flex: 0 0 23%;
+  /* background-color: #f1f1f1; */
+  text-align: right;
+  /* height: 150rpx; */
+}
+
+.step2-left image {
+  width: 100rpx;
+  margin-top: 15rpx;
+  height: auto;
+}
+
+.step2-right {
+  flex: 1;
+  text-align: left;
+  margin-left: 20rpx;
+}
+
+.step2-text {
+  font-size: 32rpx;
+  font-weight: 500;
+  line-height: 55rpx;
+}
+
+.step2-text1 {
+  font-size: 28rpx;
+  color: #666666;
+  line-height: 50rpx;
+}
+
+.step3-title {
+  display: flex;
+  padding: 0 40rpx;
+  font-size: 32rpx;
+  color: #484848;
+}
+
+.title-left-num {
+  display: inline-block;
+  margin: 0 5rpx;
+  font-weight: bold;
+  font-size: 38rpx;
+}
+
+.step3-title-left {
+  flex: 1;
+}
+
+.step3-title-right {
+  flex: 0 0 170rpx;
+  text-align: center;
+  height: 60rpx;
+  line-height: 60rpx;
+  margin-top: 30rpx;
+  font-size: 26rpx;
+  color: #999999;
+  border-radius: 40rpx;
+  border: solid 1rpx #e5e5e5;
+}
+.bell{
+  flex:0 0 50rpx;
+  height: 50rpx;
+  margin-top: 35rpx;
+  width:50rpx;
+  line-height: 50rpx;
+  border-radius: 50%;
+  text-align: center;
+  border: solid 1rpx var(--globleColor);
+  background-color: var(--globleColor);
+}
+.bell-image{
+  height: 40rpx;
+  width: 40rpx;
+  margin-top: 5rpx;
+}
+
+.steps3-list {
+  display: flex;
+  margin: 20rpx 0;
+}
+
+.step3-list-item {
+  flex: 1;
+  text-align: center;
+  padding: 30rpx 0;
+  margin-top: 10rpx;
+}
+
+.step3-item-num {
+  font-size: 44rpx;
+  font-weight: bold;
+}
+
+.step3-item-text {
+  color: #999999;
+  font-size: 28rpx;
+  margin-top: 10rpx;
+}
+
+.step3-bottom {
+  display: flex;
+  padding: 0 50rpx;
+  text-align: center;
+  height: 100rpx;
+  margin-top:40rpx;
+  font-size: 34rpx;
+  font-weight: bold;
+  line-height: 100rpx;
+
+  margin-bottom:55rpx;
+  color: var(--fontColor);
+
+}
+
+.step3-bottom-left {
+  flex: 1;
+  border-radius: 50rpx;
+  margin-right: 30rpx;
+  border: solid 1rpx var(--globleColor);
+  color: var(--orgFont);
+}
+
+.step3-cha {
+  flex: 0 0 100rpx;
+  border-radius: 50rpx;
+  margin-right: 30rpx;
+  text-align: center;
+  border: solid 1rpx var(--globleColor);
+  color: var(--orgFont);
+}
+
+.step3-bottom-right {
+  flex: 1;
+  background-color: var(--globleColor);
+  color: var(--fontColor);
+  border-radius: 50rpx;
+}
+
+.step3-parking {
+  text-align: center;
+  padding: 30rpx 0;
+  margin-top: 50rpx;
+}
+
+.step3-park-title1 {
+  font-size: 48rpx;
+  font-weight: bold;
+}
+
+.step3-park-text {
+  font-size: 28rpx;
+  color: #666666;
+  margin: 20rpx;
+  font-weight: 500;
+}
+
+.buttom-icon {
+  margin-right: 10rpx;
+}
+
+.frame {
+  background-color: rgba(0, 0, 0, 0.6);
+  position: fixed;
+  z-index: 9999999999999999;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100vh;
+}
+
+.frame-content {
+  position: fixed;
+  background-color: #fff;
+  width: 100%;
+  height: 500rpx;
+  border-radius: 40rpx 40rpx 0 0;
+  bottom: 0;
+  z-index: 99999999;
+  padding-bottom: 100rpx;
+  text-align: center;
+}
+
+.frame-title {
+  height: 100rpx;
+  line-height: 100rpx;
+  padding: 0 30rpx;
+  font-size: 28rpx;
+}
+.cha{
+  float: left;
+}
+.frame-kefu {
+  float: right;
+  font-size: 28rpx;
+}
+
+.suo {
+  width: 80%;
+  margin: 0 auto;
+}
+
+.frame-con {
+  padding: 0 30rpx;
+
+}
+
+
+
+.frame-bt {
+  display: flex;
+  height: 100rpx;
+  line-height: 100rpx;
+  text-align: center;
+  margin-top: 50rpx;
+  font-size: 32rpx;
+  font-weight: 500;
+}
+
+.frame-left {
+  flex: 0 0 250rpx;
+  border: solid 1rpx var(--globleColor);
+  border-radius: 50rpx;
+  color: var(--globleColor);
+
+}
+
+.frame-right {
+  flex: 1;
+  margin-left: 50rpx;
+  border-radius: 50rpx;
+  background-color: var(--globleColor);
+  color: var(--fontColor);
+}
+/* 未开启位置权限 */
+.pay-frame{
+  width: 100vh;
+  height: 100%;
+  position: fixed;
+  z-index: 999999999;
+  background-color: rgba(0, 0, 0, 0.6);
+}
+.topay {
+  width: 500rpx;
+  height: 300rpx;
+  background: rgba(255, 255, 255, 1);
+  border-radius: 20rpx;
+  position: fixed;
+  top: 41%;
+  left: 16%;
+  z-index: 8888;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.topay .text1,
+.text2 {
+  font-size: 28rpx;
+  font-family: PingFang SC;
+  color: rgba(42, 42, 42, 1);
+}
+
+.topay .view {
+  display: flex;
+  position: absolute;
+  bottom: 0rpx;
+  width: 100%;
+  justify-content: space-between;
+  height: 70rpx;
+  border-top: 1rpx solid #f4f4f4;
+  padding: 10rpx 0rpx;
+}
+
+.topay .view .view1 {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 49.5%;
+}
+
+.ad-list {
+  background-color: #333333;
+  opacity: 0.9;
+  height: 70rpx;
+  border-radius: 50rpx;
+  width: 94%; 
+  left: 3%;
+  position: fixed;
+  top:30rpx;
+  z-index: 9998;
+}
+
+.mess {
+  display: inline-block;
+  vertical-align: middle;
+  height: 40rpx;
+  width:40rpx;
+
+  margin: 20rpx 30rpx 20rpx 30rpx;
+}
+
+.change {
+  display: inline-block;
+  vertical-align: top;
+  height: 50rpx;
+  width: 50rpx;
+  float: right;
+  margin: 15rpx 30rpx 15rpx 30rpx;
+}
+
+.ad-list .swiper {
+  height: 70rpx;
+  position: fixed;
+  width: 68%;
+  left: 120rpx;
+  top: 30rpx;
+  z-index: 99998;
+}
+
+.ad-list .swiper .swiper-item {
+  height: 70rpx;
+  line-height:70rpx;
+
+}
+
+.ad-item {
+  display: inline-block;
+  color: #fff;
+  font-size: 26rpx;
+  /* vertical-align: middle; */
+}
+.back-home{
+  height: 50rpx;
+  width:50rpx;
+  position: absolute;
+  top: 35rpx;
+  left: 30rpx;
+}
+.marquee {
+  width: 80%;
+  overflow: hidden;
+}
+
+.marqueeTitle {
+  color: #333333;
+  font-size: 26rpx;
+}
+
+.inform {
+  display: flex;
+  align-items: center;
+  width: 94%;
+  left: 3%;
+  height: 68rpx;
+  background: white;
+  color: #333333;
+  position: fixed;
+  z-index: 9999;
+  font-size: 26rpx;
+  justify-content: space-between;
+  border-radius: 10rpx;
+}
+
+.inform-img {
+  display: flex;
+  height: 100%;
+  align-items: center;
+}
+/* 轮播图 */
+.ad-swiper{
+  position: fixed;
+  top: 30rpx;
+  z-index: 9999;
+  height: 200rpx;
+  width: 94%;
+  left: 3%;
+  /* background-color: #fff; */
+}
+.ad-swiper-list{
+  height: 200rpx;
+}
+/* 屏幕中间广告弹框 */
+.ad-frame{
+  height: 100%;
+  width: 100%;
+  position: fixed;
+  background-color: rgba(0, 0, 0, 0.6);
+  top: 0;
+  left: 0;
+  z-index: 999999999999;
+}
+.ad-frame-content{
+  width: 70%;
+  height: 55%;
+  /* background-color: #fff; */
+  margin-left: 15%;
+  margin-top:20%;
+}
+.frame-middle{
+  height: 100%;
+  width: 100%;
+}
+.frame-middle image{
+  width: 100%;
+  height: 100%;
+}
+.ad-frame-close{
+  margin: 0 auto;
+  margin-top: 100rpx;
+  text-align: center;
+  width: 60rpx;
+  height: 60rpx;
+  line-height:60rpx;
+  border:solid 4rpx #fff;
+  border-radius: 50%;
+  
+}
+.ad-frame-close .icon-cha{
+color: #fff;
+font-weight: 300;
+font-size: 30rpx;
+}
+.min{
+  font-size:22rpx;
+  color: #999999;
+  margin-left:3px;
+  font-size: 400;
+}
+.popbj{
+  background: #999;
+  opacity: 0.6;
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+}
+.pops{
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%,-50%);
+  background: white;
+  border-radius: 15rpx;
+  z-index: 2;
+  width: 600rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.pops .pop-title{ 
+  font-size: 40rpx;
+  font-weight: bold;
+  padding: 20rpx 0rpx;
+}
+.pops .pop-cont{
+  /* display: flex;
+  align-items: center; */
+  font-size: 30rpx;
+  color: red;
+  width: 88%;
+  line-height: 50rpx;
+  padding-bottom: 40rpx;
+}
+.pops .pop-btn{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  border-top: 1rpx solid #e5e5e5;
+}
+.pops .pop-btn view{
+  width: 49.5%;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}

+ 234 - 203
pages/use_bike/use_bike.axml

@@ -1,204 +1,235 @@
-<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" hidden="{{!frame}}">
-    <view class="frame-content">
-      <view class="frame-title">
-        <text class="iconfont icon-cha cha" onTap="frameClose"></text>
-        <text class="frame-kefu" onTap="keFu">联系客服</text>
-      </view>
-      
-      <image src="../../img/suo.jpg" mode="widthFix" class="suo"></image>
-      <view class="frame-con">
-        <!--<image src="../../img/lanya.jpg" mode="widthFix" class="lanya"></image> -->
-        <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" a:if="{{ steps==3 || !notice.id && ads.length==0}}">
-    <image src="../../img/mess.png" alt="" class="mess" />
-    <swiper class="swiper" autoplay='true' vertical='true' interval='10000'>
-      <swiper-item class="swiper-item">
-        <view class="ad-item">不在还车点换车,将收取调度费</view>
-      </swiper-item>
-      <!--<swiper-item class="swiper-item"><view class="ad-item">车辆静止三十分钟后将自动还车~</view></swiper-item> -->
-      <swiper-item class="swiper-item" a:if="{{bikeMessage.activity}}">
-        <view class="ad-item">{{bikeMessage.activity}}</view>
-      </swiper-item>
-    </swiper>
-    <!--<image src="../../img/change.png" class="change"></image> -->
-  </view>
-  <!-- 轮播图 -->
-  <view class="ad-swiper" a:if="{{ads.length>0 && steps!=3}}">
-    <swiper class="ad-swiper-list" indicator-dots='{{ads.length > 1 ? true : false}}' indicator-color='var(--globleColor)' 
-      autoplay='true' interval="5000" current="{{currentSwiper}}" onTap="swiperChange">
-      <swiper-item a:for="{{ads}}" a:key="key" class="ad-swiper-item">
-        <image mode="widthFix" src="{{item.surface}}" style="width:100%;height:200rpx;" onTap="swiper" data-index="{{index}}" data-type="{{item.type}}" 
-          data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}" a:if="{{item.type!='wxTencentAdvertisement'}}"></image>
-      </swiper-item>
-    </swiper>
-  </view>
-  
-  <view class="inform" style="top:{{ads.length>0 && steps!==3 ? '220rpx' : steps==3 ? '60px' : '30rpx'}}" onTap="tap_notice" 
-    a:if="{{notice.id}}" data-id="{{notice.id}}">
-    <view class="inform-img">
-      <image src="../../img/notice.png" class="inform-image" style="width:48rpx;height:48rpx;padding-left:20rpx;">
-      </image>
-    </view>
-    <view class='marquee' style='width:{{marqueeWidth}}rpx;'>
-      <view class='marqueeTitle' style="width:{{length}}rpx;transform:translateX( {{marqueeDistance}}rpx);">
-        {{notice.description}}
-      </view>
-    </view>
-    <image src="../../img/more.png" style="width:48rpx;height:48rpx;"></image>
-  </view>
-  <view class="use-bike-bottom" catchtouchmove='ture' a:if="{{frame == false}}">
-    
-    
-    
-    
-    <view class="use-bike-bottom" catchtouchmove='ture'>
-      <!-- 骑行第一步 -->
-      <view class="step1" a:if="{{steps==1}}">
-        <image src="../../img/home.png" class="back-home" onTap="backHome"></image>
-        <view class="bottom-title1">{{bikeMessage.riding_bike_mileage||'--'}}公里</view>
-        <view class="bottom-title2">剩余电量可行驶</view>
-        
-        <view class="open_bike" onTap="openBikeClick">点击开锁</view>
-        <view class="bike_no">NO:{{bikeMessage.bike_no}}</view>
-        <view class="lanya">打开蓝牙,体验快速开锁</view>
-      </view>
-      <!-- 骑行第二步 -->
-      <view class="step2" a:if="{{steps==2}}">
-        <image src="../../img/home.png" class="back-home" onTap="backHome"></image>
-        <view class="step2-title">温馨提示</view>
-        <view class="step2-content" a:if="{{setting.is_whole_area_huanche!==1}}">
-          <view class="step2-left">
-            <image src="../../img/park2.png" mode="widthFix"></image>
-          </view>
-          <view class="step2-right">
-            <view class="step2-text">还车点</view>
-            <view class="step2-text1">请在还车点内还车,否则将收取调度费</view>
-          </view>
-        </view>
-        <view class="step2-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" hidden="{{!frame}}">
+    <view class="frame-content">
+      <view class="frame-title">
+        <text class="iconfont icon-cha cha" onTap="frameClose"></text>
+        <text class="frame-kefu" onTap="keFu">联系客服</text>
+      </view>
+      
+      <image src="../../img/suo.jpg" mode="widthFix" class="suo"></image>
+      <view class="frame-con">
+        <!--<image src="../../img/lanya.jpg" mode="widthFix" class="lanya"></image> -->
+        <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" a:if="{{ steps==3 || !notice.id && ads.length==0}}">
+    <image src="../../img/mess.png" alt="" class="mess" />
+    <swiper class="swiper" autoplay='true' vertical='true' interval='10000'>
+      <swiper-item class="swiper-item">
+        <view class="ad-item">不在还车点换车,将收取调度费</view>
+      </swiper-item>
+      <!--<swiper-item class="swiper-item"><view class="ad-item">车辆静止三十分钟后将自动还车~</view></swiper-item> -->
+      <swiper-item class="swiper-item" a:if="{{bikeMessage.activity}}">
+        <view class="ad-item">{{bikeMessage.activity}}</view>
+      </swiper-item>
+    </swiper>
+    <!--<image src="../../img/change.png" class="change"></image> -->
+  </view>
+  <!-- 轮播图 -->
+  <view class="ad-swiper" a:if="{{ads.length>0 && steps!=3}}">
+    <swiper class="ad-swiper-list" indicator-dots='{{ads.length > 1 ? true : false}}' indicator-color='var(--globleColor)' 
+      autoplay='true' interval="5000" current="{{currentSwiper}}" onTap="swiperChange">
+      <swiper-item a:for="{{ads}}" a:key="key" class="ad-swiper-item">
+        <image mode="widthFix" a:if="{{item.type!=='wxTencentAdvertisement'}}" src="{{item.surface}}" style="width:100%;height:200rpx;" onTap="swiper" data-index="{{index}}" 
+          data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}" ></image>
+      </swiper-item>
+    </swiper>
+  </view>
+  
+  <view class="inform" style="top:{{ads.length>0 && steps!==3 ? '220rpx' : steps==3 ? '60px' : '30rpx'}}" onTap="tap_notice" 
+    a:if="{{notice.id}}" data-id="{{notice.id}}">
+    <view class="inform-img">
+      <image src="../../img/notice.png" class="inform-image" style="width:48rpx;height:48rpx;padding-left:20rpx;">
+      </image>
+    </view>
+    <view class='marquee' style='width:{{marqueeWidth}}rpx;'>
+      <view class='marqueeTitle' style="width:{{length}}rpx;transform:translateX( {{marqueeDistance}}rpx);">
+        {{notice.description}}
+      </view>
+    </view>
+    <image src="../../img/more.png" style="width:48rpx;height:48rpx;"></image>
+  </view>
+  <view class="use-bike-bottom" catchtouchmove='ture' a:if="{{frame == false}}">
+    <!-- 屏幕中间广告弹框 -->
+    <view class="ad-frame"  a:if="{{adFrame==true}}">
+      <view class="ad-frame-content">
+        <swiper autoplay='true' vertical='true' class="frame-middle">
+          <swiper-item  a:for="{{mid}}"  a:key='index' class="frame-middle">
+            <image a:if="{{item.type!=='wxTencentAdvertisement'}}" src="{{item.surface}}" mode="aspectFit" onTap="swiper" data-index="{{index}}" data-type="{{item.type}}" 
+              data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}"></image>
+          </swiper-item>
+        </swiper>
+      </view>
+      <view class="ad-frame-close" onTap="closeAdframe">
+        <text class="iconfont icon-cha"></text></view>
+    </view>
+
+    
+    
+    
+    <view class="use-bike-bottom" catchtouchmove='ture'>
+      <!-- 骑行第一步 -->
+      <view class="step1" a:if="{{steps==1}}">
+        <image src="../../img/home.png" class="back-home" onTap="backHome"></image>
+        <view class="bottom-title1">{{bikeMessage.riding_bike_mileage||'--'}}公里</view>
+        <view class="bottom-title2">剩余电量可行驶</view>
+        
+        <view class="open_bike" onTap="openBikeClick">点击开锁</view>
+        <view class="bike_no">NO:{{bikeMessage.bike_no}}</view>
+        <view class="lanya">打开蓝牙,体验快速开锁</view>
+      </view>
+      <!-- 骑行第二步 -->
+      <view class="step2" a:if="{{steps==2}}">
+        <image src="../../img/home.png" class="back-home" onTap="backHome"></image>
+        <view class="step2-title">温馨提示</view>
+        <view class="step2-content" a:if="{{setting.is_whole_area_huanche!==1}}">
+          <view class="step2-left">
+            <image src="../../img/park2.png" mode="widthFix"></image>
+          </view>
+          <view class="step2-right">
+            <view class="step2-text">还车点</view>
+            <view class="step2-text1">请在还车点内还车,否则将收取调度费</view>
+          </view>
+        </view>
+        <view class="step2-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="step2-content">
+          <view class="step2-left">
+            <image src="../../img/binride.png" style="width:80rpx;" 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}}<text class="min" a:if="{{isHour==false}}">分</text></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 class="pops" a:if="{{popShow}}">
+            <text class="pop-title">提示</text>
+            <view class="pop-cont">当前不在还车点继续还车将收取{{dispatch_money}}元调度费, <text style="color: black;">是否继续还车?</text></view>
+            <view class="pop-btn">
+              <view style="border-right: 1rpx solid #e5e5e5;" onTap="popHide"><text>取消</text></view>
+              <view style="color: #1e80ff;" onTap="huanche"><text>继续还车</text></view>
+            </view>
+          </view>
+          <view class="popbj" a:if="{{popShow}}"></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>

+ 1495 - 1385
pages/use_bike/use_bike.js

@@ -1,1386 +1,1496 @@
-
-// const log = require('../../utils/log')
-const { getCache, setCache, CacheKeys } = require('../../utils/cache')
-var app = getApp()
-var interval;
-var inter1;
-var locationTerval;
-var huancheTime;
-var coundDown;//运动中不可锁车倒计时
-var linshiStop;//临时停车倒计时
-const util = require('../../utils/utils.js');
-var interval;
-//蓝牙操作方法
-var BluetoothOperate = require('../../service/bluetooth.js');
-//const { content } = require('../../service/dataTransition.js');
-let bluetoothOperate = new BluetoothOperate();
-let machineNO = "" //设备编号
-let key = "" //蓝牙密钥
-let operateType = ''  //'open'开锁 'close'上锁 'bell'寻铃 'temporaryClose'临时锁车 'temporaryOpen'临时锁车开车
-var mytime = null;
-
-Page({
-  data: {
-    marqueeDistance: 520, //初始滚动距离 用到
-    marqueeWidth: 560, //通知公告用到
-    marqueePace: 0.6, //滚动速度
-    length: '',//通知公告
-    size: 26, //通知公告用到
-    notice: '',//通知公告
-    currentSwiper: 0,
-    nowBikeStatus: '',//当前车辆的状态
-    money: { time_money: 0, dispatch_money: 0, total_money: 0 },//骑行费用
-    steps: 1,//开锁步骤
-    parkStatus: 0,//骑行中:0,临时停车:1,点击结束用车:2
-    frame: false,//车辆未开锁弹框
-    code: '',//车辆编码
-    bikeMessage: '',//车辆信息
-    times: '00:00', //当前骑行时间
-    estimate_money: '--', //预计金额
-    minute: '', //骑行总时间秒
-    data: [],
-    box_no: '',
-    screenHeight: '',
-    change: false,
-    timing: 5,
-    isShow: false,
-    minute1: '',
-    parke: true,
-    timeout: 15,
-    retry: '',
-    bikePosition: false,
-    battery_power: '--',
-    huanche_timeout: 0,
-    img: app.globalData.imgUrl,
-    title: app.globalData.title,
-    stopmMinute: 30,//临时停车时间
-    stopMiao: 0,
-    chaButton: 0,//0 不显示 1显示
-    markers: [],
-    polygons: [],
-    polygons1: [],
-    zoom: 18,
-    temporaryTime: '',//临时锁车时间
-    background: false,//位置权限弹框
-    location: false,//位置权限弹框
-    coundDownTime: 5,//运动中不可锁车倒计时
-    countTimeShow: false,
-    dispatch_money: 0,//调度费
-    area_id: '',//区域id
-    mapHeight: 'calc(100vh - 300px)',
-    isHour: false,//及时判断是否含有小时
-
-  },
-  onShow: function () {
-    let that = this
-    that.setData({
-      polygons1: [],
-      polygons: []
-    })
-    my.setNavigationBar({
-      title: app.globalData.title
-    })
-    clearInterval(locationTerval);
-
-    app.login().then(res => {
-      that.userState()
-      that.posiLoca()
-      that.chushiPosiloc()
-      if (that.data.code) {
-        that.getBikeMessage()
-      }
-    })
-    if (that.data.order != undefined) {
-      that.chushi()
-    }
-    // that.reloadMap()
-  },
-  //初始化位之信息并获取区域
-  chushiPosiloc: function () {
-    let that = this
-    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({
-          longitude: longitude,
-          latitude: latitude,
-        })
-        that.home()
-      },
-      fail: function (err) {
-        console.log(err)
-        my.hideLoading()
-        if (err.error == 11) {
-
-          my.showAuthGuide({
-            authType: 'LBS',
-            success: (res) => {
-
-            },
-            fail: (error) => {
-              my.alert({ content: '获取位置授权失败' });
-            },
-          })
-        }
-        my.getSetting({
-          success: function (res) {
-            // console.log(res)
-            var statu = res.authSetting;
-            if (statu['scope.userLocation'] == false) {
-              that.setData({
-                background: true,
-                location: true
-              })
-            }
-          }
-        })
-      }
-    })
-  },
-  onLoad: function (options) {
-    let that = this
-
-    if (app.globalData.scanCode) {
-
-      that.setData({
-        code: app.globalData.scanCode
-      })
-    } else if (options.order != undefined) {
-      that.setData({
-        order: options.order,
-      })
-    } else {
-      that.setData({
-        code: options.code
-      })
-    }
-  },
-  getNotice(id) {
-    let data = {
-      'area_id': id
-    }
-    let isCache = getCache('Notice:' + id)
-    console.log(isCache, 'isCache')
-    if (isCache) {
-      if (isCache != null && isCache instanceof Object && !isCache.hasOwnProperty('id')) return
-      this.setData({ notice: isCache })
-      var length = isCache.description.length * this.data.size; //计算文字的长度
-      this.setData({
-        length: length
-      })
-      if (this.data.length > this.data.marqueeWidth) {
-        this.noticeRun();
-      } else {
-        this.setData({
-          marqueeDistance: 0
-        })
-      }
-      return
-    }
-    app.request("/index/an", data, "GET").then(res => {
-      if (200 == res.status) {
-        setCache('Notice:' + id, res.data)
-        if (res.data != null && res.data instanceof Object && !res.data.hasOwnProperty('id')) return
-
-        this.setData({ notice: res.data })
-        var length = res.data.description.length * this.data.size; //计算文字的长度
-        this.setData({
-          length: length
-        })
-        if (this.data.length > this.data.marqueeWidth) {
-          this.noticeRun();
-        } else {
-          this.setData({
-            marqueeDistance: 0
-          })
-        }
-      }
-    }).catch(err => {
-      // console.log(err)
-    })
-  },
-  noticeRun: function () {
-    var that = this;
-    clearInterval(mytime);
-    mytime = setInterval(function () {
-      if (-that.data.marqueeDistance < that.data.length) {
-        that.setData({
-          marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
-        })
-      } else {
-        clearInterval(mytime);
-        that.setData({
-          marqueeDistance: that.data.marqueeWidth
-        });
-        that.noticeRun();
-      }
-    }, 10)
-  },
-  //广告列表
-  adsList: function (id) {
-    var that = this;
-    var area_id = ''
-    if (id != undefined) {
-      area_id = id
-    } else {
-      area_id = 0
-    }
-
-    let isCache = getCache('ads:' + id)
-    if (isCache) {
-      if (isCache == '') return
-      if (isCache != null && isCache instanceof Object && isCache.hasOwnProperty('header')) {
-        that.setData({
-          ads: isCache.header
-        })
-      }
-      if (isCache != null && isCache instanceof Object && isCache.hasOwnProperty('mid')) {
-        that.setData({
-          mid: res.data.mid,
-          adFrame: true
-        })
-      }
-      return
-    }
-
-    app.request("/ads?area_id=" + area_id + "&position[]=mid&position[]=header&position[]=footer", '', "GET").then(res => {
-      if (res.status == 200) {
-        setCache('ads:' + id, res.data)
-        if (res.data == '') return
-        if (res.data.header) {
-          that.setData({
-            ads: res.data.header
-          })
-        }
-        if (res.data.mid) {
-          that.setData({
-            mid: res.data.mid,
-            adFrame: true
-          })
-        }
-      }
-    }).catch(err => {
-      // console.log(err)
-    })
-  },
-  //点击广告页
-  swiper: util.throttle(function (e) {
-
-    var type = e.currentTarget.dataset.type;
-    var index = e.currentTarget.dataset.index;
-    var name = e.currentTarget.dataset.name;
-    var detail = e.currentTarget.dataset.detail;
-    var id = e.currentTarget.dataset.id;
-    if (type != 'clilk_null') {
-      if (type == 'wxUrl') {
-        console.log(e, 'pppp')
-        my.navigateTo({
-          url: '/' + detail,
-        })
-      } else if (type == 'phone') {
-
-        my.makePhoneCall({
-          number: detail,
-        })
-      } else if (type == 'toMiniProgram') {
-        my.navigateToMiniProgram({
-          appId: detail,
-          extraData: {
-            foo: 'bar'
-          },
-          // envVersion: 'develop',
-          success(res) {
-            // 打开成功
-          }
-        })
-      } else {
-        my.navigateTo({
-          url: '../swiper/swiper?type=' + type + '&url=' + id + '&name=' + name + '&detail=' + detail,
-        })
-      }
-    }
-  }, 1000),
-  //点击轮播图
-  swiperChange: function (e) {
-    if (this.data.currentSwiper == 0 && this.data.swiperCurrent > 1) { //卡死时,重置current为正确索引
-      this.setData({
-        currentSwiper: this.data.swiperCurrent
-      });
-    } else { //正常轮转时,记录正确页码索引
-      this.setData({
-        swiperCurrent: e.detail.current
-      });
-    }
-  },
-
-
-
-  //用户状态
-  userState: function (area_id) {
-    var that = this;
-
-    app.request("/user/status", "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()
-        }
-        /**
-       * 未支付直接调转支付
-       * mead
-       */
-        if (res.data.is_pay_order) {
-          my.navigateTo({
-            url: '/pages/pay/pay?order=' + res.data.is_pay_order,
-          })
-        }
-      } else {
-        if (this.data.bikeInfo.is_link == 0) {
-          my.alert({
-            title: '提示',
-            content: '当前车子已下线请换辆车子骑行吧~',
-            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.alertal({
-            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;
-        }
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  //骑行区禁停区车辆
-  home: function () {
-    //请求首页接口和一些设置。
-    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.ban_stop(area_id)
-          that.getNotice(area_id)
-          that.adsList(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
-    that.setData({
-      polygons1: that.data.polygons1.concat(home)
-    })
-
-    let isCache = getCache('BAN_STOP:' + area_id)
-    if (isCache) {
-      that.setData({
-        markers: that.data.markers.concat(isCache.centres),
-        polygons: that.data.polygons1.concat(isCache.polygons),
-      })
-      return
-    }
-
-    var data1 = {
-      'area_id': area_id
-    }
-    app.request('/parking/stop-sites', data1, 'GET').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        var data = res.data
-        console.log(data)
-        that.setData({
-          markers: that.data.markers.concat(data.centres),
-          polygons: that.data.polygons1.concat(data.polygons),
-        })
-      }
-    })
-  },
-  //初始化信息
-  chushi: function () {
-    my.showLoading()
-    var that = this;
-    var date = Date.parse(new Date()) / 1000;
-     var setting =  my.getStorageSync({ 'key': 'setting' }).data;
-    app.request('/pages/ride-order?no=' + that.data.order, '', 'GET').then(res => {
-      console.log(res, ',---------')
-      if (res.status == 200) {
-        my.hideLoading()
-        my.setStorageSync({ 'key': 'bike_status', data: res.data.status })
-
-        if (res.data.start_use_bike_time <= 0) {
-          that.setData({
-            minute: 0
-          })
-        } else {
-          let cha = date - res.data.start_use_bike_time
-          console.log(Math.round(cha / 60), 'ppppp')
-          var time = parseInt(cha / 60) - setting.starting_price_time;
-          var per_money = setting.per_money;
-          var per_minute = setting.per_minute;
-          // console.log('测试1',times)
-          //页面进来时初始化金额
-
-          // let money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
-          let money = parseInt(time / per_minute) * per_money + parseFloat(setting.starting_price)
-          var hour = Math.floor(cha / 3600 % 24);
-          // 分钟
-          var minute = Math.floor(cha / 60 % 60);
-          // let hour = parseInt(cha / 3600)
-          console.log(hour, 'hour')
-          console.log(minute, 'hour')
-          hour = hour < 10 ? '0' + hour : hour
-          minute = minute < 10 && hour > 0 ? '0' + minute : minute
-          if (hour > 0) {
-            // let minute=
-
-            that.setData({
-              minute: date - res.data.start_use_bike_time,
-              times: hour + ":" + minute,
-              estimate_money: money,
-              isHour: true
-            })
-          } else {
-            // let minute = parseInt(cha / 60)
-            that.setData({
-              minute: date - res.data.start_use_bike_time,
-              times: minute,
-              estimate_money: money,
-              isHour: false
-            })
-          }
-
-          // that.setData({
-          //   minute: date - res.data.start_use_bike_time
-          // })
-        }
-        that.terval()
-        my.showToast({
-          content: '刷新成功',
-          icon: 'none'
-        })
-        that.setData({
-          data: res.data,
-          code: res.data.bike_no,
-          temporaryTime: res.data.pause_bike_time
-        })
-        let userStatus = my.getStorageSync({ 'key': 'userState' }).data;
-        let setting = my.getStorageSync({ 'key': 'setting' }).data;
-        let bike_status = my.getStorageSync({ 'key': 'bike_status' }).data;
-        //有正在骑行中的订单的订单
-        if (userStatus.is_ride_order != false && bike_status == 1) {
-          //骑行中
-          console.log('ppppp')
-          that.setData({
-            steps: 3
-          })
-          my.setStorageSync({ 'key': 'nowBikeStatus', data: 0 })
-          //   that.reloadMap()
-        } else if (bike_status == 0 && userStatus.is_ride_order != false) {
-          // 临时停车
-          that.setData({
-            parkStatus: 1,
-            steps: 3
-          })
-          my.setStorageSync({ 'key': 'nowBikeStatus', data: 1 })
-          //  that.reloadMap()
-          that.stopDownTime()
-        }
-        app.request('/bike/' + that.data.code, '', 'GET').then(res => {
-          console.log(res)
-          200 == res.status && that.setData({
-            battery_power: res.data.battery_power,
-            box_no: res.data.box_no,
-            bikeMessage: res.data,
-          })
-        })
-        if (res.data.status == 0) {
-          that.setData({
-            bolear: 0
-          })
-        } else if (res.data.status == 1) {
-          that.setData({
-            bolear: 1
-          })
-        } else if (res.data.status == 2) {
-          clearInterval(interval),
-            // clearInterval(interval1);
-            clearInterval(locationTerval);
-          my.reLaunch({
-            url: '../payment/payment?order=' + res.data.no
-          })
-        } else {
-          my.reLaunch({
-            url: '../index/index',
-          })
-        }
-        // that.bikeLocation();
-      }
-    }).catch(err => {
-      console.log(err)
-    })
-  },
-  //获取当前位置
-  posiLoca: function () {
-    var that = this;
-    my.showLoading({
-      content: '正在定位...',
-      icon: 'none'
-    })
-    // locationTerval = setInterval(function () {
-    my.getLocation({
-      type: 'gcj02',
-      success: (res) => {
-        var latitude = res.latitude
-        var longitude = res.longitude
-        my.hideLoading()
-        that.setData({
-          longitude: longitude,
-          latitude: latitude,
-        })
-        that.home()
-      },
-      fail: function (err) {
-        my.hideLoading()
-        if (err.error == 11) {
-          my.showAuthGuide({
-            authType: 'LBS',
-            success: (res) => {
-
-            },
-            fail: (error) => {
-              my.alert({ content: '获取位置授权失败' });
-            },
-          })
-        }
-        my.getSetting({
-          success: function (res) {
-            // console.log(res)
-            var statu = res.authSetting;
-            if (statu['scope.userLocation'] == false) {
-              that.setData({
-                background: true,
-                location: true
-              })
-            }
-          }
-        })
-      }
-    })
-
-  },
-  //获取蓝牙秘钥
-  getSecretKey(box_no) {
-    //     if (!box_no) box_no = this._bikeMainId
-    //     let that = this;
-    //     if(box_no== my.getStorageSync('box_no')) return;
-    return new Promise(function (res, rej) {
-      let param = {
-        box_no: box_no, //我公司是通过设备编号获取的密钥
-      };
-      app.request('/blu/get-key', param, 'GET').then(resp => {
-        key = resp.data.key
-        res(resp.data.key);
-        my.setStorageSync({ 'key': 'box_no', data: box_no })
-      })
-    });
-  },
-  //行车时间计时
-  terval: function () {
-    var that = this;
-    clearInterval(interval)
-    clearInterval(huancheTime)
-    var times = ''; //秒数
-    var minute = Math.round(that.data.minute / 60); //分钟
-    var minute1 = '0'; //分钟
-    var hour = 0; //小时
-    var hour1 = '0'; //小时
-    var time = that.data.minute //获取当前已骑行的秒数
-    var setting = my.getStorageSync({ 'key': 'setting' }).data;
-
-    if (time > 60) { //秒数大于60 分钟= 秒数/60  秒数=  -1*60  40
-      minute = parseInt(time / 60);
-      times = time - minute * 60;
-      //minute代表分钟  times 代表秒数
-    } else {
-      minute = parseInt(time / 60);
-      times = time;
-    }
-    interval = setInterval(function () {
-      //定时器 秒数一秒加1
-      minute++
-      if (minute < 10 && hour>0) { //如果分钟小于10 加一个0
-        minute1 = '0' + minute
-      } else {
-        minute1 = minute
-      }
-      if (minute > 59) {
-        //分钟大于59 让小时+1
-        hour = parseInt(minute / 60)
-        minute1 = minute - hour * 60;
-        if (hour < 10) {
-          hour1 = '0' + hour;
-        } else {
-          hour1 = hour
-        }
-      }
-      if (minute1 < 10 && hour > 0) { //如果分钟小于10 加一个0
-        minute1 = '0' + minute1
-      } else {
-        minute1 = minute1
-      }
-      if (hour > 0) {
-        // //如果小时大于0 显示 时分
-        that.setData({
-          times: hour1 + ':' + minute1,
-          isHour: true
-        })
-      } else {
-        // //else 显示 分秒
-        that.setData({
-          times: minute1,
-          isHour: false
-        })
-      }
-      // that.setData({ times: minute1 + ':' + times})
-      //计算钱   分钟除以5*5   判断秒数>30  minute = minute+1
-      //不满12分钟按12分钟算   并且大于30秒   
-      var per_money = setting.per_money;
-      var per_minute = setting.per_minute;
-      // console.log(minute)
-      // console.log(minute1)
-      if (setting.starting_price_time > minute) {
-        that.setData({
-          estimate_money: setting.starting_price
-        })
-      } else {
-
-        //起步价+(分钟数-起步时长)/ 一块钱可骑多少分钟 * 钱数
-        var time = minute - setting.starting_price_time;
-        // console.log('测试1',times)
-        //页面进来时初始化金额
-
-        // let money = Math.round(time / per_minute) * per_money + parseFloat(setting.starting_price)
-        let money = parseInt(time / per_minute) * per_money + parseFloat(setting.starting_price)
-        that.setData({
-          estimate_money: money,
-          onload: true
-        })
-      }
-    }, 60000)
-  },
-
-  //获取车辆信息
-  getBikeMessage: function () {
-    my.showLoading()
-    var that = this;
-    app.request('/bike/' + that.data.code, '', 'GET').then(res => {
-      console.log(res, '车辆信息--------------------')
-      machineNO = res.data.box_no
-      my.hideLoading()
-      if (res.status == 200) {
-        that.setData({
-          bikeMessage: res.data,
-          battery_power: res.data.battery_power,
-          steps: 1
-        }),
-          key = res.data.key
-      } else {
-        setTimeout(function () {
-          my.reLaunch({
-            url: '/pages/index/index',
-          })
-        }, 2000)
-
-      }
-    })
-
-  },
-  //检测用户是否完成实名认证,是否有待支付订单违章记录等
-  jiance: function () {
-    let that = this
-    var userStatus = my.getStorageSync({ 'key': 'userState' }).data;
-    var setting = my.getStorageSync({ 'key': 'setting' }).data;
-    console.log(userStatus, '旭颖')
-    console.log(setting, '旭颖')
-    if (userStatus.is_bind_mobile == 0) {
-      my.navigateTo({
-        url: '/pages/authorization/authorization',
-      })
-      //未实名认证
-    }
-    else
-      if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
-        my.navigateTo({
-          url: '/pages/real_name/real_name',
-        })
-      }//是否缴纳押金 
-      else if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
-        my.navigateTo({
-          url: '/pages/ride_zige/ride_zige',
-        })
-      } else if (userStatus.is_ride_order != false) {
-        my.alert({
-          title: '提示',
-          content: '您有一个正在骑行中的订单',
-          success: function (res) {
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          }
-        })
-      } else if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
-        my.alert({
-          title: '提示',
-          content: '您有一个待支付订单,请先支付',
-          success: function (res) {
-            my.reLaunch({
-              url: '/pages/index/index',
-            })
-          }
-        })
-      }
-      else {
-        that.setData({
-          steps: 2
-        })
-        //   this.reloadMap()
-      }
-
-
-
-  },
-
-
-
-  reloadMap(classname = 'use-bike-bottom') {
-    let query = my.createSelectorQuery();
-    let th = this;
-    query.select('.' + classname).boundingClientRect(function (rect) {
-      if (rect != null && rect instanceof Object && rect.hasOwnProperty('height')) {
-        let height = rect.height || 300;
-        th.setData({ mapHeight: 'calc(100vh - ' + (height) + 'px)' });
-      } else {
-        let height = 300;
-        th.setData({ mapHeight: 'calc(100vh - ' + height + 'px)' });
-      }
-    }).exec();
-  },
-  //倒计时
-
-  //临时停车倒计时
-  stopDownTime() {
-    // let that = this
-    // let endTime = Date.parse(new Date()); //date日期类型
-    // let startTime
-    // if (!that.data.temporaryTime || that.data.temporaryTime == null) {
-    //   startTime = endTime
-    // } else {
-    //   let data1 = that.data.temporaryTime
-    //   let data2 = data1.replace(/-/g, '/')
-    //   let data3 = new Date(data2)
-    //   startTime = data3.getTime()
-    // }
-    // let totleTime = 1800
-    // clearInterval(linshiStop)
-    // console.log(endTime, 'endTime')
-    // console.log(startTime, 'startTime')
-    // let date3 = endTime - startTime;
-    // console.log(date3, 'date3')
-    // //计算出相差天数
-    // var days = Math.floor(date3 / (24 * 3600 * 1000));
-    // //计算出小时数
-    // var leave1 = date3 % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
-    // var hours = Math.floor(leave1 / (3600 * 1000));
-    // //计算相差分钟数
-    // var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
-    // var minutes = Math.floor(leave2 / (60 * 1000));
-    // //计算相差秒数
-    // var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
-    // var seconds = Math.round(leave3 / 1000);
-    // console.log(minutes, 'minutes')
-
-    // let chaTime = totleTime - minutes * 60
-    // console.log(chaTime, 'chaTime')
-    // linshiStop = setInterval(function () {
-    //   let test = 30 * 60 * 1000
-    //   console.log(test, 'test')
-    //   if (date3 > test) {
-    //     that.setData({
-    //       stopMiao: 0,
-    //       stopmMinute: 0
-    //     })
-    //     clearInterval(linshiStop)
-    //   } else if (chaTime <= 0) {
-    //     that.setData({
-    //       stopMiao: 0,
-    //       stopmMinute: 0
-    //     })
-    //     clearInterval(linshiStop)
-    //   } else {
-    //     console.log(minutes, 'pppp')
-    //     chaTime--
-
-    //     let fen = parseInt(chaTime / 60);
-    //     let miao = parseInt(chaTime % 60);
-    //     that.setData({
-    //       stopMiao: miao,
-    //       stopmMinute: fen
-    //     })
-    //   }
-
-    // }, 1000)
-
-  },
-  //开锁方法
-  openBike() {
-    var that = this;
-    my.showLoading({
-      content: '开锁中...',
-      mask: true
-    })
-    var data = {
-      bike_no: that.data.code,
-      lat: that.data.latitude,
-      lng: that.data.longitude,
-      area_id: my.getStorageSync({ 'key': 'home' }).data.id,
-    }
-    app.request('/bike/open-lock', data, 'POST').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        that.setData({
-          steps: 3,
-          order: res.data.no
-        })
-        that.terval()
-        //蓝牙开锁
-        operateType = 'open'
-        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-          bluetoothOperate.end((flag) => { });
-        });
-        my.hideLoading()
-      } else {
-        // that.setData({
-        //   steps: 3
-        // })
-        // that.terval()
-      }
-    })
-
-
-  },
-  //开锁失败重试开锁
-  retryOpenBike: function () {
-    var that = this;
-    console.log('重试开锁')
-    //蓝牙重试开锁
-    my.showLoading({
-      content: '开锁中...',
-      mask: true
-    })
-
-    let data = {
-      order_no: that.data.order,
-      bike_no: that.data.code
-    }
-    app.request('/order/retry-open-lock', data, 'GET').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        my.hideLoading()
-        if (res.data.status == 1) {
-          that.setData({
-            frame: false
-          })
-          my.hideLoading()
-          operateType = 'open'
-          bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-            bluetoothOperate.end((flag) => { });
-          });
-          my.showToast({
-            content: '开锁成功',
-            icon: 'none'
-          })
-        }
-      }
-    })
-  },
-  openBikeClick: function () {
-    let that = this
-    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 () {
-    //点击去设置位置权限
-    this.setData({
-      background: false,
-      location: false
-    })
-    my.openSetting({
-      success: function (res) {
-      }
-    })
-  }, 1500),
-  //点击已开启位置权限
-  open: util.throttle(function () {
-    this.setData({
-      background: false,
-      location: false
-    })
-  }, 1500),
-  //寻铃
-  clickBell: util.throttle(function (e) {
-    //点击响铃
-    var that = this;
-    my.showLoading({
-      content: '找车中...',
-      mask: true
-    })
-
-    app.request('/order/retry-bell-lock?order_no=' + that.data.order + '&bike_no=' + that.data.code, '', 'GET').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        //蓝牙寻铃找车
-        operateType = 'bell'
-        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-          //flag == true 操作成功
-          //flag == false 操作失败
-          //end
-          bluetoothOperate.end((flag) => { });
-        });
-        res.data.is_ok == true && my.showToast({
-          content: '找车成功',
-          icon: 'none',
-          duration: 2000
-        })
-        res.data.is_ok == false && my.showToast({
-          content: '找车失败请重试',
-          icon: 'none',
-          duration: 2000
-        })
-      }
-    })
-  }, 1000),
-  //立即开锁
-  konwOpenBike: util.throttle(function () {
-    var that = this;
-    // that.jiance()
-    if (that.data.deposit == true) return;
-    that.openBike()
-  }, 1000),
-  //临时锁车
-  parkBike: function () {
-
-    let that = this
-    my.showLoading({
-      content: '正在临时锁车',
-    })
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-
-    //代表要临时停车
-    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
-          bluetoothOperate.end((flag) => { });
-        });
-        my.showToast({
-          content: '停车成功',
-          icon: 'none'
-        })
-        that.setData({
-          parkStatus: 1,
-          // nowBikeStatus:1
-        })
-        my.setStorageSync({ 'key': 'nowBikeStatus', data: 1 })
-        that.stopDownTime()
-        // that.getBikeMessage()
-      } else if (res.status == 450) {
-        my.showToast({
-          content: '运动中不能关锁,请稍后重试',
-          icon: 'none',
-          duration: 5000,
-          mask: true
-        })
-        my.hideLoading()
-      }
-    })
-  },
-  //结束临时锁车
-  openPark: function () {
-    let that = this
-    my.showLoading({
-      content: '解锁中',
-    })
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-    // clearInterval(inter1)
-
-    app.request('/bike/temporary-open-lock', data, 'POST').then(res => {
-      // that.inter1()
-      if (res.status == 200) {
-        my.hideLoading()
-        // 蓝牙临时开车
-        operateType = 'temporaryOpen'
-        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-          //flag == true 操作成功
-          //flag == false 操作失败
-          //end
-          bluetoothOperate.end((flag) => { });
-        });
-        my.showToast({
-          content: '开车成功',
-          icon: 'none'
-        })
-        clearInterval(linshiStop)
-        my.setStorageSync({ 'key': 'stopMiao', data: 0 })
-        my.setStorageSync({ 'key': 'stopmMinute', data: 30 })
-        that.setData({
-          stopMiao: 0,
-          stopmMinute: 30,
-          parkStatus: 0,
-          nowBikeStatus: 0
-        })
-        my.setStorageSync({ 'key': 'nowBikeStatus', data: 0 })
-      }
-    })
-
-  },
-  endUseBike: function () {
-    let that = this
-    my.showLoading({
-      content: '加载中...'
-    })
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-
-    app.request('/order/expect-order-money', data, 'POST').then(res => {
-      console.log(res)
-      if (res.status == 200) {
-        my.hideLoading()
-        let data = res.data.dispatch_money
-        res.data.time_money = parseFloat(res.data.time_money)
-        let data1 = parseFloat(data)
-        console.log(data1, 'ppppppppppppppppppp')
-        that.setData({
-          dispatch_money: data1,
-          money: res.data,
-          chaButton: 1,
-          parkStatus: 2
-        })
-
-      }
-    })
-  },
-  //确定结束用车
-  sureEndUseBike: util.throttle(function () {
-
-    my.showLoading({
-      content: '结算中...',
-      mask: true
-    })
-    var that = this;
-    var data = {
-      bike_no: that.data.code,
-      order_no: that.data.order,
-      lat: that.data.latitude,
-      lng: that.data.longitude
-    }
-    app.request('/bike/close-lock', data, 'POST').then(res => {
-      console.log(res)
-      my.hideLoading()
-      if (res.status == 200) {
-        console.log(res, '结束用车')
-        clearInterval(linshiStop);
-        clearInterval(interval);
-        my.setStorageSync({ 'key': 'stopMiao', data: 0 })
-        my.setStorageSync({ 'key': 'stopmMinute', data: 30 })
-        my.hideNavigationBarLoading(), my.hideLoading()
-        my.reLaunch({
-          url: '../pay/pay?order=' + res.data.no
-        })
-        //蓝牙锁车操作 确定结束用车
-        if (machineNO && key) {
-          operateType = 'close'
-          bluetoothOperate.start(operateType, machineNO, key, (flag) => {
-            //flag == true 操作成功
-            //flag == false 操作失败
-            //end
-            //订单结束关闭蓝牙
-            bluetoothOperate.end((flag) => { });
-          });
-        }
-
-      } else if (res.status == 450) {
-        my.showToast({
-          content: '运动中不能关锁,请稍后重试',
-          icon: 'none',
-          duration: 5000,
-          mask: true
-        })
-      }
-    }).catch(err => {
-      my.showToast({
-        content: '关锁失败,请重试。',
-        icon: 'none',
-        duration: 5000,
-      })
-      my.hideLoading()
-    })
-  }, 1000),
-
-  //取消锁车
-  cancelEndBike: function () {
-    console.log(my.getStorageSync({ 'key': 'nowBikeStatus' }).data)
-    let that = this
-    that.setData({
-      chaButton: 0,
-      dispatch_money: 0,
-      parkStatus: my.getStorageSync({ 'key': 'nowBikeStatus' }).data
-    })
-    // that.reloadMap()
-  },
-  //计价规则
-  chargeRule: function () {
-    my.navigateTo({
-      url: '/pages/charge_rule/charge_rule',
-    })
-  },
-  //骑行须知
-  bikeKnow: function () {
-    my.navigateTo({
-      url: '/pages/ride_rule/ride_rule',
-    })
-  },
-  //骑行优惠券
-  bikeCoupon: function () {
-    my.navigateTo({
-      url: '/pages/buy-card/buy-card',
-    })
-  },
-  //客服
-  keFu: function () {
-    my.makePhoneCall({
-      number: my.getStorageSync({ 'key': 'home' }).data.customer_service_phone,
-    })
-  },
-  //车辆为未开锁弹框
-  //打开
-  frameClose: function () {
-    let that = this
-    that.setData({
-      frame: false
-    })
-    //  that.reloadMap()
-  },
-  //关闭弹框
-  frameShow: function () {
-    let that = this
-    that.setData({
-      frame: true
-    })
-    that.reloadMap('frame')
-  },
-  //故障上报
-  guzhang: function () {
-    this.setData({
-      frame: false,
-    })
-    // this.reloadMap()
-    my.navigateTo({
-      url: '/pages/breakdown/breakdown',
-    })
-  },
-  //附近还车点
-  findPark: function () {
-    my.navigateTo({
-      url: '/pages/parking/parking',
-    })
-  },
-  onHide: function () {
-    console.log('onHide5555')
-    // clearInterval(testToken
-    clearInterval(mytime)
-    clearInterval(interval)
-    bluetoothOperate.end((flag) => { });
-  },
-  onUnload: function () {
-    clearInterval(locationTerval)
-    bluetoothOperate.end((flag) => { });
-    // 停止位置跟踪
-    // my.stopLocationUpdate({
-    //   success: (res) => {
-    //     console.log("onUnload stopLocationUpdate success", res)
-    //   },
-    //   fail: (err) => {
-    //     console.log("onUnload stopLocationUpdate fail", err)
-    //   }
-    // })
-  },
-  //返回首页
-  backHome() {
-    my.reLaunch({
-      url: '/pages/index/index',
-    })
-  }
+// const log = require('../../utils/log')
+const {
+  getCache,
+  setCache,
+  CacheKeys
+} = require('../../utils/cache')
+var app = getApp()
+var interval;
+var inter1;
+var locationTerval;
+var huancheTime;
+var coundDown; //运动中不可锁车倒计时
+var linshiStop; //临时停车倒计时
+const util = require('../../utils/utils.js');
+var interval;
+//蓝牙操作方法
+var BluetoothOperate = require('../../service/bluetooth.js');
+//const { content } = require('../../service/dataTransition.js');
+let bluetoothOperate = new BluetoothOperate();
+let machineNO = "" //设备编号
+let key = "" //蓝牙密钥
+let operateType = '' //'open'开锁 'close'上锁 'bell'寻铃 'temporaryClose'临时锁车 'temporaryOpen'临时锁车开车
+var mytime = null;
+
+Page({
+  data: {
+    marqueeDistance: 520, //初始滚动距离 用到
+    marqueeWidth: 560, //通知公告用到
+    marqueePace: 0.6, //滚动速度
+    length: '', //通知公告
+    size: 26, //通知公告用到
+    notice: '', //通知公告
+    currentSwiper: 0,
+    nowBikeStatus: '', //当前车辆的状态
+    money: {
+      time_money: 0,
+      dispatch_money: 0,
+      total_money: 0
+    }, //骑行费用
+    steps: 1, //开锁步骤
+    parkStatus: 0, //骑行中:0,临时停车:1,点击结束用车:2
+    frame: false, //车辆未开锁弹框
+    code: '', //车辆编码
+    bikeMessage: '', //车辆信息
+    times: '0', //当前骑行时间
+    estimate_money: '0', //预计金额
+    minute: '', //骑行总时间秒
+    data: [],
+    box_no: '',
+    screenHeight: '',
+    change: false,
+    timing: 5,
+    isShow: false,
+    minute1: '',
+    parke: true,
+    timeout: 15,
+    retry: '',
+    bikePosition: false,
+    battery_power: '--',
+    huanche_timeout: 0,
+    img: app.globalData.imgUrl,
+    title: app.globalData.title,
+    stopmMinute: 30, //临时停车时间
+    stopMiao: 0,
+    chaButton: 0, //0 不显示 1显示
+    markers: [],
+    polygons: [],
+    polygons1: [],
+    zoom: 18,
+    temporaryTime: '', //临时锁车时间
+    background: false, //位置权限弹框
+    location: false, //位置权限弹框
+    coundDownTime: 5, //运动中不可锁车倒计时
+    countTimeShow: false,
+    dispatch_money: 0, //调度费
+    area_id: '', //区域id
+    mapHeight: 'calc(100vh - 300px)',
+    isHour: false, //及时判断是否含有小时
+    popShow:false
+
+
+  },
+  onShow: function () {
+    let that = this
+    that.setData({
+      polygons1: [],
+      polygons: []
+    })
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    clearInterval(locationTerval);
+
+    app.login().then(res => {
+      that.userState()
+      that.posiLoca()
+      that.chushiPosiloc()
+      if (that.data.code) {
+        that.getBikeMessage()
+      }
+    })
+    if (that.data.order != undefined) {
+      console.log(that.data.order, 'that.data.orderthat.data.orderthat.data.order')
+      that.chushi()
+    }
+    // that.reloadMap()
+  },
+  //初始化位之信息并获取区域
+  chushiPosiloc: function () {
+    let that = this
+    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({
+          longitude: longitude,
+          latitude: latitude,
+        })
+        that.home()
+      },
+      fail: function (err) {
+        console.log(err)
+        my.hideLoading()
+        if (err.error == 11) {
+
+          my.showAuthGuide({
+            authType: 'LBS',
+            success: (res) => {
+
+            },
+            fail: (error) => {
+              my.alert({
+                content: '获取位置授权失败'
+              });
+            },
+          })
+        }
+        my.getSetting({
+          success: function (res) {
+            // console.log(res)
+            var statu = res.authSetting;
+            if (statu['scope.userLocation'] == false) {
+              that.setData({
+                background: true,
+                location: true
+              })
+            }
+          }
+        })
+      }
+    })
+  },
+  onLoad: function (options) {
+    let that = this
+
+    if (app.globalData.scanCode) {
+
+      that.setData({
+        code: app.globalData.scanCode
+      })
+    } else if (options.order != undefined) {
+      that.setData({
+        order: options.order,
+      })
+    } else {
+      that.setData({
+        code: options.code
+      })
+    }
+  },
+  getNotice(id) {
+    let data = {
+      'area_id': id
+    }
+    let isCache = getCache('Notice:' + id)
+    console.log(isCache, 'isCache')
+    if (isCache) {
+      if (isCache != null && isCache instanceof Object && !isCache.hasOwnProperty('id')) return
+      this.setData({
+        notice: isCache
+      })
+      var length = isCache.description.length * this.data.size; //计算文字的长度
+      this.setData({
+        length: length
+      })
+      if (this.data.length > this.data.marqueeWidth) {
+        this.noticeRun();
+      } else {
+        this.setData({
+          marqueeDistance: 0
+        })
+      }
+      return
+    }
+    app.request("/index/an", data, "GET").then(res => {
+      if (200 == res.status) {
+        setCache('Notice:' + id, res.data)
+        if (res.data != null && res.data instanceof Object && !res.data.hasOwnProperty('id')) return
+
+        this.setData({
+          notice: res.data
+        })
+        var length = res.data.description.length * this.data.size; //计算文字的长度
+        this.setData({
+          length: length
+        })
+        if (this.data.length > this.data.marqueeWidth) {
+          this.noticeRun();
+        } else {
+          this.setData({
+            marqueeDistance: 0
+          })
+        }
+      }
+    }).catch(err => {
+      // console.log(err)
+    })
+  },
+  noticeRun: function () {
+    var that = this;
+    clearInterval(mytime);
+    mytime = setInterval(function () {
+      if (-that.data.marqueeDistance < that.data.length) {
+        that.setData({
+          marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
+        })
+      } else {
+        clearInterval(mytime);
+        that.setData({
+          marqueeDistance: that.data.marqueeWidth
+        });
+        that.noticeRun();
+      }
+    }, 10)
+  },
+  //广告列表
+  adsList: function (id) {
+    var that = this;
+    var area_id = ''
+    if (id != undefined) {
+      area_id = id
+    } else {
+      area_id = 0
+    }
+
+    let isCache = getCache('ads:' + id)
+    if (isCache) {
+      if (isCache == '') return
+      if (isCache != null && isCache instanceof Object && isCache.hasOwnProperty('header')) {
+        that.setData({
+          ads: isCache.header
+        })
+      }
+      if (isCache != null && isCache instanceof Object && isCache.hasOwnProperty('mid')) {
+        that.setData({
+          mid: isCache.mid,
+          adFrame: true
+        })
+      }
+      return
+    }
+
+    app.request("/ads?area_id=" + area_id + "&position[]=mid&position[]=header&position[]=footer", '', "GET").then(res => {
+      if (res.status == 200) {
+        setCache('ads:' + id, res.data)
+        if (res.data == '') return
+        if (res.data.header) {
+          that.setData({
+            ads: res.data.header
+          })
+        }
+        if (res.data.mid) {
+          that.setData({
+            mid: res.data.mid,
+            adFrame: true
+          })
+        }
+      }
+    }).catch(err => {
+      // console.log(err)
+    })
+  },
+  //点击广告页
+  swiper: util.throttle(function (e) {
+
+    var type = e.currentTarget.dataset.type;
+    var index = e.currentTarget.dataset.index;
+    var name = e.currentTarget.dataset.name;
+    var detail = e.currentTarget.dataset.detail;
+    var id = e.currentTarget.dataset.id;
+    if (type != 'clilk_null') {
+      if (type == 'wxUrl') {
+        console.log(e, 'pppp')
+        my.navigateTo({
+          url: '/' + detail,
+        })
+      } else if (type == 'phone') {
+
+        my.makePhoneCall({
+          number: detail,
+        })
+      } else if (type == 'toMiniProgram') {
+        my.navigateToMiniProgram({
+          appId: detail,
+          extraData: {
+            foo: 'bar'
+          },
+          // envVersion: 'develop',
+          success(res) {
+            // 打开成功
+          }
+        })
+      } else {
+        my.navigateTo({
+          url: '../swiper/swiper?type=' + type + '&url=' + id + '&name=' + name + '&detail=' + detail,
+        })
+      }
+    }
+  }, 1000),
+  //点击轮播图
+  swiperChange: function (e) {
+    if (this.data.currentSwiper == 0 && this.data.swiperCurrent > 1) { //卡死时,重置current为正确索引
+      this.setData({
+        currentSwiper: this.data.swiperCurrent
+      });
+    } else { //正常轮转时,记录正确页码索引
+      this.setData({
+        swiperCurrent: e.detail.current
+      });
+    }
+  },
+
+
+
+  //用户状态
+  userState: function (area_id) {
+    var that = this;
+
+    app.request("/user/status", "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()
+        }
+        /**
+         * 未支付直接调转支付
+         * mead
+         */
+        if (res.data.is_pay_order) {
+          my.navigateTo({
+            url: '/pages/pay/pay?order=' + res.data.is_pay_order,
+          })
+        }
+      } else {
+        if (this.data.bikeInfo.is_link == 0) {
+          my.alert({
+            title: '提示',
+            content: '当前车子已下线请换辆车子骑行吧~',
+            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.alertal({
+            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;
+        }
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  //骑行区禁停区车辆
+  home: function () {
+    //请求首页接口和一些设置。
+    var that = this;
+    if (that.data.longitude != '' && that.data.latitude != '') {
+      //116.411027
+      var data = {
+        'lat': that.data.latitude,
+        'lng': that.data.longitude,
+        'bike_no': that.data.code
+      }
+      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.ban_stop(area_id)
+          that.getNotice(area_id)
+          that.adsList(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
+    that.setData({
+      polygons1: that.data.polygons1.concat(home)
+    })
+
+    let isCache = getCache('BAN_STOP:' + area_id)
+    if (isCache) {
+      that.setData({
+        markers: that.data.markers.concat(isCache.centres),
+        polygons: that.data.polygons1.concat(isCache.polygons),
+      })
+      return
+    }
+
+    var data1 = {
+      'area_id': area_id
+    }
+    app.request('/parking/stop-sites', data1, 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        var data = res.data
+        console.log(data)
+        that.setData({
+          markers: that.data.markers.concat(data.centres),
+          polygons: that.data.polygons1.concat(data.polygons),
+        })
+      }
+    })
+  },
+  //初始化信息
+  chushi: function () {
+    my.showLoading()
+    var that = this;
+    var date = Date.parse(new Date()) / 1000;
+
+    app.request('/pages/ride-order?no=' + that.data.order, '', 'GET').then(res => {
+      console.log(res, ',---------')
+      let setting = my.getStorageSync({
+        'key': 'setting'
+      }).data;
+
+      if (res.status == 200) {
+        my.hideLoading()
+        my.setStorageSync({
+          'key': 'bike_status',
+          data: res.data.status
+        })
+
+        if (res.data.start_use_bike_time <= 0) {
+          that.setData({
+            minute: 0
+          })
+        } else {
+          let cha = date - res.data.start_use_bike_time
+          let setting = my.getStorageSync({
+            'key': 'setting'
+          }).data;
+          var time = parseInt(cha / 60) - setting.starting_price_time;
+          var per_money = setting.per_money;
+          var per_minute = setting.per_minute;
+          // console.log('测试1',times)
+          //页面进来时初始化金额
+
+          // let money = parseFloat(parseFloat(time / per_minute * per_money + parseFloat(setting.starting_price)).toFixed(2));
+          let money = parseInt(time / per_minute) * per_money + parseFloat(setting.starting_price)
+
+          var hour = Math.floor(cha / 3600 % 24);
+          // 分钟
+          var minute = Math.floor(cha / 60 % 60);
+          // let hour = parseInt(cha / 3600)
+          console.log(hour, 'hour')
+          console.log(minute, 'hour')
+          hour = hour < 10 ? '0' + hour : hour
+          minute = minute < 10 && hour > 0 ? '0' + minute : minute
+          if (hour > 0) {
+            // let minute=
+
+            that.setData({
+              minute: date - res.data.start_use_bike_time,
+              times: hour + ":" + minute,
+              estimate_money: money,
+              isHour: true
+            })
+          } else {
+            // let minute = parseInt(cha / 60)
+            that.setData({
+              minute: date - res.data.start_use_bike_time,
+              times: minute,
+              estimate_money: money,
+              isHour: false
+            })
+          }
+
+          // that.setData({
+          //   minute: date - res.data.start_use_bike_time
+          // })
+        }
+        that.terval()
+        my.showToast({
+          content: '刷新成功',
+          icon: 'none'
+        })
+        that.setData({
+          data: res.data,
+          code: res.data.bike_no,
+          temporaryTime: res.data.pause_bike_time
+        })
+        let userStatus = my.getStorageSync({
+          'key': 'userState'
+        }).data;
+        let setting = my.getStorageSync({
+          'key': 'setting'
+        }).data;
+        let bike_status = my.getStorageSync({
+          'key': 'bike_status'
+        }).data;
+        console.log('pppppppp---------------------vyvyvyvy')
+        //有正在骑行中的订单的订单
+        if (userStatus.is_ride_order != false && bike_status == 1) {
+          //骑行中
+          console.log('ppppp')
+          that.setData({
+            steps: 3
+          })
+          my.setStorageSync({
+            'key': 'nowBikeStatus',
+            data: 0
+          })
+          //   that.reloadMap()
+        } else if (bike_status == 0 && userStatus.is_ride_order != false) {
+          // 临时停车
+          that.setData({
+            parkStatus: 1,
+            steps: 3
+          })
+          my.setStorageSync({
+            'key': 'nowBikeStatus',
+            data: 1
+          })
+          //  that.reloadMap()
+          that.stopDownTime()
+        }
+        app.request('/bike/' + that.data.code, '', 'GET').then(res => {
+          console.log(res)
+          200 == res.status && that.setData({
+            battery_power: res.data.battery_power,
+            box_no: res.data.box_no,
+            bikeMessage: res.data,
+          })
+        })
+        if (res.data.status == 0) {
+          that.setData({
+            bolear: 0
+          })
+        } else if (res.data.status == 1) {
+          that.setData({
+            bolear: 1
+          })
+        } else if (res.data.status == 2) {
+          clearInterval(interval),
+            // clearInterval(interval1);
+            clearInterval(locationTerval);
+          my.reLaunch({
+            url: '../payment/payment?order=' + res.data.no
+          })
+        } else {
+          my.reLaunch({
+            url: '../index/index',
+          })
+        }
+        // that.bikeLocation();
+      }
+    }).catch(err => {
+      console.log(err)
+    })
+  },
+  //获取当前位置
+  posiLoca: function () {
+    var that = this;
+    my.showLoading({
+      content: '正在定位...',
+      icon: 'none'
+    })
+    // locationTerval = setInterval(function () {
+    my.getLocation({
+      type: 'gcj02',
+      success: (res) => {
+        var latitude = res.latitude
+        var longitude = res.longitude
+        my.hideLoading()
+        that.setData({
+          longitude: longitude,
+          latitude: latitude,
+        })
+        that.home()
+      },
+      fail: function (err) {
+        my.hideLoading()
+        if (err.error == 11) {
+          my.showAuthGuide({
+            authType: 'LBS',
+            success: (res) => {
+
+            },
+            fail: (error) => {
+              my.alert({
+                content: '获取位置授权失败'
+              });
+            },
+          })
+        }
+        my.getSetting({
+          success: function (res) {
+            // console.log(res)
+            var statu = res.authSetting;
+            if (statu['scope.userLocation'] == false) {
+              that.setData({
+                background: true,
+                location: true
+              })
+            }
+          }
+        })
+      }
+    })
+
+  },
+  //获取蓝牙秘钥
+  getSecretKey(box_no) {
+    //     if (!box_no) box_no = this._bikeMainId
+    //     let that = this;
+    //     if(box_no== my.getStorageSync('box_no')) return;
+    return new Promise(function (res, rej) {
+      let param = {
+        box_no: box_no, //我公司是通过设备编号获取的密钥
+      };
+      app.request('/blu/get-key', param, 'GET').then(resp => {
+        key = resp.data.key
+        res(resp.data.key);
+        my.setStorageSync({
+          'key': 'box_no',
+          data: box_no
+        })
+      })
+    });
+  },
+  //行车时间计时
+  terval: function () {
+    var that = this;
+    clearInterval(interval)
+    clearInterval(huancheTime)
+    var times = ''; //秒数
+    var minute = Math.round(that.data.minute / 60); //分钟
+    var minute1 = '0'; //分钟
+    var hour = 0; //小时
+    var hour1 = '0'; //小时
+    var time = that.data.minute //获取当前已骑行的秒数
+    var setting = my.getStorageSync({
+      'key': 'setting'
+    }).data;
+
+    if (time > 60) { //秒数大于60 分钟= 秒数/60  秒数=  -1*60  40
+      minute = parseInt(time / 60);
+      times = time - minute * 60;
+      //minute代表分钟  times 代表秒数
+    } else {
+      minute = parseInt(time / 60);
+      times = time;
+    }
+    interval = setInterval(function () {
+      //定时器 秒数一秒加1
+      minute++
+      if (minute < 10 && hour > 0) { //如果分钟小于10 加一个0
+        minute1 = '0' + minute
+      } else {
+        minute1 = minute
+      }
+      if (minute > 59) {
+        //分钟大于59 让小时+1
+        hour = parseInt(minute / 60)
+        minute1 = minute - hour * 60;
+        if (hour < 10) {
+          hour1 = '0' + hour;
+        } else {
+          hour1 = hour
+        }
+      }
+      if (minute1 < 10 && hour > 0) { //如果分钟小于10 加一个0
+        minute1 = '0' + minute1
+      } else {
+        minute1 = minute1
+      }
+      if (hour > 0) {
+        // //如果小时大于0 显示 时分
+        that.setData({
+          times: hour1 + ':' + minute1,
+          isHour: true
+        })
+      } else {
+        // //else 显示 分秒
+        that.setData({
+          times: minute1,
+          isHour: false
+        })
+      }
+      // that.setData({ times: minute1 + ':' + times})
+      //计算钱   分钟除以5*5   判断秒数>30  minute = minute+1
+      //不满12分钟按12分钟算   并且大于30秒   
+      var per_money = setting.per_money;
+      var per_minute = setting.per_minute;
+      // console.log(minute)
+      // console.log(minute1)
+      if (setting.starting_price_time > minute) {
+        that.setData({
+          estimate_money: setting.starting_price
+        })
+      } else {
+
+        //起步价+(分钟数-起步时长)/ 一块钱可骑多少分钟 * 钱数
+        var time = minute - setting.starting_price_time;
+        // console.log('测试1',times)
+        //页面进来时初始化金额
+
+        // let money = Math.round(time / per_minute) * per_money + parseFloat(setting.starting_price)
+        let money = parseInt(time / per_minute) * per_money + parseFloat(setting.starting_price)
+        that.setData({
+          estimate_money: money,
+          onload: true
+        })
+      }
+    }, 60000)
+  },
+
+  //获取车辆信息
+  getBikeMessage: function () {
+    my.showLoading()
+    var that = this;
+    app.request('/bike/' + that.data.code, '', 'GET').then(res => {
+      console.log(res, '车辆信息--------------------')
+      machineNO = res.data.box_no
+      my.hideLoading()
+      if (res.status == 200) {
+        that.setData({
+            bikeMessage: res.data,
+            battery_power: res.data.battery_power,
+            steps: 1
+          }),
+          key = res.data.key
+      } else {
+        setTimeout(function () {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }, 2000)
+
+      }
+    })
+
+  },
+  //检测用户是否完成实名认证,是否有待支付订单违章记录等
+  jiance: function () {
+    let that = this
+    var userStatus = my.getStorageSync({
+      'key': 'userState'
+    }).data;
+    var setting = my.getStorageSync({
+      'key': 'setting'
+    }).data;
+    console.log(userStatus, '旭颖')
+    console.log(setting, '旭颖')
+    if (userStatus.is_bind_mobile == 0) {
+      my.navigateTo({
+        url: '/pages/authorization/authorization',
+      })
+      //未实名认证
+    } else
+    if (userStatus.is_card_certified == 0 && setting.is_card == 1) {
+      my.navigateTo({
+        url: '/pages/real_name/real_name',
+      })
+    } //是否缴纳押金 
+    else if (userStatus.is_deposit == 0 && setting.is_deposit != 0 && userStatus.is_coupon_deposit_free == false) {
+      my.navigateTo({
+        url: '/pages/ride_zige/ride_zige',
+      })
+    } else if (userStatus.is_ride_order != false) {
+      my.alert({
+        title: '提示',
+        content: '您有一个正在骑行中的订单',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+    } else if (userStatus.is_pay_order != false && userStatus.is_pay_order != undefined) {
+      my.alert({
+        title: '提示',
+        content: '您有一个待支付订单,请先支付',
+        success: function (res) {
+          my.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      })
+    } else {
+      that.setData({
+        steps: 2
+      })
+      //   this.reloadMap()
+    }
+
+
+
+  },
+
+
+
+  reloadMap(classname = 'use-bike-bottom') {
+    let query = my.createSelectorQuery();
+    let th = this;
+    query.select('.' + classname).boundingClientRect(function (rect) {
+      if (rect != null && rect instanceof Object && rect.hasOwnProperty('height')) {
+        let height = rect.height || 300;
+        th.setData({
+          mapHeight: 'calc(100vh - ' + (height) + 'px)'
+        });
+      } else {
+        let height = 300;
+        th.setData({
+          mapHeight: 'calc(100vh - ' + height + 'px)'
+        });
+      }
+    }).exec();
+  },
+  //倒计时
+
+  //临时停车倒计时
+  stopDownTime() {
+    // let that = this
+    // let endTime = Date.parse(new Date()); //date日期类型
+    // let startTime
+    // if (!that.data.temporaryTime || that.data.temporaryTime == null) {
+    //   startTime = endTime
+    // } else {
+    //   let data1 = that.data.temporaryTime
+    //   let data2 = data1.replace(/-/g, '/')
+    //   let data3 = new Date(data2)
+    //   startTime = data3.getTime()
+    // }
+    // let totleTime = 1800
+    // clearInterval(linshiStop)
+    // console.log(endTime, 'endTime')
+    // console.log(startTime, 'startTime')
+    // let date3 = endTime - startTime;
+    // console.log(date3, 'date3')
+    // //计算出相差天数
+    // var days = Math.floor(date3 / (24 * 3600 * 1000));
+    // //计算出小时数
+    // var leave1 = date3 % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
+    // var hours = Math.floor(leave1 / (3600 * 1000));
+    // //计算相差分钟数
+    // var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
+    // var minutes = Math.floor(leave2 / (60 * 1000));
+    // //计算相差秒数
+    // var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
+    // var seconds = Math.round(leave3 / 1000);
+    // console.log(minutes, 'minutes')
+
+    // let chaTime = totleTime - minutes * 60
+    // console.log(chaTime, 'chaTime')
+    // linshiStop = setInterval(function () {
+    //   let test = 30 * 60 * 1000
+    //   console.log(test, 'test')
+    //   if (date3 > test) {
+    //     that.setData({
+    //       stopMiao: 0,
+    //       stopmMinute: 0
+    //     })
+    //     clearInterval(linshiStop)
+    //   } else if (chaTime <= 0) {
+    //     that.setData({
+    //       stopMiao: 0,
+    //       stopmMinute: 0
+    //     })
+    //     clearInterval(linshiStop)
+    //   } else {
+    //     console.log(minutes, 'pppp')
+    //     chaTime--
+
+    //     let fen = parseInt(chaTime / 60);
+    //     let miao = parseInt(chaTime % 60);
+    //     that.setData({
+    //       stopMiao: miao,
+    //       stopmMinute: fen
+    //     })
+    //   }
+
+    // }, 1000)
+
+  },
+  //开锁方法
+  openBike() {
+    var that = this;
+    my.showLoading({
+      content: '开锁中...',
+      mask: true
+    })
+    var data = {
+      bike_no: that.data.code,
+      lat: that.data.latitude,
+      lng: that.data.longitude,
+      area_id: my.getStorageSync({
+        'key': 'home'
+      }).data.id,
+    }
+    app.request('/bike/open-lock', data, 'POST').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        that.setData({
+          steps: 3,
+          order: res.data.no
+        })
+        that.terval()
+        //蓝牙开锁
+        operateType = 'open'
+        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+          bluetoothOperate.end((flag) => {});
+        });
+        my.hideLoading()
+      } else {
+        // that.setData({
+        //   steps: 3
+        // })
+        // that.terval()
+      }
+    })
+
+
+  },
+  //开锁失败重试开锁
+  retryOpenBike: function () {
+    var that = this;
+    console.log('重试开锁')
+    //蓝牙重试开锁
+    my.showLoading({
+      content: '开锁中...',
+      mask: true
+    })
+
+    let data = {
+      order_no: that.data.order,
+      bike_no: that.data.code
+    }
+    app.request('/order/retry-open-lock', data, 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        my.hideLoading()
+        if (res.data.status == 1) {
+          that.setData({
+            frame: false
+          })
+          my.hideLoading()
+          operateType = 'open'
+          bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+            bluetoothOperate.end((flag) => {});
+          });
+          my.showToast({
+            content: '开锁成功',
+            icon: 'none'
+          })
+        }
+      }
+    })
+  },
+  openBikeClick: function () {
+    let that = this
+    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 () {
+    //点击去设置位置权限
+    this.setData({
+      background: false,
+      location: false
+    })
+    my.openSetting({
+      success: function (res) {}
+    })
+  }, 1500),
+  //点击已开启位置权限
+  open: util.throttle(function () {
+    this.setData({
+      background: false,
+      location: false
+    })
+  }, 1500),
+  //寻铃
+  clickBell: util.throttle(function (e) {
+    //点击响铃
+    var that = this;
+    my.showLoading({
+      content: '找车中...',
+      mask: true
+    })
+
+    app.request('/order/retry-bell-lock?order_no=' + that.data.order + '&bike_no=' + that.data.code, '', 'GET').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        //蓝牙寻铃找车
+        operateType = 'bell'
+        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+          //flag == true 操作成功
+          //flag == false 操作失败
+          //end
+          bluetoothOperate.end((flag) => {});
+        });
+        res.data.is_ok == true && my.showToast({
+          content: '找车成功',
+          icon: 'none',
+          duration: 2000
+        })
+        res.data.is_ok == false && my.showToast({
+          content: '找车失败请重试',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  }, 1000),
+  //立即开锁
+  konwOpenBike: util.throttle(function () {
+    var that = this;
+    // that.jiance()
+    if (that.data.deposit == true) return;
+    that.openBike()
+  }, 1000),
+  //临时锁车
+  parkBike: function () {
+
+    let that = this
+    my.showLoading({
+      content: '正在临时锁车',
+    })
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+
+    //代表要临时停车
+    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
+          bluetoothOperate.end((flag) => {});
+        });
+        my.showToast({
+          content: '停车成功',
+          icon: 'none'
+        })
+        that.setData({
+          parkStatus: 1,
+          // nowBikeStatus:1
+        })
+        my.setStorageSync({
+          'key': 'nowBikeStatus',
+          data: 1
+        })
+        that.stopDownTime()
+        // that.getBikeMessage()
+      } else if (res.status == 450) {
+        my.showToast({
+          content: '运动中不能关锁,请稍后重试',
+          icon: 'none',
+          duration: 5000,
+          mask: true
+        })
+        my.hideLoading()
+      }
+    })
+  },
+  //结束临时锁车
+  openPark: function () {
+    let that = this
+    my.showLoading({
+      content: '解锁中',
+    })
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+    // clearInterval(inter1)
+
+    app.request('/bike/temporary-open-lock', data, 'POST').then(res => {
+      // that.inter1()
+      if (res.status == 200) {
+        my.hideLoading()
+        // 蓝牙临时开车
+        operateType = 'temporaryOpen'
+        bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+          //flag == true 操作成功
+          //flag == false 操作失败
+          //end
+          bluetoothOperate.end((flag) => {});
+        });
+        my.showToast({
+          content: '开车成功',
+          icon: 'none'
+        })
+        clearInterval(linshiStop)
+        my.setStorageSync({
+          'key': 'stopMiao',
+          data: 0
+        })
+        my.setStorageSync({
+          'key': 'stopmMinute',
+          data: 30
+        })
+        that.setData({
+          stopMiao: 0,
+          stopmMinute: 30,
+          parkStatus: 0,
+          nowBikeStatus: 0
+        })
+        my.setStorageSync({
+          'key': 'nowBikeStatus',
+          data: 0
+        })
+      }
+    })
+
+  },
+  endUseBike: function () {
+    let that = this
+    my.showLoading({
+      content: '加载中...'
+    })
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+
+    app.request('/order/expect-order-money', data, 'POST').then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        my.hideLoading()
+        let data = res.data.dispatch_money
+        res.data.time_money = parseFloat(res.data.time_money)
+        let data1 = parseFloat(data)
+        console.log(data1, 'ppppppppppppppppppp')
+        that.setData({
+          dispatch_money: data1,
+          money: res.data,
+          chaButton: 1,
+          parkStatus: 2
+        })
+
+      }
+    })
+  },
+  //确定结束用车
+  sureEndUseBike: util.throttle(function () {
+  
+    if(this.data.dispatch_money!=0){
+      this.setData({popShow:true})
+    }else{
+      this.huanche()
+    }
+    
+  }, 1000),
+  huanche(){
+    //还车接口
+    my.showLoading({
+      content: '结算中...',
+      mask: true
+    })
+    var that = this;
+    var data = {
+      bike_no: that.data.code,
+      order_no: that.data.order,
+      lat: that.data.latitude,
+      lng: that.data.longitude
+    }
+    app.request('/bike/close-lock', data, 'POST').then(res => {
+      console.log(res)
+      my.hideLoading()
+      if (res.status == 200) {
+        console.log(res, '结束用车')
+        clearInterval(linshiStop);
+        clearInterval(interval);
+        my.setStorageSync({
+          'key': 'stopMiao',
+          data: 0
+        })
+        my.setStorageSync({
+          'key': 'stopmMinute',
+          data: 30
+        })
+        my.hideNavigationBarLoading(), my.hideLoading()
+        my.reLaunch({
+          url: '../pay/pay?order=' + res.data.no
+        })
+        //蓝牙锁车操作 确定结束用车
+        if (machineNO && key) {
+          operateType = 'close'
+          bluetoothOperate.start(operateType, machineNO, key, (flag) => {
+            //flag == true 操作成功
+            //flag == false 操作失败
+            //end
+            //订单结束关闭蓝牙
+            bluetoothOperate.end((flag) => {});
+          });
+        }
+
+      } else if (res.status == 450) {
+        my.showToast({
+          content: '运动中不能关锁,请稍后重试',
+          icon: 'none',
+          duration: 5000,
+          mask: true
+        })
+      }
+    }).catch(err => {
+      my.showToast({
+        content: '关锁失败,请重试。',
+        icon: 'none',
+        duration: 5000,
+      })
+      my.hideLoading()
+    })
+  },
+  //取消锁车
+  cancelEndBike: function () {
+    console.log(my.getStorageSync({
+      'key': 'nowBikeStatus'
+    }).data)
+    let that = this
+    that.setData({
+      chaButton: 0,
+      dispatch_money: 0,
+      parkStatus: my.getStorageSync({
+        'key': 'nowBikeStatus'
+      }).data
+    })
+    // that.reloadMap()
+  },
+  //计价规则
+  chargeRule: function () {
+    my.navigateTo({
+      url: '/pages/charge_rule/charge_rule',
+    })
+  },
+  //骑行须知
+  bikeKnow: function () {
+    my.navigateTo({
+      url: '/pages/ride_rule/ride_rule',
+    })
+  },
+
+  popHide(){
+    //取消继续还车
+    this.setData({popShow:false})
+  },
+  //骑行优惠券
+  bikeCoupon: function () {
+    my.navigateTo({
+      url: '/pages/buy-card/buy-card',
+    })
+  },
+  //客服
+  keFu: function () {
+    my.makePhoneCall({
+      number: my.getStorageSync({
+        'key': 'home'
+      }).data.customer_service_phone,
+    })
+  },
+  //车辆为未开锁弹框
+  //打开
+  frameClose: function () {
+    let that = this
+    that.setData({
+      frame: false
+    })
+    //  that.reloadMap()
+  },
+  //关闭弹框
+  frameShow: function () {
+    let that = this
+    that.setData({
+      frame: true
+    })
+    that.reloadMap('frame')
+  },
+  //故障上报
+  guzhang: function () {
+    this.setData({
+      frame: false,
+    })
+    // this.reloadMap()
+    my.navigateTo({
+      url: '/pages/breakdown/breakdown',
+    })
+  },
+  //附近还车点
+  findPark: function () {
+    my.navigateTo({
+      url: '/pages/parking/parking',
+    })
+  },
+  onHide: function () {
+    console.log('onHide5555')
+    // clearInterval(testToken
+    clearInterval(mytime)
+    clearInterval(interval)
+    bluetoothOperate.end((flag) => {});
+  },
+  onUnload: function () {
+    clearInterval(locationTerval)
+    bluetoothOperate.end((flag) => {});
+    // 停止位置跟踪
+    // my.stopLocationUpdate({
+    //   success: (res) => {
+    //     console.log("onUnload stopLocationUpdate success", res)
+    //   },
+    //   fail: (err) => {
+    //     console.log("onUnload stopLocationUpdate fail", err)
+    //   }
+    // })
+  },
+  //返回首页
+  backHome() {
+    my.reLaunch({
+      url: '/pages/index/index',
+    })
+  },
+  //关闭中间广告弹框
+  closeAdframe: function () {
+    this.setData({
+      adFrame: false
+    })
+  },
 })

+ 3 - 3
pages/use_bike/use_bike.json

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

+ 24 - 24
pages/user_rules/user_rules.acss

@@ -1,24 +1,24 @@
-/* required by usingComponents */
-/* pages/user_rules/user_rules.wxss */
-page{
-  height: 100%
-}
-.use_rule{
-  padding:0 30rpx;
-}
-.rule-title{
-  font-size: 34rpx;
-  font-weight: bold;
-  height: 100rpx;
-  margin-top: 30rpx;
-  line-height: 100rpx;
-}
-.title{
-  font-size: 32rpx;
-  font-weight: 500;
-  margin:  30rpx 0;
-}
-.text{
-  font-size: 28rpx;
-  color: #636363;
-}
+/* required by usingComponents */
+/* pages/user_rules/user_rules.wxss */
+page{
+  height: 100%
+}
+.use_rule{
+  padding:0 30rpx;
+}
+.rule-title{
+  font-size: 34rpx;
+  font-weight: bold;
+  height: 100rpx;
+  margin-top: 30rpx;
+  line-height: 100rpx;
+}
+.title{
+  font-size: 32rpx;
+  font-weight: 500;
+  margin:  30rpx 0;
+}
+.text{
+  font-size: 28rpx;
+  color: #636363;
+}

+ 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">
-    使用“禹”见你电单车服务并结束后,若用户账户内有满足使用规则的骑行卡,用户可在车费支付时使用该骑行卡。
-  </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>

+ 115 - 115
pages/weizhang/weizhang.acss

@@ -1,116 +1,116 @@
-/* required by usingComponents */
-
-.image{
-  position: absolute;
-  top: 0;
-  right: 0;
-}
-.none{
-  width: 100%;
-  height: 75%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  padding-top: 45%;
-}
-.none text{
-  padding-top: 30rpx;
-  color: #18D5B9;
-  font-size: 30rpx;
-}
-page{
-  background-color: #f2f3f5;
-  padding-top: 10rpx;
-  
-}
-.trip-list{
-margin: 0 20rpx;
-}
-.trip-list-item{
-  border-radius: 6rpx;
-  margin-top: 30rpx;
-  background-color: #ffffff;
-  padding: 20rpx;
-  font-size: 28rpx;
-}
-.title{
-  display: flex;
-}
-.title-left{
-  flex: 1;
-}
-.title-right{
-  flex: 1;
-  text-align: right;
-  color: #999999;
-}
-.time{
- margin-top: 20rpx;
- margin-bottom: 20rpx;
-
-}
-.place{
- margin-top: 10rpx;
-}
-.time-image{
-  display: inline-block;
-  vertical-align: middle;
-  height: 30rpx;
-width: 30rpx;
-}
-.time-text{
-  display: inline-block;
-  vertical-align: middle;
-  margin-left: 20rpx;
-
-}
-.time-right{
-  display: inline-block;
-  vertical-align: middle;
- float:right;
-}
-.dizhi{
-  display: flex;
-  position: relative;
-}
-.dizhi-left{
- flex: 0 0 30rpx; 
-}
-.dizhi-right{
-  flex: 1;
-  margin-left: 20rpx;
-}
-.dian1{
-  height: 15rpx;
-  width: 15rpx;
-  border-radius: 50%;
-  margin-top:20rpx;
-  margin-left: 10rpx;
-  background-color: #38df49;
-}
-.dian2{
-  height:15rpx;
-  width: 15rpx;
-  margin-top:30rpx;
-  margin-left: 10rpx;
-
-  border-radius: 50%;
-  background-color: #fd9b1c;
-  
-}
-.xian{
-  border-right: solid 1rpx #999999;
-  height: 30rpx;
-  position: absolute;
-  left: 16rpx;
-top: 35rpx;
-}
-.more{
-text-align: center;
-font-size: 26rpx;
-color: #999999;
-height: 100rpx;
-line-height:100rpx;
-margin-top: 30rpx;
+/* required by usingComponents */
+
+.image{
+  position: absolute;
+  top: 0;
+  right: 0;
+}
+.none{
+  width: 100%;
+  height: 75%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding-top: 45%;
+}
+.none text{
+  padding-top: 30rpx;
+  color: #18D5B9;
+  font-size: 30rpx;
+}
+page{
+  background-color: #f2f3f5;
+  padding-top: 10rpx;
+  
+}
+.trip-list{
+margin: 0 20rpx;
+}
+.trip-list-item{
+  border-radius: 6rpx;
+  margin-top: 30rpx;
+  background-color: #ffffff;
+  padding: 20rpx;
+  font-size: 28rpx;
+}
+.title{
+  display: flex;
+}
+.title-left{
+  flex: 1;
+}
+.title-right{
+  flex: 1;
+  text-align: right;
+  color: #999999;
+}
+.time{
+ margin-top: 20rpx;
+ margin-bottom: 20rpx;
+
+}
+.place{
+ margin-top: 10rpx;
+}
+.time-image{
+  display: inline-block;
+  vertical-align: middle;
+  height: 30rpx;
+width: 30rpx;
+}
+.time-text{
+  display: inline-block;
+  vertical-align: middle;
+  margin-left: 20rpx;
+
+}
+.time-right{
+  display: inline-block;
+  vertical-align: middle;
+ float:right;
+}
+.dizhi{
+  display: flex;
+  position: relative;
+}
+.dizhi-left{
+ flex: 0 0 30rpx; 
+}
+.dizhi-right{
+  flex: 1;
+  margin-left: 20rpx;
+}
+.dian1{
+  height: 15rpx;
+  width: 15rpx;
+  border-radius: 50%;
+  margin-top:20rpx;
+  margin-left: 10rpx;
+  background-color: #38df49;
+}
+.dian2{
+  height:15rpx;
+  width: 15rpx;
+  margin-top:30rpx;
+  margin-left: 10rpx;
+
+  border-radius: 50%;
+  background-color: #fd9b1c;
+  
+}
+.xian{
+  border-right: solid 1rpx #999999;
+  height: 30rpx;
+  position: absolute;
+  left: 16rpx;
+top: 35rpx;
+}
+.more{
+text-align: center;
+font-size: 26rpx;
+color: #999999;
+height: 100rpx;
+line-height:100rpx;
+margin-top: 30rpx;
 }

+ 83 - 83
pages/weizhang/weizhang.js

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

+ 77 - 77
pages/weizhang_detail/weizhang_detail.acss

@@ -1,78 +1,78 @@
-/* required by usingComponents */
-page{
-  height: 100%;
-  background: #F4F4F4;
-}
-.box{
-  width: 100%;
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
-.text1{
-  font-size:32rpx;
-  font-family:PingFang SC;
-  font-weight:400;
-  width: 82%;
-  padding-top: 63rpx;
-}
-.text2{
-  font-size:32rpx;
-  font-family:PingFang SC;
-  font-weight:400;
-  width: 82%;
-  padding: 32rpx 0rpx;
-  border-bottom: 2rpx solid #D5D5D5;
-}
-.view1{
-  display: flex;
-  width: 82%;
-  padding: 31rpx 0rpx;
-  border-bottom: 2rpx solid #D5D5D5;
-  justify-content: flex-start;
-}
-.view1 text{
-  font-size:32rpx;
-  font-family:PingFang SC;
-  font-weight:400;
-}
-.view1 text:nth-of-type(1){
-  width: 27%;
-}
-.view1 text:nth-of-type(2){
-  width: 73%;
-}
-.view2{
-  display: flex;
-  justify-content: space-between;
-  width: 82%;
-  font-size:32rpx;
-  font-family:PingFang SC;
-  font-weight:400;
-  /* color:rgba(255,71,71,1); */
-  padding: 31rpx 0rpx;
-  border-bottom: 2rpx solid #D5D5D5;
-}
-.text3{
-  font-size:26rpx;
-  font-family:PingFang SC;
-  font-weight:500;
-  color:rgba(56,60,63,1);
-  padding: 40rpx 0rpx;
-}
-.view3{
-  width:100%;
-  height:94rpx;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size:36rpx;
-  font-family:PingFang SC;
-  font-weight:400;
-  background: #ff0000;
-  color: white;
-  position: fixed;
-  bottom: 0;
-  left: 0;
+/* required by usingComponents */
+page{
+  height: 100%;
+  background: #F4F4F4;
+}
+.box{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+.text1{
+  font-size:32rpx;
+  font-family:PingFang SC;
+  font-weight:400;
+  width: 82%;
+  padding-top: 63rpx;
+}
+.text2{
+  font-size:32rpx;
+  font-family:PingFang SC;
+  font-weight:400;
+  width: 82%;
+  padding: 32rpx 0rpx;
+  border-bottom: 2rpx solid #D5D5D5;
+}
+.view1{
+  display: flex;
+  width: 82%;
+  padding: 31rpx 0rpx;
+  border-bottom: 2rpx solid #D5D5D5;
+  justify-content: flex-start;
+}
+.view1 text{
+  font-size:32rpx;
+  font-family:PingFang SC;
+  font-weight:400;
+}
+.view1 text:nth-of-type(1){
+  width: 27%;
+}
+.view1 text:nth-of-type(2){
+  width: 73%;
+}
+.view2{
+  display: flex;
+  justify-content: space-between;
+  width: 82%;
+  font-size:32rpx;
+  font-family:PingFang SC;
+  font-weight:400;
+  /* color:rgba(255,71,71,1); */
+  padding: 31rpx 0rpx;
+  border-bottom: 2rpx solid #D5D5D5;
+}
+.text3{
+  font-size:26rpx;
+  font-family:PingFang SC;
+  font-weight:500;
+  color:rgba(56,60,63,1);
+  padding: 40rpx 0rpx;
+}
+.view3{
+  width:100%;
+  height:94rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size:36rpx;
+  font-family:PingFang SC;
+  font-weight:400;
+  background: #ff0000;
+  color: white;
+  position: fixed;
+  bottom: 0;
+  left: 0;
 }/* pages/weizhang_detail/weizhang_detail.wxss */

+ 79 - 79
pages/weizhang_detail/weizhang_detail.js

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

+ 73 - 73
project.config.json

@@ -1,74 +1,74 @@
-{
-  "description": "项目配置文件",
-  "packOptions": {
-    "ignore": []
-  },
-  "setting": {
-    "urlCheck": true,
-    "es6": true,
-    "enhance": true,
-    "postcss": true,
-    "preloadBackgroundData": false,
-    "minified": true,
-    "newFeature": true,
-    "coverView": true,
-    "nodeModules": false,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "compileHotReLoad": false,
-    "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "enableEngineNative": false,
-    "useIsolateContext": true,
-    "useCompilerModule": true,
-    "userConfirmedUseCompilerModuleSwitch": false,
-    "userConfirmedBundleSwitch": false,
-    "packNpmManually": false,
-    "packNpmRelationList": [],
-    "minifyWXSS": true
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.16.1",
-  "appid": "2021002147603404",
-  "projectname": "%E7%A6%B9%E9%80%94%E5%87%BA%E8%A1%8C",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "scripts": {},
-  "staticServerOptions": {
-    "baseURL": "",
-    "servePath": ""
-  },
-  "isGameTourist": false,
-  "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "plugin": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": []
-    }
-  }
+{
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "enhance": true,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "enableEngineNative": false,
+    "useIsolateContext": true,
+    "useCompilerModule": true,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.16.1",
+  "appid": "2021002147603404",
+  "projectname": "%E7%A6%B9%E9%80%94%E5%87%BA%E8%A1%8C",
+  "debugOptions": {
+    "hidedInDevtools": []
+  },
+  "scripts": {},
+  "staticServerOptions": {
+    "baseURL": "",
+    "servePath": ""
+  },
+  "isGameTourist": false,
+  "condition": {
+    "search": {
+      "list": []
+    },
+    "conversation": {
+      "list": []
+    },
+    "game": {
+      "list": []
+    },
+    "plugin": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": []
+    }
+  }
 }

+ 839 - 839
service/bluetooth.js

@@ -1,840 +1,840 @@
-let dataTransition = require('./dataTransition.js');
-let util = require('./util.js');
-
-/**
- * v2.1.2
- * 胡宇健
- * 注:电池锁等获取设备状态的功能暂只兼容了WA-206的设备
- */
-
-function BluetoothOperate() {
-  let _machineNO = null; //当前类保留的设备编号
-  let _operateType = null; //操作
-  let _discoveryDevicesTimer = null;
-  let _deviceId = null;
-  let _serviceId = 'FEF6'; //UUID 
-  let _characteristicId_notify = null; //读特征值
-  let _characteristicId_write = null; //写特征值
-  let _sequenceId = 10; //流水号
-  let _sendData = ''; //发送的包数据
-  let _dataLen = 0; //数据长度
-  let _systemState = '';
-  let _sequenceId_16 = ''; //流水号16进制
-  let _CRC16 = '';
-  let _dataContent = '';
-  let _connected = false;
-  let _hasReceive = false;
-  let _callBack = null;  //回调函数
-  let _key = ''; //蓝牙密钥
-
-  let _sendCommandTime = 0;
-  let _sendCommandTimer = null; //是否重新发送消息的定时器
-  let _listenerTime = 0;
-  let _listenerTimer = null;
-
-  let _reConnect = 1; //重新连接次数
-  let _logList = []; //日志包
-  let _machineState = []; //设备状态二进制数组
-  let _machineVerson = ''; //设备版本号
-  let _machinevoltage = ''; //设备电压
-
-  this.start = (operateType, machineNO, key, cb) => {
-    _initVariable();  //初始化变量
-    //变量赋值
-    _operateType = operateType;
-    _key = key;
-    _callBack = cb;
-    this.log(machineNO, _machineNO, 'operate:', _operateType); //对比两个设备编号
-    _initBluetooth(() => { //初始化
-      //若存在该设备编号表面与前面的操作一致,直接使用deviceId进行连接
-      if (machineNO == _machineNO && _deviceId && _operateType) {
-        _startConnectDevices(); //进入直接连接步骤
-      } else {
-        _machineNO = machineNO;
-        _deviceId = null;
-        _operate();  //进入搜索步骤
-      }
-    })
-  }
-
-  this.end = (cb) => {
-    my.hideLoading();
-    my.hideToast();
-    if (_sendCommandTimer) {
-      clearTimeout(_sendCommandTimer);
-    }
-    if (_listenerTimer) {
-      clearTimeout(_listenerTimer);
-    }
-    my.disconnectBLEDevice({
-      deviceId: _deviceId,
-      complete: () => {
-        _closeBluetoothAdapter();
-        _stopBluetoothDevicesDiscovery();
-        this.log('结束蓝牙操作!');
-        cb && cb();
-        _initVariable();
-      }
-    })
-  }
-
-  this.getMachineNO = () => {
-    return _machineNO;
-  }
-
-  this.getKey = () => {
-    return _key;
-  }
-
-  this.getLog = () => {
-    return _logList;
-  }
-
-  //获取电池锁状态
-  this.getBatteryLockState = () => {
-    return _machineState[0];
-  }
-
-  //判断电池锁是否开启
-  this.isOpenBatteryLock = () => {
-    if (_machineState[0] == 0)
-      return true;
-    else
-      return false;
-  }
-
-  //获取设备运动状态
-  this.getMotionState = () => {
-    return _machineState[6];
-  }
-
-  //判断设备是否运动中
-  this.isMotion = () => {
-    if (_machineState[6] == 1)
-      return true;
-    else
-      return false;
-  }
-
-  //获取设备借还车状态
-  this.getBorrowState = () => {
-    return _machineState[7];
-  }
-
-  //判断设备是否已借车
-  this.isBorrowed = () => {
-    if (_machineState[7] == 0)
-      return true;
-    else
-      return false;
-  }
-
-  this.getMachinevoltage = () => {
-    return _machinevoltage / 1000;
-  }
-
-  const _initVariable = () => {
-    _operateType = null;
-    _discoveryDevicesTimer = null;
-    _serviceId = 'FEF6';
-    _characteristicId_notify = null;
-    _characteristicId_write = null;
-    _sequenceId = 10;
-    _sendData = '';
-    _dataLen = 0;
-    _systemState = '';
-    _sequenceId_16 = '';
-    _CRC16 = '';
-    _dataContent = '';
-    _connected = false;
-    _hasReceive = false;
-    _callBack = null;
-    _sendCommandTime = 0;
-    _sendCommandTimer = null;
-    _listenerTime = 0;
-    _listenerTimer = null;
-    _logList = [];
-    _reConnect = 1;
-  }
-
-  const _operate = () => {
-    //进入常规搜索流程
-    _deviceId = null; //一旦进入常规搜索流程初始化id,确保中断操作时下一次操作不会误使用该id
-    _startBluetoothDevicesDiscovery();
-  }
-
-  //开启蓝牙搜索,下一步打开监听事件
-  const _startBluetoothDevicesDiscovery = () => {
-    my.startBluetoothDevicesDiscovery({
-      allowDuplicatesKey: false,
-      services: ['FEF6', 'FEF5'],
-      success: (res) => {
-        this.log('蓝牙搜索启用成功!');
-        this.log(res.errMsg);
-        if (res.isDiscovering) {
-          _onBluetoothDeviceFound();
-        } else {
-          this.log('没有开启定位服务', 'isDiscovering = false');
-        }
-      },
-      fail: (err) => {
-        if (err.errMsg.indexOf('not init') > -1) {
-          _initBluetooth(() => {
-            _startBluetoothDevicesDiscovery();
-          });
-        } else {
-          this.end(() => {
-            _callBack && _callBack(false);
-          });
-          this.log('startBluetoothDevicesDiscovery error:', err.errMsg);
-        }
-      }
-    })
-  }
-
-  //蓝牙搜索监听事件
-  const _onBluetoothDeviceFound = () => {
-    _repeatDiscoveryMachine();
-    my.onBluetoothDeviceFound((res) => {
-      let device = res.devices[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) {
-          _stopBluetoothDevicesDiscovery();
-          clearInterval(_discoveryDevicesTimer);
-          _discoveryDevicesTimer = null;
-
-          _deviceId = device.deviceId;
-          this.log('deviceId:', _deviceId);
-          // if (_operateType == 'open' || _operateType == 'close')
-          if (_operateType != '')
-            _startConnectDevices();
-          else
-            _callBack && _callBack(true);
-        }
-      }
-    })
-  }
-
-  //定时器
-  const _repeatDiscoveryMachine = () => {
-    let discoveryDevicesTime = 0;
-    if (_discoveryDevicesTimer) {
-      clearInterval(_discoveryDevicesTimer);
-      _discoveryDevicesTimer = null;
-    }
-    _discoveryDevicesTimer = setInterval(() => {
-      if (discoveryDevicesTime > 14) {
-        clearInterval(_discoveryDevicesTimer);
-        _discoveryDevicesTimer = null;
-        discoveryDevicesTime = 0;
-        my.hideToast();
-        my.hideLoading();
-
-        _stopBluetoothDevicesDiscovery();
-        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)
-  }
-
-  //通过deviceId连接蓝牙设备
-  const _startConnectDevices = () => {
-    if (_deviceId.length > 0) {
-      my.connectBLEDevice({
-        deviceId: _deviceId,
-        timeout: 15000,
-        success: (res) => {
-          this.log('createBLEConnection success:', res.errMsg);
-          if (res.errCode == 0) {
-            _getService();
-          }
-        },
-        fail: (err) => {
-          this.log('createBLEConnection error:', err.errMsg);
-          if (err.errCode != -1 && err.errCode != 10000) {
-            if (err.errCode == 10006 || err.errCode == 10003 || err.errCode == 10012) {
-              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(() => {
-              _startConnectDevices();
-            });
-          } else {
-            this.end(() => {
-              _callBack && _callBack(false);
-            });
-          }
-        },
-        complete: () => {
-
-        }
-      });
-    }
-  }
-
-  //获取所有服务
-  const _getService = () => {
-    _reConnect = 1;
-    // 获取蓝牙设备service值
-    my.getBLEDeviceServices({
-      deviceId: _deviceId,
-      success: (res) => {
-        this.log('获取的所有服务值', res.errMsg);
-        _getCharacter(res.services);
-      },
-      fail: (err) => {
-        this.log('getBLEDeviceServices error', err.errMsg);
-        my.showToast({
-          content: 'service获取失败',
-          icon: 'none',
-        })
-        this.end(() => {
-          _callBack && _callBack(false);
-        });
-      }
-    })
-  }
-
-  //获取特征值
-  const _getCharacter = (services) => {
-    services.forEach((service, index) => {
-      if (service.uuid.indexOf(_serviceId) > -1) {
-        _serviceId = service.uuid;
-        this.log("serviced", _serviceId)
-
-        my.getBLEDeviceCharacteristics({
-          deviceId: _deviceId,
-          serviceId: _serviceId,
-          success: (res) => {
-            this.log('特征值:', res.errMsg);
-            res.characteristics.forEach((item) => {
-              if (item.properties.write)
-                _characteristicId_write = item.uuid;
-              if (!item.properties.write && item.properties.notify)
-                _characteristicId_notify = item.uuid;
-
-            })
-            this.log('特征值读:', _characteristicId_notify, '特征值写:', _characteristicId_write);
-
-            _notifyBLECharacteristicValueChange(() => {
-              _connectCtrl();
-            });
-          },
-          fail: (err) => {
-            this.log('读取特征值失败:' + err.errMsg);
-            this.end(() => {
-              _callBack && _callBack(false);
-            });
-            util.showModal_nocancel('读取特征值失败,请重试。')
-          }
-        })
-        return;
-      }
-    });
-  }
-
-  //秘钥连接指令
-  const _connectCtrl = () => {
-    let secretKey = _key.toString().trim().toLowerCase();
-    //拼接数据头
-    let sequenceId_16 = dataTransition.getSequenceId(_sequenceId);
-    _sequenceId++;
-    let c = secretKey.toString().replace(/\s+/g, "");
-    let cLength = dataTransition.getSecretKeyLength(c);
-    //发送内容
-    let sendValue = `02 00 01 ${cLength}`; //02 连接命令  01连接请求 cLength秘钥长度。
-    let allData = `${sendValue} ${secretKey}`;
-    let header = dataTransition.header(allData, 0, '00', sequenceId_16);
-    let data = header + allData.replace(/\s+/g, "");
-    this.log('发送的连接数据:', data);
-    _sendCtrl(data);
-  }
-
-  //发送指令。判断是否分包发送数据
-  const _sendCtrl = (data) => {
-    //保存一下发送的数据
-    _sendData = data;
-    //如果大于20个字节则分包发送,两个字符一个字节
-    let dataLen = Math.ceil(data.length / 40);
-    if (dataLen > 1) { //3
-      for (let i = 0; i < data.length; i += 40) {
-        let value = dataTransition.hexStringToArrayBuffer(data.slice(i, i + 40));
-        this.log("分包发送的数据", data.slice(i, i + 40))
-        _writeBLECharacteristicValue(value);
-      }
-    } else {
-      let value = dataTransition.hexStringToArrayBuffer(data);
-      _writeBLECharacteristicValue(value);
-    }
-  }
-
-  //发送信息
-  const _writeBLECharacteristicValue = (value, cb) => {
-    setTimeout(() => {
-      my.writeBLECharacteristicValue({
-        deviceId: _deviceId,
-        serviceId: _serviceId,
-        characteristicId: _characteristicId_write,
-        // 这里的value是ArrayBuffer类型
-        value: value,
-        success: (res) => {
-          this.log('发送信息成功', res.errMsg);
-          cb && cb();
-        },
-        fail: (err) => {
-          this.log('writeBLECharacteristicValue error ', err.errMsg);
-          let code = err.errCode;
-          if (code == 10006 || code == 10000) { //连接断开
-            _startConnectDevices();
-          } else if (code == 10008) {
-            this.log('重发数据', dataTransition.ab2hex(value));
-            _writeBLECharacteristicValue(value);
-          } else {
-            util.showModal_nocancel('数据发送失败,请重试。');
-            this.end(() => {
-              _callBack && _callBack(false);
-            });
-          }
-        }
-      })
-    }, 200);
-  }
-
-  //监听事件开启
-  const _notifyBLECharacteristicValueChange = (cb) => {
-    my.notifyBLECharacteristicValueChange({
-      state: true,
-      deviceId: _deviceId,
-      serviceId: _serviceId,
-      characteristicId: _characteristicId_notify,
-      success: () => {
-        if (_listenerTime != -1) { //超时安全判断
-          _listenerTimer = setTimeout(() => {
-            if (_listenerTime == 0) {
-              this.log('未接收到回复信息!自动重发一次!');
-              _listenerTime++;
-              _connectCtrl();
-            } else {
-              my.hideToast();
-              my.hideLoading();
-              my.confirm({
-                content: '未接收到回复信息!',
-                confirmText: '重试',
-                success: (res) => {
-                  if (res.confirm == true) {
-                    my.showToast({
-                      content: '请稍后',
-                      icon: 'loading',
-                      mask: true,
-                      duration: 100000
-                    })
-                    _connectCtrl();
-                  } else {
-                    this.end(() => {
-                      _callBack && _callBack(false);
-                    });
-                  }
-                }
-              })
-            }
-          }, 5000)
-        }
-
-        my.onBLECharacteristicValueChange((res) => {
-          clearTimeout(_listenerTimer);
-          _listenerTime = -1;
-          let data = dataTransition.ab2hex(res.value)
-          this.log('********notify收到的数据:', data);
-          if (data.slice(0, 4) == 'aa10') {
-            this.log('指令发送成功:');
-          } else if (data.slice(0, 4) == 'aa30') {
-            this.log('CRC校验失败');
-            util.showModal_nocancel('CRC校验失败,请重试。');
-            this.end(() => {
-              _callBack && _callBack(false);
-            });
-            //end
-          } else if (data.slice(0, 3) == 'aa0' && _dataLen == 0) {
-            //设备版本号
-            _machineVerson = data.slice(2, 4);
-            //16进制流水号
-            _sequenceId_16 = data.slice(6, 8); //0a
-            //计算数据包长度
-            _dataLen = parseInt(data.slice(8, 12), 16); //003e,16=62
-            //计算systemState
-            _systemState = data.slice(4, 6); //4c
-            _analysisSystem(_systemState);
-            //crc
-            _CRC16 = data.slice(12, 16); //290e
-            this.log("需要接收的字节长度", _dataLen);
-            if (data.length > 16) {
-              _connectData(data.slice(16))
-            }
-          } else {
-            if (_dataLen > 0) {
-              _connectData(data)
-            }
-          }
-        })
-
-        cb && cb();
-      },
-      fail: (err) => {
-        this.log('notifyBLECharacteristicValueChange', err.errMsg);
-        util.showModal_nocancel('特征值监听开启失败,请重试。')
-        this.end(() => {
-          _callBack && _callBack(false);
-        });
-      }
-    })
-  }
-
-  //解析存储车辆状态
-  const _analysisSystem = (systemState) => {
-    //16进制转换为10进制
-    let decimalState = parseInt(systemState, 16);
-    //10进制转换为2进制
-    let binaryState = parseInt(decimalState).toString(2);
-
-    if (binaryState.length < 8) {
-      let supplyNum = 8 - binaryState.length;
-      while (supplyNum > 0) {
-        binaryState = '0' + binaryState;
-        supplyNum--;
-      }
-    }
-
-    //字符串拆分成为数组
-    let stateArray = Array.prototype.slice.call(binaryState);
-
-    _machineState = stateArray;
-    console.log(stateArray);
-  }
-
-  //拼接数据,判断数据并发送
-  const _connectData = (data) => {
-    this.log('拼接内容:', data);
-    _dataContent += data;
-    this.log('内容长度', _dataContent.length, '接收到的数据长度', _dataLen, '*2');
-    if (_dataContent.length == _dataLen * 2) { //接收完该长度的字节和校验CRC成功之后再发送ACK
-      let dc = _dataContent;
-      let dcArr = [];
-      this.log('接收的数据长度字节:', dc.length / 2);
-      let contentArr = dataTransition.addFlagBeforeArr(dataTransition.strAverage2Arr(dc, 2));
-
-      if (parseInt(dataTransition.getCRC16(contentArr), 16) == parseInt(_CRC16, 16)) {
-        this.log('CRC16校验成功');
-        let value = dataTransition.hexStringToArrayBuffer(`aa12${_systemState}${_sequenceId_16}00000000`);
-        this.log(`返回的确认数据${dataTransition.ab2hex(value)}`);
-        //分析数据返回的内容 
-        _analysisBLEContent(dc, value);
-      } else {
-        this.log('CRC16校验失败', dataTransition.getCRC16(contentArr) + "_应为:" + _CRC16);
-        util.showModal_nocancel('CRC16校验失败,请重试。');
-        this.end(() => {
-          _callBack && _callBack(false);
-        });
-        //end
-      }
-
-      _dataLen = 0;
-      _systemState = '';
-      _dataContent = '';
-      _sequenceId_16 = '';
-      _CRC16 = '';
-    }
-  }
-
-  //解析蓝牙发送内容
-  const _analysisBLEContent = (content, reply) => {
-
-    this.log('解析数据数据***************', content);
-    if (content.indexOf('020101') > -1) {
-      if (!_connected) {
-        _connected = true;
-        this.log('连接成功');
-        _writeBLECharacteristicValue(reply, () => {
-          _ctrl(_operateType);
-        });
-        _analysisVoltage(content);
-      }
-    } else if (content.indexOf('0300820100') > -1) {
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      if (!_hasReceive) {
-        _hasReceive = true;
-        _writeBLECharacteristicValue(reply, () => {
-          this.log('开锁成功,开始回调ctrl_cb');
-          this.end(() => {
-            _callBack && _callBack(true);
-          });
-        });
-      }
-    } else if (content.indexOf('0300810100') > -1) {
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      if (!_hasReceive) {
-        _hasReceive = true;
-        _writeBLECharacteristicValue(reply, () => {
-          this.log('上锁成功,开始回调ctrl_cb');
-          this.end(() => {
-            _callBack && _callBack(true);
-          });
-        });
-      }
-    } else if (content.indexOf('0300840100') > -1) {
-      //响铃成功
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      if (!_hasReceive) {
-        _hasReceive = true;
-        _writeBLECharacteristicValue(reply, () => {
-          this.log('响铃成功,开始回调ctrl_cb');
-          this.end(() => {
-            _callBack && _callBack(true);
-          });
-        });
-      }
-    } else if (content.indexOf('0300870100') > -1) {
-      //临时关锁成功
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      if (!_hasReceive) {
-        _hasReceive = true;
-        _writeBLECharacteristicValue(reply, () => {
-          this.log('响铃成功,开始回调ctrl_cb');
-          this.end(() => {
-            _callBack && _callBack(true);
-          });
-        });
-      }
-    } else if (content.indexOf('0300850100') > -1) {
-      //开电池锁成功
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      if (!_hasReceive) {
-        _hasReceive = true;
-        _writeBLECharacteristicValue(reply, () => {
-          this.log('响铃成功,开始回调ctrl_cb');
-          this.end(() => {
-            _callBack && _callBack(true);
-          });
-        });
-      }
-    } else if (content.indexOf('04008524') > -1) {
-      _writeBLECharacteristicValue(reply, () => {
-        this.log('心跳包');
-      });
-    } else if (content.indexOf('020100') > -1) {
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      this.log('鉴权失败:', _sendData);
-      util.showModal_nocancel('鉴权失败!')
-      this.end(() => {
-        _callBack && _callBack(false);
-      });
-      //end
-    } else {
-      if (_sendCommandTimer) { //每次都将清楚等待任务
-        clearTimeout(_sendCommandTimer);
-        _sendCommandTimer = null;
-      }
-      this.end(() => {
-        let text = content === '0300810102' ? '运动中不能上锁!' : '蓝牙操作失败,请重试!';
-        this.log(text)
-        my.showToast({
-          content: text,
-          mask: true,
-          icon: 'none',
-          duration: 5000
-        })
-        _callBack && _callBack(false);
-      })
-    }
-  }
-
-  const _analysisVoltage = (content) => {
-    //判断81 :终端电池电压
-    if (content.indexOf('02010181') > -1) {
-      //这之后两位表示电池电压:81,两位表示长度:02,加上020101共十位
-      let startN = content.indexOf('020101') + 10;
-      //后四位表示电压值:16进制
-      let voltageData = content.slice(startN, startN + 4);
-
-      let voltage = parseInt(voltageData, 16);
-      if (_machineVerson == '02')
-        _machinevoltage = voltage * 10;
-      else
-        _machinevoltage = voltage;
-    }
-  }
-
-  //指令
-  const _ctrl = (type) => {
-    let sequenceId_16 = dataTransition.getSequenceId(_sequenceId);
-    _sequenceId++;
-    let sendData = '';
-    if (type === 'open') //<aa02000b 00057edb 03000201 00 >
-      sendData = '03 00 02 01 00';
-    else if (type === 'close') //<aa02000c 00058036 03000101 01 >
-      sendData = '03 00 01 01 01';
-    else if (type === 'bell') //<aa02000c 00058036 03000101 01 >
-      sendData = '03 00 04 01 01';
-    else if (type === 'batteryOpen') //<aa02000c 00058036 03000101 01 >
-      sendData = '03 00 05 01 01';
-    else if (type === 'temporaryClose') //<aa02000c 00058036 03000101 01 >
-      sendData = '03 00 01 01 30';
-    else if (type === 'temporaryOpen') //<aa02000c 00058036 03000101 01 >
-      sendData = '03 00 01 01 31';
-
-    let header = dataTransition.header(sendData, 0, '00', sequenceId_16);
-    let data = header + sendData.replace(/\s+/g, "");
-
-    this.log(`发送${type}指令`, data);
-    _sendCtrl(data);
-
-    _sendCommandTimer = setTimeout(() => { //可能出现发送消息后没有收到应答,将再次发送
-      if (_sendCommandTime == 0) {
-        this.log('设备未响应,自动重发')
-        _sendCommandTime++;
-        _ctrl(_operateType);
-      } else {
-        this.log('设备未响应')
-        my.hideLoading();
-        util.showModal('设备未响应,是否重新发送指令?', () => {
-          this.log('手动重发ctrl')
-          my.showLoading({
-            content: '开锁中',
-          })
-          _ctrl(_operateType);
-        }, () => {
-          this.end(() => {
-            _callBack && _callBack(false);
-          });
-        })
-      }
-    }, 5000)
-  }
-
-  const _stopBluetoothDevicesDiscovery = () => {
-    my.stopBluetoothDevicesDiscovery({
-      success: (res) => {
-        this.log('停止搜寻附近的蓝牙外围设备');
-      },
-      fail: (err) => {
-        this.log(err.errMsg);
-      }
-    })
-  }
-
-  const _closeBluetoothAdapter = () => {
-    my.closeBluetoothAdapter({
-      success: (res) => {
-        this.log('关闭蓝牙适配器')
-      },
-      fail: (err) => {
-        this.log(err.errMsg);
-      }
-    })
-  }
-
-  const _initBluetooth = (cb) => {
-    my.openBluetoothAdapter({
-      success: (res) => {
-      },
-      fail: (err) => {
-        this.log('initBluetooth:', err.errMsg);
-        // my.showToast({
-        //   content: '蓝牙初始化失败',
-        //   icon: 'none',
-        // })
-      },
-      complete: () => {
-        cb && cb();
-      }
-    })
-  }
-
-  this.log = (...str) => {
-    let now = new Date();
-    now = util.formatTime(now)
-    console.log(now, ...str);
-    _logList.push(str.join(','))
-  }
-}
-
+let dataTransition = require('./dataTransition.js');
+let util = require('./util.js');
+
+/**
+ * v2.1.2
+ * 胡宇健
+ * 注:电池锁等获取设备状态的功能暂只兼容了WA-206的设备
+ */
+
+function BluetoothOperate() {
+  let _machineNO = null; //当前类保留的设备编号
+  let _operateType = null; //操作
+  let _discoveryDevicesTimer = null;
+  let _deviceId = null;
+  let _serviceId = 'FEF6'; //UUID 
+  let _characteristicId_notify = null; //读特征值
+  let _characteristicId_write = null; //写特征值
+  let _sequenceId = 10; //流水号
+  let _sendData = ''; //发送的包数据
+  let _dataLen = 0; //数据长度
+  let _systemState = '';
+  let _sequenceId_16 = ''; //流水号16进制
+  let _CRC16 = '';
+  let _dataContent = '';
+  let _connected = false;
+  let _hasReceive = false;
+  let _callBack = null;  //回调函数
+  let _key = ''; //蓝牙密钥
+
+  let _sendCommandTime = 0;
+  let _sendCommandTimer = null; //是否重新发送消息的定时器
+  let _listenerTime = 0;
+  let _listenerTimer = null;
+
+  let _reConnect = 1; //重新连接次数
+  let _logList = []; //日志包
+  let _machineState = []; //设备状态二进制数组
+  let _machineVerson = ''; //设备版本号
+  let _machinevoltage = ''; //设备电压
+
+  this.start = (operateType, machineNO, key, cb) => {
+    _initVariable();  //初始化变量
+    //变量赋值
+    _operateType = operateType;
+    _key = key;
+    _callBack = cb;
+    this.log(machineNO, _machineNO, 'operate:', _operateType); //对比两个设备编号
+    _initBluetooth(() => { //初始化
+      //若存在该设备编号表面与前面的操作一致,直接使用deviceId进行连接
+      if (machineNO == _machineNO && _deviceId && _operateType) {
+        _startConnectDevices(); //进入直接连接步骤
+      } else {
+        _machineNO = machineNO;
+        _deviceId = null;
+        _operate();  //进入搜索步骤
+      }
+    })
+  }
+
+  this.end = (cb) => {
+    my.hideLoading();
+    my.hideToast();
+    if (_sendCommandTimer) {
+      clearTimeout(_sendCommandTimer);
+    }
+    if (_listenerTimer) {
+      clearTimeout(_listenerTimer);
+    }
+    my.disconnectBLEDevice({
+      deviceId: _deviceId,
+      complete: () => {
+        _closeBluetoothAdapter();
+        _stopBluetoothDevicesDiscovery();
+        this.log('结束蓝牙操作!');
+        cb && cb();
+        _initVariable();
+      }
+    })
+  }
+
+  this.getMachineNO = () => {
+    return _machineNO;
+  }
+
+  this.getKey = () => {
+    return _key;
+  }
+
+  this.getLog = () => {
+    return _logList;
+  }
+
+  //获取电池锁状态
+  this.getBatteryLockState = () => {
+    return _machineState[0];
+  }
+
+  //判断电池锁是否开启
+  this.isOpenBatteryLock = () => {
+    if (_machineState[0] == 0)
+      return true;
+    else
+      return false;
+  }
+
+  //获取设备运动状态
+  this.getMotionState = () => {
+    return _machineState[6];
+  }
+
+  //判断设备是否运动中
+  this.isMotion = () => {
+    if (_machineState[6] == 1)
+      return true;
+    else
+      return false;
+  }
+
+  //获取设备借还车状态
+  this.getBorrowState = () => {
+    return _machineState[7];
+  }
+
+  //判断设备是否已借车
+  this.isBorrowed = () => {
+    if (_machineState[7] == 0)
+      return true;
+    else
+      return false;
+  }
+
+  this.getMachinevoltage = () => {
+    return _machinevoltage / 1000;
+  }
+
+  const _initVariable = () => {
+    _operateType = null;
+    _discoveryDevicesTimer = null;
+    _serviceId = 'FEF6';
+    _characteristicId_notify = null;
+    _characteristicId_write = null;
+    _sequenceId = 10;
+    _sendData = '';
+    _dataLen = 0;
+    _systemState = '';
+    _sequenceId_16 = '';
+    _CRC16 = '';
+    _dataContent = '';
+    _connected = false;
+    _hasReceive = false;
+    _callBack = null;
+    _sendCommandTime = 0;
+    _sendCommandTimer = null;
+    _listenerTime = 0;
+    _listenerTimer = null;
+    _logList = [];
+    _reConnect = 1;
+  }
+
+  const _operate = () => {
+    //进入常规搜索流程
+    _deviceId = null; //一旦进入常规搜索流程初始化id,确保中断操作时下一次操作不会误使用该id
+    _startBluetoothDevicesDiscovery();
+  }
+
+  //开启蓝牙搜索,下一步打开监听事件
+  const _startBluetoothDevicesDiscovery = () => {
+    my.startBluetoothDevicesDiscovery({
+      allowDuplicatesKey: false,
+      services: ['FEF6', 'FEF5'],
+      success: (res) => {
+        this.log('蓝牙搜索启用成功!');
+        this.log(res.errMsg);
+        if (res.isDiscovering) {
+          _onBluetoothDeviceFound();
+        } else {
+          this.log('没有开启定位服务', 'isDiscovering = false');
+        }
+      },
+      fail: (err) => {
+        if (err.errMsg.indexOf('not init') > -1) {
+          _initBluetooth(() => {
+            _startBluetoothDevicesDiscovery();
+          });
+        } else {
+          this.end(() => {
+            _callBack && _callBack(false);
+          });
+          this.log('startBluetoothDevicesDiscovery error:', err.errMsg);
+        }
+      }
+    })
+  }
+
+  //蓝牙搜索监听事件
+  const _onBluetoothDeviceFound = () => {
+    _repeatDiscoveryMachine();
+    my.onBluetoothDeviceFound((res) => {
+      let device = res.devices[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) {
+          _stopBluetoothDevicesDiscovery();
+          clearInterval(_discoveryDevicesTimer);
+          _discoveryDevicesTimer = null;
+
+          _deviceId = device.deviceId;
+          this.log('deviceId:', _deviceId);
+          // if (_operateType == 'open' || _operateType == 'close')
+          if (_operateType != '')
+            _startConnectDevices();
+          else
+            _callBack && _callBack(true);
+        }
+      }
+    })
+  }
+
+  //定时器
+  const _repeatDiscoveryMachine = () => {
+    let discoveryDevicesTime = 0;
+    if (_discoveryDevicesTimer) {
+      clearInterval(_discoveryDevicesTimer);
+      _discoveryDevicesTimer = null;
+    }
+    _discoveryDevicesTimer = setInterval(() => {
+      if (discoveryDevicesTime > 14) {
+        clearInterval(_discoveryDevicesTimer);
+        _discoveryDevicesTimer = null;
+        discoveryDevicesTime = 0;
+        my.hideToast();
+        my.hideLoading();
+
+        _stopBluetoothDevicesDiscovery();
+        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)
+  }
+
+  //通过deviceId连接蓝牙设备
+  const _startConnectDevices = () => {
+    if (_deviceId.length > 0) {
+      my.connectBLEDevice({
+        deviceId: _deviceId,
+        timeout: 15000,
+        success: (res) => {
+          this.log('createBLEConnection success:', res.errMsg);
+          if (res.errCode == 0) {
+            _getService();
+          }
+        },
+        fail: (err) => {
+          this.log('createBLEConnection error:', err.errMsg);
+          if (err.errCode != -1 && err.errCode != 10000) {
+            if (err.errCode == 10006 || err.errCode == 10003 || err.errCode == 10012) {
+              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(() => {
+              _startConnectDevices();
+            });
+          } else {
+            this.end(() => {
+              _callBack && _callBack(false);
+            });
+          }
+        },
+        complete: () => {
+
+        }
+      });
+    }
+  }
+
+  //获取所有服务
+  const _getService = () => {
+    _reConnect = 1;
+    // 获取蓝牙设备service值
+    my.getBLEDeviceServices({
+      deviceId: _deviceId,
+      success: (res) => {
+        this.log('获取的所有服务值', res.errMsg);
+        _getCharacter(res.services);
+      },
+      fail: (err) => {
+        this.log('getBLEDeviceServices error', err.errMsg);
+        my.showToast({
+          content: 'service获取失败',
+          icon: 'none',
+        })
+        this.end(() => {
+          _callBack && _callBack(false);
+        });
+      }
+    })
+  }
+
+  //获取特征值
+  const _getCharacter = (services) => {
+    services.forEach((service, index) => {
+      if (service.uuid.indexOf(_serviceId) > -1) {
+        _serviceId = service.uuid;
+        this.log("serviced", _serviceId)
+
+        my.getBLEDeviceCharacteristics({
+          deviceId: _deviceId,
+          serviceId: _serviceId,
+          success: (res) => {
+            this.log('特征值:', res.errMsg);
+            res.characteristics.forEach((item) => {
+              if (item.properties.write)
+                _characteristicId_write = item.uuid;
+              if (!item.properties.write && item.properties.notify)
+                _characteristicId_notify = item.uuid;
+
+            })
+            this.log('特征值读:', _characteristicId_notify, '特征值写:', _characteristicId_write);
+
+            _notifyBLECharacteristicValueChange(() => {
+              _connectCtrl();
+            });
+          },
+          fail: (err) => {
+            this.log('读取特征值失败:' + err.errMsg);
+            this.end(() => {
+              _callBack && _callBack(false);
+            });
+            util.showModal_nocancel('读取特征值失败,请重试。')
+          }
+        })
+        return;
+      }
+    });
+  }
+
+  //秘钥连接指令
+  const _connectCtrl = () => {
+    let secretKey = _key.toString().trim().toLowerCase();
+    //拼接数据头
+    let sequenceId_16 = dataTransition.getSequenceId(_sequenceId);
+    _sequenceId++;
+    let c = secretKey.toString().replace(/\s+/g, "");
+    let cLength = dataTransition.getSecretKeyLength(c);
+    //发送内容
+    let sendValue = `02 00 01 ${cLength}`; //02 连接命令  01连接请求 cLength秘钥长度。
+    let allData = `${sendValue} ${secretKey}`;
+    let header = dataTransition.header(allData, 0, '00', sequenceId_16);
+    let data = header + allData.replace(/\s+/g, "");
+    this.log('发送的连接数据:', data);
+    _sendCtrl(data);
+  }
+
+  //发送指令。判断是否分包发送数据
+  const _sendCtrl = (data) => {
+    //保存一下发送的数据
+    _sendData = data;
+    //如果大于20个字节则分包发送,两个字符一个字节
+    let dataLen = Math.ceil(data.length / 40);
+    if (dataLen > 1) { //3
+      for (let i = 0; i < data.length; i += 40) {
+        let value = dataTransition.hexStringToArrayBuffer(data.slice(i, i + 40));
+        this.log("分包发送的数据", data.slice(i, i + 40))
+        _writeBLECharacteristicValue(value);
+      }
+    } else {
+      let value = dataTransition.hexStringToArrayBuffer(data);
+      _writeBLECharacteristicValue(value);
+    }
+  }
+
+  //发送信息
+  const _writeBLECharacteristicValue = (value, cb) => {
+    setTimeout(() => {
+      my.writeBLECharacteristicValue({
+        deviceId: _deviceId,
+        serviceId: _serviceId,
+        characteristicId: _characteristicId_write,
+        // 这里的value是ArrayBuffer类型
+        value: value,
+        success: (res) => {
+          this.log('发送信息成功', res.errMsg);
+          cb && cb();
+        },
+        fail: (err) => {
+          this.log('writeBLECharacteristicValue error ', err.errMsg);
+          let code = err.errCode;
+          if (code == 10006 || code == 10000) { //连接断开
+            _startConnectDevices();
+          } else if (code == 10008) {
+            this.log('重发数据', dataTransition.ab2hex(value));
+            _writeBLECharacteristicValue(value);
+          } else {
+            util.showModal_nocancel('数据发送失败,请重试。');
+            this.end(() => {
+              _callBack && _callBack(false);
+            });
+          }
+        }
+      })
+    }, 200);
+  }
+
+  //监听事件开启
+  const _notifyBLECharacteristicValueChange = (cb) => {
+    my.notifyBLECharacteristicValueChange({
+      state: true,
+      deviceId: _deviceId,
+      serviceId: _serviceId,
+      characteristicId: _characteristicId_notify,
+      success: () => {
+        if (_listenerTime != -1) { //超时安全判断
+          _listenerTimer = setTimeout(() => {
+            if (_listenerTime == 0) {
+              this.log('未接收到回复信息!自动重发一次!');
+              _listenerTime++;
+              _connectCtrl();
+            } else {
+              my.hideToast();
+              my.hideLoading();
+              my.confirm({
+                content: '未接收到回复信息!',
+                confirmText: '重试',
+                success: (res) => {
+                  if (res.confirm == true) {
+                    my.showToast({
+                      content: '请稍后',
+                      icon: 'loading',
+                      mask: true,
+                      duration: 100000
+                    })
+                    _connectCtrl();
+                  } else {
+                    this.end(() => {
+                      _callBack && _callBack(false);
+                    });
+                  }
+                }
+              })
+            }
+          }, 5000)
+        }
+
+        my.onBLECharacteristicValueChange((res) => {
+          clearTimeout(_listenerTimer);
+          _listenerTime = -1;
+          let data = dataTransition.ab2hex(res.value)
+          this.log('********notify收到的数据:', data);
+          if (data.slice(0, 4) == 'aa10') {
+            this.log('指令发送成功:');
+          } else if (data.slice(0, 4) == 'aa30') {
+            this.log('CRC校验失败');
+            util.showModal_nocancel('CRC校验失败,请重试。');
+            this.end(() => {
+              _callBack && _callBack(false);
+            });
+            //end
+          } else if (data.slice(0, 3) == 'aa0' && _dataLen == 0) {
+            //设备版本号
+            _machineVerson = data.slice(2, 4);
+            //16进制流水号
+            _sequenceId_16 = data.slice(6, 8); //0a
+            //计算数据包长度
+            _dataLen = parseInt(data.slice(8, 12), 16); //003e,16=62
+            //计算systemState
+            _systemState = data.slice(4, 6); //4c
+            _analysisSystem(_systemState);
+            //crc
+            _CRC16 = data.slice(12, 16); //290e
+            this.log("需要接收的字节长度", _dataLen);
+            if (data.length > 16) {
+              _connectData(data.slice(16))
+            }
+          } else {
+            if (_dataLen > 0) {
+              _connectData(data)
+            }
+          }
+        })
+
+        cb && cb();
+      },
+      fail: (err) => {
+        this.log('notifyBLECharacteristicValueChange', err.errMsg);
+        util.showModal_nocancel('特征值监听开启失败,请重试。')
+        this.end(() => {
+          _callBack && _callBack(false);
+        });
+      }
+    })
+  }
+
+  //解析存储车辆状态
+  const _analysisSystem = (systemState) => {
+    //16进制转换为10进制
+    let decimalState = parseInt(systemState, 16);
+    //10进制转换为2进制
+    let binaryState = parseInt(decimalState).toString(2);
+
+    if (binaryState.length < 8) {
+      let supplyNum = 8 - binaryState.length;
+      while (supplyNum > 0) {
+        binaryState = '0' + binaryState;
+        supplyNum--;
+      }
+    }
+
+    //字符串拆分成为数组
+    let stateArray = Array.prototype.slice.call(binaryState);
+
+    _machineState = stateArray;
+    console.log(stateArray);
+  }
+
+  //拼接数据,判断数据并发送
+  const _connectData = (data) => {
+    this.log('拼接内容:', data);
+    _dataContent += data;
+    this.log('内容长度', _dataContent.length, '接收到的数据长度', _dataLen, '*2');
+    if (_dataContent.length == _dataLen * 2) { //接收完该长度的字节和校验CRC成功之后再发送ACK
+      let dc = _dataContent;
+      let dcArr = [];
+      this.log('接收的数据长度字节:', dc.length / 2);
+      let contentArr = dataTransition.addFlagBeforeArr(dataTransition.strAverage2Arr(dc, 2));
+
+      if (parseInt(dataTransition.getCRC16(contentArr), 16) == parseInt(_CRC16, 16)) {
+        this.log('CRC16校验成功');
+        let value = dataTransition.hexStringToArrayBuffer(`aa12${_systemState}${_sequenceId_16}00000000`);
+        this.log(`返回的确认数据${dataTransition.ab2hex(value)}`);
+        //分析数据返回的内容 
+        _analysisBLEContent(dc, value);
+      } else {
+        this.log('CRC16校验失败', dataTransition.getCRC16(contentArr) + "_应为:" + _CRC16);
+        util.showModal_nocancel('CRC16校验失败,请重试。');
+        this.end(() => {
+          _callBack && _callBack(false);
+        });
+        //end
+      }
+
+      _dataLen = 0;
+      _systemState = '';
+      _dataContent = '';
+      _sequenceId_16 = '';
+      _CRC16 = '';
+    }
+  }
+
+  //解析蓝牙发送内容
+  const _analysisBLEContent = (content, reply) => {
+
+    this.log('解析数据数据***************', content);
+    if (content.indexOf('020101') > -1) {
+      if (!_connected) {
+        _connected = true;
+        this.log('连接成功');
+        _writeBLECharacteristicValue(reply, () => {
+          _ctrl(_operateType);
+        });
+        _analysisVoltage(content);
+      }
+    } else if (content.indexOf('0300820100') > -1) {
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      if (!_hasReceive) {
+        _hasReceive = true;
+        _writeBLECharacteristicValue(reply, () => {
+          this.log('开锁成功,开始回调ctrl_cb');
+          this.end(() => {
+            _callBack && _callBack(true);
+          });
+        });
+      }
+    } else if (content.indexOf('0300810100') > -1) {
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      if (!_hasReceive) {
+        _hasReceive = true;
+        _writeBLECharacteristicValue(reply, () => {
+          this.log('上锁成功,开始回调ctrl_cb');
+          this.end(() => {
+            _callBack && _callBack(true);
+          });
+        });
+      }
+    } else if (content.indexOf('0300840100') > -1) {
+      //响铃成功
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      if (!_hasReceive) {
+        _hasReceive = true;
+        _writeBLECharacteristicValue(reply, () => {
+          this.log('响铃成功,开始回调ctrl_cb');
+          this.end(() => {
+            _callBack && _callBack(true);
+          });
+        });
+      }
+    } else if (content.indexOf('0300870100') > -1) {
+      //临时关锁成功
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      if (!_hasReceive) {
+        _hasReceive = true;
+        _writeBLECharacteristicValue(reply, () => {
+          this.log('响铃成功,开始回调ctrl_cb');
+          this.end(() => {
+            _callBack && _callBack(true);
+          });
+        });
+      }
+    } else if (content.indexOf('0300850100') > -1) {
+      //开电池锁成功
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      if (!_hasReceive) {
+        _hasReceive = true;
+        _writeBLECharacteristicValue(reply, () => {
+          this.log('响铃成功,开始回调ctrl_cb');
+          this.end(() => {
+            _callBack && _callBack(true);
+          });
+        });
+      }
+    } else if (content.indexOf('04008524') > -1) {
+      _writeBLECharacteristicValue(reply, () => {
+        this.log('心跳包');
+      });
+    } else if (content.indexOf('020100') > -1) {
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      this.log('鉴权失败:', _sendData);
+      util.showModal_nocancel('鉴权失败!')
+      this.end(() => {
+        _callBack && _callBack(false);
+      });
+      //end
+    } else {
+      if (_sendCommandTimer) { //每次都将清楚等待任务
+        clearTimeout(_sendCommandTimer);
+        _sendCommandTimer = null;
+      }
+      this.end(() => {
+        let text = content === '0300810102' ? '运动中不能上锁!' : '蓝牙操作失败,请重试!';
+        this.log(text)
+        my.showToast({
+          content: text,
+          mask: true,
+          icon: 'none',
+          duration: 5000
+        })
+        _callBack && _callBack(false);
+      })
+    }
+  }
+
+  const _analysisVoltage = (content) => {
+    //判断81 :终端电池电压
+    if (content.indexOf('02010181') > -1) {
+      //这之后两位表示电池电压:81,两位表示长度:02,加上020101共十位
+      let startN = content.indexOf('020101') + 10;
+      //后四位表示电压值:16进制
+      let voltageData = content.slice(startN, startN + 4);
+
+      let voltage = parseInt(voltageData, 16);
+      if (_machineVerson == '02')
+        _machinevoltage = voltage * 10;
+      else
+        _machinevoltage = voltage;
+    }
+  }
+
+  //指令
+  const _ctrl = (type) => {
+    let sequenceId_16 = dataTransition.getSequenceId(_sequenceId);
+    _sequenceId++;
+    let sendData = '';
+    if (type === 'open') //<aa02000b 00057edb 03000201 00 >
+      sendData = '03 00 02 01 00';
+    else if (type === 'close') //<aa02000c 00058036 03000101 01 >
+      sendData = '03 00 01 01 01';
+    else if (type === 'bell') //<aa02000c 00058036 03000101 01 >
+      sendData = '03 00 04 01 01';
+    else if (type === 'batteryOpen') //<aa02000c 00058036 03000101 01 >
+      sendData = '03 00 05 01 01';
+    else if (type === 'temporaryClose') //<aa02000c 00058036 03000101 01 >
+      sendData = '03 00 01 01 30';
+    else if (type === 'temporaryOpen') //<aa02000c 00058036 03000101 01 >
+      sendData = '03 00 01 01 31';
+
+    let header = dataTransition.header(sendData, 0, '00', sequenceId_16);
+    let data = header + sendData.replace(/\s+/g, "");
+
+    this.log(`发送${type}指令`, data);
+    _sendCtrl(data);
+
+    _sendCommandTimer = setTimeout(() => { //可能出现发送消息后没有收到应答,将再次发送
+      if (_sendCommandTime == 0) {
+        this.log('设备未响应,自动重发')
+        _sendCommandTime++;
+        _ctrl(_operateType);
+      } else {
+        this.log('设备未响应')
+        my.hideLoading();
+        util.showModal('设备未响应,是否重新发送指令?', () => {
+          this.log('手动重发ctrl')
+          my.showLoading({
+            content: '开锁中',
+          })
+          _ctrl(_operateType);
+        }, () => {
+          this.end(() => {
+            _callBack && _callBack(false);
+          });
+        })
+      }
+    }, 5000)
+  }
+
+  const _stopBluetoothDevicesDiscovery = () => {
+    my.stopBluetoothDevicesDiscovery({
+      success: (res) => {
+        this.log('停止搜寻附近的蓝牙外围设备');
+      },
+      fail: (err) => {
+        this.log(err.errMsg);
+      }
+    })
+  }
+
+  const _closeBluetoothAdapter = () => {
+    my.closeBluetoothAdapter({
+      success: (res) => {
+        this.log('关闭蓝牙适配器')
+      },
+      fail: (err) => {
+        this.log(err.errMsg);
+      }
+    })
+  }
+
+  const _initBluetooth = (cb) => {
+    my.openBluetoothAdapter({
+      success: (res) => {
+      },
+      fail: (err) => {
+        this.log('initBluetooth:', err.errMsg);
+        // my.showToast({
+        //   content: '蓝牙初始化失败',
+        //   icon: 'none',
+        // })
+      },
+      complete: () => {
+        cb && cb();
+      }
+    })
+  }
+
+  this.log = (...str) => {
+    let now = new Date();
+    now = util.formatTime(now)
+    console.log(now, ...str);
+    _logList.push(str.join(','))
+  }
+}
+
 module.exports = BluetoothOperate

Неке датотеке нису приказане због велике количине промена