index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import React from 'react';
  2. import Assets from '@src/components/Assets';
  3. import { formatDate, formatPercent } from '@src/services/Tools';
  4. import './index.less';
  5. import Button from '../Button';
  6. function Continue(props) {
  7. const { data = {}, onContinue, onRestart, onClose } = props;
  8. const { updateTime, paper = {}, userNumber, questionNumber } = data;
  9. return (
  10. <div className="continue">
  11. <div className="body">
  12. <div className="left">
  13. <div className="text">上次做题</div>
  14. <div className="date">{updateTime && formatDate(updateTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  15. </div>
  16. <div className="center">
  17. <div className="text">{paper.title} {formatPercent(userNumber, questionNumber, false)}</div>
  18. <div className="list">
  19. {userNumber < questionNumber && <Button radius theme="border" size="small" onClick={() => {
  20. onContinue();
  21. }}>
  22. <Assets name="ico_24_continue" svg />
  23. Continue
  24. </Button>}
  25. {userNumber <= questionNumber && <Button radius theme="border" size="small" onClick={() => {
  26. onRestart();
  27. }}>
  28. <Assets name="ico_24_restart" svg />
  29. Restart
  30. </Button>}
  31. {/* {userNumber < questionNumber && <Button radius theme="border" size="small" onClick={() => {
  32. onNext();
  33. }}>
  34. <Assets name="ico_24_next" svg />
  35. Next
  36. </Button>} */}
  37. </div>
  38. </div>
  39. <div className="right">
  40. <Assets name="close" svg onClick={() => {
  41. onClose();
  42. }} />
  43. </div>
  44. </div>
  45. </div>
  46. );
  47. }
  48. Continue.propTypes = {};
  49. export default Continue;