详情位置组件优化
parent
13db3a3727
commit
55d132bade
|
|
@ -5,9 +5,12 @@
|
||||||
<a-input-search v-model:value="address" enter-button placeholder="请输入地址" @search="searchAddress" />
|
<a-input-search v-model:value="address" enter-button placeholder="请输入地址" @search="searchAddress" />
|
||||||
<div class="addressbox" v-if="optionsVisible">
|
<div class="addressbox" v-if="optionsVisible">
|
||||||
<div class="flex" v-for="item in optionsData" @click="handleflyto(item)">
|
<div class="flex" v-for="item in optionsData" @click="handleflyto(item)">
|
||||||
<div class="label">{{ item.formatted_address }}</div>
|
<!-- <div class="search-icon">
|
||||||
<div class="mr-1">{{ item.city }}</div>
|
<img src="/statistical/search-icon.png" alt="" />
|
||||||
<div>{{ item.district }}</div>
|
</div> -->
|
||||||
|
<div class="label" :title="item.name">{{ item.name }}</div>
|
||||||
|
<div class="mr-1">{{ item.cityname }}</div>
|
||||||
|
<div>{{ item.adname }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -62,12 +65,15 @@
|
||||||
const optionsData = ref([])
|
const optionsData = ref([])
|
||||||
const optionsVisible = ref(false)
|
const optionsVisible = ref(false)
|
||||||
const searchAddress = ()=>{
|
const searchAddress = ()=>{
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `https://restapi.amap.com/v3/geocode/geo?key=ed310f0b1f6cfd93edfba42f1a09d4d9&&city=临沂&address=`+address.value,
|
url: 'https://restapi.amap.com/v5/place/text?&key=ee7f561fae9249aeb971bcc661083438&keywords=' +
|
||||||
|
address.value +
|
||||||
|
'®ion=371300&citylimit=true&page_num=1&page_size=10',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log('aaa111', res.data)
|
console.log('aaa111', res.data)
|
||||||
optionsData.value = res.data.geocodes
|
optionsData.value = res.data.pois
|
||||||
optionsVisible.value = true
|
optionsVisible.value = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue