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

新的课件

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