古刹文章详细页面0.8
This commit is contained in:
parent
3f4cb82534
commit
b7de2b10dd
|
|
@ -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>
|
||||||
|
<text v-if="item.subtitle" class="item-subtitle"
|
||||||
|
>{{ item.subtitle }}
|
||||||
|
</text>
|
||||||
<view class="item-meta">
|
<view class="item-meta">
|
||||||
<text v-if="item.subtitle" class="item-subtitle"
|
|
||||||
>{{ item.subtitle }}
|
|
||||||
</text>
|
|
||||||
<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,225 +220,193 @@ 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 {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 44rpx;
|
||||||
|
color: #3d3d3d;
|
||||||
|
line-height: 60rpx;
|
||||||
|
border: red solid 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article-time {
|
||||||
|
display: block;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #808080;
|
||||||
|
line-height: 32rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-title {
|
// 封面图片区域
|
||||||
display: block;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
line-height: 1.4;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-time {
|
|
||||||
display: block;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 封面图片样式 */
|
|
||||||
.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 {
|
||||||
|
width: 100%;
|
||||||
|
height: 400rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover-image {
|
// 文章内容区域
|
||||||
width: 100%;
|
|
||||||
height: 400rpx;
|
|
||||||
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 {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-text {
|
// 相关阅读区域
|
||||||
font-size: 28rpx;
|
|
||||||
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;
|
padding: 0;
|
||||||
font-weight: bold;
|
}
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relevant-list {
|
.relevant-item {
|
||||||
padding: 0;
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
border: red solid 1px;
|
||||||
|
|
||||||
.relevant-item {
|
&:last-child {
|
||||||
display: flex;
|
border-bottom: none;
|
||||||
align-items: center;
|
}
|
||||||
padding: 30rpx;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
transition: background-color 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relevant-item:last-child {
|
&:active {
|
||||||
border-bottom: none;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.relevant-item:active {
|
.item-content {
|
||||||
background-color: #f5f5f5;
|
flex: 1;
|
||||||
}
|
margin-right: 20rpx;
|
||||||
|
|
||||||
.item-content {
|
.item-title {
|
||||||
flex: 1;
|
display: block;
|
||||||
margin-right: 20rpx;
|
font-size: 28rpx;
|
||||||
}
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
border: red solid 1px;
|
||||||
|
}
|
||||||
|
|
||||||
.item-title {
|
.item-subtitle {
|
||||||
display: block;
|
font-size: 24rpx;
|
||||||
font-size: 28rpx;
|
color: #666;
|
||||||
font-weight: 500;
|
flex: 1;
|
||||||
color: #333;
|
overflow: hidden;
|
||||||
line-height: 1.4;
|
text-overflow: ellipsis;
|
||||||
margin-bottom: 10rpx;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
margin-right: 20rpx;
|
||||||
text-overflow: ellipsis;
|
border: red solid 1px;
|
||||||
white-space: nowrap;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.item-meta {
|
.item-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
border: red solid 1px;
|
||||||
|
|
||||||
.item-subtitle {
|
.item-time {
|
||||||
font-size: 24rpx;
|
font-size: 22rpx;
|
||||||
color: #666;
|
color: #999;
|
||||||
flex: 1;
|
flex-shrink: 0;
|
||||||
overflow: hidden;
|
border: red solid 1px;
|
||||||
text-overflow: ellipsis;
|
}
|
||||||
white-space: nowrap;
|
}
|
||||||
margin-right: 20rpx;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.item-time {
|
.item-arrow {
|
||||||
font-size: 22rpx;
|
width: 40rpx;
|
||||||
color: #999;
|
height: 40rpx;
|
||||||
flex-shrink: 0;
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: red solid 1px;
|
||||||
|
|
||||||
.item-id {
|
.arrow {
|
||||||
font-size: 20rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #ccc;
|
||||||
background: #f0f0f0;
|
font-weight: bold;
|
||||||
padding: 4rpx 8rpx;
|
border: red solid 1px;
|
||||||
border-radius: 4rpx;
|
}
|
||||||
margin-left: 10rpx;
|
}
|
||||||
flex-shrink: 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.item-arrow {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.arrow {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #ccc;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 测试按钮样式 */
|
|
||||||
.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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user