罗世杰:fixed:修改列表组件发送网络请求的位置
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user