index.js 1.57 KB
Newer Older
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
1 2 3 4 5 6 7 8 9
import React from 'react';
import styles from './index.less';

const list = [
  {
    title: '医学细胞生物学(本临床定向)',
    courseType: '购买普通课程',
    buyTime: '2012.01.23',
    invalidTime: '2012.01.23',
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
10
    amount: 8.00,
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
11 12 13 14
  },
  {
    title: '医学细胞生物学(本临床定向)',
    courseType: '购买普通课程',
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
15 16 17
    buyTime: '2020.3.28 09:47:11',
    invalidTime: '2020.3.28 09:47:11',
    amount: 8.00,
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
18 19 20 21
  },
  {
    title: '医学细胞生物学(本临床定向)',
    courseType: '购买普通课程',
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
22 23 24
    buyTime: '2020.3.28 09:47:11',
    invalidTime: '2020.3.28 09:47:11',
    amount: 8.00,
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
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
  },
];
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;