fix error tips in shop editor
This commit is contained in:
parent
30ccb6edd5
commit
69d2875826
@ -1,5 +1,25 @@
|
|||||||
import request from '@/utils/request'
|
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) {
|
export async function queryArea(str: string, region: string) {
|
||||||
let data = {keyword: str, region}
|
let data = {keyword: str, region}
|
||||||
return request({
|
return request({
|
||||||
|
@ -113,7 +113,7 @@ import UploadImage from '@/components/UploadImage/index.vue'
|
|||||||
import RegionPicker from '@/components/RegionPicker/index.vue'
|
import RegionPicker from '@/components/RegionPicker/index.vue'
|
||||||
import { Form } from 'element-ui'
|
import { Form } from 'element-ui'
|
||||||
import { defaultShopData, getShop, saveShop } from '@/api/shop'
|
import { defaultShopData, getShop, saveShop } from '@/api/shop'
|
||||||
import { addressToLoc, queryArea } from '@/api/map'
|
import { addressToLoc, IAreaData, queryArea } from '@/api/map'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'ShopEditor',
|
name: 'ShopEditor',
|
||||||
@ -154,7 +154,7 @@ export default class extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private tempTagView?: ITagView
|
private tempTagView?: ITagView
|
||||||
private shopListOptions = []
|
private shopListOptions: IAreaData[] = []
|
||||||
|
|
||||||
|
|
||||||
get lang() {
|
get lang() {
|
||||||
@ -265,8 +265,9 @@ export default class extends Vue {
|
|||||||
}
|
}
|
||||||
this.shopListOptions = data.records
|
this.shopListOptions = data.records
|
||||||
}
|
}
|
||||||
|
|
||||||
private areaSelectChange(val: any) {
|
private areaSelectChange(val: any) {
|
||||||
let result
|
let result: any
|
||||||
for (let d of this.shopListOptions) {
|
for (let d of this.shopListOptions) {
|
||||||
if (d.title == val) {
|
if (d.title == val) {
|
||||||
result = d
|
result = d
|
||||||
@ -329,7 +330,7 @@ export default class extends Vue {
|
|||||||
width: 40px;
|
width: 40px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
top: 0px;
|
top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user