Pārlūkot izejas kodu

feat(front): 备考

Go 5 gadi atpakaļ
vecāks
revīzija
2f82931977

+ 2 - 2
front/project/www/components/Date/index.js

@@ -29,11 +29,11 @@ export default class extends Component {
   }
 
   render() {
-    const { hideInput, disabledDate, value, onChange } = this.props;
+    const { show, hideInput, disabledDate, value, onChange } = this.props;
     return (
       <div className={`g-date-block ${hideInput ? 'hide-input' : ''}`}>
         <DatePicker
-          open
+          open={show}
           value={value}
           dropdownClassName={`g-date ${hideInput ? 'hide-input' : ''}`}
           disabledDate={disabledDate}

+ 15 - 3
front/project/www/components/Examination/index.js

@@ -10,6 +10,7 @@ import TotalSort from '../TotalSort';
 import Date from '../Date';
 import Ratio from '../Ratio';
 import { My } from '../../stores/my';
+import { Main } from '../../stores/main';
 import { PrepareStatus, PrepareExaminationTime, PrepareScoreTime } from '../../../Constant';
 
 const PrepareStatusMap = getMap(PrepareStatus, 'value', 'short');
@@ -85,6 +86,9 @@ export default class extends Component {
         result.prepareScoreTime = result.prepareScoreTime ? moment(result.prepareScoreTime) : null;
         this.setState({ data: result, stat, first: !result.prepareStatus, step: !result.prepareStatus ? 0 : 4 });
       });
+    Main.getContract('register').then(() => {
+      this.setState({ link: { url: 'www', title: '了解出分时间信息>' } });
+    });
   }
 
   onChange(type, key) {
@@ -112,16 +116,22 @@ export default class extends Component {
       });
   }
 
+  onClose() {
+    const { onClose } = this.props;
+    if (onClose) onClose();
+    this.setState({ step: 0 });
+  }
+
   render() {
     const { step } = this.state;
-    const { show, onClose } = this.props;
+    const { show } = this.props;
     return (
       <Modal
         className="examination-modal"
         show={show}
         width={460}
         {...this.stepProp[step]}
-        onClose={() => onClose && onClose()}
+        onClose={() => this.onClose()}
       >
         <div className="examination-modal-wrapper">{this[`renderStep${step}`]()}</div>
       </Modal>
@@ -202,11 +212,13 @@ export default class extends Component {
   }
 
   renderStep3() {
-    const { data } = this.state;
+    const { data, link, step } = this.state;
     const { prepareScoreTime } = data;
     return (
       <div className="step-3-layout">
+        {link && <a href={link.url} className="a-l" target='_blank'>{link.title}</a>}
         <Date
+          show={step === 3}
           value={prepareScoreTime}
           onChange={(date) => {
             this.onChange('prepareScoreTime', date);

+ 4 - 0
front/project/www/components/Examination/index.less

@@ -53,6 +53,10 @@
     .step-2-layout {}
 
     .step-3-layout {
+      .a-l {
+        position: absolute;
+        top: 30px;
+      }
 
       .button {
         padding-left: 30px;