Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Damon
study
Commits
79b17618
Commit
79b17618
authored
Jul 16, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 分数页面百分比计算
parent
5d16abe4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
9 deletions
+37
-9
beginAnswer.vue
src/pages/learn/beginAnswer.vue
+1
-1
score.vue
src/pages/learn/score.vue
+36
-8
No files found.
src/pages/learn/beginAnswer.vue
View file @
79b17618
...
@@ -60,7 +60,7 @@ export default {
...
@@ -60,7 +60,7 @@ export default {
}
}
},
},
defaultImage
()
{
defaultImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'morentouxiang.png'
return
process
.
uniEnv
.
qn_base_url
+
'morentouxiang
-w
.png'
},
},
buttonStyle
()
{
buttonStyle
()
{
return
{
return
{
...
...
src/pages/learn/score.vue
View file @
79b17618
...
@@ -8,13 +8,16 @@
...
@@ -8,13 +8,16 @@
:border-bottom=
"false"
:border-bottom=
"false"
title-bold
title-bold
></u-navbar>
></u-navbar>
<view
class=
"top-view"
@
click=
"$u.throttle(handleClickRecord, 500)"
>
<view
class=
"top-view"
v-if=
"!isFull"
@
click=
"$u.throttle(handleClickRecord, 500)"
>
考试错题已自动加入
<text
class=
"blue-text"
>
"错题记录"
</text>
方便练习
</view
考试错题已自动加入
<text
class=
"blue-text"
>
"错题记录"
</text>
方便练习
</view
>
>
<view
class=
"content
"
>
<view
:class=
"['content',
{ 'is-full': isFull }]
">
<view
class=
"content-view"
>
<view
class=
"content-view"
>
<image
mode=
"widthFix"
class=
"back-image"
:src=
"backImage"
></image>
<image
mode=
"widthFix"
class=
"back-image"
:src=
"backImage"
></image>
<view
class=
"chart-view"
>
<view
class=
"chart-view"
>
<CircleProgress
<CircleProgress
class=
"progress-view"
class=
"progress-view"
...
@@ -28,7 +31,7 @@
...
@@ -28,7 +31,7 @@
<view
class=
"progress-content"
>
<view
class=
"progress-content"
>
<view
class=
"progress-score"
>
{{
info
.
score
}}
</view>
<view
class=
"progress-score"
>
{{
info
.
score
}}
</view>
<view
class=
"progress-info"
>
{{
resultText
}}
</view>
<view
class=
"progress-info"
>
{{
resultText
}}
</view>
<view
class=
"percent-text"
>
超越了
{{
info
.
p
ercent
}}
%的学员
</view>
<view
class=
"percent-text"
>
超越了
{{
falseP
ercent
}}
%的学员
</view>
</view>
</view>
</CircleProgress>
</CircleProgress>
</view>
</view>
...
@@ -111,8 +114,11 @@ export default {
...
@@ -111,8 +114,11 @@ export default {
borderRadius
:
'24rpx'
,
borderRadius
:
'24rpx'
,
}
}
},
},
isFull
()
{
return
this
.
info
.
score
>=
100
},
isPass
()
{
isPass
()
{
return
this
.
info
.
score
>
60
return
this
.
info
.
score
>
=
60
},
},
resultText
()
{
resultText
()
{
return
this
.
isPass
?
'合格'
:
'不合格'
return
this
.
isPass
?
'合格'
:
'不合格'
...
@@ -135,13 +141,30 @@ export default {
...
@@ -135,13 +141,30 @@ export default {
weixinImage
()
{
weixinImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'weixin.png'
return
process
.
uniEnv
.
qn_base_url
+
'weixin.png'
},
},
// 模考成绩60分以下则百分数在55%—65% 区间内取随机值;
// 模考成绩大于60分小于80分则百分数在66%—85% 区间内取随机值;
// 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值;
// 模考成绩大于90分小于100分则百分数在94%—99% 区间内取随机值)
falsePercent
()
{
var
random
=
[
94
,
99
]
if
(
this
.
info
.
score
<
60
)
{
random
=
[
55
,
65
]
}
else
if
(
this
.
info
.
score
>=
60
&&
this
.
info
.
score
<
80
)
{
random
=
[
66
,
85
]
}
else
if
(
this
.
info
.
score
>=
80
&&
this
.
info
.
score
<
90
)
{
random
=
[
86
,
93
]
}
else
if
(
this
.
info
.
score
>=
90
)
{
random
=
[
94
,
99
]
}
return
this
.
$u
.
random
(
random
[
0
],
random
[
1
])
},
},
},
onLoad
()
{
onLoad
()
{
this
.
info
=
{
this
.
info
=
{
name
:
'我就是昵称'
,
name
:
'我就是昵称'
,
image
:
''
,
image
:
''
,
score
:
80
,
score
:
74
,
percent
:
60
,
time
:
1626402760689
,
time
:
1626402760689
,
category
:
'高处安装、维护、拆除作业人员'
,
category
:
'高处安装、维护、拆除作业人员'
,
type
:
'模拟考试'
,
type
:
'模拟考试'
,
...
@@ -181,13 +204,18 @@ export default {
...
@@ -181,13 +204,18 @@ export default {
.content
{
.content
{
height
:
100%
;
height
:
100%
;
overflow
:
auto
;
overflow
:
auto
;
padding
:
64rpx
48rpx
56rpx
48rpx
;
padding
:
64rpx
48rpx
44rpx
48rpx
;
&
.is-full
{
padding-top
:
0rpx
;
border-radius
:
24rpx
;
}
.content-view
{
.content-view
{
background-color
:
#ffffff
;
background-color
:
#ffffff
;
border-radius
:
24rpx
;
border-radius
:
24rpx
;
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
z-index
:
1
;
z-index
:
1
;
padding-bottom
:
36rpx
;
.back-image
{
.back-image
{
position
:
absolute
;
position
:
absolute
;
width
:
100%
;
width
:
100%
;
...
...
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