This commit is contained in:
qiuyuan 2025-07-21 18:58:03 +08:00
parent 5e32aea993
commit bf6bfdb18e
7 changed files with 923 additions and 835 deletions

View File

@ -127,8 +127,8 @@
<u-icon name="share" size="30" color="#666"></u-icon>
<text>分享</text>
</view>
<button class="signup-btn" @click="handleSignUp" disabled>
{{isSignedUp ? '已报名' : '线下报名'}}
<button class="signup-btn" @click="handleSignUp" >
立即报名
</button>
</view>
</view>
@ -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;

View File

@ -29,38 +29,47 @@
</u-swiper>
</view>
<!-- 天气和穿搭建议 -->
<!-- 天气和穿搭建议 -->
<view class="weather-outfit-section">
<view class="weather-card">
<view class="weather-header">
<text class="location">{{weather.province}}·{{weather.area}}</text>
<text class="date">{{weather.date}} {{weather.week}}</text>
</view>
<view class="weather-content">
<view class="temperature">
<text class="temp-value">{{weather.lowest}}~{{weather.highest}}</text>
<!-- <text class="temp-unit">°C</text> -->
</view>
<view class="weather-info">
<text class="weather-desc">{{weather.weather}}</text>
</view>
</view>
<view class="weather-footer">
<view class="weather-detail-item">
<text>东风 {{weather.wind}}</text>
</view>
<view class="weather-detail-item">
<text>湿度 {{weather.humidity}}%</text>
</view>
<view class="weather-detail-item">
<text>空气质量 {{weather.quality}}</text>
</view>
<view class="weather-detail-item">
<text>紫外线 {{weather.uv_index}}</text>
</view>
</view>
</view>
<view class="weather-card">
<view class="weather-header">
<text class="location">{{weather.province}}·{{weather.area}}</text>
<text class="date">{{weather.date}} {{weather.week}}</text>
</view>
<view class="weather-content">
<view class="weather-main">
<view class="current-weather">
<image class="weather-icon" :src="getWeatherIcon(weather.weather)" mode="aspectFit">
</image>
<text class="current-temp">{{weather.real}}°</text>
</view>
<text class="weather-desc">{{weather.weather}}</text>
</view>
<view class="temperature-range">
<text class="temp-item">最高温 {{weather.highest}}°</text>
<text class="temp-item">最高温 {{weather.lowest}}°</text>
</view>
</view>
<view class="weather-footer">
<view class="footer-item">
<text class="footer-icon">🌬东风</text>
<text class="footer-text">{{weather.wind}}</text>
</view>
<view class="footer-item">
<text class="footer-icon">💧湿度</text>
<text class="footer-text">{{weather.humidity}}%</text>
</view>
<view class="footer-item">
<text class="footer-icon">🌫空气质量</text>
<text class="footer-text">{{weather.quality}}</text>
</view>
<view class="footer-item">
<text class="footer-icon">紫外线</text>
<text class="footer-text">{{weather.uv_index}}</text>
</view>
</view>
</view>
</view>
<!-- 便捷服务中心 -->
<view class="service-section">
@ -126,7 +135,7 @@
return {
list1: [],
currentDate: this.formatDate(new Date()),
weather:{},
weather: {},
}
},
mounted() {
@ -179,12 +188,43 @@
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;
}
}
}
</script>
@ -253,96 +293,114 @@
/* 天气和穿搭区域 */
.weather-outfit-section {
margin-bottom: 40rpx;
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-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);
.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;
.date {
font-size: 26rpx;
opacity: 0.9;
font-weight: bold;
}
}
.location {
font-size: 28rpx;
font-weight: 500;
}
}
.location {
font-size: 28rpx;
font-weight: 500;
}
}
.weather-content {
display: flex;
align-items: center;
justify-content: space-between;
margin: 30rpx 0;
padding: 20rpx 0;
.weather-content {
display: flex;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
padding: 20rpx 0;
.temperature {
display: flex;
align-items: flex-start;
.weather-main {
display: flex;
flex-direction: column;
align-items: center;
.temp-value {
font-size: 60rpx;
font-weight: 600;
line-height: 1;
}
.current-weather {
display: flex;
align-items: center;
.temp-unit {
font-size: 36rpx;
margin-top: 8rpx;
}
}
.weather-icon {
width: 80rpx;
height: 80rpx;
margin-right: 15rpx;
}
.weather-info {
display: flex;
flex-direction: column;
align-items: center;
.current-temp {
font-size: 64rpx;
font-weight: bold;
line-height: 1;
}
}
.weather-icon {
width: 80rpx;
height: 80rpx;
margin-bottom: 10rpx;
}
.weather-desc {
font-size: 28rpx;
margin-top: 10rpx;
opacity: 0.9;
}
}
.weather-desc {
font-size: 28rpx;
opacity: 0.9;
}
}
}
.temperature-range {
display: flex;
flex-direction: column;
align-items: flex-end;
.weather-footer {
display: flex;
justify-content: space-between;
padding-top: 20rpx;
border-top: 1rpx solid rgba(255, 255, 255, 0.2);
font-size: 24rpx;
.temp-item {
font-size: 28rpx;
margin-bottom: 10rpx;
opacity: 0.8;
.weather-detail-item {
display: flex;
align-items: center;
opacity: 0.9;
&: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;
.detail-icon {
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
}
}
}
}
.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;
}
}
}
}
}
/* 便捷服务中心 - 优化后 */

View File

@ -9,7 +9,7 @@
<view v-if="meetingRoomList.length === 0" class="empty-container">
<text>暂无会议室数据 ({{ meetingRoomList }})</text>
</view>
<view class="room-item" v-for="(item, index) in meetingRoomList" :key="index">
<view class="room-item" v-for="(item, index) in meetingRoomList" :key="index" @click="goDetail(item.roomInfo || item)">
<image class="room-img" :src="`${IMAGE_BASE_URL}`+item.imgs[0]">
</image>
<view class="room-info">
@ -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;

View File

@ -146,7 +146,7 @@ export default {
{
key: 4,
url: "/static/imgs/service/service_friend.png",
name: '会议室预约',
name: '共享空间预约',
pageUrl: 'meetingList'
},
{

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
<view class="slanted-block"></view>
</view>
<view class="right" @click="goPage('helpInfo')">
<view class="right" @click="goPage('helpInfo','')">
<view class="right-icon">+</view>
<view class="right-font">发帖</view>
</view>
@ -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页面成功');