Commit 355096cf authored by Damon's avatar Damon

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

parent b48e41fe
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@change="swiperChange" @change="swiperChange"
circular 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="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;
}, },
/** /**
......
...@@ -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: '1000',
// 分页数据 // 分页数据
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
})
} }
}, },
// 保存答案 // 保存答案
......
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