From 00a7a61df86db969f2ba61c508d02ba4709ce3d4 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 05 六月 2026 10:09:06 +0800
Subject: [PATCH] 改bug

---
 app/pages/index/index.vue |   96 ++++++++++++++++++++++++++---------------------
 1 files changed, 53 insertions(+), 43 deletions(-)

diff --git a/app/pages/index/index.vue b/app/pages/index/index.vue
index b9d4f09..b944afc 100644
--- a/app/pages/index/index.vue
+++ b/app/pages/index/index.vue
@@ -261,6 +261,8 @@
 
 <script>
 	import { mapState } from 'vuex'
+	import { checkLocationPermission } from '@/utils/utils'
+	
 	export default {
 		data() {
 			return {
@@ -640,51 +642,59 @@
 				if (this.hallLoading || !this.hallHasMore) {
 					return
 				}
-				this.hallLoading = true
-
-				let distance = null
-				if (this.selectedFilters.distance !== '涓嶉檺') {
-					const distanceText = this.selectedFilters.distance
-					if (distanceText.includes('km')) {
-						distance = parseInt(distanceText) * 1000
+				
+				checkLocationPermission().then((granted) => {
+					if (granted) {
+						console.log('宸叉湁浣嶇疆鏉冮檺')
+						this.hallLoading = true
+						
+						let distance = null
+						if (this.selectedFilters.distance !== '涓嶉檺') {
+							const distanceText = this.selectedFilters.distance
+							if (distanceText.includes('km')) {
+								distance = parseInt(distanceText) * 1000
+							} else {
+								distance = parseInt(distanceText)
+							}
+						}
+						
+						const sortTypeMap = {
+							'缁煎悎鎺掑簭': 1,
+							'璺濈鏈�杩�': 2
+						}
+						const sortType = this.selectedFilters.sort !== '涓嶉檺' ? (sortTypeMap[this.selectedFilters.sort] || null) : null
+						
+						let gradeId = null
+						if (this.selectedFilters.level !== '涓嶉檺') {
+							const selectedCategory = this.categoryList.find(item => item.name === this.selectedFilters.level)
+							if (selectedCategory) {
+								gradeId = selectedCategory.id
+							}
+						}
+						
+						console.log('鎺ュ崟澶у巺:', { distance, gradeId, sortType })
+						this.$u.api.grabOrderHall({
+							capacity: this.hallPageSize,
+							page: this.hallPage,
+							model: {
+								distance: distance,
+								gradeId: gradeId,
+								sortType: sortType
+							}
+						}).then(res => {
+							console.log('鎺ュ崟澶у巺', res)
+							this.hallLoading = false
+							if (res.code === 200) {
+								const list = res.data.records || []
+								this.orderList = this.hallPage === 1 ? list : this.orderList.concat(list)
+								this.hallHasMore = list.length >= this.hallPageSize
+							}
+						}).finally(() => {
+							this.hallLoading = false
+						})
 					} else {
-						distance = parseInt(distanceText)
+						console.log('杩樻病鏈変綅缃潈闄�')
 					}
-				}
-
-				const sortTypeMap = {
-					'缁煎悎鎺掑簭': 1,
-					'璺濈鏈�杩�': 2
-				}
-				const sortType = this.selectedFilters.sort !== '涓嶉檺' ? (sortTypeMap[this.selectedFilters.sort] || null) : null
-
-				let gradeId = null
-				if (this.selectedFilters.level !== '涓嶉檺') {
-					const selectedCategory = this.categoryList.find(item => item.name === this.selectedFilters.level)
-					if (selectedCategory) {
-						gradeId = selectedCategory.id
-					}
-				}
-
-				console.log('鎺ュ崟澶у巺:', { distance, gradeId, sortType })
-				this.$u.api.grabOrderHall({
-					capacity: this.hallPageSize,
-					page: this.hallPage,
-					model: {
-						distance: distance,
-						gradeId: gradeId,
-						sortType: sortType
-					}
-				}).then(res => {
-					console.log('鎺ュ崟澶у巺', res)
-					this.hallLoading = false
-					if (res.code === 200) {
-						const list = res.data.records || []
-						this.orderList = this.hallPage === 1 ? list : this.orderList.concat(list)
-						this.hallHasMore = list.length >= this.hallPageSize
-					}
-				}).finally(() => {
-					this.hallLoading = false
 				})
 			},
 

--
Gitblit v1.9.3