From 658107c8a09e2ef74bab1ad7114eeaf367848a25 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 06 七月 2026 18:14:16 +0800
Subject: [PATCH] Merge branch '3.0.1' of http://139.186.142.91:10010/r/productDev/parkBike into 3.0.1

---
 bicycle/pages/index/index.vue |  305 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 208 insertions(+), 97 deletions(-)

diff --git a/bicycle/pages/index/index.vue b/bicycle/pages/index/index.vue
index 031da43..0b8f052 100644
--- a/bicycle/pages/index/index.vue
+++ b/bicycle/pages/index/index.vue
@@ -17,7 +17,7 @@
 						id="mapId"
 						class="map"
 						scale="15"
-						:show-location="true"
+						:show-location="mapShowLocation"
 						:polygons="eleBusinessArea"
 						:markers="markers"
 						:latitude="latitude"
@@ -44,9 +44,10 @@
 						<text class="f26 c3 mt10">{{item.name}}</text>
 					</view>
 				</view>
-				<view class="index_box_vip">
+				<view class="index_box_vip" v-if="tcList.length > 0">
 					<view class="index_box_vip_head">
 						<text>鐑攢濂楅</text>
+						<button open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="!userInfo.mobile">鑾峰彇鎵嬫満鍙�</button>
 						<text @click="jumpTC">鏇村浼樻儬 ></text>
 					</view>
 					<scroll-view scroll-x class="scrollView">
@@ -65,14 +66,15 @@
 							</view>
 							<view class="vip3">
 								<view class="vip3_info">浣庤嚦{{item.dayPrice}}鍏�/澶�</view>
-								<view class="vip3_button" @click="purchase(item.id)">璐拱</view>
+								<button class="vip3_button" open-type="getPhoneNumber" @getphonenumber="getPhone" v-if="!userInfo.mobile">璐拱</button>
+								<view class="vip3_button" @click="purchase(item.id)" v-else>璐拱</view>
 							</view>
 						</view>
 					</scroll-view>
 				</view>
-				<view class="index_box_poster" @click="jumpX">
+				<!-- <view class="index_box_poster" @click="jumpX">
 					<image class="imgfull" :src="info.leaseNoticeUrl" mode="widthFix"></image>
-				</view>
+				</view> -->
 				<view class="index_box_video" v-if="info.leaseVideoUrl">
 					<video class="img100b" :src="info.leaseVideoUrl" enable-danmu danmu-btn controls></video>
 				</view>
@@ -99,8 +101,23 @@
 				</view>
 				<image src="@/static/images/ic_safe@2x.png" mode="widthFix"></image>
 			</view>
+			<view class="index_scancode_fl" v-if="taocan.length > 0">
+				<view class="index_scancode_fl_tips">绂忓埄</view>
+				<swiper v-if="taocan.length > 1" class="index_scancode_fl_swiper" vertical autoplay circular interval="3000" duration="500" :indicator-dots="false">
+					<swiper-item v-for="(item, index) in taocan" :key="index">
+						<view class="index_scancode_fl_text">浠呴渶{{ item.price || 0 }}鍏� 鍙緱鈥渰{ item.name || '' }}鈥濋獞琛屽崱</view>
+					</swiper-item>
+				</swiper>
+				<view v-else class="index_scancode_fl_text">浠呴渶{{ taocan[0] ? taocan[0].price || 0 : 0 }}鍏� 鍙緱鈥渰{ taocan[0] ? taocan[0].name || '' : '' }}鈥濋獞琛屽崱</view>
+				<view class="index_scancode_fl_btn" @click="jumpTC">鍘荤湅鐪�</view>
+			</view>
 			<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_xieyi">
+				<text @click.stop="jumpgz">璁¤垂瑙勫垯</text>
+				<text>锝�</text>
+				<text @click.stop="jumpX">绉熻祦椤荤煡</text>
+			</view>
 			<view class="index_scancode_zw"></view>
 		</view>
 		<!-- 鑷杞�-缂寸撼鎶奸噾 --> 
@@ -111,6 +128,16 @@
 					<text>娓╅Θ鎻愮ず</text>
 					<text>楠戣闇�瑕佺即绾硔{(info.deposit / 100).toFixed(2)}}鍏冭嚜琛岃溅鎶奸噾</text>
 					<text>锛堟娂閲戦殢鏃跺彲閫�锛�</text>
+				</view>
+				<view class="index_scancode_fl" v-if="taocan.length > 0">
+					<view class="index_scancode_fl_tips">绂忓埄</view>
+					<swiper v-if="taocan.length > 1" class="index_scancode_fl_swiper" vertical autoplay circular interval="3000" duration="500" :indicator-dots="false">
+						<swiper-item v-for="(item, index) in taocan" :key="index">
+							<view class="index_scancode_fl_text">浠呴渶{{ item.price || 0 }}鍏� 鍙緱鈥渰{ item.name || '' }}鈥濋獞琛屽崱</view>
+						</swiper-item>
+					</swiper>
+					<view v-else class="index_scancode_fl_text">浠呴渶{{ taocan[0] ? taocan[0].price || 0 : 0 }}鍏� 鍙緱鈥渰{ taocan[0] ? taocan[0].name || '' : '' }}鈥濋獞琛屽崱</view>
+					<view class="index_scancode_fl_btn" @click="jumpTC">鍘荤湅鐪�</view>
 				</view>
 				<view class="deposit_read" @click="active = !active">
 					<image src="@/static/icon/ic_select@2x.png" mode="widthFix" v-if="!active"></image>
@@ -307,19 +334,14 @@
 					},
 					{
 						id: 3,
-						name: '璁′环瑙勫垯',
-						icon: require('@/static/images/home_ic_guize@2x.png')
+						name: '鍥㈣喘楠屽埜',
+						icon: require('@/static/images/home_ic_yajing@x.png')
 					},
 					{
 						id: 4,
-						name: '娑堣垂鏄庣粏',
-						icon: require('@/static/images/home_ic_mingxi@2x.png')
-					},
-					{
-						id: 5,
-						name: '杩愯惀涓績',
-						icon: require('@/static/icon/home_ic_mingxi.png')
-					},
+						name: '涓汉涓績',
+						icon: require('@/static/images/home_ic_jiesuan@x.png')
+					}
 				],
 
 				info: {},
@@ -344,7 +366,9 @@
 					}
 				],
 				onPullDownRefresh: false,
-				timerdian: null
+				timerdian: null,
+				taocan: [],
+				mapShowLocation: false
 			}
 		},
 		components: { tram },
@@ -353,10 +377,8 @@
 		},
 		async onLoad(options) {
 			var that = this;
+			await this.$onLaunched;
 			
-			if (JSON.stringify(this.userInfo) == '{}') {
-				await this.$onLaunched;
-			}
 			await this.getAddress()
 			// await this.getHomeInfo()
 			await this.getSite()
@@ -492,7 +514,11 @@
 						})
 					}
 				})
+			this.getTC()
 			uni.$on('update', data => {
+				this.carRental()
+			})
+			uni.$on('sweep', () => {
 				this.carRental()
 			})
 		},
@@ -500,13 +526,26 @@
 			this.onPullDownRefresh = true
 			this.refresh()
 		},
-		onShow() {
+		async onShow() {
+			await this.$onLaunched;
 			this.refresh()
 		},
 		onPageScroll(e) {
 			this.top = e.scrollTop
 		},
 		methods: {
+			// 鐑攢濂楅
+			getTC() {
+				this.$u.api.discountPage({
+					capacity: 10,
+					page: 1,
+					model: {}
+				}).then(res => {
+					if (res.code === 200) {
+						this.taocan = res.data.records
+					}
+				})
+			},
 			// 鍒嗛挓杞崲
 			convertMinutesToHours(minutes) {
 			    const hours = Math.floor(minutes / 60);  // 璁$畻灏忔椂鏁�
@@ -715,14 +754,18 @@
 			},
 			// 璺宠浆
 			async jump(item) {
+				if (!this.userInfo || !this.userInfo.mobile) return
 				await this.refresh()
 				if (item.id === 3) {
+					// uni.navigateTo({
+					// 	url: '/pages/pricingRules/pricingRules'
+					// });
 					uni.navigateTo({
-						url: '/pages/pricingRules/pricingRules'
+						url: '/pages/couponRedemption/couponRedemption'
 					});
 				} else if (item.id === 4) {
 					uni.navigateTo({
-						url: '/pages/consumptionDetails/consumptionDetails'
+						url: '/pages/personalCenter/personalCenter'
 					}); 
 				} else if (item.id === 5) {
 					if (!this.userInfo.sysuser) {
@@ -824,16 +867,18 @@
 							} = loginRes;
 							that.$u.api.wxLogin({
 								code
-							})
-							.then(res => {
+							}).then(res => {
+								that.$store.commit('setToken', res.data.token)
 								that.$u.api.wxPhone({
 									encryptedData: e.detail.encryptedData,
 									iv: e.detail.iv,
 									sessionKey: res.data.sessionKey
 								}).then(result => {
 									if (result.code === 200) {
-										that.$store.commit('setUserInfo', result.data
-											.userResponse)
+										that.$store.commit('setUserInfo', result.data.userResponse)
+										uni.redirectTo({
+										  url: '/pages/index/index'
+										});
 									}
 								})
 							})
@@ -931,68 +976,7 @@
 							//鎵嬫満瀹氫綅鏈嶅姟锛圙PS锛夋湭鎺堟潈
 							uni.showToast({ title: "璇锋墦寮�鎵嬫満GPS", icon: "none" });
 						} else {
-							// 2銆佸垽鏂井淇″皬绋嬪簭鏄惁鎺堟潈浣嶇疆淇℃伅
-							uni.authorize({
-								//鎺堟潈璇锋眰绐楀彛
-								scope: "scope.userLocation",
-								success: (res) => {
-									that.fnGetlocation();
-								},
-								fail: (err) => {
-									err = err["errMsg"];
-									uni.showModal({ content: "闇�瑕佹巿鏉冧綅缃俊鎭�", confirmText: "纭鎺堟潈" })
-									.then((res) => {
-										if (res.confirm) {
-											uni.openSetting({
-												success: (res) => {
-													if (res.authSetting["scope.userLocation"]) {
-														// 鎺堟潈鎴愬姛
-														uni.showToast({ title: "鎺堟潈鎴愬姛", icon: "none" });
-														that.fnGetlocation();
-													} else {
-														// 鏈巿鏉�
-														uni.showToast({ title: "鎺堟潈澶辫触,璇烽噸鏂版巿鏉�", icon: "none" });
-														uni.showModal({
-															title: "鎺堟潈",
-															content: "鑾峰彇鎺堟潈" + authouName + "澶辫触,鏄惁鍓嶅線鎺堟潈璁剧疆锛�",
-															success: function(result) {
-																if (result.confirm) {
-																	uni.openSetting();
-																}
-															},
-															fail: function() {
-																uni.showToast({ title: "绯荤粺閿欒锛�", icon: "none" });
-															}
-														});
-													}
-												}
-											});
-										}
-										if (res.cancel) {
-											// 鍙栨秷鎺堟潈
-											uni.showToast({ title: "浣犳嫆缁濅簡鎺堟潈锛屾棤娉曡幏寰楀懆杈逛俊鎭�", icon: "none" });
-										}
-									});
-								},
-								complete(res) {
-									if (res.errMsg == "authorize:ok") {
-										that.fnGetlocation();
-									} else {
-										uni.showModal({
-											title: "鎺堟潈",
-											content: "鑾峰彇鎺堟潈" + authouName + "澶辫触,鏄惁鍓嶅線鎺堟潈璁剧疆锛�",
-											success: function(result) {
-												if (result.confirm) {
-													uni.openSetting();
-												}
-											},
-											fail: function() {
-												uni.showToast({ title: "绯荤粺閿欒锛�", icon: "none" });
-											},
-										});
-									}
-								},
-							});
+							that.fnGetlocation();
 						}
 					},
 				});
@@ -1005,16 +989,27 @@
 					altitude: true,
 					isHighAccuracy: true,
 					success: function(res) {
+						that.mapShowLocation = true
 						that.latitude = res.latitude
 						that.longitude = res.longitude
 					},
 					fail(err) {
+						if (err.errMsg === "getLocation:fail auth deny" || err.errMsg === "getLocation:fail authorize no response") {
+							uni.showModal({ content: "闇�瑕佹巿鏉冧綅缃俊鎭�", confirmText: "纭鎺堟潈" }).then((res) => {
+								if (res.confirm) {
+									uni.openSetting({
+										success: (settingRes) => {
+											if (settingRes.authSetting["scope.userLocation"]) {
+												that.fnGetlocation();
+											}
+										}
+									})
+								}
+							})
+							return
+						}
 						if (err.errMsg === "getLocation:fail 棰戠箒璋冪敤浼氬鍔犵數閲忔崯鑰楋紝鍙�冭檻浣跨敤 wx.onLocationChange 鐩戝惉鍦扮悊浣嶇疆鍙樺寲") {
 							uni.showToast({ title: "璇峰嬁棰戠箒瀹氫綅", icon: "none" });
-						}
-						if (err.errMsg === "getLocation:fail auth deny") {
-							// 鏈巿鏉�
-							uni.showToast({ title: "鏃犳硶瀹氫綅锛岃閲嶆柊鑾峰彇浣嶇疆淇℃伅", icon: "none" });
 						}
 						if (err.errMsg === "getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF") {
 							uni.showModal({ content: "璇峰紑鍚墜鏈哄畾浣嶆湇鍔�", showCancel: false });
@@ -1472,6 +1467,15 @@
 						display: flex;
 						align-items: center;
 						justify-content: space-between;
+						position: relative;
+						button {
+							position: absolute;
+							right: 0;
+							top: 0;
+							width: 200rpx;
+							height: 40rpx;
+							opacity: 0;
+						}
 						text {
 							&:nth-child(1) {
 								font-weight: 600;
@@ -1604,7 +1608,7 @@
 				
 				.index_zw1 {
 					width: 100%;
-					height: calc(env(safe-area-inset-bottom) + 310rpx);
+					height: calc(env(safe-area-inset-bottom) + 390rpx);
 				}
 
 				.index_zw {
@@ -1617,14 +1621,14 @@
 
 		.index_scancode {
 			width: 100%;
-			height: 306rpx;
+			// height: 306rpx;
 			background: linear-gradient(360deg, #FFFFFF 0%, #FFFFFF 58%, #D0FFFD 100%);
 			box-shadow: 0rpx -6rpx 16rpx 0rpx rgba(0, 0, 0, 0.1);
 			border-radius: 32rpx 32rpx 0rpx 0rpx;
 			position: fixed;
 			bottom: 0;
 			left: 0;
-			padding: 30rpx 20rpx;
+			padding: 30rpx 20rpx 30rpx 20rpx;
 			box-sizing: border-box;
 
 			.index_scancode_top {
@@ -1661,6 +1665,53 @@
 					flex-shrink: 0;
 				}
 			}
+			
+			.index_scancode_fl {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				margin-top: 18rpx;
+				.index_scancode_fl_tips {
+					flex-shrink: 0;
+					width: 64rpx;
+					height: 36rpx;
+					line-height: 36rpx;
+					text-align: center;
+					background: #FF5A31;
+					border-radius: 2rpx 12rpx 2rpx 12rpx;
+					margin-right: 16rpx;
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #FFFFFF;
+				}
+				.index_scancode_fl_text {
+					flex: 1;
+					height: 36rpx;
+					line-height: 36rpx;
+					font-weight: 400;
+					font-size: 26rpx;
+					color: #FF5A31;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+				.index_scancode_fl_swiper {
+					flex: 1;
+					height: 36rpx;
+				}
+				.index_scancode_fl_btn {
+					flex-shrink: 0;
+					height: 36rpx;
+					line-height: 36rpx;
+					text-align: center;
+					background: #EAF9F8;
+					border-radius: 4rpx;
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #01B6AD;
+					margin-left: 8rpx;
+				}
+			}
 
 			.index_scancode_bottom {
 				width: 100%;
@@ -1675,6 +1726,19 @@
 				font-weight: 500;
 				color: #FFFFFF;
 				margin-top: 30rpx;
+			}
+			
+			.index_scancode_xieyi {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				margin-top: 30rpx;
+				text {
+					font-weight: 400;
+					font-size: 26rpx;
+					color: #999999;
+				}
 			}
 		}
 
@@ -1794,6 +1858,53 @@
 			background: linear-gradient(360deg, #FFFFFF 0%, #FFFFFF 58%, #D0FFFD 100%);
 			box-shadow: 0rpx -6rpx 16rpx 0rpx rgba(0, 0, 0, 0.1);
 			border-radius: 32rpx 32rpx 0rpx 0rpx;
+			
+			.index_scancode_fl {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				margin-top: 30rpx;
+				.index_scancode_fl_tips {
+					flex-shrink: 0;
+					width: 64rpx;
+					height: 36rpx;
+					line-height: 36rpx;
+					text-align: center;
+					background: #FF5A31;
+					border-radius: 2rpx 12rpx 2rpx 12rpx;
+					margin-right: 16rpx;
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #FFFFFF;
+				}
+				.index_scancode_fl_text {
+					flex: 1;
+					height: 36rpx;
+					line-height: 36rpx;
+					font-weight: 400;
+					font-size: 26rpx;
+					color: #FF5A31;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+				.index_scancode_fl_swiper {
+					flex: 1;
+					height: 36rpx;
+				}
+				.index_scancode_fl_btn {
+					flex-shrink: 0;
+					height: 36rpx;
+					line-height: 36rpx;
+					text-align: center;
+					background: #EAF9F8;
+					border-radius: 4rpx;
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #01B6AD;
+					margin-left: 8rpx;
+				}
+			}
 
 			.deposit_text {
 				width: 100%;
@@ -1835,7 +1946,7 @@
 				width: 100%;
 				display: flex;
 				align-items: center;
-				margin-top: 100rpx;
+				margin-top: 40rpx;
 
 				image {
 					width: 32rpx;
@@ -2149,4 +2260,4 @@
 			}
 		}
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3