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
545e6046
Commit
545e6046
authored
Jul 03, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
屏幕点击事件
parent
ff3aaf39
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
13 deletions
+60
-13
default.vue
layouts/default.vue
+1
-3
_id.vue
pages/index/game/_id.vue
+39
-8
WebRTCPlayer.vue
pages/index/game/components/WebRTCPlayer.vue
+20
-2
No files found.
layouts/default.vue
View file @
545e6046
...
...
@@ -42,15 +42,13 @@ export default {
initSceen
()
{
let
zoom
=
1
const
{
innerWidth
,
innerHeight
}
=
window
console
.
log
(
'innerWidth'
,
innerWidth
)
console
.
log
(
'innerHeight'
,
innerHeight
)
if
(
innerWidth
/
innerHeight
>
1080
/
608
)
{
console
.
log
(
'比例'
)
zoom
=
window
.
innerHeight
/
608
}
else
{
zoom
=
window
.
innerWidth
/
1080
}
this
.
zoom
=
zoom
//
this.zoom = zoom
},
},
}
...
...
pages/index/game/_id.vue
View file @
545e6046
...
...
@@ -6,7 +6,7 @@
<img
src=
"@/assets/images/temp/game/video-play.png"
alt=
""
class=
"bg"
>
<img
v-if=
"isPlay"
src=
"@/assets/images/temp/game/video-play-state.png"
alt=
""
class=
"play-state"
>
<div
class=
"box"
>
<WebRTCPlayer
ref=
"webrtc"
:video-src=
"player"
/>
<WebRTCPlayer
ref=
"webrtc"
:video-src=
"player"
@
click=
"(data) => click().player(data)"
/>
</div>
</div>
<div
class=
"option-block"
>
...
...
@@ -48,7 +48,9 @@
</div>
<!-- play -->
<img
v-audio
src=
"@/assets/images/temp/game/play-button.png"
alt=
""
class=
"play-btn btn"
@
click=
"click().play()"
>
<div
class=
"play-btn btn"
@
click=
"click().play()"
>
<img
v-audio
src=
"@/assets/images/temp/game/play-button.png"
alt=
""
>
</div>
<!-- 自动下注 -->
<div
v-audio
class=
"auto"
>
<img
v-show=
"!isAuto"
src=
"https://kuawai.s3.ap-east-1.amazonaws.com/resource/assets/Textures/chinese/ic_autoChinese.png"
alt=
""
class=
"auto-btn btn"
@
click=
"showTime = !showTime;"
>
...
...
@@ -117,13 +119,14 @@ export default {
return
this
.
deviceButtonPanel
.
backgroundUrl
},
btnList
()
{
return
this
.
deviceButtonPanel
.
keyMapping
||
[]
const
btnList
=
this
.
deviceButtonPanel
.
keyMapping
||
[]
return
btnList
.
filter
(
i
=>
i
.
buttonStatus
===
1
)
},
btnList1
()
{
return
this
.
btnList
.
filter
(
i
=>
i
.
buttonStatus
===
1
&&
i
.
buttonValue
>=
9
)
return
this
.
btnList
.
filter
(
(
i
,
index
)
=>
index
<
6
)
},
btnList2
()
{
return
this
.
btnList
.
filter
(
i
=>
i
.
buttonStatus
===
1
&&
i
.
buttonValue
<=
8
)
return
this
.
btnList
.
filter
(
(
i
,
index
)
=>
index
>=
6
)
},
// 当前设备
device
()
{
...
...
@@ -300,6 +303,21 @@ export default {
console
.
log
(
'jackpotList'
,
data
)
})
},
touch
:
({
x
,
y
})
=>
{
const
url
=
'/api/game/touch'
const
{
id
}
=
this
const
params
=
{
deviceId
:
id
,
x
,
y
,
}
this
.
$request
({
url
,
method
:
'get'
,
params
,
}).
then
(({
data
})
=>
{
})
},
}
},
click
()
{
...
...
@@ -319,6 +337,9 @@ export default {
play
:
()
=>
{
this
.
network
().
button
({
buttonValue
:
2
})
},
player
:
({
x16
,
y16
})
=>
{
this
.
network
().
touch
({
x
:
x16
,
y
:
y16
})
},
// 设置自动play时间
setAutoPlay
:
(
time
)
=>
{
if
(
time
===
-
1
)
{
...
...
@@ -501,10 +522,20 @@ export default {
}
.play-btn
{
width
:
186px
;
position
:
absolute
;
right
:
149px
;
bottom
:
15px
;
right
:
204px
;
bottom
:
26px
;
overflow
:
visible
;
width
:
90px
;
height
:
90px
;
img
{
width
:
186px
;
position
:
absolute
;
left
:
-48px
;
bottom
:
-5px
;
user-select
:
none
;
pointer-events
:
none
;
}
}
.auto
{
width
:
70px
;
...
...
pages/index/game/components/WebRTCPlayer.vue
View file @
545e6046
<
template
>
<video
id=
"jswebrtc"
ref=
"jswebrtc"
style=
"width: 100%;height: 100%;object-fit: fill"
/>
<video
id=
"jswebrtc"
ref=
"jswebrtc"
style=
"width: 100%;height: 100%;object-fit: fill"
@
click=
"(e) => handler().click(e)"
/>
</
template
>
<
script
>
...
...
@@ -63,7 +63,25 @@ export default {
console
.
log
(
obj
,
'播放器开始播放!'
)
}
})
}
},
handler
()
{
return
{
click
:
(
e
)
=>
{
console
.
log
(
'click'
,
e
)
const
video
=
this
.
$refs
.
jswebrtc
const
{
offsetWidth
,
offsetHeight
}
=
video
// 组件宽高
const
{
offsetX
,
offsetY
}
=
e
// 点击位置
const
clickPercenX
=
(
offsetHeight
-
offsetY
)
/
offsetHeight
const
clickPercenY
=
(
offsetX
)
/
offsetWidth
// 计算点击区域对应的十六进制
const
max
=
32639
const
x16
=
(
+
(
max
*
clickPercenX
).
toFixed
(
0
)).
toString
(
16
)
const
y16
=
(
+
(
max
*
clickPercenY
).
toFixed
(
0
)).
toString
(
16
)
this
.
$emit
(
'click'
,
{
x16
,
y16
})
},
}
},
},
}
</
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