xuxueyang
2024-10-20 f4fd489475500b0d41dde019963307d217321d50
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()
               }
            });
         },