Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP15
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
OP15
Commits
0a1fa64d
Commit
0a1fa64d
authored
Dec 24, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddd
parent
5e4054e1
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
41 deletions
+37
-41
form.component.html
form/src/app/form/form.component.html
+8
-8
form.component.ts
form/src/app/form/form.component.ts
+4
-0
OP15.js
play/assets/OP15/scene/OP15.js
+24
-32
defaultData.js
play/assets/OP15/script/defaultData.js
+1
-1
No files found.
form/src/app/form/form.component.html
View file @
0a1fa64d
...
...
@@ -2,18 +2,18 @@
<div
style=
"padding: 10px;"
>
<div
style=
"margin-top: 5px"
>
<span>
开始
第1遍
音频:
</span>
<span>
开始音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
begin_audio
1
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio
1
')"
[
audioUrl
]="
item
.
begin_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
开始第2遍音频
:
</span>
<
app-audio-record
er
[
audioUrl
]="
item
.
begin_audio2
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio2
')
"
></app-audio-record
er>
<span>
区分时间点
:
</span>
<
nz-input-numb
er
(
nzBlur
)="
setBeginSepTime
()
"
[(
ngModel
)]="
item
.
begin_sep_time
"
[
nzStep
]="
1
"
></nz-input-numb
er>
</div>
<div
style=
"margin-top: 5px"
>
<span>
做题引导音频:
</span>
...
...
form/src/app/form/form.component.ts
View file @
0a1fa64d
...
...
@@ -130,6 +130,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
setBeginSepTime
()
{
this
.
save
();
}
onWordAudioUploadSuccess
(
e
,
idx
)
{
this
.
item
.
wordList
[
idx
].
audio
=
e
.
url
;
this
.
save
();
...
...
play/assets/OP15/scene/OP15.js
View file @
0a1fa64d
...
...
@@ -361,6 +361,8 @@ cc.Class({
}
}
}
const
state
=
{
id
:
'
game
'
,
initial
:
'
begin
'
,
...
...
@@ -383,44 +385,17 @@ cc.Class({
var
dragonDisplay
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
'
begin
'
,
0
);
return
new
Promise
((
resolve
,
reject
)
=>
{
let
a1
=
this
.
data
.
begin_audio1
;
if
(
this
.
begin_audio1
)
{
a1
=
this
.
begin_audio1
}
playAudioByUrl
(
a1
,
()
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio
,
()
=>
{
console
.
log
(
'
game begin audio finish
'
);
resolve
()
})
});
},
onDone
:
'
begin2
'
,
onError
:
'
begin2
'
}
},
begin2
:
{
invoke
:
{
src
:
(
ctx
)
=>
{
console
.
log
(
'
game begin 2
'
);
for
(
let
i
=
0
;
i
<
this
.
_allAnimationNodes
.
length
;
i
++
)
{
const
t
=
this
.
_allAnimationNodes
[
i
];
const
dragonDisplay
=
t
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
}
return
new
Promise
((
resolve
,
reject
)
=>
{
let
a2
=
this
.
data
.
begin_audio2
;
if
(
this
.
begin_audio2
)
{
a2
=
this
.
begin_audio2
;
}
playAudioByUrl
(
this
.
data
.
begin_audio2
,
()
=>
{
resolve
()
})
});
},
onDone
:
'
guide
'
,
onError
:
'
guide
'
}
},
guide
:{
invoke
:
{
src
:
(
ctx
)
=>
{
...
...
@@ -510,8 +485,25 @@ cc.Class({
}
}
}
if
(
this
.
data
.
begin_sep_time
)
{
const
t
=
+
this
.
data
.
begin_sep_time
*
1000
;
after
[
t
]
=
{
actions
:
()
=>
{
console
.
log
(
'
game begin 2
'
);
for
(
let
i
=
0
;
i
<
this
.
_allAnimationNodes
.
length
;
i
++
)
{
const
t
=
this
.
_allAnimationNodes
[
i
];
const
dragonDisplay
=
t
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
}
}
}
}
state
.
states
.
begin
.
after
=
after
;
const
gameMachine
=
createMachine
(
state
);
window
.
gameMachine
=
gameMachine
;
this
.
gameMachineService
=
interpret
(
gameMachine
).
onTransition
((
state
)
=>
{
...
...
@@ -625,10 +617,10 @@ cc.Class({
},
addPreloadAudio
()
{
// this._audioResList.push({ url: this.data.begin_audio1
});
this
.
prepareAudioClip
(
this
.
data
.
begin_audio1
,
'
begin_audio1
'
)
this
.
_audioResList
.
push
({
url
:
this
.
data
.
begin_audio
});
//
this.prepareAudioClip(this.data.begin_audio1, 'begin_audio1')
// this._audioResList.push({ url: this.data.begin_audio2 });
this
.
prepareAudioClip
(
this
.
data
.
begin_audio2
,
'
begin_audio2
'
)
//
this.prepareAudioClip(this.data.begin_audio2, 'begin_audio2')
this
.
_audioResList
.
push
({
url
:
this
.
data
.
guide_audio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
playing_audio
});
if
(
this
.
data
.
wrong_audio
)
{
...
...
play/assets/OP15/script/defaultData.js
View file @
0a1fa64d
This diff is collapsed.
Click to expand it.
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