提交 507be808 authored 作者: lihuihui's avatar lihuihui

修改购买页

上级 21704d98
src/assets/images/pay/c4.png

159.7 KB | W: | H:

src/assets/images/pay/c4.png

94.0 KB | W: | H:

src/assets/images/pay/c4.png
src/assets/images/pay/c4.png
src/assets/images/pay/c4.png
src/assets/images/pay/c4.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/images/pay/c5.png

279.4 KB | W: | H:

src/assets/images/pay/c5.png

179.4 KB | W: | H:

src/assets/images/pay/c5.png
src/assets/images/pay/c5.png
src/assets/images/pay/c5.png
src/assets/images/pay/c5.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="title" >{{ answerData['1'].title }}</div> <div class="title" >{{ answerData['1'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['1'].data"> <template v-for="(item, index) in answerData['1'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li> <li @click="go(item.id, item.num)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li>
</template> </template>
</ul> </ul>
</template> </template>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="title" >{{ answerData['2'].title }}</div> <div class="title" >{{ answerData['2'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['2'].data"> <template v-for="(item, index) in answerData['2'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li> <li @click="go(item.id, item.num)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li>
</template> </template>
</ul> </ul>
</template> </template>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="title" >{{ answerData['6'].title }}</div> <div class="title" >{{ answerData['6'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['6'].data"> <template v-for="(item, index) in answerData['6'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li> <li @click="go(item.id, item.num)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li>
</template> </template>
</ul> </ul>
</template> </template>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="title" >{{ answerData['5'].title }}</div> <div class="title" >{{ answerData['5'].title }}</div>
<ul> <ul>
<template v-for="(item, index) in answerData['5'].data"> <template v-for="(item, index) in answerData['5'].data">
<li @click="go(item.id)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li> <li @click="go(item.id, item.num)" :data-id="item.id" :key="index" :class="item.sign == true ? 'active2' : item.answer == undefined ? 'active3' : item.answer.length == 0 ? 'active3' : 'active1'">{{ item.num }}</li>
</template> </template>
</ul> </ul>
</template> </template>
...@@ -114,12 +114,11 @@ export default { ...@@ -114,12 +114,11 @@ export default {
} }
}, },
methods: { methods: {
go(id) { go(id, num) {
console.log(id)
setTimeout(() => { setTimeout(() => {
this.$emit('showCard') this.$emit('showCard')
}, 200) }, 200)
this.$emit('cardChange', id) this.$emit('cardChange', { id: id, num: parseInt(num / 10) })
}, },
scrollDom() { scrollDom() {
const topViewH = document.getElementById('top-view2').offsetHeight const topViewH = document.getElementById('top-view2').offsetHeight
......
...@@ -14,10 +14,13 @@ ...@@ -14,10 +14,13 @@
<swiper ref="mySwiper" :options="swiperOptions"> <swiper ref="mySwiper" :options="swiperOptions">
<template v-for="(item) in questionsData.questions"> <template v-for="(item) in questionsData.questions">
<template v-for="(dItem, dIndex) in item.question_list"> <template v-for="(dItem, dIndex) in item.question_list">
<swiper-slide :key="dIndex+dItem.id" :data-dId="dItem.id" :data-cId="item.id" :indexs="dItem.num"> <swiper-slide
<!-- v-if="dItem.num <= (countPage.currentPage + 1) * countPage.showQuestionNum && dItem.num >= ((countPage.currentPage == 1 ? 0 : countPage.currentPage) - 2) * countPage.showQuestionNum" --> :key="dIndex+dItem.id"
:data-dId="dItem.id"
:data-cId="item.id"
:indexs="dItem.num">
<!-- v-if="dItem.num <= countPage.currentPage * countPage.showQuestionNum && dItem.num >= countPage.currentPage * countPage.showQuestionNum - 20" -->
<div class="title"> <div class="title">
<!-- {{dItem.num}}-{{(countPage.currentPage + 1) * countPage.showQuestionNum}}==={{dItem.num}}-{{((countPage.currentPage == 1 ? 0 : countPage.currentPage) - 2) * countPage.showQuestionNum}} -->
<div class="type" v-if="item.type == 1">单选题</div> <div class="type" v-if="item.type == 1">单选题</div>
<div class="type" v-if="item.type == 2">多选题</div> <div class="type" v-if="item.type == 2">多选题</div>
<div class="type" v-if="item.type == 5">案例题</div> <div class="type" v-if="item.type == 5">案例题</div>
...@@ -254,6 +257,9 @@ export default { ...@@ -254,6 +257,9 @@ export default {
_this.requestData.answerPage = this.activeIndex _this.requestData.answerPage = this.activeIndex
}, },
slidePrevTransitionEnd: function() { slidePrevTransitionEnd: function() {
// if (this.activeIndex === 0) {
// _this.prevQuestionLoading()
// }
if (this.activeIndex === _this.questionsData.sheet.question_count - 1) { if (this.activeIndex === _this.questionsData.sheet.question_count - 1) {
this.slideTo(_this.swiperSign, 0, false) this.slideTo(_this.swiperSign, 0, false)
_this.currentNum = this.activeIndex + 1 _this.currentNum = this.activeIndex + 1
...@@ -261,10 +267,6 @@ export default { ...@@ -261,10 +267,6 @@ export default {
_this.sildesHeightCount() _this.sildesHeightCount()
_this.setCurrentCollect() _this.setCurrentCollect()
_this.getIsSign() _this.getIsSign()
} else {
// if (this.activeIndex === 0) {
// _this.prevQuestionLoading()
// }
} }
}, },
slideNextTransitionEnd: function() { slideNextTransitionEnd: function() {
...@@ -332,28 +334,27 @@ export default { ...@@ -332,28 +334,27 @@ export default {
}, },
methods: { methods: {
prevQuestionLoading() { prevQuestionLoading() {
const qId = this.swiper.slides[this.swiper.activeIndex].attributes['data-cId'].nodeValue const dId = this.swiper.slides[this.swiper.activeIndex].attributes['data-dId'].nodeValue
console.log(qId, this.questionsData.questions) this.countPage.currentPage--
// const item = this.questionData.list.find(item => { return item.question_id === qId }) this.$nextTick(() => {
for (let i = 0; i < this.swiper.slides.length; i++) {
if (this.swiper.slides[i].attributes['data-dId']) {
this.swiper.slides[i].attributes['data-dId'].nodeValue === dId && (this.swiper.slideTo(i, 0, false))
}
this.currentNum = this.swiper.activeIndex
}
})
}, },
nextQuestionLoading() { nextQuestionLoading() {
// countPage: {
// currentPage: 1,
// showQuestionNum: 10
// },
const dId = this.swiper.slides[this.swiper.activeIndex].attributes['data-dId'].nodeValue const dId = this.swiper.slides[this.swiper.activeIndex].attributes['data-dId'].nodeValue
this.countPage.currentPage += this.countPage.currentPage this.countPage.currentPage++
this.$nextTick(() => { this.$nextTick(() => {
for (let i = 0; i < this.swiper.slides.length; i++) { for (let i = 0; i < this.swiper.slides.length; i++) {
console.log(i)
if (this.swiper.slides[i].attributes['data-dId']) { if (this.swiper.slides[i].attributes['data-dId']) {
this.swiper.slides[i].attributes['data-dId'].nodeValue === dId && (this.swiper.slideTo(i, 0, false)) this.swiper.slides[i].attributes['data-dId'].nodeValue === dId && (this.swiper.slideTo(i, 0, false))
} }
} }
}) })
// console.log(dId, this.questionsData.questions)
// this.swiper.slideTo(0, 0, false)
// console.log(this.swiper.slides.length)
}, },
sildesHeightCount() { sildesHeightCount() {
// slides高度重新赋值 // slides高度重新赋值
...@@ -490,7 +491,9 @@ export default { ...@@ -490,7 +491,9 @@ export default {
this.isExamEnd = false this.isExamEnd = false
}, },
// 答题卡点击跳题 // 答题卡点击跳题
cardChange(e) { cardChange(data) {
const e = data.id
this.countPage.currentPage = data.num
for (let i = 0; i < this.questionsData.sheet.question_count; i++) { for (let i = 0; i < this.questionsData.sheet.question_count; i++) {
if (this.swiper.slides[i].attributes['data-dId'].nodeValue === e) { if (this.swiper.slides[i].attributes['data-dId'].nodeValue === e) {
setTimeout(() => { setTimeout(() => {
......
...@@ -203,9 +203,9 @@ export default { ...@@ -203,9 +203,9 @@ export default {
right: 0; right: 0;
width:3.3rem; width:3.3rem;
height:1rem; height:1rem;
background:linear-gradient(-90deg,rgba(204,158,94,1),rgba(247,214,161,1)); background:linear-gradient(-90deg,rgba(204,157,93,1),rgba(247,213,161,1));
font-size:.37rem; font-size:.37rem;
color:rgba(81,42,4,1); color:rgba(80,41,3,1);
line-height:1rem; line-height:1rem;
text-align: center; text-align: center;
} }
......
...@@ -203,9 +203,9 @@ export default { ...@@ -203,9 +203,9 @@ export default {
right: 0; right: 0;
width:3.3rem; width:3.3rem;
height:1rem; height:1rem;
background:linear-gradient(-90deg,rgba(204,158,94,1),rgba(247,214,161,1)); background:linear-gradient(-90deg,rgba(204,157,93,1),rgba(247,213,161,1));
font-size:.37rem; font-size:.37rem;
color:rgba(81,42,4,1); color:rgba(80,41,3,1);
line-height:1rem; line-height:1rem;
text-align: center; text-align: center;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论