This commit is contained in:
2025-03-20 19:32:25 +08:00
parent ebc8c7bb26
commit 8e35b74d86
17 changed files with 3170 additions and 1840 deletions
+75 -6
View File
@@ -26,7 +26,18 @@
<!-- 列表渲染 -->
<template v-for="item in listData">
<view class="" v-if="item.article_status === 1">
<view class="" v-if="!item">
<view class="main">
<view>
<text class="title">该文章已被下架或删除</text>
</view>
<view class="info">
<text class="publish_date">{{ "最近访问于:文章不存在"}}</text>
</view>
</view>
</view>
<view class="" v-else-if="item.article_status === 1">
<not-cover v-if="item.thumbnail && item.thumbnail.length === 0" :ctype="'historyList'"
:data="getNewItem(item)"></not-cover>
<right-small-cover v-else-if="item.thumbnail && item.thumbnail.length === 1" :ctype="'historyList'"
@@ -34,9 +45,7 @@
<three-cover v-else-if="item.thumbnail && item.thumbnail.length === 3" :ctype="'historyList'"
:data="getNewItem(item)"></three-cover>
</view>
<view class="" v-else>
111
</view>
</template>
@@ -159,13 +168,18 @@
return item;
},
async listLoad(data) {
if (data.lenght === 0) return;
console.log(data);
if(data[0].article_id) {
const listData = data.map(item => {
if (item.article_id.length === 0 ) return;
if (typeof item.article_id.thumbnail === 'string') {
item.article_id[0].thumbnail = [item.article_id[0].thumbnail]
}
item.article_id[0].user_id = item.user_id[0];
console.log(item);
item.article_id[0].user_id = item.user_id[0];
item.article_id[0].last_view_time = new Date(item.last_view_time).getTime();
return item.article_id[0];
})
@@ -174,6 +188,7 @@
// 处理腾讯云文件链接
for (const article of listData) {
if (!article) continue;
const parseImages = await parseImageUrl(article.thumbnail)
article.thumbnail = parseImages ? parseImages.map(image => image.src) : []
@@ -272,7 +287,8 @@
}
</script>
<style scoped>
<style lang="scss" scoped>
/* #ifndef APP-NVUE */
.pages view {
display: flex;
@@ -349,4 +365,57 @@
.pages .uni-list ::v-deep .uni-list--border:after {
background-color: #f5f5f5;
}
.main {
display: flex;
justify-content: space-between;
flex-direction: column;
flex: 1;
padding-left: 30rpx;
padding-right: 30rpx;
padding-top: 24rpx;
padding-bottom: 24rpx;
.title {
font-size: 30rpx;
color: #bbb;
}
.thumbnails {
margin: 20rpx 0;
display: flex;
align-items: center;
flex-direction: row;
.img {
flex: 1;
/* #ifndef APP-NVUE */
width: auto;
/* #endif */
height: 200rpx;
border-radius: 8rpx;
margin: 0 10rpx;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
}
}
.info {
display: flex;
flex-direction: row;
margin-top: 20rpx;
}
.author,
.publish_date {
font-size: 24rpx;
color: #bbbbbb;
}
.publish_date {
margin-left: 14rpx;
}
}
</style>