xvying пре 3 година
комит
8a457bae2e
100 измењених фајлова са 5562 додато и 0 уклоњено
  1. 100 0
      app.acss
  2. 279 0
      app.js
  3. 53 0
      app.json
  4. 1 0
      cache.txt
  5. 13 0
      components/foottip/foottip.acss
  6. 4 0
      components/foottip/foottip.axml
  7. 39 0
      components/foottip/foottip.js
  8. 6 0
      components/foottip/foottip.json
  9. BIN
      img/avator.jpg
  10. BIN
      img/banshou.png
  11. BIN
      img/bell.png
  12. BIN
      img/bell1.png
  13. BIN
      img/bike-show.jpg
  14. BIN
      img/bike.jpg
  15. BIN
      img/change.png
  16. BIN
      img/coupon_select.png
  17. BIN
      img/dun.png
  18. BIN
      img/fail.png
  19. BIN
      img/go.png
  20. BIN
      img/home.png
  21. BIN
      img/icon.png
  22. BIN
      img/ka_icon.png
  23. BIN
      img/kefu.png
  24. BIN
      img/know.jpg
  25. BIN
      img/lanya.jpg
  26. BIN
      img/logo.png
  27. BIN
      img/mess.png
  28. BIN
      img/mine.png
  29. BIN
      img/mobile.jpg
  30. BIN
      img/nocard.png
  31. BIN
      img/park.png
  32. BIN
      img/park1.jpg
  33. BIN
      img/park2.png
  34. BIN
      img/pay-success.png
  35. BIN
      img/position.png
  36. BIN
      img/quan_icon.png
  37. BIN
      img/scan.png
  38. BIN
      img/success.png
  39. BIN
      img/suo.jpg
  40. BIN
      img/time.png
  41. BIN
      img/weixin.png
  42. BIN
      img/wenhao.png
  43. BIN
      img/with-home.png
  44. BIN
      img/you.png
  45. 5 0
      mini.project.json
  46. 47 0
      pages/account_details/account_details.acss
  47. 16 0
      pages/account_details/account_details.axml
  48. 79 0
      pages/account_details/account_details.js
  49. 5 0
      pages/account_details/account_details.json
  50. 28 0
      pages/agreement/agreement.acss
  51. 24 0
      pages/agreement/agreement.axml
  52. 30 0
      pages/agreement/agreement.js
  53. 4 0
      pages/agreement/agreement.json
  54. 53 0
      pages/authorization/authorization.acss
  55. 11 0
      pages/authorization/authorization.axml
  56. 235 0
      pages/authorization/authorization.js
  57. 5 0
      pages/authorization/authorization.json
  58. 176 0
      pages/balance/balance.acss
  59. 54 0
      pages/balance/balance.axml
  60. 198 0
      pages/balance/balance.js
  61. 5 0
      pages/balance/balance.json
  62. 243 0
      pages/breakdown/breakdown.acss
  63. 52 0
      pages/breakdown/breakdown.axml
  64. 324 0
      pages/breakdown/breakdown.js
  65. 7 0
      pages/breakdown/breakdown.json
  66. 534 0
      pages/buy-card/buy-card.acss
  67. 78 0
      pages/buy-card/buy-card.axml
  68. 170 0
      pages/buy-card/buy-card.js
  69. 4 0
      pages/buy-card/buy-card.json
  70. 82 0
      pages/change_mobile/change_mobile.acss
  71. 15 0
      pages/change_mobile/change_mobile.axml
  72. 206 0
      pages/change_mobile/change_mobile.js
  73. 5 0
      pages/change_mobile/change_mobile.json
  74. 54 0
      pages/charge_rule/charge_rule.acss
  75. 46 0
      pages/charge_rule/charge_rule.axml
  76. 34 0
      pages/charge_rule/charge_rule.js
  77. 4 0
      pages/charge_rule/charge_rule.json
  78. 123 0
      pages/coupon/coupon.acss
  79. 36 0
      pages/coupon/coupon.axml
  80. 94 0
      pages/coupon/coupon.js
  81. 4 0
      pages/coupon/coupon.json
  82. 23 0
      pages/depoSuce/depoSuce.acss
  83. 8 0
      pages/depoSuce/depoSuce.axml
  84. 41 0
      pages/depoSuce/depoSuce.js
  85. 4 0
      pages/depoSuce/depoSuce.json
  86. 340 0
      pages/index/index.acss
  87. 98 0
      pages/index/index.axml
  88. 859 0
      pages/index/index.js
  89. 4 0
      pages/index/index.json
  90. 72 0
      pages/inputcode/inputcode.acss
  91. 21 0
      pages/inputcode/inputcode.axml
  92. 133 0
      pages/inputcode/inputcode.js
  93. 5 0
      pages/inputcode/inputcode.json
  94. 9 0
      pages/logs/logs.acss
  95. 6 0
      pages/logs/logs.axml
  96. 18 0
      pages/logs/logs.js
  97. 4 0
      pages/logs/logs.json
  98. 149 0
      pages/mine/mine.acss
  99. 65 0
      pages/mine/mine.axml
  100. 118 0
      pages/mine/mine.js

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


+ 279 - 0
app.js

@@ -0,0 +1,279 @@
+App({
+  onLaunch: function () {
+    let token=my.getStorageSync({'key':'token'}).data
+    let  data =  Math.round(new Date().getTime()/1000).toString();;
+    let tokenTime=my.getStorageSync({'key':'token_time'}).data
+    let cha=data-tokenTime
+    let data1=60*60*24
+    if(!token){
+      this.token()
+    }else if(cha>data1){
+      my.removeStorageSync('token')
+      this.token()
+    }
+ 
+    // 登录
+    var that = this;
+    my.getSystemInfo({
+      success: res => {
+        console.log(res)
+        var system = res.system.trim().split(/\s+/)[1];
+        // var intNumber = system.substring(0, system.indexOf("."));
+        // if (res.platform == 'ios' && intNumber < 13 || res.SDKVersion < '2.1.0') {
+        //   console.log('低版本')
+        //   that.globalData.compatible = true;
+        //   my.reLaunch({
+        //     url: '/pages/compatible/index/index',
+        //   })
+        // }
+        // that.globalData.platform = res.platform
+        // that.globalData.version = res.version
+        // console.log(res.safeArea.bottom)
+        // console.log('手机信息res' + res.model)
+        // if (res.model == 'iPhone X' || res.model == 'iPhone XR' || res.model == 'iPhone XS Max') {
+        //   that.globalData.screenHeight = 'xSeries'
+        // } else if (res.safeArea.bottom >= 780) {
+        //   that.globalData.screenHeight = 'xSeries'
+        // }
+      }
+    })
+    if (my.getStorageSync({'key':'midTimes'}).data != '') {
+      var time = my.getStorageSync({'key':'midTimes'}).data;
+      var timestamp = Date.parse(new Date()) / 1000;
+      if (time <= timestamp) {
+        console.log('midtimes过期')
+        my.setStorageSync({'key':'midTimes',data:''})
+      }
+    }
+    var time = my.getStorageSync({'key':'token_time'}).data;
+    var timestamp = Date.parse(new Date());
+    if (time <= timestamp / 1000) {
+      console.log('token过期')
+      my.removeStorageSync('token_time')
+    }
+    if (my.canIUse('getUpdateManager')) {
+      const updateManager = my.getUpdateManager()
+      updateManager.onCheckForUpdate(function (res) {
+        if (res.hasUpdate) {
+          updateManager.onUpdateReady(function () {
+            my.alert({
+              title: '更新提示',
+              content: '新版本已经准备好,是否重启应用?',
+              success: function (res) {
+                
+                  updateManager.applyUpdate()
+                
+              }
+            })
+          })
+          updateManager.onUpdateFailed(function () {
+            my.alert({
+              title: '已经有新版本了哟~',
+              content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
+            })
+          })
+        }
+      })
+    } else {
+      my.alert({
+        title: '提示',
+        content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+      })
+    }
+   //登录
+
+
+
+
+  },
+  globalData: {
+    statusBarHeight: my.getSystemInfoSync()['statusBarHeight'],
+    windowHeight: my.getSystemInfoSync()['windowHeight'],
+    imgUrl: 'http://resource.bike.hanyiyun.com/',
+    screenHeight: '',
+    login: false,
+    platform: '',
+    version: '',
+    req: true,
+    id: 0,
+    times: 60,
+    invalid: false,
+    compatible: '',
+    title: '禹见你', //全局修改此小程序名称
+    logoUrl: '/img/dingding.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
+            },
+            method: method,
+            success: (res) => {
+              resolve(res)
+              // console.log(res)
+              if (res.status == 450) {
+                return;
+              }
+               if (res.status != 200) {
+                if (res.data.message == '订单不存在或订单已结算') {
+                  if (this.globalData.compatible) {
+                    my.reLaunch({
+                      url: '/pages/compatible/index/index',
+                    })
+                  } else {
+                    my.reLaunch({
+                      url: '/pages/index/index',
+                    })
+                  }
+                  return false;
+                } else if (res.data.message == '运动中不能关锁') {
+                  return false;
+                }
+                if (res.message != undefined) {
+                  my.showToast({
+                    content: res.message,
+                    icon: 'none',
+                    duration: 3000,
+                    mask: true
+                  })
+                } else if (res.data.message != undefined) {
+                  my.showToast({
+                    content: res.data.message,
+                    icon: 'none',
+                    duration: 3000,
+                    mask: true
+                  })
+                }
+              }
+              if (res.status == 401) {
+                var timeout;
+                my.removeStorageSync('token')
+                my.removeStorageSync('token_time') 
+                // this.token()
+                my.reLaunch({
+                  url: '/pages/index/index',
+                })
+              } else if (res.status == 404) {
+                my.navigateTo({
+                  url: '/pages/undefind/undefind',
+                })
+              }
+            },
+            fail: (err) => {
+              my.showToast({
+                content: err,
+                icon: 'none',
+                mask: true,
+                duration: 3000,
+
+              });
+         
+              reject("请求失败")
+            },
+            complete: () => {
+              that.globalData.req = true
+            }
+          })
+        })
+      }
+    }
+  },
+  token:function(){
+    let that=this
+    my.getAuthCode({
+      success: function (res) {
+        my.getSystemInfo({
+          success(res) {
+            console.log(arr)
+          var  arr = [{
+                label: '品牌',
+                type: 'brand',
+                value: res.brand
+              },
+              {
+                label: '型号',
+                type: 'model',
+                value: res.model
+              },
+              {
+                label: '系统平台',
+                type: 'platform',
+                value: res.platform
+              },
+              {
+                label: '系统版本',
+                type: 'system',
+                value: res.system
+              },
+              {
+                label: '微信版本',
+                type: 'version',
+                value: res.version
+              },
+              {
+                label: '小程序版本',
+                type: 'SDKVersion',
+                value: res.SDKVersion
+              },
+              {
+                label: '定位状态',
+                type: 'locationEnabled',
+                value: res.locationEnabled ? '开' : '关'
+              },
+              {
+                label: '定位授权',
+                type: 'locationAuthorized',
+                value: res.locationAuthorized ? '已授权' : '未授权'
+              }
+            ]
+          }
+        })
+        // 发送 res.code 到后台换取 openId, sessionKey, unionId
+        console.log(res.code)
+        var data = {
+        'code': res.authCode,
+          'appid': that.globalData.appid,
+          'type': 1
+        };
+        my.request({
+          url: that.globalData.url + '/auth/weapp-login',
+            data: data,
+            headers: {
+              'content-type': 'application/json',
+              'Accept': 'application/json',
+              'Cache-Control': 'no-cache',
+              'Authorization': my.getStorageSync({'key':'token'}).data,
+              'merchant-id': that.globalData.merchant_id
+            },
+          method:'POST',
+          success:(res)=>{
+            my.setStorageSync({'key':'token',data:res.data.token});
+            my.setStorageSync({'key':'session_key',data:res.data.session_key});
+            my.setStorageSync({'key':'token_time',data:res.data.exp});
+            my.setStorageSync({'key':'user_ID',data:res.data.user.id});
+          }
+        })
+       
+      }
+    })
+  }
+})

+ 53 - 0
app.json

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

+ 1 - 0
cache.txt

@@ -0,0 +1 @@
+123.149.2.166

+ 13 - 0
components/foottip/foottip.acss

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

+ 4 - 0
components/foottip/foottip.axml

@@ -0,0 +1,4 @@
+<!--components/foottip/foottip.wxml-->
+<view class="button-tips" onTap="skipXieyi">
+    <text><slot></slot></text><text class="xieyi">《禹见你用户协议》</text>  
+  </view>

+ 39 - 0
components/foottip/foottip.js

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

+ 6 - 0
components/foottip/foottip.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    
+  },
+  "component": true
+}





BIN
img/bike-show.jpg




BIN
img/coupon_select.png



















BIN
img/pay-success.png



BIN
img/quan_icon.png








BIN
img/with-home.png



+ 5 - 0
mini.project.json

@@ -0,0 +1,5 @@
+{
+  "component2": true,
+  "axmlStrictCheck": false,
+  "enableParallelLoader": true
+}

+ 47 - 0
pages/account_details/account_details.acss

@@ -0,0 +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;
+  margin-top: 40%;
+  }
+  .none image{
+    height: 100rpx;
+    width: 100rpx;
+  }

+ 16 - 0
pages/account_details/account_details.axml

@@ -0,0 +1,16 @@
+<view class="account-detail">
+  <view class="account-list" a:for="{{accountList}}" a:key='index'>
+    <view class="title">{{item.created_at}}</view>
+    <view class="list-card">
+      <view class="card-title">
+        <text>{{item.name}}</text>
+        <text class="money">{{item.money|parseFloat}}元</text>
+      </view>
+      <view class="from">类型:{{item.operate_type}}</view>
+    </view>
+  </view>
+  <view class="none" a:if="{{accountList.length==0}}">
+    <image src="../../img/nocard.png"></image>
+    <view class="more">暂无数据</view>
+  </view>
+</view>

+ 79 - 0
pages/account_details/account_details.js

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

+ 5 - 0
pages/account_details/account_details.json

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

+ 28 - 0
pages/agreement/agreement.acss

@@ -0,0 +1,28 @@
+/* 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;
+}

+ 24 - 0
pages/agreement/agreement.axml

@@ -0,0 +1,24 @@
+<!--隐私条款-->
+<view class="privacy">
+  <view class="priCon">
+    <view class="priTitle">隐私服务协议</view>
+    <view class="line"></view>
+    <view class="passage">
+      <view>
+        {{title}}平台重视对用户隐私的保护。请您务必认真阅读本政策,在确认充分了解并同意后使用{{title}}。如果您或者您的 监护人不同意本隐私政策的任何内容,您应该立即停止使用。 当您开始使用{{title}}平台,即表示您/您的监护人已经同意 我们按照本政策来收集、保存、使用、共享、保护您的个人信息。
+      </view>
+      <view>
+        <view>本隐私政策主要包括以下内容:</view>
+        <view>1、 本隐私政策中个人信息的定义与范围(包括:姓名、手机号码 用户密码、身份证号码、性别、年龄、征信信息、车辆信息、位置信息、行程信息、通话记录、录音录像、订单信息及交易状态、支付信息、设备信息、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>

+ 30 - 0
pages/agreement/agreement.js

@@ -0,0 +1,30 @@
+var app = getApp()
+Page({
+  data: {
+    title:app.globalData.title
+  },
+  onLoad: function (options) {
+
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+    
+  }
+})

+ 4 - 0
pages/agreement/agreement.json

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

+ 53 - 0
pages/authorization/authorization.acss

@@ -0,0 +1,53 @@
+/* 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;
+  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;
+}

+ 11 - 0
pages/authorization/authorization.axml

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

+ 235 - 0
pages/authorization/authorization.js

@@ -0,0 +1,235 @@
+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
+    })
+    my.removeStorageSync('token');
+    my.getAuthCode({
+      success: function (res) {
+        my.getSystemInfo({
+          success(res) {
+            console.log(arr)
+            arr = [{
+              label: '品牌',
+              type: 'brand',
+              value: res.brand
+            },
+            {
+              label: '型号',
+              type: 'model',
+              value: res.model
+            },
+            {
+              label: '系统平台',
+              type: 'platform',
+              value: res.platform
+            },
+            {
+              label: '系统版本',
+              type: 'system',
+              value: res.system
+            },
+            {
+              label: '微信版本',
+              type: 'version',
+              value: res.version
+            },
+            {
+              label: '小程序版本',
+              type: 'SDKVersion',
+              value: res.SDKVersion
+            },
+            {
+              label: '定位状态',
+              type: 'locationEnabled',
+              value: res.locationEnabled ? '开' : '关'
+            },
+            {
+              label: '定位授权',
+              type: 'locationAuthorized',
+              value: res.locationAuthorized ? '已授权' : '未授权'
+            }
+            ]
+          }
+        })
+        // 发送 res.code 到后台换取 openId, sessionKey, unionId
+
+        console.log(app.globalData.appid, 'appid')
+
+        var data = {
+          'code': res.authCode,
+          'appid': app.globalData.appid,
+          'type': 1
+        };
+        app.request("/auth/weapp-login", data, "POST").then(res => {
+          console.log(res, '登录')
+          my.setStorageSync({ 'key': 'token', data: res.data.token });
+          my.setStorageSync({ 'key': 'session_key', data: res.data.session_key });
+          my.setStorageSync({ 'key': 'token_time', data: res.data.exp });
+          my.setStorageSync({ 'key': 'user_ID', data: res.data.user.id });
+          that.setData({
+            token: res.data.token,
+            session_key: res.data.session_key
+          })
+          app.request("/user/status", '', "GET").then(res => {
+            console.log(res)
+            if (res.status == 200) {
+              that.setData({
+                bind_mobile: res.data.is_bind_mobile
+              })
+            }
+          })
+        })
+      }
+    })
+  },
+  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 () {
+
+  }
+})

+ 5 - 0
pages/authorization/authorization.json

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

+ 176 - 0
pages/balance/balance.acss

@@ -0,0 +1,176 @@
+/* required by usingComponents */
+/* pages/balance/balance.wxss */
+.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;
+
+}
+
+.bottom-card {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  padding: 50rpx 0;
+  padding-bottom: 120rpx;
+  width: 100%;
+  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;
+}

+ 54 - 0
pages/balance/balance.axml

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

+ 198 - 0
pages/balance/balance.js

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

+ 5 - 0
pages/balance/balance.json

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

+ 243 - 0
pages/breakdown/breakdown.acss

@@ -0,0 +1,243 @@
+/* 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: #fff7d3;
+}
+
+.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);
+  text-align: center;
+  height: 100rpx;
+  line-height: 100rpx;
+  border-radius: 50rpx;
+  margin-top: 50rpx;
+  font-size: 34rpx;
+}

+ 52 - 0
pages/breakdown/breakdown.axml

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

+ 324 - 0
pages/breakdown/breakdown.js

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

+ 7 - 0
pages/breakdown/breakdown.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+  
+  },
+  "navigationBarTitleText": "我要报修"
+
+}

+ 534 - 0
pages/buy-card/buy-card.acss

@@ -0,0 +1,534 @@
+/* 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: #ffe98f;
+  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: #ffe98f;
+  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;
+}
+.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;
+}
+
+.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%;
+  margin-top: 30%;
+  height: 90%;
+}
+
+.none image {
+  height: 200rpx;
+  width: 200rpx;
+}
+
+.none text {
+  /* padding-right: 70rpx; */
+  padding-top: 50rpx;
+}

+ 78 - 0
pages/buy-card/buy-card.axml

@@ -0,0 +1,78 @@
+<view class="box">
+  <view class="top" a:if="{{arr!=''}}">
+    <text>电单车骑行卡</text>
+    <text>购卡骑行更划算</text>
+  </view>
+  <view a:if="{{arr!=''}}" class="card">
+    <view  class="{{currentCard==hotInfo.id ? 'active' : 'card-list1'}}" onTap="changeCard" data-id="{{hotInfo}}">
+      <view class="right-tips" a:if="{{hotInfo.is_discount==1}}" >限时{{item.discount}}折</view>
+      <!--  -->
+      <view class="card-title">
+        <text a:if="{{hotInfo.is_limit_times==1}}">{{hotInfo.times}}次/{{hotInfo.effective_days}}天</text>
+        <text a:if="{{hotInfo.is_limit_times==0}}">{{hotInfo.effective_days}}天不限次</text>
+      </view>
+      <view class="card-tips">单次最高抵扣{{hotInfo.deduction_money}}元</view>
+      <view class="card-money">
+        <text class="money-num">{{hotInfo.now_price}}</text>元
+        <text class="yuanjia" a:if="{{hotInfo.is_discount==1}}">{{hotInfo.price}}元</text>
+      </view>
+    </view>
+    <view class="card-list" a:for="{{arr}}" a:key="key">
+
+      <view class="card-list-item" class="{{currentCard==item.id ? 'active1' : 'card-list-item'}}" onTap="changeCard" data-id="{{item}}">
+      <view class="right-tips" a:if="{{item.is_discount==1}}">限时{{item.discount}}折</view>
+        <view class="card-content">
+          <view class="card-title">
+            <text a:if="{{item.is_limit_times==1}}">{{item.times}}次/{{item.effective_days}}天</text>
+            <text a:if="{{item.is_limit_times==0}}">{{item.effective_days}}天不限次</text>
+          </view>
+          <view class="item-money">
+            <text class="money-num">{{item.now_price}}</text>元
+            <text class="yuanjia" a:if="{{item.is_discount==1}}">{{hotInfo.price}}元</text>
+          </view>
+          <view class="card-tips" style="font-size:22rpx">单次最高抵扣{{item.deduction_money}}元</view>
+        </view>
+      </view>
+    </view>
+
+  </view>
+<view class="buy-buttom" a:if="{{arr!=''}}" onTap="buyButtom">购买</view>
+  <view class="background" a:if="{{info}}" onTap="background"></view>
+  <view class="model" a:if="{{info}}">
+    <view class="view">
+      <text class="title">购买骑行卡</text>
+      <view class="content">
+        <view class="count">
+          <view class="count_a">
+            <text class="text" a:if="{{infoDetail.is_limit_times==1}}">{{infoDetail.times}}次</text>
+            <text class="text" a:if="{{infoDetail.is_limit_times==0}}">不限次</text>
+            <text>(有效期{{infoDetail.effective_days}}天)</text>
+          </view>
+          <view class="count_b">
+            <text>¥{{infoDetail.now_price}}</text>
+            <text a:if="{{infoDetail.is_discount==1}}">{{infoDetail.price}}</text>
+          </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
+            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>
+      </view>
+      <view class="btn1" onTap="form">
+        <text>{{infoDetail.now_price}}元购买</text>
+      </view>
+    </view>
+    <image src="{{img}}weapp/guanbi.png" style="width:48rpx;height:48rpx;" class="over1" onTap="background"></image>
+  </view>
+</view>
+<view class="none" a:if="{{arr=='' && hotInfo==''}}">
+  <image src="../../img/nocard.png" ></image>
+  <text>暂无骑行卡</text>
+</view>

+ 170 - 0
pages/buy-card/buy-card.js

@@ -0,0 +1,170 @@
+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.id != undefined) {
+      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.statusCode == 200) {
+          that.setData({
+            no: res.data.no
+          })
+          my.tradePay({
+            tradeNO: res.data.tradeNo,
+            success: function (res) {
+              my.showToast({
+                content: '购买成功,请用车',
+                icon: 'none',
+                mask: true,
+                success: function () {
+                  my.reLaunch({
+                    url: '/pages/index/index',
+                  })
+                }
+              })
+            },
+            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 () {
+
+  }
+})

+ 4 - 0
pages/buy-card/buy-card.json

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

+ 82 - 0
pages/change_mobile/change_mobile.acss

@@ -0,0 +1,82 @@
+/* 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);
+}
+
+
+.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);
+  border-radius: 40rpx;
+  font-size: 28rpx;
+  font-weight: 500;
+  margin-top: 100rpx;
+}

+ 15 - 0
pages/change_mobile/change_mobile.axml

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

+ 206 - 0
pages/change_mobile/change_mobile.js

@@ -0,0 +1,206 @@
+// 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.statusCode == 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.statusCode == 200) {
+            my.showToast({
+              content: '换绑成功',
+              icon: 'none'
+            })
+          }
+          if (res.statusCode == 422) {
+            console.log(res)
+            my.showToast({
+              content: res.data.errors.mobile[0],
+              icon: 'none',
+              duration: 2000
+            })
+          }
+        })
+      } else {
+        my.showToast({
+          content: '您的操作过于频繁,请稍后再试~',
+          icon: 'none'
+        })
+      }
+    }
+  }, 1000),
+  //获取手机号
+  getPhoneNumber: function (e) {
+    let that = this
+    if (e.detail.errMsg == "getPhoneNumber:ok") {
+      let data = {
+        session_key: my.getStorageSync({'key':'setting'}).data,
+        iv: e.detail.iv,
+        encryptedData: e.detail.encryptedData
+      }
+      app.request('/user/bind-wechat-mobile', data, 'POST').then(res => {
+        if (res.statusCode == 200) {
+          console.log(res.data, '手机号')
+          if (res.data.is_bind_mobile==true) {
+            my.showToast({
+              content: '当前手机号已绑定',
+              icon:'none'
+            })
+            return
+          } else {
+            that.setData({
+              phoneVal: e.detail.value,
+              codeIshow:false
+            })
+          }
+        }
+      })
+    } else {
+      my.showToast({
+        content: '获取手机号失败',
+        icon: 'none',
+        duration: 2000
+      })
+    }
+  },
+
+
+
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+
+  onShareAppMessage: function () {
+
+  },
+
+})

+ 5 - 0
pages/change_mobile/change_mobile.json

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

+ 54 - 0
pages/charge_rule/charge_rule.acss

@@ -0,0 +1,54 @@
+/* required by usingComponents */
+/* pages/charge_rule/charge_rule.wxss */
+.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 - 0
pages/charge_rule/charge_rule.axml

@@ -0,0 +1,46 @@
+<view class="box">
+<view class="tip">——— <text style="color:#333333">{{homeName}}</text>———</view>
+  <view a:if="{{setting.is_deposit}}">
+    <view class="rules-title">
+      <view class="left">骑行押金</view>
+      <view class="right">{{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.starting_price}}元({{setting.starting_price_time}}分钟)</view>
+      </view>
+      <view class="row">
+        <view class="rl">时长费</view>
+        <view class="rr">{{setting.per_money}}元/{{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">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.min_limit_km}}m时:每多{{setting.over_limit_per_km}}m,增加{{setting.over_limit_per_km_money}}元;{{setting.max_dispatching_fee}}元封顶。</view>
+    </view>
+  </view>
+ 
+</view>

+ 34 - 0
pages/charge_rule/charge_rule.js

@@ -0,0 +1,34 @@
+var app = getApp()
+Page({
+  data: {
+    setting:my.getStorageSync({'key':'setting'}).data,
+    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 () {
+
+  }
+})

+ 4 - 0
pages/charge_rule/charge_rule.json

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

+ 123 - 0
pages/coupon/coupon.acss

@@ -0,0 +1,123 @@
+/* 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);
+}
+.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);
+  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);
+}
+

+ 36 - 0
pages/coupon/coupon.axml

@@ -0,0 +1,36 @@
+<view class="coupon">
+
+  <view class="tab"  >
+    <view class="{{status==item.id ? 'tab-item1' :'tab-item'}}" a:for="{{tabList}}" a:key='index' onTap="currentTab" data-id="{{item.id}}">{{item.name}}</view>
+  </view>
+  <view a:if="{{couponList.length>0}}">
+  <!-- <view class="coupon-dui" onTap="couponCode" >兑换优惠券</view> -->
+
+  <view class="coupon-list">
+    <view class="coupon-item" a:for="{{couponList}}" a:key='index'>
+      <view class="left">
+        <text>¥</text>
+        <text class="num">{{item.used_amount}}</text>
+      </view>
+      <view class="right">
+        <view class="right-title">{{item.type_name}}</view>
+        <view class="right-text" a:if="{{status==1}}">{{item.valid_end_time}}到期</view>
+        <view class="right-text" a:else>{{status==0 ? '已过期' : '已使用'}}</view>
+      </view>
+    </view>
+  </view>
+ 
+  <!-- 兑换码弹框 -->
+  <view class="frame" a:if="{{frameShow==true}}">
+    <view class="frame-content">
+      <view class="top" onTap="closeFrame"><text class="iconfont icon-cha"></text></view>
+     <input type="text" placeholder="请输入兑换码" class="code-input" placeholder-class="no-input"/>
+     <view class="sure-button" onTap="sureSubmit">确定</view>
+    </view>
+  </view>
+</view>
+<view class="no-card" a:if="{{couponList.length==0}}">
+    <image src="../../img/nocard.png"></image>
+    <view>暂无可用优惠券</view>
+  </view>
+</view>

+ 94 - 0
pages/coupon/coupon.js

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

+ 4 - 0
pages/coupon/coupon.json

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

+ 23 - 0
pages/depoSuce/depoSuce.acss

@@ -0,0 +1,23 @@
+/* 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);
+
+}

+ 8 - 0
pages/depoSuce/depoSuce.axml

@@ -0,0 +1,8 @@
+<!--押金成功-->
+<view class="suce">
+  <image src="../../img/pay-success.png"></image>
+  <view class="text">支付成功!</view>
+  <view hover-class="none" onTap="goHome">
+      <view class="btn">返回首页</view>
+  </view>
+</view>

+ 41 - 0
pages/depoSuce/depoSuce.js

@@ -0,0 +1,41 @@
+var app = getApp()
+Page({
+  data: {
+    img:app.globalData.imgUrl
+  },
+  onLoad: function (options) {
+
+  },
+  goHome(){
+    if(app.globalData.compatible){
+      my.reLaunch({
+        url: '/pages/compatible/index/index',
+      })
+    }else{
+      my.reLaunch({
+        url: '/pages/index/index',
+      })
+    }
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+    
+  }
+})

+ 4 - 0
pages/depoSuce/depoSuce.json

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

+ 340 - 0
pages/index/index.acss

@@ -0,0 +1,340 @@
+/* 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);
+}
+
+.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;
+}
+/* 未支付订单弹框 */
+.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;
+}

+ 98 - 0
pages/index/index.axml

@@ -0,0 +1,98 @@
+<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}}" bindchange="swiperChange">
+      <swiper-item a:for="{{ads}}" a:key="key" class="ad-swiper-item">
+        <image src="{{item.surface}}" style="width:100%;height:100%;" onTap="swiper" data-index="{{index}}"
+          data-type="{{item.type}}" data-name="{{item.name}}" data-detail="{{item.detail}}" data-id="{{item.id}}"
+          a:if="{{item.type!='wxTencentAdvertisement'}}"></image>
+      </swiper-item>
+    </swiper>
+  </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" 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>

+ 859 - 0
pages/index/index.js

@@ -0,0 +1,859 @@
+// index.js
+// 获取应用实例
+//获取应用实例
+const app = getApp();
+var token = my.getStorageSync({'key':'token'}).data;
+const util = require('../../utils/utils.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: 520, //用到
+    length: '',
+    swiperCurrent: 0,
+    midbolear: '',
+    per_money: '',
+    img: app.globalData.imgUrl,
+    new_user_coupons: [],
+    scanCodeErr: false,//扫码失败弹框
+  },
+
+  onLoad: function (query) {
+    var that = this;
+    console.log(query)
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    // if (query.scene) {
+    //   app.globalData.id = query.scene
+    // }
+    this.setData({
+      height1: app.globalData.statusBarHeight,
+      screenHeight: app.globalData.screenHeight
+    })
+    my.getSystemInfo({
+      success: (res) => {
+      }
+    })
+  },
+  onShow: function () {
+    var that = this;
+    my.setNavigationBar({
+      title: app.globalData.title
+    })
+    token = my.getStorageSync({'key':'token'}).data
+    this.setData({
+      show: false,
+      midbolear: my.getStorageSync({'key':'midTimes'}).data,
+      polygons: []
+    })
+    that.location();
+    testToken = setInterval(function () {
+      let token=my.getStorageSync({'key':'token'}).data
+      if (token) {
+        console.log('0000')
+        clearInterval(testToken)
+        that.userState();
+        that.getUser();
+      } else {
+        console.log(token,'1')
+      }
+    }, 1000)
+    my.hideBackHome();
+  },
+  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
+    }
+    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)
+    })
+  },
+  //点击广告页
+  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({
+          phoneNumber: 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
+      });
+    }
+  },
+  //定位当前位置
+  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) {
+        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, '区域')
+          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)
+              })
+          }
+          clearInterval(mytime)
+          setTimeout(function () {
+            // that.notice();
+          }, 500)
+          if (res.data.status_code == 423) {
+            my.getLocation({
+              success: function (res) {
+                my.alert({
+                  title: '提示',
+                  content: '您附近暂无运营区域~',
+                })
+                var setting = {
+                  is_deposit: 1
+                }
+                that.setData({
+                  setting
+                })
+              },
+              fail: function (err) {
+                that.setData({
+                  location: true
+                })
+              }
+            })
+          }
+          my.setStorageSync({'key':'setting',data:data.setting})
+          my.setStorageSync({'key':'home',data: data})
+        }
+      }).catch(err => {
+        console.log(err)
+      })
+    }
+  },
+  //停车区域
+  ban_stop: function (id) {
+    var that = this;
+    var data1 = {
+      'area_id': 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({
+          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 == 0) {
+      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;
+    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 && that.data.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) {
+        console.log(res, '扫码结果')
+        var index = res.result.lastIndexOf("\=");
+        var code = res.result.substring(index + 1, res.result.length);
+        console.log(code.length)
+        if (code.length == 9) {
+          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({
+      phoneNumber: my.getStorageSync({'key':'home'}).data.customer_service_phone,
+    })
+  }, 1500),
+  //用户状态
+  userState: function () {
+    var that = this;
+
+    var data = {
+      'area_id': that.data.id
+    }
+    app.request("/user/status", data, "GET").then(res => {
+      console.log(res)
+      if (res.status == 200) {
+        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 () {
+        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) {
+    console.log(e, 'oooooo')
+    let data = e.currentTarget.dataset.id
+    let that = this
+    var userStatus = that.data.userStatus;
+    console.log(that.data.latitude)
+    if (!that.data.latitude && !that.data.longitude) {
+      that.setData({
+        background: true,
+        location: true
+      })
+    } else {
+      if (data.id == 2) {
+        console.log(that.data.userStatus,'')
+        if (!userStatus) {
+          my.navigateTo({
+            url: '/pages/authorization/authorization',
+          })
+        } else {
+          that.jiance1();
+        }
+
+      } 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 == 1) {
+      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({
+      phoneNumber: 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',
+    })
+  }
+})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 4 - 0
pages/index/index.json

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

+ 72 - 0
pages/inputcode/inputcode.acss

@@ -0,0 +1,72 @@
+/* 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 {
+  /* 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;
+}
+.sure-buttom{
+  background-color:var(--globleColor);
+  color: #333333;
+  font-weight: 600;
+}
+.code-number{
+  height: 70rpx;
+line-height: 70rpx;
+  background-color:var(--globleColor);
+
+}

+ 21 - 0
pages/inputcode/inputcode.axml

@@ -0,0 +1,21 @@
+<!--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:95%"></input>
+    <!-- <view class="query_num_block">
+      <input class="num_item_block" a:for="{{inputLen}}" a:key="index" disabled onTap='onFocus'
+        value="{{code.length>=index+1?code[index]:''}}" type='number'/>
+    </view>
+    <input name="password" password="{{true}}" class='hidden_ipt' maxlength="{{inputLen}}" focus="{{isFocus}}"
+      bindinput="setValue" type='number'></input> -->
+  </view>
+
+
+
+  <view onTap="sureSubmit" class="{{submitState==0 ? 'buttom' : 'sure-buttom'}}">确定</view>
+</view>

+ 133 - 0
pages/inputcode/inputcode.js

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

+ 5 - 0
pages/inputcode/inputcode.json

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

+ 9 - 0
pages/logs/logs.acss

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

+ 6 - 0
pages/logs/logs.axml

@@ -0,0 +1,6 @@
+<!--logs.wxml-->
+<view class="container log-list">
+  <block a:for="{{logs}}" a:key="timeStamp" a:for-item="log">
+    <text class="log-item">{{index + 1}}. {{log.date}}</text>
+  </block>
+</view>

+ 18 - 0
pages/logs/logs.js

@@ -0,0 +1,18 @@
+// logs.js
+const util = require('../../utils/util.js')
+
+Page({
+  data: {
+    logs: []
+  },
+  onLoad() {
+    this.setData({
+      logs: (my.getStorageSync({'key':'home'}).data || []).map(log => {
+        return {
+          date: util.formatTime(new Date(log)),
+          timeStamp: log
+        }
+      })
+    })
+  }
+})

+ 4 - 0
pages/logs/logs.json

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

+ 149 - 0
pages/mine/mine.acss

@@ -0,0 +1,149 @@
+/* required by usingComponents */
+/* pages/mine/mine.wxss */
+.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;
+}
+
+.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;
+}

+ 65 - 0
pages/mine/mine.axml

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

+ 118 - 0
pages/mine/mine.js

@@ -0,0 +1,118 @@
+// pages/mine/mine.js
+var app=getApp()
+Page({
+  data: {
+    userInfo: '',//用户信息
+    deposit: '',//是否缴纳押金 未缴纳0 已缴纳1
+    arr:[],
+    show:false,
+    setting:'',//设置
+  },
+  onLoad: function (options) {
+  },
+  getUser() {
+    let token=my.getStorageSync({'key':'token'}).data
+    if (token != '') {
+      app.request("/me", '', "GET").then(res => {
+        console.log(res)
+        200 == res.statusCode && my.setStorageSync({'key':"userInfo",data:res.data})
+        this.setData({
+          userInfo: res.data,
+          deposit: my.getStorageSync({'key':'userState'}).data,
+          setting:my.getStorageSync({'key':'setting'}).data
+        })
+      }).catch(err => {
+        console.log(err)
+      })
+    }
+  },
+  onReady: function () {
+
+  },
+  onShow: function () {
+    let that=this
+    this.getUser();
+    var area_id = ''
+    if (my.getStorageSync({'key':'home'}).data.id != undefined) {
+      area_id = my.getStorageSync({'key':'home'}).data.id
+    }
+    var data = {
+      'area_id': area_id
+    }
+    app.request("/card_riding/user_card", data, "GET").then(res => {
+      console.log(res)
+      that.setData({ arr: res.data.user_card, show: res.data.is_card_begin })
+    })
+  },
+  onHide: function () {
+
+  },
+  onUnload: function () {
+
+  },
+  onPullDownRefresh: function () {
+
+  },
+  onReachBottom: function () {
+
+  },
+  onShareAppMessage: function () {
+
+  },
+  adDetail: function () {
+    my.navigateTo({
+      url: '/pages/ride_zige/ride_zige',
+    })
+  },
+  balance: function () {
+    my.navigateTo({
+      url: '/pages/balance/balance',
+    })
+  },
+  coupon: function () {
+    my.navigateTo({
+      url: '/pages/coupon/coupon',
+    })
+  },
+  myCard: function () {
+    my.navigateTo({
+      url: '/pages/mine_card/mine_card',
+    })
+  },
+  rideZige: function () {
+      my.navigateTo({
+        url: '/pages/ride_zige/ride_zige',
+      })
+  },
+  setUp: function () {
+    my.navigateTo({
+      url: '/pages/set_up/set_up',
+    })
+  },
+  mineData: function () {
+    my.navigateTo({
+      url: '/pages/mine_data/mine_data',
+    })
+  },
+  trip: function () {
+    my.navigateTo({
+      url: '/pages/trip/trip',
+    })
+  },
+  accountDetails: function () {
+    my.navigateTo({
+      url: '/pages/account_details/account_details',
+    })
+  },
+  weizhang: function () {
+    my.navigateTo({
+      url: '/pages/weizhang/weizhang',
+    })
+  },
+  buyCard: function () {
+    my.navigateTo({
+      // url: '/pages/ride_zige/ride_zige',
+      url: '/pages/buy-card/buy-card'
+    })
+  }
+})

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