Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
z_05_xcx
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
z_05_xcx
Commits
9194730d
Commit
9194730d
authored
Sep 27, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 移出屏幕的节点移除
parent
a2858aa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
120 additions
and
113 deletions
+120
-113
n_xuan1.js
play/assets/tmpGame/scene_2/n_xuan1.js
+120
-113
No files found.
play/assets/tmpGame/scene_2/n_xuan1.js
View file @
9194730d
...
...
@@ -89,7 +89,7 @@ cc.Class({
getData
(
func
)
{
http
(
'
GET
'
,
'
https://staging-teach.ireadabc.com/api/courseware/v1/getdata?courseid=
'
+
this
.
courseid
,
{}).
then
((
resStr
)
=>
{
http
(
'
GET
'
,
'
https://staging-teach.ireadabc.com/api/courseware/v1/getdata?courseid=
'
+
this
.
courseid
,
{}).
then
((
resStr
)
=>
{
const
res
=
JSON
.
parse
(
resStr
)
const
data
=
JSON
.
parse
(
res
.
data
);
func
(
data
);
...
...
@@ -302,7 +302,7 @@ cc.Class({
w
:
{
big
:
'
<color=#73edff>W</c><color=#ffffff>INDOW</color>
'
,
small
:
'
<color=#abff61>w</c><color=#ffffff>indow</color>
'
},
x
:
{
big
:
'
<color=#ffffff>BO</color><color=#73edff>X</c>
'
,
small
:
'
<color=#ffffff>bo</color><color=#abff61>x</c>
'
},
y
:
{
big
:
'
<color=#73edff>Y</c><color=#ffffff>OGURT</color>
'
,
small
:
'
<color=#abff61>y</c><color=#ffffff>ogurt</color>
'
},
z
:
{
big
:
'
<color=#73edff>Z</c><color=#ffffff>EBRA</color>
'
,
small
:
'
<color=#abff61>z</c><color=#ffffff>ebra</color
'
}
z
:
{
big
:
'
<color=#73edff>Z</c><color=#ffffff>EBRA</color>
'
,
small
:
'
<color=#abff61>z</c><color=#ffffff>ebra</color
>
'
}
}
const
bigPictureWordRichText
=
cc
.
find
(
'
Canvas/LetterPicturePage/PictureWordBigBg/PictureWordBigRichText
'
);
...
...
@@ -814,6 +814,9 @@ cc.Class({
letterNodeBase
.
zIndex
=
10
;
cc
.
tween
(
letterNodeBase
)
.
to
(
1.2
,
{
y
:
1500
},
{
easing
:
'
cubicIn
'
})
.
call
(()
=>
{
letterNodeBase
.
active
=
false
;
})
.
start
();
},
...
...
@@ -862,6 +865,10 @@ cc.Class({
cc
.
tween
(
ribbonNodeBase
)
.
by
(
3
,
{
y
:
-
1600
,
x
:
RandomInt
(
-
100
,
100
),
angle
:
RandomInt
(
-
60
,
60
)
})
.
call
(()
=>
{
ribbonNodeBase
.
active
=
false
;
ribbonNodeBase
.
removeFromParent
();
})
.
start
();
}
},
...
...
@@ -1136,7 +1143,7 @@ cc.Class({
let
isNeedSendData
=
true
;
rankData
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
name
==
newData
.
name
)
{
if
(
item
.
score
<
newData
.
score
)
{
isNeedSendData
=
false
;
}
...
...
@@ -1147,7 +1154,7 @@ cc.Class({
this
.
sendData
(
newData
);
}
const
tmpData
=
{}
...
...
@@ -1156,7 +1163,7 @@ cc.Class({
if
(
!
tmpData
[
scoreData
.
name
])
{
tmpData
[
scoreData
.
name
]
=
scoreData
}
else
{
if
(
tmpData
[
scoreData
.
name
].
score
>
scoreData
.
score
)
{
if
(
tmpData
[
scoreData
.
name
].
score
>
scoreData
.
score
)
{
tmpData
[
scoreData
.
name
]
=
scoreData
;
}
}
...
...
@@ -1171,7 +1178,7 @@ cc.Class({
})
this
.
rankData
=
newRankData
;
this
.
setScrollView
();
cc
.
find
(
'
Canvas/scrollview
'
).
active
=
true
;
...
...
@@ -1179,7 +1186,7 @@ cc.Class({
},
sendData
(
data
)
{
http
(
'
POST
'
,
'
https://staging-teach.ireadabc.com/api/dashboard/v1/studyinfo?courseid=
'
+
this
.
courseid
,
data
).
then
((
resStr
)
=>
{
http
(
'
POST
'
,
'
https://staging-teach.ireadabc.com/api/dashboard/v1/studyinfo?courseid=
'
+
this
.
courseid
,
data
).
then
((
resStr
)
=>
{
const
res
=
JSON
.
parse
(
resStr
)
console
.
log
(
'
sendData res:
'
,
res
);
});
...
...
@@ -1187,7 +1194,7 @@ cc.Class({
},
receiveData
(
id
,
cb
)
{
http
(
'
GET
'
,
'
https://staging-teach.ireadabc.com/api/dashboard/v1/studyinfo?courseid=
'
+
this
.
courseid
,
{}).
then
((
resStr
)
=>
{
http
(
'
GET
'
,
'
https://staging-teach.ireadabc.com/api/dashboard/v1/studyinfo?courseid=
'
+
this
.
courseid
,
{}).
then
((
resStr
)
=>
{
const
res
=
JSON
.
parse
(
resStr
)
if
(
cb
)
{
cb
(
res
.
data
);
...
...
@@ -1238,8 +1245,8 @@ cc.Class({
const
self
=
this
;
self
.
createUserInfoButton
();
},
showLoadingPage
()
{
...
...
@@ -1255,7 +1262,7 @@ cc.Class({
loadingIcon
.
opacity
=
0
;
cc
.
tween
(
loadingIcon
)
.
to
(
2
,
{
opacity
:
255
},
{
easing
:
'
cubicOut
'
})
.
to
(
2
,
{
opacity
:
255
},
{
easing
:
'
cubicOut
'
})
.
start
()
},
...
...
@@ -1263,7 +1270,7 @@ cc.Class({
const
loading
=
cc
.
find
(
'
Canvas/loading
'
)
cc
.
tween
(
loading
)
.
to
(
0.5
,
{
opacity
:
0
},
{
easing
:
'
cubicOut
'
})
.
to
(
0.5
,
{
opacity
:
0
},
{
easing
:
'
cubicOut
'
})
.
call
(()
=>
{
loading
.
active
=
false
;
})
...
...
@@ -1273,108 +1280,108 @@ cc.Class({
/**
* 点击创建用户信息授权按钮
*/
authorButton
:
null
,
createUserInfoButton
()
{
//获取视图窗口可见区域尺寸
let
visibleSize
=
cc
.
view
.
getVisibleSize
();
//获取系统信息
let
wx_size
=
wx
.
getSystemInfoSync
();
//计算实际大小和可见区域尺寸的比例(这里以宽度为准)
let
size_scale_width
=
wx_size
.
screenWidth
/
visibleSize
.
width
;
//计算创建用户信息按钮需要的属性(img_auth为蓝色参考节点)
let
x
=
visibleSize
.
width
/
2
;
//(this.img_auth.x + visibleSize.width / 2 - this.img_auth.width / 2) * size_scale_width;
let
y
=
visibleSize
.
height
/
2
;
// (Math.abs(this.img_auth.y) + visibleSize.height / 2 - this.img_auth.height / 2) * size_scale_width;
let
width
=
300
;
// this.img_auth.width * size_scale_width;
let
height
=
300
;
// this.img_auth.height * size_scale_width;
const
frameSize
=
cc
.
view
.
getFrameSize
();
const
rankBtnW
=
200
;
const
rankBtnH
=
40
;
const
disH
=
-
40
;
this
.
authorButton
=
wx
.
createUserInfoButton
({
type
:
'
text
'
,
text
:
'
查看排行
'
,
style
:
{
left
:
frameSize
.
width
/
2
-
rankBtnW
/
2
,
top
:
frameSize
.
height
/
2
-
rankBtnH
/
2
-
disH
,
width
:
200
,
height
:
40
,
lineHeight
:
40
,
backgroundColor
:
'
#cccccc
'
,
color
:
'
#222222
'
,
textAlign
:
'
center
'
,
fontSize
:
16
,
borderRadius
:
4
}
})
const
replayBtn
=
cc
.
find
(
'
Canvas/replayButton
'
);
// replayBtn.y = cc.winSize.height / 2 - disH;
replayBtn
.
active
=
true
;
console
.
log
(
'
this.authorButton:
'
,
this
.
authorButton
);
this
.
authorButton
.
onTap
((
res
)
=>
{
if
(
res
.
errMsg
==
"
getUserInfo:ok
"
)
{
wx
.
showToast
({
icon
:
"
none
"
,
title
:
"
获取用户信息成功
"
,
duration
:
2000
,
});
this
.
authorButton
.
hide
();
//获取用户信息成功后隐藏按钮
// wx.login({
// success (res) {
// console.log('login res: ', res);
// if (res.code) {
// //发起网络请求
// const tmpUrl = 'https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code'
// wx.request({
// url: 'https://test.com/onLogin',
// data: {
// code: res.code
// }
// })
// } else {
// console.log('登录失败!' + res.errMsg)
// }
// }
// })
console
.
log
(
'
res:
'
,
res
)
authorButton
:
null
,
createUserInfoButton
()
{
//获取视图窗口可见区域尺寸
let
visibleSize
=
cc
.
view
.
getVisibleSize
();
//获取系统信息
let
wx_size
=
wx
.
getSystemInfoSync
();
//计算实际大小和可见区域尺寸的比例(这里以宽度为准)
let
size_scale_width
=
wx_size
.
screenWidth
/
visibleSize
.
width
;
//计算创建用户信息按钮需要的属性(img_auth为蓝色参考节点)
let
x
=
visibleSize
.
width
/
2
;
//(this.img_auth.x + visibleSize.width / 2 - this.img_auth.width / 2) * size_scale_width;
let
y
=
visibleSize
.
height
/
2
;
// (Math.abs(this.img_auth.y) + visibleSize.height / 2 - this.img_auth.height / 2) * size_scale_width;
let
width
=
300
;
// this.img_auth.width * size_scale_width;
let
height
=
300
;
// this.img_auth.height * size_scale_width;
const
frameSize
=
cc
.
view
.
getFrameSize
();
const
rankBtnW
=
200
;
const
rankBtnH
=
40
;
const
disH
=
-
40
;
this
.
authorButton
=
wx
.
createUserInfoButton
({
type
:
'
text
'
,
text
:
'
查看排行
'
,
style
:
{
left
:
frameSize
.
width
/
2
-
rankBtnW
/
2
,
top
:
frameSize
.
height
/
2
-
rankBtnH
/
2
-
disH
,
width
:
200
,
height
:
40
,
lineHeight
:
40
,
backgroundColor
:
'
#cccccc
'
,
color
:
'
#222222
'
,
textAlign
:
'
center
'
,
fontSize
:
16
,
borderRadius
:
4
}
})
const
self
=
this
;
wx
.
getUserInfo
({
success
(
res
)
{
console
.
log
(
"
getUserInfo:
"
,
res
);
self
.
userInfo
=
res
.
userInfo
;
self
.
showScrollView
();
// exportJson.userInfo = res.userInfo;
//此时可进行登录操作
const
replayBtn
=
cc
.
find
(
'
Canvas/replayButton
'
);
// replayBtn.y = cc.winSize.height / 2 - disH;
replayBtn
.
active
=
true
;
console
.
log
(
'
this.authorButton:
'
,
this
.
authorButton
);
this
.
authorButton
.
onTap
((
res
)
=>
{
if
(
res
.
errMsg
==
"
getUserInfo:ok
"
)
{
wx
.
showToast
({
icon
:
"
none
"
,
title
:
"
获取用户信息成功
"
,
duration
:
2000
,
});
this
.
authorButton
.
hide
();
//获取用户信息成功后隐藏按钮
// wx.login({
// success (res) {
// console.log('login res: ', res);
// if (res.code) {
// //发起网络请求
// const tmpUrl = 'https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code'
// wx.request({
// url: 'https://test.com/onLogin',
// data: {
// code: res.code
// }
// })
// } else {
// console.log('登录失败!' + res.errMsg)
// }
// }
// })
console
.
log
(
'
res:
'
,
res
)
const
self
=
this
;
wx
.
getUserInfo
({
success
(
res
)
{
console
.
log
(
"
getUserInfo:
"
,
res
);
self
.
userInfo
=
res
.
userInfo
;
self
.
showScrollView
();
// exportJson.userInfo = res.userInfo;
//此时可进行登录操作
}
});
}
else
{
if
(
res
.
errMsg
===
"
getUserInfo:fail auth deny
"
)
{
wx
.
showToast
({
icon
:
"
none
"
,
title
:
"
获取用户信息失败
"
,
duration
:
2000
,
});
}
else
{
wx
.
showToast
({
icon
:
"
none
"
,
title
:
res
.
errMsg
,
duration
:
2000
,
});
}
}
});
}
else
{
if
(
res
.
errMsg
===
"
getUserInfo:fail auth deny
"
)
{
wx
.
showToast
({
icon
:
"
none
"
,
title
:
"
获取用户信息失败
"
,
duration
:
2000
,
});
}
else
{
wx
.
showToast
({
icon
:
"
none
"
,
title
:
res
.
errMsg
,
duration
:
2000
,
});
}
}
});
},
},
});
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