|
@@ -1,6 +1,11 @@
|
|
|
<template>
|
|
|
<div class="contentBody" v-if="learnChildList.length > 0">
|
|
|
- <van-tabs :active="active" type="line" line-height="0px" @click="childChange">
|
|
|
+ <van-tabs
|
|
|
+ :active="active"
|
|
|
+ type="line"
|
|
|
+ line-height="0px"
|
|
|
+ @click="childChange"
|
|
|
+ >
|
|
|
<!-- 子目录 -->
|
|
|
<van-tab
|
|
|
v-for="(tabItem, tabIndex) in learnChildList"
|
|
@@ -8,7 +13,12 @@
|
|
|
:title="tabItem.name"
|
|
|
:title-style="titleStyle"
|
|
|
>
|
|
|
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
|
|
|
+ <van-list
|
|
|
+ v-model="loading"
|
|
|
+ :finished="finished"
|
|
|
+ finished-text="没有更多了"
|
|
|
+ @load="onLoad"
|
|
|
+ >
|
|
|
<van-cell
|
|
|
v-for="(contentItem, contentIndex) in contentList"
|
|
|
:key="contentIndex"
|
|
@@ -17,18 +27,23 @@
|
|
|
<div slot="default" class="contentItemDiv">
|
|
|
<div class="contentItemTitleTitleRow">
|
|
|
<div class="contentItemTitle">{{ contentItem.name }}</div>
|
|
|
- <div v-if="contentItem.isNeedStudyToday" class="contentItemstates">今日必学</div>
|
|
|
+ <div
|
|
|
+ v-if="contentItem.isNeedStudyToday"
|
|
|
+ class="contentItemstates"
|
|
|
+ >
|
|
|
+ 今日必学
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="contentItemDescription">
|
|
|
<div class="contentItemDescriptionTime">
|
|
|
{{
|
|
|
- formateDatesFun(contentItem.createdTime) ||
|
|
|
- contentItem.createdTime
|
|
|
+ formateDatesFun(contentItem.createdTime) ||
|
|
|
+ contentItem.createdTime
|
|
|
}}
|
|
|
</div>
|
|
|
<div class="contentItemDescriptionStudyNeedTime">
|
|
|
所需学习时间:{{
|
|
|
- getTimeHoursMinuteSecondsFun(contentItem.readTimeInSec)
|
|
|
+ getTimeHoursMinuteSecondsFun(contentItem.readTimeInSec)
|
|
|
}}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -41,6 +56,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getTodayStr } from "@/utils/date";
|
|
|
export default {
|
|
|
name: "page-learn-child",
|
|
|
components: {},
|
|
@@ -109,12 +125,7 @@ export default {
|
|
|
},
|
|
|
// 判断是否今日必学
|
|
|
formatNeedStudyTodayFun(datas) {
|
|
|
- let date = new Date();
|
|
|
- let year = date.getFullYear();
|
|
|
- let month = date.getMonth() + 1;
|
|
|
- month = month >= 10 ? "" + month : "0" + month;
|
|
|
- let day = date.getDate();
|
|
|
- let todayStr = year + month + day;
|
|
|
+ let todayStr = getTodayStr();
|
|
|
datas.forEach(item => {
|
|
|
item.tags.forEach(itemChild => {
|
|
|
if (itemChild === todayStr) {
|