Commit f33de8b0 authored by limingzhe's avatar limingzhe

fix: debug

parent 01c7e034
...@@ -53,7 +53,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -53,7 +53,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
curBookWords = []; curBookWords = [];
selectedWord: any; selectedWord: any;
courseId; bookTextList = [];
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef, constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef,
...@@ -64,10 +64,8 @@ courseId; ...@@ -64,10 +64,8 @@ courseId;
ngOnInit() { ngOnInit() {
this.courseId = this.getCourseIdFromUrl(); this.getBookTextLis();
if (this.courseId) {
console.log('courseId: ', this.courseId);
}
this.item = {}; this.item = {};
...@@ -633,25 +631,16 @@ getUnusedWord(ques: any): any { ...@@ -633,25 +631,16 @@ getUnusedWord(ques: any): any {
}, 1); }, 1);
} }
/** getBookTextLis() {
* 从URL中获取course_id参数
* @returns course_id的值,如果不存在则返回null
*/
getCourseIdFromUrl(): string | null {
const queryString = window.location.search;
if (!queryString) {
return null;
}
// 移除开头的 '?' 并分割参数 if ((<any>window).courseware.getPictureBookTextList) {
const params = queryString.substring(1).split('&');
// 查找course_id参数 (<any>window).courseware.getPictureBookTextList((data) => {
for (const param of params) { console.log('getPictureBookTextList data: ', data);
const [key, value] = param.split('=');
if (key === 'course_id') { });
return decodeURIComponent(value); } else {
} console.log('not find getPictureBookTextList');
} }
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment