提交 1d943992 authored 作者: lihuihui's avatar lihuihui

修改一道题收藏不了的问题

上级 bd09fba2
...@@ -177,6 +177,11 @@ export default { ...@@ -177,6 +177,11 @@ export default {
observer: true, observer: true,
autoHeight: true, autoHeight: true,
on: { on: {
init() {
setTimeout(() => {
_this.setCurrentCollect()
}, 500)
},
slideChangeTransitionStart: function() { slideChangeTransitionStart: function() {
_this.sildesHeightCount() _this.sildesHeightCount()
_this.setCurrentCollect() _this.setCurrentCollect()
...@@ -262,6 +267,9 @@ export default { ...@@ -262,6 +267,9 @@ export default {
methods: { methods: {
sildesHeightCount() { sildesHeightCount() {
// slides高度重新赋值 // slides高度重新赋值
if (document.getElementById('bottom-view-btn') === null) {
return false
}
const computedStyle = window.getComputedStyle(this.swiper.slides[this.swiper.activeIndex], null) const computedStyle = window.getComputedStyle(this.swiper.slides[this.swiper.activeIndex], null)
const topView = document.getElementById('top-view').clientHeight const topView = document.getElementById('top-view').clientHeight
const bottomView = document.getElementById('bottom-view-btn').clientHeight const bottomView = document.getElementById('bottom-view-btn').clientHeight
...@@ -675,7 +683,7 @@ export default { ...@@ -675,7 +683,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.currentNum = res.answers.answerPage + 1 this.currentNum = res.answers.answerPage + 1
this.swiper.slideTo(res.answers.answerPage, 0, false) this.swiper.slideTo(res.answers.answerPage, 0, false)
this.setCurrentCollect() // this.setCurrentCollect()
this.currentNum === this.questionsData.sheet.question_count ? this.nextBtnShow = false : this.nextBtnShow = true this.currentNum === this.questionsData.sheet.question_count ? this.nextBtnShow = false : this.nextBtnShow = true
}, 100) }, 100)
} }
...@@ -688,16 +696,16 @@ export default { ...@@ -688,16 +696,16 @@ export default {
this.requestData = datas this.requestData = datas
this.requestData2 = Object.keys(datas).length this.requestData2 = Object.keys(datas).length
} else { } else {
setTimeout(() => { // setTimeout(() => {
this.setCurrentCollect() // this.setCurrentCollect()
}, 300) // }, 300)
this.requestData = {} this.requestData = {}
this.requestData2 = 0 this.requestData2 = 0
} }
}) })
}, },
setCurrentCollect() { setCurrentCollect() {
if (!this.nextBtnShow) { if (this.swiper.activeIndex + 1 === this.swiper.slides.length) {
return false return false
} }
const itemDid = this.swiper.slides[this.swiper.activeIndex].attributes['data-dId'].nodeValue const itemDid = this.swiper.slides[this.swiper.activeIndex].attributes['data-dId'].nodeValue
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论