Commit f33de8b0 authored by limingzhe's avatar limingzhe

fix: debug

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