|
@@ -15,12 +15,12 @@
|
|
|
<div slot="default" class="contentItemDiv">
|
|
|
<div>
|
|
|
<div class="contentItemTitle">
|
|
|
- {{ item.name || "学习文章标题" }}
|
|
|
+ {{ item.materialTitle || "学习文章标题" }}
|
|
|
</div>
|
|
|
<div class="contentItemDescription">
|
|
|
收藏时间:
|
|
|
<span>{{
|
|
|
- formateDatesFun(item.createdTime) || item.createdTime
|
|
|
+ formateDatesFun(item.addedTime)
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -70,13 +70,9 @@ export default {
|
|
|
this.$_http
|
|
|
.get(this.$pathParams(this.$_API.JTXT_GET_USER_FAVORITES, path))
|
|
|
.then(res => {
|
|
|
- if (res.data.materials) {
|
|
|
- res.data.materials.forEach((item, index) => {
|
|
|
- this.getFavoritesDetailFun(
|
|
|
- item,
|
|
|
- index + 1 === res.data.materials.length
|
|
|
- );
|
|
|
- });
|
|
|
+ if (res.data) {
|
|
|
+ this.favoritesList = res.data;
|
|
|
+ console.log("--index--" + JSON.stringify(this.favoritesList));
|
|
|
this.finished = true;
|
|
|
} else {
|
|
|
this.$store.commit("toggleLoading", false);
|
|
@@ -87,23 +83,6 @@ export default {
|
|
|
this.$store.commit("toggleLoading", false);
|
|
|
});
|
|
|
},
|
|
|
- // 查询:单个文章的详情
|
|
|
- getFavoritesDetailFun(item, isLast) {
|
|
|
- let path = {
|
|
|
- materialId: item
|
|
|
- };
|
|
|
- this.$_http
|
|
|
- .get(this.$pathParams(this.$_API.JTXT_GET_MATERIAL_MATERIALID, path))
|
|
|
- .then(res => {
|
|
|
- this.favoritesList.push(res.data);
|
|
|
- if (isLast) {
|
|
|
- this.$store.commit("toggleLoading", false);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$store.commit("toggleLoading", false);
|
|
|
- });
|
|
|
- },
|
|
|
onLoad() {},
|
|
|
// 操作:返回
|
|
|
onClickLeft() {
|