Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_iplayabc
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_iplayabc
Commits
4379b6b4
Commit
4379b6b4
authored
Feb 14, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 提取方法
parent
ca037c18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
middleLayer.js
assets/middleLayer_for_iplayabc/script/middleLayer.js
+15
-13
No files found.
assets/middleLayer_for_iplayabc/script/middleLayer.js
View file @
4379b6b4
...
...
@@ -85,21 +85,11 @@ cc.Class({
this
.
initListener
();
this
.
initPageInfo
();
this
.
hideUI
();
//
this.showWaitingLetters();
this
.
showWaitingLetters
();
this
.
initTerminalInfo
(()
=>
{
this
.
getUserStar
();
// 获取用户所获得的星星数量
// this.loadGame();
cc
.
assetManager
.
loadRemote
(
`
${
this
.
baseApiUrl
}
v1/wechart/wxacode?user_code=
${
this
.
userCode
}
`
,{
ext
:
'
.jpeg
'
},
(
err
,
img
)
=>
{
if
(
err
)
{
console
.
log
(
"
==远程图片加载错误==
"
);
// TODO 上报错误
}
else
{
console
.
log
(
img
);
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
);
cc
.
find
(
'
middleLayer/qrcode
'
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
spriteFrame
;
}
})
this
.
getUserQrcode
();
// 获取用户动态小程序码
this
.
loadGame
();
});
},
...
...
@@ -136,6 +126,18 @@ cc.Class({
});
},
getUserQrcode
()
{
cc
.
assetManager
.
loadRemote
(
`
${
this
.
baseApiUrl
}
v1/wechart/wxacode?user_code=
${
this
.
userCode
}
`
,{
ext
:
'
.jpeg
'
},
(
err
,
img
)
=>
{
if
(
err
)
{
console
.
log
(
"
==远程图片加载错误==
"
);
// TODO 上报错误
}
else
{
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
);
cc
.
find
(
'
middleLayer/qrcode
'
).
getComponent
(
cc
.
Sprite
).
spriteFrame
=
spriteFrame
;
}
})
},
getUserStar
()
{
this
.
callNetworkApiGet
(
this
.
baseApiUrl
,
"
v1/terminal/user/stars
"
,
{
user_code
:
this
.
userCode
,
...
...
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