Commit 3977b8ff authored by 刘阳's avatar 刘阳

fix: 修改问题

parent cbd42274
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
ref="draw" ref="draw"
:points="paints[currentIndex]" :points="paints[currentIndex]"
:paintType="paintType" :paintType="paintType"
:drawType="drawType"
class="draw-board" class="draw-board"
/> />
<div class="tools-wrap"> <div class="tools-wrap">
...@@ -19,15 +20,15 @@ ...@@ -19,15 +20,15 @@
<el-button @click="sendAnswer" <el-button @click="sendAnswer"
type="primary" type="primary"
class="itm" class="itm"
:disabled="disabled">提交 :disabled="false">提交
</el-button> </el-button>
</div> </div>
</div> </div>
<div v-if="questionType === 0"> <div >
<div class="ans-wrap"> <div v-if="questionType === 3" class="ans-wrap">
<el-button <el-button
v-for="itm in Answers" v-for="itm in Answers"
:disabled="disabled" :disabled="disable"
@click="chooseAnswer(itm.value)" @click="chooseAnswer(itm.value)"
:key="itm.value" :key="itm.value"
type="primary" type="primary"
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<el-button v-if="questionType === 0 " <el-button v-if="questionType === 3"
type="primary" type="primary"
@click="sendAnswer" @click="sendAnswer"
:disabled="disabled" :disabled="disabled"
...@@ -80,7 +81,8 @@ export default { ...@@ -80,7 +81,8 @@ export default {
currentIndex: '', currentIndex: '',
questionType: -1, questionType: -1,
paintTypes, paintTypes,
getMsg: {} getMsg: {},
drawType: 'mouse'
}; };
}, },
methods: { methods: {
...@@ -98,7 +100,7 @@ export default { ...@@ -98,7 +100,7 @@ export default {
}, },
sendAnswer() { sendAnswer() {
let msg = '' let msg = ''
if (this.questionType === 0) { if (this.questionType === 3) {
msg = this.currentAns msg = this.currentAns
} else if (this.questionType === 1 || this.questionType === 2) { } else if (this.questionType === 1 || this.questionType === 2) {
msg = this.$refs.draw.getImg() msg = this.$refs.draw.getImg()
...@@ -106,11 +108,12 @@ export default { ...@@ -106,11 +108,12 @@ export default {
msg = '' msg = ''
} }
socket.sendGroupMsg( socket.sendGroupMsg(
{ {
type: 'answer',
payload: { payload: {
type: this.questionType, type: this.questionType,
answer: msg, answer: msg,
username: this.$route.query.username || ''
} }
}, },
(data) => { (data) => {
...@@ -126,8 +129,10 @@ export default { ...@@ -126,8 +129,10 @@ export default {
// "payload":{"type":0,"title":"选择题"}}] // "payload":{"type":0,"title":"选择题"}}]
if (msg && msg.from && msg.from.indexOf('teacher') > -1 && msg.payload.type > -1) { if (msg && msg.from && msg.from.indexOf('teacher') > -1 && msg.payload.type > -1) {
this.questionType = msg.payload.type this.questionType = msg.payload.type
} if (this.questionType === 3) {
console.log('msg', this.questionType); this.disabled = false
}
}
} }
}, },
beforeDestroy() { beforeDestroy() {
...@@ -136,6 +141,8 @@ export default { ...@@ -136,6 +141,8 @@ export default {
}, },
mounted() { mounted() {
this.paintType = 'pencil'; this.paintType = 'pencil';
this.drawType = 'mouse'
navigator.userAgent.toLowerCase();
socket.onMsg(this.dealMsg); socket.onMsg(this.dealMsg);
document.body.addEventListener('touchmove', (e) => { document.body.addEventListener('touchmove', (e) => {
e.preventDefault(); e.preventDefault();
...@@ -181,7 +188,7 @@ export default { ...@@ -181,7 +188,7 @@ export default {
margin: 10px 30px; margin: 10px 30px;
} }
.ans-itm-select { .ans-itm-select {
background-color: rgb(18, 72, 134); background-color: rgb(29, 126, 236);
} }
} }
.ans-commit { .ans-commit {
......
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