Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
MingSnake_241120
Commits
1f29e1c8
Commit
1f29e1c8
authored
Dec 10, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
8bb139ac
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
cc.d.ts
@types/cc.d.ts
+1
-1
GamePosterPanel.ts
assets/Scripts/Panels/GamePosterPanel.ts
+5
-3
store.ts
assets/Scripts/store/store.ts
+7
-2
No files found.
@types/cc.d.ts
View file @
1f29e1c8
...
...
@@ -2231,7 +2231,7 @@ declare module "cc" {
* 精灵的精灵帧。
*/
get spriteFrame(): SpriteFrame | null;
set spriteFrame(value: SpriteFrame | null);
set spriteFrame(value: SpriteFrame |
string |
null);
/**
* @en
* The sprite render type.
assets/Scripts/Panels/GamePosterPanel.ts
View file @
1f29e1c8
import
Panel
from
"../../Module/Panel"
;
import
{
_decorator
,
Button
,
Director
,
director
,
game
,
Label
,
Node
,
RenderTexture
,
Sprite
}
from
"cc"
;
import
{
observer
}
from
"../store/decorators"
;
import
store
from
"../store/store"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -17,12 +18,13 @@ export default class GamePosterPanel extends Panel {
@
property
(
Sprite
)
qrcode
:
Sprite
=
null
;
onLoad
()
{
this
.
lengthTxt
.
string
=
`
${
this
.
data
.
score
}
`
;
this
.
killTxt
.
string
=
`
${
this
.
data
.
finalKill
}
`
;
this
.
qrcode
.
spriteFrame
=
store
.
inviteInfo
.
qrCode
;
}
async
start
()
{
this
.
lengthTxt
.
string
=
`
${
this
.
data
.
score
}
`
;
this
.
killTxt
.
string
=
`
${
this
.
data
.
finalKill
}
`
;
// director.once(Director.EVENT_AFTER_DRAW, this.copyRenderTex);
// director.once(Director.EVENT_END_FRAME, this.copyRenderTex);
this
.
scheduleOnce
(
this
.
copyRenderTex
,
0.5
);
...
...
assets/Scripts/store/store.ts
View file @
1f29e1c8
...
...
@@ -105,26 +105,31 @@ class Store {
inviteInfo
:
{
shareUrl
:
string
,
inviteCode
:
string
,
qrCode
:
string
|
SpriteFrame
,
}
=
{
shareUrl
:
""
,
inviteCode
:
""
,
qrCode
:
""
,
};
async
genInviteInfo
()
{
this
.
inviteInfo
.
shareUrl
=
`
${
location
.
origin
}${
location
.
pathname
}
`
+
`?appID=
${
getUrlParams
(
"appID"
)}
`
;
const
{
success
:
genCodeSuc
,
data
:
genCodeData
}
=
await
sendWebNet
(
WebNetName
.
getInviteCode
);
if
(
!
genCodeSuc
)
{
this
.
inviteInfo
.
inviteCode
=
genCodeData
.
inviteCode
;
}
const
activ
eUrl
=
`
${
location
.
origin
}${
location
.
pathname
}
`
this
.
inviteInfo
.
shar
eUrl
=
`
${
location
.
origin
}${
location
.
pathname
}
`
+
`?appID=
${
getUrlParams
(
"appID"
)}
`
+
`&inviteCode=
${
genCodeData
.
inviteCode
}
`
;
const
path
=
"package/pages/common-activity/index"
+
"?webUrl="
+
encodeURIComponent
(
activ
eUrl
);
"?webUrl="
+
encodeURIComponent
(
this
.
inviteInfo
.
shar
eUrl
);
const
{
success
:
genQrSuc
,
data
:
genQrData
}
=
await
sendWebNet
(
WebNetName
.
genQrCode
,
{
path
:
path
,
...
...
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