Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
华
华夏模拟理财_20250701
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
华夏模拟理财_20250701
Commits
65057426
Commit
65057426
authored
Jul 29, 2025
by
zhangyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
d7349a7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
14 deletions
+33
-14
main.ts
mock/main.ts
+3
-3
index.jsx
src/panels/answerPanel/index.jsx
+17
-2
index.less
src/panels/answerPanel/index.less
+13
-9
No files found.
mock/main.ts
View file @
65057426
...
...
@@ -61,13 +61,13 @@ export default [
{
"channel"
:
"1"
,
"endTime"
:
"23:00:00"
,
"joinStatus"
:
fals
e
,
"joinStatus"
:
tru
e
,
"rainId"
:
"2"
,
"ruId"
:
null
,
"startTime"
:
"14:10:30"
}
],
"redRainCountDownTime"
:
3
,
"redRainCountDownTime"
:
0
,
actStartTime
:
Date
.
now
()
-
1
*
24
*
60
*
60
*
1000
,
actEndTime
:
Date
.
now
()
+
3
*
24
*
60
*
60
*
1000
,
endPoint
:
Date
.
now
()
+
0.0001
*
24
*
60
*
60
*
1000
,
...
...
@@ -491,7 +491,7 @@ export default [
return
{
"code"
:
null
,
"data"
:
{
"answers"
:
[
'选项
1选项1选项1选项1选项1选项1选项1选项1选项1选项1
'
,
"选项2"
,
"选项3"
,
"选项4"
],
"answers"
:
[
'选项
选项选项选项选项选项选项选项选项选项a
'
,
"选项2"
,
"选项3"
,
"选项4"
],
"avatar"
:
null
,
"content"
:
"题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目题目"
,
"fullStrength"
:
true
,
...
...
src/panels/answerPanel/index.jsx
View file @
65057426
...
...
@@ -85,19 +85,34 @@ class AnswerPanel extends React.Component {
ModalCtrl
.
closeModal
()
})
getBLen
=
function
(
str
)
{
if
(
str
==
null
)
return
0
;
if
(
typeof
str
!=
"string"
)
{
str
+=
""
;
}
return
str
.
replace
(
/
[^\x
00-
\x
ff
]
/g
,
"01"
).
length
;
}
render
()
{
const
qsInfo
=
this
.
state
.
qsInfo
||
{};
const
correctAnswers
=
this
.
state
.
correctAnswers
||
[];
const
selAnswer
=
this
.
state
.
selAnswer
;
const
labelObj
=
{
0
:
'A'
,
1
:
'B'
,
2
:
'C'
,
3
:
'D'
}
return
(
<
div
className=
"answerPanel modal_center"
>
<
span
className=
"bg"
></
span
>
<
div
className=
'question-title'
>
{
qsInfo
.
content
||
''
}
</
div
>
<
div
className=
'answer-con'
>
{
(
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
)
})
}
>
{
el
}
})
}
>
{
str
}
{
(
selAnswer
===
index
+
1
+
''
)
&&
correctAnswers
.
length
>
0
&&
!
correctAnswers
.
includes
(
index
+
1
+
''
)
&&
<
span
className=
'error-icon'
></
span
>
}
{
correctAnswers
.
includes
(
index
+
1
+
''
)
&&
<
span
className=
'correct-icon'
></
span
>
}
</
div
>
...
...
src/panels/answerPanel/index.less
View file @
65057426
...
...
@@ -31,26 +31,30 @@
}
.answer-con {
width:
492
px;
width:
540
px;
height: 360px;
position: absolute;
top: 740px;
left: 1
29
px;
left: 1
05
px;
.answer-item {
width:
492
px;
width:
540
px;
height: 80px;
line-height: 80px;
text-align: center;
text-align: left;
color: rgb(88, 88, 88);
font-size:
30
px;
font-size:
24
px;
font-weight: bold;
margin-bottom: 6px;
.lineClamp1();
line-height: 80px;
padding-left: 10px;
.sparkBg("answerPanel/normalBg.png");
position: relative;
}
.toolong {
line-height: 1.5;
}
.error {
.sparkBg("answerPanel/errorBg.png");
}
...
...
@@ -64,7 +68,7 @@
position: absolute;
width: 61px;
height: 60px;
right: -
2
0px;
right: -
1
0px;
top: -10px;
.sparkBg("answerPanel/correctIcon.png");
}
...
...
@@ -73,7 +77,7 @@
position: absolute;
width: 58px;
height: 54px;
right: -
2
0px;
right: -
1
0px;
top: -10px;
display: inline-block;
.sparkBg("answerPanel/errorIcon.png");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment