index.js 1.53 KB
Newer Older
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
import React from 'react';
import styles from './index.less';

const list = [
  {
    title: '医学细胞生物学(本临床定向)',
    courseType: '购买普通课程',
    buyTime: '2012.01.23',
    invalidTime: '2012.01.23',
    amount: 8,
  },
  {
    title: '医学细胞生物学(本临床定向)',
    courseType: '购买普通课程',
    buyTime: '2012.01.23',
    invalidTime: '2012.01.23',
    amount: 8,
  },
  {
    title: '医学细胞生物学(本临床定向)',
    courseType: '购买普通课程',
    buyTime: '2012.01.23',
    invalidTime: '2012.01.23',
    amount: 8,
  },
];
const Index = () => {
  const renderItem = () => {
    return list.map(({ title, courseType, buyTime, invalidTime, amount }) => {
      return (
        <div className={styles.item}>
          <div className={styles.top}>
            <div className={styles.title}>
              <div className={styles.courseTitle}>{title}</div>
              <div className={styles.courseType}>{courseType}</div>
            </div>
            <div className={styles.amount}>-{amount}</div>
          </div>
          <div className={styles.bottom}>
            <div className={styles.time}>
              <span>购买时间</span>
              <span>{buyTime}</span>
            </div>
            <div className={styles.time}>
              <span>失效时间</span>
              <span>{invalidTime}</span>
            </div>
          </div>
        </div>
      );
    });
  };
  return <div className={styles.root}>{renderItem()}</div>;
};
export default Index;