he2802 пре 4 година
родитељ
комит
5b5ae01864
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      pages2/course/detail.vue

+ 6 - 4
pages2/course/detail.vue

@@ -228,18 +228,20 @@ export default {
 			payStatus: true, //是否购买该课程
 			commendList: [], //推荐课程列表
 			collecStatus: false, //收藏状态
-			initH4: 0
+			initH4: 0,
+			id:0
 		};
 	},
 	onLoad(option) {
 		const Verify = require('@/wxcomponents/verify_mpsdk/main.js');
 		Verify.init();
+		this.id = option.id
 		this.$api.courseInfo(option.id).then(res => {
 			this.queryData = res.data.data;
 			this.getTeacher(res.data.data.teacherIds);
-			this.getChapter(res.data.data.courseId);
-			this.getcommendList(res.data.data.courseId);
 		});
+		this.getChapter(this.id);
+		this.getcommendList(this.id);
 	},
 	onShow() {
 		if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
@@ -329,7 +331,7 @@ export default {
 				.exec();
 		},
 		favoritesStatus() {
-			this.$api.coursecollectPD(this.queryData.courseId).then(result => {
+			this.$api.coursecollectPD(this.id).then(result => {
 				if (result.data.data === undefined) {
 					this.collecStatus = false;
 				} else {