|
@@ -8,7 +8,7 @@
|
|
|
<!-- 骨架屏 -->
|
|
<!-- 骨架屏 -->
|
|
|
<view v-else-if="loading && (!articles || articles.length === 0)" class="bs-shelf-skeleton">
|
|
<view v-else-if="loading && (!articles || articles.length === 0)" class="bs-shelf-skeleton">
|
|
|
<view class="bs-skeleton-grid">
|
|
<view class="bs-skeleton-grid">
|
|
|
- <view v-for="n in 4" :key="n" class="bs-skeleton-card">
|
|
|
|
|
|
|
+ <view v-for="n in 3" :key="n" class="bs-skeleton-card">
|
|
|
<view class="bs-skeleton-cover"></view>
|
|
<view class="bs-skeleton-cover"></view>
|
|
|
<view class="bs-skeleton-line"></view>
|
|
<view class="bs-skeleton-line"></view>
|
|
|
</view>
|
|
</view>
|
|
@@ -94,9 +94,9 @@ export default {
|
|
|
{ title: '亲子沟通的心理学智慧', category: '心理养育', summary: '有效的倾听与表达技巧' },
|
|
{ title: '亲子沟通的心理学智慧', category: '心理养育', summary: '有效的倾听与表达技巧' },
|
|
|
{ title: '规划师推荐的书单', category: '成长规划', summary: '培养未来领导力的阅读路径' },
|
|
{ title: '规划师推荐的书单', category: '成长规划', summary: '培养未来领导力的阅读路径' },
|
|
|
{ title: '儿童营养均衡完全指南', category: '营养健康', summary: '0-12岁各阶段营养需求' }
|
|
{ title: '儿童营养均衡完全指南', category: '营养健康', summary: '0-12岁各阶段营养需求' }
|
|
|
- ].slice(0, 4)
|
|
|
|
|
|
|
+ ].slice(0, 3)
|
|
|
}
|
|
}
|
|
|
- return this.articles.slice(0, 4)
|
|
|
|
|
|
|
+ return this.articles.slice(0, 3)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -183,16 +183,17 @@ export default {
|
|
|
padding-top: 16rpx;
|
|
padding-top: 16rpx;
|
|
|
}
|
|
}
|
|
|
.bs-skeleton-card {
|
|
.bs-skeleton-card {
|
|
|
- width: calc(25% - 12rpx);
|
|
|
|
|
|
|
+ width: calc(33.33% - 12rpx);
|
|
|
margin-right: 16rpx;
|
|
margin-right: 16rpx;
|
|
|
margin-bottom: 16rpx;
|
|
margin-bottom: 16rpx;
|
|
|
}
|
|
}
|
|
|
-.bs-skeleton-card:nth-child(4n) {
|
|
|
|
|
|
|
+.bs-skeleton-card:nth-child(3n) {
|
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
|
}
|
|
}
|
|
|
.bs-skeleton-cover {
|
|
.bs-skeleton-cover {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 160rpx;
|
|
|
|
|
|
|
+ height: 0;
|
|
|
|
|
+ padding-top: 133.33%; /* 3:4 书封比例 */
|
|
|
border-radius: 12rpx;
|
|
border-radius: 12rpx;
|
|
|
background: linear-gradient(180deg, #e8e8e8 0%, #f0f0f0 50%, #e8e8e8 100%);
|
|
background: linear-gradient(180deg, #e8e8e8 0%, #f0f0f0 50%, #e8e8e8 100%);
|
|
|
background-size: 200% 100%;
|
|
background-size: 200% 100%;
|
|
@@ -211,28 +212,30 @@ export default {
|
|
|
100% { background-position: -200% 0; }
|
|
100% { background-position: -200% 0; }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* ---- 四列文章网格 ---- */
|
|
|
|
|
|
|
+/* ---- 三列文章网格 ---- */
|
|
|
.bs-grid {
|
|
.bs-grid {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
}
|
|
}
|
|
|
.bs-card {
|
|
.bs-card {
|
|
|
- width: calc(25% - 12rpx);
|
|
|
|
|
|
|
+ width: calc(33.33% - 12rpx);
|
|
|
margin-right: 16rpx;
|
|
margin-right: 16rpx;
|
|
|
margin-bottom: 16rpx;
|
|
margin-bottom: 16rpx;
|
|
|
}
|
|
}
|
|
|
-.bs-card:nth-child(4n) {
|
|
|
|
|
|
|
+.bs-card:nth-child(3n) {
|
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
|
}
|
|
}
|
|
|
.bs-card-cover {
|
|
.bs-card-cover {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 160rpx;
|
|
|
|
|
|
|
+ height: 0;
|
|
|
|
|
+ padding-top: 133.33%; /* 3:4 书封比例 */
|
|
|
border-radius: 12rpx;
|
|
border-radius: 12rpx;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.12);
|
|
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.12);
|
|
|
transition: transform 0.18s, box-shadow 0.18s;
|
|
transition: transform 0.18s, box-shadow 0.18s;
|
|
|
}
|
|
}
|
|
@@ -243,12 +246,18 @@ export default {
|
|
|
|
|
|
|
|
/* 封面图 */
|
|
/* 封面图 */
|
|
|
.bs-cover-img {
|
|
.bs-cover-img {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 无封面图时:渐变底 + 书名 */
|
|
/* 无封面图时:渐变底 + 书名 */
|
|
|
.bs-cover-text {
|
|
.bs-cover-text {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display: flex;
|
|
display: flex;
|