From 3b5dc77ee03b5df1b49fffafc71a9c9aa56678cf Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 17 二月 2025 18:31:03 +0800
Subject: [PATCH] 更新

---
 bicycle/pages/index/index.vue |  310 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 290 insertions(+), 20 deletions(-)

diff --git a/bicycle/pages/index/index.vue b/bicycle/pages/index/index.vue
index 4693757..87faa72 100644
--- a/bicycle/pages/index/index.vue
+++ b/bicycle/pages/index/index.vue
@@ -8,12 +8,16 @@
 				<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>
+					<text>鍗拌薄婊ㄦ箹瓒e懗鑷杞�</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 class="map" scale="15" :show-location="true" :markers="markers" :latitude="latitude" :longitude="longitude" />
+					<view class="index_box_map_type">
+						<view class="index_box_map_type_row active">鑷杞�</view>
+						<view class="index_box_map_type_row">鐢靛姩杞�</view>
+					</view>
 					<view class="index_box_icon" @click="jumpMap">
 						<image src="@/static/icon/ic_fullscreen@2x.png" mode="widthFix"></image>
 					</view>
@@ -27,16 +31,39 @@
 					</image>
 				</view>
 				<view class="index_box_function">
-					<view class="cXYC" v-for="(item, index) in functionList" :key="index" @click="jump(item)">
+					<view class="cXYC" 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_vip">
+					<view class="index_box_vip_head">
+						<text>鐑攢濂楅</text>
+						<text @click="jumpTC">鏇村浼樻儬 ></text>
+					</view>
+					<scroll-view scroll-x class="scrollView">
+						<view class="index_box_vip_row" v-for="(item, index) in 3" :key="index">
+							<view class="vip1">
+								<text>鐢靛崟杞﹀勾鍗�</text>
+								<text>365</text>
+							</view>
+							<view class="vip2">
+								<text>365澶╃晠楠戯紝浜彈楠戣溅涔愯叮</text>
+								<u>楼699</u>
+							</view>
+							<view class="vip3">
+								<view class="vip3_info">浣庤嚦1鍏�/澶�</view>
+								<view class="vip3_button">璐拱</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" :show-play-btn="false" :src="info.leaseVideoUrl" enable-danmu danmu-btn controls></video>
+					<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>
@@ -59,7 +86,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">
@@ -81,7 +108,7 @@
 				</view>
 			</view>
 		</u-popup>
-		<!-- 寮�閿� -->
+		<!-- 鑷杞�-寮�閿� -->
 		<u-popup :show="show5" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
 			@close="show5 = false">
 			<view class="loading">
@@ -98,7 +125,7 @@
 				</view> -->
 			</view>
 		</u-popup>
-		<!-- 楠戣涓� -->
+		<!-- 鑷杞�-楠戣涓� -->
 		<u-popup :show="show2" :overlay="false" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
 			@close="show2 = false">
 			<view class="ride">
@@ -137,7 +164,7 @@
 				</view>
 			</view>
 		</u-popup>
-		<!-- 宸茶繕杞� -->
+		<!-- 鑷杞�-宸茶繕杞� -->
 		<u-popup :show="show6" :overlay="false" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
 			@close="show6 = false">
 			<view class="ride">
@@ -174,7 +201,7 @@
 				</view>
 			</view>
 		</u-popup>
-		<!-- 纭缁撶畻 -->
+		<!-- 鑷杞�-纭缁撶畻 -->
 		<u-popup :show="show3" :overlay="false" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10" @close="show3 = false">
 			<template>
 				<view class="deposit1">
@@ -192,7 +219,7 @@
 		</u-popup>
 		<!-- 鎻愮ず -->
 		<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" :closeOnClickOverlay="false" overlayStyle="z-index: 10075;" bgColor="transparent" :round="10" @close="show = false">
@@ -273,15 +300,85 @@
 			if (JSON.stringify(this.userInfo) == '{}') {
 				await this.$onLaunched;
 			}
-			console.log(decodeURIComponent(options.scene))
-			this.getAddress()
-			this.getHomeInfo()
-			this.getSite()
+			await this.getAddress()
+			await this.getHomeInfo()
+			await this.getSite()
+			// if (decodeURIComponent(options.scene) !== 'undefined') {
+			// 	console.log(decodeURIComponent(options.scene))
+			// 	this.carRentalCopy(decodeURIComponent(options.scene))
+			// }
 		},
 		onPageScroll(e) {
 			this.top = e.scrollTop
 		},
 		methods: {
+			jumpTC() {
+				uni.navigateTo({
+					url: '/pages/setMenu/setMenu'
+				});
+			},
+			// 寰俊鎵撳紑灏忕▼搴忓紑閿佹柟娉�
+			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;
+				}
+				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
+						// 寰幆鏌ョ湅瑙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
+					}
+				}
+			},
 			jumpX() {
 				uni.navigateTo({
 					url: '/pages/leaseNotice/leaseNotice'
@@ -327,7 +424,7 @@
 							this.show3 = false
 							this.show6 = false
 							this.show7 = false
-							uni.showToast({ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒', icon: 'success', duration: 2000 });
+							uni.showToast({ title: '缁撶畻鐢宠鎻愪氦鎴愬姛锛岃鑰愬績绛夊緟閫�娆撅紒', icon: 'none', duration: 2000 });
 							// this.refresh()
 						}
 					}).finally(() => {
@@ -339,12 +436,15 @@
 			},
 			minute() {
 				this.show3 = false
-				console.log(this.info.rideStatus)
 				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
 			},
@@ -355,7 +455,8 @@
 				});
 			},
 			// 璺宠浆
-			jump(item) {
+			async jump(item) {
+				await this.refresh()
 				if (item.id === 3) {
 					uni.navigateTo({
 						url: '/pages/pricingRules/pricingRules'
@@ -365,18 +466,25 @@
 						url: '/pages/consumptionDetails/consumptionDetails'
 					});
 				} 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
@@ -468,10 +576,14 @@
 				}
 			},
 			// 鎵爜绉熻溅
-			carRental() {
+			async carRental() {
+				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;
 				}
 				var that = this;
@@ -480,11 +592,13 @@
 					// 鎵爜瑙i攣楠戣
 					uni.scanCode({
 						success: async function(result) {
+							let text = decodeURIComponent(result.path)
+							text = text.substring(text.lastIndexOf('?') + 7, text.length)
 							// 鎵撳紑寮�閿佸脊妗�
 							that.show5 = true
 							// 璋冪敤寮�閿佹帴鍙�
 							let res = await that.$u.api.openLock({
-								code: result.result
+								code: text
 							})
 							if (res.code === 200) {
 								that.disable = false
@@ -848,7 +962,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%;
@@ -930,6 +1073,133 @@
 					text {
 						font-weight: 400;
 					}
+					.cXYC {
+						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(#FFFFFF 0%, #FCEADC 100%);
+					border-radius: 20rpx;
+					.index_box_vip_head {
+						width: 100%;
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+						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;
+								text {
+									&:nth-child(1) {
+										font-weight: 500;
+										font-size: 32rpx;
+										color: #303030;
+									}
+									&:nth-child(2) {
+										font-weight: 400;
+										font-size: 40rpx;
+										color: #FF5A31;
+										&: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 {
+									font-weight: 400;
+									font-size: 26rpx;
+									color: #777777;
+								}
+								u {
+									font-weight: 400;
+									font-size: 24rpx;
+									color: #999999;
+								}
+							}
+							.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;
+								}
+							}
+						}
+					}
 				}
 
 				.index_box_poster {

--
Gitblit v1.9.3