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
376de221
Commit
376de221
authored
Dec 16, 2020
by
huanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
72337a53
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
27 deletions
+62
-27
index.vue
src/views/answer-screen/index.vue
+4
-3
index.vue
src/views/home/index.vue
+8
-3
index.vue
src/views/online/index.vue
+1
-1
index.vue
src/views/paint-screen/index.vue
+47
-18
yarn.lock
yarn.lock
+2
-2
No files found.
src/views/answer-screen/index.vue
View file @
376de221
<
template
>
<div
ref=
"gk_screen_std"
class=
"gk-screen-std"
>
<div
v-if=
"
!
isChoice"
ref=
"vd"
>
<div
v-if=
"isChoice"
ref=
"vd"
>
<geek-draw-board
ref=
"draw"
:points=
"paints[currentIndex]"
...
...
@@ -108,11 +108,11 @@ export default {
}
},
beforeDestroy
()
{
socket
.
offMsg
(
this
.
dealMsg
);
//
socket.offMsg(this.dealMsg);
},
mounted
()
{
this
.
paintType
=
'pencil'
;
socket
.
onMsg
(
this
.
dealMsg
);
//
socket.onMsg(this.dealMsg);
document
.
body
.
addEventListener
(
'touchmove'
,
(
e
)
=>
{
e
.
preventDefault
();
},
{
passive
:
false
});
...
...
@@ -126,6 +126,7 @@ export default {
display
:
flex
;
flex-flow
:
column
;
align-items
:
center
;
overflow
:
hidden
;
.tools-wrap
{
position
:
fixed
;
left
:
20px
;
...
...
src/views/home/index.vue
View file @
376de221
...
...
@@ -75,9 +75,14 @@ export default {
userId
=
`
${
new
Date
().
getTime
()}
`
}
const
routeName
=
joinObj
.
path
// socket.connect(userId, () => {
this
.
$router
.
push
({
name
:
routeName
,
query
:
{
userId
,
roomId
:
this
.
roomId
}})
// })
socket
.
connect
(
userId
,
()
=>
{
this
.
$router
.
push
({
name
:
routeName
,
query
:
{
userId
,
roomId
:
this
.
roomId
,
username
:
this
.
username
}
})
})
}
},
mounted
()
{
...
...
src/views/online/index.vue
View file @
376de221
...
...
@@ -149,7 +149,7 @@ export default {
console
.
log
(
'add: '
,
stream
)
setTimeout
(()
=>
{
this
.
playStream
(
stream
)
},
3
00
);
},
1
00
);
})
this
.
rtc
.
removeStream
((
stream
)
=>
{
const
index
=
this
.
streams
.
findIndex
((
itm
)
=>
itm
.
getId
()
===
stream
.
getId
())
...
...
src/views/paint-screen/index.vue
View file @
376de221
...
...
@@ -2,14 +2,25 @@
<div
class=
"paint-main"
ref=
"pain_main"
>
<img
:src=
"currentImg"
class=
"bg"
/>
<geek-draw-board
ref=
"draw"
:points=
"paints[currentIndex]"
:paintType=
"paintType"
class=
"draw-board"
/>
:points=
"paints[currentIndex]"
paintColor=
'#FFF'
:paintType=
"paintType"
class=
"draw-board"
/>
<div
class=
"tools-wrap"
>
<el-button
class=
"itm"
type=
"info"
@
click=
"changeTool(itm.title)"
v-for=
"itm in paintTypes"
:key=
"itm.title"
>
{{
itm
.
name
}}
</el-button>
</div>
<div
class=
"stream-wrap"
>
<el-button
class=
"itm"
type=
"text"
@
click=
"steamAction(itm.title)"
v-for=
"itm in streamTypes"
:key=
"itm.title"
>
{{
itm
.
name
}}
</el-button>
<template
v-for=
"itm in streamTypes"
>
<el-button
class=
"itm"
type=
"text"
v-if=
"itm.type !== 'down'"
@
click=
"steamAction(itm.title)"
:key=
"itm.title"
>
{{
itm
.
name
}}
</el-button>
<el-dropdown
v-else
:key=
"itm.title"
>
<span
class=
"el-dropdown-link"
>
{{
itm
.
name
}}
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
@
click
.
native=
"startAnswer(op)"
v-for=
"op in itm.options"
:key=
"op.title"
>
{{
op
.
title
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
</div>
<div
class=
"reply-wrap"
>
...
...
@@ -53,7 +64,7 @@ import {
six
,
siven
,
eight
,
nine
nine
}
from
'@/assets/images/index'
import
HWRTC
from
'@/utils/hwrtc'
import
socket
from
'@/utils/socket'
...
...
@@ -66,10 +77,19 @@ const paintTypes = [
]
const
streamTypes
=
[
{
title
:
'ans'
,
name
:
'学生答题'
},
{
title
:
'publish'
,
name
:
'开始推流'
},
{
title
:
'unpublish'
,
name
:
'停止推流'
},
{
title
:
'setting'
,
name
:
'设置'
},
{
title
:
'ans'
,
name
:
'学生答题'
,
type
:
'down'
,
options
:
[
{
title
:
'选择题'
,
value
:
0
},
{
title
:
'简答题'
,
value
:
1
},
{
title
:
'填空题'
,
value
:
2
}
]
},
// { title: 'publish', name: '开始推流' },
// { title: 'unpublish', name: '停止推流' },
// { title: 'setting', name: '设置' },
{
title
:
'full'
,
name
:
'全屏'
},
]
...
...
@@ -127,6 +147,9 @@ export default {
}
this
.
paintType
=
title
},
startAnswer
(
opt
)
{
this
.
sendAnswerTag
(
opt
.
value
,
opt
.
title
)
},
async
steamAction
(
action
)
{
if
(
action
===
'setting'
)
{
this
.
modal
=
true
...
...
@@ -134,27 +157,27 @@ export default {
if
(
action
===
'publish'
)
{
this
.
rtc
.
createStream
(
this
.
mico
,
this
.
camera
)
}
if
(
action
===
'ans'
)
{
this
.
sendAnswerTag
();
}
if
(
action
===
'full'
)
{
// eslint-disable-next-line no-unused-expressions
this
.
$refs
.
pain_main
&&
this
.
$refs
.
pain_main
.
requestFullscreen
();
}
},
sendAnswerTag
()
{
sendAnswerTag
(
type
,
title
)
{
this
.
replyList
=
[]
socket
.
sendGroupMsg
({
type
:
'question'
,
options
:
[
'A'
,
'B'
,
'C'
,
'D'
],
message
:
'请答题'
payload
:
{
type
,
title
,
}
},
(
res
)
=>
{
console
.
log
(
'teacher send success: '
,
res
);
})
},
registerMsgReceived
()
{
socket
.
onMsg
((
data
)
=>
{
this
.
replyList
.
push
(
data
);
const
{
type
,
payload
}
=
data
if
(
type
===
'answer'
)
this
.
replyList
.
push
(
payload
);
})
},
preAction
()
{
...
...
@@ -209,7 +232,7 @@ export default {
transform
:
translateY
(
-50%
);
}
.bg
{
height
:
100vh
;
height
:
100vh
;
width
:
100vw
;
}
.draw-board
{
...
...
@@ -250,8 +273,14 @@ export default {
animation
:
reply
1
.2s
linear
;
}
}
::v-deep
.el-button--text
{
color
:
white
;
::v-deep
{
.el-button--text
{
color
:
white
;
}
.el-dropdown
{
margin-right
:
20px
;
color
:
white
;
}
}
}
...
...
yarn.lock
View file @
376de221
...
...
@@ -881,8 +881,8 @@
"@geek/geekui@^1.1.2":
version "1.1.2"
resolved "http://git.jksxb.cn:8081/repository/geek/@geek/geekui/-/geekui-1.1.2.tgz#
bbe448fbefb1487d4b5f16596458d8062b79700f
"
integrity sha512-
TBPYSECTJknnBs7dSNdQLM+rnoMItpC3HBILLr3YuQCUdvmJdRsbaxlMokfEKv6a3sceAPWHCsnqEl7S4N+2y
w==
resolved "http://git.jksxb.cn:8081/repository/geek/@geek/geekui/-/geekui-1.1.2.tgz#
8ef29a981ee01139ee73a9389058619595df2a88
"
integrity sha512-
bQ5lvdCZfFb8gy4iNsphljJBA/eUgJe6vzrIF+u0JXlS+7aGCvO3nOIqbkUwEEUBJHZfiz/XzISy+59gJCobg
w==
dependencies:
"@geek/geek-editor" "^1.0.7"
cos-js-sdk-v5 "^0.5.27"
...
...
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