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
6b2adf0a
Commit
6b2adf0a
authored
Jul 22, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-v1.0.0' of
https://git.banshouhui.com/wuzhenzhe/study
into dev-v1.0.0
parents
14f06db6
40ad59b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
20 deletions
+30
-20
index.vue
src/components/answer-sheet/index.vue
+4
-0
answer.vue
src/pages/learn/answer.vue
+22
-18
utils.js
src/pages/learn/utils.js
+2
-1
index.js
src/store/index.js
+2
-1
No files found.
src/components/answer-sheet/index.vue
View file @
6b2adf0a
...
@@ -97,6 +97,10 @@ export default {
...
@@ -97,6 +97,10 @@ export default {
this
.
lists
.
forEach
((
v
)
=>
{
this
.
lists
.
forEach
((
v
)
=>
{
v
.
checked
=
false
// 勾选
v
.
checked
=
false
// 勾选
v
.
confirm
=
false
// 确认答案
v
.
confirm
=
false
// 确认答案
if
(
this
.
rightKey
.
includes
(
v
.
sort
))
{
this
.
$set
(
v
,
'checked'
,
true
)
this
.
$set
(
v
,
'confirm'
,
true
)
}
})
})
this
.
$set
(
this
.
lists
[
index
],
'confirm'
,
true
)
this
.
$set
(
this
.
lists
[
index
],
'confirm'
,
true
)
// 用户选的答案
// 用户选的答案
...
...
src/pages/learn/answer.vue
View file @
6b2adf0a
...
@@ -112,7 +112,9 @@
...
@@ -112,7 +112,9 @@
>
>
</dailyPop>
</dailyPop>
</view>
</view>
<!-- 体验资格结束 -->
<experience-end-pop
:visible
.
sync=
"experienceEnd"
/>
</view>
</view>
</
template
>
</
template
>
...
@@ -121,7 +123,7 @@ import swiperLimitedLoad from '@/components/swiper-limited-load/index.vue'
...
@@ -121,7 +123,7 @@ import swiperLimitedLoad from '@/components/swiper-limited-load/index.vue'
import
answerOperationTips
from
'@/components/answer-operation-tips/index.vue'
import
answerOperationTips
from
'@/components/answer-operation-tips/index.vue'
import
answerCompletePop
from
'@/components/answer-complete-pop/index.vue'
import
answerCompletePop
from
'@/components/answer-complete-pop/index.vue'
import
dailyPop
from
'@/components/daily-pop/index.vue'
import
dailyPop
from
'@/components/daily-pop/index.vue'
import
experienceEndPop
from
'@/components/experience-end-pop/index.vue'
import
Utils
from
'./utils.js'
import
Utils
from
'./utils.js'
const
NO_PREV_PAGE
=
-
1
const
NO_PREV_PAGE
=
-
1
...
@@ -132,7 +134,8 @@ export default {
...
@@ -132,7 +134,8 @@ export default {
swiperLimitedLoad
,
swiperLimitedLoad
,
answerOperationTips
,
answerOperationTips
,
answerCompletePop
,
answerCompletePop
,
dailyPop
dailyPop
,
experienceEndPop
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -141,6 +144,8 @@ export default {
...
@@ -141,6 +144,8 @@ export default {
type
:
1
,
type
:
1
,
// 1 答题模式 2 学习模式
// 1 答题模式 2 学习模式
model
:
1
,
model
:
1
,
// 体验资格
experienceEnd
:
false
,
// 每日一练
// 每日一练
daily
:
{
daily
:
{
status
:
false
,
status
:
false
,
...
@@ -218,10 +223,6 @@ export default {
...
@@ -218,10 +223,6 @@ export default {
break
;
break
;
}
}
// 第一次进入,显示提示
if
(
this
.
questionList
.
length
===
0
)
{
this
.
show
=
true
}
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
...
@@ -374,28 +375,26 @@ export default {
...
@@ -374,28 +375,26 @@ export default {
item
.
result
=
status
item
.
result
=
status
item
.
errShow
=
this
.
type
===
2
?
true
:
status
===
'fail'
item
.
errShow
=
this
.
type
===
2
?
true
:
status
===
'fail'
item
.
userAnswer
=
userAnswer
item
.
userAnswer
=
userAnswer
// 保存答案
if
(
this
.
model
===
1
)
this
.
saveAnswer
(
item
)
if
(
this
.
model
===
1
)
this
.
saveAnswer
(
item
)
// 滑动提示
if
(
!
this
.
tipStatus
&&
status
===
'fail'
)
{
this
.
$u
.
vuex
(
'tipStatus'
,
true
)
this
.
show
=
true
}
// 更新答题卡
// 更新答题卡
if
(
this
.
type
===
1
){
if
(
this
.
type
===
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
)
// 每日一练数量统计
if
(
this
.
daily
.
status
)
{
if
(
this
.
daily
.
count
<
9
)
this
.
daily
.
count
++
if
(
this
.
daily
.
count
===
9
)
{
this
.
daily
.
visible
=
true
this
.
daily
.
status
=
false
return
}
}
}
}
// 如果回答错误或者是考试模式,自动进入下一题
// 如果回答错误或者是考试模式,自动进入下一题
if
((
status
===
'pass'
&&
this
.
model
!==
2
)
||
this
.
type
===
2
)
{
if
((
status
===
'pass'
&&
this
.
model
!==
2
)
||
this
.
type
===
2
)
{
if
(
this
.
currentIndex
+
1
>
this
.
total
-
1
)
{
// 最后一题回答后
if
(
this
.
currentIndex
+
1
>
this
.
total
-
1
)
{
// 最后一题回答后
if
(
this
.
type
===
2
)
{
if
(
this
.
type
===
2
)
{
// 统计分数,交卷
this
.
handPapers
(
1
)
this
.
handPapers
(
1
)
this
.
submit
()
this
.
submit
()
}
}
...
@@ -418,6 +417,11 @@ export default {
...
@@ -418,6 +417,11 @@ export default {
}
}
this
.
$u
.
api
.
answer
([
params
])
this
.
$u
.
api
.
answer
([
params
])
},
},
// 每日一练达成
dailyComplete
()
{
this
.
daily
.
visible
=
true
this
.
daily
.
status
=
false
},
// 统计分数
// 统计分数
handPapers
(
type
)
{
handPapers
(
type
)
{
const
fail
=
this
.
list
.
filter
((
v
)
=>
v
.
result
===
'fail'
).
length
// 错题数
const
fail
=
this
.
list
.
filter
((
v
)
=>
v
.
result
===
'fail'
).
length
// 错题数
...
...
src/pages/learn/utils.js
View file @
6b2adf0a
...
@@ -147,7 +147,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
...
@@ -147,7 +147,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
answer
:
info
.
answer
,
answer
:
info
.
answer
,
rightKey
:
info
.
answer
.
split
(
','
),
rightKey
:
info
.
answer
.
split
(
','
),
explain
:
info
.
analysis
,
explain
:
info
.
analysis
,
type
:
type
type
:
type
,
collectionFlag
:
info
.
collectionFlag
}
}
// 回显已答题目
// 回显已答题目
if
(
vm
.
type
===
1
)
{
// 练习模式回显
if
(
vm
.
type
===
1
)
{
// 练习模式回显
...
...
src/store/index.js
View file @
6b2adf0a
...
@@ -12,7 +12,7 @@ try{
...
@@ -12,7 +12,7 @@ try{
}
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let
saveStateKeys
=
[
'userInfo'
,
'vuex_token'
,
'openId'
,
'searchHistory'
,
'questionList'
,
'lastIndex'
];
let
saveStateKeys
=
[
'userInfo'
,
'vuex_token'
,
'openId'
,
'searchHistory'
,
'questionList'
,
'lastIndex'
,
'tipStatus'
];
// 保存变量到本地存储中
// 保存变量到本地存储中
const
saveLifeData
=
function
(
key
,
value
){
const
saveLifeData
=
function
(
key
,
value
){
...
@@ -38,6 +38,7 @@ const store = new Vuex.Store({
...
@@ -38,6 +38,7 @@ const store = new Vuex.Store({
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
questionList
:
lifeData
.
questionList
?
lifeData
.
questionList
:
[],
// 练习列表
questionList
:
lifeData
.
questionList
?
lifeData
.
questionList
:
[],
// 练习列表
lastIndex
:
lifeData
.
lastIndex
?
lifeData
.
lastIndex
:
0
,
// 上次做到第几题
lastIndex
:
lifeData
.
lastIndex
?
lifeData
.
lastIndex
:
0
,
// 上次做到第几题
tipStatus
:
lifeData
.
tipStatus
?
lifeData
.
tipStatus
:
false
,
// 滑动提示
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version
:
'1.0.0'
,
vuex_version
:
'1.0.0'
,
},
},
...
...
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