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

updata

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