数据为空占位

This commit is contained in:
zhaofang
2022-11-14 11:33:13 +08:00
parent c7172e7db5
commit eaaa163e14
9 changed files with 143 additions and 106 deletions

View File

@@ -14,87 +14,108 @@
</view>
</view>
<view v-if="conType == 1">
<view v-for="(item, idx) in courseList" :key="idx" class="course_box">
<view class="course" @click="toCourseDetail(item)">
<view class="course-info">
<view class="" style="position: relative;">
<course-image :course="item" width="262upx" height="147upx"></course-image>
<view class="coureslabel">
{{ contentTypeFilter(item.contentType).text }}
<view v-if="courseList.length > 0">
<view v-for="(item, idx) in courseList" :key="idx" class="course_box">
<view class="course" @click="toCourseDetail(item)">
<view class="course-info">
<view class="" style="position: relative;">
<course-image :course="item" width="262upx" height="147upx"></course-image>
<view class="coureslabel">
{{ contentTypeFilter(item.contentType).text }}
</view>
</view>
<view class="course-title">
<view class="course-name">
<text style="font-weight: bold; font-size: 32rpx;" v-html="$keywordActiveShow(item.title, query.keyword)"></text>
</view>
<view class="course-content">
<author-info :avatar="item.avatar" :name="item.authorName" :info="item.orgInfo" :sex="item.sex"></author-info>
</view>
</view>
</view>
<view class="course-title">
<view class="course-name">
<text style="font-weight: bold; font-size: 32rpx;" v-html="$keywordActiveShow(item.title, query.keyword)"></text>
</view>
<view class="course-content">
<author-info :avatar="item.avatar" :name="item.authorName" :info="item.orgInfo" :sex="item.sex"></author-info>
</view>
</view>
</view>
</view>
<view class="item-bottom">
<text class="item-time">收藏时间{{ item.time }}</text>
<view class="rowbtn rowbtn-primary">
<image src="../../static/images/icon/favo.png" mode=""></image>取消收藏
</view>
</view>
</view>
</view>
<view v-if="conType == 2">
<view class="article_one" v-for="(item, idx) in articleList" :key="idx">
<view class="articla_tit" @click="toArticleDetail(item)" v-html="$keywordActiveShow(item.title, query.keyword)"></view>
<text class="articla_text" v-html="$keywordActiveShow(item.summary, query.keyword)"></text>
<author-info :avatar="item.avatar" :name="item.sysCreateBy" :info="item.orgInfo" :sex="item.sex"></author-info>
<view class="artical_text_bottom">
<view class="item-bottom">
<text class="item-time">收藏时间{{ item.time }}</text>
<view class="rowbtn rowbtn-primary">
<image src="../../static/images/icon/favo.png" mode=""></image>取消收藏
</view>
</view>
</view>
</view>
<view v-else class="empt-box">
<u-empty
text="你还没有收藏哦~"
icon="../../static/images/favorite-empt.png">
</u-empty>
</view>
</view>
<view v-if="conType == 2">
<view class="" v-if="articleList.length > 0">
<view class="article_one" v-for="(item, idx) in articleList" :key="idx">
<view class="articla_tit" @click="toArticleDetail(item)" v-html="$keywordActiveShow(item.title, query.keyword)"></view>
<text class="articla_text" v-html="$keywordActiveShow(item.summary, query.keyword)"></text>
<author-info :avatar="item.avatar" :name="item.sysCreateBy" :info="item.orgInfo" :sex="item.sex"></author-info>
<view class="artical_text_bottom">
<text class="item-time">收藏时间{{ item.time }}</text>
<view class="rowbtn rowbtn-primary">
<image src="../../static/images/icon/favo.png" mode=""></image>取消收藏
</view>
</view>
</view>
</view>
<view v-else class="empt-box">
<u-empty
text="你还没有收藏哦~"
icon="../../static/images/favorite-empt.png">
</u-empty>
</view>
</view>
<view v-if="conType == 4">
<view v-for="(item, idx) in qaList" :key="idx" class="qa">
<view class="qa-body" @click="toQaDetail(item.question)">
<text v-if="item.question.isResolve" style="color:#08A890">已解决</text>
<text v-else style="color:#387DF7">
待解决
</text>
<text v-html="$keywordActiveShow(item.question.title, query.keyword)"></text>
</view>
<author-info :avatar="item.avatar" :name="item.question.sysCreateBy" :info="item.orgInfo" :sex="item.sex"></author-info>
<view class="qa-bottom" v-html="$keywordActiveShow(item.question.content, query.keyword)"></view>
<view class="qa-answers" v-if="item.question.isResolve">
<view style="
word-break:break-all;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
display: -webkit-box;-webkit-line-clamp: 2;
line-height: 35rpx;
overflow: hidden;text-overflow: ellipsis;
font-size: 28rpx;
">
<text style="color: #FFB30F; " class="answertext" >最佳回答</text> {{ item.question.bestAnswer }}
<view v-if="qaList.length > 0">
<view v-for="(item, idx) in qaList" :key="idx" class="qa">
<view class="qa-body" @click="toQaDetail(item.question)">
<text v-if="item.question.isResolve" style="color:#08A890">已解决</text>
<text v-else style="color:#387DF7">
待解决
</text>
<text v-html="$keywordActiveShow(item.question.title, query.keyword)"></text>
</view>
</view>
<view class="item-bottom">
<text class="item-time">收藏时间{{ item.time }}</text>
<view style="margin-top: 10upx;" class="rowbtn rowbtn-primary">
<image src="../../static/images/icon/favo.png" mode=""></image>取消收藏
<author-info :avatar="item.avatar" :name="item.question.sysCreateBy" :info="item.orgInfo" :sex="item.sex"></author-info>
<view class="qa-bottom" v-html="$keywordActiveShow(item.question.content, query.keyword)"></view>
<view class="qa-answers" v-if="item.question.isResolve">
<view style="
word-break:break-all;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
display: -webkit-box;-webkit-line-clamp: 2;
line-height: 35rpx;
overflow: hidden;text-overflow: ellipsis;
font-size: 28rpx;
">
<text style="color: #FFB30F; " class="answertext" >最佳回答</text> {{ item.question.bestAnswer }}
</view>
</view>
<view class="item-bottom">
<text class="item-time">收藏时间{{ item.time }}</text>
<view style="margin-top: 10upx;" class="rowbtn rowbtn-primary">
<image src="../../static/images/icon/favo.png" mode=""></image>取消收藏
</view>
</view>
</view>
</view>
<view v-else class="empt-box">
<u-empty
text="你还没有收藏哦~"
icon="../../static/images/favorite-empt.png">
</u-empty>
</view>
</view>
<view v-show="count > query.pageSize"><uni-load-more :status="loadStatus"></uni-load-more></view>
<!-- <view v-show="count > query.pageSize"><uni-load-more :status="loadStatus"></uni-load-more></view> -->
</view>
</template>
@@ -392,6 +413,11 @@ export default {
</script>
<style lang="scss" scoped>
.empt-box{
height: 64vh;
background: #fff;
padding-top: 300upx;
}
.coureslabel{
width: 78upx;
height: 32upx;