Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ireadabcMiddleLayer
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
ireadabcMiddleLayer
Commits
088a8c18
Commit
088a8c18
authored
Dec 20, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: log
parent
bac68d29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
middleLayer.js
assets/ireadabcMiddleLayer/script/middleLayer.js
+20
-18
No files found.
assets/ireadabcMiddleLayer/script/middleLayer.js
View file @
088a8c18
...
@@ -97,12 +97,12 @@ cc.Class({
...
@@ -97,12 +97,12 @@ cc.Class({
// })
// })
// }, 20000);
// }, 20000);
//
this.baseUrl = 'http://staging-teach.ireadabc.com/api/';
this
.
baseUrl
=
'
http://staging-teach.ireadabc.com/api/
'
;
//
this.initStoryBoxView({
this
.
initStoryBoxView
({
//
// coursewareId: 18307
// coursewareId: 18307
//
coursewareId: 18582
coursewareId
:
18582
//
});
});
//
this.bundleType = 'StoryBox';
this
.
bundleType
=
'
StoryBox
'
;
this
.
log
(
'
汪汪汪
'
);
this
.
log
(
'
汪汪汪
'
);
},
},
...
@@ -162,6 +162,7 @@ cc.Class({
...
@@ -162,6 +162,7 @@ cc.Class({
initStoryBoxView
(
bundleInfo
)
{
initStoryBoxView
(
bundleInfo
)
{
this
.
hideWWView
();
this
.
hideWWView
();
this
.
showLog
(
bundleInfo
.
coursewareId
);
this
.
callNetworkApiGet
(
'
syllabus/v1/tree
'
,
{
orgid
:
483
,
pid
:
bundleInfo
.
coursewareId
},
(
data
)
=>
{
this
.
callNetworkApiGet
(
'
syllabus/v1/tree
'
,
{
orgid
:
483
,
pid
:
bundleInfo
.
coursewareId
},
(
data
)
=>
{
console
.
log
(
data
);
console
.
log
(
data
);
const
defaultBondle
=
data
.
rows
.
find
(
row
=>
row
.
name
==
'
默认
'
);
const
defaultBondle
=
data
.
rows
.
find
(
row
=>
row
.
name
==
'
默认
'
);
...
@@ -178,13 +179,9 @@ cc.Class({
...
@@ -178,13 +179,9 @@ cc.Class({
this
.
menuItemNodeList
=
[];
this
.
menuItemNodeList
=
[];
let
storyBoxMenuLength
=
0
;
console
.
log
(
data
.
rows
.
map
(
row
=>
row
.
name
));
data
.
rows
.
filter
((
row
)
=>
{
data
.
rows
.
filter
((
row
)
=>
{
return
row
.
name
!=
'
默认
'
;
return
row
.
name
!=
'
默认
'
;
}).
forEach
((
data
,
idx
)
=>
{
}).
forEach
((
data
,
idx
,
arr
)
=>
{
console
.
log
(
data
.
name
,
idx
);
console
.
log
(
data
.
name
,
idx
);
const
node
=
cc
.
instantiate
(
cc
.
find
(
'
middleLayer/menuItem
'
));
const
node
=
cc
.
instantiate
(
cc
.
find
(
'
middleLayer/menuItem
'
));
...
@@ -192,8 +189,7 @@ cc.Class({
...
@@ -192,8 +189,7 @@ cc.Class({
node
.
parent
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase
'
);
node
.
parent
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase
'
);
node
.
active
=
true
;
node
.
active
=
true
;
node
.
x
=
0
;
node
.
x
=
0
;
node
.
y
=
50
+
storyBoxMenuLength
*
100
;
node
.
y
=
50
+
(
arr
.
length
-
1
-
idx
)
*
100
;
storyBoxMenuLength
++
;
this
.
menuItemNodeList
.
push
(
node
);
this
.
menuItemNodeList
.
push
(
node
);
...
@@ -222,6 +218,7 @@ cc.Class({
...
@@ -222,6 +218,7 @@ cc.Class({
.
call
(()
=>
{
.
call
(()
=>
{
if
(
data
.
has_child
==
'
0
'
)
{
if
(
data
.
has_child
==
'
0
'
)
{
this
.
hideAllSubmenu
();
this
.
hideAllSubmenu
();
this
.
resetAllMenu
();
this
.
hideMenu
();
this
.
hideMenu
();
btn
.
active
=
false
;
btn
.
active
=
false
;
btnSelected
.
active
=
true
;
btnSelected
.
active
=
true
;
...
@@ -300,11 +297,11 @@ cc.Class({
...
@@ -300,11 +297,11 @@ cc.Class({
}
}
});
});
this
.
storyBoxMenuLength
=
this
.
menuItemNodeList
.
filter
(
node
=>
node
.
active
).
length
;
const
titleNode
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase/title
'
);
const
titleNode
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase/title
'
);
titleNode
.
y
=
30
+
storyBoxMenuLength
*
100
;
titleNode
.
y
=
30
+
this
.
storyBoxMenuLength
*
100
;
this
.
storyBoxMenuLength
=
this
.
menuItemNodeList
.
filter
(
node
=>
node
.
active
).
length
;
const
storyBox
=
cc
.
find
(
'
middleLayer/storyBox
'
);
const
storyBox
=
cc
.
find
(
'
middleLayer/storyBox
'
);
storyBox
.
active
=
true
;
storyBox
.
active
=
true
;
...
@@ -313,6 +310,13 @@ cc.Class({
...
@@ -313,6 +310,13 @@ cc.Class({
},
},
hideAllSubmenu
()
{
hideAllSubmenu
()
{
this
.
menuItemNodeList
.
forEach
(
node
=>
{
const
menuBase
=
cc
.
find
(
'
bubbleBase
'
,
node
);
menuBase
.
active
=
false
;
});
},
resetAllMenu
()
{
this
.
menuItemNodeList
.
forEach
(
node
=>
{
this
.
menuItemNodeList
.
forEach
(
node
=>
{
const
btn
=
cc
.
find
(
'
btn
'
,
node
);
const
btn
=
cc
.
find
(
'
btn
'
,
node
);
const
btnLight
=
cc
.
find
(
'
btnHightLight
'
,
node
);
const
btnLight
=
cc
.
find
(
'
btnHightLight
'
,
node
);
...
@@ -326,9 +330,6 @@ cc.Class({
...
@@ -326,9 +330,6 @@ cc.Class({
const
labelSelected
=
cc
.
find
(
'
labelSelected
'
,
node
);
const
labelSelected
=
cc
.
find
(
'
labelSelected
'
,
node
);
label
.
active
=
true
;
label
.
active
=
true
;
labelSelected
.
active
=
false
;
labelSelected
.
active
=
false
;
const
menuBase
=
cc
.
find
(
'
bubbleBase
'
,
node
);
menuBase
.
active
=
false
;
});
});
},
},
...
@@ -387,6 +388,7 @@ cc.Class({
...
@@ -387,6 +388,7 @@ cc.Class({
hideMenu
()
{
hideMenu
()
{
this
.
hideAllSubmenu
();
this
.
hideAllSubmenu
();
this
.
resetAllMenu
();
const
lineBtnShow
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase/lineBtnShow
'
);
const
lineBtnShow
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase/lineBtnShow
'
);
const
lineBtnHide
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase/lineBtnHide
'
)
const
lineBtnHide
=
cc
.
find
(
'
middleLayer/storyBox/menu/menuBase/lineBtnHide
'
)
...
...
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