From 28a2f7a48f508970a10413c8aa2367a4e4790b1b Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 28 四月 2026 16:08:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 small-program/pages/index/index.vue |   37 +++++++++----------------------------
 1 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 085439b..22369fb 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -1,6 +1,6 @@
 <template>
 	<view class="index-page">
-		<view class="top-gradient-bg" :style="{ backgroundImage: 'url(' + backgroundImage + ')' }"></view>
+		<image class="top-gradient-bg" src="/static/image/bg_home@2x.png" mode="aspectFill"></image>
 		<view class="top-hero">
 			<view :style="{ height: statusbarHeight + 'px' }"></view>
 			<view class="hero-bar" :style="{ height: navHeight + 'px' }">
@@ -105,12 +105,9 @@
 		},
 		data() {
 			return {
-				backgroundImage: require('@/static/image/bg_home@2x.png'),
 				bannerList: [],
 				pointList: [],
-				page: 1,
-				ingOrder:null,
-				isRequest: true
+				ingOrder: null
 			}
 		},
 		async onLoad() {
@@ -123,11 +120,6 @@
 		onShow() {
 			this.ingOrder =null
 			this.getIngorder()
-		},
-		onReachBottom() {
-			if (this.cityId && this.latitude && this.longitude) {
-				this.getNearbyShopList()
-			}
 		},
 		methods: {
 			jumpOrderDetail(id){
@@ -164,10 +156,9 @@
 				}
 			},
 			async getNearbyShopList() {
-				if (!this.isRequest) return;
 				const res = await this.$u.api.getNearbyShopList({
-					capacity: 10,
-					page: this.page,
+					capacity: 5,
+					page: 1,
 					model: {
 						latitude: this.latitude,
 						longitude: this.longitude,
@@ -177,10 +168,6 @@
 				})
 				if (res.code === 200) {
 					this.pointList = res.data.records || []
-					this.page++
-					if (res.data.total <= this.pointList.length) {
-						this.isRequest = false
-					}
 				}
 			},
 			jumpJC() {
@@ -207,11 +194,10 @@
 				uni.chooseLocation({
 					type: 'gcj02',
 					success: async function(addr) {
+						console.log(addr, '==================uniapp閫夋嫨浣嶇疆鎴愬姛');
 						if (addr.errMsg === 'chooseLocation:ok' && addr.latitude) {
 							const locParam = { latitude: addr.latitude, longitude: addr.longitude };
-							// uni.setStorageSync('address', locParam);
-							
-							var myAmapFun = new amapFile.AMapWX({ key: 'e4d46c87adf151dca20060317592b1b6' });
+							var myAmapFun = new amapFile.AMapWX({ key: that.$gaodeMapKey });
 							myAmapFun.getRegeo({
 								location: addr.longitude + ',' + addr.latitude,
 								success: async function(data) {
@@ -221,31 +207,26 @@
 									locParam.city = (info.regeocodeData.addressComponent.city && typeof info.regeocodeData.addressComponent.city === 'string') 
 										? info.regeocodeData.addressComponent.city 
 										: info.regeocodeData.addressComponent.province;
-									var ta = info.name || '鍦板潃鑾峰彇澶辫触';
+									var ta = addr.name || '鍦板潃鑾峰彇澶辫触';
 									locParam.address = ta
 									const resCity = await that.$u.api.getCityByName({ cityName: locParam.city })
 									if (resCity.code === 200 && resCity.data) {
 										locParam.cityId = resCity.data.id
 										that.$store.commit('setPosition', locParam)
-										that.page = 1
 										that.pointList = []
-										that.isRequest = true
 										that.getNearbyShopList()
 									} else {
 										that.$store.commit('setPosition', locParam)
 										that.$store.commit('clearCityId')
-										that.page = 1
 										that.pointList = []
-										that.isRequest = true
+										that.getNearbyShopList()
 									}
 								},
 								fail: function(err) {
 									console.error('鑾峰彇浣嶇疆澶辫触===========', err);
 									that.$store.commit('setPosition', locParam)
-									that.page = 1
 									that.pointList = []
-									that.isRequest = true
-									// that.getNearbyShopList()
+									that.getNearbyShopList()
 								}
 							});
 						}

--
Gitblit v1.9.3