Commit 355096cf authored by Damon's avatar Damon

fix: 【ID1001314】【小程序-首页-答题模式】:答对试题后自动跳转到下一页的速度太快,需要优化。

parent b48e41fe
......@@ -7,7 +7,7 @@
@change="swiperChange"
circular
>
<swiper-item v-for="(item, index) in swiperList" :key="index" class="swiper-items">
<swiper-item v-for="(item, i) in swiperList" :key="i">
<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="content">
......@@ -69,8 +69,8 @@ export default {
},
// 值为0禁止切换动画
swiperDuration: {
type: Number,
default: 1000
type: String,
default: '250'
},
// 分页需要传此数据
total: {
......@@ -86,7 +86,7 @@ export default {
// 此值控制swiper的位置
swiperCurrent: 0,
// 当前swiper渲染的items
swiperList: [],
swiperList: [1, 2, 3],
}
},
watch: {
......@@ -216,7 +216,6 @@ export default {
swiperList[current] = currentItem
swiperList[this.getLastSwiperChangeIndex(current)] = this.getLastSwiperNeedItem(currentItem, list)
swiperList[this.getNextSwiperChangeIndex(current)] = this.getNextSwiperNeedItem(currentItem, list)
console.log("swiperList", swiperList)
return swiperList;
},
/**
......
......@@ -36,7 +36,6 @@
<view class="swiper">
<swiper-limited-load
ref="swiper"
:swiperHeight="500"
:swiperDuration="swiperDuration"
:list="list"
:current="current"
......@@ -179,7 +178,7 @@ export default {
current: 0,
// 仅仅记录swiper的位置
currentIndex: 0,
swiperDuration: '0',
swiperDuration: '1000',
// 分页数据
currentPage: 1,
pageSize: 100,
......@@ -441,7 +440,7 @@ export default {
}
}
// 如果回答错误或者是考试模式,自动进入下一题
// 如果回答正确或者是考试模式,自动进入下一题
if ((status === 'pass' && this.model !== 2) || this.type === 2) {
if (this.currentIndex + 1 > this.total - 1) { // 最后一题回答后
if (this.type === 2) { // 统计分数,交卷
......@@ -450,9 +449,7 @@ export default {
}
return
}
this.$nextTick(() => {
this.current = this.currentIndex + 1
})
this.current = this.currentIndex + 1
}
},
// 保存答案
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment