From 7a0b33a5f2e0ba589bf35a1b8d896700a21f94a4 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 30 四月 2026 16:00:55 +0800
Subject: [PATCH] 支付宝支付dddadd

---
 small-program/pages/index/index.vue |   45 ++++++++++++++++++++++++++++++---------------
 1 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index df092fb..3dd218b 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -110,7 +110,8 @@
 				pointList: [],
 				ingOrder: null,
 				showLogin: false,
-				pendingNavigate: null
+				pendingNavigate: null,
+				lastLocationAuth: null
 			}
 		},
 		async onLoad() {
@@ -123,6 +124,7 @@
 		onShow() {
 			this.ingOrder =null
 			this.getIngorder()
+			this.checkLocationAuth()
 		},
 		watch: {
 			token(newToken) {
@@ -135,6 +137,27 @@
 			}
 		},
 		methods: {
+			async checkLocationAuth() {
+				const _this = this
+				uni.getSetting({
+					success(res) {
+						const authLocation = res.authSetting['scope.userLocation']
+						if (_this.lastLocationAuth !== null && _this.lastLocationAuth !== authLocation) {
+							if (authLocation) {
+								_this.positioning()
+							}
+						}
+						_this.lastLocationAuth = authLocation
+					}
+				})
+			},
+			async getIngorder() {
+				var that =this
+				let res = await that.$u.api.getActiveOrderTip()
+				if (res && res.code === 200) { 
+					this.ingOrder = res.data
+				} 
+			},
 			jumpBannerDetail(item) {
 				if(!item.content || item.content =='' || item.type==0){
 					return
@@ -153,13 +176,6 @@
 				uni.navigateTo({
 					url:'/pages/delivery-order-detail/delivery-order-detail?userType=0&id='+id
 				})
-			},
-			async getIngorder(){
-				var that =this
-				let res = await that.$u.api.getActiveOrderTip()
-				if (res && res.code === 200) { 
-					this.ingOrder = res.data
-				} 
 			},
 			jumpOrderList(status){
 				if (!this.token) {
@@ -241,12 +257,10 @@
 									console.log(data, '==================閫夋嫨鍦板潃閫嗚В鏋�');
 									let info = data[0];
 									locParam.province = info.province;
-									locParam.city = (info.regeocodeData.addressComponent.city && typeof info.regeocodeData.addressComponent.city === 'string') 
-										? info.regeocodeData.addressComponent.city 
-										: info.regeocodeData.addressComponent.province;
+									locParam.adcode = info.regeocodeData.addressComponent.adcode
 									var ta = addr.name || '鍦板潃鑾峰彇澶辫触';
 									locParam.address = ta
-									const resCity = await that.$u.api.getCityByName({ cityName: locParam.city })
+									const resCity = await that.$u.api.getCityByName({ code: locParam.adcode })
 									if (resCity.code === 200 && resCity.data) {
 										locParam.cityId = resCity.data.id
 										that.$store.commit('setPosition', locParam)
@@ -281,23 +295,24 @@
 					isHighAccuracy: true,
 					success: function (addr) {
 						const locParam = { latitude: addr.latitude, longitude: addr.longitude };
-						var myAmapFun = new amapFile.AMapWX({ key: 'f2e6c0bfcac14c27b4f0d6d0d5b9d7d' });
+						var myAmapFun = new amapFile.AMapWX({ key: that.$gaodeMapKey });
 						myAmapFun.getRegeo({
 							location: addr.longitude + ',' + addr.latitude,
 							success: async function(data) {
 								console.log(data, '==================鑾峰彇鍦板潃');
 								let info = data[0];
 								locParam.province = info.province;
-								locParam.city = info.city;
+								locParam.adcode = info.regeocodeData.addressComponent.adcode;
 								locParam.area = info.district;
 								locParam.street = info.street;
 								var ta = info.name || '鍦板潃鑾峰彇澶辫触';
 								locParam.address = ta
-								const resCity = await that.$u.api.getCityByName({ cityName: locParam.city })
+								const resCity = await that.$u.api.getCityByName({ code: locParam.adcode })
 								if (resCity.code === 200) {
 									locParam.cityId = resCity.data.id
 								}
 								that.$store.commit('setPosition', locParam)
+								that.getNearbyShopList()
 								that.$isResolve()
 							},
 							fail: (err) => {

--
Gitblit v1.9.3