|
@@ -7,12 +7,10 @@
|
|
|
:key="index"
|
|
|
:title="item.name"
|
|
|
>
|
|
|
- <PageLearnChild
|
|
|
- :isFirstGroup="index === 0"
|
|
|
- :swiperList="swiperList"
|
|
|
- :learnChildList="learnChildList"
|
|
|
- >
|
|
|
+ <PageLearnChild v-if="index !== 0" :learnChildList="learnChildList">
|
|
|
</PageLearnChild>
|
|
|
+ <PageLearnRecommend v-if="index === 0" :swiperList="swiperList">
|
|
|
+ </PageLearnRecommend>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
</div>
|
|
@@ -24,6 +22,9 @@ export default {
|
|
|
components: {
|
|
|
PageLearnChild: resolve => {
|
|
|
require(["./page-learn-child"], resolve);
|
|
|
+ },
|
|
|
+ PageLearnRecommend: resolve => {
|
|
|
+ require(["./page-learn-recommend"], resolve);
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -56,7 +57,9 @@ export default {
|
|
|
this.$_http
|
|
|
.get(this.$_API.JTXT_GET_CATEGORIES)
|
|
|
.then(res => {
|
|
|
- this.learnRootList = res.data;
|
|
|
+ // 第一个添加推荐
|
|
|
+ this.learnRootList = [{ id: "0", name: "推荐", parentId: null }];
|
|
|
+ this.learnRootList = [...this.learnRootList, ...res.data];
|
|
|
// 查询子目录
|
|
|
this.getChildList();
|
|
|
})
|
|
@@ -66,6 +69,9 @@ export default {
|
|
|
},
|
|
|
// 查询子目录
|
|
|
getChildList() {
|
|
|
+ if (this.choosedRootIndex === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
let path = {
|
|
|
categoryId: this.learnRootList[this.choosedRootIndex].id
|
|
|
};
|