首页下拉刷新和加载更多的设置,地区搜索是置page为1

This commit is contained in:
wangzimeng 2025-08-14 09:26:32 +08:00
parent 1e87dd5950
commit e999d3738d

View File

@ -2,59 +2,62 @@
<view v-if="template">
<s-layout title="首页" navbar="custom" tabbar="/pages/index/index" :bgStyle="template.style?.background"
:navbarStyle="template.style?.navbar" onShareAppMessage :showFloatButton="true" bgColor="#fcc74e">
<view class="container">
<!-- 顶部 -->
<view class="top">
<!-- 顶部-地址&搜索 -->
<view class="locTop">
<view class="locTop-left" @click="toPage('/packageA/search/index')">
<uni-section style="border-radius: 192rpx;padding: 0;width: 430rpx;height: 70rpx;"
type="line">
<uni-search-bar style="border-radius: 192rpx;" radius="23" placeholder="搜索您需要的信息"
bgColor="#ffffff" clearButton="none" cancelButton="none" :readonly="true" />
</uni-section>
<scroll-view @scrolltolower="onScrolltolower" :refresher-enabled="true" :refresher-triggered="homrS"
@refresherrefresh="onS" scroll-y="true" class="scrollBox align-items"
style="height: 1080rpx;box-sizing: border-box;">
<view class="container">
<!-- 顶部 -->
<view class="top">
<!-- 顶部-地址&搜索 -->
<view class="locTop">
<view class="locTop-left" @click="toPage('/packageA/search/index')">
<uni-section style="border-radius: 192rpx;padding: 0;width: 430rpx;height: 70rpx;"
type="line">
<uni-search-bar style="border-radius: 192rpx;" radius="23" placeholder="搜索您需要的信息"
bgColor="#ffffff" clearButton="none" cancelButton="none" :readonly="true" />
</uni-section>
</view>
<view class="locTop-right" @click="toPage('/pages/canteenRent/fabu')">
发布档口信息
</view>
</view>
<view class="locTop-right" @click="toPage('/pages/canteenRent/fabu')">
发布档口信息
</view>
</view>
<!-- 顶部-三个内容跳转 -->
<view class="navTop">
<view class="navTop-left" @click="toTabb('/pages/index/category')">
<!-- <view class="title" style="">食堂招租</view>
<!-- 顶部-三个内容跳转 -->
<view class="navTop">
<view class="navTop-left" @click="toTabb('/pages/index/category')">
<!-- <view class="title" style="">食堂招租</view>
<view class="intro" style="color: #f42b2b;margin-top: 20rpx;">味揽商机 食载未来</view> -->
</view>
<view class="navTop-right">
<view class="navRight1" @click="toPage('/pages/canteenRent/rentList')">
<!-- <view class="title" style="">平台学院</view>
</view>
<view class="navTop-right">
<view class="navRight1" @click="toPage('/pages/canteenRent/rentList')">
<!-- <view class="title" style="">平台学院</view>
<view class="intro" style="color: #05b0b0;margin-top: 20rpx;">学知赋能成长</view> -->
</view>
<view class="navRight2" @click="toPage('/pages/school/schoolIndex')">
<!-- <view class="title" style="">原料商城</view>
</view>
<view class="navRight2" @click="toPage('/pages/school/schoolIndex')">
<!-- <view class="title" style="">原料商城</view>
<view class="intro" style="color: #f58f3d;margin-top: 20rpx;">优材好料直供</view> -->
</view>
</view>
</view>
</view>
</view>
<!-- 轮播图 -->
<view class="swiper-box">
<view class="swiper_s">
<swiper class="swiper_s" :circular="true" :autoplay="true" indicator-active-color="#0DAE11"
indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent"
@animationfinish="swiperChange">
<!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"-->
<swiper-item style="margin: 0 auto;" v-for="(item, index) in bannerList" :key="index"
@click="swiperJump(item)">
<view style="position: relative;width: 100%;height: 100%;">
<!--<view class="fnon_tit"></view>
</view>
<!-- 轮播图 -->
<view class="swiper-box">
<view class="swiper_s">
<swiper class="swiper_s" :circular="true" :autoplay="true" indicator-active-color="#0DAE11"
indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent"
@animationfinish="swiperChange">
<!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"-->
<swiper-item style="margin: 0 auto;" v-for="(item, index) in bannerList" :key="index"
@click="swiperJump(item)">
<view style="position: relative;width: 100%;height: 100%;">
<!--<view class="fnon_tit"></view>
<view class="text">{{ item.title ? item.title : '' }}</view>
@click="click(item.url)" 跳转活动链接 -->
<image class="swiper-image" :src="item.image" mode="scaleToFill" />
</view>
</swiper-item>
<!-- <swiper-item style="margin: 0 auto;">
<image class="swiper-image" :src="item.image" mode="scaleToFill" />
</view>
</swiper-item>
<!-- <swiper-item style="margin: 0 auto;">
<view style="position: relative;width: 100%;height: 100%">
<!--<view class="fnon_tit"></view>
<view class="text">{{ item.title ? item.title : '' }}</view>
@ -62,37 +65,35 @@
<image class="swiper-image" src="/static/cart-empty.png" mode="scaleToFill" />
</view>
</swiper-item> -->
</swiper>
</swiper>
</view>
</view>
</view>
<!-- 推荐列表 -->
<view class="recommend-box">
<!-- 推荐标题 -->
<view class="recom-titleBox">
<view style="width: 60%;display: flex;justify-content: flex-start;align-items: center;">
<view style="font-size: 38rpx;line-height: 38rpx;font-weight: 800;color: #333333;">餐厅推荐
</view>
<view class="cityBox" @click="state.showRegion = true">
<view style="margin-right: 10rpx;font-size: 30rpx;font-weight: 800;line-height: 45rpx;
white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{ state.model.city_name ? state.model.city_name : '地区筛选'}}
<!-- 推荐列表 -->
<view class="recommend-box">
<!-- 推荐标题 -->
<view class="recom-titleBox">
<view style="width: 60%;display: flex;justify-content: flex-start;align-items: center;">
<view style="font-size: 38rpx;line-height: 38rpx;font-weight: 800;color: #333333;">餐厅推荐
</view>
<view class="cityBox" @click="state.showRegion = true">
<view style="margin-right: 10rpx;font-size: 30rpx;font-weight: 800;line-height: 45rpx;
white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{ state.model.city_name ? state.model.city_name : '地区筛选'}}
</view>
<image style="width: 25rpx;height: 13rpx;"
src="https://jiangxiaoxian.0rui.cn/rentTriangle.png" mode=""></image>
</view>
<image style="width: 25rpx;height: 13rpx;"
src="https://jiangxiaoxian.0rui.cn/rentTriangle.png" mode=""></image>
</view>
</view>
<view class="title-more" @click="toPage('/pages/canteenRent/rentList')">
<view style="font-size: 26rpx;line-height: 26rpx;font-weight: 400;color: #999999;">查看更多
<view class="title-more" @click="toPage('/pages/canteenRent/rentList')">
<view style="font-size: 26rpx;line-height: 26rpx;font-weight: 400;color: #999999;">查看更多
</view>
<image style="width: 28rpx;height: 28rpx;margin-left: 20rpx;"
src="https://jiangxiaoxian.0rui.cn/nextMore.png" mode=""></image>
</view>
<image style="width: 28rpx;height: 28rpx;margin-left: 20rpx;"
src="https://jiangxiaoxian.0rui.cn/nextMore.png" mode=""></image>
</view>
</view>
<!-- 列表 -->
<scroll-view @scrolltolower="onScrolltolower" :refresher-enabled="true" :refresher-triggered="homrS"
@refresherrefresh="onS" scroll-y="true" class="flex align-items"
style="height: 800rpx;box-sizing: border-box;margin-top: 20rpx;">
<!-- 列表 -->
<view class="rrecommList" v-for="(item,index) in rentList" :key="index"
@click="toPage(`/pages/canteenRent/rentDetail?id=` + item.id)">
<view class="reListItem">
@ -136,12 +137,12 @@
</view>
</view>
</view>
</scroll-view>
</view>
<view class="viewCan" style="width: 100%;height: 200rpx;"></view>
</view>
</view>
</scroll-view>
<!-- 省市区弹窗 -->
@ -260,6 +261,7 @@
console.log('onRegionConfirm33', state.model, proCity.value);
listQuery.value.province = state.model.province_id
listQuery.value.city = state.model.city_id;
listQuery.value.page = 1;
rentList.value = [];
getList()
state.showRegion = false;
@ -537,8 +539,22 @@
line-height: 22rpx;
}
.scrollBox {
padding-bottom: constant(safe-area-inset-bottom);
/* iOS 11.0 - 11.1 */
padding-bottom: env(safe-area-inset-bottom);
/* iOS 11.2+ */
}
/* 对于没有安全区域的设备,设置默认值 */
@supports not (padding-bottom: env(safe-area-inset-bottom)) {
.scrollBox {
padding-bottom: 0;
}
}
.container {
min-height: 90vh;
height: 100%;
width: 100%;
background-color: #f7f7f7;
// display: grid;
@ -760,6 +776,9 @@
}
.viewCan {}
}
</style>