main
xy 2 years ago
parent 7a37ee72ad
commit f380221fff

@ -85,7 +85,7 @@
<template>
<template v-if="!isTotalEnd">
<div class="answers__text answers__result">
打卡成功已完成<span>{{detail.point_answer_total + 1}}</span>个红色场馆的打卡 完成{{detail.points.length}}家红色场馆打卡即可获得<span>荣誉证书</span>
打卡成功已完成<span>{{ totalDone }}</span>个红色场馆的打卡 完成{{ detail.points ? detail.points.length : 0}}家红色场馆打卡即可获得<span>荣誉证书</span>
</div>
<div class="answers__btn" @click="$u.throttle(toMap)">
@ -127,12 +127,12 @@ export default {
methods: {
async getDetail () {
const res = await this.$u.api.getPoints()
this.isTotalEnd = res.points.length == res.point_answer_total
this.isTotalEnd = res.points?.length == res.point_answer_total
this.detail = res
},
async getQuestions () {
async getQuestions (id) {
const res = await this.$u.api.getQuestions({
point_id: this.vuex_point_id
point_id: id
})
this.answers = res.questions
@ -148,12 +148,12 @@ export default {
setTimeout(() => {
this.progress = this.now === (this.answers.length - 1) ? 3 : 2
this.progress = this.now === (this.answers?.length - 1) ? 3 : 2
if (this.progress === 3) {
this.isTotalEnd = this.detail.points.length == ( Number(this.detail.point_answer_total) + 1)
this.isTotalEnd = this.detail.points?.length == ( Number(this.detail.point_answer_total) + 1)
this.$u.api.saveQuiz({
point_id: this.vuex_point_id,
point_id: this.$route.query?.id ? this.$route.query.id : this.vuex_point_id,
answers: this.myAnswers
})
}
@ -175,6 +175,15 @@ export default {
}
},
computed: {
totalDone () {
if (this.detail && this.detail.points) {
let id = this.$route.query?.id ? this.$route.query.id : this.vuex_point_id
let point = this.detail.points.find(i => i.id == id)
return point?.has_answer > 0 ? this.detail.point_answer_total : this.detail.point_answer_total+1
}
return 1
},
correctAnswer () {
let correct = this.answers[this.now]?.options?.find(i => i.is_correct)
return `${this.num(correct?.myindex)}${correct?.title}`
@ -246,8 +255,8 @@ export default {
}
}
},
onShow() {
this.getQuestions();
onLoad(option) {
this.getQuestions(option.id);
this.getDetail();
}
}

@ -14,7 +14,7 @@ export default {
methods: {
toAnswer () {
uni.navigateTo({
url: '/pages/answer/answer'
url: `/pages/answer/answer?id=${this.$route.query?.id}`
})
},
@ -60,7 +60,7 @@ export default {
uni.hideLoading()
}
},
onLoad () {
onLoad (option) {
if (this.flag) {
uni.showLoading({
mask: true,
@ -71,9 +71,9 @@ export default {
this.$nextTick(() => {
this.$refs['iframe'].onload = async () => {
let detail = await this.getDetail(this.vuex_point_id)
let detail = await this.getDetail(option.id)
let vrs = detail.content
let images = await this.getImages(this.vuex_point_id)
let images = await this.getImages(option.id)
this.$refs['iframe'].contentWindow.setDomData({ detail: detail.points , vrs: vrs, images: images.data })
}
})

@ -14,6 +14,7 @@
:key="index"
:style="{ 'transform': `translate(calc(${area.w * item.x / 100}px - 50%),calc(${area.h * item.y / 100}px - 50%))` }"
@click="$u.throttle(() => toDetail(item))">
<u-image v-if="item.has_answer > 0" class="pointer__flag" :width="43" :height="50" :src="require('@/static/flag.png')"></u-image>
<div class="pointer__horn" :class="{ 'pointer__horn--active': item.has_answer > 0 }" :style="{ 'transform': `translate(-3rpx, calc(-50% - 4rpx)) rotate(${item.d}deg)` }"></div>
<div class="box" :style="{ 'transform': transformBox(item.d) }">
@ -114,7 +115,7 @@ export default {
toDetail (item) {
this.$u.vuex('vuex_point_id', item.id)
uni.navigateTo({
url: `/pages/detail/detail`
url: `/pages/detail/detail?id=${item.id}`
})
},
@ -138,7 +139,7 @@ export default {
this.done = res.point_answer_total || 0
this.pointers = res.points?.map((i, index) => {
return {
d: convertToEquivalentAngle(70 * index + 1),
d: convertToEquivalentAngle(53 * index + 1),
...i
}
})
@ -226,6 +227,13 @@ export default {
position: relative;
&__flag {
transform: translate(0%, -34rpx);
position: absolute;
top: 0;
left: 0;
}
&__horn {
width: 20rpx;
height: 26rpx;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -41,10 +41,10 @@
<div class="wrapper">
<div class="clearfix study-swiperbox">
<div class="study-party">
<div class="swiper-btn">
<li class="videonum">2</li>
<li class="picnum">6</li>
</div>
<!-- <div class="swiper-btn">-->
<!-- <li class="videonum">2</li>-->
<!-- <li class="picnum">6</li>-->
<!-- </div>-->
<!-- 视频轮播图 -->
<div class="swiper-list" data-num="0">
<div class="swiper-container" id="swiper0">
@ -64,9 +64,9 @@
</div>
</div>
<!-- 右边固定栏 -->
<div class="study-right">
<img src="skin/default/images/rightimg.jpg">
</div>
<!-- <div class="study-right">-->
<!-- <img src="skin/default/images/rightimg.jpg">-->
<!-- </div>-->
</div>
<div class="studyContent">
<!-- 详情 -->

@ -252,8 +252,7 @@ textarea::-webkit-input-placeholder{ color:#aaa; }
}
.study-party{
float: left;
width: 69.489%;
width: 100%;
position: relative;
}
.swiper-btn{
@ -392,13 +391,14 @@ textarea::-webkit-input-placeholder{ color:#aaa; }
}
.answer-start{
width:100%;
height: 7.5rem;
height: 10.5rem;
margin:0 auto;
margin-top: 1.4rem;
background: url(../images/answerbg.png) no-repeat center top;
background-size: 100% auto;
padding-top: 4.2rem;
padding-left: 8.8rem;
padding-top: 5.2rem;
padding-left: 10.8rem;
padding-right: 2rem;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;

Loading…
Cancel
Save