Commit 4accd242 authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents ba914bef a970d48b
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
// 此值控制swiper的位置 // 此值控制swiper的位置
swiperCurrent: 0, swiperCurrent: 0,
// 当前swiper渲染的items // 当前swiper渲染的items
swiperList: [1, 2, 3], swiperList: [],
} }
}, },
watch: { watch: {
...@@ -126,6 +126,7 @@ export default { ...@@ -126,6 +126,7 @@ export default {
this.swiperCurrent = current this.swiperCurrent = current
}, },
answerChange(status, lists, userAnswer) { answerChange(status, lists, userAnswer) {
this.$set(this.swiperList[this.swiperIndex], 'answerList', lists)
this.$set(this.swiperList[this.swiperIndex], 'errShow', this.type === 2 ? true : status === 'fail') this.$set(this.swiperList[this.swiperIndex], 'errShow', this.type === 2 ? true : status === 'fail')
this.$set(this.swiperList[this.swiperIndex], 'submitStatus', true) this.$set(this.swiperList[this.swiperIndex], 'submitStatus', true)
this.$emit("answerChange", status, lists, userAnswer) this.$emit("answerChange", status, lists, userAnswer)
...@@ -216,6 +217,7 @@ export default { ...@@ -216,6 +217,7 @@ 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;
}, },
/** /**
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
background="transparent" background="transparent"
titleColor="#191C27" titleColor="#191C27"
:border-bottom="false" :border-bottom="false"
:custom-back="customBack"
title="答题" title="答题"
title-bold title-bold
></u-navbar> ></u-navbar>
...@@ -320,7 +321,22 @@ export default { ...@@ -320,7 +321,22 @@ export default {
this.loadMore(current) this.loadMore(current)
}, },
// 返回
customBack() {
if (this.source === 3) { // 如果已答题,点击返回提示交卷
const count = this.list.reduce((accumulator, currentValue) => {
if (currentValue.submitStatus) accumulator++
return accumulator
}, 0)
if (count > 1) {
this.handPapers()
return
}
}
this.$u.route({
type: 'back'
})
},
loadMore(current) { loadMore(current) {
let list = this.list let list = this.list
......
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