Commit 65057426 authored by zhangyuan's avatar zhangyuan

提交

parent d7349a7f
...@@ -61,13 +61,13 @@ export default [ ...@@ -61,13 +61,13 @@ export default [
{ {
"channel": "1", "channel": "1",
"endTime": "23:00:00", "endTime": "23:00:00",
"joinStatus": false, "joinStatus": true,
"rainId": "2", "rainId": "2",
"ruId": null, "ruId": null,
"startTime": "14:10:30" "startTime": "14:10:30"
} }
], ],
"redRainCountDownTime": 3, "redRainCountDownTime": 0,
actStartTime: Date.now() - 1 * 24 * 60 * 60 * 1000, actStartTime: Date.now() - 1 * 24 * 60 * 60 * 1000,
actEndTime: Date.now() + 3 * 24 * 60 * 60 * 1000, actEndTime: Date.now() + 3 * 24 * 60 * 60 * 1000,
endPoint: Date.now() + 0.0001 * 24 * 60 * 60 * 1000, endPoint: Date.now() + 0.0001 * 24 * 60 * 60 * 1000,
...@@ -491,7 +491,7 @@ export default [ ...@@ -491,7 +491,7 @@ export default [
return { return {
"code": null, "code": null,
"data": { "data": {
"answers": ['选项1选项1选项1选项1选项1选项1选项1选项1选项1选项1', "选项2", "选项3", "选项4"], "answers": ['选项选项选项选项选项选项选项选项选项选项a', "选项2", "选项3", "选项4"],
"avatar": null, "avatar": null,
"content": "题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目", "content": "题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目",
"fullStrength": true, "fullStrength": true,
......
...@@ -85,19 +85,34 @@ class AnswerPanel extends React.Component { ...@@ -85,19 +85,34 @@ class AnswerPanel extends React.Component {
ModalCtrl.closeModal() ModalCtrl.closeModal()
}) })
getBLen = function (str) {
if (str == null) return 0;
if (typeof str != "string") {
str += "";
}
return str.replace(/[^\x00-\xff]/g, "01").length;
}
render() { render() {
const qsInfo = this.state.qsInfo || {}; const qsInfo = this.state.qsInfo || {};
const correctAnswers = this.state.correctAnswers || []; const correctAnswers = this.state.correctAnswers || [];
const selAnswer = this.state.selAnswer; const selAnswer = this.state.selAnswer;
const labelObj = {
0: 'A',
1: 'B',
2: 'C',
3: 'D'
}
return ( return (
<div className="answerPanel modal_center"> <div className="answerPanel modal_center">
<span className="bg"></span> <span className="bg"></span>
<div className='question-title'>{qsInfo.content || ''}</div> <div className='question-title'>{qsInfo.content || ''}</div>
<div className='answer-con'> <div className='answer-con'>
{(qsInfo.answers || []).map((el, index) => { {(qsInfo.answers || []).map((el, index) => {
return <div className={`answer-item ${(selAnswer === index + 1 + '') && correctAnswers.length > 0 && !correctAnswers.includes(index + 1 + '') ? 'error' : ''} ${correctAnswers.includes(index + 1 + '') ? 'correct' : ''}`} key={index} onClick={_asyncThrottle(() => { const str = labelObj[index] + '、' + el;
let len = this.getBLen(str);
return <div className={`${len > 44 ? 'toolong' : ''} answer-item ${(selAnswer === index + 1 + '') && correctAnswers.length > 0 && !correctAnswers.includes(index + 1 + '') ? 'error' : ''} ${correctAnswers.includes(index + 1 + '') ? 'correct' : ''}`} key={index} onClick={_asyncThrottle(() => {
this.submit(index) this.submit(index)
})}>{el} })}>{str}
{(selAnswer === index + 1 + '') && correctAnswers.length > 0 && !correctAnswers.includes(index + 1 + '') && <span className='error-icon'></span>} {(selAnswer === index + 1 + '') && correctAnswers.length > 0 && !correctAnswers.includes(index + 1 + '') && <span className='error-icon'></span>}
{correctAnswers.includes(index + 1 + '') && <span className='correct-icon'></span>} {correctAnswers.includes(index + 1 + '') && <span className='correct-icon'></span>}
</div> </div>
......
...@@ -31,26 +31,30 @@ ...@@ -31,26 +31,30 @@
} }
.answer-con { .answer-con {
width: 492px; width: 540px;
height: 360px; height: 360px;
position: absolute; position: absolute;
top: 740px; top: 740px;
left: 129px; left: 105px;
.answer-item { .answer-item {
width: 492px; width: 540px;
height: 80px; height: 80px;
line-height: 80px; text-align: left;
text-align: center;
color: rgb(88, 88, 88); color: rgb(88, 88, 88);
font-size: 30px; font-size: 24px;
font-weight: bold; font-weight: bold;
margin-bottom: 6px; margin-bottom: 6px;
.lineClamp1(); line-height: 80px;
padding-left: 10px;
.sparkBg("answerPanel/normalBg.png"); .sparkBg("answerPanel/normalBg.png");
position: relative; position: relative;
} }
.toolong {
line-height: 1.5;
}
.error { .error {
.sparkBg("answerPanel/errorBg.png"); .sparkBg("answerPanel/errorBg.png");
} }
...@@ -64,7 +68,7 @@ ...@@ -64,7 +68,7 @@
position: absolute; position: absolute;
width: 61px; width: 61px;
height: 60px; height: 60px;
right: -20px; right: -10px;
top: -10px; top: -10px;
.sparkBg("answerPanel/correctIcon.png"); .sparkBg("answerPanel/correctIcon.png");
} }
...@@ -73,7 +77,7 @@ ...@@ -73,7 +77,7 @@
position: absolute; position: absolute;
width: 58px; width: 58px;
height: 54px; height: 54px;
right: -20px; right: -10px;
top: -10px; top: -10px;
display: inline-block; display: inline-block;
.sparkBg("answerPanel/errorIcon.png"); .sparkBg("answerPanel/errorIcon.png");
......
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