修改获取站点的接口
This commit is contained in:
parent
99a9803833
commit
545c045c8c
@ -60,6 +60,7 @@
|
||||
getLocalShopById
|
||||
} from '@/api/shop.js'
|
||||
import {
|
||||
getPostStationList,
|
||||
getLocation,
|
||||
addPostStation,
|
||||
delPostStation
|
||||
@ -97,24 +98,21 @@
|
||||
onLoad(e) {
|
||||
if (e?.lstore_id) {
|
||||
this.lstore_id = e.lstore_id
|
||||
this.getLocalShopByIdFunc(e.lstore_id)
|
||||
this.getPostStationListFunc(e.lstore_id)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['initLocationFunc']),
|
||||
...mapMutations(['setCityInfo']),
|
||||
|
||||
getLocalShopByIdFunc(id) {
|
||||
getLocalShopById({
|
||||
id,
|
||||
type: 0
|
||||
getPostStationListFunc(id) {
|
||||
getPostStationList({
|
||||
id
|
||||
}).then((res) => {
|
||||
if (res.code == 1) {
|
||||
this.info = res.data
|
||||
|
||||
if (res.data.post_station.length >= 1) {
|
||||
this.postStationList = res.data.post_station
|
||||
res.data.post_station.map((value, index) => {
|
||||
if (res.data.length >= 1) {
|
||||
this.postStationList = res.data
|
||||
this.postStationList.map((value, index) => {
|
||||
this.poiList.push({
|
||||
id: value.id,
|
||||
latitude: value.lat,
|
||||
@ -134,13 +132,13 @@
|
||||
})
|
||||
})
|
||||
|
||||
this.lat = res.data.post_station[0].lat
|
||||
this.lng = res.data.post_station[0].lng
|
||||
this.lat = this.postStationList[0].lat
|
||||
this.lng = this.postStationList[0].lng
|
||||
} else {
|
||||
this.poiList[0] = {
|
||||
id: 1,
|
||||
latitude: this.cityInfo.gcj02_lat,
|
||||
longitude: this.cityInfo.gcj02_lng,
|
||||
longitude: this.cityInfo.gcj02_lng,
|
||||
iconPath: '/bundle_b/static/mark.png',
|
||||
width: 40,
|
||||
height: 40,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user