Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP_03_2
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
OP_03_2
Commits
9d647fe5
Commit
9d647fe5
authored
Dec 29, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:增加音频清除功能,调整播放逻辑
parent
6911a141
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
21 deletions
+44
-21
form.component.html
form/src/app/form/form.component.html
+15
-0
form.component.ts
form/src/app/form/form.component.ts
+4
-0
OP_03_2.js
play/assets/OP_03_2/scene/OP_03_2.js
+25
-21
No files found.
form/src/app/form/form.component.html
View file @
9d647fe5
...
@@ -22,6 +22,11 @@
...
@@ -22,6 +22,11 @@
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl1
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl1
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
<nz-form-control
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteAudio
(
item
,
'
guideAudioUrl1
')"
>
<i
nz-icon
nzType=
"delete"
nzTheme=
"outline"
></i>
清除
</button>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl2"
>
待机音频
</nz-form-label>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl2"
>
待机音频
</nz-form-label>
...
@@ -30,6 +35,11 @@
...
@@ -30,6 +35,11 @@
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl2
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl2
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
<nz-form-control
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteAudio
(
item
,
'
guideAudioUrl2
')"
>
<i
nz-icon
nzType=
"delete"
nzTheme=
"outline"
></i>
清除
</button>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl3"
>
结束音频
</nz-form-label>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl3"
>
结束音频
</nz-form-label>
...
@@ -38,6 +48,11 @@
...
@@ -38,6 +48,11 @@
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl3
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl3
')"
>
</app-audio-recorder>
</app-audio-recorder>
</nz-form-control>
</nz-form-control>
<nz-form-control
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"danger"
(
click
)="
deleteAudio
(
item
,
'
guideAudioUrl3
')"
>
<i
nz-icon
nzType=
"delete"
nzTheme=
"outline"
></i>
清除
</button>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
>
图片
</nz-form-label>
<nz-form-label
[
nzSpan
]="
2
"
>
图片
</nz-form-label>
...
...
form/src/app/form/form.component.ts
View file @
9d647fe5
...
@@ -99,6 +99,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -99,6 +99,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
this
.
save
();
}
}
deleteAudio
(
item
,
key
){
item
[
key
]
=
null
;
this
.
save
();
}
/**
/**
* 储存数据
* 储存数据
...
...
play/assets/OP_03_2/scene/OP_03_2.js
View file @
9d647fe5
...
@@ -219,26 +219,21 @@ cc.Class({
...
@@ -219,26 +219,21 @@ cc.Class({
this
.
_cantouch
=
false
;
this
.
_cantouch
=
false
;
//播放动画
this
.
playAni
(
'
begin
'
,
0
);
const
begin
=
()
=>
{
this
.
playAni
(
'
begin
'
,
0
);
this
.
_cantouch
=
true
;
this
.
begin
();
}
console
.
log
(
this
.
data
.
guideAudioUrl1
);
console
.
log
(
this
.
data
.
guideAudioUrl1
);
//如果有引导音频,则播放完引导音频再开始
//如果有引导音频,则播放完引导音频再开始
if
(
this
.
data
.
guideAudioUrl1
)
{
if
(
this
.
data
.
guideAudioUrl1
)
{
//播放动画
this
.
playAni
(
'
begin
'
,
0
);
//播放引导音频1
//播放引导音频1
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl1
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl1
,
()
=>
{
begin
();
this
.
begin
();
});
});
}
}
else
{
else
{
begin
();
this
.
begin
();
}
}
this
.
addDefaultMusic
();
this
.
addDefaultMusic
();
...
@@ -661,6 +656,8 @@ cc.Class({
...
@@ -661,6 +656,8 @@ cc.Class({
this
.
playAudioByUrl
(
this
.
data
.
exercises
.
audioUrl
,
()
=>
{
this
.
playAudioByUrl
(
this
.
data
.
exercises
.
audioUrl
,
()
=>
{
this
.
_cantouch
=
true
;
//停止监听动画
//停止监听动画
this
.
_stopAni
=
true
;
this
.
_stopAni
=
true
;
...
@@ -749,14 +746,7 @@ cc.Class({
...
@@ -749,14 +746,7 @@ cc.Class({
handNode
.
opacity
=
0
;
handNode
.
opacity
=
0
;
this
.
_stop
=
true
;
this
.
_stop
=
true
;
//播放动画
const
play
=
()
=>
{
const
state
=
this
.
playAni
(
'
finish
'
,
0
);
//播放结束音频
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl3
,
()
=>
{
state
.
stop
();
this
.
playAni
(
'
normal
'
,
0
);
this
.
playAni
(
'
normal
'
,
0
);
//设置可以点击字母
//设置可以点击字母
...
@@ -767,9 +757,23 @@ cc.Class({
...
@@ -767,9 +757,23 @@ cc.Class({
this
.
_canClickCat
=
true
;
this
.
_canClickCat
=
true
;
this
.
showPhotoBtn
();
this
.
showPhotoBtn
();
}
);
}
if
(
this
.
data
.
guideAudioUrl3
){
//播放动画
const
state
=
this
.
playAni
(
'
finish
'
,
0
);
//播放结束音频
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl3
,
()
=>
{
state
.
stop
();
play
();
});
}
else
{
play
();
}
},
},
...
...
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