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
355096cf
Commit
355096cf
authored
Jul 27, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 【ID1001314】【小程序-首页-答题模式】:答对试题后自动跳转到下一页的速度太快,需要优化。
parent
b48e41fe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
index.vue
src/components/swiper-limited-load/index.vue
+4
-5
answer.vue
src/pages/learn/answer.vue
+3
-6
No files found.
src/components/swiper-limited-load/index.vue
View file @
355096cf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
@
change=
"swiperChange"
@
change=
"swiperChange"
circular
circular
>
>
<swiper-item
v-for=
"(item, i
ndex) in swiperList"
:key=
"index"
class=
"swiper-items
"
>
<swiper-item
v-for=
"(item, i
) in swiperList"
:key=
"i
"
>
<view
class=
"u-flex subject"
>
<view
class=
"u-flex subject"
>
<view
class=
"title"
v-if=
"item.title"
><text
class=
"title-type"
>
{{
titleType
[
item
.
type
-
1
]
}}
</text>
{{
item
.
title
}}
</view>
<view
class=
"title"
v-if=
"item.title"
><text
class=
"title-type"
>
{{
titleType
[
item
.
type
-
1
]
}}
</text>
{{
item
.
title
}}
</view>
<view
class=
"content"
>
<view
class=
"content"
>
...
@@ -69,8 +69,8 @@ export default {
...
@@ -69,8 +69,8 @@ export default {
},
},
// 值为0禁止切换动画
// 值为0禁止切换动画
swiperDuration
:
{
swiperDuration
:
{
type
:
Number
,
type
:
String
,
default
:
1000
default
:
'250'
},
},
// 分页需要传此数据
// 分页需要传此数据
total
:
{
total
:
{
...
@@ -86,7 +86,7 @@ export default {
...
@@ -86,7 +86,7 @@ export default {
// 此值控制swiper的位置
// 此值控制swiper的位置
swiperCurrent
:
0
,
swiperCurrent
:
0
,
// 当前swiper渲染的items
// 当前swiper渲染的items
swiperList
:
[],
swiperList
:
[
1
,
2
,
3
],
}
}
},
},
watch
:
{
watch
:
{
...
@@ -216,7 +216,6 @@ export default {
...
@@ -216,7 +216,6 @@ export default {
swiperList
[
current
]
=
currentItem
swiperList
[
current
]
=
currentItem
swiperList
[
this
.
getLastSwiperChangeIndex
(
current
)]
=
this
.
getLastSwiperNeedItem
(
currentItem
,
list
)
swiperList
[
this
.
getLastSwiperChangeIndex
(
current
)]
=
this
.
getLastSwiperNeedItem
(
currentItem
,
list
)
swiperList
[
this
.
getNextSwiperChangeIndex
(
current
)]
=
this
.
getNextSwiperNeedItem
(
currentItem
,
list
)
swiperList
[
this
.
getNextSwiperChangeIndex
(
current
)]
=
this
.
getNextSwiperNeedItem
(
currentItem
,
list
)
console
.
log
(
"swiperList"
,
swiperList
)
return
swiperList
;
return
swiperList
;
},
},
/**
/**
...
...
src/pages/learn/answer.vue
View file @
355096cf
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
<view
class=
"swiper"
>
<view
class=
"swiper"
>
<swiper-limited-load
<swiper-limited-load
ref=
"swiper"
ref=
"swiper"
:swiperHeight=
"500"
:swiperDuration=
"swiperDuration"
:swiperDuration=
"swiperDuration"
:list=
"list"
:list=
"list"
:current=
"current"
:current=
"current"
...
@@ -179,7 +178,7 @@ export default {
...
@@ -179,7 +178,7 @@ export default {
current
:
0
,
current
:
0
,
// 仅仅记录swiper的位置
// 仅仅记录swiper的位置
currentIndex
:
0
,
currentIndex
:
0
,
swiperDuration
:
'0'
,
swiperDuration
:
'
100
0'
,
// 分页数据
// 分页数据
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
100
,
pageSize
:
100
,
...
@@ -441,7 +440,7 @@ export default {
...
@@ -441,7 +440,7 @@ export default {
}
}
}
}
// 如果回答
错误
或者是考试模式,自动进入下一题
// 如果回答
正确
或者是考试模式,自动进入下一题
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
)
{
// 统计分数,交卷
...
@@ -450,9 +449,7 @@ export default {
...
@@ -450,9 +449,7 @@ export default {
}
}
return
return
}
}
this
.
$nextTick
(()
=>
{
this
.
current
=
this
.
currentIndex
+
1
this
.
current
=
this
.
currentIndex
+
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