Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM4-11
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
YM4-11
Commits
022ef2ad
Commit
022ef2ad
authored
Sep 21, 2020
by
Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix
parent
cb639768
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
5 deletions
+42
-5
package-lock.json
package-lock.json
+5
-0
play.component.ts
src/app/play/play.component.ts
+37
-5
No files found.
package-lock.json
View file @
022ef2ad
...
...
@@ -2021,6 +2021,11 @@
"resolved"
:
"https://registry.npmjs.org/angular2-fontawesome/-/angular2-fontawesome-5.2.1.tgz"
,
"integrity"
:
"sha512-aS6Y8dBLFdSx4yqyqIQDujIKAHJjqvdaD/y3/qDPE/pHYd/HBZZMLBlHcVuocraA5TuPBWBxF1w9NxT+3J54nQ=="
},
"angular2-uuid"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/angular2-uuid/-/angular2-uuid-1.1.1.tgz"
,
"integrity"
:
"sha1-cvA81TK39AAy6x7PufhFc4S+lW4="
},
"angularx-qrcode"
:
{
"version"
:
"1.6.4"
,
"resolved"
:
"https://registry.npmjs.org/angularx-qrcode/-/angularx-qrcode-1.6.4.tgz"
,
...
...
src/app/play/play.component.ts
View file @
022ef2ad
...
...
@@ -88,6 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy {
g_firstTouch
=
true
;
g_partTitle_x
=
null
;
g_mainTitle_x
=
null
;
g_dragDelay
=
300
//放置拖拽事件触发播放音效
// ------------------------------------
// ------------ 私有数据 ------------
...
...
@@ -298,7 +299,7 @@ export class PlayComponent implements OnInit, OnDestroy {
labelWidth
=
w
/
2
return
{
x
:
this
.
g_partTitle_x
-
20
*
this
.
g_mapScale
+
labelWidth
*
this
.
g_mapScale
,
y
:
(
65
*
this
.
g_mapScale
)
/
2
y
:
5
*
this
.
g_mapScale
+
(
65
*
this
.
g_mapScale
)
/
2
}
})
...
...
@@ -310,7 +311,7 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
this
.
g_partTitle_x
+
labelWidth
+
60
*
this
.
g_mapScale
,
y
:
(
65
*
this
.
g_mapScale
)
/
2
y
:
5
*
this
.
g_mapScale
+
(
65
*
this
.
g_mapScale
)
/
2
}
})
...
...
@@ -387,10 +388,19 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
render
(
element
.
ref
)
this
.
render
(
elementDrag
.
ref
)
element
.
timeoutID
=
null
this
.
subscribeMapDragEvent
(
element
.
id
,
()
=>
{
item
.
media
.
audio_url
&&
this
.
g_cartoon
.
playAudio
(
item
.
media
.
audio_url
)
console
.
log
(
item
.
media
.
audio_url
)
element
.
timeoutID
=
setTimeout
(()
=>
{
if
(
item
.
media
.
audio_url
)
{
this
.
g_cartoon
.
stopAllAudio
()
this
.
g_cartoon
.
playAudio
(
item
.
media
.
audio_url
)
}
},
this
.
g_dragDelay
);
},
()
=>
{
if
(
element
.
timeoutID
)
{
clearTimeout
(
element
.
timeoutID
)
element
.
timeoutID
=
null
}
elementDrag
.
ref
.
x
=
this
.
g_clickX
,
elementDrag
.
ref
.
y
=
this
.
g_clickY
},
()
=>
{
...
...
@@ -430,9 +440,20 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
render
(
textDrag
.
ref
)
this
.
render
(
element
.
ref
)
element
.
timeoutID
=
null
this
.
subscribeMapDragEvent
(
element
.
id
,
()
=>
{
element
.
timeoutID
=
setTimeout
(()
=>
{
if
(
this
.
g_formData
.
bgItem
.
wordLeft_audio_url
)
{
this
.
g_cartoon
.
stopAllAudio
()
this
.
g_cartoon
.
playAudio
(
this
.
g_formData
.
bgItem
.
wordLeft_audio_url
)
}
},
this
.
g_dragDelay
);
text
.
ref
.
alpha
=
0.5
;
},
()
=>
{
if
(
element
.
timeoutID
)
{
clearTimeout
(
element
.
timeoutID
)
element
.
timeoutID
=
null
}
textDrag
.
ref
.
x
=
this
.
g_clickX
,
textDrag
.
ref
.
y
=
this
.
g_clickY
},
()
=>
{
...
...
@@ -473,9 +494,20 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
render
(
textDrag
.
ref
)
this
.
render
(
element
.
ref
)
element
.
timeoutID
=
null
this
.
subscribeMapDragEvent
(
element
.
id
,
()
=>
{
element
.
timeoutID
=
setTimeout
(()
=>
{
if
(
this
.
g_formData
.
bgItem
.
wordRight_audio_url
)
{
this
.
g_cartoon
.
stopAllAudio
()
this
.
g_cartoon
.
playAudio
(
this
.
g_formData
.
bgItem
.
wordRight_audio_url
)
}
},
this
.
g_dragDelay
);
text
.
ref
.
alpha
=
0.5
;
},
()
=>
{
if
(
element
.
timeoutID
)
{
clearTimeout
(
element
.
timeoutID
)
element
.
timeoutID
=
null
}
textDrag
.
ref
.
x
=
this
.
g_clickX
,
textDrag
.
ref
.
y
=
this
.
g_clickY
},
()
=>
{
...
...
@@ -498,7 +530,7 @@ export class PlayComponent implements OnInit, OnDestroy {
value
=
this
.
g_formData
.
bgItem
.
wordLeft_text
;
}
else
if
(
key
==
-
2
)
{
value
=
this
.
g_formData
.
bgItem
.
wordRight_text
;
}
else
{
}
else
if
(
this
.
g_formData
.
hotZoneItemArr
.
length
>
0
)
{
value
=
this
.
g_formData
.
hotZoneItemArr
[
combinIndex
].
media
.
text
}
textAll
.
push
(
...
...
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