feat: 汉字每日打卡页面优化
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { WATER_COLORS } from '../../constants/colors';
|
||||
import { WORDS } from '../../core/data/words';
|
||||
import {
|
||||
WORDS,
|
||||
collectCategoryWords,
|
||||
getCategoryTabIndex,
|
||||
} from '../../core/data/words';
|
||||
import {
|
||||
DrawServiceFactory,
|
||||
type IDrawService,
|
||||
@@ -195,7 +199,7 @@ createPage(
|
||||
/** 随机生成文字卡片 */
|
||||
refreshCardList() {
|
||||
const allWords = WORDS.slice(0, 2).reduce(
|
||||
(acc, cat) => acc.concat(cat.words),
|
||||
(acc, cat) => acc.concat(collectCategoryWords(cat)),
|
||||
[] as string[],
|
||||
);
|
||||
const selected: string[] = [];
|
||||
@@ -312,7 +316,7 @@ createPage(
|
||||
const categoryId = Number(e.currentTarget.dataset.categoryId);
|
||||
this.setData({
|
||||
showSelectWordPopup: true,
|
||||
pickerCurrentTab: categoryId,
|
||||
pickerCurrentTab: getCategoryTabIndex(categoryId),
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user