basic.js 1014 Bytes
Newer Older
duanledexianxianxian's avatar
init  
duanledexianxianxian committed
1 2
import React from 'react';
import List from './components/list'
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
3
import router from 'umi/router';
duanledexianxianxian's avatar
init  
duanledexianxianxian committed
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

const Index = () => {
  const dataSource = [
    {
      id: 1,
      image: '/images/exam1.png',
      title: '2020版中西医结合执业助理医师 模拟试',
      like: 0,
      share: 1,
    },
    {
      id: 2,
      image: '/images/exam1.png',
      title: '2020版中西医结合执业助理医师 模拟试',
      like: 0,
      share: 0,
    },
    {
      id: 3,
      image: '/images/exam1.png',
      title: '2020版中西医结合执业助理医师 模拟试',
      like: 1,
      share: 1,
    },
  ];

  const onClickLike = id => {
  };
  const onClickShare = id => {
    console.log(id);
  };
  
  const onClickButton = id => {
duanledexianxianxian's avatar
sync  
duanledexianxianxian committed
37 38
    router.push('/exam/questionList');

duanledexianxianxian's avatar
init  
duanledexianxianxian committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
  };
  

  const opt={
    dataSource,
    buttonLable:"立即答题",
    onClickLike,
    onClickShare,
    onClickButton
  }
    return (
      <>
          <List {...opt}></List>
      </>
    );
}

export default Index;