From 19d17f0f0fb02f46342d70b5180e40a0ad1b66d3 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 09 十一月 2023 18:16:13 +0800
Subject: [PATCH] MrShi
---
bicycle/pages/index/index.vue | 268 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 167 insertions(+), 101 deletions(-)
diff --git a/bicycle/pages/index/index.vue b/bicycle/pages/index/index.vue
index 05ec29c..06a0229 100644
--- a/bicycle/pages/index/index.vue
+++ b/bicycle/pages/index/index.vue
@@ -4,8 +4,12 @@
: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">
@@ -32,9 +36,14 @@
<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">
@@ -50,7 +59,7 @@
<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">
@@ -90,7 +99,7 @@
</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">
@@ -129,7 +138,7 @@
</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">
@@ -166,7 +175,7 @@
</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">
@@ -182,11 +191,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" :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>
@@ -206,6 +215,11 @@
export default {
data() {
return {
+ disable: false,
+
+ top: 0,
+
+ title: '',
latitude: null,
longitude: null,
bgImg: require('@/static/images/bg_service@2x.png'),
@@ -255,13 +269,17 @@
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() {
@@ -288,7 +306,7 @@
res.data.forEach((item, index) => {
this.markers.push({
id: index,
- width: 30,
+ width: 40,
height: 40,
latitude: item.latitude,
longitude: item.longitude,
@@ -306,18 +324,21 @@
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
}
},
@@ -342,6 +363,10 @@
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 {
@@ -358,7 +383,7 @@
// 楠戣鏄庣粏
toRidingDetails() {
uni.navigateTo({
- url: `/pages/ridingDetails/ridingDetails?id=${this.info.goodsOrderId}`
+ url: `/pages/ridingDetails/ridingDetails?id=${this.info.goodsOrderId}&price=${this.info.deposit / 100}`
});
},
// 璺宠浆鏁呴殰涓婃姤
@@ -369,33 +394,40 @@
},
// 鎶奸噾鏀粯
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: '璇峰厛鍕鹃�夊崗璁�',
@@ -441,55 +473,63 @@
return;
}
var that = this;
- // 鎵爜瑙i攣楠戣
- 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
+ // 鎵爜瑙i攣楠戣
+ uni.scanCode({
+ success: async function(result) {
+ // 鎵撳紑寮�閿佸脊妗�
that.show5 = true
- // 寰幆娆℃暟
- var num = 1
- // 寰幆鏌ョ湅瑙i攣缁撴灉
- 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
+ // 寰幆鏌ョ湅瑙i攣缁撴灉
+ 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() {
@@ -608,6 +648,10 @@
// 宸叉崲杞�
if (res.data.rideStatus === 2) {
this.show6 = true
+ return
+ }
+ if (res.data.rideStatus === -1) {
+ this.show6 = false
}
clearInterval(this.timer)
}
@@ -666,15 +710,18 @@
}
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
}
@@ -753,24 +800,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 {
@@ -884,10 +943,16 @@
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;
}
}
}
@@ -1000,6 +1065,7 @@
.red {
color: #FC2525 !important;
+ font-size: 30rpx !important;
}
text {
--
Gitblit v1.9.3