Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eslotsys-game-nuxt
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
毛线
eslotsys-game-nuxt
Commits
a7aa82e7
Commit
a7aa82e7
authored
Jul 03, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
点击逻辑优化
parent
1d2c6f25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
default.vue
layouts/default.vue
+5
-1
WebRTCPlayer.vue
pages/index/game/components/WebRTCPlayer.vue
+9
-3
index.js
store/index.js
+4
-0
No files found.
layouts/default.vue
View file @
a7aa82e7
...
...
@@ -9,7 +9,7 @@
</
template
>
<
script
>
import
{
mapActions
}
from
'vuex'
import
{
mapActions
,
mapMutations
}
from
'vuex'
import
Audio
from
'@/components/common/audio/index'
export
default
{
components
:
{
...
...
@@ -39,6 +39,9 @@ export default {
...
mapActions
({
GetConfig
:
'GetConfig'
,
}),
...
mapMutations
([
'SetZoom'
,
]),
initSceen
()
{
let
zoom
=
1
const
{
innerWidth
,
innerHeight
}
=
window
...
...
@@ -48,6 +51,7 @@ export default {
}
else
{
zoom
=
window
.
innerWidth
/
1080
}
this
.
SetZoom
(
zoom
)
this
.
zoom
=
zoom
},
},
...
...
pages/index/game/components/WebRTCPlayer.vue
View file @
a7aa82e7
...
...
@@ -4,6 +4,7 @@
</
template
>
<
script
>
import
{
mapState
}
from
'vuex'
export
default
{
name
:
"WebRTCPlayer"
,
props
:
{
...
...
@@ -17,6 +18,11 @@ export default {
player
:
null
}
},
computed
:
{
...
mapState
([
'zoom'
,
]),
},
mounted
()
{
this
.
$watch
(
'videoSrc'
,
()
=>
{
if
(
this
.
videoSrc
)
{
...
...
@@ -67,12 +73,12 @@ export default {
handler
()
{
return
{
click
:
(
e
)
=>
{
cons
ole
.
log
(
'click'
,
e
)
cons
t
{
zoom
}
=
this
const
video
=
this
.
$refs
.
jswebrtc
const
{
offsetWidth
,
offsetHeight
}
=
video
// 组件宽高
const
{
offsetX
,
offsetY
}
=
e
// 点击位置
const
clickPercenX
=
(
offsetHeight
-
offsetY
)
/
offsetHeight
const
clickPercenY
=
(
offsetX
)
/
offsetWidth
const
clickPercenX
=
(
offsetHeight
*
zoom
-
offsetY
)
/
(
offsetHeight
*
zoom
)
const
clickPercenY
=
(
offsetX
)
/
(
offsetWidth
*
zoom
)
// 计算点击区域对应的十六进制
const
max
=
32639
...
...
store/index.js
View file @
a7aa82e7
...
...
@@ -32,6 +32,7 @@ export const state = () => ({
authBtnIdList
:
[],
// 权限按钮id列表
deviceList
:
[],
// 设备列表
device
:
{},
// 当前设备
zoom
:
1
,
// 当前屏幕缩放比例
appConfig
:
{
project_name
:
'——'
,
// 项目名称
img_domain
:
''
,
// 图片名称
...
...
@@ -152,6 +153,9 @@ export const mutations = {
SetDevice
(
state
,
data
)
{
state
.
device
=
data
},
SetZoom
(
state
,
data
)
{
state
.
zoom
=
data
},
}
export
const
actions
=
{
...
...
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