diff --git a/pages/activeDetail/index.vue b/pages/activeDetail/index.vue index 55d41b2..dd91b96 100644 --- a/pages/activeDetail/index.vue +++ b/pages/activeDetail/index.vue @@ -127,8 +127,8 @@ 分享 - @@ -146,11 +146,7 @@ export default { Id:null, isFavorite: false, isSignedUp: false, - bannerImages: [ - // '/static/night-run-1.jpg', - // '/static/night-run-2.jpg', - // '/static/night-run-3.jpg' - ], + bannerImages: [], activityInfo: {}, // timeline: [ // {time: '19:00-19:20', desc: '签到领取装备'}, @@ -190,13 +186,26 @@ export default { icon: 'none' }) }, - handleSignUp() { - this.isSignedUp = true - uni.showToast({ - title: '报名成功!', - icon: 'success' - }) - }, + + async handleSignUp(){ + try { + const res = await get(`/api/v1/app_auth/activities/${this.Id}`); + if ( !res.success) { + uni.showToast({ + title: res.msg || '报名失败', + icon: 'error' + }) + }else{ + uni.showToast({ + title: '报名成功!', + icon: 'success' + }) + } + + } catch (err) { + console.error('获取详情失败:', err); + } + }, shareActivity() { uni.share({ title: this.activityInfo.title, @@ -518,7 +527,7 @@ $shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.06); .signup-btn { flex: 1; height: 80rpx; - background-color: #ccc; + background-color: #5b9cf8; color: #fff; border-radius: 40rpx; font-size: 32rpx; diff --git a/pages/index/index.vue b/pages/index/index.vue index d0d0713..f6d4a7a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -29,38 +29,47 @@ - - - - - - {{weather.province}}·{{weather.area}} - {{weather.date}} {{weather.week}} - - - - {{weather.lowest}}~{{weather.highest}} - - - - {{weather.weather}} - - - - - 东风 {{weather.wind}} - - - 湿度 {{weather.humidity}}% - - - 空气质量 {{weather.quality}} - - - 紫外线 {{weather.uv_index}} - - - + + + + + {{weather.province}}·{{weather.area}} + {{weather.date}} {{weather.week}} + + + + + + + {{weather.real}}° + + {{weather.weather}} + + + 最高温 {{weather.highest}}° + 最高温 {{weather.lowest}}° + + + + + 🌬️东风 + {{weather.wind}} + + + 💧湿度 + {{weather.humidity}}% + + + 🌫️空气质量 + {{weather.quality}} + + + ☀️紫外线 + {{weather.uv_index}} + + + + @@ -125,8 +134,8 @@ data() { return { list1: [], - currentDate: this.formatDate(new Date()), - weather:{}, + currentDate: this.formatDate(new Date()), + weather: {}, } }, mounted() { @@ -178,13 +187,44 @@ const res = await get('/api/v1/apps/home/weather'); if (!res || !res.success) { throw new Error('获取天气失败'); - } - this.weather = {...res.data}; + } + this.weather = { + ...res.data + }; } catch (err) { console.error('获取轮播图失败:', err); } }, + getWeatherIcon(weather) { + const weatherMap = { + '晴': '/static/imgs/index/sunny.png', + '多云': '/static/imgs/index/cloudy.png', + '阴': '/static/imgs/index/overcast.png', + '雨': '/static/imgs/index/rain.png', + '小雨': '/static/imgs/index/light-rain.png', + '中雨': '/static/imgs/index/moderate-rain.png', + '大雨': '/static/imgs/index/heavy-rain.png', + '暴雨': '/static/imgs/index/storm-rain.png', + '雪': '/static/imgs/index/snow.png', + '雾': '/static/imgs/index/fog.png', + '霾': '/static/imgs/index/fog.png', + }; + + // 默认图标 + const defaultIcon = '/static/imgs/weather/default.png'; + + // 遍历天气关键词,匹配最合适的图标 + for (const key in weatherMap) { + if (weather.includes(key)) { + return weatherMap[key]; + } + } + + return defaultIcon; + } + + } } @@ -252,97 +292,115 @@ } /* 天气和穿搭区域 */ - .weather-outfit-section { - margin-bottom: 40rpx; - - .weather-card { - width: 92%; - background: #85b0ed; - border-radius: 20rpx; - padding: 30rpx; - color: #fff; - box-shadow: 0 8rpx 24rpx rgba(133, 176, 237, 0.3); - - .weather-header { - display: flex; - justify-content: space-between; - margin-bottom: 20rpx; - padding-bottom: 20rpx; - border-bottom: 1rpx solid rgba(255, 255, 255, 0.2); - - .date { - font-size: 26rpx; - opacity: 0.9; - font-weight: bold; - } - - .location { - font-size: 28rpx; - font-weight: 500; - } - } - - .weather-content { - display: flex; - align-items: center; - justify-content: space-between; - margin: 30rpx 0; - padding: 20rpx 0; - - .temperature { - display: flex; - align-items: flex-start; - - .temp-value { - font-size: 60rpx; - font-weight: 600; - line-height: 1; - } - - .temp-unit { - font-size: 36rpx; - margin-top: 8rpx; - } - } - - .weather-info { - display: flex; - flex-direction: column; - align-items: center; - - .weather-icon { - width: 80rpx; - height: 80rpx; - margin-bottom: 10rpx; - } - - .weather-desc { - font-size: 28rpx; - opacity: 0.9; - } - } - } - - .weather-footer { - display: flex; - justify-content: space-between; - padding-top: 20rpx; - border-top: 1rpx solid rgba(255, 255, 255, 0.2); - font-size: 24rpx; - - .weather-detail-item { - display: flex; - align-items: center; - opacity: 0.9; - - .detail-icon { - width: 28rpx; - height: 28rpx; - margin-right: 8rpx; - } - } - } - } + .weather-outfit-section { + margin-bottom: 40rpx; + + .weather-card { + width: 92%; + background: #85b0ed; + border-radius: 20rpx; + padding: 30rpx; + color: #fff; + box-shadow: 0 8rpx 24rpx rgba(133, 176, 237, 0.3); + + .weather-header { + display: flex; + justify-content: space-between; + margin-bottom: 20rpx; + padding-bottom: 20rpx; + border-bottom: 1rpx solid rgba(255, 255, 255, 0.2); + + .date { + font-size: 26rpx; + opacity: 0.9; + font-weight: bold; + } + + .location { + font-size: 28rpx; + font-weight: 500; + } + } + + .weather-content { + display: flex; + justify-content: space-between; + align-items: center; + margin: 20rpx 0; + padding: 20rpx 0; + + .weather-main { + display: flex; + flex-direction: column; + align-items: center; + + .current-weather { + display: flex; + align-items: center; + + .weather-icon { + width: 80rpx; + height: 80rpx; + margin-right: 15rpx; + } + + .current-temp { + font-size: 64rpx; + font-weight: bold; + line-height: 1; + } + } + + .weather-desc { + font-size: 28rpx; + margin-top: 10rpx; + opacity: 0.9; + } + } + + .temperature-range { + display: flex; + flex-direction: column; + align-items: flex-end; + + .temp-item { + font-size: 28rpx; + margin-bottom: 10rpx; + opacity: 0.8; + + &:last-child { + margin-bottom: 0; + } + } + } + } + .weather-footer { + display: flex; + justify-content: space-between; + align-items: center; + padding-top: 20rpx; + border-top: 1rpx solid rgba(255, 255, 255, 0.2); + font-size: 24rpx; + + .footer-item { + display: flex; + flex-direction: column; + align-items: center; + flex: 1; + + .footer-icon { + font-size: 24rpx; + margin-bottom: 6rpx; + } + + .footer-text { + opacity: 0.9; + text-align: center; + line-height: 1.2; + } + } + } + } } /* 便捷服务中心 - 优化后 */ diff --git a/pages/meetingList/index.vue b/pages/meetingList/index.vue index 58e61f0..7a7d422 100644 --- a/pages/meetingList/index.vue +++ b/pages/meetingList/index.vue @@ -9,7 +9,7 @@ 暂无会议室数据 ({{ meetingRoomList }}) - + @@ -104,7 +104,7 @@ IMAGE_BASE_URL, tabsReady: false, tabList: [{ - name: '会议预约' + name: '共享空间' }, { name: '预约记录' @@ -146,7 +146,6 @@ } else { this.getList(); } - console.log("=======index", index) }, // 格式化日期 formatDate(dateString) { @@ -210,7 +209,6 @@ }); } } catch (err) { - console.error('取消预约失败:', err); uni.showToast({ title: '取消失败', icon: 'none' @@ -221,14 +219,11 @@ }, goDetail(item) { - // 调试输出完整数据结构 - console.log('点击项完整数据:', JSON.stringify(item)); - + // 安全获取ID(兼容各种可能的字段名) const id = item.id; if (!id) { - console.error('无效的会议室数据,缺少ID字段:', item); uni.showToast({ title: '会议室信息异常', icon: 'none' @@ -236,9 +231,6 @@ return; } - // 调试输出最终使用的ID - console.log('导航使用的ID:', id); - uni.navigateTo({ url: `/pages/meetingDetail/index?Id=${encodeURIComponent(id)}`, // 使用encodeURIComponent防止特殊字符问题 success: () => { @@ -261,16 +253,12 @@ pageSize: 10, }); - console.log("===res", res) - if (res?.success) { this.meetingRoomList = [...res.data]; - console.log("======this.meetingRoomList", this.meetingRoomList) this.tabsReady = true; } } catch (err) { - console.error('获取我的求助失败:', err); uni.showToast({ title: '加载列表失败', icon: 'none' @@ -287,8 +275,6 @@ pageSize: 10, }); - console.log("===res", res) - if (res?.success) { this.orderList = [...res.data]; this.tabsReady = true; diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 585930c..0189ad4 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -146,7 +146,7 @@ export default { { key: 4, url: "/static/imgs/service/service_friend.png", - name: '会议室预约', + name: '共享空间预约', pageUrl: 'meetingList' }, { diff --git a/pages/neighbor/index.vue b/pages/neighbor/index.vue index 397c149..fbd2331 100644 --- a/pages/neighbor/index.vue +++ b/pages/neighbor/index.vue @@ -102,7 +102,7 @@ resolve({ longitude: res.longitude, latitude: res.latitude - }); + }); }, fail: (err) => { console.error('获取位置失败:', err); diff --git a/pages/neighborDetail/index.vue b/pages/neighborDetail/index.vue index 27f41a3..8867a8b 100644 --- a/pages/neighborDetail/index.vue +++ b/pages/neighborDetail/index.vue @@ -1,116 +1,63 @@ - - \ No newline at end of file diff --git a/pages/neighborList/index.vue b/pages/neighborList/index.vue index d683004..a8b9350 100644 --- a/pages/neighborList/index.vue +++ b/pages/neighborList/index.vue @@ -16,7 +16,7 @@ - + + 发帖 @@ -92,9 +92,9 @@ }, methods: { // 跳转详情页面 - goPage(page){ + goPage(page,id){ uni.navigateTo({ - url: `/pages/${page}/index`, + url: `/pages/${page}/index?Id=${id}`, // url: '/pages/helpInfo/index', success: () => { console.log('切换到tabBar页面成功');