import React, { useEffect } from 'react'; import classnames from 'classnames'; interface IProps { className?: string; prefixCls?: string; dataSource: any; platform?: number; // 平台:PC:1 H5: 2 snapPlanId: string; snapStepId: string; } /* const data = { "snapStepId": "190", "title": "多受任革活党1多受任革活党1", "classPercent": null, "gradePercent": null, "count": 3, "rightCount": 0, "testCount": 3, "canNext": false, "canWrongTest": true, "wrongTestRounds": 2, "finishPercent": 1.0, "masterPercent": 0.0 } */ const Report: React.FC = (props) => { const { className, prefixCls = 'ewt-homework-words-report', platform = 1, dataSource, children, snapPlanId, snapStepId, } = props; useEffect(() => { if (snapPlanId && snapStepId) { const paperStatusStore = `words_paper_status_${snapPlanId}_${snapStepId}`; if (paperStatusStore) { window.sessionStorage.removeItem(`words_paper_status_${snapPlanId}_${snapStepId}`) } } }, [snapPlanId, snapStepId]) const { title, canNext, masterPercent, rightCount, count, classPercent, gradePercent, testCount } = dataSource; return (
{ Number(masterPercent) >= 70 ? () : () }

本阶段训练完成

{Number(masterPercent) >= 70 ? (

恭喜你击败了本班 {classPercent}% 的同学
本年级 {gradePercent}%的同学

) : (

很遗憾,你本阶段的训练不是很理想 无法挑战下一关,再巩固一下吧

)}

{testCount} 个

训练单词量

{rightCount} 个

回答正确单词数

{masterPercent} %

单词掌握度

{children}
); } export default Report;