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

fix: 修改问题

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