Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_NJ_lite
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_NJ_lite
Commits
e0502f71
Commit
e0502f71
authored
Sep 26, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/middleLayer_for_NJ_lite
parents
468bfa95
98bcba55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
middleLayer.ts
assets/middleLayer_for_NJ_lite/script/middleLayer.ts
+18
-11
middleLayerBase.ts
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
+4
-3
No files found.
assets/middleLayer_for_NJ_lite/script/middleLayer.ts
View file @
e0502f71
...
@@ -40,13 +40,17 @@ export default class NewClass extends middleLayerBase {
...
@@ -40,13 +40,17 @@ export default class NewClass extends middleLayerBase {
(
<
any
>
window
).
air
=
{};
(
<
any
>
window
).
air
=
{};
}
}
(
<
any
>
window
).
air
.
hideAirClassLoading
=
()
=>
{
(
<
any
>
window
).
air
.
hideAirClassLoading
=
()
=>
{
console
.
log
(
'
汪汪汪
'
);
if
((
<
any
>
window
).
air
.
onCourseInScreen
)
{
(
<
any
>
window
).
air
.
onCourseInScreen
&&
(
<
any
>
window
).
air
.
onCourseInScreen
(()
=>
{
(
<
any
>
window
).
air
.
onCourseInScreen
(()
=>
{
console
.
log
(
"
***成功调用onCourseInScreen***
"
);
console
.
log
(
"
***成功调用onCourseInScreen***
"
);
(
<
any
>
window
).
air
.
onCourseInScreen
=
null
;
(
<
any
>
window
).
air
.
onCourseInScreen
=
null
;
});
this
.
hideWaitingLetters
();
this
.
hideWaitingLetters
();
this
.
hideMask
();
this
.
hideMask
();
});
}
else
{
this
.
hideWaitingLetters
();
this
.
hideMask
();
}
}
}
}
}
async
showTips
(
str
:
string
)
{
async
showTips
(
str
:
string
)
{
...
@@ -101,7 +105,7 @@ export default class NewClass extends middleLayerBase {
...
@@ -101,7 +105,7 @@ export default class NewClass extends middleLayerBase {
const
{
versionName
:
onlineVersion
,
storeList
}
=
await
this
.
getOnlineVersion
();
const
{
versionName
:
onlineVersion
,
storeList
}
=
await
this
.
getOnlineVersion
();
const
nativeVersion
=
await
this
.
getNativeVersion
();
const
nativeVersion
=
await
this
.
getNativeVersion
();
this
.
version
=
nativeVersion
;
this
.
version
=
nativeVersion
;
if
(
onlineVersion
!=
''
&&
onlineVersion
!=
nativeVersion
)
{
if
(
onlineVersion
!=
''
&&
onlineVersion
!=
nativeVersion
&&
this
.
type
!=
'
aixuebao
'
)
{
console
.
log
(
'
onlineVersion =
'
+
onlineVersion
);
console
.
log
(
'
onlineVersion =
'
+
onlineVersion
);
console
.
log
(
'
nativeVersion =
'
+
nativeVersion
);
console
.
log
(
'
nativeVersion =
'
+
nativeVersion
);
...
@@ -110,11 +114,11 @@ export default class NewClass extends middleLayerBase {
...
@@ -110,11 +114,11 @@ export default class NewClass extends middleLayerBase {
}
}
async
getNativeVersion
()
{
async
getNativeVersion
()
{
const
engineInfo
=
await
this
.
getEngineInfo
();
const
engineInfo
=
await
this
.
getEngineInfo
();
const
{
version
,
isDev
,
type
,
uuid
}
=
JSON
.
parse
(
engineInfo
);
const
{
version
,
isDev
,
type
,
uuid
,
mac
}
=
JSON
.
parse
(
engineInfo
);
this
.
version
=
version
;
this
.
version
=
version
;
this
.
isDev
=
isDev
;
this
.
isDev
=
isDev
;
this
.
type
=
type
;
this
.
type
=
type
;
this
.
engine_uuid
=
uuid
;
this
.
engine_uuid
=
mac
||
uuid
;
return
this
.
version
;
return
this
.
version
;
}
}
...
@@ -281,6 +285,7 @@ export default class NewClass extends middleLayerBase {
...
@@ -281,6 +285,7 @@ export default class NewClass extends middleLayerBase {
score
:
data
?
data
.
score
:
0
,
score
:
data
?
data
.
score
:
0
,
result
:
JSON
.
stringify
(
data
),
result
:
JSON
.
stringify
(
data
),
study_duration
:
Date
.
now
()
-
this
.
courseOpenTimeStamp
,
study_duration
:
Date
.
now
()
-
this
.
courseOpenTimeStamp
,
is_folder_end
:
(
this
.
courseIndex
==
this
.
courses
.
length
-
1
)
?
1
:
0
});
});
callback
&&
callback
(
res
);
callback
&&
callback
(
res
);
}
}
...
@@ -660,7 +665,9 @@ export default class NewClass extends middleLayerBase {
...
@@ -660,7 +665,9 @@ export default class NewClass extends middleLayerBase {
return
;
return
;
}
}
// this.showConfirm("确定跳过吗?", () => {
// this.showConfirm("确定跳过吗?", () => {
this
.
goNextPage
();
if
(
!
this
.
isShowWaiting
)
{
this
.
goNextPage
();
}
// });
// });
});
});
buttonOnClick
(
cc
.
find
(
'
middleLayer/BtnLeft
'
),
()
=>
{
buttonOnClick
(
cc
.
find
(
'
middleLayer/BtnLeft
'
),
()
=>
{
...
...
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
View file @
e0502f71
...
@@ -198,7 +198,7 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -198,7 +198,7 @@ export abstract class middleLayerBase extends cc.Component {
this
.
currentBundleInfo
=
{
sceneName
,
version
,
bondleUrl
};
this
.
currentBundleInfo
=
{
sceneName
,
version
,
bondleUrl
};
console
.
log
(
"
[middleLayer_for_NJ_lite]-[loadBundle] currentBundleInfo=
"
,
JSON
.
stringify
(
this
.
currentBundleInfo
))
console
.
log
(
"
[middleLayer_for_NJ_lite]-[loadBundle] currentBundleInfo=
"
,
JSON
.
stringify
(
this
.
currentBundleInfo
))
this
.
showWaitingLetters
();
this
.
showWaitingLetters
();
cc
.
audioEngine
.
stopAll
();
const
oldSceneName
=
this
.
currentBundleInfo
?.
sceneName
;
const
oldSceneName
=
this
.
currentBundleInfo
?.
sceneName
;
const
engineInfo
=
await
this
.
getEngineInfo
();
const
engineInfo
=
await
this
.
getEngineInfo
();
const
{
isChanged
}
=
JSON
.
parse
(
engineInfo
);
const
{
isChanged
}
=
JSON
.
parse
(
engineInfo
);
...
@@ -208,7 +208,6 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -208,7 +208,6 @@ export abstract class middleLayerBase extends cc.Component {
cc
.
assetManager
.
loadBundle
(
bondleUrl
,
{
version
:
version
},
async
(
err
,
bundle
)
=>
{
cc
.
assetManager
.
loadBundle
(
bondleUrl
,
{
version
:
version
},
async
(
err
,
bundle
)
=>
{
bundle
.
loadScene
(
sceneName
,
null
,
null
,
(
err
,
scene
)
=>
{
bundle
.
loadScene
(
sceneName
,
null
,
null
,
(
err
,
scene
)
=>
{
cc
.
audioEngine
.
stopAll
();
this
.
loadBundleLock
=
false
;
// 加载完成 解锁
this
.
loadBundleLock
=
false
;
// 加载完成 解锁
let
bufferedLoadBundle
=
this
.
getLoadBundleFromBuffer
();
let
bufferedLoadBundle
=
this
.
getLoadBundleFromBuffer
();
if
(
bufferedLoadBundle
)
{
if
(
bufferedLoadBundle
)
{
...
@@ -350,12 +349,14 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -350,12 +349,14 @@ export abstract class middleLayerBase extends cc.Component {
this
.
goTarIndexPage
(
this
.
courseIndex
-
1
);
this
.
goTarIndexPage
(
this
.
courseIndex
-
1
);
}
}
goNextPage
()
{
goNextPage
()
{
console
.
log
(
"
====goNextPage====
"
);
this
.
goTarIndexPage
(
this
.
courseIndex
+
1
);
this
.
goTarIndexPage
(
this
.
courseIndex
+
1
);
}
}
goTarIndexPage
(
index
)
{
goTarIndexPage
(
index
)
{
if
(
!
this
.
courses
||
index
==
this
.
courseIndex
||
index
<
0
||
index
>
this
.
courses
.
length
-
1
)
{
if
(
!
this
.
courses
||
index
==
this
.
courseIndex
||
index
<
0
||
index
>
this
.
courses
.
length
-
1
)
{
return
;
return
;
}
}
this
.
showWaitingLetters
();
this
.
showWaitingLetters
();
(
<
any
>
window
).
courseware
.
freeAllOcMethod
();
(
<
any
>
window
).
courseware
.
freeAllOcMethod
();
...
@@ -372,7 +373,7 @@ export abstract class middleLayerBase extends cc.Component {
...
@@ -372,7 +373,7 @@ export abstract class middleLayerBase extends cc.Component {
}
}
log
(
str
:
string
)
{
log
(
str
:
string
)
{
c
c
.
log
(
str
);
c
onsole
.
log
(
str
);
}
}
showTips
(
str
:
string
)
{
showTips
(
str
:
string
)
{
...
...
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