1、首页:发布档口信息的按钮功能实现,并调整搜索框的样式大小

2、首页:定位下移至餐厅推荐旁,并把展示文字由全国更换为地区筛选(包括省市的组件中的文字修改。)
3、首页:平台推荐改为餐厅推荐
4、餐厅推荐的加载更多
5、首页金刚区的三个入口的底图更换,文字更换,展示位置调整将买酱料放到左侧
This commit is contained in:
wangzimeng 2025-08-13 18:21:48 +08:00
parent 6f158c739d
commit be19313044
5 changed files with 226 additions and 140 deletions

View File

@ -42,17 +42,6 @@
"group": "商城"
}
},
{
"path": "pages/index/fabu",
"style": {
"navigationBarTitleText": "发布信息"
},
"meta": {
"sync": true,
"title": "发布信息",
"group": "商城"
}
},
{
"path": "pages/index/cart",
"style": {
@ -128,6 +117,17 @@
"group": "商品"
}
},
{
"path": "fabu",
"style": {
"navigationBarTitleText": "发布信息"
},
"meta": {
"sync": true,
"title": "发布信息",
"group": "商城"
}
},
{
"path": "rentEdit",
"style": {

View File

@ -709,6 +709,7 @@
icon: 'success'
})
agreeAdd.value = false;
agreeShow.value = false;
selectTagslist.value = []
tagSelectedNum.value = 0;
form.value = {

View File

@ -43,8 +43,9 @@
// })
}
}).catch((error) => {
'error: ',
error;
console.log('error: ', error);
// 'error: ',
// error;
})
}

View File

@ -7,39 +7,32 @@
<view class="top">
<!-- 顶部-地址&搜索 -->
<view class="locTop">
<view class="locTop-left" @click="state.showRegion = true">
<image style="width: 34rpx;height: 34rpx;"
src="https://jiangxiaoxian.0rui.cn/locationTop.png" mode=""></image>
<view
style="margin-left: 10rpx;font-size: 30rpx;font-weight: 800;line-height: 45rpx;
white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 230rpx;">
{{state.model.city_name ? proCity:'全国' }}
</view>
</view>
<view class="locTop-right" @click="toPage('/packageA/search/index')">
<uni-section style="border-radius: 192rpx;padding: 0;" type="line">
<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" />
bgColor="#ffffff" clearButton="none" cancelButton="none" :readonly="true" />
</uni-section>
<!-- @confirm="search"-->
</view>
<view class="locTop-right" @click="toPage('/pages/canteenRent/fabu')">
发布档口信息
</view>
</view>
<!-- 顶部-三个内容跳转 -->
<view class="navTop">
<view class="navTop-left" @click="toPage('/pages/canteenRent/rentList')">
<view class="title" style="">食堂招租</view>
<view class="intro" style="color: #f42b2b;margin-top: 20rpx;">味揽商机 食载未来</view>
<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/school/schoolIndex')">
<view class="title" style="">平台学院</view>
<view class="intro" style="color: #05b0b0;margin-top: 20rpx;">学知赋能成长</view>
<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="toTabb('/pages/index/category')">
<view class="title" style="">原料商城</view>
<view class="intro" style="color: #f58f3d;margin-top: 20rpx;">优材好料直供</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>
@ -52,7 +45,8 @@
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)">
<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>
@ -75,7 +69,19 @@
<view class="recommend-box">
<!-- 推荐标题 -->
<view class="recom-titleBox">
<view style="font-size: 38rpx;line-height: 38rpx;font-weight: 800;color: #333333;">平台推荐</view>
<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>
</view>
<view class="title-more" @click="toPage('/pages/canteenRent/rentList')">
<view style="font-size: 26rpx;line-height: 26rpx;font-weight: 400;color: #999999;">查看更多
</view>
@ -83,50 +89,58 @@
src="https://jiangxiaoxian.0rui.cn/nextMore.png" mode=""></image>
</view>
</view>
<view class="rrecommList" v-for="(item,index) in rentList" :key="index" @click="toPage(`/pages/canteenRent/rentDetail?id=` + item.id)">
<view class="reListItem">
<!-- 左侧图片 -->
<view class="listItem-images">
<image v-if="item.recommend == 1"
style="width: 77rpx;height: 36rpx;z-index: 100;position: relative;top: 34rpx;left: 0rpx;"
src="https://jiangxiaoxian.0rui.cn/hot.png"></image>
<image class="iamges-mainImg" :src="item.images[0]" mode="aspectFill"></image>
</view>
<!-- 右侧内容 -->
<view class="listItem-contents">
<view class="title2" style="margin-bottom: 20rpx;">{{item.platform_title}}</view>
<scroll-view class="score-box">
<view class="fs11 flex cate">
<view class="cate-e" v-for="(e,i) in item.cate" :key="i">
<view v-show="e" class="status-tag " style="margin-right: 20rpx;">{{e}}
<!-- 列表 -->
<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">
<!-- 左侧图片 -->
<view class="listItem-images">
<image v-if="item.recommend == 1"
style="width: 77rpx;height: 36rpx;z-index: 100;position: relative;top: 34rpx;left: 0rpx;"
src="https://jiangxiaoxian.0rui.cn/hot.png"></image>
<image class="iamges-mainImg" :src="item.images[0]" mode="aspectFill"></image>
</view>
<!-- 右侧内容 -->
<view class="listItem-contents">
<view class="title2" style="margin-bottom: 20rpx;">{{item.platform_title}}</view>
<scroll-view class="score-box">
<view class="fs11 flex cate">
<view class="cate-e" v-for="(e,i) in item.cate" :key="i">
<view v-show="e" class="status-tag " style="margin-right: 20rpx;">{{e}}
</view>
</view>
<!-- <text v-show="item.cate[1]"
class="status-tag" style="margin-right: 20rpx;">{{item.cate[1]}}</text>
<text v-show="item.cate[2]"
class="status-tag">{{item.cate[2]}}</text> -->
</view>
</scroll-view>
<view class="cons-third">
<view style="display: flex;">
<image style="width: 24rpx;height: 24rpx;"
src="https://jiangxiaoxian.0rui.cn/locationList.png"></image>
<view class="title3" style="margin-left: 10rpx;">{{item.address_city_text}}
</view>
</view>
<!-- <text v-show="item.cate[1]"
class="status-tag" style="margin-right: 20rpx;">{{item.cate[1]}}</text>
<text v-show="item.cate[2]"
class="status-tag">{{item.cate[2]}}</text> -->
</view>
</scroll-view>
<view class="cons-third">
<view style="display: flex;">
<image style="width: 24rpx;height: 24rpx;"
src="https://jiangxiaoxian.0rui.cn/locationList.png"></image>
<view class="title3" style="margin-left: 10rpx;">{{item.address_city_text}}
<view class="title3">{{item.release_time_text}}</view>
<view style="display: flex;">
<image style="width: 24rpx;height: 24rpx;"
src="https://jiangxiaoxian.0rui.cn/eye.png"></image>
<view class="title3" style="margin-left: 10rpx;">{{item.views}}</view>
</view>
</view>
<view class="title3">{{item.release_time_text}}</view>
<view style="display: flex;">
<image style="width: 24rpx;height: 24rpx;"
src="https://jiangxiaoxian.0rui.cn/eye.png"></image>
<view class="title3" style="margin-left: 10rpx;">{{item.views}}</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
@ -161,33 +175,33 @@
function getAreaCity() {
// if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.getCity().then((res) => {
if (res.code === 1) {
uni.setStorageSync('areaCity', res.data);
}
});
// }
// if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.getCity().then((res) => {
if (res.code === 1) {
uni.setStorageSync('areaCity', res.data);
}
});
// }
};
function getTag() {
// if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.tagsList().then((res) => {
if (res.code === 1) {
uni.setStorageSync('tagList', res.data.list);
}
});
// }
// if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.tagsList().then((res) => {
if (res.code === 1) {
uni.setStorageSync('tagList', res.data.list);
}
});
// }
};
function getType() {
// if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.listType().then((res) => {
if (res.code === 1) {
uni.setStorageSync('typeList', res.data);
}
});
// }
// if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.listType().then((res) => {
if (res.code === 1) {
uni.setStorageSync('typeList', res.data);
}
});
// }
};
@ -213,13 +227,13 @@
});
const getAreaData = () => {
if (_.isEmpty(uni.getStorageSync('areaData'))) {
sheep.$api.data.area().then((res) => {
if (res.code === 1) {
uni.setStorageSync('areaData', res.data);
}
});
}
if (_.isEmpty(uni.getStorageSync('areaData'))) {
sheep.$api.data.area().then((res) => {
if (res.code === 1) {
uni.setStorageSync('areaData', res.data);
}
});
}
};
@ -234,9 +248,9 @@
...e,
};
if(state.model.province_name == state.model.city_name) {
if (state.model.province_name == state.model.city_name) {
proCity.value = state.model.province_name
}else {
} else {
// proCity.value = state.model.province_name + " " + state.model.city_name
proCity.value = state.model.province_name + state.model.city_name
}
@ -245,7 +259,8 @@
console.log('onRegionConfirm33', state.model, proCity.value);
listQuery.value.province = state.model.province_id
listQuery.value.city = state.model.city_id
listQuery.value.city = state.model.city_id;
rentList.value = [];
getList()
state.showRegion = false;
};
@ -301,21 +316,21 @@
//
function swiperJump(item) {
console.log('轮播图跳转事件:',item.url);
console.log('轮播图跳转事件:', item.url);
const tabBarPages = [
'/pages/index/index',
'/pages/index/fabu',
'/pages/index/user'
];
console.log('tabbarsList',tabBarPages);
if(item.type == "in") {
'/pages/index/index',
'/pages/index/fabu',
'/pages/index/user'
];
console.log('tabbarsList', tabBarPages);
if (item.type == "in") {
console.log('跳进内页');
if(tabBarPages.includes(item.url)) {
if (tabBarPages.includes(item.url)) {
console.log('导航页');
uni.switchTab({
url: item.url,
})
}else {
} else {
uni.navigateTo({
url: item.url,
})
@ -329,6 +344,11 @@
setTimeout(function() {
uni.stopPullDownRefresh();
}, 800);
rentList.value = [];
state.model.city_name = '';
state.model.province_name = '';
state.currentCityIndex = [0, 0];
getList();
});
onPageScroll(() => {});
@ -336,10 +356,10 @@
const bannerList = ref([])
async function getBanner() {
const res = await sheep.$api.home.homeBanner({});
console.log('banner',res);
if(res.code == 1) {
console.log('banner', res);
if (res.code == 1) {
bannerList.value = res.data.list
console.log('bannerList',bannerList.value);
console.log('bannerList', bannerList.value);
}
}
@ -373,13 +393,15 @@
})
}
const rentList = ref([])
const rentList = ref([]);
const rentCount = ref(0);
const homrS = ref(false)
//
async function getList() {
const res = await sheep.$api.rent.rentlist({
keywords: listQuery.value.keywords,
page: listQuery.value.page,
limit: 25,
limit: 10,
cate_ids: listQuery.value.cate_ids,
order: 'normal',
status: 1,
@ -391,7 +413,10 @@
console.log('getList', res);
if (res.data && res.data.list) {
rentList.value = res.data.list;
// rentList.value = res.data.list;
// rentCount.value = res.data.count
rentList.value = [...rentList.value, ...res.data.list];
rentCount.value = res.data.count;
// Safely process each item
rentList.value = rentList.value.map(item => {
@ -419,6 +444,42 @@
console.log('getList', rentList.value);
}
//
function onScrolltolower() {
if (rentList.value.length < rentCount.value) {
listQuery.value.page += 1;
getList();
}
}
//
function onS() {
homrS.value = true
listQuery.value.keywords = '';
listQuery.value.cate_ids = '';
listQuery.value.province = '';
state.model.city_name = '';
listQuery.value.city = '';
state.currentCityIndex = [0, 0];
uni.showLoading({
title: '加载中...'
});
resetLists();
setTimeout(() => {
homrS.value = false;
uni.hideLoading();
uni.stopPullDownRefresh();
}, 2000)
}
//
function resetLists() {
// listQuery.value.keywords = ''
console.log('listQuery.value.keywords', listQuery.value.keywords);
listQuery.value.page = 1;
rentList.value = [];
getList();
}
// tabBar
uni.hideTabBar({
fail: () => {},
@ -499,7 +560,8 @@
// align-items: center;
.locTop-left {
width: 250rpx;
width: 430rpx;
height: 70rpx;
display: flex;
align-items: center;
justify-content: flex-start;
@ -507,9 +569,18 @@
}
.locTop-right {
width: 410rpx;
width: 203rpx;
height: 70rpx;
background-color: #ff5900;
color: #ffffff;
font-size: 28rpx;
font-weight: bold;
line-height: 42rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 104rpx;
padding: 0rpx 10rpx;
}
}
@ -522,7 +593,7 @@
.navTop-left {
width: 270rpx;
height: 350rpx;
background-image: url('https://jiangxiaoxian.0rui.cn/rent.png');
background-image: url('https://jiangxiaoxian.0rui.cn/shoppingMall.png');
background-size: 100%;
border-radius: 18rpx;
padding: 40rpx 30rpx 0rpx 30rpx;
@ -538,7 +609,7 @@
.navRight1 {
width: 270rpx;
height: 140rpx;
background-image: url('https://jiangxiaoxian.0rui.cn/school.png');
background-image: url('https://jiangxiaoxian.0rui.cn/rent.png');
background-size: 100%;
border-radius: 18rpx;
padding: 40rpx 30rpx 0rpx 30rpx;
@ -548,7 +619,7 @@
margin-top: 30rpx;
width: 270rpx;
height: 140rpx;
background-image: url('https://jiangxiaoxian.0rui.cn/shoppingMall.png');
background-image: url('https://jiangxiaoxian.0rui.cn/school.png');
background-size: 100%;
border-radius: 18rpx;
padding: 40rpx 30rpx 0rpx 30rpx;
@ -586,6 +657,7 @@
.recommend-box {
margin-top: 30rpx;
padding: 20rpx 30rpx;
height: 900rpx;
.recom-titleBox {
display: flex;
@ -593,6 +665,18 @@
align-items: center;
width: 690rpx;
.cityBox {
width: 222rpx;
height: 60rpx;
margin-left: 30rpx;
border-radius: 132rpx 132rpx 132rpx 132rpx;
border: 1rpx solid #999999;
display: flex;
align-items: center;
justify-content: center;
margin-top: 6rpx;
}
.title-more {
display: flex;
justify-content: center;

View File

@ -89,12 +89,12 @@
child: [{
id: '',
level: "city",
name: "全",
name: "全部地区",
pid: 0
}], //
id: '',
level: "province",
name: "全",
name: "全部地区",
pid: 0
}]
const areaData = proFirst.concat(uni.getStorageSync('areaCity'))