提交 25a4b287 authored 作者: lihuihui's avatar lihuihui

updata

上级 c78c9ef6
......@@ -71,7 +71,6 @@ export default {
}
},
mounted() {
// this.scrollDom()
},
data() {
return {
......@@ -85,6 +84,18 @@ export default {
}
},
methods: {
duplicates(arr) {
const newarr = []
for (let j = 0; j < arr.length; j++) {
for (let i = j + 1; i < arr.length; i++) {
if (arr[j].type === arr[i].type) {
arr[j].question_list = arr[j].question_list.concat(arr[i].question_list)
newarr.push(arr[j])
}
}
}
return Array.from(new Set(newarr))
},
go(id) {
this.$emit('cardChange', id)
this.$emit('showCard')
......@@ -94,7 +105,6 @@ export default {
const clientHeight = document.documentElement.clientHeight
const bottomView = document.getElementById('bottom-view2')
bottomView.style.height = (clientHeight - topViewH) + 'px'
console.log(bottomView.style.height)
}
},
computed: {
......@@ -104,7 +114,6 @@ export default {
dataList() {
let num = 1
return this.questionsData.questions.map(item => {
// console.log(this.questionsData.questions.find(items => { return items.type }))
item.question_list.map((subitem, index) => {
subitem.num = num + index
return subitem
......@@ -120,6 +129,12 @@ export default {
this.$forceUpdate()
},
deep: true
},
questionsData: {
handler(newV, oldV) {
// console.log(this.duplicates(this.questionsData.questions))
// this.questionsData.questions =
}
}
}
}
......
......@@ -165,9 +165,10 @@ export default {
swiperSign: 0,
swiperOptions: {
observer: true,
autoHeight: true,
on: {
slideChangeTransitionStart: function() {
_this.scrollDom()
// _this.scrollDom()
_this.getIsSign()
if (this.activeIndex === _this.questionsData.sheet.question_count) {
_this.topicCard.isShow = true
......@@ -359,7 +360,7 @@ export default {
document.getElementById('bottom-view').scrollTop = 0
this.topicCard.isShow = true
this.swiper.slideTo(this.questionsData.sheet.question_count, 0, false)
this.scrollDom()
// this.scrollDom()
},
// 标记
signQuestion() {
......@@ -463,9 +464,9 @@ export default {
// 显示隐藏解析
analyShow() {
this.isAnalysis = !this.isAnalysis
setTimeout(() => {
this.scrollDom()
}, 500)
// setTimeout(() => {
// this.scrollDom()
// }, 500)
},
// 单选事件 判断题事件
selectRadio(cData, checkId, index, oData) {
......@@ -551,13 +552,13 @@ export default {
const topViewH = document.getElementById('top-view').offsetHeight
const clientHeight = document.documentElement.clientHeight
const bottomView = document.getElementById('bottom-view')
const domH = this.swiper.slides[this.swiper.activeIndex].clientHeight
// const domH = this.swiper.slides[this.swiper.activeIndex].clientHeight
bottomView.style.height = (clientHeight - topViewH) + 'px'
if (domH - 50 >= (clientHeight - topViewH)) {
this.classHide = true
} else {
this.classHide = false
}
// if (domH - 50 >= (clientHeight - topViewH)) {
// this.classHide = true
// } else {
// this.classHide = false
// }
},
initData(n) {
const param = this.requestParam
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论