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

View File

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

View File

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

View File

@ -7,39 +7,32 @@
<view class="top"> <view class="top">
<!-- 顶部-地址&搜索 --> <!-- 顶部-地址&搜索 -->
<view class="locTop"> <view class="locTop">
<view class="locTop-left" @click="state.showRegion = true"> <view class="locTop-left" @click="toPage('/packageA/search/index')">
<image style="width: 34rpx;height: 34rpx;" <uni-section style="border-radius: 192rpx;padding: 0;width: 430rpx;height: 70rpx;"
src="https://jiangxiaoxian.0rui.cn/locationTop.png" mode=""></image> type="line">
<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">
<uni-search-bar style="border-radius: 192rpx;" radius="23" placeholder="搜索您需要的信息" <uni-search-bar style="border-radius: 192rpx;" radius="23" placeholder="搜索您需要的信息"
bgColor="#ffffff" clearButton="none" cancelButton="none" bgColor="#ffffff" clearButton="none" cancelButton="none" :readonly="true" />
:readonly="true" />
</uni-section> </uni-section>
<!-- @confirm="search"--> </view>
<view class="locTop-right" @click="toPage('/pages/canteenRent/fabu')">
发布档口信息
</view> </view>
</view> </view>
<!-- 顶部-三个内容跳转 --> <!-- 顶部-三个内容跳转 -->
<view class="navTop"> <view class="navTop">
<view class="navTop-left" @click="toPage('/pages/canteenRent/rentList')"> <view class="navTop-left" @click="toTabb('/pages/index/category')">
<view class="title" style="">食堂招租</view> <!-- <view class="title" style="">食堂招租</view>
<view class="intro" style="color: #f42b2b;margin-top: 20rpx;">味揽商机 食载未来</view> <view class="intro" style="color: #f42b2b;margin-top: 20rpx;">味揽商机 食载未来</view> -->
</view> </view>
<view class="navTop-right"> <view class="navTop-right">
<view class="navRight1" @click="toPage('/pages/school/schoolIndex')"> <view class="navRight1" @click="toPage('/pages/canteenRent/rentList')">
<view class="title" style="">平台学院</view> <!-- <view class="title" style="">平台学院</view>
<view class="intro" style="color: #05b0b0;margin-top: 20rpx;">学知赋能成长</view> <view class="intro" style="color: #05b0b0;margin-top: 20rpx;">学知赋能成长</view> -->
</view> </view>
<view class="navRight2" @click="toTabb('/pages/index/category')"> <view class="navRight2" @click="toPage('/pages/school/schoolIndex')">
<view class="title" style="">原料商城</view> <!-- <view class="title" style="">原料商城</view>
<view class="intro" style="color: #f58f3d;margin-top: 20rpx;">优材好料直供</view> <view class="intro" style="color: #f58f3d;margin-top: 20rpx;">优材好料直供</view> -->
</view> </view>
</view> </view>
</view> </view>
@ -52,7 +45,8 @@
indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent" indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent"
@animationfinish="swiperChange"> @animationfinish="swiperChange">
<!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"--> <!-- 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 style="position: relative;width: 100%;height: 100%;">
<!--<view class="fnon_tit"></view> <!--<view class="fnon_tit"></view>
<view class="text">{{ item.title ? item.title : '' }}</view> <view class="text">{{ item.title ? item.title : '' }}</view>
@ -75,7 +69,19 @@
<view class="recommend-box"> <view class="recommend-box">
<!-- 推荐标题 --> <!-- 推荐标题 -->
<view class="recom-titleBox"> <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 class="title-more" @click="toPage('/pages/canteenRent/rentList')">
<view style="font-size: 26rpx;line-height: 26rpx;font-weight: 400;color: #999999;">查看更多 <view style="font-size: 26rpx;line-height: 26rpx;font-weight: 400;color: #999999;">查看更多
</view> </view>
@ -83,50 +89,58 @@
src="https://jiangxiaoxian.0rui.cn/nextMore.png" mode=""></image> src="https://jiangxiaoxian.0rui.cn/nextMore.png" mode=""></image>
</view> </view>
</view> </view>
<view class="rrecommList" v-for="(item,index) in rentList" :key="index" @click="toPage(`/pages/canteenRent/rentDetail?id=` + item.id)"> <!-- 列表 -->
<view class="reListItem"> <scroll-view @scrolltolower="onScrolltolower" :refresher-enabled="true" :refresher-triggered="homrS"
<!-- 左侧图片 --> @refresherrefresh="onS" scroll-y="true" class="flex align-items"
<view class="listItem-images"> style="height: 800rpx;box-sizing: border-box;margin-top: 20rpx;">
<image v-if="item.recommend == 1" <view class="rrecommList" v-for="(item,index) in rentList" :key="index"
style="width: 77rpx;height: 36rpx;z-index: 100;position: relative;top: 34rpx;left: 0rpx;" @click="toPage(`/pages/canteenRent/rentDetail?id=` + item.id)">
src="https://jiangxiaoxian.0rui.cn/hot.png"></image> <view class="reListItem">
<image class="iamges-mainImg" :src="item.images[0]" mode="aspectFill"></image> <!-- 左侧图片 -->
</view> <view class="listItem-images">
<!-- 右侧内容 --> <image v-if="item.recommend == 1"
<view class="listItem-contents"> style="width: 77rpx;height: 36rpx;z-index: 100;position: relative;top: 34rpx;left: 0rpx;"
<view class="title2" style="margin-bottom: 20rpx;">{{item.platform_title}}</view> src="https://jiangxiaoxian.0rui.cn/hot.png"></image>
<scroll-view class="score-box"> <image class="iamges-mainImg" :src="item.images[0]" mode="aspectFill"></image>
<view class="fs11 flex cate"> </view>
<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 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>
</view> </view>
<view class="title3">{{item.release_time_text}}</view>
<!-- <text v-show="item.cate[1]" <view style="display: flex;">
class="status-tag" style="margin-right: 20rpx;">{{item.cate[1]}}</text> <image style="width: 24rpx;height: 24rpx;"
<text v-show="item.cate[2]" src="https://jiangxiaoxian.0rui.cn/eye.png"></image>
class="status-tag">{{item.cate[2]}}</text> --> <view class="title3" style="margin-left: 10rpx;">{{item.views}}</view>
</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>
</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>
</view> </view>
</view> </scroll-view>
</view> </view>
</view> </view>
@ -159,37 +173,37 @@
region region
} from '@/sheep/validate/form'; } from '@/sheep/validate/form';
function getAreaCity() { function getAreaCity() {
// if (_.isEmpty(uni.getStorageSync('areaCity'))) { // if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.getCity().then((res) => { sheep.$api.rent.getCity().then((res) => {
if (res.code === 1) { if (res.code === 1) {
uni.setStorageSync('areaCity', res.data); uni.setStorageSync('areaCity', res.data);
} }
}); });
// } // }
}; };
function getTag() { function getTag() {
// if (_.isEmpty(uni.getStorageSync('areaCity'))) { // if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.tagsList().then((res) => { sheep.$api.rent.tagsList().then((res) => {
if (res.code === 1) { if (res.code === 1) {
uni.setStorageSync('tagList', res.data.list); uni.setStorageSync('tagList', res.data.list);
} }
}); });
// } // }
}; };
function getType() { function getType() {
// if (_.isEmpty(uni.getStorageSync('areaCity'))) { // if (_.isEmpty(uni.getStorageSync('areaCity'))) {
sheep.$api.rent.listType().then((res) => { sheep.$api.rent.listType().then((res) => {
if (res.code === 1) { if (res.code === 1) {
uni.setStorageSync('typeList', res.data); uni.setStorageSync('typeList', res.data);
} }
}); });
// } // }
}; };
const template = computed(() => sheep.$store('app').template?.home); const template = computed(() => sheep.$store('app').template?.home);
const isLogin = computed(() => sheep.$store('user').isLogin); const isLogin = computed(() => sheep.$store('user').isLogin);
@ -211,18 +225,18 @@
region, region,
}, },
}); });
const getAreaData = () => { const getAreaData = () => {
if (_.isEmpty(uni.getStorageSync('areaData'))) { if (_.isEmpty(uni.getStorageSync('areaData'))) {
sheep.$api.data.area().then((res) => { sheep.$api.data.area().then((res) => {
if (res.code === 1) { if (res.code === 1) {
uni.setStorageSync('areaData', res.data); uni.setStorageSync('areaData', res.data);
} }
}); });
} }
}; };
const proCity = ref('') const proCity = ref('')
@ -233,10 +247,10 @@
...state.model, ...state.model,
...e, ...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 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
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); console.log('onRegionConfirm33', state.model, proCity.value);
listQuery.value.province = state.model.province_id listQuery.value.province = state.model.province_id
listQuery.value.city = state.model.city_id listQuery.value.city = state.model.city_id;
rentList.value = [];
getList() getList()
state.showRegion = false; state.showRegion = false;
}; };
@ -298,24 +313,24 @@
sheep.$router.go(decodeURIComponent(options.page)); sheep.$router.go(decodeURIComponent(options.page));
} }
}); });
// //
function swiperJump(item) { function swiperJump(item) {
console.log('轮播图跳转事件:',item.url); console.log('轮播图跳转事件:', item.url);
const tabBarPages = [ const tabBarPages = [
'/pages/index/index', '/pages/index/index',
'/pages/index/fabu', '/pages/index/fabu',
'/pages/index/user' '/pages/index/user'
]; ];
console.log('tabbarsList',tabBarPages); console.log('tabbarsList', tabBarPages);
if(item.type == "in") { if (item.type == "in") {
console.log('跳进内页'); console.log('跳进内页');
if(tabBarPages.includes(item.url)) { if (tabBarPages.includes(item.url)) {
console.log('导航页'); console.log('导航页');
uni.switchTab({ uni.switchTab({
url: item.url, url: item.url,
}) })
}else { } else {
uni.navigateTo({ uni.navigateTo({
url: item.url, url: item.url,
}) })
@ -329,19 +344,24 @@
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 800); }, 800);
rentList.value = [];
state.model.city_name = '';
state.model.province_name = '';
state.currentCityIndex = [0, 0];
getList();
}); });
onPageScroll(() => {}); onPageScroll(() => {});
const bannerList = ref([]) const bannerList = ref([])
async function getBanner() { async function getBanner() {
const res = await sheep.$api.home.homeBanner({}); const res = await sheep.$api.home.homeBanner({});
console.log('banner',res); console.log('banner', res);
if(res.code == 1) { if (res.code == 1) {
bannerList.value = res.data.list bannerList.value = res.data.list
console.log('bannerList',bannerList.value); console.log('bannerList', bannerList.value);
} }
} }
@ -366,20 +386,22 @@
} }
} }
const toTabb = (e) => { const toTabb = (e) => {
uni.switchTab({ uni.switchTab({
url: e, url: e,
}) })
} }
const rentList = ref([]) const rentList = ref([]);
const rentCount = ref(0);
const homrS = ref(false)
// //
async function getList() { async function getList() {
const res = await sheep.$api.rent.rentlist({ const res = await sheep.$api.rent.rentlist({
keywords: listQuery.value.keywords, keywords: listQuery.value.keywords,
page: listQuery.value.page, page: listQuery.value.page,
limit: 25, limit: 10,
cate_ids: listQuery.value.cate_ids, cate_ids: listQuery.value.cate_ids,
order: 'normal', order: 'normal',
status: 1, status: 1,
@ -391,7 +413,10 @@
console.log('getList', res); console.log('getList', res);
if (res.data && res.data.list) { 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 // Safely process each item
rentList.value = rentList.value.map(item => { rentList.value = rentList.value.map(item => {
@ -418,7 +443,43 @@
// } // }
console.log('getList', rentList.value); 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 // tabBar
uni.hideTabBar({ uni.hideTabBar({
fail: () => {}, fail: () => {},
@ -499,7 +560,8 @@
// align-items: center; // align-items: center;
.locTop-left { .locTop-left {
width: 250rpx; width: 430rpx;
height: 70rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
@ -507,9 +569,18 @@
} }
.locTop-right { .locTop-right {
width: 410rpx; width: 203rpx;
height: 70rpx; 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 { .navTop-left {
width: 270rpx; width: 270rpx;
height: 350rpx; height: 350rpx;
background-image: url('https://jiangxiaoxian.0rui.cn/rent.png'); background-image: url('https://jiangxiaoxian.0rui.cn/shoppingMall.png');
background-size: 100%; background-size: 100%;
border-radius: 18rpx; border-radius: 18rpx;
padding: 40rpx 30rpx 0rpx 30rpx; padding: 40rpx 30rpx 0rpx 30rpx;
@ -538,7 +609,7 @@
.navRight1 { .navRight1 {
width: 270rpx; width: 270rpx;
height: 140rpx; height: 140rpx;
background-image: url('https://jiangxiaoxian.0rui.cn/school.png'); background-image: url('https://jiangxiaoxian.0rui.cn/rent.png');
background-size: 100%; background-size: 100%;
border-radius: 18rpx; border-radius: 18rpx;
padding: 40rpx 30rpx 0rpx 30rpx; padding: 40rpx 30rpx 0rpx 30rpx;
@ -548,7 +619,7 @@
margin-top: 30rpx; margin-top: 30rpx;
width: 270rpx; width: 270rpx;
height: 140rpx; height: 140rpx;
background-image: url('https://jiangxiaoxian.0rui.cn/shoppingMall.png'); background-image: url('https://jiangxiaoxian.0rui.cn/school.png');
background-size: 100%; background-size: 100%;
border-radius: 18rpx; border-radius: 18rpx;
padding: 40rpx 30rpx 0rpx 30rpx; padding: 40rpx 30rpx 0rpx 30rpx;
@ -586,6 +657,7 @@
.recommend-box { .recommend-box {
margin-top: 30rpx; margin-top: 30rpx;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
height: 900rpx;
.recom-titleBox { .recom-titleBox {
display: flex; display: flex;
@ -593,6 +665,18 @@
align-items: center; align-items: center;
width: 690rpx; 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 { .title-more {
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

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