罗世杰:店铺转让、找店地址触底加载和下拉query

This commit is contained in:
LuoShijie
2023-11-19 19:37:22 +08:00
parent f7abaf847e
commit 8b8f821817
3 changed files with 49 additions and 17 deletions

View File

@@ -7,10 +7,10 @@
</view>
<view class="marginLR10">
<DropDown></DropDown>
<DropDown @getQueryInfo = "getShopList"></DropDown>
</view>
<view class="marginLR10">
<SearchShopList :showStyle="1"/>
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList"/>
</view>
</view>
@@ -26,11 +26,44 @@
},
data() {
return {
pageSize: 5,
pageNum: 1,
searchInfoList: [],
customQuery: {},
searchListLength: '',
}
},
onReachBottom() {
if (this.searchListLength !== 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.searchListLength = res.data.data.length
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
console.log(this.searchInfoList);
})
},
getQueryInfo(query){
console.log("getQueryInfo",query);
const q = this.$u.queryParams({
type: 2,
pageSize: this.pageSize,
pageNum: this.pageNum,
...query
})
this.customQuery = q
return q
},
},
created() {
this.getShopList()
}
}
</script>