From 54f0643445e444eb38598b9eca9639ea74e067ad Mon Sep 17 00:00:00 2001 From: wangzimeng <3297159934@qq.com> Date: Wed, 23 Jul 2025 15:54:47 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A6=96=E9=A1=B5=E7=9A=84=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=8E=A8=E8=8D=90=E7=9A=84=E5=88=97=E8=A1=A8=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E5=92=8C=E9=A1=B6=E9=83=A8=E7=9C=81=E5=B8=82?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=9A=84=E5=AE=9E=E7=8E=B0=202=E3=80=81?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E9=A6=96=E9=A1=B5=E7=9A=84=E6=88=91=E7=9A=84?= =?UTF-8?q?=E7=A7=AF=E5=88=86=EF=BC=88=E9=87=87=E7=94=A8=E5=8E=9F=E7=89=88?= =?UTF-8?q?=E7=9A=84=EF=BC=89=E5=92=8C=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=EF=BC=88=E9=87=87=E7=94=A8=E5=8E=9F=E7=89=88=E7=9A=84=EF=BC=89?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=92=8C=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= =?UTF-8?q?=203=E3=80=81=E9=A6=96=E9=A1=B5=E7=9A=84=E9=A3=9F=E5=A0=82?= =?UTF-8?q?=E6=8B=9B=E7=A7=9F=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/canteenRent/rentList.vue | 232 +++++---- pages/index/index.vue | 244 ++++++--- pages/index/user.vue | 2 +- pages/public/feedback.vue | 3 +- pages/user/wallet/score.vue | 10 +- .../su-regionCity-picker.vue | 478 +++++++++--------- 6 files changed, 558 insertions(+), 411 deletions(-) diff --git a/pages/canteenRent/rentList.vue b/pages/canteenRent/rentList.vue index eb3b172..da109be 100644 --- a/pages/canteenRent/rentList.vue +++ b/pages/canteenRent/rentList.vue @@ -7,27 +7,26 @@ - + - + - - {{state.model.city_name ? proCity:'地区' }} + + {{state.model.city_name ? state.model.city_name:'全国' }} - - - - - {{dictLabel || '标签'}} + + {{dictLabel || '标签'}} @@ -55,7 +54,18 @@ {{item.platform_title}} - 标签 + + + + {{e}} + + + + + - - - + @@ -123,10 +124,12 @@ address1: null, categoryId: null, tags: '', + cate_ids: '', area: null, city: null, + province: null, district: null, - keywords:null, + keywords: null, // district: '', }) @@ -135,18 +138,11 @@ onLoad(() => { getList(); + getTagList() }) onShow(() => {}) - - // 数据 - const pagination = { - data: [], - current_page: 1, - total: 1, - last_page: 1, - }; - + const state = reactive({ showRegion: false, model: { @@ -162,21 +158,14 @@ address, region, }, - currentTab: 0, - pagination: { - data: [], - current_page: 1, - total: 1, - last_page: 1, - }, loadStatus: '', type: '', }); const proCity = ref(''); //省市页面显示 - function searchRent() { - console.log('搜索'); + console.log('搜索',listQuery.value.keywords); + getList() } const onRegionConfirm = (e) => { @@ -186,76 +175,90 @@ ...state.model, ...e, }; - - proCity.value = state.model.province_name + " " + state.model.city_name + // proCity.value = state.model.province_name + " " + state.model.city_name console.log('onRegionConfirm33', state.model, proCity.value); + listQuery.value.province = state.model.province_id + listQuery.value.city = state.model.city_id + getList() state.showRegion = false; }; /* 标签 */ - // const getTagList = () => { - // const obj = [{ - // dictLabel:'全部', - // dictCode:'' - // }] - // getTag(listQuery.value).then(res => { - // tagList.value = obj.concat(res.data) - // total.value = res.total - // }) - // } + const tagShowList = ref([]) + async function getTagList() { + const obj = [{ + name: '全部', + id: '' + }] + const res = await sheep.$api.rent.tagsList({}); + if (res.code == 1) { + tagList.value = obj.concat(res.data.list) + tagShowList.value = tagList.value.map(({ + name, + id + }) => ({ + name, + id + })); + console.log('tagList', tagList.value, tagShowList.value); + } + } /**选择标签 */ - // function onChangeTag(e) { - // const value = e.detail.value; - // listQuery.value.tags = tagList.value[e.detail.value].dictLabel; - // dictLabel.value = tagList.value[e.detail.value].dictLabel; - // console.log('标签',listQuery.value); - // getList(listQuery.value); + function onChangeTag(e) { + const value = e.detail.value; + listQuery.value.cate_ids = tagList.value[e.detail.value].id; + dictLabel.value = tagList.value[e.detail.value].name; + console.log('标签', listQuery.value); + getList(listQuery.value); - // } + } const rentList = ref([]) //招租列表 async function getList() { - // state.loadStatus = 'loading'; - let res = await sheep.$api.rent.rentlist({ - keywords: listQuery.keywords, - page:listQuery.page, - limit: listQuery.limit, - my:1, - order:'normal', - status:1, + const res = await sheep.$api.rent.rentlist({ + keywords: listQuery.value.keywords, + page: listQuery.value.page, + limit: listQuery.value.limit, + cate_ids: listQuery.value.cate_ids, + my: 1, + order: 'normal', + status: 1, + province: listQuery.value.province, + city: listQuery.value.city, }); - console.log('getList',res); - if (res.code === 1) { - rentList.value = res.data.list - for(let i = 0;i { + // Create a new object with all properties from the original item + const newItem = { + ...item + }; + + // Only process release_time_text if it exists + if (newItem.release_time_text) { + newItem.release_time_text = newItem.release_time_text.substring(0, 10); + } + + return newItem; + }); + } else { + // Handle case where data is not in expected format + rentList.value = []; } - // if (state.pagination.current_page < state.pagination.last_page) { - // state.loadStatus = 'more'; - // } else { - // state.loadStatus = 'noMore'; + + // rentList.value = res.data.list; + // for(let i=0;i { - // loadmore(); - }); + .ui-btn-picker--primary { + color: blue; + } + + .ui-btn-picker--tips { + color: red; + } + \ No newline at end of file