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
348c4e92
Commit
348c4e92
authored
Oct 20, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bug修复
parent
071a7a7c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
54 deletions
+79
-54
index.vue
src/components/answer-sheet/index.vue
+34
-24
index.vue
src/components/search-item/index.vue
+1
-4
index.vue
src/components/swiper-limited-load/index.vue
+21
-8
index.vue
src/components/toast-pop/index.vue
+7
-4
results.vue
src/pages/advertisement/results.vue
+1
-0
index.vue
src/pages/index/index.vue
+1
-1
answer.vue
src/pages/learn/answer.vue
+14
-11
utils.js
src/pages/learn/utils.js
+0
-2
No files found.
src/components/answer-sheet/index.vue
View file @
348c4e92
...
...
@@ -11,11 +11,11 @@
</view>
<view
v-else
:class=
"[rightKey.includes(item.sort) ? 'success' : 'error']"
:class=
"[
data.
rightKey.includes(item.sort) ? 'success' : 'error']"
></view>
<view
class=
"text"
>
{{
item
.
text
}}
</view>
</view>
<view
class=
"btn"
v-if=
"rightKey.length > 1 && btnStatus"
>
<view
class=
"btn"
v-if=
"
data.
rightKey.length > 1 && btnStatus"
>
<view
:class=
"['confirm',
{ active: getCheckedNum }]"
@click="confirmMultiple"
...
...
@@ -43,22 +43,28 @@ const equar = (a, b) => {
export
default
{
name
:
'answerSheet'
,
props
:
{
answerList
:
{
type
:
Array
,
default
:
[],
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
rightKey
:
{
type
:
Array
,
default
:
[],
},
submitStatus
:
{
type
:
Boolean
,
default
:
false
,
data
:
{
type
:
Object
,
default
()
{
return
{}
}
},
// answerList: {
// type: Array,
// default: [],
// },
// multiple: {
// type: Boolean,
// default: false,
// },
// rightKey: {
// type: Array,
// default: [],
// },
// submitStatus: {
// type: Boolean,
// default: false,
// },
btnStatus
:
{
type
:
Boolean
,
default
:
true
,
...
...
@@ -73,7 +79,7 @@ export default {
}
},
watch
:
{
answerList
:
{
'data.answerList'
:
{
handler
:
function
(
newValue
,
oldValue
)
{
if
(
newValue
.
length
>
0
)
{
this
.
lists
=
newValue
...
...
@@ -86,18 +92,21 @@ export default {
getCheckedNum
()
{
const
num
=
this
.
lists
.
filter
((
v
)
=>
v
.
checked
)
return
num
.
length
>
1
?
true
:
false
}
},
multiple
()
{
return
this
.
data
.
type
==
3
},
},
methods
:
{
select
(
index
)
{
// 已选定
if
(
this
.
submitStatus
)
return
if
(
this
.
data
.
submitStatus
)
return
if
(
!
this
.
multiple
)
{
// 非多选处理
this
.
lists
.
forEach
((
v
)
=>
{
v
.
checked
=
false
// 勾选
v
.
confirm
=
false
// 确认答案
if
(
this
.
rightKey
.
includes
(
v
.
sort
))
{
if
(
this
.
data
.
rightKey
.
includes
(
v
.
sort
))
{
this
.
$set
(
v
,
'checked'
,
true
)
this
.
$set
(
v
,
'confirm'
,
true
)
}
...
...
@@ -106,7 +115,7 @@ export default {
// 用户选的答案
this
.
userAnswer
=
this
.
lists
[
index
].
sort
// 判断所选答案是否正确
this
.
answer
=
this
.
rightKey
.
includes
(
this
.
lists
[
index
].
sort
)
this
.
answer
=
this
.
data
.
rightKey
.
includes
(
this
.
lists
[
index
].
sort
)
?
'pass'
:
'fail'
}
...
...
@@ -117,6 +126,7 @@ export default {
},
// 多选提交答案
confirmMultiple
()
{
if
(
this
.
data
.
submitStatus
)
return
const
num
=
this
.
lists
.
filter
((
v
)
=>
v
.
checked
)
if
(
num
.
length
>
1
)
{
// 判断所选答案是否正确
...
...
@@ -124,11 +134,11 @@ export default {
// 用户选的答案
this
.
userAnswer
=
checkedList
.
join
(
','
)
// 判断所选答案是否正确
this
.
answer
=
equar
(
checkedList
,
this
.
rightKey
)
?
'pass'
:
'fail'
this
.
answer
=
equar
(
checkedList
,
this
.
data
.
rightKey
)
?
'pass'
:
'fail'
// 处理显示逻辑
this
.
lists
.
forEach
((
v
)
=>
{
if
(
v
.
checked
)
this
.
$set
(
v
,
'confirm'
,
true
)
if
(
this
.
rightKey
.
includes
(
v
.
sort
))
this
.
$set
(
v
,
'checked'
,
true
)
if
(
this
.
data
.
rightKey
.
includes
(
v
.
sort
))
this
.
$set
(
v
,
'checked'
,
true
)
})
this
.
submitAnswer
()
}
...
...
src/components/search-item/index.vue
View file @
348c4e92
...
...
@@ -14,10 +14,7 @@
<view
class=
"content"
>
<answer-sheet
ref=
"answerSheet"
:answerList=
"item.answerList"
:rightKey=
"item.rightKey"
:multiple=
"item.type === 3"
:submitStatus=
"item.submitStatus"
:data=
"item"
:btnStatus=
"false"
@
change=
"answerChange"
></answer-sheet>
...
...
src/components/swiper-limited-load/index.vue
View file @
348c4e92
...
...
@@ -13,10 +13,7 @@
<view
class=
"content"
v-if=
"item.answerList"
>
<answer-sheet
ref=
"answerSheet"
:answerList=
"item.answerList"
:rightKey=
"item.rightKey"
:multiple=
"item.type === 3"
:submitStatus=
"item.submitStatus"
:data=
"item"
@
change=
"answerChange"
></answer-sheet>
</view>
...
...
@@ -116,7 +113,6 @@ export default {
methods
:
{
init
(
defaulaIndex
)
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
list
))
console
.
log
(
'bbb:'
,
list
)
if
(
list
==
null
||
list
.
length
==
0
)
{
return
}
...
...
@@ -220,7 +216,7 @@ export default {
let
realIndex
=
list
.
findIndex
(
item
=>
item
.
index
==
defaultIndex
)
let
currentItem
=
list
[
realIndex
]
let
swiperList
=
[]
swiperList
[
current
]
=
currentItem
swiperList
[
current
]
=
this
.
initItem
(
currentItem
)
swiperList
[
this
.
getLastSwiperChangeIndex
(
current
)]
=
this
.
getLastSwiperNeedItem
(
currentItem
,
list
)
swiperList
[
this
.
getNextSwiperChangeIndex
(
current
)]
=
this
.
getNextSwiperNeedItem
(
currentItem
,
list
)
console
.
log
(
"swiperList"
,
swiperList
)
...
...
@@ -247,7 +243,7 @@ export default {
let
realIndex
=
list
.
findIndex
(
item
=>
item
.
index
==
listNeedIndex
)
if
(
realIndex
==
-
1
)
return
null
let
item
=
listNeedIndex
==
-
1
?
null
:
list
[
realIndex
]
return
item
return
this
.
initItem
(
item
)
},
/**
* 获取下一个要替换的list中的item
...
...
@@ -259,7 +255,24 @@ export default {
if
(
realIndex
==
-
1
)
return
null
let
total
=
this
.
total
!=
0
?
this
.
total
:
list
.
length
let
item
=
listNeedIndex
==
total
?
null
:
list
[
realIndex
]
return
item
return
this
.
initItem
(
item
)
},
initItem
(
data
)
{
if
(
this
.
type
===
2
&&
data
.
userAnswer
&&
!
data
.
submitStatus
)
{
data
.
submitStatus
=
true
,
data
.
result
=
data
.
userAnswer
==
data
.
answer
?
'pass'
:
'fail'
data
.
errShow
=
true
let
userAnswers
=
data
.
userAnswer
.
split
(
','
)
let
answers
=
data
.
answer
.
split
(
','
)
for
(
var
item
of
data
.
answerList
)
{
if
(
userAnswers
.
indexOf
(
item
.
sort
)
!=
-
1
||
answers
.
indexOf
(
item
.
sort
)
!=
-
1
)
{
item
.
checked
=
true
item
.
confirm
=
true
}
}
}
return
data
}
},
}
...
...
src/components/toast-pop/index.vue
View file @
348c4e92
...
...
@@ -6,9 +6,6 @@
mode=
"center"
width=
"654rpx"
:mask-close-able=
"false"
closeable
close-icon-size=
"32"
@
close=
"handleClose"
>
<image
:src=
"tanchuangdingbuImage"
...
...
@@ -16,6 +13,7 @@
mode=
"widthFix"
></image>
<view
class=
"toast-pop"
>
<u-icon
class=
"close-icon"
name=
"close"
@
click=
"handleClose"
></u-icon>
<view
class=
"pop-title"
>
<text>
{{
title
}}
</text>
</view>
...
...
@@ -133,7 +131,6 @@ export default {
this
.
$emit
(
'click'
,
this
.
type
)
},
handleClose
()
{
console
.
log
(
'aaaa:'
,
this
.
visible
)
this
.
changeVisibleValue
(
false
)
}
},
...
...
@@ -155,6 +152,12 @@ export default {
// background-size: 100% 240rpx;
// background-repeat: no-repeat;
text-align
:
center
;
.close-icon
{
top
:
30rpx
;
right
:
30rpx
;
position
:
absolute
;
font-size
:
32rpx
;
}
.pop-title
{
font-size
:
40rpx
;
text-align
:
center
;
...
...
src/pages/advertisement/results.vue
View file @
348c4e92
...
...
@@ -135,6 +135,7 @@ export default {
this
.
list
=
res
if
(
this
.
list
.
length
==
1
)
{
this
.
selectedData
=
this
.
list
[
0
].
echoMap
.
questionWarehouseId
this
.
cardData
=
this
.
list
[
0
].
echoMap
.
cardId
}
})
.
catch
((
err
)
=>
{
...
...
src/pages/index/index.vue
View file @
348c4e92
...
...
@@ -624,7 +624,7 @@ export default {
},
checkToken
()
{
if
(
this
.
vuex_token
)
{
return
true
return
!
this
.
loading
}
else
{
this
.
$u
.
route
({
url
:
'pages/login/index'
,
...
...
src/pages/learn/answer.vue
View file @
348c4e92
...
...
@@ -390,7 +390,7 @@ export default {
return
accumulator
},
0
)
if
(
count
>
0
)
{
const
noStart
=
this
.
list
.
filter
((
v
)
=>
!
v
.
result
).
length
// 未做题数
const
noStart
=
this
.
list
.
filter
((
v
)
=>
!
v
.
userAnswer
).
length
// 未做题数
// 显示暂停弹窗
this
.
pauseData
=
{
answered
:
this
.
list
.
length
-
noStart
,
...
...
@@ -509,7 +509,7 @@ export default {
item
.
result
=
status
item
.
errShow
=
this
.
type
===
2
?
true
:
status
===
'fail'
item
.
userAnswer
=
userAnswer
// 保存答案
if
(
this
.
model
===
1
)
this
.
saveAnswer
(
item
)
...
...
@@ -556,13 +556,12 @@ export default {
// 如果回答正确或者是考试模式,自动进入下一题
if
((
status
===
'pass'
&&
this
.
model
!==
2
)
||
this
.
type
===
2
)
{
if
(
this
.
currentIndex
+
1
>
this
.
total
-
1
)
{
// 最后一题回答后
if
(
this
.
type
===
2
)
{
// 统计分数,交卷
this
.
handPapers
(
1
)
this
.
submit
()
}
let
count
=
this
.
list
.
filter
((
v
)
=>
v
.
userAnswer
).
length
// 最后一题回答后
if
(
count
>=
this
.
total
&&
this
.
type
===
2
)
{
// 统计分数,交卷
this
.
handPapers
(
1
)
this
.
submit
()
return
}
setTimeout
(()
=>
{
...
...
@@ -611,8 +610,8 @@ export default {
},
// 统计分数
handPapers
(
type
)
{
const
fail
=
this
.
list
.
filter
((
v
)
=>
v
.
result
===
'fail'
).
length
// 错题数
const
noStart
=
this
.
list
.
filter
((
v
)
=>
!
v
.
result
).
length
// 未做题数
const
fail
=
this
.
list
.
filter
((
v
)
=>
v
.
userAnswer
&&
v
.
userAnswer
!==
v
.
answer
).
length
// 错题数
const
noStart
=
this
.
list
.
filter
((
v
)
=>
!
v
.
userAnswer
).
length
// 未做题数
const
fraction
=
this
.
total
-
noStart
-
fail
// 分数
this
.
complete
.
result
=
[
fail
,
noStart
,
fraction
]
this
.
complete
.
type
=
fraction
<
this
.
passPoint
?
'fail'
:
'pass'
...
...
@@ -938,6 +937,10 @@ export default {
font-size
:
28rpx
;
.c-list
{
display
:
flex
;
width
:
200rpx
;
justify-content
:
center
;
height
:
80rpx
;
align-items
:
center
;
text
{
padding-left
:
10rpx
;
}
...
...
src/pages/learn/utils.js
View file @
348c4e92
...
...
@@ -64,8 +64,6 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
type
:
type
,
collectionFlag
:
info
.
collectionFlag
,
userAnswer
:
info
.
userAnswer
,
submitStatus
:
info
.
userAnswer
?
true
:
null
,
result
:
info
.
userAnswer
?
(
info
.
userAnswer
==
info
.
answer
?
'pass'
:
'fail'
)
:
null
}
// 回显已答题目
if
(
vm
.
source
===
1
)
{
// 练习模式回显
...
...
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