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

feat: 抢答题

parent 84fe608b
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="info-box"> <div class="info-box">
<p>学生:{{ quickResponse.username }}</p> <p>学生:{{ quickResponse.username }}</p>
<div class="answer-box"> <div class="answer-box">
<span>{{quickResponse.answer}}</span> <span>{{`抢答成功`}}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</div> </div>
</div> </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="imgSrc" class="as-img" alt="">
<img :src="require('@/assets/images/icon-close.png')" @click="imgSrc = ''" class="close-img" alt=""> <img :src="require('@/assets/images/icon-close.png')" @click="imgSrc = ''" class="close-img" alt="">
</div> </div>
...@@ -49,7 +49,8 @@ export default { ...@@ -49,7 +49,8 @@ export default {
name: 'answer-dialog', name: 'answer-dialog',
props: { props: {
replyList: {required: true, default: () => []}, replyList: {required: true, default: () => []},
quickResponse: {} quickResponse: {},
questionImg: {}
}, },
data() { data() {
return { return {
...@@ -61,6 +62,7 @@ export default { ...@@ -61,6 +62,7 @@ export default {
}, },
mounted() { mounted() {
console.log('answerList', this.replyList) console.log('answerList', this.replyList)
console.log([this.$refs.imgBox])
}, },
watch: { watch: {
quickResponse: { quickResponse: {
...@@ -213,7 +215,7 @@ export default { ...@@ -213,7 +215,7 @@ export default {
width: 100vw; width: 100vw;
//background: rgba(0, 0, 0, .3); //background: rgba(0, 0, 0, .3);
background-size: 100% 100%; 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; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<!-- </template>--> <!-- </template>-->
<!-- </div>--> <!-- </div>-->
<!-- </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> </div>
</template> </template>
...@@ -253,7 +253,6 @@ export default { ...@@ -253,7 +253,6 @@ export default {
if (type === 'answer' && this.eventId === payload.eventId) { if (type === 'answer' && this.eventId === payload.eventId) {
// 抢答题 // 抢答题
if (`${payload.type}` === '2' && !this.quickResponseData) { if (`${payload.type}` === '2' && !this.quickResponseData) {
console.log('asdfffff')
this.quickResponseData = payload this.quickResponseData = payload
newAnswerList.forEach((item) => { newAnswerList.forEach((item) => {
if (!item.answer && item.username === username) { if (!item.answer && item.username === username) {
...@@ -336,7 +335,7 @@ export default { ...@@ -336,7 +335,7 @@ export default {
}, { passive: false }); }, { passive: false });
this.$el.addEventListener('click', () => { this.$el.addEventListener('click', () => {
this.ansModal = false this.ansModal = false
this.showAnsModal = false // this.showAnsModal = false
}, 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