邓洁 : 取消下拉刷新

This commit is contained in:
邓洁
2023-11-20 20:11:38 +08:00
parent 770fc4137a
commit aaee754194
6 changed files with 77 additions and 65 deletions

View File

@@ -39,27 +39,27 @@
}
},
onPullDownRefresh() {
this.refresh=true
this.refresh = true
// if (this.showNull = true) {
const q = this.$u.queryParams({
type: 1,
pageSize: this.pageSize,
pageNum: 1,
})
// if(this.showNull=true){
// this.pageNum=1
// }
this.getShopList(q, "refresh")
const q = this.$u.queryParams({
type: 1,
pageSize: this.pageSize,
pageNum: 1,
})
// if(this.showNull=true){
// this.pageNum=1
// }
this.getShopList(q, "refresh")
// }
},
onReachBottom() {
if (!this.refresh&&this.shopListLength !== 0) {
if (!this.refresh && this.shopListLength !== 0) {
this.pageNum++
this.getShopList()
console.log("触底加载");
}else if(this.shopListLength == 0){
this.pageNum=1
} else if (this.shopListLength == 0) {
this.pageNum = 1
}
},
methods: {
@@ -74,11 +74,11 @@
this.$api.getShopList(query).then(res => {
this.shopListLength = res.data.data.length
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
.includes('region')||this.refresh) {
.includes('region') || this.refresh) {
console.log('筛选');
// this.resetQuery(q)
this.shopInfoList = res.data.data
this.refresh=false
this.refresh = false
if (res.data.data.length == 0) {
this.showNull = true
} else {
@@ -88,7 +88,7 @@
console.log('查询');
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
}
uni.stopPullDownRefresh()
console.log(this.shopInfoList);
})
},