Commit 90c0d518 authored by 晏成浩's avatar 晏成浩

feat: 抢答题

parent 84fe608b
......@@ -16,7 +16,7 @@
<div class="info-box">
<p>学生:{{ quickResponse.username }}</p>
<div class="answer-box">
<span>{{quickResponse.answer}}</span>
<span>{{`抢答成功`}}</span>
</div>
</div>
</div>
......@@ -35,7 +35,7 @@
</div>
</div>
</div>
<div v-if="imgSrc" class="img-pre-box" @click="handleImgClick" ref="imgBox">
<div v-if="imgSrc" class="img-pre-box" @click="handleImgClick" ref="imgBox" :style="{backgroundImage: `url(${questionImg?questionImg:'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/1.png'})`}">
<img :src="imgSrc" class="as-img" alt="">
<img :src="require('@/assets/images/icon-close.png')" @click="imgSrc = ''" class="close-img" alt="">
</div>
......@@ -49,7 +49,8 @@ export default {
name: 'answer-dialog',
props: {
replyList: {required: true, default: () => []},
quickResponse: {}
quickResponse: {},
questionImg: {}
},
data() {
return {
......@@ -61,6 +62,7 @@ export default {
},
mounted() {
console.log('answerList', this.replyList)
console.log([this.$refs.imgBox])
},
watch: {
quickResponse: {
......@@ -213,7 +215,7 @@ export default {
width: 100vw;
//background: rgba(0, 0, 0, .3);
background-size: 100% 100%;
background-image: url("//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/1.png");
//background-image: url("//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/1.png");
position: fixed;
left: 0;
top: 0;
......
......@@ -64,7 +64,7 @@
<!-- </template>-->
<!-- </div>-->
<!-- </div>-->
<answer-dialog v-if="showAnsModal" :quick-response="quickResponseData" @question-exit="handleQuestionExit" :reply-list="replyList"/>
<answer-dialog v-if="showAnsModal" :question-img="currentImg" :quick-response="quickResponseData" @question-exit="handleQuestionExit" :reply-list="replyList"/>
</div>
</template>
......@@ -253,7 +253,6 @@ export default {
if (type === 'answer' && this.eventId === payload.eventId) {
// 抢答题
if (`${payload.type}` === '2' && !this.quickResponseData) {
console.log('asdfffff')
this.quickResponseData = payload
newAnswerList.forEach((item) => {
if (!item.answer && item.username === username) {
......@@ -336,7 +335,7 @@ export default {
}, { passive: false });
this.$el.addEventListener('click', () => {
this.ansModal = false
this.showAnsModal = false
// this.showAnsModal = false
}, false)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment