Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
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
wildfirecode13
wfc13
Commits
8e7bf13f
Commit
8e7bf13f
authored
Aug 06, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
5c8e1ed0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
46 deletions
+70
-46
prize.ts
project/src/panels/prize.ts
+23
-19
IndexScene.ts
project/src/scenes/IndexScene.ts
+30
-19
NewbieScene.ts
project/src/scenes/NewbieScene.ts
+7
-4
ShareScene.ts
project/src/scenes/ShareScene.ts
+10
-4
No files found.
project/src/panels/prize.ts
View file @
8e7bf13f
...
...
@@ -10,7 +10,7 @@ import getObject from "../getObject";
import
{
IndexScene
}
from
"../scenes/IndexScene"
;
import
{
Tools
}
from
"../Tools"
;
import
updateShare
from
"../updateShare"
;
import
{
getWebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
get
PxTokenSave
,
get
WebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
let
createItemResultComplete
,
myWalletResultComplete
;
const
checkUpdateShare
=
()
=>
{
...
...
@@ -42,27 +42,31 @@ export class PrizePanel extends Panel {
const
w
=
prize_tips1
.
textWidth
+
prize_tips2
.
textWidth
;
prize_tips2
.
x
=
(
595
-
w
)
/
2
;
prize_tips1
.
x
=
prize_tips2
.
x
+
prize_tips2
.
textWidth
;
prize_tip3
.
textWidth
=
595
;
prize_tip3
.
x
=
0
;
prize_tip3
.
textAlign
=
'center'
;
prize_tip3
.
text
=
`
${
data
}
/1000000`
;
prize_tip3
.
textWidth
=
595
;
prize_tip3
.
x
=
0
;
prize_tip3
.
textAlign
=
'center'
;
prize_tip3
.
text
=
`
${
data
}
/1000000`
;
let
percent
=
0.05
;
if
(
data
/
1000000
>
percent
)
{
percent
=
data
/
1000000
;
if
(
data
/
1000000
>
percent
)
{
percent
=
data
/
1000000
;
}
const
progressBar
=
new
ProgressBarS
(
getObject
(
this
,
'prize_progress'
));
progressBar
.
value
=
percent
;
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
createItemResultComplete
=
createItemResult
;
checkUpdateShare
();
});
sendWebNet
(
WebNetName
.
myWallet
).
then
(
myWalletResult
=>
{
myWalletResultComplete
=
myWalletResult
;
checkUpdateShare
();
});
const
progressBar
=
new
ProgressBarS
(
getObject
(
this
,
'prize_progress'
));
progressBar
.
value
=
percent
;
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
createItemResultComplete
=
createItemResult
;
checkUpdateShare
();
});
})
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
myWallet
,
{
token
:
token
}).
then
(
myWalletResult
=>
{
myWalletResultComplete
=
myWalletResult
;
checkUpdateShare
();
});
})
getObject
(
this
,
'prize_close'
).
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
...
...
project/src/scenes/IndexScene.ts
View file @
8e7bf13f
...
...
@@ -11,7 +11,7 @@ import { ShareFailPanel } from '../panels/share_fail';
import
{
ShareSuccessPanel
}
from
'../panels/share_success'
;
import
{
getStageHeight
,
getStageOffset
}
from
'../stage'
;
import
updateShare
from
'../updateShare'
;
import
{
sendWebNet
,
WebNetName
}
from
'../WebNet'
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
'../WebNet'
;
let
createItemResultComplete
,
myWalletResultComplete
;
const
checkUpdateShare
=
()
=>
{
...
...
@@ -26,9 +26,11 @@ export class IndexScene extends Scene {
onclick_index_drawBtn
(){
sendWebNet
(
WebNetName
.
withDraw
).
then
(
res
=>
{
showPanel
(
DrawPanel
);
});
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
withDraw
,{
token
:
token
}).
then
(
res
=>
{
showPanel
(
DrawPanel
);
});
})
}
page
:
FYGE
.
ScrollPage
;
...
...
@@ -77,26 +79,35 @@ export class IndexScene extends Scene {
});
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
createItemResultComplete
=
createItemResult
;
checkUpdateShare
();
});
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
createItemResultComplete
=
createItemResult
;
checkUpdateShare
();
});
})
sendWebNet
(
WebNetName
.
myWallet
).
then
(
myWalletResult
=>
{
myWalletResultComplete
=
myWalletResult
;
checkUpdateShare
();
});
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
myWallet
,{
token
:
token
}).
then
(
myWalletResult
=>
{
myWalletResultComplete
=
myWalletResult
;
checkUpdateShare
();
});
})
}
async
showSharePanel
()
{
sendWebNet
(
WebNetName
.
myWallet
).
then
(
myWalletResult
=>
{
if
(
myWalletResult
.
data
.
experienceAmount
>=
myWalletResult
.
data
.
maxExperienceAmount
){
showPanel
(
ShareFailPanel
);
}
else
{
showPanel
(
ShareSuccessPanel
);
}
});
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
myWallet
,{
token
:
token
}).
then
(
myWalletResult
=>
{
if
(
myWalletResult
.
data
.
experienceAmount
>=
myWalletResult
.
data
.
maxExperienceAmount
){
showPanel
(
ShareFailPanel
);
}
else
{
showPanel
(
ShareSuccessPanel
);
}
});
})
}
onPageVisibilityChange
=
async
(
visible
)
=>
{
...
...
project/src/scenes/NewbieScene.ts
View file @
8e7bf13f
...
...
@@ -8,7 +8,7 @@ import TestButton from "../common/TestButton";
import
getQueryParams
from
"../getQueryParams"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
RulePanel
}
from
"../panels/rule"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
IndexScene
}
from
"./IndexScene"
;
let
prize
;
export
class
NewbieScene
extends
Scene
{
...
...
@@ -38,9 +38,12 @@ export class NewbieScene extends Scene {
openPrize
()
{
prize
=
1
;
sendWebNet
(
WebNetName
.
acquireExperienceAmount
).
then
(
acquireExperienceAmount
=>
{
showPanel
(
PrizePanel
,
acquireExperienceAmount
.
data
);
})
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
acquireExperienceAmount
,{
token
:
token
}).
then
(
acquireExperienceAmount
=>
{
showPanel
(
PrizePanel
,
acquireExperienceAmount
.
data
);
})
})
}
onClick_prizeBtn
()
{
...
...
project/src/scenes/ShareScene.ts
View file @
8e7bf13f
...
...
@@ -4,14 +4,17 @@ import Marquee from "../common/Marquee";
import
getObject
from
"../getObject"
;
import
getQueryParams
from
"../getQueryParams"
;
import
{
AssistPanel
}
from
"../panels/assist"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
export
class
ShareScene
extends
Scene
{
onClick_share_assist
(){
const
query
=
getQueryParams
();
sendWebNet
(
WebNetName
.
assist
,{
code
:
query
.
shareCode
}).
then
(
res
=>
{
showPanel
(
AssistPanel
)
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
assist
,{
code
:
query
.
shareCode
}).
then
(
res
=>
{
showPanel
(
AssistPanel
)
})
})
}
get
groupNames
()
{
return
[
"share"
]
}
get
skinName
()
{
return
"share"
}
...
...
@@ -25,7 +28,10 @@ export class ShareScene extends Scene {
super
.
start
();
console
.
log
(
'ShareScene query>>'
,
JSON
.
stringify
(
data
.
query
));
sendWebNet
(
WebNetName
.
shareInfo
,{
code
:
getQueryParams
().
shareCode
}).
then
(
res
=>
{});
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
shareInfo
,{
code
:
getQueryParams
().
shareCode
,
token
:
token
}).
then
(
res
=>
{});
})
sendWebNet
(
WebNetName
.
carouselInfo
).
then
(
res
=>
{
console
.
log
(
'carouselInfo '
,
res
);
...
...
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