|
@@ -23,7 +23,7 @@ import {
|
|
|
Volume2,
|
|
Volume2,
|
|
|
X,
|
|
X,
|
|
|
} from 'lucide-angular';
|
|
} from 'lucide-angular';
|
|
|
-import { catchError, finalize, forkJoin, Observable, of, switchMap } from 'rxjs';
|
|
|
|
|
|
|
+import { catchError, finalize, forkJoin, Observable, of, switchMap, throwError } from 'rxjs';
|
|
|
import { GAME_AUDIO } from '../../core/app.constants';
|
|
import { GAME_AUDIO } from '../../core/app.constants';
|
|
|
import { ApiError, ApiService } from '../../core/api.service';
|
|
import { ApiError, ApiService } from '../../core/api.service';
|
|
|
import {
|
|
import {
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
} from '../../core/anti-forget';
|
|
} from '../../core/anti-forget';
|
|
|
import { AppUser, PageMeta } from '../../core/models';
|
|
import { AppUser, PageMeta } from '../../core/models';
|
|
|
import { canStartTeacherLedLearning, isTeacherLedLearningPath } from '../../core/learning-access';
|
|
import { canStartTeacherLedLearning, isTeacherLedLearningPath } from '../../core/learning-access';
|
|
|
|
|
+import { isLearningStage, learningReturnUrl } from '../../core/learning-navigation';
|
|
|
import { PlatformService } from '../../core/platform.service';
|
|
import { PlatformService } from '../../core/platform.service';
|
|
|
import { SessionService } from '../../core/session.service';
|
|
import { SessionService } from '../../core/session.service';
|
|
|
|
|
|
|
@@ -144,7 +145,6 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
readonly memorySelectedDate = signal('');
|
|
readonly memorySelectedDate = signal('');
|
|
|
readonly orderInfo = signal<SourceItem>({});
|
|
readonly orderInfo = signal<SourceItem>({});
|
|
|
readonly learnedRecord = signal<SourceItem>({});
|
|
readonly learnedRecord = signal<SourceItem>({});
|
|
|
- readonly plRecord = signal<SourceItem>({});
|
|
|
|
|
readonly antiHistory = signal<SourceItem>({});
|
|
readonly antiHistory = signal<SourceItem>({});
|
|
|
readonly myNewWords = signal<SourceItem>({});
|
|
readonly myNewWords = signal<SourceItem>({});
|
|
|
|
|
|
|
@@ -337,6 +337,33 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
return ['pages/stu/stu5', 'pages/stu/pl_stu5'].includes(this.meta.path);
|
|
return ['pages/stu/stu5', 'pages/stu/pl_stu5'].includes(this.meta.path);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ get hasNextWordBatch(): boolean {
|
|
|
|
|
+ const currentPage = Number(this.storageGet('_page_current_learn') ?? 1);
|
|
|
|
|
+ const pages = this.parseArray(this.storageGet('_page_word_orilist'));
|
|
|
|
|
+ return Number.isInteger(currentPage) && currentPage > 0
|
|
|
|
|
+ && Array.isArray(pages[currentPage]) && pages[currentPage].length > 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ get stageActionLabel(): string {
|
|
|
|
|
+ if (this.isMatchingPage) return '进入听音识意';
|
|
|
|
|
+ if (this.isListeningPage) return '进入组合拼写';
|
|
|
|
|
+ if (this.hasNextWordBatch) return '学习下一组单词';
|
|
|
|
|
+ const mode = String(this.storageGet('learn_mode') ?? '');
|
|
|
|
|
+ if (mode === 'newword' || mode === 'history_word') return '完成学习并返回';
|
|
|
|
|
+ return this.meta.path === 'pages/stu/pl_stu5' && !this.query('orderId') ? '保存并结束学习' : '查看学习结果';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ get canReturnToLearningEntry(): boolean {
|
|
|
|
|
+ return isLearningStage(this.meta.path, this.route.snapshot.queryParamMap);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ returnToLearningEntry(): void {
|
|
|
|
|
+ const legacyOrderId = this.meta.path === 'pages/stu/pl_end' ? this.query('id') : '';
|
|
|
|
|
+ const url = legacyOrderId ? `/pages/shop/get_order?id=${encodeURIComponent(legacyOrderId)}`
|
|
|
|
|
+ : learningReturnUrl(this.route.snapshot.queryParamMap, history.state?.learningReturnUrl);
|
|
|
|
|
+ void this.router.navigateByUrl(url, { replaceUrl: true });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
get isReviewPage(): boolean {
|
|
get isReviewPage(): boolean {
|
|
|
return ['pages/stu/stu6', 'pages/stu/pl_end'].includes(this.meta.path);
|
|
return ['pages/stu/stu6', 'pages/stu/pl_end'].includes(this.meta.path);
|
|
|
}
|
|
}
|
|
@@ -729,6 +756,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
continueAfterStage(): void {
|
|
continueAfterStage(): void {
|
|
|
|
|
+ if (this.submitting() || !this.completed()) return;
|
|
|
if (this.isMatchingPage) {
|
|
if (this.isMatchingPage) {
|
|
|
this.completed.set(false);
|
|
this.completed.set(false);
|
|
|
this.navigateStage('/pages/stu/stu4');
|
|
this.navigateStage('/pages/stu/stu4');
|
|
@@ -761,6 +789,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
submitReview(): void {
|
|
submitReview(): void {
|
|
|
|
|
+ if (this.submitting() || !this.words().length) return;
|
|
|
if (this.words().some((word) => this.reviewValue(word) === 0)) {
|
|
if (this.words().some((word) => this.reviewValue(word) === 0)) {
|
|
|
this.platform.toast('请为每个单词选择掌握情况', 'error');
|
|
this.platform.toast('请为每个单词选择掌握情况', 'error');
|
|
|
return;
|
|
return;
|
|
@@ -1044,7 +1073,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
leave(): void {
|
|
leave(): void {
|
|
|
this.clearLearningStorage();
|
|
this.clearLearningStorage();
|
|
|
- void this.router.navigateByUrl('/pages/home/index');
|
|
|
|
|
|
|
+ void this.router.navigateByUrl('/pages/home/index', { replaceUrl: true });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private loadNodes(): void {
|
|
private loadNodes(): void {
|
|
@@ -1177,6 +1206,10 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private initializeStage(source: Word[]): void {
|
|
private initializeStage(source: Word[]): void {
|
|
|
|
|
+ if (!source.length) {
|
|
|
|
|
+ this.error.set('本关暂无单词,请返回重新选择学习内容');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const words = this.isStudyListPage ? source : this.shuffle(source);
|
|
const words = this.isStudyListPage ? source : this.shuffle(source);
|
|
|
this.words.set(words);
|
|
this.words.set(words);
|
|
|
if (this.isStudyListPage) {
|
|
if (this.isStudyListPage) {
|
|
@@ -1233,18 +1266,22 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private finishSpellingFlow(): void {
|
|
private finishSpellingFlow(): void {
|
|
|
- const totalPages = Number(this.storageGet('_page_total_page') ?? 0);
|
|
|
|
|
- const currentPage = Number(this.storageGet('_page_current_learn') ?? 0);
|
|
|
|
|
- if (totalPages > currentPage) {
|
|
|
|
|
|
|
+ const currentPage = Number(this.storageGet('_page_current_learn') ?? 1);
|
|
|
|
|
+ if (this.hasNextWordBatch) {
|
|
|
|
|
+ this.completed.set(false);
|
|
|
this.storageSet('_page_current_learn', currentPage + 1);
|
|
this.storageSet('_page_current_learn', currentPage + 1);
|
|
|
this.navigateStage('/pages/stu/stu_con');
|
|
this.navigateStage('/pages/stu/stu_con');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const mode = String(this.storageGet('learn_mode') ?? '');
|
|
const mode = String(this.storageGet('learn_mode') ?? '');
|
|
|
if (mode === 'newword') {
|
|
if (mode === 'newword') {
|
|
|
- void this.router.navigateByUrl('/pages/member/starshop');
|
|
|
|
|
|
|
+ this.completed.set(false);
|
|
|
|
|
+ this.clearLearningStorage();
|
|
|
|
|
+ void this.router.navigateByUrl('/pages/member/starshop', { replaceUrl: true });
|
|
|
} else if (mode === 'history_word') {
|
|
} else if (mode === 'history_word') {
|
|
|
- void this.router.navigateByUrl('/pages/his/his');
|
|
|
|
|
|
|
+ this.completed.set(false);
|
|
|
|
|
+ this.clearLearningStorage();
|
|
|
|
|
+ void this.router.navigateByUrl('/pages/his/his', { replaceUrl: true });
|
|
|
} else if (this.meta.path === 'pages/stu/pl_stu5') {
|
|
} else if (this.meta.path === 'pages/stu/pl_stu5') {
|
|
|
if (this.query('orderId')) {
|
|
if (this.query('orderId')) {
|
|
|
this.createPracticeLearningRecord();
|
|
this.createPracticeLearningRecord();
|
|
@@ -1339,7 +1376,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
).subscribe({
|
|
).subscribe({
|
|
|
next: () => {
|
|
next: () => {
|
|
|
this.platform.toast('提交成功', 'success');
|
|
this.platform.toast('提交成功', 'success');
|
|
|
- void this.router.navigate(['/pages/member/myorder'], { queryParams: { pnid: this.query('pnid') } });
|
|
|
|
|
|
|
+ void this.router.navigate(['/pages/member/myorder'], { queryParams: { pnid: this.query('pnid') }, replaceUrl: true });
|
|
|
},
|
|
},
|
|
|
error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
|
});
|
|
});
|
|
@@ -1347,34 +1384,41 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
private loadPracticeEnd(): void {
|
|
private loadPracticeEnd(): void {
|
|
|
const orderId = this.query('orderId') || this.query('id');
|
|
const orderId = this.query('orderId') || this.query('id');
|
|
|
- const student = this.session.student();
|
|
|
|
|
- const user = this.session.user();
|
|
|
|
|
- this.api.get<unknown>('e_order_detail', { id: orderId }).subscribe({
|
|
|
|
|
- next: ({ result }) => this.orderInfo.set(this.findList(result)[0] ?? {}),
|
|
|
|
|
- error: () => undefined,
|
|
|
|
|
- });
|
|
|
|
|
- this.api.get<unknown>('content_list', { modelId: 59, psize: 2, myfield2: `yyds=${orderId}|jsmz=${user?.userId}` }).subscribe({
|
|
|
|
|
- next: ({ result }) => this.plRecord.set(this.findList(result)[0] ?? {}),
|
|
|
|
|
- error: () => undefined,
|
|
|
|
|
- });
|
|
|
|
|
- this.api.get<unknown>('content_list', { modelId: 56, psize: 1, myfield2: `UserId=${student?.userId}|dsid=${orderId}` }).subscribe({
|
|
|
|
|
- next: ({ result }) => {
|
|
|
|
|
- const record = this.findList(result)[0] ?? {};
|
|
|
|
|
- this.learnedRecord.set(record);
|
|
|
|
|
- if (!record['GeneralID']) {
|
|
|
|
|
- this.loading.set(false);
|
|
|
|
|
- this.error.set('未找到本次陪练学习记录');
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ const coachId = this.session.user()?.userId;
|
|
|
|
|
+ if (!orderId || !coachId) {
|
|
|
|
|
+ this.loading.set(false);
|
|
|
|
|
+ this.error.set('缺少预约或老师信息,请返回课程重新进入');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.api.get<unknown>('e_order_detail', { id: orderId }).pipe(
|
|
|
|
|
+ switchMap(({ result }) => {
|
|
|
|
|
+ const order = this.findList(result)[0] ?? (result as SourceItem);
|
|
|
|
|
+ const studentId = Number(order?.['szyh'] ?? order?.['yhid'] ?? 0);
|
|
|
|
|
+ if (!studentId) return throwError(() => new ApiError('预约记录缺少学员信息,请返回课程重试'));
|
|
|
|
|
+ this.orderInfo.set(order);
|
|
|
|
|
+ if (this.session.student()?.userId !== studentId) {
|
|
|
|
|
+ this.session.setStudent({ userId: studentId, groupId: 1, honeyName: String(order['HoneyName'] ?? order['honeyName'] ?? '学员') });
|
|
|
}
|
|
}
|
|
|
- this.api.get<unknown>('e_record_detail', { id: record['GeneralID'] }).pipe(finalize(() => this.loading.set(false))).subscribe({
|
|
|
|
|
- next: ({ result: detail }) => this.words.set(this.findList(detail).map((item) => this.toWord(item)).filter((word) => word.word)),
|
|
|
|
|
- error: (error: ApiError) => this.error.set(error.message),
|
|
|
|
|
|
|
+ // Restrict the read to this appointment, its student and the signed-in coach.
|
|
|
|
|
+ return this.api.get<unknown>('content_list', {
|
|
|
|
|
+ modelId: 56, psize: 1,
|
|
|
|
|
+ myfield2: `UserId=${studentId}|dsid=${orderId}|pl=${coachId}`,
|
|
|
});
|
|
});
|
|
|
|
|
+ }),
|
|
|
|
|
+ switchMap(({ result }) => {
|
|
|
|
|
+ const record = this.findList(result)[0] ?? {};
|
|
|
|
|
+ this.learnedRecord.set(record);
|
|
|
|
|
+ if (!record['GeneralID']) return throwError(() => new ApiError('未找到本次陪练学习记录,请返回课程重试'));
|
|
|
|
|
+ return this.api.get<unknown>('e_record_detail', { id: record['GeneralID'] });
|
|
|
|
|
+ }),
|
|
|
|
|
+ finalize(() => this.loading.set(false)),
|
|
|
|
|
+ ).subscribe({
|
|
|
|
|
+ next: ({ result }) => {
|
|
|
|
|
+ const words = this.findList(result).map((item) => this.toWord(item)).filter((word) => word.word);
|
|
|
|
|
+ this.words.set(words);
|
|
|
|
|
+ this.reviewState.set(Object.fromEntries(words.map((word) => [word.id, Number(word['check']) === 1 ? 1 : Number(word['check']) === 2 ? 2 : 0])));
|
|
|
},
|
|
},
|
|
|
- error: (error: ApiError) => {
|
|
|
|
|
- this.loading.set(false);
|
|
|
|
|
- this.error.set(error.message);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ error: (error: ApiError) => this.error.set(error.message),
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1397,60 +1441,16 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
addon: JSON.stringify(addon),
|
|
addon: JSON.stringify(addon),
|
|
|
}).pipe(finalize(() => this.submitting.set(false))).subscribe({
|
|
}).pipe(finalize(() => this.submitting.set(false))).subscribe({
|
|
|
next: () => {
|
|
next: () => {
|
|
|
- void this.platform.confirm('即将结束本次学习,确认继续?').then((confirmed) => {
|
|
|
|
|
- if (confirmed) this.endPracticeOrder();
|
|
|
|
|
|
|
+ this.clearLearningStorage();
|
|
|
|
|
+ void this.router.navigate(['/pages/shop/get_order'], {
|
|
|
|
|
+ queryParams: { id: this.query('orderId') || this.query('id'), feedback: '1' },
|
|
|
|
|
+ replaceUrl: true,
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private endPracticeOrder(): void {
|
|
|
|
|
- const orderId = this.query('orderId') || this.query('id');
|
|
|
|
|
- const content = { GeneralID: orderId, UpDateTime: this.dateTime() };
|
|
|
|
|
- this.submitting.set(true);
|
|
|
|
|
- this.api.post('e_order_update_v2', { status: 11, uid: this.session.user()?.userId, content: JSON.stringify(content) }).subscribe({
|
|
|
|
|
- next: () => this.savePracticeSession(),
|
|
|
|
|
- error: (error: ApiError) => {
|
|
|
|
|
- this.submitting.set(false);
|
|
|
|
|
- this.platform.toast(error.message, 'error');
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private savePracticeSession(): void {
|
|
|
|
|
- const student = this.session.student();
|
|
|
|
|
- const user = this.session.user();
|
|
|
|
|
- const order = this.orderInfo();
|
|
|
|
|
- const content: SourceItem = {
|
|
|
|
|
- ModelID: 59,
|
|
|
|
|
- nodeId: 296,
|
|
|
|
|
- inputer: user?.honeyName,
|
|
|
|
|
- status: 99,
|
|
|
|
|
- Hits: 0,
|
|
|
|
|
- title: student?.honeyName,
|
|
|
|
|
- };
|
|
|
|
|
- let action = 'content_add';
|
|
|
|
|
- if (this.plRecord()['GeneralID']) {
|
|
|
|
|
- content['GeneralID'] = this.plRecord()['GeneralID'];
|
|
|
|
|
- action = 'content_update';
|
|
|
|
|
- }
|
|
|
|
|
- const addon = {
|
|
|
|
|
- jsmz: user?.userId,
|
|
|
|
|
- kcid: order['kcid'],
|
|
|
|
|
- xymz: student?.userId,
|
|
|
|
|
- kclx: order['dslx_t'],
|
|
|
|
|
- yyds: this.query('orderId') || this.query('id'),
|
|
|
|
|
- jffs: order['jffs'],
|
|
|
|
|
- kcmc: order['kcmc'],
|
|
|
|
|
- szmdid: order['szmd'],
|
|
|
|
|
- };
|
|
|
|
|
- this.api.post(action, { content: JSON.stringify(content), addon: JSON.stringify(addon) }).pipe(finalize(() => this.submitting.set(false))).subscribe({
|
|
|
|
|
- next: () => void this.router.navigate(['/pages/shop/get_order'], { queryParams: { id: this.query('orderId') || this.query('id') } }),
|
|
|
|
|
- error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
private createPracticeLearningRecord(): void {
|
|
private createPracticeLearningRecord(): void {
|
|
|
const allWords = this.readAllLearningWords();
|
|
const allWords = this.readAllLearningWords();
|
|
|
const user = this.session.user();
|
|
const user = this.session.user();
|
|
@@ -1525,7 +1525,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
next: () => {
|
|
next: () => {
|
|
|
this.clearLearningStorage();
|
|
this.clearLearningStorage();
|
|
|
this.platform.toast('学习记录已保存', 'success');
|
|
this.platform.toast('学习记录已保存', 'success');
|
|
|
- void this.router.navigateByUrl('/pages/his/his');
|
|
|
|
|
|
|
+ void this.router.navigateByUrl('/pages/his/his', { replaceUrl: true });
|
|
|
},
|
|
},
|
|
|
error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
error: (error: ApiError) => this.platform.toast(error.message, 'error'),
|
|
|
});
|
|
});
|
|
@@ -1745,6 +1745,8 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
this.storageSet('_page_word_orilist', pages);
|
|
this.storageSet('_page_word_orilist', pages);
|
|
|
sessionStorage.setItem('xiaoshu.selectedWords', JSON.stringify(pages[0] ?? chosen));
|
|
sessionStorage.setItem('xiaoshu.selectedWords', JSON.stringify(pages[0] ?? chosen));
|
|
|
void this.router.navigate(['/pages/stu/stu_con'], {
|
|
void this.router.navigate(['/pages/stu/stu_con'], {
|
|
|
|
|
+ replaceUrl: true,
|
|
|
|
|
+ state: { learningReturnUrl: this.router.url },
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
nids: this.query('nids') || this.query('nid'),
|
|
nids: this.query('nids') || this.query('nid'),
|
|
|
pnid: this.query('pnid'),
|
|
pnid: this.query('pnid'),
|
|
@@ -1755,6 +1757,8 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
private navigateStage(path: string): void {
|
|
private navigateStage(path: string): void {
|
|
|
void this.router.navigate([path], {
|
|
void this.router.navigate([path], {
|
|
|
|
|
+ replaceUrl: true,
|
|
|
|
|
+ state: { learningReturnUrl: history.state?.learningReturnUrl },
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
nid: this.query('nid'),
|
|
nid: this.query('nid'),
|
|
|
nids: this.query('nids'),
|
|
nids: this.query('nids'),
|
|
@@ -1765,18 +1769,18 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private readLearningWords(): Word[] {
|
|
private readLearningWords(): Word[] {
|
|
|
- const totalPages = Number(this.storageGet('_page_total_page') ?? 0);
|
|
|
|
|
const currentPage = Number(this.storageGet('_page_current_learn') ?? 1);
|
|
const currentPage = Number(this.storageGet('_page_current_learn') ?? 1);
|
|
|
- if (totalPages > 0) {
|
|
|
|
|
- const pages = this.parseArray(this.storageGet('_page_word_orilist'));
|
|
|
|
|
|
|
+ const pages = this.parseArray(this.storageGet('_page_word_orilist'));
|
|
|
|
|
+ if (pages.length) {
|
|
|
const page = pages[currentPage - 1];
|
|
const page = pages[currentPage - 1];
|
|
|
- if (Array.isArray(page)) {
|
|
|
|
|
|
|
+ if (Number.isInteger(currentPage) && currentPage > 0 && Array.isArray(page)) {
|
|
|
const mode = String(this.storageGet('learn_mode') ?? '');
|
|
const mode = String(this.storageGet('learn_mode') ?? '');
|
|
|
const key = mode === 'newword' ? 'choose_newword_learn' : mode === 'history_word' ? 'choose_hisword_learn' : 'choose_word_learn';
|
|
const key = mode === 'newword' ? 'choose_newword_learn' : mode === 'history_word' ? 'choose_hisword_learn' : 'choose_word_learn';
|
|
|
this.storageSet(key, page);
|
|
this.storageSet(key, page);
|
|
|
sessionStorage.setItem('xiaoshu.selectedWords', JSON.stringify(page));
|
|
sessionStorage.setItem('xiaoshu.selectedWords', JSON.stringify(page));
|
|
|
return page.map((item) => this.toWord(item as SourceItem));
|
|
return page.map((item) => this.toWord(item as SourceItem));
|
|
|
}
|
|
}
|
|
|
|
|
+ return [];
|
|
|
}
|
|
}
|
|
|
const mode = String(this.storageGet('learn_mode') ?? '');
|
|
const mode = String(this.storageGet('learn_mode') ?? '');
|
|
|
const key = mode === 'newword' ? 'choose_newword_learn' : mode === 'history_word' ? 'choose_hisword_learn' : 'choose_word_learn';
|
|
const key = mode === 'newword' ? 'choose_newword_learn' : mode === 'history_word' ? 'choose_hisword_learn' : 'choose_word_learn';
|