| | |
| | | @click="selectAddressSuggestion(item)" |
| | | > |
| | | <view class="suggestion-name">{{ item.name }}</view> |
| | | <view class="suggestion-address">{{ item.district }}{{ item.address }}</view> |
| | | <view class="suggestion-address">{{ (item.district || '') + (item.address || '') }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | <script> |
| | | import { searchHospitals } from "@/api/hospital" |
| | | import { baiduPlaceSuggestion } from "@/api/map" |
| | | import { searchTianDiTuAddress } from "@/api/map" |
| | | |
| | | export default { |
| | | name: 'HospitalSelector', |
| | |
| | | |
| | | // 搜索地址建议 |
| | | searchAddress(query) { |
| | | baiduPlaceSuggestion(query, this.region).then(response => { |
| | | searchTianDiTuAddress(query, this.region).then(response => { |
| | | if (response.code === 200 && response.data) { |
| | | this.addressSuggestions = response.data |
| | | this.showAddressSuggestions = true |
| | |
| | | |
| | | // 选择地址建议 |
| | | selectAddressSuggestion(item) { |
| | | const fullAddress = item.district + item.address |
| | | const fullAddress = (item.district || '') + (item.address || '') |
| | | this.$emit('input', { |
| | | ...this.value, |
| | | address: fullAddress |