Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_debug
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
middleLayer_for_debug
Commits
50e9976b
Commit
50e9976b
authored
Dec 28, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/middleLayer_for_debug
parents
74df49d4
ee636fbf
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1787 additions
and
245 deletions
+1787
-245
middleLayer_for_debug.fire
...ts/middleLayer_for_debug/scene/middleLayer_for_debug.fire
+1737
-241
middleLayer.js
assets/middleLayer_for_debug/script/middleLayer.js
+49
-3
project.json
settings/project.json
+1
-1
No files found.
assets/middleLayer_for_debug/scene/middleLayer_for_debug.fire
View file @
50e9976b
This diff is collapsed.
Click to expand it.
assets/middleLayer_for_debug/script/middleLayer.js
View file @
50e9976b
...
...
@@ -112,6 +112,20 @@ cc.Class({
});
},
preloadSourceImman
()
{
// 测试用
cc
.
find
(
"
middleLayer/ui/ProgressLabel
"
).
active
=
true
;
cc
.
find
(
'
middleLayer/ui/loadingProgress
'
).
active
=
true
;
this
.
callNetworkApiGet
(
`http://staging-teach.ireadabc.com`
,
`/api/courseware/v1/getresources`
,
{
courseid
:
20894
},
(
datastr1
)
=>
{
const
data1
=
JSON
.
parse
(
datastr1
);
if
(
data1
.
rows
&&
data1
.
rows
.
length
>
0
)
{
this
.
preloadCount
+=
data1
.
rows
.
length
;
}
this
.
log
(
'
data1.rows =
'
+
JSON
.
stringify
(
data1
.
rows
));
this
.
preloadSource
(
data1
.
rows
);
});
},
batchPreloadScene
(
scenes
=
[])
{
const
expects
=
[
// 'op_03_2',
...
...
@@ -245,6 +259,30 @@ cc.Class({
window
.
courseware
.
closeOsmo
();
});
cc
.
find
(
'
middleLayer/ui/BtnOpenRecord
'
).
on
(
'
click
'
,
()
=>
{
window
.
courseware
.
startRecord
(
''
);
});
cc
.
find
(
'
middleLayer/ui/BtnCloseRecord
'
).
on
(
'
click
'
,
()
=>
{
window
.
courseware
.
stopRecord
(
0
,
res
=>
{
this
.
log
(
'
--------录音返回结果 stopRecord ------------
'
);
this
.
log
(
JSON
.
stringify
(
res
))
this
.
log
(
'
------------------------------
'
);
});
});
cc
.
find
(
'
middleLayer/ui/BtnOpenTest
'
).
on
(
'
click
'
,
()
=>
{
window
.
courseware
.
startTest
(
''
);
});
cc
.
find
(
'
middleLayer/ui/BtnCloseTest
'
).
on
(
'
click
'
,
()
=>
{
window
.
courseware
.
stopTest
(
res
=>
{
this
.
log
(
'
--------录音评测返回结果 stopTest ---------
'
);
this
.
log
(
JSON
.
stringify
(
res
))
this
.
log
(
'
------------------------------
'
);
});
});
const
BtnStartLocal
=
cc
.
find
(
'
middleLayer/ui/BtnStartLocal
'
);
BtnStartLocal
.
on
(
'
click
'
,
()
=>
{
const
addressText
=
cc
.
find
(
'
middleLayer/ui/address
'
);
...
...
@@ -261,8 +299,6 @@ cc.Class({
const
BtnStartOnline
=
cc
.
find
(
'
middleLayer/ui/BtnStartOnline
'
);
BtnStartOnline
.
on
(
'
click
'
,
()
=>
{
this
.
showWaitingLetters
();
this
.
hideUI
();
const
nameText
=
cc
.
find
(
'
middleLayer/ui/bundleName
'
);
const
bundleName
=
nameText
.
getComponent
(
cc
.
EditBox
).
string
;
cc
.
sys
.
localStorage
.
setItem
(
'
bundleName
'
,
bundleName
);
...
...
@@ -285,7 +321,8 @@ cc.Class({
this
.
loadedCount
=
0
;
cc
.
find
(
"
middleLayer/ui/ProgressLabel
"
).
active
=
true
;
cc
.
find
(
'
middleLayer/ui/loadingProgress
'
).
active
=
true
;
this
.
preloadAll
();
// this.preloadAll();
this
.
preloadSourceImman
();
});
const
btnClose
=
cc
.
find
(
'
middleLayer/ConsoleNode/BtnClose
'
);
...
...
@@ -349,6 +386,8 @@ cc.Class({
cc
.
find
(
'
middleLayer/ui
'
).
active
=
false
;
},
loadOnlineBundle
(
bundleName
)
{
this
.
hideUI
();
this
.
showWaitingLetters
();
this
.
callNetworkApiGet
(
`http://staging-teach.ireadabc.com`
,
`/api/template/v1/
${
bundleName
}
`
,
{},
(
datastr
)
=>
{
const
data
=
JSON
.
parse
(
datastr
);
let
configData
=
null
;
...
...
@@ -602,6 +641,13 @@ cc.Class({
},
1000
);
},
exit
()
{
cc
.
game
.
removePersistRootNode
(
this
.
node
);
cc
.
director
.
loadScene
(
"
emptyScene
"
,
()
=>
{
this
.
callNativeFunction
({
name
:
'
exit
'
,
value
:
''
});
});
},
getRainbowColorList
()
{
return
[
cc
.
color
(
255
,
255
,
0
),
...
...
settings/project.json
View file @
50e9976b
{
"last-module-event-record-time"
:
163
6882785201
,
"last-module-event-record-time"
:
163
9702063432
,
"migrate-history"
:
[
"cloud-function"
]
...
...
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