Files
reader-star/apps/admin/src/views/user/data/mock.ts
rjl b71a758474 feat(user): 重构用户端竞赛流程并添加新页面
- 将原单页竞赛流程拆分为独立路由页面(首页、封面、规则、抽题、答题、图解、组别、队伍)
- 新增 Pinia store 管理竞赛状态、计时器和音频控制
- 添加 SCSS 变量文件定义主题色
- 更新路由配置和类型定义以支持新页面结构
- 重构 QuestionRenderer 组件优化样式
- 添加图标依赖并更新国际化配置
- 移动图片资源到用户目录并清理旧文件
2026-02-06 17:45:44 +08:00

224 lines
7.4 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.

import type { CompetitionData } from '../types'
import img from '@/assets/imgs/user/q5-img.png'
/**
* 模拟数据
* 真实后端数据可能是:
* 活动详情接口传活动id 获取 流程nodes
* 每次可能只返回一个n1前端先展示n1用户点击“抽题”后再请求n2。其中questions 可能不是在n1就返回而是点击抽提时候 传nodeId 去随机获取后前端保存
* 1. 包含 3 个节点N1, N2, N3
* 2. 每个节点包含 2 个批次(汉字听一听, 汉字加一加)
* 3. 每个批次包含 2 个问题Q1, Q2, Q3, Q4, Q5
*/
export const mockData: CompetitionData = {
activityInfo: {
name: '星·辞海遨游',
},
nodes: [
{
nodeId: 'N3',
roundTitle: '第二轮',
moduleName: '诗词理解',
batchName: '选择题',
description: '请选择正确的选项时间为30秒。',
uiTemplate: 'TEMPLATE_POETRY_MULTIPLE_CHOICE',
config: { timeLimit: 300, questionCount: 2, scorePerQuestion: 2 },
questions: [
{
id: 'Q3',
content: {
title: '《闻王昌龄左迁龙标遥有此寄》中,“左迁”的意思是()',
options: [
{ label: 'A', text: '贬官,降职', image: img },
{ label: 'B', text: '搬家', image: img },
{ label: 'C', text: '一路向西游玩', image: img },
],
},
answer: ['A'],
},
{
id: 'Q4',
content: {
title: '《静夜思》中,“举头望明月”的下一句是()',
options: [
{ label: 'A', text: '低头思故乡', image: img },
{ label: 'B', text: '疑是地上霜', image: img },
],
},
answer: ['A'],
},
],
},
{
nodeId: 'N1',
roundTitle: '第一轮',
moduleName: '汉字听一听',
batchName: '根据提示写汉字',
description: '请根据汉语拼音提示书写正确的汉字时间为15秒。',
uiTemplate: 'TEMPLATE_DICTATION_HINT',
config: { timeLimit: 5, questionCount: 2, scorePerQuestion: 1 },
questions: [
{
id: 'Q1',
content: {
title: 'jiū,表示小鸟的叫声',
meta: { hint: '表示小鸟的叫声' },
},
answer: ['啾'],
},
{
id: 'Q2',
content: {
title: 'yāo',
meta: { hint: '形容草木茂盛美丽' },
},
answer: ['夭'],
},
],
},
{
nodeId: 'N2',
roundTitle: '第二轮',
moduleName: '汉字听一听',
batchName: '同音字',
description: '诗词理解',
uiTemplate: 'TEMPLATE_DICTATION_HOMOPHONE',
config: { timeLimit: 5, questionCount: 2, scorePerQuestion: 1 },
questions: [
{
id: 'Q3',
content: { title: 'táng' },
answer: ['唐', '塘', '糖', '搪', '溏', '瑭', '鄌', '螗', '糖', '堂', '膛', '螳', '鄳', '樘', '镗', '棠', '饧'],
},
{
id: 'Q4',
content: { title: 'jù' },
answer: ['剧', '据', '巨', '拒', '聚', '炬', '距', '惧', '具', '俱', '沮', '咀', '矩', '锯'],
},
],
},
{
nodeId: 'N4',
roundTitle: '第三轮',
moduleName: '汉字加一加',
batchName: '部件组合',
description: '请写出含有指定部件的汉字时间为60秒。',
uiTemplate: 'TEMPLATE_COMPONENT_ADD',
config: { timeLimit: 5, questionCount: 1, scorePerQuestion: 1 },
questions: [
{
id: 'Q5',
content: { title: '车' },
answer: ['辆', '轿', '转', '软', '轮', '辐', '输', '轨', '轩', '轻', '轶', '辄', '轴', '轧', '轼', '辊', '辕', '辙', '辍', '辗', '轸', '轭', '辚', '辖', '较', '辘', '轫', '轵', '辋', '轲', '轺', '臻', '软', '辌', '轷', '轻', '辁', '辒', '蚺', '韫', '轱', '辂', '轻', '轹', '辅', '舻', '辐', '斩', '连', '阵', '军', '轰', '库', '辈', '载', '辈', '晕', '辔'],
},
],
},
{
nodeId: 'N5',
roundTitle: '第四轮',
moduleName: '词语听写',
batchName: '拼音写词',
description: '请根据汉语拼音提示书写正确的词语时间为30秒。',
uiTemplate: 'TEMPLATE_WORD_DICTATION',
config: { timeLimit: 5, questionCount: 2, scorePerQuestion: 2 },
questions: [
{
id: 'Q6',
content: {
title: 'zhì rè',
meta: { hint: '形容温度极高' },
},
answer: ['炙热'],
},
{
id: 'Q7',
content: {
title: 'hào hàn',
meta: { hint: '形容广大繁多' },
},
answer: ['浩瀚'],
},
],
},
{
nodeId: 'N6',
roundTitle: '第五轮',
moduleName: '成语写一写',
batchName: '文字要求',
description: '请根据要求书写正确的成语时间为60秒。',
uiTemplate: 'TEMPLATE_IDIOM_TEXT_REQ',
config: { timeLimit: 5, questionCount: 1, scorePerQuestion: 1 },
questions: [
{
id: 'Q8',
content: { title: '请写出含有反义字的四字成语。' },
answer: ['七上八下', '前因后果', '大同小异', '东张西望', '左顾右盼', '南辕北辙', '深入浅出', '出生入死', '死去活来', '天翻地覆', '黑白分明'],
},
],
},
{
nodeId: 'N7',
roundTitle: '第六轮',
moduleName: '成语写一写',
batchName: '看图写成语',
description: '请根据图片书写正确的成语时间为30秒。',
uiTemplate: 'TEMPLATE_IDIOM_IMAGE',
config: { timeLimit: 30, questionCount: 2, scorePerQuestion: 2 },
questions: [
{
id: 'Q9',
content: {
title: '',
titleImage: img,
meta: { hint: '比喻事情已定' },
},
answer: ['板上钉钉'],
},
{
id: 'Q10',
content: {
title: '',
titleImage: img,
meta: { hint: '比喻事情已定' },
},
answer: ['板上钉钉'],
},
],
},
{
nodeId: 'N8',
roundTitle: '第七轮',
moduleName: '汉字辨析',
batchName: '选字填空',
description: '请选择正确的汉字填入括号中。',
uiTemplate: 'TEMPLATE_POETRY_MULTIPLE_CHOICE',
config: { timeLimit: 20, questionCount: 1, scorePerQuestion: 2 },
questions: [
{
id: 'Q11',
content: {
title: '下列哪个字是“没”的繁体字?',
options: [
{ label: 'A', text: '没', renderType: 'tianzige' },
{ label: 'B', text: '沒', renderType: 'tianzige' },
{ label: 'C', text: '殁', renderType: 'tianzige' },
],
},
answer: ['B'],
},
],
},
],
}
export const uiTemplatesMapping = {
TEMPLATE_DICTATION_HINT: '汉字听写-提示',
TEMPLATE_DICTATION_HOMOPHONE: '汉字听写-同音',
TEMPLATE_COMPONENT_ADD: '汉字加一加',
TEMPLATE_WORD_DICTATION: '词语听写',
TEMPLATE_IDIOM_TEXT_REQ: '成语-文字要求',
TEMPLATE_IDIOM_IMAGE: '成语-看图',
TEMPLATE_POETRY_MULTIPLE_CHOICE: '诗词理解-选择题',
}