修改
This commit is contained in:
parent
5e32aea993
commit
bf6bfdb18e
@ -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,12 +186,25 @@ export default {
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
handleSignUp() {
|
||||
this.isSignedUp = true
|
||||
|
||||
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({
|
||||
@ -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;
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
</u-swiper>
|
||||
</view>
|
||||
|
||||
<!-- 天气和穿搭建议 -->
|
||||
<!-- 天气和穿搭建议 -->
|
||||
<view class="weather-outfit-section">
|
||||
<view class="weather-card">
|
||||
@ -38,28 +37,38 @@
|
||||
<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 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>
|
||||
<view class="weather-info">
|
||||
<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="weather-detail-item">
|
||||
<text>东风 {{weather.wind}}</text>
|
||||
<view class="footer-item">
|
||||
<text class="footer-icon">🌬️东风</text>
|
||||
<text class="footer-text">{{weather.wind}}</text>
|
||||
</view>
|
||||
<view class="weather-detail-item">
|
||||
<text>湿度 {{weather.humidity}}%</text>
|
||||
<view class="footer-item">
|
||||
<text class="footer-icon">💧湿度</text>
|
||||
<text class="footer-text">{{weather.humidity}}%</text>
|
||||
</view>
|
||||
<view class="weather-detail-item">
|
||||
<text>空气质量 {{weather.quality}}</text>
|
||||
<view class="footer-item">
|
||||
<text class="footer-icon">🌫️空气质量</text>
|
||||
<text class="footer-text">{{weather.quality}}</text>
|
||||
</view>
|
||||
<view class="weather-detail-item">
|
||||
<text>紫外线 {{weather.uv_index}}</text>
|
||||
<view class="footer-item">
|
||||
<text class="footer-icon">☀️紫外线</text>
|
||||
<text class="footer-text">{{weather.uv_index}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 便捷服务中心 -->
|
||||
@ -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>
|
||||
@ -284,61 +324,79 @@
|
||||
|
||||
.weather-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 30rpx 0;
|
||||
align-items: center;
|
||||
margin: 20rpx 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 {
|
||||
.weather-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.current-weather {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.weather-icon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-bottom: 10rpx;
|
||||
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;
|
||||
|
||||
.weather-detail-item {
|
||||
.footer-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
opacity: 0.9;
|
||||
flex: 1;
|
||||
|
||||
.detail-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 8rpx;
|
||||
.footer-icon {
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.footer-text {
|
||||
opacity: 0.9;
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
@ -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页面成功');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user