邓洁 : "我的"模块删除功能

This commit is contained in:
邓洁
2023-11-19 18:46:42 +08:00
parent 676638c370
commit 0f268fb419
7 changed files with 161 additions and 95 deletions

View File

@@ -1,13 +1,7 @@
<template>
<view>
<SearchShopListItem
v-for="item in searchInfoList"
:key="searchid"
:shopInfo="item"
:show-style="showStyle"
:isEdit="isEdit"
@delItem="handleDel"
></SearchShopListItem>
<SearchShopListItem v-for="item in searchInfoList" :key="searchid" :shopInfo="item" :show-style="showStyle"
:isEdit="isEdit" @delItem="handleDel" @updateItem="handleUpdate"></SearchShopListItem>
</view>
</template>
@@ -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)