罗世杰:fixed:修改列表组件发送网络请求的位置

This commit is contained in:
LuoShijie
2023-11-19 14:24:58 +08:00
parent 5c0b5d1ede
commit ae5b700362
5 changed files with 83 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view>
<SearchShopListItem
v-for="item in shopInfoList"
v-for="item in searchInfoList"
:key="searchid"
:shopInfo="item"
:show-style="showStyle"
@@ -24,10 +24,15 @@
return {
pageSize: 5,
pageNum: 1,
shopInfoList: []
};
},
props: {
searchInfoList:{
type: Array,
default(){
return []
}
},
showStyle:{
type: Number,
default() {
@@ -53,9 +58,6 @@
}
}
},
created() {
this.getList()
},
methods: {
handleDel(shopid){
console.log("删除了商铺", shopid);
@@ -63,19 +65,6 @@
// 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
})
}
}
}