From 8e75bb4e451d6d3f33e2146335bad0f85d27d99f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 02 十一月 2023 17:06:46 +0800
Subject: [PATCH] 硬件协议对接
---
 bicycle/pages/index/index.vue |  133 ++++++++++++++++++++++++++++---------------
 1 files changed, 86 insertions(+), 47 deletions(-)
diff --git a/bicycle/pages/index/index.vue b/bicycle/pages/index/index.vue
index 076c975..05ec29c 100644
--- a/bicycle/pages/index/index.vue
+++ b/bicycle/pages/index/index.vue
@@ -3,18 +3,18 @@
 		<view class="index_nav"
 			:style="{ height: 'calc(' + (statusbarHeight + navHeight) + 'px' + ' + ' + '224rpx' + ')' }">
 			<view class="index_nav_a" :style="{ height: statusbarHeight + 'px' }"></view>
-			<view class="index_nav_b" :style="{ height: navHeight + 'px', lineHeight: navHeight + 'px', top: navHeight + 'px' }">
+			<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 class="index_box">
 				<view class="index_box_map">
 					<map class="map" :show-location="true" :markers="markers" :latitude="latitude" :longitude="longitude" />
-					<cover-view class="index_box_icon" @click="jumpMap">
+					<view class="index_box_icon" @click="jumpMap">
 						<image src="@/static/icon/ic_fullscreen@2x.png" mode="widthFix"></image>
-					</cover-view>
-					
+					</view>
 				</view>
-				<view class="index_box_title" :style="{ backgroundImage: 'url(' + bgImg + ')' }">
+				<view class="index_box_title">
 					<view class="index_box_title_left">
 						<text>{{info.parkName}}</text>
 						<text>鏈嶅姟鐢佃瘽锛歿{info.serverPhone}}</text>
@@ -23,12 +23,12 @@
 					</image>
 				</view>
 				<view class="index_box_function">
-					<view class="fx1 cXYC" v-for="(item, index) in functionList" :key="index" @click="jump(item)">
+					<view class="cXYC" v-for="(item, index) in functionList" :key="index" @click="jump(item)">
 						<image class="img80" :src="item.icon" mode="widthFix"></image>
-						<text class="f26 b c3 mt10">{{item.name}}</text>
+						<text class="f26 c3 mt10">{{item.name}}</text>
 					</view>
 				</view>
-				<view class="index_box_poster">
+				<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">
@@ -50,16 +50,6 @@
 			<view class="index_scancode_bottom" @click="carRental" v-else>鎵爜绉熻溅</view>
 			<view class="index_scancode_zw"></view>
 		</view>
-		<!-- 骞垮憡 -->
-		<u-popup :show="show" mode="center" bgColor="transparent" :round="10" @close="show = false">
-			<view class="popupbox">
-				<view class="advertisement">
-					<image :src="info.adList[0].imgurl" mode="widthFix"></image>
-				</view>
-				<image class="close" @click="show = false" src="@/static/images/ic_close@2x.png" mode="widthFix">
-				</image>
-			</view>
-		</u-popup>
 		<!-- 缂寸撼鎶奸噾 -->
 		<u-popup :show="show1" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
 			@close="show1 = false">
@@ -73,7 +63,7 @@
 					<image src="@/static/icon/ic_select@2x.png" mode="widthFix" v-if="!active"></image>
 					<image src="@/static/icon/ic_selected@2x.png" mode="widthFix" v-else></image>
 					<view class="deposit_read_z">
-						鎴戝凡闃呰<text>銆婄璧侀』鐭ャ��</text>鍜�<text @click.stop="jumpgz">銆婅浠疯鍒欍��</text>
+						鎴戝凡闃呰<text @click.stop="jumpX">銆婄璧侀』鐭ャ��</text>鍜�<text @click.stop="jumpgz">銆婅浠疯鍒欍��</text>
 					</view>
 				</view>
 				<view class="deposit_footer">
@@ -93,14 +83,14 @@
 					</view>
 					<view class="loading_box_info">璇锋寜鐓т氦瑙勮椹�</view>
 				</view>
-				<view class="loading_box_err" @click="toFaultReporting">
+				<!-- <view class="loading_box_err" @click="toFaultReporting">
 					<image src="@/static/icon/ic_guzhang@2x.png" mode="widthFix"></image>
 					<text>杞﹁締鏁呴殰涓婃姤</text>
-				</view>
+				</view> -->
 			</view>
 		</u-popup>
 		<!-- 楠戣涓� -->
-		<u-popup :show="show2" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
+		<u-popup :show="show2" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
 			@close="show2 = false">
 			<view class="ride">
 				<view class="ride_head">
@@ -128,7 +118,7 @@
 					</view>
 					<view class="ride_content_info">
 						<image src="@/static/icon/ic_tip@2x.png" mode="widthFix"></image>
-						<text>鏀寔涓�旇繕杞︼紝楠戣鏃堕棿鑷姩绱锛屽鏇存崲杞﹀瀷锛屾寜鎵�鍙栬溅杈嗕腑鏈�楂樿溅鍨嬭璐�</text>
+						<text v-if="info.tips">{{info.tips}}</text>
 					</view>
 				</view>
 				<view class="ride_btn" @click="navigationReturn">瀵艰埅鑷冲洯鍖虹珯杩樿溅鐐�</view>
@@ -139,7 +129,7 @@
 			</view>
 		</u-popup>
 		<!-- 宸茶繕杞� -->
-		<u-popup :show="show6" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
+		<u-popup :show="show6" overlayOpacity="0" :closeOnClickOverlay="false" mode="bottom" bgColor="#fff" :round="10"
 			@close="show6 = false">
 			<view class="ride">
 				<view class="ride_head">
@@ -166,7 +156,7 @@
 					</view>
 					<view class="ride_content_info">
 						<image src="@/static/icon/ic_tip@2x.png" mode="widthFix"></image>
-						<text>鏀寔涓�旇繕杞︼紝楠戣鏃堕棿鑷姩绱锛屽鏇存崲杞﹀瀷锛屾寜鎵�鍙栬溅杈嗕腑鏈�楂樿溅鍨嬭璐�</text>
+						<text v-if="info.tips">{{info.tips}}</text>
 					</view>
 				</view>
 				<view class="ride_btn" @click="carRental">鎵爜缁х画楠戣</view>
@@ -195,6 +185,16 @@
 		<u-modal :show="show4" :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">
+			<view class="popupbox">
+				<view class="advertisement">
+					<image :src="info.adList[0].imgfullurl" mode="widthFix"></image>
+				</view>
+				<image class="close" @click="show = false" src="@/static/images/ic_close@2x.png" mode="widthFix">
+				</image>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -246,7 +246,10 @@
 				],
 
 				info: {},
-				content: ''
+				content: '',
+				
+				timer: null,
+				isDisabled: true
 			}
 		},
 		computed: {
@@ -261,6 +264,11 @@
 			this.getSite()
 		},
 		methods: {
+			jumpX() {
+				uni.navigateTo({
+					url: '/pages/leaseNotice/leaseNotice'
+				});
+			},
 			jumpMap() {
 				uni.navigateTo({
 					url: '/pages/maps/maps'
@@ -286,9 +294,7 @@
 									longitude: item.longitude,
 									title: item.name,
 									iconPath: '/static/icon/ic_bike@2x.png',
-									addr: item.addr,
-									clusterId: 1,
-									joinCluster: true
+									addr: item.addr
 								})
 							})
 						}
@@ -296,18 +302,18 @@
 			},
 			// 缁撶畻
 			settlement1() {
-				this.$u.api.goodsOrderSettlement({
-					orderId: this.info.goodsOrderId
-				}).then(res => {
-					if (res.code === 200) {
-						this.refresh()
-						uni.showToast({ title: '缁撶畻鎴愬姛锛�', icon: 'success', duration: 2000 });
-						// this.info.rideStatus = -1
-						// this.info.depositStatus = 0
-						this.show3 = false
-						this.show7 = false
-					}
-				})
+				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
@@ -337,8 +343,6 @@
 					});
 				} else if (item.id === 2) {
 					if (this.info.depositStatus === 1) {
-						// this.settlement1()
-						// this.show7 = true
 						this.show3 = true
 					} else {
 						uni.showToast({ title: '鎮ㄦ殏鏃犳娂閲戯紝鏃犻渶缁撶畻锛�', icon: 'none', duration: 2000 });
@@ -474,7 +478,7 @@
 									uni.showToast({ title: '寮�閿佸け璐�', icon: 'error', duration: 2000 });
 								}
 								// 寮�閿佽秴鏃�
-								if (num === 120) {
+								if (num === 180) {
 									that.refresh()
 									clearInterval(timer)
 									that.show5 = false
@@ -590,6 +594,25 @@
 					},
 				});
 			},
+			// 鍒锋柊楠戣鐘舵��
+			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
+						}
+						clearInterval(this.timer)
+					}
+				}, 10000)
+			},
 			// 鑾峰彇棣栭〉淇℃伅
 			getHomeInfo() {
 				this.$u.api.home()
@@ -626,15 +649,17 @@
 										uni.showToast({ title: '寮�閿佸け璐�', icon: 'error', duration: 2000 });
 									}
 									// 寮�閿佽秴鏃�
-									if (num === 120) {
+									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
@@ -688,7 +713,7 @@
 										uni.showToast({ title: '寮�閿佸け璐�', icon: 'error', duration: 2000 });
 									}
 									// 寮�閿佽秴鏃�
-									if (num === 120) {
+									if (num === 180) {
 										clearInterval(timer)
 										this.show5 = false
 										uni.showToast({ title: '寮�閿佽秴鏃�', icon: 'error', duration: 2000 });
@@ -697,6 +722,7 @@
 							}
 							if (res.data.rideStatus === 1) {
 								this.show2 = true
+								this.refreshStatus()
 							}
 							if (res.data.rideStatus === 5) {
 								this.show5 = true
@@ -713,6 +739,9 @@
 					phoneNumber: mobile
 				});
 			}
+		},
+		destroyed() {
+			clearInterval(this.timer)
 		}
 	}
 </script>
@@ -733,7 +762,7 @@
 				width: 100%;
 				padding: 0 30rpx;
 				box-sizing: border-box;
-				position: sticky;
+				position: fixed;
 				z-index: 9;
 
 				text {
@@ -789,6 +818,12 @@
 					align-items: center;
 					position: relative;
 					top: -16rpx;
+					// filter: blur(3px);
+					// -webkit-filter: blur(3px);
+					background: linear-gradient(270deg, #C5FAF7 0%, rgba(10,201,192,0.63) 65%, rgba(214,251,249,0.81) 100%);
+					box-shadow: inset 0rpx 1rpx 0rpx 0rpx #E3FFFE;
+					border-radius: 20rpx 20rpx 0rpx 0rpx;
+					backdrop-filter: blur(3px);
 
 					.index_box_title_left {
 						flex: 1;
@@ -828,8 +863,12 @@
 					border-radius: 20rpx;
 					display: flex;
 					align-items: center;
+					justify-content: space-between;
 					position: relative;
 					top: -24rpx;
+					text {
+						font-weight: 400;
+					}
 				}
 
 				.index_box_poster {
--
Gitblit v1.9.3