MrShi
3 小时以前 658107c8a09e2ef74bab1ad7114eeaf367848a25
bicycle/pages/index/index.vue
@@ -4,12 +4,27 @@
         :style="{ height: 'calc(' + (statusbarHeight + navHeight) + 'px' + ' + ' + '224rpx' + ')' }">
         <view class="index_nav_a" :style="{ height: statusbarHeight + 'px' }"></view>
         <view :style="{ height: navHeight + 'px' }"></view>
         <view class="index_nav_b" :style="{ height: navHeight + 'px', lineHeight: navHeight + 'px', top: statusbarHeight + 'px' }">
            <text>印象滨湖自行车</text>
         <view class="index_nav_box" :style="{ background: top > 0 ? '#9AE2DF' : 'rgba(0,0,0,0)' }">
            <view class="index_nav_a" :style="{ height: statusbarHeight + 'px' }"></view>
            <view :style="{ height: navHeight + 'px' }"></view>
            <view class="index_nav_b" :style="{ height: navHeight + 'px', lineHeight: navHeight + 'px', top: statusbarHeight + 'px' }">
               <text>印象滨湖趣味自行车</text>
            </view>
         </view>
         <view class="index_box">
            <view class="index_box_map">
               <map class="map" :show-location="true" :markers="markers" :latitude="latitude" :longitude="longitude" />
               <map
                  id="mapId"
                  class="map"
                  scale="15"
                  :show-location="mapShowLocation"
                  :polygons="eleBusinessArea"
                  :markers="markers"
                  :latitude="latitude"
                  :longitude="longitude" />
               <view class="index_box_map_type">
                  <view :class="type === item.id ? 'index_box_map_type_row active' : 'index_box_map_type_row'" v-for="(item, index) in types" :key="index" @click="clickType(item.id)">{{item.name}}</view>
               </view>
               <view class="index_box_icon" @click="jumpMap">
                  <image src="@/static/icon/ic_fullscreen@2x.png" mode="widthFix"></image>
               </view>
@@ -23,18 +38,59 @@
               </image>
            </view>
            <view class="index_box_function">
               <view class="cXYC" v-for="(item, index) in functionList" :key="index" @click="jump(item)">
               <view class="cXYC" :style="{ marginTop: item.id === 5 ? '30rpx' : '' }" v-for="(item, index) in functionList" :key="index" @click.stop="jump(item)">
                  <button open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="!userInfo.mobile"></button>
                  <image class="img80" :src="item.icon" mode="widthFix"></image>
                  <text class="f26 c3 mt10">{{item.name}}</text>
               </view>
            </view>
            <view class="index_box_poster" @click="jumpX">
               <image class="imgfull" :src="info.leaseNoticeUrl" mode="widthFix"></image>
            <view class="index_box_vip" v-if="tcList.length > 0">
               <view class="index_box_vip_head">
                  <text>热销套餐</text>
                  <button open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="!userInfo.mobile">获取手机号</button>
                  <text @click="jumpTC">更多优惠 ></text>
               </view>
               <scroll-view scroll-x class="scrollView">
                  <view class="index_box_vip_row" v-for="(item, index) in tcList" :key="index">
                     <view class="vip1">
                        <view class="vip1_left">
                           {{item.name || ''}}
                        </view>
                        <view class="vip1_right">
                           {{item.price || ''}}
                        </view>
                     </view>
                     <view class="vip2">
                        <text>{{item.descs || ''}}</text>
                        <u>¥{{item.linePrice || ''}}</u>
                     </view>
                     <view class="vip3">
                        <view class="vip3_info">低至{{item.dayPrice}}元/天</view>
                        <button class="vip3_button" open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="!userInfo.mobile">购买</button>
                        <view class="vip3_button" @click="purchase(item.id)" v-else>购买</view>
                     </view>
                  </view>
               </scroll-view>
            </view>
            <!-- <view class="index_box_poster" @click="jumpX">
               <image class="imgfull" :src="info.leaseNoticeUrl" mode="widthFix"></image>
            </view> -->
            <view class="index_box_video" v-if="info.leaseVideoUrl">
               <video class="img100b" :src="info.leaseVideoUrl" enable-danmu danmu-btn controls></video>
            </view>
            <view class="index_zw"></view>
            <template v-if="info.memberRidesResponse && info.memberRidesResponse.ridesType === 0">
               <view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 600rpx);" v-if="show5"></view>
               <view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 660rpx);" v-else-if="show6"></view>
               <view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 660rpx);" v-else-if="show2"></view>
               <view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 580rpx);" v-else-if="show1"></view>
               <view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 500rpx);" v-else-if="show3"></view>
               <view class="index_zw1" v-else></view>
            </template>
            <template v-else-if="info.memberRidesResponse && info.memberRidesResponse.ridesType === 1">
               <view style="width: 100%; height: calc(env(safe-area-inset-bottom) + 660rpx);" v-if="$refs.d_tram.d_show3 || $refs.d_tram.d_show4"></view>
               <view class="index_zw1" v-else></view>
            </template>
            <view class="index_zw1" v-else></view>
         </view>
      </view>
      <view class="index_scancode">
@@ -45,19 +101,43 @@
            </view>
            <image src="@/static/images/ic_safe@2x.png" mode="widthFix"></image>
         </view>
         <button class="index_scancode_bottom" open-type="getPhoneNumber" @getphonenumber="getPhone"
            v-if="!userInfo.mobile">扫码租车</button>
         <view class="index_scancode_fl" v-if="taocan.length > 0">
            <view class="index_scancode_fl_tips">福利</view>
            <swiper v-if="taocan.length > 1" class="index_scancode_fl_swiper" vertical autoplay circular interval="3000" duration="500" :indicator-dots="false">
               <swiper-item v-for="(item, index) in taocan" :key="index">
                  <view class="index_scancode_fl_text">仅需{{ item.price || 0 }}元 可得“{{ item.name || '' }}”骑行卡</view>
               </swiper-item>
            </swiper>
            <view v-else class="index_scancode_fl_text">仅需{{ taocan[0] ? taocan[0].price || 0 : 0 }}元 可得“{{ taocan[0] ? taocan[0].name || '' : '' }}”骑行卡</view>
            <view class="index_scancode_fl_btn" @click="jumpTC">去看看</view>
         </view>
         <button class="index_scancode_bottom" open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="!userInfo.mobile">扫码租车</button>
         <view class="index_scancode_bottom" @click="carRental" v-else>扫码租车</view>
         <view class="index_scancode_xieyi">
            <text @click.stop="jumpgz">计费规则</text>
            <text>|</text>
            <text @click.stop="jumpX">租赁须知</text>
         </view>
         <view class="index_scancode_zw"></view>
      </view>
      <!-- 缴纳押金 -->
      <u-popup :show="show1" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
      <!-- 自行车-缴纳押金 -->
      <u-popup :show="show1" :closeOnClickOverlay="true" mode="bottom" bgColor="#fff" :round="10"
         @close="show1 = false">
         <view class="deposit">
            <view class="deposit_text">
               <text>温馨提示</text>
               <text>骑行需要缴纳{{(info.deposit / 100).toFixed(2)}}元自行车押金</text>
               <text>(押金随时可退)</text>
            </view>
            <view class="index_scancode_fl" v-if="taocan.length > 0">
               <view class="index_scancode_fl_tips">福利</view>
               <swiper v-if="taocan.length > 1" class="index_scancode_fl_swiper" vertical autoplay circular interval="3000" duration="500" :indicator-dots="false">
                  <swiper-item v-for="(item, index) in taocan" :key="index">
                     <view class="index_scancode_fl_text">仅需{{ item.price || 0 }}元 可得“{{ item.name || '' }}”骑行卡</view>
                  </swiper-item>
               </swiper>
               <view v-else class="index_scancode_fl_text">仅需{{ taocan[0] ? taocan[0].price || 0 : 0 }}元 可得“{{ taocan[0] ? taocan[0].name || '' : '' }}”骑行卡</view>
               <view class="index_scancode_fl_btn" @click="jumpTC">去看看</view>
            </view>
            <view class="deposit_read" @click="active = !active">
               <image src="@/static/icon/ic_select@2x.png" mode="widthFix" v-if="!active"></image>
@@ -72,8 +152,8 @@
            </view>
         </view>
      </u-popup>
      <!-- 开锁 -->
      <u-popup :show="show5" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
      <!-- 自行车-开锁 -->
      <u-popup :show="show5" :overlay="false" :closeOnClickOverlay="true" mode="bottom" bgColor="#fff" :round="10"
         @close="show5 = false">
         <view class="loading">
            <view class="loading_box">
@@ -89,8 +169,8 @@
            </view> -->
         </view>
      </u-popup>
      <!-- 骑行中 -->
      <u-popup :show="show2" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
      <!-- 自行车-骑行中 -->
      <u-popup :show="show2" overlayOpacity="0" :closeOnClickOverlay="true" mode="bottom" bgColor="#fff" :round="10"
         @close="show2 = false">
         <view class="ride">
            <view class="ride_head">
@@ -106,6 +186,12 @@
                  <text>骑行明细</text>
                  <image src="@/static/icon/ar_detail@2x.png" mode="widthFix"></image>
               </view>
            </view>
            <!-- 有套餐显示 -->
            <view class="info_des_tc" v-if="info && info.memberRidesResponse && info.memberRidesResponse.discountMember">
               <u-icon name="info-circle" color="#FF5A31" size="18"></u-icon>
               <text v-if="info.memberRidesResponse.discountMember.limitType === 0">您有骑行套餐,本次行程免费骑行</text>
               <text v-if="info.memberRidesResponse.discountMember.limitType === 1">您已购买骑行套餐,本次行程免费骑行{{convertMinutesToHours(info.memberRidesResponse.discountMember.surplusTime)}}~</text>
            </view>
            <view class="ride_content" v-if="info.memberRidesResponse">
               <view class="ride_content_a">
@@ -128,8 +214,8 @@
            </view>
         </view>
      </u-popup>
      <!-- 已还车 -->
      <u-popup :show="show6" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
      <!-- 自行车-已还车 -->
      <u-popup :show="show6" overlayOpacity="0" :closeOnClickOverlay="true" mode="bottom" bgColor="#fff" :round="10"
         @close="show6 = false">
         <view class="ride">
            <view class="ride_head">
@@ -145,6 +231,12 @@
                  <text>骑行明细</text>
                  <image src="@/static/icon/ar_detail@2x.png" mode="widthFix"></image>
               </view>
            </view>
            <!-- 有套餐显示 -->
            <view class="info_des_tc" v-if="info && info.memberRidesResponse && info.memberRidesResponse.discountMember">
               <u-icon name="info-circle" color="#FF5A31" size="18"></u-icon>
               <text v-if="info.memberRidesResponse.discountMember.limitType === 0">您有骑行套餐,本次行程免费骑行</text>
               <text v-if="info.memberRidesResponse.discountMember.limitType === 1">您已购买骑行套餐,本次行程免费骑行{{convertMinutesToHours(info.memberRidesResponse.discountMember.surplusTime)}}~</text>
            </view>
            <view class="ride_content" v-if="info.memberRidesResponse">
               <view class="ride_content_a">
@@ -165,8 +257,8 @@
            </view>
         </view>
      </u-popup>
      <!-- 确认结算 -->
      <u-popup :show="show3" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" @close="show3 = false">
      <!-- 自行车-确认结算 -->
      <u-popup :show="show3" :closeOnClickOverlay="true" mode="bottom" bgColor="#fff" :round="10" @close="show3 = false">
         <template>
            <view class="deposit1">
               <view class="deposit_text">
@@ -182,11 +274,11 @@
         </template>
      </u-popup>
      <!-- 提示 -->
      <u-modal :show="show4" :content='content' confirmColor="#01B6AD" @confirm="show4 = false"></u-modal>
      <!-- 确认结算弹框 -->
      <u-modal :show="show4" :title="title" :content='content' confirmColor="#01B6AD" @confirm="show4 = false"></u-modal>
      <!-- 自行车-确认结算弹框 -->
      <u-modal :show="show7" title="提示" content='确认结算吗?' :showCancelButton="true" cancelText="取消" @confirm="settlement1" @cancel="show7 = false"></u-modal>
      <!-- 广告 -->
      <u-popup :show="show" mode="center" bgColor="transparent" :round="10" @close="show = false">
      <u-popup :show="show" mode="center" :overlayStyle="{ zIndex: '99999' }" :closeOnClickOverlay="true" zIndex="99999" bgColor="transparent" :round="10" @close="show = false">
         <view class="popupbox">
            <view class="advertisement">
               <image :src="info.adList[0].imgfullurl" mode="widthFix"></image>
@@ -195,6 +287,8 @@
            </image>
         </view>
      </u-popup>
      <!-- 电车 -->
      <tram ref="d_tram" @unlockDoor="refresh('tram')" />
   </view>
</template>
@@ -202,10 +296,15 @@
   import {
      mapState
   } from 'vuex'
   import tram from '@/components/tram/tram.vue'
   export default {
      data() {
         return {
            disable: false,
            top: 0,
            title: '',
            latitude: null,
            longitude: null,
            bgImg: require('@/static/images/bg_service@2x.png'),
@@ -235,394 +334,88 @@
               },
               {
                  id: 3,
                  name: '计价规则',
                  icon: require('@/static/images/home_ic_guize@2x.png')
                  name: '团购验券',
                  icon: require('@/static/images/home_ic_yajing@x.png')
               },
               {
                  id: 4,
                  name: '消费明细',
                  icon: require('@/static/images/home_ic_mingxi@2x.png')
               },
                  name: '个人中心',
                  icon: require('@/static/images/home_ic_jiesuan@x.png')
               }
            ],
            info: {},
            content: '',
            
            timer: null,
            isDisabled: true
            isDisabled: true,
            tcList: [],
            type: 1,
            types: [
               { name: '自行车', id: 1 },
               { name: '电动车', id: 2 }
            ],
            eleBusinessArea: [
               {
                  points: [],
                  fillColor: "#0077FF12",
                  strokeColor: "#0077FF",
                  strokeWidth: 3,
                  zIndex: 7
               }
            ],
            onPullDownRefresh: false,
            timerdian: null,
            taocan: [],
            mapShowLocation: false
         }
      },
      components: { tram },
      computed: {
         ...mapState(['navHeight', 'statusbarHeight', 'userInfo'])
      },
      async onLoad() {
         if (JSON.stringify(this.userInfo) == '{}') {
            await this.$onLaunched;
         }
         this.getAddress()
         this.getHomeInfo()
         this.getSite()
      },
      methods: {
         jumpX() {
            uni.navigateTo({
               url: '/pages/leaseNotice/leaseNotice'
            });
         },
         jumpMap() {
            uni.navigateTo({
               url: '/pages/maps/maps'
            });
         },
         // 计价规则
         jumpgz() {
            uni.navigateTo({
               url: '/pages/pricingRules/pricingRules'
            });
         },
         getSite() {
            this.$u.api.rentSiteList()
               .then(res => {
                  if (res.code === 200) {
                     this.markers = []
                     res.data.forEach((item, index) => {
                        this.markers.push({
                           id: index,
                           width: 30,
                           height: 40,
                           latitude: item.latitude,
                           longitude: item.longitude,
                           title: item.name,
                           iconPath: '/static/icon/ic_bike@2x.png',
                           addr: item.addr
                        })
                     })
                  }
               })
         },
         // 结算
         settlement1() {
            if (this.isDisabled) {
               this.isDisabled = false
               this.$u.api.goodsOrderSettlement({}).then(res => {
                  if (res.code === 200) {
                     this.refresh()
                     uni.showToast({ title: '结算成功!', icon: 'success', duration: 2000 });
                     this.show3 = false
                     this.show7 = false
                     this.isDisabled = true
                  }
               })
            }
         },
         minute() {
            this.show3 = false
            if (this.info.rideStatus !== -1) {
               this.show6 = true
            }
         },
         settlement() {
            this.show6 = false
            this.show3 = true
         },
         // 导航到还车点
         navigationReturn() {
            uni.navigateTo({
               url: '/pages/maps/maps'
            });
         },
         // 跳转
         jump(item) {
            if (item.id === 3) {
               uni.navigateTo({
                  url: '/pages/pricingRules/pricingRules'
               });
            } else if (item.id === 4) {
               uni.navigateTo({
                  url: '/pages/consumptionDetails/consumptionDetails'
               });
            } else if (item.id === 2) {
               if (this.info.depositStatus === 1) {
                  this.show3 = true
               } else {
                  uni.showToast({ title: '您暂无押金,无需结算!', icon: 'none', duration: 2000 });
               }
            } else if (item.id === 1) {
               if (this.info.depositStatus === 1) {
                  uni.showToast({ title: '押金已充值', icon: 'none', duration: 2000 });
                  return
               }
               this.show1 = true
            }
         },
         // 骑行明细
         toRidingDetails() {
            uni.navigateTo({
               url: `/pages/ridingDetails/ridingDetails?id=${this.info.goodsOrderId}`
            });
         },
         // 跳转故障上报
         toFaultReporting() {
            uni.navigateTo({
               url: `/pages/problemReporting/problemReporting?code=${this.info.memberRidesResponse.bikeCode}`
            });
         },
         // 押金支付
         depositPayment() {
            if (this.active) {
               var that = this;
               this.$u.api.createGoodsOrderPay()
                  .then(res => {
                     if (res.code === 200) {
                        wx.requestPayment({
                           timeStamp: res.data.timeStamp,
                           nonceStr: res.data.nonceStr,
                           package: res.data.packageValue,
                           signType: 'MD5',
                           paySign: res.data.paySign,
                           success (res) {
                              if (res.errMsg = 'requestPayment:ok') {
                                 that.show1 = false
                                 that.info.depositStatus = 1
                                 that.carRental()
                                 that.refresh()
                                 uni.showToast({ title: '充值成功', icon: 'success', duration: 2000 });
                              }
                           },
                           fail(err) {
                              console.log(err)
                           }
                        })
                     }
                  })
            } else {
               uni.showToast({
                  title: '请先勾选协议',
                  icon: 'none',
                  duration: 2000
               });
            }
         },
         // 获取手机号
         getPhone(e) {
            var that = this;
            if (e.detail.errMsg === 'getPhoneNumber:ok') {
               uni.login({
                  provider: 'weixin',
                  success: function(loginRes) {
                     let {
                        code
                     } = loginRes;
                     that.$u.api.wxLogin({
                        code
                     })
                     .then(res => {
                        that.$u.api.wxPhone({
                           encryptedData: e.detail.encryptedData,
                           iv: e.detail.iv,
                           sessionKey: res.data.sessionKey
                        }).then(result => {
                           if (result.code === 200) {
                              that.$store.commit('setUserInfo', result.data
                                 .userResponse)
                           }
                        })
                     })
                  }
               });
            }
         },
         // 扫码租车
         carRental() {
            // 判断有没有交押金
            if (this.info.depositStatus === 0) {
               this.show1 = true
               return;
            }
            var that = this;
            // 扫码解锁骑行
            uni.scanCode({
               success: async function(result) {
                  // 打开开锁弹框
                  that.show5 = true
                  // 调用开锁接口
                  let res = await that.$u.api.openLock({
                     code: result.result
                  })
                  if (res.code === 200) {
                     that.show6 = false
                     that.show5 = true
                     // 循环次数
                     var num = 1
                     // 循环查看解锁结果
                     let timer = setInterval(async () => {
                        num += 1
                        let res1 = await that.$u.api.refreshLock({
                           id: res.data.id
                        })
                        // 开锁成功
                        if (res1.data.status === 1) {
                           that.refresh()
                           clearInterval(timer)
                           that.show5 = false
                           setTimeout(() => {
                              that.show2 = true
                           }, 500)
                        }
                        // 开锁失败
                        if (res1.data.status === 3) {
                           that.refresh()
                           clearInterval(timer)
                           that.show5 = false
                           uni.showToast({ title: '开锁失败', icon: 'error', duration: 2000 });
                        }
                        // 开锁超时
                        if (num === 180) {
                           that.refresh()
                           clearInterval(timer)
                           that.show5 = false
                           uni.showToast({ title: '开锁超时', icon: 'error', duration: 2000 });
                        }
                     }, 1000)
                  } else {
                     that.show5 = false
                  }
               }
            });
         },
         // 获取经纬度
         getAddress() {
            let that = this;
            // 1、判断手机定位服务【GPS】 是否授权
            uni.getSystemInfo({
               success(res) {
                  let locationEnabled = res.locationEnabled; // 判断手机定位服务是否开启
                  let locationAuthorized = res.locationAuthorized; // 判断定位服务是否允许微信授权
                  if (locationEnabled == false || locationAuthorized == false) {
                     //手机定位服务(GPS)未授权
                     uni.showToast({ title: "请打开手机GPS", icon: "none" });
                  } else {
                     // 2、判断微信小程序是否授权位置信息
                     uni.authorize({
                        //授权请求窗口
                        scope: "scope.userLocation",
                        success: (res) => {
                           that.fnGetlocation();
                        },
                        fail: (err) => {
                           err = err["errMsg"];
                           uni.showModal({ content: "需要授权位置信息", confirmText: "确认授权" })
                           .then((res) => {
                              if (res.confirm) {
                                 uni.openSetting({
                                    success: (res) => {
                                       if (res.authSetting["scope.userLocation"]) {
                                          // 授权成功
                                          uni.showToast({ title: "授权成功", icon: "none" });
                                          that.fnGetlocation();
                                       } else {
                                          // 未授权
                                          uni.showToast({ title: "授权失败,请重新授权", icon: "none" });
                                          uni.showModal({
                                             title: "授权",
                                             content: "获取授权" + authouName + "失败,是否前往授权设置?",
                                             success: function(result) {
                                                if (result.confirm) {
                                                   uni.openSetting();
                                                }
                                             },
                                             fail: function() {
                                                uni.showToast({ title: "系统错误!", icon: "none" });
                                             }
                                          });
                                       }
                                    }
                                 });
                              }
                              if (res.cancel) {
                                 // 取消授权
                                 uni.showToast({ title: "你拒绝了授权,无法获得周边信息", icon: "none" });
                              }
                           });
                        },
                        complete(res) {
                           if (res.errMsg == "authorize:ok") {
                              that.fnGetlocation();
                           } else {
                              uni.showModal({
                                 title: "授权",
                                 content: "获取授权" + authouName + "失败,是否前往授权设置?",
                                 success: function(result) {
                                    if (result.confirm) {
                                       uni.openSetting();
                                    }
                                 },
                                 fail: function() {
                                    uni.showToast({ title: "系统错误!", icon: "none" });
                                 },
                              });
                           }
                        },
                     });
                  }
               },
            });
         },
         // 定位获取
         fnGetlocation() {
            let that = this;
            uni.getLocation({
               type: "gcj02",
               altitude: true,
               isHighAccuracy: true,
               success: function(res) {
                  that.latitude = res.latitude
                  that.longitude = res.longitude
               },
               fail(err) {
                  if (err.errMsg === "getLocation:fail 频繁调用会增加电量损耗,可考虑使用 wx.onLocationChange 监听地理位置变化") {
                     uni.showToast({ title: "请勿频繁定位", icon: "none" });
                  }
                  if (err.errMsg === "getLocation:fail auth deny") {
                     // 未授权
                     uni.showToast({ title: "无法定位,请重新获取位置信息", icon: "none" });
                  }
                  if (err.errMsg === "getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF") {
                     uni.showModal({ content: "请开启手机定位服务", showCancel: false });
                  }
               },
            });
         },
         // 刷新骑行状态
         refreshStatus() {
            this.timer = setInterval(async () => {
               let res = await this.$u.api.home()
      async onLoad(options) {
         var that = this;
         await this.$onLaunched;
         await this.getAddress()
         // await this.getHomeInfo()
         await this.getSite()
         this.$u.api.home()
            .then(async res => {
               if (res.code === 200) {
                  this.info = res.data
                  // 骑行中
                  if (res.data.rideStatus === 1) {
                     return
                  let code = decodeURIComponent(options.scene)
                  // 是否弹出广告图
                  if (res.data.adList.length > 0 && !res.data.memberRidesResponse) {
                     this.show = true
                  }
                  this.show2 = false
                  // 已换车
                  if (res.data.rideStatus === 2) {
                     this.show6 = true
                  }
                  clearInterval(this.timer)
               }
            }, 10000)
         },
         // 获取首页信息
         getHomeInfo() {
            this.$u.api.home()
               .then(res => {
                  if (res.code === 200) {
                     this.info = res.data
                     // 是否弹出广告图
                     if (res.data.adList.length > 0) {
                        this.show = true
                  if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 0 && code !== 'undefined' && res.data.rideStatus !== 2) {
                     let typeName = ''
                     if (code.substring(0, code.indexOf('-')) === 'ebike') {
                        typeName = '电动车'
                     } else {
                        typeName = '自行车'
                     }
                     uni.showToast({
                        title: `当前存在未结算自行车订单,请先结算订单后再扫码租${typeName}`,
                        icon: 'none'
                     })
                  } else if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 1 && code !== 'undefined') {
                     let typeName = ''
                     if (code.substring(0, code.indexOf('-')) === 'ebike') {
                        typeName = '电动车'
                     } else {
                        typeName = '自行车'
                     }
                     uni.showToast({
                        title: `当前存在未结算电动车订单,请先结算订单后再扫码租${typeName}`,
                        icon: 'none'
                     })
                  }
                  // 自行车
                  if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 0) {
                     // 解锁中
                     if (res.data.rideStatus === 0) {
                        this.show5 = true
@@ -666,69 +459,805 @@
                     }
                     if (res.data.rideStatus === 2) {
                        this.show6 = true
                        this.refreshStatus()
                     }
                  } else if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 1) {
                     that.$refs.d_tram.info = {
                        ...res.data.memberRidesResponse.discountMember,
                        ...res.data.memberRidesResponse,
                        deposit: res.data.deposit,
                        goodsOrderId: res.data.goodsOrderId
                     }
                     // 骑行中
                     if (res.data.rideStatus === 1) {
                        that.$refs.d_tram.d_show3 = true
                     }
                     // 临时锁车
                     if (res.data.rideStatus === 4) {
                        that.$refs.d_tram.d_show4 = true
                     }
                     // 轮询刷新电车骑行状态
                     that.refreshTram()
                  // 没有骑行订单
                  } else if (!res.data.memberRidesResponse) {
                     if (decodeURIComponent(options.scene) !== 'undefined') {
                        let code = decodeURIComponent(options.scene)
                        if (code.substring(0, code.indexOf('-')) === 'ebike') {
                           console.log('电动车')
                           this.carRentalCopy(decodeURIComponent(options.scene), 2)
                        } else {
                           console.log('自行车')
                           this.carRentalCopy(decodeURIComponent(options.scene), 1)
                        }
                     }
                  }
                  // 是否营业
                  if (res.data.isBusiness === 0) {
                     this.title = '暂停营业提醒'
                     this.content = res.data.unBusinessTips
                     this.show4 = true
                     return
                  }
                  // 是否停止服务
                  if (res.data.isStopServe === 1) {
                     this.title = '暂停服务提醒'
                     this.content = res.data.stopServeTips
                     this.show4 = true
                  }
                  this.tcList = res.data.discountList
                  let arr = JSON.parse(res.data.eleBusinessArea)
                  this.eleBusinessArea[0].points = arr.map(item => {
                     return {
                        latitude: item.lat,
                        longitude: item.lng
                     }
                  })
               }
            })
         this.getTC()
         uni.$on('update', data => {
            this.carRental()
         })
         uni.$on('sweep', () => {
            this.carRental()
         })
      },
      onPullDownRefresh() {
         this.onPullDownRefresh = true
         this.refresh()
      },
      async onShow() {
         await this.$onLaunched;
         this.refresh()
      },
      onPageScroll(e) {
         this.top = e.scrollTop
      },
      methods: {
         // 热销套餐
         getTC() {
            this.$u.api.discountPage({
               capacity: 10,
               page: 1,
               model: {}
            }).then(res => {
               if (res.code === 200) {
                  this.taocan = res.data.records
               }
            })
         },
         // 分钟转换
         convertMinutesToHours(minutes) {
             const hours = Math.floor(minutes / 60);  // 计算小时数
             const remainingMinutes = minutes % 60;  // 计算剩余的分钟数
            if (hours > 0 && remainingMinutes > 0) {
               return `${hours}小时${remainingMinutes}分钟`;
            } else if (hours == 0) {
               return `${remainingMinutes}分钟`;
            } else if (remainingMinutes == 0) {
               return `${hours}小时`;
            }
         },
         clickcontrol() {
            let mapObjs = uni.createMapContext('mapId', this)
            mapObjs.moveToLocation({
               complete: res => {
                  console.log('移动完成:', res)
               }
            })
         },
         async getEleBikeList() {
            let res = await this.$u.api.eleBikeList({})
            if (res.code === 200) {
               this.markers = []
               res.data.forEach((item, index) => {
                  this.markers.push({
                     id: index,
                     width: 40,
                     height: 40,
                     latitude: item.latitude,
                     longitude: item.longitude,
                     title: item.name,
                     iconPath: '/static/icon/ic_bike@2x.png'
                  })
               })
               this.clickcontrol()
            }
         },
         clickType(id) {
            this.type = id
            if (id === 1) {
               this.getSite()
            } else {
               this.getEleBikeList()
            }
         },
         purchase(id) {
            uni.navigateTo({
               url: `/pages/packageDetails/packageDetails?id=${id}`
            });
         },
         jumpTC() {
            uni.navigateTo({
               url: '/pages/setMenu/setMenu'
            });
         },
         // 微信打开小程序开锁方法
         async carRentalCopy(code, type) {
            var that = this;
            let ddd = await this.$u.api.home()
            if (ddd.code === 200) {
               this.info = ddd.data
               // 判断有没有交押金
               if (this.info.depositStatus === 0) {
                  this.show1 = true
                  return;
               } else if (this.info.depositStatus === 2) {
                  uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 });
                  return;
               }
               // 自行车
               if (type === 1) {
                   if (!that.disable) {
                      that.disable = true
                      // 打开开锁弹框
                      that.show5 = true
                      // 调用开锁接口
                      let res = await that.$u.api.openLock({
                         code: code
                      })
                      if (res.code === 200) {
                         that.disable = false
                         that.show6 = false
                         that.show5 = true
                         // 循环次数
                         var num = 1
                         // 循环查看解锁结果
                         let timer = setInterval(async () => {
                            num += 1
                            let res1 = await that.$u.api.refreshLock({
                               id: res.data.id
                            })
                            // 开锁成功
                            if (res1.data.status === 1) {
                               that.refresh()
                               clearInterval(timer)
                               that.show5 = false
                               setTimeout(() => {
                                  that.show2 = true
                               }, 500)
                            }
                            // 开锁失败
                            if (res1.data.status === 3) {
                               that.refresh()
                               clearInterval(timer)
                               that.show5 = false
                               uni.showToast({ title: '开锁失败', icon: 'error', duration: 2000 });
                            }
                            // 开锁超时
                            if (num === 180) {
                               that.refresh()
                               clearInterval(timer)
                               that.show5 = false
                               uni.showToast({ title: '开锁超时', icon: 'error', duration: 2000 });
                            }
                         }, 1000)
                      } else {
                         that.show5 = false
                         that.disable = false
                      }
                   }
               } else {
                  let res = await that.$u.api.getBikeChargingRule({ code: code })
                  if (res.code === 200) {
                     that.$refs.d_tram.info = res.data
                     that.$refs.d_tram.d_show1 = true
                  }
               }
            }
         },
         jumpX() {
            uni.navigateTo({
               url: '/pages/leaseNotice/leaseNotice'
            });
         },
         jumpMap() {
            uni.navigateTo({
               url: `/pages/maps/maps?type=${this.type}`
            });
         },
         // 计价规则
         jumpgz() {
            uni.navigateTo({
               url: '/pages/pricingRules/pricingRules'
            });
         },
         getSite() {
            this.$u.api.rentSiteList()
               .then(res => {
                  if (res.code === 200) {
                     this.markers = []
                     res.data.forEach((item, index) => {
                        this.markers.push({
                           id: index,
                           width: 40,
                           height: 40,
                           latitude: item.latitude,
                           longitude: item.longitude,
                           title: item.name,
                           iconPath: '/static/icon/ic_bike@2x.png',
                           addr: item.addr
                        })
                     })
                     this.clickcontrol()
                  }
               })
         },
         // 结算
         settlement1() {
            if (this.isDisabled) {
               this.isDisabled = false
               this.$u.api.goodsOrderSettlement({}).then(res => {
                  if (res.code === 200) {
                     this.show3 = false
                     this.show6 = false
                     this.show7 = false
                     uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 });
                     // this.refresh()
                  }
               }).finally(() => {
                  this.refresh()
                  this.show3 = false
                  this.isDisabled = true
               })
            }
         },
         minute() {
            this.show3 = false
            if (this.info.rideStatus != -1) {
               this.show6 = true
            }
         },
         settlement() {
            if (this.info.depositStatus === 2) {
               uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 });
               return
            }
            this.show6 = false
            this.show3 = true
         },
         // 导航到还车点
         navigationReturn() {
            uni.navigateTo({
               url: '/pages/maps/maps'
            });
         },
         // 跳转
         async jump(item) {
            if (!this.userInfo || !this.userInfo.mobile) return
            await this.refresh()
            if (item.id === 3) {
               // uni.navigateTo({
               //    url: '/pages/pricingRules/pricingRules'
               // });
               uni.navigateTo({
                  url: '/pages/couponRedemption/couponRedemption'
               });
            } else if (item.id === 4) {
               uni.navigateTo({
                  url: '/pages/personalCenter/personalCenter'
               });
            } else if (item.id === 5) {
               if (!this.userInfo.sysuser) {
                  uni.navigateTo({
                     url: '/pages/operationLogin/operationLogin'
                  });
               } else {
                  uni.navigateTo({
                     url: '/pages/operationsCenter/operationsCenter'
                  });
               }
            } else if (item.id === 2) {
               if (!this.userInfo.mobile) return
               if (this.info.rideStatus === 1) {
                  uni.showToast({ title: '骑行中不能结算押金', icon: 'none', duration: 2000 })
                  return
               }
               if (this.info.depositStatus === 1) {
                  this.show3 = true
               } else if (this.info.depositStatus === 2) {
                  uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 });
               } else {
                  uni.showToast({ title: '您暂无押金,无需结算!', icon: 'none', duration: 2000 });
               }
            } else if (item.id === 1) {
               if (!this.userInfo.mobile) return
               if (this.info.depositStatus === 1) {
                  uni.showToast({ title: '押金已充值', icon: 'none', duration: 2000 });
                  return
               } else if (this.info.depositStatus === 2) {
                  uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 });
                  return
               }
               this.show1 = true
            }
         },
         // 骑行明细
         toRidingDetails() {
            uni.navigateTo({
               url: `/pages/ridingDetails/ridingDetails?id=${this.info.goodsOrderId}&price=${this.info.deposit / 100}`
            });
         },
         // 跳转故障上报
         toFaultReporting() {
            uni.navigateTo({
               url: `/pages/problemReporting/problemReporting?code=${this.info.memberRidesResponse.bikeCode}`
            });
         },
         // 押金支付
         depositPayment() {
            var that = this;
            if (this.active) {
               if (!this.disable) {
                  that.disable = true
                  that.$u.api.createGoodsOrderPay()
                     .then(res => {
                        if (res.code === 200) {
                           wx.requestPayment({
                              timeStamp: res.data.timeStamp,
                              nonceStr: res.data.nonceStr,
                              package: res.data.packageVal,
                              signType: 'MD5',
                              paySign: res.data.paySign,
                              success (res) {
                                 that.disable = false
                                 if (res.errMsg = 'requestPayment:ok') {
                                    that.show1 = false
                                    that.info.depositStatus = 1
                                    that.carRental()
                                    uni.showToast({ title: '充值成功', icon: 'success', duration: 2000 });
                                 }
                              },
                              fail(err) {
                                 that.disable = false
                              }
                           })
                        }
                     }).catch((err) => {
                        that.disable = false
                     })
               }
            } else {
               uni.showToast({
                  title: '请先勾选协议',
                  icon: 'none',
                  duration: 2000
               });
            }
         },
         // 获取手机号
         getPhone(e) {
            var that = this;
            if (e.detail.errMsg === 'getPhoneNumber:ok') {
               uni.login({
                  provider: 'weixin',
                  success: function(loginRes) {
                     let {
                        code
                     } = loginRes;
                     that.$u.api.wxLogin({
                        code
                     }).then(res => {
                        that.$store.commit('setToken', res.data.token)
                        that.$u.api.wxPhone({
                           encryptedData: e.detail.encryptedData,
                           iv: e.detail.iv,
                           sessionKey: res.data.sessionKey
                        }).then(result => {
                           if (result.code === 200) {
                              that.$store.commit('setUserInfo', result.data.userResponse)
                              uni.redirectTo({
                                url: '/pages/index/index'
                              });
                           }
                        })
                     })
                  }
               });
            }
         },
         // 扫码租车
         async carRental() {
            var that = this;
            let res = await this.$u.api.home()
            if (res.code === 200) {
               this.info = res.data
               // 判断有没有交押金
               if (this.info.depositStatus === 0) {
                  this.show1 = true
                  return;
               } else if (this.info.depositStatus === 2) {
                  uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 });
                  return;
               }
               // 扫码获取车辆信息
               uni.scanCode({
                  success: async function(result) {
                     let code = decodeURIComponent(result.path).split('=')[1]
                     let res = await that.$u.api.getBikeChargingRule({ code })
                     // 自行车
                     if (res.code === 200 && res.data.ridesType === 0) {
                        that.disable = true
                        that.show5 = true
                        // 调用开锁接口
                        let bicycle = await that.$u.api.openLock({ code })
                        if (bicycle.code === 200) {
                           that.disable = false
                           that.show6 = false
                           that.show5 = true
                           // 循环次数
                           var num = 1
                           // 循环查看解锁结果
                           let timer = setInterval(async () => {
                              num += 1
                              let res1 = await that.$u.api.refreshLock({ id: bicycle.data.id })
                              // 开锁成功
                              if (res1.data.status === 1) {
                                 that.refresh()
                                 clearInterval(timer)
                                 that.show5 = false
                                 setTimeout(() => {
                                    that.show2 = true
                                 }, 500)
                              }
                              // 开锁失败
                              if (res1.data.status === 3) {
                                 that.refresh()
                                 clearInterval(timer)
                                 that.show5 = false
                                 uni.showToast({ title: '开锁失败', icon: 'error', duration: 2000 });
                              }
                              // 开锁超时
                              if (num === 180) {
                                 that.refresh()
                                 clearInterval(timer)
                                 that.show5 = false
                                 uni.showToast({ title: '开锁超时', icon: 'error', duration: 2000 });
                              }
                           }, 1000)
                        } else {
                           that.show5 = false
                           that.disable = false
                        }
                     } else if (res.code === 200 && res.data.ridesType === 1) {
                        that.$refs.d_tram.info = res.data
                        that.$refs.d_tram.d_show1 = true
                     }
                  },
                  fail() {
                     that.disable = false
                  }
               })
            }
         },
         // 获取经纬度
         getAddress() {
            let that = this;
            // 1、判断手机定位服务【GPS】 是否授权
            uni.getSystemInfo({
               success(res) {
                  let locationEnabled = res.locationEnabled; // 判断手机定位服务是否开启
                  let locationAuthorized = res.locationAuthorized; // 判断定位服务是否允许微信授权
                  if (locationEnabled == false || locationAuthorized == false) {
                     //手机定位服务(GPS)未授权
                     uni.showToast({ title: "请打开手机GPS", icon: "none" });
                  } else {
                     that.fnGetlocation();
                  }
               },
            });
         },
         // 定位获取
         fnGetlocation() {
            let that = this;
            uni.getLocation({
               type: "gcj02",
               altitude: true,
               isHighAccuracy: true,
               success: function(res) {
                  that.mapShowLocation = true
                  that.latitude = res.latitude
                  that.longitude = res.longitude
               },
               fail(err) {
                  if (err.errMsg === "getLocation:fail auth deny" || err.errMsg === "getLocation:fail authorize no response") {
                     uni.showModal({ content: "需要授权位置信息", confirmText: "确认授权" }).then((res) => {
                        if (res.confirm) {
                           uni.openSetting({
                              success: (settingRes) => {
                                 if (settingRes.authSetting["scope.userLocation"]) {
                                    that.fnGetlocation();
                                 }
                              }
                           })
                        }
                     })
                     return
                  }
                  if (err.errMsg === "getLocation:fail 频繁调用会增加电量损耗,可考虑使用 wx.onLocationChange 监听地理位置变化") {
                     uni.showToast({ title: "请勿频繁定位", icon: "none" });
                  }
                  if (err.errMsg === "getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF") {
                     uni.showModal({ content: "请开启手机定位服务", showCancel: false });
                  }
               },
            });
         },
         // 刷新骑行状态
         refreshStatus() {
            this.timer = setInterval(async () => {
               let res = await this.$u.api.home()
               if (res.code === 200) {
                  this.info = res.data
                  // 骑行中
                  if (res.data.rideStatus === 1) {
                     return
                  }
                  this.show2 = false
                  // 已换车
                  if (res.data.rideStatus === 2) {
                     this.show6 = true
                     return
                  }
                  if (res.data.rideStatus === -1) {
                     this.show6 = false
                  }
                  clearInterval(this.timer)
               }
            }, 10000)
         },
         // 刷新电车信息
         refreshTram() {
            this.timerdian = setInterval(() => {
               this.$u.api.home()
                  .then(res => {
                     if (res.code === 200) {
                        this.info = res.data
                        // 未查到骑行订单
                        if (!res.data.memberRidesResponse) {
                           this.$refs.d_tram.d_show = false
                           this.$refs.d_tram.d_show1 = false
                           this.$refs.d_tram.d_show2 = false
                           this.$refs.d_tram.d_show3 = false
                           this.$refs.d_tram.d_show4 = false
                           this.$refs.d_tram.d_show5 = false
                           this.$refs.d_tram.d_show6 = false
                           this.$refs.d_tram.d_show7 = false
                           this.$refs.d_tram.d_show8 = false
                           this.$refs.d_tram.d_show9 = false
                           clearInterval(this.timerdian)
                           this.timerdian = null
                        }
                     }
                  })
            }, 30000)
         },
         // 获取首页信息
         getHomeInfo() {
            var that = this
            this.$u.api.home()
               .then(async res => {
                  if (res.code === 200) {
                     this.info = res.data
                     console.log('是否弹出广告图', res.data.adList.length > 0 && !res.data.memberRidesResponse)
                     // 是否弹出广告图
                     if (res.data.adList.length > 0 && !res.data.memberRidesResponse) {
                        this.show = true
                     }
                     // 自行车
                     if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 0) {
                        // 解锁中
                        if (res.data.rideStatus === 0) {
                           this.show5 = true
                           // 循环次数
                           var num = 1
                           // 循环查看解锁结果
                           let timer = setInterval(async () => {
                              num += 1
                              let res1 = await this.$u.api.refreshLock({
                                 id: res.data.memberRidesResponse.rideId
                              })
                              // 开锁成功
                              if (res1.data.status === 1) {
                                 clearInterval(timer)
                                 this.show5 = false
                                 setTimeout(() => {
                                    this.show2 = true
                                 }, 500)
                              }
                              // 开锁失败
                              if (res1.data.status === 3) {
                                 clearInterval(timer)
                                 this.show5 = false
                                 uni.showToast({ title: '开锁失败', icon: 'error', duration: 2000 });
                              }
                              // 开锁超时
                              if (num === 180) {
                                 clearInterval(timer)
                                 this.show5 = false
                                 uni.showToast({ title: '开锁超时', icon: 'error', duration: 2000 });
                              }
                           }, 1000)
                        }
                        // 骑行中
                        if (res.data.rideStatus === 1) {
                           this.show2 = true
                           this.refreshStatus()
                        }
                        if (res.data.rideStatus === 5) {
                           this.show5 = true
                        }
                        if (res.data.rideStatus === 2) {
                           this.show6 = true
                           this.refreshStatus()
                        }
                     } else if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 1) {
                        that.$refs.d_tram.info = {
                           ...res.data.memberRidesResponse.discountMember,
                           ...res.data.memberRidesResponse,
                           deposit: res.data.deposit,
                           goodsOrderId: res.data.goodsOrderId
                        }
                        // 骑行中
                        if (res.data.rideStatus === 1) {
                           that.$refs.d_tram.d_show3 = true
                        }
                        // 临时锁车
                        if (res.data.rideStatus === 4) {
                           that.$refs.d_tram.d_show4 = true
                        }
                     }
                     // 是否营业
                     if (res.data.isBusiness === 0) {
                        this.title = '暂停营业提醒'
                        this.content = res.data.unBusinessTips
                        this.show4 = true
                        return
                     }
                     // 是否停止服务
                     if (res.data.isStopServe === 1) {
                        this.title = '暂停服务提醒'
                        this.content = res.data.stopServeTips
                        this.show4 = true
                     }
                     this.tcList = res.data.discountList
                     let arr = JSON.parse(res.data.eleBusinessArea)
                     this.eleBusinessArea[0].points = arr.map(item => {
                        return {
                           latitude: item.lat,
                           longitude: item.lng
                        }
                     })
                  }
               })
         },
         // 刷新首页信息
         refresh() {
         refresh(type) {
            this.$u.api.home()
               .then(res => {
                  uni.stopPullDownRefresh()
                  if (res.code === 200) {
                     this.info = res.data
                     // 解锁中
                     if (res.data.rideStatus === 0) {
                        this.show5 = true
                        // 循环次数
                        var num = 1
                        // 循环查看解锁结果
                        let timer = setInterval(async () => {
                           num += 1
                           let res1 = await this.$u.api.refreshLock({
                              id: res.data.memberRidesResponse.rideId
                           })
                           // 开锁成功
                           if (res1.data.status === 1) {
                              clearInterval(timer)
                              this.show5 = false
                              setTimeout(() => {
                                 this.show2 = true
                              }, 500)
                           }
                           // 开锁失败
                           if (res1.data.status === 3) {
                              clearInterval(timer)
                              this.show5 = false
                              uni.showToast({ title: '开锁失败', icon: 'error', duration: 2000 });
                           }
                           // 开锁超时
                           if (num === 180) {
                              clearInterval(timer)
                              this.show5 = false
                              uni.showToast({ title: '开锁超时', icon: 'error', duration: 2000 });
                           }
                        }, 1000)
                     if (type === 'tram') {
                        this.refreshTram()
                     }
                     if (res.data.rideStatus === 1) {
                        this.show2 = true
                        this.refreshStatus()
                     // 未查到骑行订单
                     if (!res.data.memberRidesResponse && this.onPullDownRefresh) {
                        this.show1 = false
                        this.show2 = false
                        this.show3 = false
                        this.show4 = false
                        this.show5 = false
                        this.show6 = false
                        this.show7 = false
                        this.$refs.d_tram.d_show = false
                        this.$refs.d_tram.d_show1 = false
                        this.$refs.d_tram.d_show2 = false
                        this.$refs.d_tram.d_show3 = false
                        this.$refs.d_tram.d_show4 = false
                        this.$refs.d_tram.d_show5 = false
                        this.$refs.d_tram.d_show6 = false
                        this.$refs.d_tram.d_show7 = false
                        this.$refs.d_tram.d_show8 = false
                        this.$refs.d_tram.d_show9 = false
                        this.onPullDownRefresh = false
                        return
                     }
                     if (res.data.rideStatus === 5) {
                        this.show5 = true
                     }
                     if (res.data.rideStatus === 2) {
                        this.show6 = true
                     // 自行车
                     if (res.data.memberRidesResponse.ridesType === 0) {
                        // 解锁中
                        if (res.data.rideStatus === 0) {
                           this.show5 = true
                           // 循环次数
                           var num = 1
                           // 循环查看解锁结果
                           let timer = setInterval(async () => {
                              num += 1
                              let res1 = await this.$u.api.refreshLock({
                                 id: res.data.memberRidesResponse.rideId
                              })
                              // 开锁成功
                              if (res1.data.status === 1) {
                                 clearInterval(timer)
                                 this.show5 = false
                                 setTimeout(() => {
                                    this.show2 = true
                                 }, 500)
                              }
                              // 开锁失败
                              if (res1.data.status === 3) {
                                 clearInterval(timer)
                                 this.show5 = false
                                 uni.showToast({ title: '开锁失败', icon: 'error', duration: 2000 });
                              }
                              // 开锁超时
                              if (num === 180) {
                                 clearInterval(timer)
                                 this.show5 = false
                                 uni.showToast({ title: '开锁超时', icon: 'error', duration: 2000 });
                              }
                           }, 1000)
                        }
                        if (res.data.rideStatus === 1) {
                           this.show2 = true
                           this.refreshStatus()
                        }
                        if (res.data.rideStatus === 5) {
                           this.show5 = true
                        }
                        if (res.data.rideStatus === 2) {
                           this.show6 = true
                        }
                     } else if (res.data.memberRidesResponse.ridesType === 1) {
                        this.$refs.d_tram.info = {
                           ...res.data.memberRidesResponse.discountMember,
                           ...res.data.memberRidesResponse,
                           deposit: res.data.deposit,
                           goodsOrderId: res.data.goodsOrderId
                        }
                        // 骑行中
                        if (res.data.rideStatus === 1) {
                           this.$refs.d_tram.d_show3 = true
                        }
                        // 临时锁车
                        if (res.data.rideStatus === 4) {
                           this.$refs.d_tram.d_show4 = true
                        }
                     }
                  }
               })
@@ -753,24 +1282,36 @@
<style lang="scss" scoped>
   .index {
      width: 100%;
      height: auto;
      .index_nav {
         width: 100%;
         height: auto;
         background: repeating-linear-gradient(to bottom, #9AE2DF, #ffffff);
         .index_nav_b {
         .index_nav_box {
            width: 100%;
            padding: 0 30rpx;
            box-sizing: border-box;
            height: auto;
            position: fixed;
            z-index: 9;
            text {
               font-size: 38rpx;
               font-family: PingFangSC-Semibold, PingFang SC;
               font-weight: 600;
               color: #222222;
            top: 0;
            left: 0;
            z-index: 999;
            .index_nav_b {
               width: 100%;
               padding: 0 30rpx;
               box-sizing: border-box;
               position: fixed;
               z-index: 9;
               text {
                  font-size: 38rpx;
                  font-family: PingFangSC-Semibold, PingFang SC;
                  font-weight: 600;
                  color: #222222;
               }
            }
         }
         .index_box {
@@ -787,7 +1328,36 @@
               padding: 6rpx;
               box-sizing: border-box;
               position: relative;
               .index_box_map_type {
                  position: absolute;
                  bottom: 20rpx;
                  left: 50%;
                  width: 244rpx;
                  height: 56rpx;
                  transform: translate(-50%, 0);
                  background: #FFFFFF;
                  box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0,0,0,0.08);
                  border-radius: 16rpx;
                  padding: 6rpx;
                  box-sizing: border-box;
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  .index_box_map_type_row {
                     width: 116rpx;
                     height: 44rpx;
                     line-height: 44rpx;
                     text-align: center;
                     border-radius: 12rpx;
                     font-weight: 400;
                     font-size: 28rpx;
                     color: #666666;
                  }
                  .active {
                     background: rgba(1,182,173,0.08) !important;
                     color: #01B6AD;
                  }
               }
               .map {
                  width: 100%;
                  height: 100%;
@@ -864,10 +1434,161 @@
               display: flex;
               align-items: center;
               justify-content: space-between;
               flex-wrap: wrap;
               position: relative;
               top: -24rpx;
               text {
                  font-weight: 400;
               }
               .cXYC {
                  width: 23%;
                  position: relative;
                  button {
                     width: 100%;
                     height: 100%;
                     position: absolute;
                     top: 0;
                     left: 0;
                     background-color: rgba(0,0,0,0);
                     border: none;
                     opacity: 0;
                  }
               }
            }
            .index_box_vip {
               width: 100%;
               padding: 24rpx 30rpx;
               box-sizing: border-box;
               background: linear-gradient(#FCEADC 0%, #FFFFFF 100%);
               border-radius: 20rpx;
               .index_box_vip_head {
                  width: 100%;
                  display: flex;
                  align-items: center;
                  justify-content: space-between;
                  position: relative;
                  button {
                     position: absolute;
                     right: 0;
                     top: 0;
                     width: 200rpx;
                     height: 40rpx;
                     opacity: 0;
                  }
                  text {
                     &:nth-child(1) {
                        font-weight: 600;
                        font-size: 34rpx;
                        color: #303030;
                     }
                     &:nth-child(2) {
                        font-weight: 400;
                        font-size: 26rpx;
                        color: #666666;
                     }
                  }
               }
               .scrollView {
                  width: 100%;
                  margin-top: 20rpx;
                  white-space: nowrap;
                  .index_box_vip_row {
                     display: inline-block;
                     width: 580rpx;
                     height: 216rpx;
                     background: #FFFFFF;
                     box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(0,0,0,0.06);
                     border-radius: 12rpx;
                     margin-right: 16rpx;
                     padding: 24rpx;
                     box-sizing: border-box;
                     &:last-child {
                        margin: 0 !important;
                     }
                     .vip1 {
                        width: 100%;
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        .vip1_left {
                           flex: 1;
                           font-weight: 500;
                           font-size: 32rpx;
                           color: #303030;
                           white-space: nowrap;
                           overflow: hidden;
                           text-overflow: ellipsis;
                        }
                        .vip1_right {
                           flex-shrink: 0;
                           margin-left: 30rpx;
                           font-weight: 400;
                           font-size: 40rpx;
                           color: #FF5A31;
                           white-space: nowrap;
                           overflow: hidden;
                           text-overflow: ellipsis;
                           &:before {
                              content: '¥';
                              font-weight: 400;
                              font-size: 26rpx;
                              color: #FF5A31;
                           }
                        }
                     }
                     .vip2 {
                        width: 100%;
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        margin-top: 10rpx;
                        margin-bottom: 16rpx;
                        text {
                           flex: 1;
                           white-space: nowrap;
                           overflow: hidden;
                           text-overflow: ellipsis;
                           font-weight: 400;
                           font-size: 26rpx;
                           color: #777777;
                        }
                        u {
                           flex-shrink: 0;
                           font-weight: 400;
                           font-size: 24rpx;
                           color: #999999;
                           text-decoration: line-through;
                        }
                     }
                     .vip3 {
                        width: 100%;
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        .vip3_info {
                           padding: 6rpx 12rpx;
                           box-sizing: border-box;
                           background: rgba(255,90,49,0.1);
                           border-radius: 8rpx;
                           font-weight: 400;
                           font-size: 24rpx;
                           color: #FF5A31;
                        }
                        .vip3_button {
                           width: 120rpx;
                           height: 60rpx;
                           line-height: 60rpx;
                           text-align: center;
                           background: #01B6AD;
                           box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(1,182,173,0.24);
                           border-radius: 30rpx;
                           font-weight: 500;
                           font-size: 28rpx;
                           color: #FFFFFF;
                        }
                     }
                  }
               }
            }
@@ -884,24 +1605,30 @@
               overflow: hidden;
               margin-top: 20rpx;
            }
            .index_zw1 {
               width: 100%;
               height: calc(env(safe-area-inset-bottom) + 390rpx);
            }
            .index_zw {
               width: 100%;
               height: 336rpx;
               // height: 336rpx;
               height: 680rpx;
            }
         }
      }
      .index_scancode {
         width: 100%;
         height: 306rpx;
         // height: 306rpx;
         background: linear-gradient(360deg, #FFFFFF 0%, #FFFFFF 58%, #D0FFFD 100%);
         box-shadow: 0rpx -6rpx 16rpx 0rpx rgba(0, 0, 0, 0.1);
         border-radius: 32rpx 32rpx 0rpx 0rpx;
         position: fixed;
         bottom: 0;
         left: 0;
         padding: 30rpx 20rpx;
         padding: 30rpx 20rpx 30rpx 20rpx;
         box-sizing: border-box;
         .index_scancode_top {
@@ -938,6 +1665,53 @@
               flex-shrink: 0;
            }
         }
         .index_scancode_fl {
            width: 100%;
            display: flex;
            align-items: center;
            margin-top: 18rpx;
            .index_scancode_fl_tips {
               flex-shrink: 0;
               width: 64rpx;
               height: 36rpx;
               line-height: 36rpx;
               text-align: center;
               background: #FF5A31;
               border-radius: 2rpx 12rpx 2rpx 12rpx;
               margin-right: 16rpx;
               font-weight: 400;
               font-size: 24rpx;
               color: #FFFFFF;
            }
            .index_scancode_fl_text {
               flex: 1;
               height: 36rpx;
               line-height: 36rpx;
               font-weight: 400;
               font-size: 26rpx;
               color: #FF5A31;
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
            }
            .index_scancode_fl_swiper {
               flex: 1;
               height: 36rpx;
            }
            .index_scancode_fl_btn {
               flex-shrink: 0;
               height: 36rpx;
               line-height: 36rpx;
               text-align: center;
               background: #EAF9F8;
               border-radius: 4rpx;
               font-weight: 400;
               font-size: 24rpx;
               color: #01B6AD;
               margin-left: 8rpx;
            }
         }
         .index_scancode_bottom {
            width: 100%;
@@ -952,6 +1726,19 @@
            font-weight: 500;
            color: #FFFFFF;
            margin-top: 30rpx;
         }
         .index_scancode_xieyi {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 30rpx;
            text {
               font-weight: 400;
               font-size: 26rpx;
               color: #999999;
            }
         }
      }
@@ -1000,6 +1787,7 @@
            .red {
               color: #FC2525 !important;
               font-size: 30rpx !important;
            }
            text {
@@ -1070,6 +1858,53 @@
         background: linear-gradient(360deg, #FFFFFF 0%, #FFFFFF 58%, #D0FFFD 100%);
         box-shadow: 0rpx -6rpx 16rpx 0rpx rgba(0, 0, 0, 0.1);
         border-radius: 32rpx 32rpx 0rpx 0rpx;
         .index_scancode_fl {
            width: 100%;
            display: flex;
            align-items: center;
            margin-top: 30rpx;
            .index_scancode_fl_tips {
               flex-shrink: 0;
               width: 64rpx;
               height: 36rpx;
               line-height: 36rpx;
               text-align: center;
               background: #FF5A31;
               border-radius: 2rpx 12rpx 2rpx 12rpx;
               margin-right: 16rpx;
               font-weight: 400;
               font-size: 24rpx;
               color: #FFFFFF;
            }
            .index_scancode_fl_text {
               flex: 1;
               height: 36rpx;
               line-height: 36rpx;
               font-weight: 400;
               font-size: 26rpx;
               color: #FF5A31;
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
            }
            .index_scancode_fl_swiper {
               flex: 1;
               height: 36rpx;
            }
            .index_scancode_fl_btn {
               flex-shrink: 0;
               height: 36rpx;
               line-height: 36rpx;
               text-align: center;
               background: #EAF9F8;
               border-radius: 4rpx;
               font-weight: 400;
               font-size: 24rpx;
               color: #01B6AD;
               margin-left: 8rpx;
            }
         }
         .deposit_text {
            width: 100%;
@@ -1111,7 +1946,7 @@
            width: 100%;
            display: flex;
            align-items: center;
            margin-top: 100rpx;
            margin-top: 40rpx;
            image {
               width: 32rpx;
@@ -1300,6 +2135,25 @@
               }
            }
         }
         .info_des_tc {
            width: 100%;
            height: 60rpx;
            line-height: 60rpx;
            background: #F4EFEA;
            border-radius: 16rpx;
            margin: 20rpx 0;
            display: flex;
            align-items: center;
            padding: 0 20rpx;
            box-sizing: border-box;
            text {
               font-weight: 400;
               font-size: 26rpx;
               color: #FF5A31;
               margin-left: 10rpx;
            }
         }
         .ride_content {
            width: 100%;
@@ -1406,4 +2260,4 @@
         }
      }
   }
</style>
</style>