HomeWorkItem.jsx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Created by RaoMeng on 2019/1/14
  3. * Desc: 作业列表item
  4. */
  5. import React, {Component} from 'react'
  6. import {isObjEmpty} from "../utils/common";
  7. import 'css/homework.css'
  8. export default class HomeWorkItem extends Component {
  9. constructor() {
  10. super()
  11. this.state = {}
  12. }
  13. componentDidMount() {
  14. }
  15. render() {
  16. const {homeWork} = this.props
  17. return (
  18. <div style={{padding: '0 10px'}} onClick={this.onItemClick}>
  19. <div className='recharge-item-root'>
  20. <div className='common-flex-row homework-item-title-layout'>
  21. <div className='homework-item-title'>{homeWork.notifyName}</div>
  22. <span className={homeWork.taskStatus === 2 ? 'homework-item-done'
  23. : 'homework-item-todo'}>{homeWork.readStatus}</span>
  24. </div>
  25. <div className='gray-line' style={{height: '1px', marginBottom: '10px'}}></div>
  26. <div className='recharge-item-line'>
  27. <div className='recharge-item-caption'>内容:</div>
  28. <div className='recharge-item-value'>{homeWork.notifyDetails}</div>
  29. </div>
  30. <div className='recharge-item-line'>
  31. <div className='recharge-item-caption'>截止日期:</div>
  32. <div className='recharge-item-value'>{homeWork.endDate}</div>
  33. </div>
  34. <div className='recharge-item-line'>
  35. <div className='recharge-item-caption'>发布老师:</div>
  36. <div className='recharge-item-value'>{homeWork.notifyCreatorName}</div>
  37. </div>
  38. <div className='recharge-item-line' style={{paddingBottom: '20px'}}>
  39. <div className='recharge-item-caption'>发布时间:</div>
  40. <div className='recharge-item-value'>{homeWork.creatDate}</div>
  41. </div>
  42. </div>
  43. </div>
  44. )
  45. }
  46. onItemClick = () => {
  47. if (this.props.onItemClick) {
  48. this.props.onItemClick(this.props.index, this.props.homeWork.notifyId)
  49. }
  50. }
  51. }