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
76aed41f
Commit
76aed41f
authored
Jul 24, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 体验资格 && 每日一练
parent
670ae7af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
answer.vue
src/pages/learn/answer.vue
+27
-12
utils.js
src/pages/learn/utils.js
+1
-1
No files found.
src/pages/learn/answer.vue
View file @
76aed41f
...
@@ -179,7 +179,7 @@ export default {
...
@@ -179,7 +179,7 @@ export default {
total
:
0
,
total
:
0
,
requesting
:
false
,
requesting
:
false
,
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
source
:
0
,
source
:
1
,
recordId
:
0
,
recordId
:
0
,
// 合格分数
// 合格分数
passPoint
:
60
,
passPoint
:
60
,
...
@@ -213,10 +213,13 @@ export default {
...
@@ -213,10 +213,13 @@ export default {
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
if
(
e
?.
source
)
this
.
source
=
parseInt
(
e
.
source
)
if
(
e
?.
experience
)
this
.
experience
=
Boolean
(
e
.
experience
)
// 体验资格
if
(
e
?.
recordId
)
this
.
recordId
=
e
.
recordId
if
(
e
?.
daily
)
this
.
daily
.
status
=
true
// 每日一练
if
(
e
?.
passPoint
)
this
.
passPoint
=
parseInt
(
e
.
passPoint
)
if
(
e
?.
dailyCount
)
this
.
daily
.
count
=
parseInt
(
e
.
dailyCount
)
// 打卡天数
if
(
e
?.
totalPoint
)
this
.
totalPoint
=
parseInt
(
e
.
totalPoint
)
if
(
e
?.
source
)
this
.
source
=
parseInt
(
e
.
source
)
// 来源
if
(
e
?.
recordId
)
this
.
recordId
=
e
.
recordId
// 考试ID
if
(
e
?.
passPoint
)
this
.
passPoint
=
parseInt
(
e
.
passPoint
)
// 合格分数
if
(
e
?.
totalPoint
)
this
.
totalPoint
=
parseInt
(
e
.
totalPoint
)
// 考试总分/总条数
switch
(
this
.
source
)
{
switch
(
this
.
source
)
{
case
1
:
case
1
:
case
2
:
case
2
:
...
@@ -262,11 +265,11 @@ export default {
...
@@ -262,11 +265,11 @@ export default {
this
.
total
=
total
this
.
total
=
total
// 练习模式-初始化答题卡列表
// 练习模式-初始化答题卡列表
if
(
this
.
typ
e
===
1
)
Utils
.
initAnswerCardList
(
total
,
this
)
if
(
this
.
sourc
e
===
1
)
Utils
.
initAnswerCardList
(
total
,
this
)
this
.
cachePageDataMap
=
new
Map
()
this
.
cachePageDataMap
=
new
Map
()
// 上次答到了第几题
// 上次答到了第几题
let
index
=
this
.
typ
e
===
1
?
(
this
.
lastIndex
||
0
)
:
0
let
index
=
this
.
sourc
e
===
1
?
(
this
.
lastIndex
||
0
)
:
0
this
.
refresh
(
index
)
this
.
refresh
(
index
)
})
})
},
},
...
@@ -395,8 +398,8 @@ export default {
...
@@ -395,8 +398,8 @@ export default {
this
.
show
=
true
this
.
show
=
true
}
}
// 更新答题卡
//
顺序练习,
更新答题卡
if
(
this
.
typ
e
===
1
){
if
(
this
.
sourc
e
===
1
){
this
.
questionList
[
this
.
currentIndex
]
=
item
this
.
questionList
[
this
.
currentIndex
]
=
item
this
.
$u
.
vuex
(
'questionList'
,
this
.
questionList
)
this
.
$u
.
vuex
(
'questionList'
,
this
.
questionList
)
this
.
$u
.
vuex
(
'lastIndex'
,
this
.
currentIndex
)
this
.
$u
.
vuex
(
'lastIndex'
,
this
.
currentIndex
)
...
@@ -426,12 +429,17 @@ export default {
...
@@ -426,12 +429,17 @@ export default {
recordId
:
this
.
recordId
,
recordId
:
this
.
recordId
,
source
:
this
.
source
source
:
this
.
source
}
}
this
.
$u
.
api
.
answer
([
params
])
this
.
$u
.
api
.
answer
([
params
]).
then
(
res
=>
{
if
(
this
.
source
===
2
&&
res
===
10
)
{
if
(
this
.
daily
.
status
)
this
.
dailyComplete
()
}
})
},
},
// 每日一练达成
// 每日一练达成
dailyComplete
()
{
dailyComplete
()
{
this
.
daily
.
visible
=
true
this
.
daily
.
count
=
this
.
daily
.
count
+
1
this
.
daily
.
status
=
false
this
.
daily
.
status
=
false
this
.
daily
.
visible
=
true
},
},
// 统计分数
// 统计分数
handPapers
(
type
)
{
handPapers
(
type
)
{
...
@@ -470,7 +478,14 @@ export default {
...
@@ -470,7 +478,14 @@ export default {
},
},
// 每日一练弹框确认
// 每日一练弹框确认
dailySubmit
()
{
dailySubmit
()
{
if
(
this
.
experience
)
{
this
.
$u
.
route
({
type
:
'redirect'
,
url
:
'/pages/learn/detail'
,
})
}
else
{
this
.
daily
.
visible
=
false
this
.
daily
.
visible
=
false
}
},
},
// 每日一练弹框取消
// 每日一练弹框取消
dailyCancel
()
{
dailyCancel
()
{
...
...
src/pages/learn/utils.js
View file @
76aed41f
...
@@ -151,7 +151,7 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
...
@@ -151,7 +151,7 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
collectionFlag
:
info
.
collectionFlag
collectionFlag
:
info
.
collectionFlag
}
}
// 回显已答题目
// 回显已答题目
if
(
vm
.
typ
e
===
1
)
{
// 练习模式回显
if
(
vm
.
sourc
e
===
1
)
{
// 练习模式回显
const
ansItem
=
vm
.
questionList
.
find
(
v
=>
v
.
index
===
item
.
index
)
const
ansItem
=
vm
.
questionList
.
find
(
v
=>
v
.
index
===
item
.
index
)
questionList
.
push
(
ansItem
?
ansItem
:
item
)
questionList
.
push
(
ansItem
?
ansItem
:
item
)
}
else
{
}
else
{
...
...
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