Files
doodle-mini/miniprogram/constants/mathFunctions.ts
T
2025-12-15 17:00:06 +08:00

147 lines
3.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export interface MathFunctionType {
id: string;
page?: string;
title: string;
desc: string;
icon: string;
}
export const MATH_FUNCTION_TYPES: MathFunctionType[] = [
// 第一阶段:认识数字(最基础)
{
id: 'number-find',
page: 'numberFind',
title: '找数字,涂一涂',
desc: '找一找下面相同的数字,涂上颜色',
icon: '🔍',
},
{
id: 'number-write',
page: 'numberFind',
title: '看数字,写一写',
desc: '看数字,按笔画顺序写一写',
icon: '✏️',
},
{
id: 'number-coloring',
page: 'countMatch',
title: '按数字,涂颜色',
desc: '按数字给相应的圆圈涂上颜色',
icon: '🎨',
},
// 第二阶段:数数与计数
{
id: 'counting-matching',
page: 'countMatch',
title: '数一数,连一连',
desc: '通过连线配对数字和对应的数量图形',
icon: '🔗',
},
{
id: 'counting-select',
page: 'countingSelect',
title: '数一数,选一选',
desc: '数出物品数量,圈出正确答案',
icon: '✓',
},
{
id: 'counting-fill',
page: 'countingSelect',
title: '数一数,填一填',
desc: '数出物品数量,填写对应的数字',
icon: '✏️',
},
{
id: 'compare',
page: 'compare',
title: '数一数,比大小',
desc: '比较数量大小,在 ⭕️ 中填入>、<、=',
icon: '⚖️',
},
// 第三阶段:数字序列
{
id: 'missing-number',
page: 'missingNumber',
title: '填上缺少的数字',
desc: '在数字序列中找出并填写缺失的数字',
icon: '❓',
},
{
id: 'number-decompose',
page: 'numberDecompose',
title: '10以内数的分与合',
desc: '把数字分一分,合一合',
icon: '🔢',
},
// 第四阶段:简单运算(从易到难)
{
id: 'addition-5',
page: 'addition',
title: '5以内加法',
desc: '练习5以内的加法运算,图形化展示',
icon: '',
},
{
id: 'addition-10',
page: 'addition',
title: '10以内加法',
desc: '练习10以内的加法运算,图形化展示',
icon: '',
},
{
id: 'subtraction-10',
page: 'addition',
title: '10以内减法',
desc: '练习10以内的减法运算,图形化展示',
icon: '',
},
{
id: 'addition-subtraction-10',
page: 'addition',
title: '10以内加减法',
desc: '练习10以内的加法和减法混合运算',
icon: '±',
},
{
id: 'number-decompose-20',
page: 'numberDecompose',
title: '20以内数的分与合',
desc: '把数字分一分,合一合',
icon: '🔢',
},
];
/**
* 数字颜色映射(柔和12色)
* 用于数学页面的数字显示和涂色
*/
export const NUMBER_COLORS: Record<number, string> = {
1: '#ED6D50', // 柔和红色
2: '#F9A857', // 柔和橙色
3: '#FFE176', // 柔和黄色
4: '#B2D94B', // 柔和黄绿色
5: '#53D1B6', // 柔和绿色
6: '#6CD2EA', // 柔和青色
7: '#79A7ED', // 柔和蓝色
8: '#9C98DE', // 柔和紫色
9: '#F2A4C0', // 柔和粉色
10: '#FC9B6C', // 柔和橙红色
11: '#BC8F71', // 柔和棕色
12: '#666666', // 柔和黑灰
};
/**
* 获取所有数字颜色数组
*/
export function getNumberColors(): string[] {
return Object.values(NUMBER_COLORS);
}
/**
* 随机获取一个数字颜色
*/
export function getRandomNumberColor(): string {
const colors = getNumberColors();
return colors[Math.floor(Math.random() * colors.length)];
}