From be19313044a0c89c8e18b79a31b337469e104e77 Mon Sep 17 00:00:00 2001 From: wangzimeng <3297159934@qq.com> Date: Wed, 13 Aug 2025 18:21:48 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A6=96=E9=A1=B5=EF=BC=9A=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=A1=A3=E5=8F=A3=E4=BF=A1=E6=81=AF=E7=9A=84=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=90=9C=E7=B4=A2=E6=A1=86=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=A4=A7=E5=B0=8F=202=E3=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E5=AE=9A=E4=BD=8D=E4=B8=8B=E7=A7=BB=E8=87=B3=E9=A4=90?= =?UTF-8?q?=E5=8E=85=E6=8E=A8=E8=8D=90=E6=97=81=EF=BC=8C=E5=B9=B6=E6=8A=8A?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=96=87=E5=AD=97=E7=94=B1=E5=85=A8=E5=9B=BD?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E4=B8=BA=E5=9C=B0=E5=8C=BA=E7=AD=9B=E9=80=89?= =?UTF-8?q?=EF=BC=88=E5=8C=85=E6=8B=AC=E7=9C=81=E5=B8=82=E7=9A=84=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=96=87=E5=AD=97=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=82=EF=BC=89=203=E3=80=81=E9=A6=96=E9=A1=B5=EF=BC=9A?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8E=A8=E8=8D=90=E6=94=B9=E4=B8=BA=E9=A4=90?= =?UTF-8?q?=E5=8E=85=E6=8E=A8=E8=8D=90=204=E3=80=81=E9=A4=90=E5=8E=85?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=9A=84=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=205=E3=80=81=E9=A6=96=E9=A1=B5=E9=87=91=E5=88=9A=E5=8C=BA?= =?UTF-8?q?=E7=9A=84=E4=B8=89=E4=B8=AA=E5=85=A5=E5=8F=A3=E7=9A=84=E5=BA=95?= =?UTF-8?q?=E5=9B=BE=E6=9B=B4=E6=8D=A2=EF=BC=8C=E6=96=87=E5=AD=97=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=EF=BC=8C=E5=B1=95=E7=A4=BA=E4=BD=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=B0=86=E4=B9=B0=E9=85=B1=E6=96=99=E6=94=BE=E5=88=B0?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 22 +- pages/{index => canteenRent}/fabu.vue | 1 + pages/canteenRent/lawNotice.vue | 5 +- pages/index/index.vue | 334 +++++++++++------- .../su-regionCity-picker.vue | 4 +- 5 files changed, 226 insertions(+), 140 deletions(-) rename pages/{index => canteenRent}/fabu.vue (99%) diff --git a/pages.json b/pages.json index 8334721..6710b41 100644 --- a/pages.json +++ b/pages.json @@ -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": { diff --git a/pages/index/fabu.vue b/pages/canteenRent/fabu.vue similarity index 99% rename from pages/index/fabu.vue rename to pages/canteenRent/fabu.vue index b73fc67..24fa307 100644 --- a/pages/index/fabu.vue +++ b/pages/canteenRent/fabu.vue @@ -709,6 +709,7 @@ icon: 'success' }) agreeAdd.value = false; + agreeShow.value = false; selectTagslist.value = [] tagSelectedNum.value = 0; form.value = { diff --git a/pages/canteenRent/lawNotice.vue b/pages/canteenRent/lawNotice.vue index 0631b8e..1b28868 100644 --- a/pages/canteenRent/lawNotice.vue +++ b/pages/canteenRent/lawNotice.vue @@ -43,8 +43,9 @@ // }) } }).catch((error) => { - 'error: ', - error; + console.log('error: ', error); + // 'error: ', + // error; }) } diff --git a/pages/index/index.vue b/pages/index/index.vue index 741d5c1..ebbd227 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -7,39 +7,32 @@ - - - - {{state.model.city_name ? proCity:'全国' }} - - - - + + + bgColor="#ffffff" clearButton="none" cancelButton="none" :readonly="true" /> - + + + 发布档口信息 - - 食堂招租 - 味揽商机 食载未来 + + - - 平台学院 - 学知赋能成长 + + - - 原料商城 - 优材好料直供 + + @@ -52,7 +45,8 @@ indicator-color="#ffffff" :indicator-dots="false" :current="swiperCurrent" @animationfinish="swiperChange"> - + - 平台推荐 + + 餐厅推荐 + + + + {{ state.model.city_name ? state.model.city_name : '地区筛选'}} + + + + + 查看更多 @@ -83,50 +89,58 @@ src="https://jiangxiaoxian.0rui.cn/nextMore.png" mode=""> - - - - - - - - - - {{item.platform_title}} - - - - {{e}} + + + + + + + + + + + + {{item.platform_title}} + + + + {{e}} + + + + + + + + + + {{item.address_city_text}} - - - - - - - - {{item.address_city_text}} + {{item.release_time_text}} + + + {{item.views}} - {{item.release_time_text}} - - - {{item.views}} - - + + + @@ -159,37 +173,37 @@ region } from '@/sheep/validate/form'; - + 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); + } + }); + // } }; - + const template = computed(() => sheep.$store('app').template?.home); const isLogin = computed(() => sheep.$store('user').isLogin); @@ -211,18 +225,18 @@ region, }, }); - + 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); + } + }); + } }; - - + + const proCity = ref('') @@ -233,10 +247,10 @@ ...state.model, ...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; }; @@ -298,24 +313,24 @@ sheep.$router.go(decodeURIComponent(options.page)); } }); - + //轮播图跳转 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,19 +344,24 @@ setTimeout(function() { uni.stopPullDownRefresh(); }, 800); + rentList.value = []; + state.model.city_name = ''; + state.model.province_name = ''; + state.currentCityIndex = [0, 0]; + getList(); }); onPageScroll(() => {}); - + 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); } - + } @@ -366,20 +386,22 @@ } } - + const toTabb = (e) => { uni.switchTab({ url: e, }) } - 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 => { @@ -418,7 +443,43 @@ // } 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; diff --git a/sheep/ui/su-regionCity-picker/su-regionCity-picker.vue b/sheep/ui/su-regionCity-picker/su-regionCity-picker.vue index f3ec490..1aa8eb6 100644 --- a/sheep/ui/su-regionCity-picker/su-regionCity-picker.vue +++ b/sheep/ui/su-regionCity-picker/su-regionCity-picker.vue @@ -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'))