diff --git a/src/api/shop.ts b/src/api/shop.ts
index ca6d92e..24bf9be 100644
--- a/src/api/shop.ts
+++ b/src/api/shop.ts
@@ -3,7 +3,8 @@ import { IShopData } from './types'
export const defaultShopData: IShopData = {
name: '',
- _id: ''
+ _id: '',
+ address: '',
}
export const getShops = (params: any) =>
diff --git a/src/api/types.d.ts b/src/api/types.d.ts
index f5fa6ec..fb4ec46 100644
--- a/src/api/types.d.ts
+++ b/src/api/types.d.ts
@@ -44,5 +44,8 @@ export interface IQuestionData {
export interface IShopData {
_id: string,
name: string,
- createdAt?: Date
+ createdAt?: Date,
+ areaCode?: number,
+ areaStr?: string,
+ address: string
}
diff --git a/src/components/RegionPicker/index.vue b/src/components/RegionPicker/index.vue
new file mode 100644
index 0000000..87eae98
--- /dev/null
+++ b/src/components/RegionPicker/index.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
diff --git a/src/views/shop/edit.vue b/src/views/shop/edit.vue
index 37796ba..3a692d1 100644
--- a/src/views/shop/edit.vue
+++ b/src/views/shop/edit.vue
@@ -38,6 +38,7 @@
v-model="postForm.name"
:maxlength="100"
name="name"
+ id="name"
required
>
店铺名
@@ -45,6 +46,36 @@
+
+
+
+
+
+
+
+
+
+
+
+ 详细地址
+
+
+
+
@@ -57,6 +88,7 @@ import { TagsViewModule, ITagView } from '@/store/modules/tags-view'
import MaterialInput from '@/components/MaterialInput/index.vue'
import Sticky from '@/components/Sticky/index.vue'
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'
@@ -65,7 +97,8 @@ import { defaultShopData, getShop, saveShop } from '@/api/shop'
components: {
MaterialInput,
Sticky,
- UploadImage
+ UploadImage,
+ RegionPicker
}
})
export default class extends Vue {
@@ -174,6 +207,11 @@ export default class extends Vue {
})
}
+ private areaChange(val: string) {
+ console.log(`new area: ${val}`)
+ this.postForm.areaStr = val
+ }
+
}
diff --git a/src/views/shop/list.vue b/src/views/shop/list.vue
index 845704a..049b67c 100644
--- a/src/views/shop/list.vue
+++ b/src/views/shop/list.vue
@@ -38,7 +38,7 @@
@@ -51,6 +51,14 @@
+
+
+ {{ row.areaStr }}
+
+
+