From c333298f8216a9ee0a2dd9d9a270bf4906f1e364 Mon Sep 17 00:00:00 2001 From: zhouxueli <2841188632@qq.com> Date: Thu, 21 Aug 2025 17:24:18 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"story#7074,=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BD=8D=E7=BD=AE=E6=94=B9=E5=8A=A8=E4=B8=BA?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=8E=A5=E5=8F=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1abb7ac605c2359e745d2bc5ef513632cca38696. --- src/api/secondHandCar.js | 12 +----------- src/utils/map.js | 17 ++--------------- src/views/report/addressMap.vue | 10 ++++------ 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/src/api/secondHandCar.js b/src/api/secondHandCar.js index 97950b75..6a1a6679 100644 --- a/src/api/secondHandCar.js +++ b/src/api/secondHandCar.js @@ -102,14 +102,4 @@ export function auditCarInfoAgain(data){ contentType: 'application/json', data }) -} - - -// 我的发布列表 -export function getAddressForService(data){ - return request({ - url: '/base/gaodeMap/getPlaceByAddress', - method:'GET', - params: data, - }) -} +} \ No newline at end of file diff --git a/src/utils/map.js b/src/utils/map.js index a036e997..b6b51fbd 100644 --- a/src/utils/map.js +++ b/src/utils/map.js @@ -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([]) } }) - })*/ + }) }) } diff --git a/src/views/report/addressMap.vue b/src/views/report/addressMap.vue index 0388bba1..1217ce23 100644 --- a/src/views/report/addressMap.vue +++ b/src/views/report/addressMap.vue @@ -75,14 +75,13 @@ } let content = '
'; 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))