Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_ShaMo
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
NJ_ShaMo
Commits
e21f2ef7
Commit
e21f2ef7
authored
Jul 20, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
e7200d07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
15 deletions
+39
-15
NJ_ShaMo.ts
assets/NJ_ShaMo/scene/NJ_ShaMo.ts
+36
-12
util.ts
assets/NJ_ShaMo/script/util.ts
+3
-3
No files found.
assets/NJ_ShaMo/scene/NJ_ShaMo.ts
View file @
e21f2ef7
...
...
@@ -60,7 +60,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
moreGameFolder
=
res
.
rows
.
find
(
item
=>
item
.
name
==
'
more games
'
);
}
orgId
=
507
;
async
onLoadEnd
()
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
this
.
orgId
=
middleLayer
.
getComponent
(
'
middleLayer
'
).
ORG_ID
||
507
;
}
if
(
this
.
orgId
!=
507
)
{
// 数字版
cc
.
find
(
'
Canvas/lxc
'
).
active
=
false
;
}
await
this
.
initData
();
await
this
.
initView
();
this
.
initListener
();
...
...
@@ -155,20 +165,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
resStr
=
await
asyncCallNetworkApiGet
(
'
/api/syllabus/v1/list
'
,
{
pid
:
this
.
rows
[
i
].
id
});
const
res
=
JSON
.
parse
(
resStr
);
const
guideRow
=
res
.
rows
.
find
(
row
=>
row
.
name
==
'
指读索引
'
);
if
(
!
guideRow
)
{
middleLayerComponent
.
showTips
(
"
未配置‘指读索引’
"
);
return
;
if
(
this
.
orgId
==
507
)
{
const
guideRow
=
res
.
rows
.
find
(
row
=>
row
.
name
==
'
指读索引
'
);
if
(
!
guideRow
)
{
middleLayerComponent
.
showTips
(
"
未配置‘指读索引’
"
);
return
;
}
middleLayerComponent
.
setData
(
'
NJ_game_select
'
,
{
folderId
:
this
.
rows
[
i
].
id
,
folderName
:
this
.
rows
[
i
].
name
,
courseId
:
guideRow
.
id
,
nextFolderId
:
this
.
rows
[
i
+
1
]?.
id
});
jumpToCourseWare
(
guideRow
.
id
);
}
else
{
if
(
res
.
rows
.
length
==
0
)
{
middleLayerComponent
.
showTips
(
"
未制作
"
);
return
;
}
middleLayerComponent
.
setData
(
'
NJ_game_select
'
,
{
folderId
:
this
.
rows
[
i
].
id
,
folderName
:
this
.
rows
[
i
].
name
,
courseId
:
res
.
rows
[
0
].
id
,
nextFolderId
:
this
.
rows
[
i
+
1
]?.
id
});
jumpToCourseWare
(
res
.
rows
[
0
].
id
,
true
);
}
middleLayerComponent
.
setData
(
'
NJ_game_select
'
,
{
folderId
:
this
.
rows
[
i
].
id
,
folderName
:
this
.
rows
[
i
].
name
,
courseId
:
guideRow
.
id
,
nextFolderId
:
this
.
rows
[
i
+
1
]?.
id
});
jumpToCourseWare
(
guideRow
.
id
);
});
}
...
...
assets/NJ_ShaMo/script/util.ts
View file @
e21f2ef7
...
...
@@ -536,13 +536,13 @@ export function jumpToBundle(bundleName: string) {
}
}
export
function
jumpToCourseWare
(
course
WareId
:
number
)
{
export
function
jumpToCourseWare
(
course
Id
:
number
,
linkFlag
=
false
)
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
middleLayerComponent
.
loadOnlineCourseWare
(
course
WareId
);
middleLayerComponent
.
loadOnlineCourseWare
(
course
Id
,
linkFlag
);
}
else
{
console
.
log
(
'
jump to CourseWare:
'
+
course
Ware
Id
);
console
.
log
(
'
jump to CourseWare:
'
+
courseId
);
}
}
...
...
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