罗世杰修改ShopList和SearchList的api

This commit is contained in:
LuoShijie
2023-11-18 18:07:01 +08:00
parent f3cec1461e
commit fbb6b00cba
7 changed files with 78 additions and 93 deletions

View File

@@ -13,13 +13,18 @@
<script>
/**
* @property {Array} shopInfoList 对象数组,(不带图片)需要展示商铺列表
* @property {Number} showStyle 展示商铺的样式类型(0为首页默认)
* @property {Boolean} isEdit 是否显示编辑和删除
* @property {Number} listType 获取列表类型传递参数部分
* @property {Object} customQuery 自定义查询参数
*/
export default {
name:"SearchShopList",
data() {
return {
pageSize: 5,
pageNum: 1,
shopInfoList: []
};
},
props: {
@@ -35,38 +40,22 @@
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万元"
}
]
listType:{
type: Number,
default(){
return 2
}
},
customQuery:{
type: Object,
default(){
return {}
}
}
},
created() {
this.getList()
},
methods: {
handleDel(shopid){
console.log("删除了商铺", shopid);
@@ -74,6 +63,19 @@
// TODO不能直接修改
// if(delindex !== -1) this.shopInfoList = this.shopInfoList.slice(delindex,1)
// console.log(this.shopInfoList);
},
getList() {
const query = this.$u.queryParams({
type: this.listType,
pageSize: this.pageSize,
pageNum: this.pageNum,
...this.customQuery
})
console.log(query, 'query');
this.$api.getShopList(query).then(res => {
console.log(this.shopInfoList);
this.shopInfoList = res.data.data
})
}
}
}