Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn19_read
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
sn19_read
Commits
e4471bfd
Commit
e4471bfd
authored
Nov 13, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
eb692f80
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
427 additions
and
370 deletions
+427
-370
sn19_read.fire
assets/sn19_read/scene/sn19_read.fire
+387
-357
sn19_read.ts
assets/sn19_read/scene/sn19_read.ts
+38
-11
form.component.html
form/src/app/form/form.component.html
+2
-2
No files found.
assets/sn19_read/scene/sn19_read.fire
View file @
e4471bfd
This diff is collapsed.
Click to expand it.
assets/sn19_read/scene/sn19_read.ts
View file @
e4471bfd
...
@@ -58,7 +58,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -58,7 +58,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
public
layer_item_little
:
cc
.
Node
=
null
;
public
layer_item_little
:
cc
.
Node
=
null
;
_cantouch
=
null
;
_cantouch
=
null
;
private
list
:
Array
<
{
type
,
text
,
right
,
imgage
,
duration
,
content
,
audio
,
npcAudio
}
>
;
private
list
:
Array
<
{
type
,
text
,
right
,
imgage
,
duration
,
content
,
audio
,
npcAudio
,
npcPlay
}
>
;
private
recordFlag
:
number
;
//录音模式
private
recordFlag
:
number
;
//录音模式
private
score
:
number
;
private
score
:
number
;
private
scoreList
:
Array
<
number
>
;
private
scoreList
:
Array
<
number
>
;
...
@@ -81,6 +81,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -81,6 +81,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
layers
:
Array
<
cc
.
Node
>
;
private
layers
:
Array
<
cc
.
Node
>
;
initView
()
{
initView
()
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
tip_record
'
),
false
);
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
tip_record
'
),
false
);
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
tip_again
'
),
false
);
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
tip_nopic
'
),
false
);
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
tip_nopic
'
),
false
);
}
}
...
@@ -90,7 +91,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -90,7 +91,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initListener
()
{
initListener
()
{
pg
.
view
.
touchOn
(
this
.
btn_last
,
this
.
preLayer
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_last
,
this
.
preLayer
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_next
,
this
.
nextLayer
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_next
,
this
.
nextLayer
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_record
,
this
.
onTouchRecord
,
this
);
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
.
btn_record
,
'
bg
'
)
,
this
.
onTouchRecord
,
this
);
pg
.
view
.
touchOn
(
this
.
ani_npc
,
this
.
onPlayNpc
,
this
);
pg
.
view
.
touchOn
(
this
.
ani_npc
,
this
.
onPlayNpc
,
this
);
let
layout_btns
=
pg
.
view
.
find
(
this
.
btn_record
,
"
mask/layout_btns
"
);
let
layout_btns
=
pg
.
view
.
find
(
this
.
btn_record
,
"
mask/layout_btns
"
);
...
@@ -252,6 +253,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -252,6 +253,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
recordAudioId
:
any
;
private
recordAudioId
:
any
;
async
showRecorAudioPlay
()
{
async
showRecorAudioPlay
()
{
if
(
!
this
.
recordAudio
)
return
;
if
(
!
this
.
recordAudio
)
return
;
this
.
touchForbid
=
false
let
layout_btns
=
pg
.
view
.
find
(
this
.
btn_record
,
"
mask/layout_btns
"
);
let
layout_btns
=
pg
.
view
.
find
(
this
.
btn_record
,
"
mask/layout_btns
"
);
let
btn_right
=
pg
.
view
.
find
(
layout_btns
,
'
btn_right
'
)
let
btn_right
=
pg
.
view
.
find
(
layout_btns
,
'
btn_right
'
)
...
@@ -263,8 +265,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -263,8 +265,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
audio
.
playAudioByUrl
(
this
.
recordAudio
,
()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
recordAudio
,
()
=>
{
this
.
recordAudioId
=
null
;
this
.
recordAudioId
=
null
;
this
.
showRecorAudioPlayEnd
().
then
(()
=>
{
this
.
showRecorAudioPlayEnd
(
false
).
then
(()
=>
{
if
(
this
.
recording
)
return
;
this
.
showNpcAudioPlay
().
then
(()
=>
{
this
.
showNpcAudioPlay
().
then
(()
=>
{
if
(
this
.
recording
)
return
;
this
.
showNpcAudioPlayEnd
();
this
.
showNpcAudioPlayEnd
();
this
.
nextLayer
();
this
.
nextLayer
();
})
})
...
@@ -273,10 +277,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -273,10 +277,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
recordAudioId
=
audioId
;
this
.
recordAudioId
=
audioId
;
})
})
}
}
showRecorAudioPlayEnd
()
{
showRecorAudioPlayEnd
(
clear
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
this
.
recordAudio
)
return
;
if
(
!
this
.
recordAudio
)
return
;
if
(
this
.
recordAudioId
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
recordAudioId
)
this
.
recordAudioId
=
null
;
}
if
(
clear
)
{
this
.
showRecordHide
();
return
;
}
let
layout_btns
=
pg
.
view
.
find
(
this
.
btn_record
,
"
mask/layout_btns
"
);
let
layout_btns
=
pg
.
view
.
find
(
this
.
btn_record
,
"
mask/layout_btns
"
);
let
btn_right
=
pg
.
view
.
find
(
layout_btns
,
'
btn_right
'
)
let
btn_right
=
pg
.
view
.
find
(
layout_btns
,
'
btn_right
'
)
let
btn_play
=
pg
.
view
.
find
(
layout_btns
,
'
btn_play
'
)
let
btn_play
=
pg
.
view
.
find
(
layout_btns
,
'
btn_play
'
)
...
@@ -285,16 +299,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -285,16 +299,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
btn_play
.
active
=
true
;
btn_play
.
active
=
true
;
btn_stop
.
active
=
false
;
btn_stop
.
active
=
false
;
if
(
this
.
recordAudioId
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
recordAudioId
)
this
.
recordAudioId
=
null
;
}
// 播放文字内容
// 播放文字内容
this
.
label_word
.
active
=
true
;
this
.
label_word
.
active
=
true
;
pg
.
view
.
setString
(
this
.
label_word
,
this
.
recordAudioWord
);
pg
.
view
.
setString
(
this
.
label_word
,
this
.
recordAudioWord
);
// 播放鼓励
// 播放鼓励
this
.
ani_good
.
active
=
true
;
this
.
ani_good
.
active
=
true
;
pg
.
hw
.
playLocalAudio
(
"
right
"
)
pg
.
view
.
playDBAnimation
(
this
.
ani_good
,
'
newAnimation
'
,
1
);
pg
.
view
.
playDBAnimation
(
this
.
ani_good
,
'
newAnimation
'
,
1
);
this
.
_cantouch
=
false
;
this
.
_cantouch
=
false
;
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
...
@@ -315,6 +325,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -315,6 +325,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
npcAudioId
:
any
;
private
npcAudioId
:
any
;
showNpcAudioPlay
()
{
showNpcAudioPlay
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
CurrentData
.
npcPlay
)
{
return
resolve
(
''
);
}
this
.
CurrentData
.
npcPlay
=
true
;
pg
.
view
.
playDBAnimation
(
this
.
ani_npc
,
'
newAnimation
'
,
0
);
pg
.
view
.
playDBAnimation
(
this
.
ani_npc
,
'
newAnimation
'
,
0
);
pg
.
audio
.
playAudioByUrl
(
this
.
CurrentData
.
npcAudio
,
()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
CurrentData
.
npcAudio
,
()
=>
{
pg
.
view
.
playDBAnimation
(
this
.
ani_npc
,
'
newAnimation
'
,
1
);
pg
.
view
.
playDBAnimation
(
this
.
ani_npc
,
'
newAnimation
'
,
1
);
...
@@ -339,8 +353,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -339,8 +353,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 停止播放录音
// 停止播放录音
onTouchRecordStop
()
{
onTouchRecordStop
()
{
this
.
showRecorAudioPlayEnd
().
then
(()
=>
{
this
.
showRecorAudioPlayEnd
(
false
).
then
(()
=>
{
if
(
this
.
recording
)
return
;
this
.
showNpcAudioPlay
().
then
(()
=>
{
this
.
showNpcAudioPlay
().
then
(()
=>
{
if
(
this
.
recording
)
return
;
this
.
showNpcAudioPlayEnd
();
this
.
showNpcAudioPlayEnd
();
this
.
nextLayer
();
this
.
nextLayer
();
})
})
...
@@ -362,7 +378,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -362,7 +378,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
async
onTouchRecord
()
{
async
onTouchRecord
()
{
if
(
this
.
touchForbid
)
return
;
if
(
this
.
touchForbid
)
return
;
if
(
this
.
recording
)
return
;
if
(
this
.
recording
)
return
;
if
(
this
.
recordAudio
)
return
;
if
(
this
.
recordAudio
)
{
this
.
showRecorAudioPlayEnd
(
true
);
}
this
.
recording
=
true
;
this
.
recording
=
true
;
this
.
recordAudio
=
''
;
this
.
recordAudio
=
''
;
this
.
voiceTouchForbid
=
true
;
this
.
voiceTouchForbid
=
true
;
...
@@ -392,6 +410,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -392,6 +410,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
recordAudio
=
data
.
audio
;
this
.
recordAudio
=
data
.
audio
;
this
.
recordAudioWord
=
data
.
text
;
this
.
recordAudioWord
=
data
.
text
;
this
.
recording
=
false
;
this
.
recording
=
false
;
if
(
!
this
.
recordAudioWord
)
{
pg
.
hw
.
playLocalAudio
(
"
tip
"
)
let
tip
=
pg
.
view
.
find
(
this
,
'
tip_again
'
);
pg
.
view
.
visible
(
tip
,
true
);
tip
.
opacity
=
255
;
cc
.
Tween
.
stopAllByTarget
(
tip
)
cc
.
tween
(
tip
).
delay
(
0.8
).
to
(
0.5
,
{
opacity
:
0
}).
start
();
return
;
}
this
.
showRecorAudioPlay
();
this
.
showRecorAudioPlay
();
}
}
private
recordAudioWord
:
string
;
private
recordAudioWord
:
string
;
...
...
form/src/app/form/form.component.html
View file @
e4471bfd
...
@@ -125,13 +125,13 @@
...
@@ -125,13 +125,13 @@
<div
style=
"margin-top: 5px;"
>
<div
style=
"margin-top: 5px;"
>
<nz-radio-group
[(
ngModel
)]="
option
.
imageBig
"
(
ngModelChange
)="
ngChange
(
i
,
j
)"
>
<nz-radio-group
[(
ngModel
)]="
option
.
imageBig
"
(
ngModelChange
)="
ngChange
(
i
,
j
)"
>
<label
nz-radio
[
nzValue
]="
1
"
>
<label
nz-radio
[
nzValue
]="
1
"
>
<span
[
style
]="{
color:option
.
imageBig=
=
1
?
'#
169BD5
'
:
'#
000
'}"
>
16:9
比例
</span>
<span
[
style
]="{
color:option
.
imageBig=
=
1
?
'#
169BD5
'
:
'#
000
'}"
>
4:3
比例
</span>
</label>
</label>
<label
nz-radio
[
nzValue
]="
2
"
>
<label
nz-radio
[
nzValue
]="
2
"
>
<span
[
style
]="{
color:option
.
imageBig=
=
2
?
'#
169BD5
'
:
'#
000
'}"
>
2:1比例
</span>
<span
[
style
]="{
color:option
.
imageBig=
=
2
?
'#
169BD5
'
:
'#
000
'}"
>
2:1比例
</span>
</label>
</label>
<label
nz-radio
[
nzValue
]="
3
"
>
<label
nz-radio
[
nzValue
]="
3
"
>
<span
[
style
]="{
color:option
.
imageBig=
=
3
?
'#
169BD5
'
:
'#
000
'}"
>
4:3
比例
</span>
<span
[
style
]="{
color:option
.
imageBig=
=
3
?
'#
169BD5
'
:
'#
000
'}"
>
16:9
比例
</span>
</label>
</label>
</nz-radio-group>
</nz-radio-group>
</div>
</div>
...
...
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