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
112eb3c0
Commit
112eb3c0
authored
Dec 21, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整逻辑,增加引导音频
parent
0ad8a900
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
26 deletions
+65
-26
form.component.html
form/src/app/form/form.component.html
+6
-0
OP_03_2.js
play/assets/OP_03_2/scene/OP_03_2.js
+55
-24
defaultData.js
play/assets/OP_03_2/script/defaultData.js
+4
-2
No files found.
form/src/app/form/form.component.html
View file @
112eb3c0
...
@@ -71,6 +71,7 @@
...
@@ -71,6 +71,7 @@
<tr>
<tr>
<th>
序号
</th>
<th>
序号
</th>
<th>
字母
</th>
<th>
字母
</th>
<th>
引导音频
</th>
<th>
音频
</th>
<th>
音频
</th>
<th>
操作
</th>
<th>
操作
</th>
</tr>
</tr>
...
@@ -79,6 +80,11 @@
...
@@ -79,6 +80,11 @@
<tr
*
ngFor=
"let row of wordTable.data;let j = index"
>
<tr
*
ngFor=
"let row of wordTable.data;let j = index"
>
<td>
{{ j+1 }}
</td>
<td>
{{ j+1 }}
</td>
<td><input
type=
"text"
nz-input
[(
ngModel
)]="
row
.
val
"
(
blur
)="
save
()"
maxlength=
"1"
></td>
<td><input
type=
"text"
nz-input
[(
ngModel
)]="
row
.
val
"
(
blur
)="
save
()"
maxlength=
"1"
></td>
<td>
<app-audio-recorder
[
audioUrl
]="
row
.
guideAudioUrl
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
row
,
'
guideAudioUrl
')"
>
</app-audio-recorder>
</td>
<td>
<td>
<app-audio-recorder
[
audioUrl
]="
row
.
audioUrl
"
<app-audio-recorder
[
audioUrl
]="
row
.
audioUrl
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
row
,
'
audioUrl
')"
>
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
row
,
'
audioUrl
')"
>
...
...
play/assets/OP_03_2/scene/OP_03_2.js
View file @
112eb3c0
...
@@ -116,6 +116,9 @@ cc.Class({
...
@@ -116,6 +116,9 @@ cc.Class({
this
.
_audioResList
.
push
({
url
:
wordArr
[
i
].
audioUrl
});
this
.
_audioResList
.
push
({
url
:
wordArr
[
i
].
audioUrl
});
}
}
if
(
wordArr
[
i
].
guideAudioUrl
){
this
.
_audioResList
.
push
({
url
:
wordArr
[
i
].
guideAudioUrl
});
}
}
}
}
}
...
@@ -216,13 +219,15 @@ cc.Class({
...
@@ -216,13 +219,15 @@ cc.Class({
this
.
_cantouch
=
false
;
this
.
_cantouch
=
false
;
//播放动
车
//播放动
画
this
.
playAni
(
'
begin
'
,
0
);
this
.
playAni
(
'
begin
'
,
0
);
const
begin
=
()
=>
{
const
begin
=
()
=>
{
this
.
playAni
(
'
begin
'
,
0
);
this
.
playAni
(
'
begin
'
,
0
);
this
.
_cantouch
=
true
;
this
.
_cantouch
=
true
;
this
.
_canClickCat
=
true
;
this
.
begin
();
this
.
begin
();
}
}
...
@@ -264,15 +269,16 @@ cc.Class({
...
@@ -264,15 +269,16 @@ cc.Class({
//有空格,取2 * index节点值
//有空格,取2 * index节点值
let
wordNode
=
textNode
.
wordNodeArr
[
2
*
index
];
let
wordNode
=
textNode
.
wordNodeArr
[
2
*
index
];
//播放音频
this
.
playAudioByUrl
(
word
.
guideAudioUrl
,
()
=>
{
this
.
playAudioByUrl
(
word
.
audioUrl
,
()
=>
{
//播放音频
this
.
playAudioByUrl
(
word
.
audioUrl
,
()
=>
{
this
.
begin
(
index
+
1
);
})
//显示文本动画
this
.
begin
(
index
+
1
);
this
.
textTwinkle
(
wordNode
);
})
//显示文本动画
this
.
textTwinkle
(
wordNode
);
})
},
},
maskNode
:
null
,
maskNode
:
null
,
...
@@ -357,19 +363,21 @@ cc.Class({
...
@@ -357,19 +363,21 @@ cc.Class({
this
.
_cantouch
=
false
;
this
.
_cantouch
=
false
;
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
//播放音频
this
.
playAudioByUrl
(
wordArr
[
i
].
audioUrl
,
()
=>
{
this
.
_cantouch
=
true
;
state
.
stop
();
this
.
playAudioByUrl
(
wordArr
[
i
].
guideAudioUrl
,
()
=>
{
this
.
playAni
(
'
normal
'
,
0
);
//播放音频
})
this
.
playAudioByUrl
(
wordArr
[
i
].
audioUrl
,
()
=>
{
//显示文本动画
this
.
_cantouch
=
true
;
this
.
textTwinkle
(
label
);
state
.
stop
();
this
.
playAni
(
'
normal
'
,
0
);
})
//显示文本动画
this
.
textTwinkle
(
label
);
})
})
})
//其余字母
//其余字母
...
@@ -396,6 +404,25 @@ cc.Class({
...
@@ -396,6 +404,25 @@ cc.Class({
let
wordArr
=
this
.
data
.
exercises
.
word2Arr
;
let
wordArr
=
this
.
data
.
exercises
.
word2Arr
;
const
play
=
()
=>
{
if
(
!
this
.
_cantouch
)
{
return
;
}
this
.
_cantouch
=
false
;
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
//播放单词音频
this
.
playTextAutio
(()
=>
{
state
.
stop
();
this
.
playAni
(
'
normal
'
,
0
);
});
}
for
(
let
i
=
0
;
i
<
wordArr
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
wordArr
.
length
;
++
i
)
{
if
(
!
wordArr
[
i
].
val
)
{
if
(
!
wordArr
[
i
].
val
)
{
...
@@ -407,12 +434,19 @@ cc.Class({
...
@@ -407,12 +434,19 @@ cc.Class({
let
label
=
this
.
getWord
(
initial
,
80
,
true
);
let
label
=
this
.
getWord
(
initial
,
80
,
true
);
label
.
isInitial
=
true
;
label
.
isInitial
=
true
;
wordNodeArr
.
push
(
label
);
wordNodeArr
.
push
(
label
);
label
.
addComponent
(
cc
.
Button
);
label
.
on
(
'
click
'
,
()
=>
{
play
();
});
//其余字母
//其余字母
let
last
=
wordArr
[
i
].
val
.
substr
(
1
);
let
last
=
wordArr
[
i
].
val
.
substr
(
1
);
let
lastLabel
=
this
.
getWord
(
last
,
80
,
false
);
let
lastLabel
=
this
.
getWord
(
last
,
80
,
false
);
wordNodeArr
.
push
(
lastLabel
);
wordNodeArr
.
push
(
lastLabel
);
lastLabel
.
addComponent
(
cc
.
Button
);
lastLabel
.
on
(
'
click
'
,
()
=>
{
play
();
});
}
}
...
@@ -427,6 +461,8 @@ cc.Class({
...
@@ -427,6 +461,8 @@ cc.Class({
_showStandby
:
null
,
_showStandby
:
null
,
initBtn
()
{
initBtn
()
{
this
.
_canClickCat
=
false
;
const
catBtn
=
cc
.
find
(
'
Canvas/Main Camera/catFrame/cat/ClickBtn
'
);
const
catBtn
=
cc
.
find
(
'
Canvas/Main Camera/catFrame/cat/ClickBtn
'
);
catBtn
.
addComponent
(
cc
.
Button
);
catBtn
.
addComponent
(
cc
.
Button
);
...
@@ -635,11 +671,6 @@ cc.Class({
...
@@ -635,11 +671,6 @@ cc.Class({
}
}
},
(
audioId
)
=>
{
},
(
audioId
)
=>
{
//显示完成,不再播放动画
if
(
this
.
_shown
)
{
return
;
}
//设置可播放动画
//设置可播放动画
this
.
_stopAni
=
false
;
this
.
_stopAni
=
false
;
...
...
play/assets/OP_03_2/script/defaultData.js
View file @
112eb3c0
...
@@ -3,11 +3,13 @@ export const defaultData = {
...
@@ -3,11 +3,13 @@ export const defaultData = {
"
wordArr
"
:[
"
wordArr
"
:[
{
{
"
val
"
:
"
A
"
,
"
val
"
:
"
A
"
,
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/8b5ecca5d4509e1b8a7e81e69d8db615.mp3
"
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/8b5ecca5d4509e1b8a7e81e69d8db615.mp3
"
,
"
guideAudioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/8b5ecca5d4509e1b8a7e81e69d8db615.mp3
"
},
},
{
{
"
val
"
:
"
a
"
,
"
val
"
:
"
a
"
,
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/607af37644501e678de6cbafee555948.mp3
"
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/607af37644501e678de6cbafee555948.mp3
"
,
"
guideAudioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/8b5ecca5d4509e1b8a7e81e69d8db615.mp3
"
}
}
],
],
"
word2Arr
"
:[
"
word2Arr
"
:[
...
...
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