|
@@ -24,7 +24,7 @@
|
|
|
:key="contentIndex"
|
|
|
@click="chooseContent(contentIndex)"
|
|
|
>
|
|
|
- <div slot="default" class="contentItemDiv">
|
|
|
+ <div slot="default" class="contentItemDiv" v-if="contentItem">
|
|
|
<div class="contentItemTitleTitleRow">
|
|
|
<div class="contentItemTitle">{{ contentItem.name }}</div>
|
|
|
<div v-if="contentItem.isNeedStudyToday" class="contentItemstates">
|
|
@@ -67,7 +67,7 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
created() {
|
|
|
- this.getContentList();
|
|
|
+ this.getNewsfeed();
|
|
|
this.checkTodabTag();
|
|
|
},
|
|
|
mounted() {},
|
|
@@ -79,18 +79,12 @@ export default {
|
|
|
console.log(todayStr);
|
|
|
},
|
|
|
// 查询子目录
|
|
|
- getContentList() {
|
|
|
- let path = {
|
|
|
- categoryId: "6083ece7a05c7856f139a001"
|
|
|
- };
|
|
|
+ getNewsfeed() {
|
|
|
this.$_http
|
|
|
- .get(
|
|
|
- this.$pathParams(
|
|
|
- this.$_API.JTXT_GET_CATEGORIES_CATEGROYID_MATERIALS,
|
|
|
- path
|
|
|
- )
|
|
|
- )
|
|
|
+ .get(this.$_API.JTXT_GET_NEWSFEED)
|
|
|
.then(res => {
|
|
|
+ console.log("--newsfeed-");
|
|
|
+ console.log(res);
|
|
|
this.formatNeedStudyTodayFun(res.data);
|
|
|
this.finished = true;
|
|
|
})
|
|
@@ -100,9 +94,8 @@ export default {
|
|
|
},
|
|
|
// 判断是否今日必学
|
|
|
formatNeedStudyTodayFun(datas) {
|
|
|
- console.log("222222", datas);
|
|
|
datas.forEach(item => {
|
|
|
- if (item.tags.length > 0) {
|
|
|
+ if (item && item.tags.length > 0) {
|
|
|
item.isNeedStudyToday = true;
|
|
|
}
|
|
|
});
|