Commit 48ab8111 authored by 甘瑞文's avatar 甘瑞文

新的课件

parent 0cb93d80
...@@ -3,7 +3,7 @@ import axios from 'axios' ...@@ -3,7 +3,7 @@ import axios from 'axios'
// const socketUrl = 'ws://payx.jkwljy.com/socket.io' // const socketUrl = 'ws://payx.jkwljy.com/socket.io'
const socketUrl = 'http://192.168.32.53:7001/' const socketUrl = 'http://172.10.1.208:7001/'
const http = axios.create({ const http = axios.create({
baseURL: socketUrl, baseURL: socketUrl,
......
<template> <template>
<div ref="gk_screen_std" class="gk-screen-std"> <div ref="gk_screen_std" class="gk-screen-std" :style="backgroundStyle">
<div ref="vd"> <div ref="vd">
<geek-draw-board <geek-draw-board
ref="draw" ref="draw"
:paintType="paintType" :paintType="paintType"
class="draw-board" class="draw-board"
paintColor='#F0F' paintColor='#F0F'
paintWidth='10'
:bgImg='img'
/> />
<div class="tools-wrap"> <div class="tools-wrap">
<el-button <el-button
...@@ -18,11 +20,12 @@ ...@@ -18,11 +20,12 @@
</el-button> </el-button>
<el-button @click="handleSubmit" <el-button @click="handleSubmit"
type="primary" type="primary"
class="itm btn-submit">提交 class="itm btn-submit"
</el-button> v-if="step !== 'stopped'"
>提交</el-button>
</div> </div>
</div> </div>
<div v-if="this.stage === 'submitted' || this.submitting" class="submit-mask"> <div v-if="step === 'submitted' || submitting" class="submit-mask">
<h1>已提交</h1> <h1>已提交</h1>
</div> </div>
<!-- <div class="none" v-if="questionType === -1" >暂无题目作答,请等候老师发送</div> --> <!-- <div class="none" v-if="questionType === -1" >暂无题目作答,请等候老师发送</div> -->
...@@ -50,15 +53,24 @@ export default { ...@@ -50,15 +53,24 @@ export default {
eventId: { eventId: {
type: String, type: String,
required: true required: true
},
img: {
type: String,
required: true
} }
}, },
data() { data() {
return { return {
stage: 'unsubmit', step: 'unsubmit',
paints: [], paints: [],
paintType: 'pencil', paintType: 'pencil',
paintTypes, paintTypes,
submitting: false submitting: false,
backgroundStyle: {
background:'#FFF url(' + this.img + ') no-repeat',
backgroundSize: 'contain',
backgroundPosition: 'center'
}
}; };
}, },
methods: { methods: {
...@@ -72,6 +84,7 @@ export default { ...@@ -72,6 +84,7 @@ export default {
}, },
handleSubmit() { handleSubmit() {
const msg = this.$refs.draw.getImg() const msg = this.$refs.draw.getImg()
console.log(msg);
this.submitting = true this.submitting = true
socket.sendGroupMsg( socket.sendGroupMsg(
{ {
...@@ -85,21 +98,21 @@ export default { ...@@ -85,21 +98,21 @@ export default {
}, },
(data) => { (data) => {
console.log('回执', data) console.log('回执', data)
this.stage = 'submitted' this.step = 'submitted'
this.submitting = false this.submitting = false
} }
); );
}, },
onMsg(msg) { onMsg(msg) {
console.log('msg', msg); console.log('select-question onmsg: ', msg);
this.getMsg = msg if (!msg || !msg.from || msg.from.indexOf('teacher') < 0 || !msg.payload) {
// 42["msg",{"from":"teacher-1608135771425","type":"question", return
// "payload":{"type":0,"title":"选择题"}}]
if (msg && msg.from && msg.from.indexOf('teacher') > -1 && msg.payload.type > -1) {
this.disabled = false
} }
if (msg.type === 'question-stop' && msg.payload.eventId === this.eventId) {
this.step = 'stopped'
} }
}, },
},
beforeDestroy() { beforeDestroy() {
socket.offMsg(this.onMsg); socket.offMsg(this.onMsg);
}, },
......
<template> <template>
<div class="gk-screen-std"> <div class="gk-screen-std">
<h1>请等待...</h1> <p><i class="el-icon-lock"></i></p>
</div> </div>
</template> </template>
...@@ -33,5 +33,8 @@ export default { ...@@ -33,5 +33,8 @@ export default {
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
p{
font-size: 150px;
}
} }
</style> </style>
<template> <template>
<div class="gk-screen-std"> <div class="gk-screen-std">
<h1 v-if="this.stage === 'counting'">{{this.countingText}}</h1> <h1 v-if="step === 'counting'">{{countingText}}</h1>
<el-button <el-button
v-if="this.stage === 'racing'" v-if="step === 'racing'"
type="primary" type="primary"
@click="handleSubmit" @click="handleSubmit"
:class="this.submitting ? 'race' : 'race active'" :class="submitting ? 'race' : 'race active'"
> >
<i class="el-icon-thumb"></i> <i class="el-icon-thumb"></i>
</el-button> </el-button>
<h1 v-if="this.stage === 'submitted'"><i class="el-icon-loading"></i></h1> <h1 v-if="this.step === 'submitted'"><i class="el-icon-loading"></i></h1>
<!-- <h1 v-if="this.stage === 'submitted'">已提交</h1> --> <h1 v-if="step === 'stopped'">已结束</h1>
<!-- <h1 v-if="this.step === 'submitted'">已提交</h1> -->
</div> </div>
</template> </template>
...@@ -24,14 +25,18 @@ export default { ...@@ -24,14 +25,18 @@ export default {
eventId: { eventId: {
type: String, type: String,
required: true required: true
},
img: {
type: String,
required: true
} }
}, },
data() { data() {
return { return {
counttimes: 5, counttimes: 5,
stage: 'counting', step: 'counting',
isme: false, isme: false,
eventId: 0 submitting: false
}; };
}, },
computed: { computed: {
...@@ -42,6 +47,9 @@ export default { ...@@ -42,6 +47,9 @@ export default {
methods: { methods: {
handleSubmit() { handleSubmit() {
console.log('===handleSubmit==='); console.log('===handleSubmit===');
if(this.submitting){
return
}
this.submitting = true this.submitting = true
socket.sendGroupMsg({ socket.sendGroupMsg({
type: 'answer', type: 'answer',
...@@ -53,19 +61,26 @@ export default { ...@@ -53,19 +61,26 @@ export default {
} }
}, },
(data) => { (data) => {
this.stage = 'submitted' this.submitting = false
this.step = 'submitted'
console.log('回执', data); console.log('回执', data);
}); });
}, },
onMsg() { onMsg(msg) {
console.log('select-question onmsg: ', msg);
if (!msg || !msg.from || msg.from.indexOf('teacher') < 0 || !msg.payload) {
return
}
if (msg.type === 'question-stop' && msg.payload.eventId === this.eventId) {
this.step = 'stopped'
}
}, },
startCountdown() { startCountdown() {
if (this.intervalId) { if (this.intervalId) {
clearInterval(this.intervalId) clearInterval(this.intervalId)
} }
this.intervalId = 0 this.intervalId = 0
this.stage = 'counting' this.step = 'counting'
this.sending = false this.sending = false
this.intervalId = setInterval(this.countdown, 1000) this.intervalId = setInterval(this.countdown, 1000)
}, },
...@@ -74,7 +89,7 @@ export default { ...@@ -74,7 +89,7 @@ export default {
if (this.intervalId) { if (this.intervalId) {
clearInterval(this.intervalId) clearInterval(this.intervalId)
} }
this.stage = 'racing' this.step = 'racing'
this.intervalId = 0 this.intervalId = 0
return return
} }
......
<template> <template>
<div class="gk-screen-std"> <div class="gk-screen-std" :style="backgroundStyle">
<el-card class="select-card" v-show="step === 'unsubmit'" v-loading="submitting"> <el-card class="select-card" v-show="step === 'unsubmit'" v-loading="submitting">
<div slot="header" class="clearfix select-card-header"> <div slot="header" class="clearfix select-card-header">
<span>请选择</span> <span>请选择</span>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<div slot="header"> <div slot="header">
<span>已经结束</span> <span>已经结束</span>
</div> </div>
<h2 >{{!!answer ? '未作答' : '你的选择是 ' + answer + ' '}}</h2> <h2 >{{!answer ? '未作答' : answer }}</h2>
</el-card> </el-card>
</div> </div>
</template> </template>
...@@ -42,14 +42,28 @@ export default { ...@@ -42,14 +42,28 @@ export default {
eventId: { eventId: {
type: String, type: String,
required: true required: true
},
img: {
type: String,
required: true
} }
}, },
data() { data() {
console.log({
backgroundStyle: {
backgroundImage:'url(' + this.img + ')',
}
});
return { return {
step: 'unsubmit',// unsubmit submitted stopped step: 'unsubmit',// unsubmit submitted stopped
answer: '', answer: '',
Options, Options,
submitting: false, submitting: false,
backgroundStyle: {
background:'#FFF url(' + this.img + ') no-repeat',
backgroundSize: 'contain',
backgroundPosition: 'center'
}
}; };
}, },
methods: { methods: {
...@@ -77,12 +91,8 @@ export default { ...@@ -77,12 +91,8 @@ export default {
if (!msg || !msg.from || msg.from.indexOf('teacher') < 0 || !msg.payload) { if (!msg || !msg.from || msg.from.indexOf('teacher') < 0 || !msg.payload) {
return return
} }
if (!msg.payload.eventId || !msg.payload.type || msg.payload.type < 0) {
return
}
if (msg.type === 'question-stop' && msg.payload.eventId === this.eventId) { if (msg.type === 'question-stop' && msg.payload.eventId === this.eventId) {
this.step = 'stopped' this.step = 'stopped'
} }
} }
}, },
......
<template> <template>
<div class="board-container"> <div class="board-container">
<quick-response :eventId="eventId" v-if="this.currentComponment === 'quick-response'"/> <quick-response :eventId="eventId" :img="img" v-if="this.currentComponment === 'quick-response'"/>
<locker :eventId="eventId" v-if="this.currentComponment === 'locker'"/> <locker :eventId="eventId" v-if="this.currentComponment === 'locker'"/>
<select-question :eventId="eventId" v-if="this.currentComponment === 'select-question'"/> <select-question :eventId="eventId" :img="img" v-if="this.currentComponment === 'select-question'"/>
<drawing-board :eventId="eventId" v-if="this.currentComponment === 'drawing-board'"/> <drawing-board :eventId="eventId" :img="img" v-if="this.currentComponment === 'drawing-board'"/>
</div> </div>
</template> </template>
...@@ -26,8 +26,9 @@ export default { ...@@ -26,8 +26,9 @@ export default {
}, },
data() { data() {
return { return {
currentComponment: 'select-question', currentComponment: 'locker',
eventId: 0 eventId: '0',
img: ''
}; };
}, },
methods: { methods: {
...@@ -71,18 +72,22 @@ export default { ...@@ -71,18 +72,22 @@ export default {
} }
this.eventId = msg.payload.eventId; this.eventId = msg.payload.eventId;
this.currentComponment = 'locker'; this.currentComponment = 'locker';
this.img = ''
this.$nextTick(() => { this.$nextTick(() => {
const {type} = msg.payload; const {type} = msg.payload;
if (type === 3) { if (type === 3) {
this.currentComponment = 'select-question' this.currentComponment = 'select-question'
this.img = msg.payload.img
} else if (type === 1) { } else if (type === 1) {
this.currentComponment = 'drawing-board' this.currentComponment = 'drawing-board'
this.img = msg.payload.img
} else if (type === 2) { } else if (type === 2) {
this.currentComponment = 'quick-response' this.currentComponment = 'quick-response'
this.img = msg.payload.img
} else { } else {
this.currentComponment = 'locker' this.currentComponment = 'locker'
this.img = ''
} }
console.log(type, this.currentComponment)
}) })
} }
}, },
......
...@@ -121,16 +121,32 @@ const streamTypes = [ ...@@ -121,16 +121,32 @@ const streamTypes = [
// nine // nine
// ] // ]
const imgs = [ const imgs = ["//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%871.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/1.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%872.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/2.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%873.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/3.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%874.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/4.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%875.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/5.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%876.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/6.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%877.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/7.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%878.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/8.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…5%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%879.PNG",
'//test-static-1257124244.cos.ap-chengdu.myqcloud.com/gk-online-static/courseware/demo/9.png', "//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8710.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8711.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8712.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8713.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8714.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8715.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8716.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8717.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8718.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8719.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8720.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8721.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8722.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8723.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8724.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8725.PNG",
"//test-static-1257124244.cos.ap-chengdu.myqcloud.c…%8E%9F%E7%90%86/%E5%B9%BB%E7%81%AF%E7%89%8726.PNG"
] ]
Vue.use(GeekDrawBoard) Vue.use(GeekDrawBoard)
......
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