|
@@ -33,7 +33,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { pathParams } from "@/utils/tools";
|
|
|
export default {
|
|
|
name: "page-learn-child",
|
|
|
components: {},
|
|
@@ -63,7 +62,7 @@ export default {
|
|
|
"learnChildList.length": {
|
|
|
handler(newValue, oldValue) {
|
|
|
if (oldValue === 0 && newValue !== 0) {
|
|
|
- this.getChildList();
|
|
|
+ this.getContentList();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -72,15 +71,20 @@ export default {
|
|
|
childChange(index) {
|
|
|
this.finished = false;
|
|
|
this.choosedChildIndex = index;
|
|
|
- this.getChildList();
|
|
|
+ this.getContentList();
|
|
|
},
|
|
|
// 查询子目录
|
|
|
- getChildList() {
|
|
|
+ getContentList() {
|
|
|
let path = {
|
|
|
categoryId: this.learnChildList[this.choosedChildIndex].id
|
|
|
};
|
|
|
this.$_http
|
|
|
- .get(pathParams(this.$_API.JTXT_GET_CATEGORIES_CATEGROYID, path))
|
|
|
+ .get(
|
|
|
+ this.$pathParams(
|
|
|
+ this.$_API.JTXT_GET_CATEGORIES_CATEGROYID_MATERIALS,
|
|
|
+ path
|
|
|
+ )
|
|
|
+ )
|
|
|
.then(res => {
|
|
|
this.contentList = res.data;
|
|
|
// 移除第一个
|
|
@@ -94,7 +98,10 @@ export default {
|
|
|
},
|
|
|
onLoad() {},
|
|
|
chooseContent(index) {
|
|
|
- this.$router.push({ name: "learn-content" });
|
|
|
+ this.$router.push({
|
|
|
+ name: "learn-content",
|
|
|
+ params: { materialId: this.contentList[index].id }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|