|
@@ -1,70 +1,64 @@
|
|
|
<template>
|
|
|
<div class="contentBody">
|
|
|
- <van-list
|
|
|
- v-model="loading"
|
|
|
- :finished="finished"
|
|
|
- finished-text="没有更多了"
|
|
|
- @load="onLoad"
|
|
|
- >
|
|
|
- <template>
|
|
|
- <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
|
|
|
- <van-swipe-item v-for="(item, index) in swiperList" :key="index">
|
|
|
- <van-image
|
|
|
- width="100%"
|
|
|
- height="100%"
|
|
|
- fit="cover"
|
|
|
- :src="item.imageUrl"
|
|
|
- :show-error="true"
|
|
|
- @click="clickCarousels(item)"
|
|
|
- />
|
|
|
- </van-swipe-item>
|
|
|
- </van-swipe>
|
|
|
- </template>
|
|
|
- <van-cell
|
|
|
- v-for="(contentItem, contentIndex) in contentList"
|
|
|
- :key="contentIndex"
|
|
|
- @click="chooseContent(contentIndex)"
|
|
|
- >
|
|
|
- <div slot="default" class="contentItemDiv" v-if="contentItem">
|
|
|
- <div class="contentItemTitleTitleRow">
|
|
|
- <div class="contentItemTitle">{{ contentItem.name }}</div>
|
|
|
- <div v-if="contentItem.isNeedStudyToday" class="contentItemstates">
|
|
|
- 今日必学
|
|
|
+ <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
|
|
|
+ <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
|
|
+ <template>
|
|
|
+ <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
|
|
|
+ <van-swipe-item v-for="(item, index) in swiperList" :key="index">
|
|
|
+ <van-image
|
|
|
+ width="100%"
|
|
|
+ height="100%"
|
|
|
+ fit="cover"
|
|
|
+ :src="item.imageUrl"
|
|
|
+ :show-error="true"
|
|
|
+ @click="clickCarousels(item)"
|
|
|
+ />
|
|
|
+ </van-swipe-item>
|
|
|
+ </van-swipe>
|
|
|
+ </template>
|
|
|
+ <van-cell
|
|
|
+ v-for="(contentItem, contentIndex) in contentList"
|
|
|
+ :key="contentIndex"
|
|
|
+ @click="chooseContent(contentIndex)"
|
|
|
+ >
|
|
|
+ <div slot="default" class="contentItemDiv" v-if="contentItem">
|
|
|
+ <div class="contentItemTitleTitleRow">
|
|
|
+ <div class="contentItemTitle">{{ contentItem.name }}</div>
|
|
|
+ <div v-if="contentItem.isNeedStudyToday" class="contentItemstates">今日必学</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="contentItemDescription">
|
|
|
- <div class="contentItemDescriptionTime">
|
|
|
- {{
|
|
|
+ <div class="contentItemDescription">
|
|
|
+ <div class="contentItemDescriptionTime">
|
|
|
+ {{
|
|
|
formateDatesFun(contentItem.createdTime) ||
|
|
|
contentItem.createdTime
|
|
|
- }}
|
|
|
- </div>
|
|
|
- <div class="contentItemDescriptionStudyNeedTime">
|
|
|
- 所需学习时间:{{
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div class="contentItemDescriptionStudyNeedTime">
|
|
|
+ 所需学习时间:{{
|
|
|
getTimeHoursMinuteSecondsFun(contentItem.readTimeInSec)
|
|
|
- }}
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </van-cell>
|
|
|
- </van-list>
|
|
|
+ </van-cell>
|
|
|
+ </van-list>
|
|
|
+ </van-pull-refresh>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { Toast } from "vant";
|
|
|
import { mapState } from "vuex";
|
|
|
export default {
|
|
|
name: "page-learn-recommend",
|
|
|
components: {},
|
|
|
- props: {
|
|
|
- // 轮播图的数据
|
|
|
- swiperList: null
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
contentList: [],
|
|
|
loading: false,
|
|
|
- finished: false
|
|
|
+ finished: false,
|
|
|
+ isLoading: false,
|
|
|
+ swiperList: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -147,6 +141,14 @@ export default {
|
|
|
name: "learn-content",
|
|
|
params: { materialId: this.contentList[index].id }
|
|
|
});
|
|
|
+ },
|
|
|
+ onRefresh() {
|
|
|
+ this.getNewsfeed();
|
|
|
+ this.getCarousels();
|
|
|
+ setTimeout(() => {
|
|
|
+ Toast("刷新成功");
|
|
|
+ this.isLoading = false;
|
|
|
+ }, 500);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -174,11 +176,11 @@ export default {
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
overflow: hidden;
|
|
|
- word-wrap:break-word;
|
|
|
- white-space:pre-wrap;
|
|
|
+ word-wrap: break-word;
|
|
|
+ white-space: pre-wrap;
|
|
|
display: -webkit-box;
|
|
|
-webkit-box-orient: ho;
|
|
|
- -webkit-line-clamp:10;
|
|
|
+ -webkit-line-clamp: 10;
|
|
|
}
|
|
|
.contentItemstates {
|
|
|
font-size: 0.6rem;
|