Commit 0cb93d80 authored by 晏成浩's avatar 晏成浩

Merge branch 'feature/20201222_show_student_answer' into 'master'

feat: 直播答题页面 See merge request !2
parents 3db23f41 3ad121da
......@@ -13,7 +13,6 @@
</div>
</div>
</div>
</div>
<div v-if="imgSrc" class="img-pre-box" @click="handleImgClick">
<img :src="imgSrc" alt="">
......
......@@ -109,16 +109,28 @@ const paintTypes = [
const streamTypes = [
]
// const imgs = [
// one,
// two,
// thr,
// four,
// five,
// six,
// siven,
// eight,
// nine
// ]
const imgs = [
one,
two,
thr,
four,
five,
six,
siven,
eight,
nine
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/1.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/2.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/3.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/4.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/5.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/6.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/7.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/8.png',
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/9.png',
]
Vue.use(GeekDrawBoard)
......@@ -172,7 +184,7 @@ export default {
this.$refs.pain_main && this.$refs.pain_main.requestFullscreen();
}
if (title === 'question-stop') {
this.eventId = `${new Date().getTime()}`
// this.eventId = `${new Date().getTime()}`
socket.sendGroupMsg({
type: 'question-stop',
payload: {
......@@ -208,11 +220,13 @@ export default {
payload: {
type,
title,
eventId: this.eventId
eventId: this.eventId,
img: this.currentImg
}
}, (res) => {
console.log('teacher send success: ', res);
// 暂时填入三个默认数据
this.showAnsModal = true // 弹出答题
this.replyList = [
{username: '阿槑',},
{username: '懒惰怪',},
......@@ -239,12 +253,12 @@ export default {
// // 处理假数据
const newAnswerList = JSON.parse(JSON.stringify(this.replyList))
// 保证 只赋值一次
let flag = true
// let flag = true
newAnswerList.forEach((item) => {
if (flag && !item.answer) {
if (!item.answer && item.username === username) {
item.type = payload.type
item.answer = payload.answer
flag = false
// flag = false
}
})
// 更新视图
......@@ -288,7 +302,7 @@ export default {
this.$el.addEventListener('click', () => {
this.ansModal = false
this.showAnsModal = false
}, true)
}, false)
}
}
</script>
......
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