邓洁 : 取消下拉刷新

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

@@ -1,16 +1,16 @@
<template>
<view class="root">
<InputAndSwiper></InputAndSwiper>
<view>
<view class="dropdown-bug">
</view>
<view class="marginLR10">
<DropDown @getQueryInfo = "getShopList"></DropDown>
<DropDown @getQueryInfo="getShopList"></DropDown>
</view>
<view class="marginLR10">
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList"/>
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
</view>
</view>
<view v-if="showNull" class="showNull">
@@ -39,46 +39,46 @@
}
},
onPullDownRefresh() {
this.refresh=true
this.refresh = true
// if (this.showNull = true) {
const q = this.$u.queryParams({
type: 2,
pageSize: this.pageSize,
pageNum: 1,
})
// if(this.showNull=true){
// this.pageNum=1
// }
this.getShopList(q, "refresh")
const q = this.$u.queryParams({
type: 2,
pageSize: this.pageSize,
pageNum: 1,
})
// if(this.showNull=true){
// this.pageNum=1
// }
this.getShopList(q, "refresh")
// }
},
onReachBottom() {
if (!this.refresh&&this.searchListLength !== 0) {
if (!this.refresh && this.searchListLength !== 0) {
this.pageNum++
this.getShopList()
console.log("触底加载");
}else if(this.searchListLength == 0){
this.pageNum=1
} else if (this.searchListLength == 0) {
this.pageNum = 1
}
},
methods: {
getShopList(q, type){
getShopList(q, type) {
let query = {}
if (type == "refresh") {
query = q
} else {
query = this.getQueryInfo(q)
}
console.log("listquery",query);
console.log("listquery", query);
this.$api.getShopList(query).then(res => {
this.searchListLength = 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.searchInfoList = res.data.data
this.refresh=false
this.refresh = false
if (res.data.data.length == 0) {
this.showNull = true
} else {
@@ -89,10 +89,11 @@
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
}
console.log(this.searchInfoList);
uni.stopPullDownRefresh()
})
},
getQueryInfo(query){
console.log("getQueryInfo",query);
getQueryInfo(query) {
console.log("getQueryInfo", query);
const q = this.$u.queryParams({
type: 2,
pageSize: this.pageSize,
@@ -116,12 +117,15 @@
height: 100rpx;
color: darkgray;
}
page {
background-color: $uni-bg-color-grey;
}
.root{
.root {
position: relative;
}
.dropdown-bug {
position: absolute;
background-color: $uni-bg-color-grey;
@@ -130,8 +134,8 @@
transform: translateY(-20rpx);
z-index: 2;
}
.marginLR10{
.marginLR10 {
margin: 0 10px;
}
</style>
</style>