From fd39ea8b2f09ce95f5946370d9d9fc64e17bf9ed Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 21 Apr 2021 15:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E7=BC=96=E8=BE=91=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=85=BE=E8=AE=AF=E5=9C=B0=E5=9B=BE=E5=BA=A7?= =?UTF-8?q?=E6=A0=87=E7=9A=84=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/map.ts | 10 ++ src/api/shop.ts | 1 + src/api/types.d.ts | 8 +- src/components/UploadImage/index.vue | 45 ++--- src/router/modules/marketing.ts | 20 +-- src/views/marketing/points.vue | 258 +++++++++++---------------- src/views/shop/edit.vue | 65 ++++++- 7 files changed, 217 insertions(+), 190 deletions(-) diff --git a/src/api/map.ts b/src/api/map.ts index 1147615..98e6697 100644 --- a/src/api/map.ts +++ b/src/api/map.ts @@ -9,3 +9,13 @@ export async function queryArea(str: string, region: string) { }) } + +export async function addressToLoc(address: string) { + let data = { address } + return request({ + url: '/area/geocoder', + method: 'post', + data + }) + +} diff --git a/src/api/shop.ts b/src/api/shop.ts index 24bf9be..a77e3df 100644 --- a/src/api/shop.ts +++ b/src/api/shop.ts @@ -5,6 +5,7 @@ export const defaultShopData: IShopData = { name: '', _id: '', address: '', + logo: '' } export const getShops = (params: any) => diff --git a/src/api/types.d.ts b/src/api/types.d.ts index fb4ec46..2e389b9 100644 --- a/src/api/types.d.ts +++ b/src/api/types.d.ts @@ -47,5 +47,11 @@ export interface IShopData { createdAt?: Date, areaCode?: number, areaStr?: string, - address: string + address: string, + logo?: string, + lng?: number, + lat?: number, + showName?: string, + extData?: string, + category?: string } diff --git a/src/components/UploadImage/index.vue b/src/components/UploadImage/index.vue index 2a1054e..3c3d10d 100644 --- a/src/components/UploadImage/index.vue +++ b/src/components/UploadImage/index.vue @@ -2,32 +2,33 @@
将文件拖到此处,或点击上传
-
-
- -
- -
-
-
+ + + + + + + + + + + + + +
@@ -88,7 +93,6 @@ export default class extends Vue { .image-preview { width: 200px; - height: 200px; position: relative; border: 1px dashed #d9d9d9; float: left; @@ -97,18 +101,15 @@ export default class extends Vue { .image-preview-wrapper { position: relative; width: 100%; - height: 100%; img { width: 100%; - height: 100%; } } .image-preview-action { position: absolute; width: 100%; - height: 100%; left: 0; top: 0; cursor: default; diff --git a/src/router/modules/marketing.ts b/src/router/modules/marketing.ts index 72df80c..c4b0856 100644 --- a/src/router/modules/marketing.ts +++ b/src/router/modules/marketing.ts @@ -30,16 +30,16 @@ const marketingRoutes: RouteConfig = { icon: 'promo' } }, - // { - // path: 'points', - // component: () => import('@/views/marketing/points.vue'), - // name: 'PointsSetting', - // meta: { - // title: 'marketing_points', - // permissions: ['points:read'], - // icon: 'points' - // } - // } + { + path: 'points', + component: () => import('@/views/marketing/points.vue'), + name: 'PointsSetting', + meta: { + title: 'marketing_points', + permissions: ['points:read'], + icon: 'points' + } + } ] } diff --git a/src/views/marketing/points.vue b/src/views/marketing/points.vue index 96f461d..fdcbaea 100644 --- a/src/views/marketing/points.vue +++ b/src/views/marketing/points.vue @@ -1,187 +1,135 @@ diff --git a/src/views/shop/edit.vue b/src/views/shop/edit.vue index 4a676d2..3d54df1 100644 --- a/src/views/shop/edit.vue +++ b/src/views/shop/edit.vue @@ -8,7 +8,6 @@ class="form-container" > + + + + + + @@ -49,6 +69,25 @@ required /> + + {{postForm.lat}} - {{postForm.lng}} + + 更新座标 + + + + +