Sfoglia il codice sorgente

:feature: 导学内课程不做权限验证

zhanghe 6 anni fa
parent
commit
2c91545971

+ 1 - 1
src/stage/index/scene/CLScene.js

@@ -306,7 +306,7 @@ class CLScene extends scene {
             return;
             return;
         }
         }
         // 进入课程详情场景
         // 进入课程详情场景
-        this.showScene(require(`./CourseScene.js`), { id });
+        this.showScene(require(`./CourseScene.js`), { id, sceneName: this.sceneType });
     }
     }
 
 
     onBack() {
     onBack() {

+ 7 - 4
src/stage/index/scene/CourseScene.js

@@ -19,9 +19,11 @@ class CourseScene extends scene {
 		this.id = 1;
 		this.id = 1;
 		this.isFirst = true;
 		this.isFirst = true;
 		this.marquee = null;
 		this.marquee = null;
-	    //course name
-	    this.title = '';
-	    this.isBought = false;
+    //course name
+    this.title = '';
+    this.isBought = false;
+		//scene name
+		this.sceneName = '';
 	}
 	}
 
 
 	generateCourseDetailTitle(itemTitle, secondTitle){
 	generateCourseDetailTitle(itemTitle, secondTitle){
@@ -291,6 +293,7 @@ class CourseScene extends scene {
 	onCreate(data) {
 	onCreate(data) {
 		this.setContentView(require('../../../res/tpl/CourseScene.tpl'), {}, 'CourseScene', {}, () => {
 		this.setContentView(require('../../../res/tpl/CourseScene.tpl'), {}, 'CourseScene', {}, () => {
 			this.id = data.id;
 			this.id = data.id;
+			this.sceneName = data.sceneName;
 			NotificationCenter.add('course_detail', this.detailObserver.bind(this));
 			NotificationCenter.add('course_detail', this.detailObserver.bind(this));
 			NotificationCenter.add('course_status', this.courseStatusObserver.bind(this));
 			NotificationCenter.add('course_status', this.courseStatusObserver.bind(this));
 			// check course is blank
 			// check course is blank
@@ -336,7 +339,7 @@ class CourseScene extends scene {
 
 
 	//检查对课权限
 	//检查对课权限
 	isAuthorized(lessonSeq) {
 	isAuthorized(lessonSeq) {
-		if (this.isBought) {
+		if (this.sceneName === 'guidance' || this.isBought) {
 		  //is bought
 		  //is bought
 		  return true;
 		  return true;
 	  } else if (0 === lessonSeq) {
 	  } else if (0 === lessonSeq) {