Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
ls_gramophone
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
ls_gramophone
Commits
4cd126ac
Commit
4cd126ac
authored
Jun 14, 2022
by
李帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+1
parent
c4f1d402
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
ls_gramophone.ts
assets/ls_gramophone/scene/ls_gramophone.ts
+17
-4
No files found.
assets/ls_gramophone/scene/ls_gramophone.ts
View file @
4cd126ac
/*
/*
* @Author: ls
* @Author: ls
* @Date: 2022-05-15 18:22:18
* @Date: 2022-05-15 18:22:18
* @LastEditTime: 2022-06-14 16:
10:58
* @LastEditTime: 2022-06-14 16:
46:05
* @LastEditors: ls
* @LastEditors: ls
* @Description:
* @Description:
* @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts
* @FilePath: \ls_gramophone\assets\ls_gramophone\scene\ls_gramophone.ts
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
import
Item
from
'
../script/Item
'
;
import
Item
from
'
../script/Item
'
;
import
{
MyCocosSceneComponent
}
from
'
../script/MyCocosSceneComponent
'
;
import
{
MyCocosSceneComponent
}
from
'
../script/MyCocosSceneComponent
'
;
import
{
onHomeworkFinish
}
from
'
../script/util
'
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
@@ -33,6 +34,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -33,6 +34,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 当前
// 当前
_curIndex
=
-
1
;
_curIndex
=
-
1
;
_results
=
[];
addPreloadImage
()
{
addPreloadImage
()
{
// TODO 根据自己的配置预加载图片资源
// TODO 根据自己的配置预加载图片资源
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pageImage
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pageImage
});
...
@@ -61,8 +64,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -61,8 +64,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_recording
=
false
;
this
.
_recording
=
false
;
this
.
_records
.
length
=
0
;
this
.
_records
.
length
=
0
;
this
.
_results
.
length
=
0
;
this
.
data
.
sentences
.
forEach
((
element
)
=>
{
this
.
data
.
sentences
.
forEach
((
element
)
=>
{
this
.
_records
.
push
(
null
);
this
.
_records
.
push
(
null
);
this
.
_results
.
push
(
null
);
});
});
}
}
...
@@ -303,20 +308,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -303,20 +308,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
idx
!==
-
1
)
{
if
(
idx
!==
-
1
)
{
this
.
_records
[
idx
]
=
res
.
audioUrl
;
this
.
_records
[
idx
]
=
res
.
audioUrl
;
this
.
log
(
`
${
idx
}
===>
${
res
.
audioUrl
}
`
);
this
.
log
(
`
${
idx
}
===>
${
res
.
audioUrl
}
`
);
// onHomeworkFinish(res);
this
.
content
.
children
[
idx
].
getComponent
(
Item
).
recorded
();
// this.resetRecord();
}
}
this
.
_results
[
idx
]
=
res
;
for
(
const
iterator
of
this
.
_results
)
{
if
(
iterator
===
null
)
{
return
;
}
}
}
}
onHomeworkFinish
({
stone
:
10
,
details
:
this
.
_results
});
});
});
}
else
{
}
else
{
if
(
idx
!==
-
1
)
{
if
(
idx
!==
-
1
)
{
this
.
content
.
children
[
idx
].
getComponent
(
Item
).
recorded
();
this
.
content
.
children
[
idx
].
getComponent
(
Item
).
recorded
();
// this.resetRecord();
}
}
// 模拟测试
// 模拟测试
// this._records[idx] = 'http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3';
// this._records[idx] = 'http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3';
}
}
this
.
resetRecord
();
});
});
}
}
...
...
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