@ -103,13 +103,3 @@ export function auditCarInfoAgain(data){
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 我的发布列表
|
||||
export function getAddressForService(data){
|
||||
return request({
|
||||
url: '/base/gaodeMap/getPlaceByAddress',
|
||||
method:'GET',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { getAddressForService } from "@/api/secondHandCar"
|
||||
// 获取定位, 返回 经纬度
|
||||
export function getLocal(mapContext) {
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -47,19 +46,7 @@ export function getAddress(mapContext, lnglat) {
|
||||
// 输入提示
|
||||
export function searchFun(mapContext, cityCode, keyword) {
|
||||
return new Promise((resolve) => {
|
||||
getAddressForService({
|
||||
city: '',
|
||||
address: keyword
|
||||
}).then((res) => {
|
||||
if(res.code == 200) {
|
||||
resolve(res?.data?.pois || [])
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
}).catch(() => {
|
||||
resolve([])
|
||||
})
|
||||
/*mapContext.plugin('AMap.AutoComplete', function(){
|
||||
mapContext.plugin('AMap.AutoComplete', function(){
|
||||
var autoOptions = {
|
||||
city: cityCode || '全国',
|
||||
};
|
||||
@ -74,7 +61,7 @@ export function searchFun(mapContext, cityCode, keyword) {
|
||||
resolve([])
|
||||
}
|
||||
})
|
||||
})*/
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -75,14 +75,13 @@
|
||||
}
|
||||
let content = '<div class="dest-position"></div>';
|
||||
let activeObj = this.addressList[this.activeIndex];
|
||||
let lanLat = activeObj.location.split(',');
|
||||
this.marker = new AMap.Marker({
|
||||
position: new AMap.LngLat( lanLat[0], lanLat[1] ),
|
||||
position: new AMap.LngLat( activeObj.location.lng, activeObj.location.lat ),
|
||||
content: content,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
});
|
||||
this.map.add(this.marker)
|
||||
this.map.setCenter([lanLat[0], lanLat[1]])
|
||||
this.map.setCenter([activeObj.location.lng, activeObj.location.lat])
|
||||
},
|
||||
successHandler() {
|
||||
if( this.activeIndex == null ) {
|
||||
@ -90,11 +89,10 @@
|
||||
return
|
||||
}
|
||||
let activeObj = this.addressList[this.activeIndex];
|
||||
let lanLat = activeObj.location.split(',');
|
||||
let _tempObj = {
|
||||
startPoiAddress: activeObj?.district + activeObj?.address + activeObj?.name,
|
||||
startLat: lanLat[0],
|
||||
startLng: lanLat[1],
|
||||
startLat: activeObj?.location?.lat,
|
||||
startLng: activeObj?.location?.lng,
|
||||
adCode: activeObj?.adcode,
|
||||
}
|
||||
sessionStorage.setItem('reportAddress', JSON.stringify(_tempObj))
|
||||
|
Reference in New Issue
Block a user