fix error tips in shop editor

This commit is contained in:
zhl 2021-04-23 09:54:55 +08:00
parent 30ccb6edd5
commit 69d2875826
2 changed files with 25 additions and 4 deletions

View File

@ -1,5 +1,25 @@
import request from '@/utils/request'
export interface ILocation {
lat: number,
lng: number
}
/**
* POI对象结构
*/
export interface IAreaData {
address: string,
id: string,
title: string,
province: string,
city: string,
district: string,
adcode: string,
type: number,
location: ILocation
}
export async function queryArea(str: string, region: string) {
let data = {keyword: str, region}
return request({

View File

@ -113,7 +113,7 @@ import UploadImage from '@/components/UploadImage/index.vue'
import RegionPicker from '@/components/RegionPicker/index.vue'
import { Form } from 'element-ui'
import { defaultShopData, getShop, saveShop } from '@/api/shop'
import { addressToLoc, queryArea } from '@/api/map'
import { addressToLoc, IAreaData, queryArea } from '@/api/map'
@Component({
name: 'ShopEditor',
@ -154,7 +154,7 @@ export default class extends Vue {
}
private tempTagView?: ITagView
private shopListOptions = []
private shopListOptions: IAreaData[] = []
get lang() {
@ -265,8 +265,9 @@ export default class extends Vue {
}
this.shopListOptions = data.records
}
private areaSelectChange(val: any) {
let result
let result: any
for (let d of this.shopListOptions) {
if (d.title == val) {
result = d
@ -329,7 +330,7 @@ export default class extends Vue {
width: 40px;
position: absolute;
right: 10px;
top: 0px;
top: 0;
}
}
</style>