83 lines
1.8 KiB
Vue
83 lines
1.8 KiB
Vue
<template>
|
||
<view>
|
||
<SearchShopListItem
|
||
v-for="item in shopInfoList"
|
||
:key="searchid"
|
||
:shopInfo="item"
|
||
:show-style="showStyle"
|
||
@delItem="handleDel"
|
||
></SearchShopListItem>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
/**
|
||
* @property {Array} shopInfoList 对象数组,(不带图片)需要展示的商铺列表
|
||
*/
|
||
export default {
|
||
name:"SearchShopList",
|
||
data() {
|
||
return {
|
||
|
||
};
|
||
},
|
||
props: {
|
||
showStyle:{
|
||
type: Number,
|
||
default() {
|
||
return 0
|
||
}
|
||
},
|
||
isEdit: {
|
||
type: Boolean,
|
||
default() {
|
||
return false
|
||
}
|
||
},
|
||
shopInfoList: {
|
||
type: Array,
|
||
default() {
|
||
return [
|
||
{
|
||
searchid: 1,
|
||
title: '寻找旺铺,200平米左右,寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
|
||
price: 5000,
|
||
date: '2023-11-02',
|
||
phoneNum: 13348946108,
|
||
pos: '锦江区',
|
||
category: '餐饮美食',
|
||
uname: 'A先生',
|
||
sqr: 500,
|
||
yjtzText: "423万元"
|
||
},
|
||
{
|
||
searchid: 2,
|
||
title: '寻找旺铺,200平米左右,寻找旺铺,200平米左右寻找旺铺,200平米左右寻找旺铺,200平米左右',
|
||
price: 7000,
|
||
date: '2023-11-02',
|
||
phoneNum: 13348946108,
|
||
pos: '锦江区',
|
||
category: '餐饮美食',
|
||
uname: '王先生',
|
||
sqr: 200,
|
||
yjtzText: "423万元"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
handleDel(shopid){
|
||
console.log("删除了商铺", 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> |