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