diff --git a/components/SearchShopList/SearchShopList.vue b/components/SearchShopList/SearchShopList.vue index 4fe4956..8cd3de1 100644 --- a/components/SearchShopList/SearchShopList.vue +++ b/components/SearchShopList/SearchShopList.vue @@ -1,13 +1,7 @@ @@ -19,7 +13,7 @@ * @property {Object} customQuery 自定义查询参数 */ export default { - name:"SearchShopList", + name: "SearchShopList", data() { return { pageSize: 5, @@ -27,40 +21,44 @@ }; }, props: { - searchInfoList:{ + searchInfoList: { type: Array, - default(){ + default () { return [] } }, - showStyle:{ + showStyle: { type: Number, - default() { + default () { return 0 } }, isEdit: { type: Boolean, - default() { + default () { return false } }, - listType:{ + listType: { type: Number, - default(){ + default () { return 2 } }, - customQuery:{ + customQuery: { type: Object, - default(){ + default () { return {} } } }, methods: { - handleDel(shopid){ + handleUpdate(searchid) { + this.$emit('updateItem', searchid) + }, + handleDel(shopid) { console.log("删除了商铺", shopid); + this.$emit('delItem', shopid) // const delindex = this.shopInfoList.findIndex((item,index)=> item.shopid === shopid) // TODO:不能直接修改 // if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1) diff --git a/components/SearchShopListItem/SearchShopListItem.vue b/components/SearchShopListItem/SearchShopListItem.vue index 6241990..3433e8b 100644 --- a/components/SearchShopListItem/SearchShopListItem.vue +++ b/components/SearchShopListItem/SearchShopListItem.vue @@ -6,7 +6,7 @@ {{shopInfo.tt}} - + 租金:{{shopInfo.zujin}}元/月 @@ -44,7 +44,7 @@ - + @@ -68,7 +68,7 @@ {{shopInfo.mobile}} - + @@ -89,7 +89,7 @@ 发布日期:{{$u.timeFormat(shopInfo.pub_time,'yyyy-mm-dd')}} - + @@ -100,7 +100,7 @@ 删除 - + @@ -110,41 +110,41 @@ export default { props: { shopInfo: { - type:Object, - default(){ + type: Object, + default () { return { - + } } }, showStyle: { - type:Number, - default() { + type: Number, + default () { return 0 } }, isEdit: { - type:Boolean, - default(){ + type: Boolean, + default () { return false } } - + }, data() { return { - + } - + }, computed: { - + }, methods: { handleEdit(searchid) { // TODO 完成页面跳转 - console.log("点击了编辑ID为",searchid); - + console.log("点击了编辑ID为", searchid); + this.$emit('updateItem', searchid) }, handleDel(searchid) { this.$emit('delItem', searchid) @@ -156,23 +156,28 @@