邓洁 : 修改搜索细节

This commit is contained in:
邓洁
2023-11-28 12:14:56 +08:00
parent 2000ce91af
commit 2a0144d1bd
10 changed files with 296 additions and 170 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="root">
<view class="sticky">
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh">
<InputAndSwiper @getQueryInfo="getInput" ref="input" :bannerURL="swiperList">
</InputAndSwiper>
<view class="marginLR10 ">
<DropDown @getQueryInfo="getShopList" ref="dropdown" @cancelPageNum="cancelPageNum"></DropDown>
@@ -9,10 +9,10 @@
</view>
<view class="marginLR10">
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList"></ShowShopList>
</view>
<view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~
</text>
<view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~
</text>
</view>
</view>
<TabBar :current-page="1"></TabBar>
</view>
@@ -20,6 +20,9 @@
<script>
import DropDownItem from "@/components/DropDown/DropDownItem.vue"
import {
nextTick
} from "vue"
export default {
components: {
DropDownItem
@@ -33,8 +36,7 @@
swiperList: [],
shopListLength: '',
showNull: false,
refresh: false,
isRefresh: false
refresh: false
}
},
onPullDownRefresh() {
@@ -50,11 +52,12 @@
// }
this.getShopList(q, "refresh")
this.$refs.dropdown.resetInfo()
this.$refs.input.resetInfo()
// }
},
onReachBottom() {
if (!this.refresh && this.shopListLength !== 0) {
this.isRefresh = true
this.$refs.input.resetInfo()
this.pageNum++
this.getShopList()
console.log("触底加载");
@@ -90,6 +93,11 @@
this.$api.getShopList(q).then(res => {
this.shopListLength = res.data.data.length
this.shopInfoList = res.data.data
if (res.data.data.length == 0) {
this.showNull = true
} else {
this.showNull = false
}
})
},
getShopList(q, type) {
@@ -117,6 +125,7 @@
console.log('查询');
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
}
uni.stopPullDownRefresh()
console.log(this.shopInfoList);
})
@@ -149,6 +158,9 @@
justify-content: center;
height: 100rpx;
color: darkgray;
// position: absolute;
// top: 0;
// background-color: red;
}
.root {