罗世杰:店铺转让、找店地址触底加载和下拉query
This commit is contained in:
@@ -29,24 +29,26 @@
|
||||
pageSize: 5,
|
||||
pageNum: 1,
|
||||
shopInfoList: [],
|
||||
customQuery: {
|
||||
|
||||
}
|
||||
customQuery: {},
|
||||
shopListLength: '',
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
onReachBottom() {
|
||||
if (this.shopInfoList.length !== 0) {
|
||||
this.pageNum++
|
||||
this.getShopList()
|
||||
console.log("触底加载");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getShopList(q){
|
||||
let query = this.getQueryInfo(q)
|
||||
console.log("listquery",query);
|
||||
this.$api.getShopList(query).then(res => {
|
||||
this.shopInfoList = res.data.data
|
||||
this.shopListLength = res.data.data.length
|
||||
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||
console.log(this.shopInfoList);
|
||||
this.shopInfoList.forEach(item=>{
|
||||
item.pics =this.$api.imgUrl + item.pics
|
||||
});
|
||||
})
|
||||
},
|
||||
getQueryInfo(query){
|
||||
@@ -60,9 +62,6 @@
|
||||
this.customQuery = q
|
||||
return q
|
||||
},
|
||||
rePost(query){
|
||||
console.log("rePost",query);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getShopList()
|
||||
|
||||
Reference in New Issue
Block a user