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
3b6d5735
Commit
3b6d5735
authored
Dec 16, 2020
by
刘阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 禁用滑动
parent
d2636bf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
71 deletions
+75
-71
index.vue
src/views/answer-screen/index.vue
+72
-71
index.vue
src/views/paint-screen/index.vue
+3
-0
No files found.
src/views/answer-screen/index.vue
View file @
3b6d5735
<
template
>
<div
ref=
"gk_screen_std"
class=
"gk-screen-std"
>
<div
v-if=
"isChoice"
>
<geek-draw-board
ref=
"draw"
:points=
"paints[currentIndex]"
:paintType=
"paintType"
class=
"draw-board"
/>
<div
ref=
"gk_screen_std"
class=
"gk-screen-std"
>
<div
v-if=
"!isChoice"
ref=
"vd"
>
<geek-draw-board
ref=
"draw"
:points=
"paints[currentIndex]"
: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>
<div
v-else
>
<div
class=
"ans-wrap"
>
<el-button
v-for=
"itm in Answers"
:disabled=
"disabled"
@
click=
"chooseAnswer(itm.value)"
:key=
"itm.value"
type=
"primary"
:class=
"['ans-itm', itm.value === currentAns ? 'ans-itm-select': '' ]"
>
{{
itm
.
title
}}
</el-button>
<el-button
class=
"itm"
type=
"info"
@
click=
"changeTool(itm.title)"
v-for=
"itm in paintTypes"
:key=
"itm.title"
>
{{
itm
.
name
}}
</el-button>
</div>
</div>
</div>
<el-button
type=
"primary"
@
click=
"sendChoose"
:disabled=
"false"
class=
"ans-commit"
>
提交
<div
v-else
>
<div
class=
"ans-wrap"
>
<el-button
v-for=
"itm in Answers"
:disabled=
"disabled"
@
click=
"chooseAnswer(itm.value)"
:key=
"itm.value"
type=
"primary"
:class=
"['ans-itm', itm.value === currentAns ? 'ans-itm-select' : '']"
>
{{
itm
.
title
}}
</el-button>
</div>
</div>
<el-button
type=
"primary"
@
click=
"sendChoose"
:disabled=
"false"
class=
"ans-commit"
>
提交
</el-button>
</div>
</
template
>
<
script
>
import
{
GeekDrawBoard
}
from
'@geek/geekui'
import
socket
from
'../../utils/socket'
import
{
GeekDrawBoard
}
from
'@geek/geekui'
;
import
socket
from
'../../utils/socket'
;
const
Answers
=
[
{
title
:
'A'
,
value
:
'A'
},
{
title
:
'B'
,
value
:
'B'
},
{
title
:
'C'
,
value
:
'C'
},
{
title
:
'D'
,
value
:
'D'
}
]
]
;
const
paintTypes
=
[
{
title
:
'pencil'
,
name
:
'铅笔'
,
width
:
20
},
{
title
:
'redo'
,
name
:
'撤回'
},
{
title
:
'erase'
,
name
:
'橡皮擦'
,
width
:
50
},
{
title
:
'clear'
,
name
:
'清空'
}
,
]
{
title
:
'clear'
,
name
:
'清空'
}
]
;
export
default
{
name
:
'vd'
,
components
:
{
GeekDrawBoard
},
...
...
@@ -61,62 +71,53 @@ export default {
currentIndex
:
''
,
isChoice
:
true
,
paintTypes
}
}
;
},
methods
:
{
changeTool
(
title
)
{
if
(
title
===
'redo'
||
title
===
'clear'
)
{
// eslint-disable-next-line no-unused-expressions
this
.
$refs
.
draw
&&
this
.
$refs
.
draw
[
title
]();
return
return
;
}
this
.
paintType
=
title
this
.
paintType
=
title
;
},
chooseAnswer
(
value
)
{
console
.
log
(
value
)
this
.
currentAns
=
value
console
.
log
(
value
)
;
this
.
currentAns
=
value
;
},
sendChoose
()
{
console
.
log
(
'currentPaintData'
,
this
.
$refs
.
draw
.
getImg
())
socket
.
sendGroupMsg
({
type
:
'answer'
,
message
:
this
.
currentAns
,
questionType
:
''
,
},(
data
)
=>
{
console
.
log
(
'回执'
,
data
);
this
.
disabled
=
true
})
console
.
log
(
'currentPaintData'
,
this
.
$refs
.
draw
.
getImg
());
socket
.
sendGroupMsg
(
{
type
:
'answer'
,
message
:
this
.
currentAns
,
questionType
:
''
},
(
data
)
=>
{
console
.
log
(
'回执'
,
data
);
this
.
disabled
=
true
;
}
);
},
dealMsg
(
msg
)
{
console
.
log
(
'msg'
,
msg
)
console
.
log
(
'msg'
,
msg
);
if
(
msg
&&
msg
.
from
&&
msg
.
from
.
indexOf
(
'teacher'
)
>
-
1
&&
msg
.
type
===
'question'
)
{
this
.
disabled
=
false
this
.
disabled
=
false
;
}
},
scrollFunc
(
evt
)
{
evt
=
evt
||
window
.
event
;
if
(
evt
.
preventDefault
)
{
// Firefox
evt
.
preventDefault
();
evt
.
stopPropagation
();
}
else
{
// IE
evt
.
cancelBubble
=
true
;
evt
.
returnValue
=
false
;
}
return
false
;
}
},
beforeDestroy
()
{
socket
.
offMsg
(
this
.
dealMsg
)
socket
.
offMsg
(
this
.
dealMsg
)
;
},
mounted
()
{
this
.
paintType
=
'pencil'
socket
.
onMsg
(
this
.
dealMsg
)
document
.
addEventListener
(
'DOMMouseScroll'
,
this
.
scrollFunc
,
false
);
document
.
addEventListener
(
'mousewheel'
,
this
.
scrollFunc
,
false
);
},
}
this
.
paintType
=
'pencil'
;
socket
.
onMsg
(
this
.
dealMsg
);
document
.
body
.
addEventListener
(
'touchmove'
,
(
e
)
=>
{
e
.
preventDefault
();
},
{
passive
:
false
});
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -125,7 +126,7 @@ export default {
display
:
flex
;
flex-flow
:
column
;
align-items
:
center
;
.tools-wrap
{
.tools-wrap
{
position
:
fixed
;
left
:
20px
;
top
:
10px
;
...
...
@@ -140,10 +141,10 @@ export default {
margin-left
:
0
;
}
}
.draw-board
{
height
:
80vh
;
width
:
100vw
;
background
:
#f5f5f5
.draw-board
{
height
:
80vh
;
width
:
100vw
;
background
:
#f5f5f5
;
}
.ans-wrap
{
margin-top
:
20vh
;
...
...
src/views/paint-screen/index.vue
View file @
3b6d5735
...
...
@@ -186,6 +186,9 @@ export default {
this
.
isJoin
=
true
this
.
mico
=
(
this
.
micros
[
0
]
||
{}).
deviceId
this
.
registerMsgReceived
()
document
.
body
.
addEventListener
(
'touchmove'
,
(
e
)
=>
{
e
.
preventDefault
();
},
{
passive
:
false
});
}
}
</
script
>
...
...
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