From f4fd489475500b0d41dde019963307d217321d50 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期日, 20 十月 2024 20:30:49 +0800
Subject: [PATCH] update 定位

---
 pages/user/address/address.vue |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/pages/user/address/address.vue b/pages/user/address/address.vue
index 6be831d..82a5fdd 100644
--- a/pages/user/address/address.vue
+++ b/pages/user/address/address.vue
@@ -19,7 +19,7 @@
 				</view>
 				<view class="flex" @click="changeCurrentAddress">
 					<view>
-						<image style="width: 30rpx;height: 30rpx;" class="m-t-2"
+						<image style="width: 30rpx;height: 30rpx;margin-top: 6rpx;margin-right: 10rpx;" class="m-t-2"
 							src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/a2/a248385d4fe748ca81ee058ea5bf8c47icon-address.jpg">
 						</image>
 					</view>
@@ -262,7 +262,7 @@
 					//表单选择了地址
 					wx.chooseLocation({
 						success: location => {
-							console.log('success loc', location)
+							console.log('success loc', location,source)
 							// address: "江苏省苏州市吴中区太湖东路288号"
 							// errMsg: "chooseLocation:ok"
 							// latitude: 31.26249
@@ -270,13 +270,14 @@
 							// name: "苏州市吴中区人民政府"
 							if (source === 'form') {
 								// (location.address || '') +
-								that.submitForm.address = (location.name || '')
+								that.submitForm.address = (location.name || location.address || '')
 								that.submitForm.latitude = location.latitude || 0
 								that.submitForm.longitude = location.longitude || 0
 							} else if (source === 'input') {
 								// (location.address || '') +
 								// that.search_flow =   (location.name || '')
-								that.$store.commit('setAddressDesc', (location.name || ''))
+								that.$store.commit('setAddressDesc', (location.name || location.address || ''))
+								that.$forceUpdate()
 							}
 
 							// if (!that.submitForm.province && location.provinceName) {
@@ -386,11 +387,11 @@
 
 					},
 					fail: (err) => {
-						this.error = err;
+						that.error = err;
 						console.error('定位失败:', err);
 					},
 					complete() {
-						this.$message.hideLoading()
+						that.$message.hideLoading()
 					}
 				});
 			},

--
Gitblit v1.9.3