古刹文章详细页面0.8

This commit is contained in:
WindowBird 2025-08-14 11:58:05 +08:00
parent 3f4cb82534
commit b7de2b10dd

View File

@ -49,13 +49,11 @@
> >
<view class="item-content"> <view class="item-content">
<text class="item-title">{{ item.title }}</text> <text class="item-title">{{ item.title }}</text>
<view class="item-meta">
<text v-if="item.subtitle" class="item-subtitle" <text v-if="item.subtitle" class="item-subtitle"
>{{ item.subtitle }} >{{ item.subtitle }}
</text> </text>
<view class="item-meta">
<text class="item-time">{{ formatTime(item.createTime) }}</text> <text class="item-time">{{ formatTime(item.createTime) }}</text>
<!-- 开发时显示文章ID -->
<text v-if="!tourId" class="item-id">ID: {{ item.id }}</text>
</view> </view>
</view> </view>
<view class="item-arrow"> <view class="item-arrow">
@ -222,144 +220,140 @@ export default {
console.log("封面图片加载失败"); console.log("封面图片加载失败");
// //
}, },
// 使
testWithId(id) {
this.tourId = id;
this.fetchTourDetail();
this.fetchRelevantArticles();
},
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
//
.page { .page {
background: #f6f1e7; background: #f6f1e7;
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
//
.content-container { .content-container {
width: 100%; width: 100%;
padding: 20rpx; padding: 0 52rpx;
box-sizing: border-box; box-sizing: border-box;
} border: red solid 1px;
/* 文章头部样式 */
.article-header {
background: #fff; background: #fff;
padding: 40rpx 30rpx; }
//
.article-header {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
padding: 32rpx 30rpx;
border-radius: 16rpx; border-radius: 16rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
} border: red solid 1px;
.article-title { .article-title {
display: block; font-weight: 500;
font-size: 36rpx; font-size: 44rpx;
font-weight: bold; color: #3d3d3d;
color: #333; line-height: 60rpx;
line-height: 1.4; border: red solid 1px;
margin-bottom: 20rpx; }
}
.article-time { .article-time {
display: block; display: block;
font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #808080;
line-height: 1.2; line-height: 32rpx;
}
} }
/* 封面图片样式 */ //
.cover-image-container { .cover-image-container {
background: #fff; background: #fff;
border-radius: 16rpx; margin-bottom: 32rpx;
margin-bottom: 20rpx;
overflow: hidden; overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
} border: red solid 1px;
.cover-image { .cover-image {
width: 100%; width: 100%;
height: 400rpx; height: 400rpx;
display: block; display: block;
}
} }
/* 文章内容样式 */ //
.article-content { .article-content {
background: #fff; background: #fff;
padding: 30rpx;
border-radius: 16rpx; border-radius: 16rpx;
margin-bottom: 20rpx; margin-bottom: 32rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
min-height: 200rpx; min-height: 200rpx;
border: red solid 1px;
} }
/* 加载状态样式 */ //
.loading-container { .loading-container {
background: #fff; background: #fff;
padding: 60rpx 30rpx; padding: 60rpx 30rpx;
border-radius: 16rpx; border-radius: 16rpx;
text-align: center; text-align: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
}
.loading-text { .loading-text {
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
}
} }
/* 相关阅读区域样式 */ //
.relevant-section { .relevant-section {
background: #fff; background: #fff;
border-radius: 16rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
} border: red solid 1px;
.section-title { .section-title {
padding: 30rpx; .title-text {
border-bottom: 1rpx solid #f0f0f0; font-weight: 400;
background: #f8f8f8; font-size: 36rpx;
} color: #695347;
line-height: 50rpx;
border-bottom: 2rpx solid #a24242;
}
}
.title-text { .relevant-list {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.relevant-list {
padding: 0; padding: 0;
} }
.relevant-item { .relevant-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 30rpx; padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0; border-bottom: 1rpx solid #f0f0f0;
transition: background-color 0.3s ease; transition: background-color 0.3s ease;
} border: red solid 1px;
.relevant-item:last-child { &:last-child {
border-bottom: none; border-bottom: none;
} }
.relevant-item:active { &:active {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.item-content { .item-content {
flex: 1; flex: 1;
margin-right: 20rpx; margin-right: 20rpx;
}
.item-title { .item-title {
display: block; display: block;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
@ -369,15 +363,10 @@ export default {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} border: red solid 1px;
}
.item-meta { .item-subtitle {
display: flex;
align-items: center;
justify-content: space-between;
}
.item-subtitle {
font-size: 24rpx; font-size: 24rpx;
color: #666; color: #666;
flex: 1; flex: 1;
@ -385,62 +374,39 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
margin-right: 20rpx; margin-right: 20rpx;
} border: red solid 1px;
}
.item-time { .item-meta {
display: flex;
align-items: center;
justify-content: space-between;
border: red solid 1px;
.item-time {
font-size: 22rpx; font-size: 22rpx;
color: #999; color: #999;
flex-shrink: 0; flex-shrink: 0;
} border: red solid 1px;
}
}
}
.item-id { .item-arrow {
font-size: 20rpx;
color: #666;
background: #f0f0f0;
padding: 4rpx 8rpx;
border-radius: 4rpx;
margin-left: 10rpx;
flex-shrink: 0;
}
.item-arrow {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} border: red solid 1px;
.arrow { .arrow {
font-size: 24rpx; font-size: 24rpx;
color: #ccc; color: #ccc;
font-weight: bold; font-weight: bold;
} border: red solid 1px;
}
/* 测试按钮样式 */ }
.test-buttons { }
position: fixed;
top: 100rpx; /* 根据导航栏高度调整 */
left: 20rpx;
z-index: 10;
background-color: #fff;
padding: 20rpx;
border-radius: 16rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.test-btn {
margin-bottom: 10rpx;
background-color: #4caf50;
color: #fff;
font-size: 28rpx;
padding: 15rpx 30rpx;
border-radius: 8rpx;
border: none;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
}
.test-btn:last-child {
margin-bottom: 0;
} }
</style> </style>