Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gk-online-teacher
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huanglu
gk-online-teacher
Commits
b59c4e9e
Commit
b59c4e9e
authored
Dec 16, 2020
by
huanglu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.jiuaoedu.com:huanglu/gk-online-teacher
parents
706b3068
b845b7c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
22 deletions
+58
-22
index.vue
src/views/answer-screen/index.vue
+57
-22
index.vue
src/views/paint-screen/index.vue
+1
-0
No files found.
src/views/answer-screen/index.vue
View file @
b59c4e9e
<
template
>
<div
ref=
"gk_screen_std"
class=
"gk-screen-std"
>
<div
v-if=
"isChoice
"
ref=
"vd"
>
<div
v-if=
"questionType === 1 || questionType === 2
"
ref=
"vd"
>
<geek-draw-board
ref=
"draw"
:points=
"paints[currentIndex]"
:paintType=
"paintType"
:drawType=
"drawType"
class=
"draw-board"
/>
<div
class=
"tools-wrap"
>
...
...
@@ -16,13 +17,18 @@
:key=
"itm.title"
>
{{
itm
.
name
}}
</el-button>
<el-button
@
click=
"sendAnswer"
type=
"primary"
class=
"itm"
:disabled=
"disabled"
>
提交
</el-button>
</div>
</div>
<div
v-else
>
<div
class=
"ans-wrap"
>
<div
>
<div
v-if=
"questionType === 3"
class=
"ans-wrap"
>
<el-button
v-for=
"itm in Answers"
:disabled=
"disable
d
"
:disabled=
"disable"
@
click=
"chooseAnswer(itm.value)"
:key=
"itm.value"
type=
"primary"
...
...
@@ -32,10 +38,14 @@
</el-button>
</div>
</div>
<el-button
type=
"primary"
@
click=
"sendChoose"
:disabled=
"false"
class=
"ans-commit"
>
提交
</el-button>
<el-button
v-if=
"questionType === 3"
type=
"primary"
@
click=
"sendAnswer"
:disabled=
"disabled"
class=
"ans-commit"
>
提交
</el-button>
<div
class=
"none"
v-if=
"questionType === -1"
>
暂无题目作答,请等候老师发送
</div>
</div>
</
template
>
...
...
@@ -69,8 +79,10 @@ export default {
paints
:
[],
paintType
:
''
,
currentIndex
:
''
,
isChoice
:
true
,
paintTypes
questionType
:
-
1
,
paintTypes
,
getMsg
:
{},
drawType
:
'mouse'
};
},
methods
:
{
...
...
@@ -86,33 +98,53 @@ export default {
console
.
log
(
value
);
this
.
currentAns
=
value
;
},
sendChoose
()
{
console
.
log
(
'currentPaintData'
,
this
.
$refs
.
draw
.
getImg
());
sendAnswer
()
{
let
msg
=
''
if
(
this
.
questionType
===
3
)
{
msg
=
this
.
currentAns
}
else
if
(
this
.
questionType
===
1
||
this
.
questionType
===
2
)
{
msg
=
this
.
$refs
.
draw
.
getImg
()
}
else
{
msg
=
''
}
socket
.
sendGroupMsg
(
{
{
type
:
'answer'
,
message
:
this
.
currentAns
,
questionType
:
''
payload
:
{
type
:
this
.
questionType
,
answer
:
msg
,
username
:
this
.
$route
.
query
.
username
||
''
}
},
(
data
)
=>
{
console
.
log
(
'回执'
,
data
);
this
.
$alert
(
'提交成功!'
)
this
.
disabled
=
true
;
}
);
},
dealMsg
(
msg
)
{
console
.
log
(
'msg'
,
msg
);
if
(
msg
&&
msg
.
from
&&
msg
.
from
.
indexOf
(
'teacher'
)
>
-
1
&&
msg
.
type
===
'question'
)
{
this
.
disabled
=
false
;
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
.
questionType
=
msg
.
payload
.
type
// if (this.questionType === 3) {
this
.
disabled
=
false
// }
}
}
},
beforeDestroy
()
{
// socket.offMsg(this.dealMsg);
this
.
getMsg
=
{}
socket
.
offMsg
(
this
.
dealMsg
);
},
mounted
()
{
this
.
paintType
=
'pencil'
;
// socket.onMsg(this.dealMsg);
this
.
drawType
=
'mouse'
navigator
.
userAgent
.
toLowerCase
();
socket
.
onMsg
(
this
.
dealMsg
);
document
.
body
.
addEventListener
(
'touchmove'
,
(
e
)
=>
{
e
.
preventDefault
();
},
{
passive
:
false
});
...
...
@@ -126,7 +158,6 @@ export default {
display
:
flex
;
flex-flow
:
column
;
align-items
:
center
;
overflow
:
hidden
;
.tools-wrap
{
position
:
fixed
;
left
:
20px
;
...
...
@@ -143,7 +174,7 @@ export default {
}
}
.draw-board
{
height
:
8
0vh
;
height
:
10
0vh
;
width
:
100vw
;
background
:
#f5f5f5
;
}
...
...
@@ -158,12 +189,16 @@ export default {
margin
:
10px
30px
;
}
.ans-itm-select
{
background-color
:
rgb
(
18
,
72
,
134
);
background-color
:
rgb
(
29
,
126
,
236
);
}
}
.ans-commit
{
font-size
:
40px
;
margin-top
:
5vh
;
}
.none
{
font-size
:
26px
;
margin-top
:
40vh
;
}
}
</
style
>
src/views/paint-screen/index.vue
View file @
b59c4e9e
...
...
@@ -233,6 +233,7 @@ export default {
this
.
isJoin
=
true
this
.
mico
=
(
this
.
micros
[
0
]
||
{}).
deviceId
this
.
registerMsgReceived
()
document
.
body
.
addEventListener
(
'touchmove'
,
(
e
)
=>
{
e
.
preventDefault
();
},
{
passive
:
false
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment