| | |
| | | :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"> |
| | |
| | | <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> |
| | | <video class="img100b" :show-play-btn="false" :src="info.leaseVideoUrl" enable-danmu danmu-btn controls></video> |
| | | </view> |
| | | <view class="index_zw"></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> |
| | | <view class="index_zw1" v-else></view> |
| | | </view> |
| | | </view> |
| | | <view class="index_scancode"> |
| | |
| | | <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" |
| | | @close="show1 = false"> |
| | | <view class="deposit"> |
| | |
| | | </view> |
| | | </u-popup> |
| | | <!-- 骑行中 --> |
| | | <u-popup :show="show2" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" |
| | | <u-popup :show="show2" :overlay="false" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" |
| | | @close="show2 = false"> |
| | | <view class="ride"> |
| | | <view class="ride_head"> |
| | |
| | | </view> |
| | | </u-popup> |
| | | <!-- 已还车 --> |
| | | <u-popup :show="show6" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" |
| | | <u-popup :show="show6" :overlay="false" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" |
| | | @close="show6 = false"> |
| | | <view class="ride"> |
| | | <view class="ride_head"> |
| | |
| | | </view> |
| | | </u-popup> |
| | | <!-- 确认结算 --> |
| | | <u-popup :show="show3" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" @close="show3 = false"> |
| | | <u-popup :show="show3" :overlay="false" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" @close="show3 = false"> |
| | | <template> |
| | | <view class="deposit1"> |
| | | <view class="deposit_text"> |
| | |
| | | </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" :closeOnClickOverlay="false" overlayStyle="z-index: 10075;" bgColor="transparent" :round="10" @close="show = false"> |
| | | <view class="popupbox"> |
| | | <view class="advertisement"> |
| | | <image :src="info.adList[0].imgfullurl" mode="widthFix"></image> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | disable: false, |
| | | |
| | | top: 0, |
| | | |
| | | title: '', |
| | | latitude: null, |
| | | longitude: null, |
| | | bgImg: require('@/static/images/bg_service@2x.png'), |
| | |
| | | computed: { |
| | | ...mapState(['navHeight', 'statusbarHeight', 'userInfo']) |
| | | }, |
| | | async onLoad() { |
| | | async onLoad(options) { |
| | | if (JSON.stringify(this.userInfo) == '{}') { |
| | | await this.$onLaunched; |
| | | } |
| | | console.log(decodeURIComponent(options.scene)) |
| | | this.getAddress() |
| | | this.getHomeInfo() |
| | | this.getSite() |
| | | }, |
| | | onPageScroll(e) { |
| | | this.top = e.scrollTop |
| | | }, |
| | | methods: { |
| | | jumpX() { |
| | |
| | | res.data.forEach((item, index) => { |
| | | this.markers.push({ |
| | | id: index, |
| | | width: 30, |
| | | width: 40, |
| | | height: 40, |
| | | latitude: item.latitude, |
| | | longitude: item.longitude, |
| | |
| | | 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.show6 = false |
| | | this.show7 = false |
| | | this.isDisabled = true |
| | | uni.showToast({ title: '结算成功!', icon: 'success', duration: 2000 }); |
| | | this.refresh() |
| | | } |
| | | }).finally(() => { |
| | | this.isDisabled = true |
| | | }) |
| | | } |
| | | }, |
| | | minute() { |
| | | this.show3 = false |
| | | if (this.info.rideStatus !== -1) { |
| | | console.log(this.info.rideStatus) |
| | | if (this.info.rideStatus != -1) { |
| | | this.show6 = true |
| | | } |
| | | }, |
| | |
| | | url: '/pages/consumptionDetails/consumptionDetails' |
| | | }); |
| | | } else if (item.id === 2) { |
| | | if (this.info.rideStatus === 1) { |
| | | uni.showToast({ title: '骑行中不能结算押金', icon: 'none', duration: 2000 }) |
| | | return |
| | | } |
| | | if (this.info.depositStatus === 1) { |
| | | this.show3 = true |
| | | } else { |
| | |
| | | // 骑行明细 |
| | | toRidingDetails() { |
| | | uni.navigateTo({ |
| | | url: `/pages/ridingDetails/ridingDetails?id=${this.info.goodsOrderId}` |
| | | url: `/pages/ridingDetails/ridingDetails?id=${this.info.goodsOrderId}&price=${this.info.deposit / 100}` |
| | | }); |
| | | }, |
| | | // 跳转故障上报 |
| | |
| | | }, |
| | | // 押金支付 |
| | | depositPayment() { |
| | | var that = this; |
| | | 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 }); |
| | | |
| | | 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.packageValue, |
| | | 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() |
| | | that.refresh() |
| | | uni.showToast({ title: '充值成功', icon: 'success', duration: 2000 }); |
| | | } |
| | | }, |
| | | fail(err) { |
| | | that.disable = false |
| | | console.log(err) |
| | | } |
| | | }, |
| | | fail(err) { |
| | | console.log(err) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }).catch((err) => { |
| | | that.disable = false |
| | | console.log(err) |
| | | }) |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: '请先勾选协议', |
| | |
| | | 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 |
| | | if (!that.disable) { |
| | | that.disable = true |
| | | // 扫码解锁骑行 |
| | | uni.scanCode({ |
| | | success: async function(result) { |
| | | // 打开开锁弹框 |
| | | 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 |
| | | // 调用开锁接口 |
| | | let res = await that.$u.api.openLock({ |
| | | code: result.result |
| | | }) |
| | | 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 |
| | | } |
| | | }, |
| | | fail() { |
| | | that.disable = false |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | // 获取经纬度 |
| | | getAddress() { |
| | |
| | | // 已换车 |
| | | if (res.data.rideStatus === 2) { |
| | | this.show6 = true |
| | | return |
| | | } |
| | | if (res.data.rideStatus === -1) { |
| | | this.show6 = false |
| | | } |
| | | clearInterval(this.timer) |
| | | } |
| | |
| | | } |
| | | if (res.data.rideStatus === 2) { |
| | | this.show6 = true |
| | | this.refreshStatus() |
| | | } |
| | | // 是否营业 |
| | | 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 |
| | | } |
| | |
| | | <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 { |
| | |
| | | overflow: hidden; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .index_zw1 { |
| | | width: 100%; |
| | | height: calc(env(safe-area-inset-bottom) + 310rpx); |
| | | } |
| | | |
| | | .index_zw { |
| | | width: 100%; |
| | | height: 336rpx; |
| | | // height: 336rpx; |
| | | height: 680rpx; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | .red { |
| | | color: #FC2525 !important; |
| | | font-size: 30rpx !important; |
| | | } |
| | | |
| | | text { |