Files
2023-12-05 10:48:27 +08:00

73 lines
1.5 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<SearchShopListItem v-for="item in searchInfoList" :key="item.id" :shopInfo="item" :show-style="showStyle"
:isEdit="isEdit" @delItem="handleDel" @updateItem="handleUpdate"></SearchShopListItem>
</view>
</template>
<script>
/**
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
* @property {Boolean} isEdit 是否显示编辑和删除
* @property {Number} listType 获取列表类型传递参数部分
* @property {Object} customQuery 自定义查询参数
*/
export default {
name: "SearchShopList",
data() {
return {
pageSize: 5,
pageNum: 1,
};
},
props: {
searchInfoList: {
type: Array,
default () {
return []
}
},
showStyle: {
type: Number,
default () {
return 0
}
},
isEdit: {
type: Boolean,
default () {
return false
}
},
listType: {
type: Number,
default () {
return 2
}
},
customQuery: {
type: Object,
default () {
return {}
}
}
},
methods: {
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)
// console.log(this.shopInfoList);
}
}
}
</script>
<style lang="scss">
</style>