diff --git a/config/defaultSettings.js b/config/defaultSettings.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cea2d1fec530639320d5e76b2bdcc46ed90a0d9d 100644 --- a/config/defaultSettings.js +++ b/config/defaultSettings.js @@ -0,0 +1,4 @@ +export default { + selectNo:["A","B","C","D","E","F","G","H"], + judgeNo:["T","F"] +} \ No newline at end of file diff --git a/package.json b/package.json index b12f774e574464c63052f1926ef77f2e82736b87..ec47a4718e08b59d6c3f139c20f3c8fb8d8c6a79 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "dva": "^2.6.0-beta.6", "path-to-regexp": "^2.4.0", "react": "^16.8.6", - "react-dom": "^16.8.6" + "react-dom": "^16.8.6", + "classnames": "^2.2.6" }, "devDependencies": { "babel-eslint": "^9.0.0", diff --git a/public/images/error.png b/public/images/error.png new file mode 100644 index 0000000000000000000000000000000000000000..7f3e683b547b85d600676578332b5dddeb2bc6fc Binary files /dev/null and b/public/images/error.png differ diff --git a/public/images/right.png b/public/images/right.png new file mode 100644 index 0000000000000000000000000000000000000000..8d17ead9e6c693b31ebc7bef85f8158fa8142e60 Binary files /dev/null and b/public/images/right.png differ diff --git a/src/global.less b/src/global.less index 08359cebffbb5705a39309ff20a1d73d88624c78..88fc21048debebc7611b7729fb8d70953c19754a 100644 --- a/src/global.less +++ b/src/global.less @@ -3,6 +3,7 @@ html, body, #root { + background-color: #FFFFFF; height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', diff --git a/src/pages/exam/question/list.js b/src/pages/exam/question/list.js index 1923fa88c9d99794d21d027d761149d84f14caa2..75f85d99ed9db80d4840bf1e44bc556171b5be80 100644 --- a/src/pages/exam/question/list.js +++ b/src/pages/exam/question/list.js @@ -66,21 +66,24 @@ const renderMenu = () => { console.log(images[i]) console.log(images[i + 1]) console.log(images[i + 2]) + const v1= images[i] + const v2=images[i + 1] + const v3= images[i + 2] menus.push(
-
- goPage(images[i].key)} /> - {images[i].title} +
+ goPage(v1.key)} /> + {v1.title}
- {i+1< images.length &&
- goPage(images[i + 1].key)} /> - {images[i + 1].title} + {i+1< images.length &&
+ goPage(v2.key)} /> + {v2.title}
} - {i+2< images.length &&
- goPage(images[i + 2].key)} /> - {images[i + 2].title} + {i+2< images.length &&
+ goPage(v3.key)} /> + {v3.title}
} -
, +
); } i += 3; diff --git a/src/pages/exam/question/single/index.js b/src/pages/exam/question/single/index.js index 14d36e2230f055b9c89701592b59d3ce6abfece1..0e19765adacf40979192aee1f70c4b6702769d34 100644 --- a/src/pages/exam/question/single/index.js +++ b/src/pages/exam/question/single/index.js @@ -1,8 +1,97 @@ -import React from "react"; -import styles from "./index.less"; +import React, { useState } from 'react'; +import styles from './index.less'; +import config from '@/config'; +import { Button } from 'antd-mobile'; +import classNames from 'classNames'; +const Index = ({}) => { + const [isShowAnswer, setIsShowAnswer] = useState(false); + const [isSelected, setIsSelected] = useState(false); -const Index = () => { - return
hello wolrd
; + const options = [ + { + id: 1, + title: '前交通动脉', + isRight: true, + }, + { + id: 1, + title: '矩形备份', + isRight: true, + }, + { + id: 1, + title: '矩形备份', + isRight: true, + }, + { + id: 1, + title: '矩形备份', + isRight: false, + }, + { + id: 1, + title: '矩形备份', + isRight: true, + }, + ]; + + const showAnswer = () => { + setIsShowAnswer(true); + }; + + const selectOption=()=>{ + } + + const renderOption = () => { + return options.map((item, index) => { + return ( +
+ {config.selectNo[index]}.{item.title} + {isShowAnswer && ( + + )} +
+ ); + }); + }; + return ( +
+
+ 2/211、脑底动脉环在脑循环中起着非常重要的作用,能沟通脑前脑、后、左、右的血液供应,下列哪条动脉不参与脑底动脉环的组成? +
+
{renderOption()}
+ {isShowAnswer && ( +
+
正确答案为:B
+
+ 题型解析 + :脑底动脉环的组成包括颈内动脉,大脑前动脉起始段,前交通动脉,大脑后动脉和后交通动脉,不包括椎动脉。 +
+
+ )} + {!isShowAnswer && ( +
+ +
+ )} +
+
上一题
+
+ 跳转到 + 题 +
+
下一题
+
+
+ ); }; -export default Index; \ No newline at end of file +export default Index; diff --git a/src/pages/exam/question/single/index.less b/src/pages/exam/question/single/index.less index 185e2bb9ccb74f5a3d807f5d54f5a3f500010301..6720d2edabcfb61983cf8c13e23c44d649111fd3 100644 --- a/src/pages/exam/question/single/index.less +++ b/src/pages/exam/question/single/index.less @@ -1,3 +1,109 @@ -.root{ - -} \ No newline at end of file +.root { + font-size: 16px; + padding: 16px; + .title { + color: #202030; + font-weight: 600; + line-height: 1.5; + } + + .options { + margin: 32px 0 24px; + font-size: 14px; + .option { + background-color: rgba(250, 250, 250, 1); + border-radius: 5px; + height: 44px; + line-height: 44px; + margin-bottom: 16px; + padding-left: 16px; + position: relative; + &.error { + background-color: #feeff2; + color: #f94268; + font-size: 16px; + font-weight: 600; + } + &.right { + background-color: #f1fbf6; + color: #3dc484; + font-size: 16px; + font-weight: 600; + } + &.selected { + background-color: #ecf3fe; + } + img { + position: absolute; + right: 16px; + } + } + } + + .submit { + :global { + .am-button { + line-height: 40px; + font-size: 16px; + width: 105px; + height: 40px; + background: linear-gradient(270deg, rgba(23, 106, 254, 1) 0%, rgba(97, 159, 255, 1) 100%); + border-radius: 20px; + } + } + } + + .action { + display: flex; + justify-content: space-between; + font-size: 14px; + margin-top: 48px; + .pre { + width: 72px; + height: 32px; + background: #f9f9f9; + border-radius: 16px; + color: #cccccc; + font-weight: 600; + line-height: 32px; + text-align: center; + } + .input { + input { + width: 36px; + height: 26px; + border-radius: 4px; + border: 1px solid #eff4fe; + color: #176aff; + font-weight: 500; + margin: 0 12px; + } + } + .next { + width: 72px; + height: 32px; + line-height: 32px; + background: #e3edfe; + border-radius: 16px; + color: #176aff; + font-weight: 600; + text-align: center; + } + } + + .answer { + .rightAnswer { + margin-bottom: 16px; + color: #3dc484; + } + .analysis { + margin-bottom: 16px; + font-size: 14px; + color: #202030; + line-height: 1.5; + span { + font-weight: 600; + } + } + } +}