| | |
| | | </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> |
| | |
| | | //表单选择了地址 |
| | | wx.chooseLocation({ |
| | | success: location => { |
| | | console.log('success loc', location) |
| | | console.log('success loc', location,source) |
| | | // address: "江苏省苏州市吴中区太湖东路288号" |
| | | // errMsg: "chooseLocation:ok" |
| | | // latitude: 31.26249 |
| | |
| | | // 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) { |
| | |
| | | |
| | | }, |
| | | fail: (err) => { |
| | | this.error = err; |
| | | that.error = err; |
| | | console.error('定位失败:', err); |
| | | }, |
| | | complete() { |
| | | this.$message.hideLoading() |
| | | that.$message.hideLoading() |
| | | } |
| | | }); |
| | | }, |