info
This commit is contained in:
@@ -34,10 +34,6 @@
|
||||
<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>
|
||||
|
||||
<!-- 加载状态:上拉加载更多,加载中,没有更多数据了,加载错误 -->
|
||||
@@ -157,7 +153,7 @@
|
||||
return item;
|
||||
},
|
||||
async listLoad(data) {
|
||||
if(data[0].article_id) {
|
||||
if(data.length !== 0) {
|
||||
const listData = data.map(item => {
|
||||
if (typeof item.article_id.thumbnail === 'string') {
|
||||
item.article_id[0].thumbnail = [item.article_id[0].thumbnail]
|
||||
@@ -179,6 +175,10 @@
|
||||
|
||||
this.listData = this.loadType === 'loadMore' ? this.listData.concat(listData) : listData
|
||||
this.loadType = null
|
||||
} else {
|
||||
|
||||
this.listData = this.loadType === 'loadMore' ? this.listData.concat([]) : []
|
||||
this.loadType = null
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
@@ -216,7 +216,9 @@
|
||||
update_time: new Date().getTime(item.update_time)
|
||||
})
|
||||
})
|
||||
this.listData = listData;
|
||||
|
||||
this.listData = this.loadType === 'loadMore' ? this.listData.concat(listData) : listData
|
||||
this.loadType = null
|
||||
},
|
||||
// 初始化导航栏大小
|
||||
initNavBarSize() {
|
||||
@@ -252,9 +254,12 @@
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.loadType = 'refresh'
|
||||
console.log(this.$refs.udb);
|
||||
this.$refs.udb.loadData({
|
||||
clear: true
|
||||
}, () => {
|
||||
|
||||
console.log(1);
|
||||
uni.stopPullDownRefresh()
|
||||
// #ifdef APP-NVUE
|
||||
this.showRefresh = false
|
||||
|
||||
Reference in New Issue
Block a user