Commit f383824a authored by duanledexianxianxian's avatar duanledexianxianxian 😁

sync

parent b058c2de
...@@ -60,10 +60,16 @@ export default [ ...@@ -60,10 +60,16 @@ export default [
}, },
{ {
key: '315', key: '315',
path: '/exam/questionList', path: '/exam/question/list',
isFull: true, isFull: true,
component: './exam/question/list', component: './exam/question/list',
}, },
{
key: '316',
path: '/exam/question/single',
isFull: true,
component: './exam/question/single',
},
], ],
}, },
], ],
......
...@@ -33,9 +33,9 @@ const Index = () => { ...@@ -33,9 +33,9 @@ const Index = () => {
console.log(id); console.log(id);
}; };
const onClickButton = id => { const onClickButton = (id,e) => {
router.push('/exam/questionList'); e.preventDefault()
return router.push('/exam/question/list');
}; };
......
...@@ -42,7 +42,7 @@ const Index = ({ ...@@ -42,7 +42,7 @@ const Index = ({
/> />
<div className={styles.label}>分享</div> <div className={styles.label}>分享</div>
</div> </div>
<Button type="primary" onClick={() => onClickButton(id)}> <Button type="primary" onClick={(e) => onClickButton(id,e)}>
{buttonLable} {buttonLable}
</Button> </Button>
</div> </div>
......
import React from 'react'; import React from 'react';
import styles from './list.less'; import styles from './list.less';
import router from 'umi/router';
const images = [ const images = [
{ {
image: '', key: 'single',
title: '', image: '/images/danxuanti.png',
title: '单选题',
}, },
{ {
image: '', key: 'multiple',
title: '', image: '/images/duoxuanti.png',
title: '多选题',
}, },
{ {
image: '', key: 'judgment',
title: '', image: '/images/panduanti.png',
title: '判断题',
}, },
{ {
image: '', key: 'completion',
title: '', image: '/images/tiankongti.png',
title: '填空题',
}, },
{ {
image: '', key: 'short',
title: '', image: '/images/jiandati.png',
title: '简答题',
}, },
{ {
image: '', key: 'caseChoice ',
title: '', image: '/images/anlixuanzeti.png',
title: '案例选择题',
}, },
{ {
image: '', key: 'caseMultiple',
title: '', image: '/images/mingcijieshi.png',
title: '名词解释',
}, },
{ {
image: '', key: 'b1',
title: '', image: '/images/b1tixing.png',
title: 'B1题型',
}, },
{ {
image: '', key: 'argumentation',
title: '', image: '/images/lunshuti.png',
title: '论述题',
},
{
key: 'analytical ',
image: '/images/fenxiti.png',
title: '分析题',
}, },
]; ];
const Index = () => { const goPage = key => {
return ( router.push(`/exam/question/${key}`);
<div className={styles.root}> };
<div className={styles.row}>
<div>
<img src={'/images/danxuanti.png'} alt=""></img>
<span>单选题</span>
</div>
<img src={'/images/duoxuanti.png'} alt=""></img> const renderMenu = () => {
<img src={'/images/panduanti.png'} alt=""></img> const menus = [];
</div> for (let i = 0; i < images.length; ) {
<div className={styles.row}> if (i % 3 === 0) {
<img src={'/images/tiankongti.png'} alt=""></img> console.log(i)
<img src={'/images/jiandati.png'} alt=""></img> console.log(images[i])
<img src={'/images/anlixuanzeti.png'} alt=""></img> console.log(images[i + 1])
</div> console.log(images[i + 2])
<div className={styles.row}> menus.push(
<img src={'/images/mingcijieshi.png'} alt=""></img> <div className={styles.row} key={i}>
<img src={'/images/b1tixing.png'} alt=""></img> <div className={styles.col} key={images[i].key}>
<img src={'/images/lunshuti.png'} alt=""></img> <img src={images[i].image} alt="" onClick={()=>goPage(images[i].key)} />
</div> <span>{images[i].title}</span>
<div className={styles.row}>
<img src={'/images/fenxiti.png'} alt=""></img>
</div>
</div> </div>
{i+1< images.length && <div className={styles.col} key={images[i+ 1].key}>
<img src={images[i + 1].image} alt="" onClick={()=>goPage(images[i + 1].key)} />
<span>{images[i + 1].title}</span>
</div>}
{i+2< images.length && <div className={styles.col} key={images[i+ 2].key}>
<img src={images[i + 2].image} alt="" onClick={()=>goPage(images[i + 2].key)} />
<span>{images[i + 2].title}</span>
</div>}
</div>,
); );
}
i += 3;
}
return menus;
};
const Index = () => {
return <div className={styles.root}>{renderMenu()}</div>;
}; };
export default Index; export default Index;
.root{ .root{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-top: 8px;
.row{ .row{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 0px 8px; padding: 0px 8px;
.col{
position: relative;
img{ img{
padding: 4px 4px; padding: 4px 4px;
} }
span{
margin-left: -20px;
width: 100px;
position: absolute;
left: 50%;
right: 50%;
bottom: 18px;
color: #FFFFFF;
}
}
} }
} }
\ No newline at end of file
import React from "react";
import styles from "./index.less";
const Index = () => {
return <div className={styles.root}>hello wolrd</div>;
};
export default Index;
\ No newline at end of file
.root{
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment