| | |
| | | </image> |
| | | </view> |
| | | <view class="index_box_function"> |
| | | <view class="cXYC" v-for="(item, index) in functionList" :key="index" @click.stop="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 class="index_box_video" v-if="info.leaseVideoUrl"> |
| | | <video class="img100b" :src="info.leaseVideoUrl" enable-danmu danmu-btn controls></video> |
| | | </view> |
| | | <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-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> |
| | | <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> |
| | | <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> |
| | | <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_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"> |
| | |
| | | </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"> |
| | |
| | | </view> |
| | | </u-popup> |
| | | <!-- 自行车-骑行中 --> |
| | | <u-popup :show="show2" :overlay="false" 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"> |
| | |
| | | <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"> |
| | |
| | | </view> |
| | | </u-popup> |
| | | <!-- 自行车-已还车 --> |
| | | <u-popup :show="show6" :overlay="false" 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"> |
| | |
| | | <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"> |
| | |
| | | </view> |
| | | </u-popup> |
| | | <!-- 自行车-确认结算 --> |
| | | <u-popup :show="show3" :overlay="false" :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"> |
| | |
| | | <!-- 自行车-确认结算弹框 --> |
| | | <u-modal :show="show7" title="提示" content='确认结算吗?' :showCancelButton="true" cancelText="取消" @confirm="settlement1" @cancel="show7 = false"></u-modal> |
| | | <!-- 广告 --> |
| | | <u-popup :show="show" mode="center" :closeOnClickOverlay="false" zIndex="99999" 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> |
| | |
| | | </image> |
| | | </view> |
| | | </u-popup> |
| | | |
| | | <!-- 电车 --> |
| | | <tram ref="d_tram" @unlockDoor="refresh" /> |
| | | <tram ref="d_tram" @unlockDoor="refresh('tram')" /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | name: '消费明细', |
| | | icon: require('@/static/images/home_ic_mingxi@2x.png') |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '运营中心', |
| | | icon: require('@/static/icon/home_ic_mingxi.png') |
| | | }, |
| | | ], |
| | | |
| | | info: {}, |
| | |
| | | zIndex: 7 |
| | | } |
| | | ], |
| | | onPullDownRefresh: false |
| | | onPullDownRefresh: false, |
| | | timerdian: null |
| | | } |
| | | }, |
| | | components: { tram }, |
| | |
| | | ...mapState(['navHeight', 'statusbarHeight', 'userInfo']) |
| | | }, |
| | | async onLoad(options) { |
| | | var that = this; |
| | | |
| | | if (JSON.stringify(this.userInfo) == '{}') { |
| | | await this.$onLaunched; |
| | | } |
| | | await this.getAddress() |
| | | await this.getHomeInfo() |
| | | // await this.getHomeInfo() |
| | | await this.getSite() |
| | | // if (decodeURIComponent(options.scene) !== 'undefined') { |
| | | // console.log(decodeURIComponent(options.scene)) |
| | | // this.carRentalCopy(decodeURIComponent(options.scene)) |
| | | // } |
| | | |
| | | this.$u.api.home() |
| | | .then(async res => { |
| | | if (res.code === 200) { |
| | | let code = decodeURIComponent(options.scene) |
| | | // 是否弹出广告图 |
| | | if (res.data.adList.length > 0 && !res.data.memberRidesResponse) { |
| | | 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 |
| | | // 循环次数 |
| | | 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 |
| | | } |
| | | // 轮询刷新电车骑行状态 |
| | | 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 |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | uni.$on('update', data => { |
| | | this.carRental() |
| | | }) |
| | | }, |
| | | onPullDownRefresh() { |
| | | this.onPullDownRefresh = true |
| | |
| | | this.top = e.scrollTop |
| | | }, |
| | | methods: { |
| | | clickcontrol(){ |
| | | // 分钟转换 |
| | | 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 => { |
| | |
| | | }); |
| | | }, |
| | | // 微信打开小程序开锁方法 |
| | | async carRentalCopy(code) { |
| | | await this.refresh() |
| | | // 判断有没有交押金 |
| | | if (this.info.depositStatus === 0) { |
| | | this.show1 = true |
| | | return; |
| | | } else if (this.info.depositStatus === 2) { |
| | | uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 }); |
| | | return; |
| | | } |
| | | async carRentalCopy(code, type) { |
| | | var that = this; |
| | | 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) |
| | | 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 { |
| | | that.show5 = false |
| | | that.disable = false |
| | | 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 |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | } else if (item.id === 4) { |
| | | uni.navigateTo({ |
| | | url: '/pages/consumptionDetails/consumptionDetails' |
| | | }); |
| | | }); |
| | | } 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) { |
| | |
| | | that.show1 = false |
| | | that.info.depositStatus = 1 |
| | | that.carRental() |
| | | that.refresh() |
| | | uni.showToast({ title: '充值成功', icon: 'success', duration: 2000 }); |
| | | } |
| | | }, |
| | |
| | | } |
| | | }).catch((err) => { |
| | | that.disable = false |
| | | console.log(err) |
| | | }) |
| | | } |
| | | } else { |
| | |
| | | // 扫码租车 |
| | | async carRental() { |
| | | var that = this; |
| | | // 刷新首页信息 |
| | | await this.refresh() |
| | | // 判断有没有交押金 |
| | | if (this.info.depositStatus === 0) { |
| | | this.show1 = true |
| | | return; |
| | | } else if (this.info.depositStatus === 2) { |
| | | uni.showToast({ title: '结算申请提交成功,请耐心等待退款!', icon: 'none', duration: 2000 }); |
| | | return; |
| | | } |
| | | // 自行车 |
| | | if (this.type === 1) { |
| | | if (!that.disable) { |
| | | that.disable = true |
| | | // 扫码解锁骑行 |
| | | uni.scanCode({ |
| | | success: async function(result) { |
| | | let text = decodeURIComponent(result.path) |
| | | text = text.substring(text.lastIndexOf('?') + 7, text.length) |
| | | // 打开开锁弹框 |
| | | |
| | | 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 res = await that.$u.api.openLock({ |
| | | code: text |
| | | }) |
| | | if (res.code === 200) { |
| | | 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: res.data.id |
| | | }) |
| | | let res1 = await that.$u.api.refreshLock({ id: bicycle.data.id }) |
| | | // 开锁成功 |
| | | if (res1.data.status === 1) { |
| | | that.refresh() |
| | |
| | | that.show5 = false |
| | | that.disable = false |
| | | } |
| | | }, |
| | | fail() { |
| | | that.disable = false |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | uni.scanCode({ |
| | | success: async function(result) { |
| | | let res = await that.$u.api.getBikeChargingRule({ |
| | | code: result.result |
| | | }) |
| | | if (res.code === 200) { |
| | | } 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 |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | }, 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 |
| | |
| | | .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) { |
| | | this.type = 1 |
| | | // 解锁中 |
| | | if (res.data.rideStatus === 0) { |
| | | this.show5 = true |
| | |
| | | this.refreshStatus() |
| | | } |
| | | } else if (res.data.memberRidesResponse && res.data.memberRidesResponse.ridesType === 1) { |
| | | this.type = 2 |
| | | that.$refs.d_tram.info = { |
| | | ...res.data.memberRidesResponse.discountMember, |
| | | ...res.data.memberRidesResponse, |
| | |
| | | }) |
| | | }, |
| | | // 刷新首页信息 |
| | | refresh() { |
| | | refresh(type) { |
| | | this.$u.api.home() |
| | | .then(res => { |
| | | uni.stopPullDownRefresh() |
| | | if (res.code === 200) { |
| | | this.info = res.data |
| | | if (type === 'tram') { |
| | | this.refreshTram() |
| | | } |
| | | // 未查到骑行订单 |
| | | if (!res.data.memberRidesResponse && this.onPullDownRefresh) { |
| | | this.show1 = false |
| | |
| | | this.show6 = false |
| | | this.show7 = false |
| | | |
| | | that.$refs.d_tram.d_show = false |
| | | that.$refs.d_tram.d_show1 = false |
| | | that.$refs.d_tram.d_show2 = false |
| | | that.$refs.d_tram.d_show3 = false |
| | | that.$refs.d_tram.d_show4 = false |
| | | that.$refs.d_tram.d_show5 = false |
| | | that.$refs.d_tram.d_show6 = false |
| | | that.$refs.d_tram.d_show7 = false |
| | | that.$refs.d_tram.d_show8 = false |
| | | that.$refs.d_tram.d_show9 = 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 |
| | | } |
| | |
| | | this.show6 = true |
| | | } |
| | | } else if (res.data.memberRidesResponse.ridesType === 1) { |
| | | this.type = 2 |
| | | this.$refs.d_tram.info = { |
| | | ...res.data.memberRidesResponse.discountMember, |
| | | ...res.data.memberRidesResponse, |
| | |
| | | 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%; |
| | |
| | | width: 100%; |
| | | padding: 24rpx 30rpx; |
| | | box-sizing: border-box; |
| | | background: linear-gradient(#FFFFFF 0%, #FCEADC 100%); |
| | | background: linear-gradient(#FCEADC 0%, #FFFFFF 100%); |
| | | border-radius: 20rpx; |
| | | .index_box_vip_head { |
| | | width: 100%; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .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%; |