1
0

page.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3. import './index.less';
  4. import Assets from '@src/components/Assets';
  5. import Page from '@src/containers/Page';
  6. import Button from '../../../components/Button';
  7. import Navigation from '../../../components/Navigation';
  8. import Answer from '../../../components/Answer';
  9. import Calculator from '../../../components/Calculator';
  10. import AnswerSelect from '../../../components/AnswerSelect';
  11. import AnswerTable from '../../../components/AnswerTable';
  12. export default class extends Page {
  13. initState() {
  14. return { showCalculator: false };
  15. }
  16. renderView() {
  17. return this.renderDetail();
  18. }
  19. initData() {
  20. setTimeout(() => {
  21. ReactDOM.render(
  22. <AnswerSelect list={[{ title: '123' }, { title: '321' }]} />,
  23. document.getElementById('#select#'),
  24. );
  25. ReactDOM.render(
  26. <AnswerTable
  27. list={[{ title: '123' }, { title: '321' }]}
  28. columns={[{ key: 'one', title: 'one' }, { key: 'two', title: 'two' }]}
  29. data={[{ one: '123', two: '321' }]}
  30. />,
  31. document.getElementById('#table#'),
  32. );
  33. }, 1);
  34. }
  35. renderCotent() {
  36. return (
  37. <div className="block block-content">
  38. <Navigation list={['Sports Association', 'News Orgnization', 'News Orgnization']} onChange={() => {}} />
  39. <div className="text">
  40. For each of the following statements, select Both accept if, based on the information provided, it can be
  41. inferred that both the sports association and the news organizations would likely accept that the statement is
  42. true. If not, select Otherwise.
  43. <span id="#table#" />
  44. For each of the following statements, select Both accept if, based on the information provided, it can be
  45. inferred <span id="#select#" />
  46. that both the sports association and the news organizations would likely accept that the statement is true. If
  47. not, select Otherwise.
  48. </div>
  49. </div>
  50. );
  51. }
  52. renderAnswer() {
  53. return (
  54. <div className="block block-answer">
  55. <div className="text m-b-2">
  56. For each of the following statements, select Both accept if, based on the information provided, it can be
  57. inferred that both the sports association and the news organizations would likely accept that the statement is
  58. true. If not, select Otherwise.{' '}
  59. </div>
  60. <Answer
  61. list={[
  62. 'Neuroscientists, having amassed a wealth of knowledge',
  63. 'the past twenty years about the brain and its development from birth to adulthood',
  64. 'Neuroscientists, having amassed a wealth of knowledge',
  65. 'the past twenty years about the brain and its development from birth to adulthood, ) the past twenty years about the brain and its development from birth to adulthood',
  66. ]}
  67. />
  68. </div>
  69. );
  70. }
  71. renderDetail() {
  72. const { showCalculator } = this.state;
  73. return (
  74. <div className="layout">
  75. <div className="fixed">
  76. Analytical Writing Assessment
  77. <Assets
  78. className="calculator-icon"
  79. name="calculator_icon"
  80. onClick={() => this.setState({ showCalculator: !showCalculator })}
  81. />
  82. <Assets className="collect-icon" name="collect_icon" />
  83. </div>
  84. <Calculator show={showCalculator} />
  85. <div className="layout-header">
  86. <div className="title">OG18:1-20</div>
  87. <div className="right">
  88. <div className="block">
  89. <Assets name="timeleft_icon" />
  90. Time left 00:02
  91. </div>
  92. <div className="block">
  93. <Assets name="subjectnumber_icon" />1 of 20
  94. </div>
  95. </div>
  96. </div>
  97. <div className="layout-body two">
  98. {this.renderCotent()}
  99. {this.renderAnswer()}
  100. </div>
  101. <div className="layout-footer">
  102. <div className="help">
  103. <Assets name="help_icon" />
  104. Help
  105. </div>
  106. <div className="full">
  107. <Assets name="fullscreen_icon" />
  108. </div>
  109. <div className="next">
  110. Next
  111. <Assets name="next_icon" />
  112. </div>
  113. </div>
  114. </div>
  115. );
  116. }
  117. renderStart() {
  118. return (
  119. <div className="start">
  120. <div className="bg" />
  121. <div className="fixed-content">
  122. <div className="title">「练习」OG18 综合:第1-20题</div>
  123. <div className="desc">
  124. <div className="block">
  125. <div className="desc-title">
  126. <Assets name="subject_icon" />
  127. 题目总数
  128. </div>
  129. <div className="desc-info">20</div>
  130. </div>
  131. <div className="block">
  132. <div className="desc-title">
  133. <Assets name="time_icon" />
  134. 建议用时
  135. </div>
  136. <div className="desc-info">20 min</div>
  137. </div>
  138. </div>
  139. <div className="tip">题目选项乱序显示</div>
  140. <div className="submit">
  141. <Button size="lager" radius>
  142. 开始练习
  143. </Button>
  144. </div>
  145. </div>
  146. </div>
  147. );
  148. }
  149. }