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

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,15 +1,7 @@
<template>
<view>
<ShowShopListItem
v-for="item in shopInfoList"
:key="shopid"
:shopInfo="item"
:is-adshow="isADshow"
:adlinkPath="adlinkPath"
:show-style="showStyle"
:is-edit="isEdit"
@delItem="handleDel"
></ShowShopListItem>
<ShowShopListItem v-for="item in shopInfoList" :key="shopid" :shopInfo="item" :is-adshow="isADshow"
:adlinkPath="adlinkPath" :show-style="showStyle" :is-edit="isEdit" @delItem="handleDel"></ShowShopListItem>
</view>
</template>
@@ -24,7 +16,7 @@
* @property {Object} customQuery 自定义查询参数
*/
export default {
name:"ShowShopList",
name: "ShowShopList",
data() {
return {
pageSize: 5,
@@ -33,54 +25,55 @@
};
},
props: {
showStyle:{
showStyle: {
type: Number,
default() {
default () {
return 0
}
},
isADshow: {
type: Boolean,
default() {
default () {
return true
}
},
adlinkPath: {
type: String,
default() {
default () {
return ''
}
},
isEdit: {
type: Boolean,
default() {
default () {
return false
}
},
// //获取列表类型传递参数部分
listType:{
listType: {
type: Number,
default() {
default () {
return 1
}
},
customQuery:{
customQuery: {
type: Object,
default() {
default () {
return {}
}
},
shopInfoList: {
type: Array,
default() {
default () {
return []
}
}
},
methods: {
handleDel(shopid){
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)
@@ -93,17 +86,17 @@
pageNum: this.pageNum,
...this.customQuery
})
console.log("query",query);
console.log("query", query);
this.$api.getShopList(query).then(res => {
this.shopInfoList = res.data.data
this.shopInfoList.forEach(item=>{
item.pics =this.$api.imgUrl + item.pics
this.shopInfoList.forEach(item => {
item.pics = this.$api.imgUrl + item.pics
});
})
}
},
}
</script>