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";
...
@@ -10,7 +10,7 @@ import getObject from "../getObject";
import
{
IndexScene
}
from
"../scenes/IndexScene"
;
import
{
IndexScene
}
from
"../scenes/IndexScene"
;
import
{
Tools
}
from
"../Tools"
;
import
{
Tools
}
from
"../Tools"
;
import
updateShare
from
"../updateShare"
;
import
updateShare
from
"../updateShare"
;
import
{
getWebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
get
PxTokenSave
,
get
WebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
let
createItemResultComplete
,
myWalletResultComplete
;
let
createItemResultComplete
,
myWalletResultComplete
;
const
checkUpdateShare
=
()
=>
{
const
checkUpdateShare
=
()
=>
{
...
@@ -42,27 +42,31 @@ export class PrizePanel extends Panel {
...
@@ -42,27 +42,31 @@ export class PrizePanel extends Panel {
const
w
=
prize_tips1
.
textWidth
+
prize_tips2
.
textWidth
;
const
w
=
prize_tips1
.
textWidth
+
prize_tips2
.
textWidth
;
prize_tips2
.
x
=
(
595
-
w
)
/
2
;
prize_tips2
.
x
=
(
595
-
w
)
/
2
;
prize_tips1
.
x
=
prize_tips2
.
x
+
prize_tips2
.
textWidth
;
prize_tips1
.
x
=
prize_tips2
.
x
+
prize_tips2
.
textWidth
;
prize_tip3
.
textWidth
=
595
;
prize_tip3
.
textWidth
=
595
;
prize_tip3
.
x
=
0
;
prize_tip3
.
x
=
0
;
prize_tip3
.
textAlign
=
'center'
;
prize_tip3
.
textAlign
=
'center'
;
prize_tip3
.
text
=
`
${
data
}
/1000000`
;
prize_tip3
.
text
=
`
${
data
}
/1000000`
;
let
percent
=
0.05
;
let
percent
=
0.05
;
if
(
data
/
1000000
>
percent
)
{
if
(
data
/
1000000
>
percent
)
{
percent
=
data
/
1000000
;
percent
=
data
/
1000000
;
}
}
const
progressBar
=
new
ProgressBarS
(
getObject
(
this
,
'prize_progress'
));
const
progressBar
=
new
ProgressBarS
(
getObject
(
this
,
'prize_progress'
));
progressBar
.
value
=
percent
;
progressBar
.
value
=
percent
;
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
getPxTokenSave
().
then
(
token
=>
{
createItemResultComplete
=
createItemResult
;
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
checkUpdateShare
();
createItemResultComplete
=
createItemResult
;
});
checkUpdateShare
();
});
sendWebNet
(
WebNetName
.
myWallet
).
then
(
myWalletResult
=>
{
})
myWalletResultComplete
=
myWalletResult
;
checkUpdateShare
();
getPxTokenSave
().
then
(
token
=>
{
});
sendWebNet
(
WebNetName
.
myWallet
,
{
token
:
token
}).
then
(
myWalletResult
=>
{
myWalletResultComplete
=
myWalletResult
;
checkUpdateShare
();
});
})
getObject
(
this
,
'prize_close'
).
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
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';
...
@@ -11,7 +11,7 @@ import { ShareFailPanel } from '../panels/share_fail';
import
{
ShareSuccessPanel
}
from
'../panels/share_success'
;
import
{
ShareSuccessPanel
}
from
'../panels/share_success'
;
import
{
getStageHeight
,
getStageOffset
}
from
'../stage'
;
import
{
getStageHeight
,
getStageOffset
}
from
'../stage'
;
import
updateShare
from
'../updateShare'
;
import
updateShare
from
'../updateShare'
;
import
{
sendWebNet
,
WebNetName
}
from
'../WebNet'
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
'../WebNet'
;
let
createItemResultComplete
,
myWalletResultComplete
;
let
createItemResultComplete
,
myWalletResultComplete
;
const
checkUpdateShare
=
()
=>
{
const
checkUpdateShare
=
()
=>
{
...
@@ -26,9 +26,11 @@ export class IndexScene extends Scene {
...
@@ -26,9 +26,11 @@ export class IndexScene extends Scene {
onclick_index_drawBtn
(){
onclick_index_drawBtn
(){
sendWebNet
(
WebNetName
.
withDraw
).
then
(
res
=>
{
getPxTokenSave
().
then
(
token
=>
{
showPanel
(
DrawPanel
);
sendWebNet
(
WebNetName
.
withDraw
,{
token
:
token
}).
then
(
res
=>
{
});
showPanel
(
DrawPanel
);
});
})
}
}
page
:
FYGE
.
ScrollPage
;
page
:
FYGE
.
ScrollPage
;
...
@@ -77,26 +79,35 @@ export class IndexScene extends Scene {
...
@@ -77,26 +79,35 @@ export class IndexScene extends Scene {
});
});
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
getPxTokenSave
().
then
(
token
=>
{
createItemResultComplete
=
createItemResult
;
sendWebNet
(
WebNetName
.
createItem
).
then
(
createItemResult
=>
{
checkUpdateShare
();
createItemResultComplete
=
createItemResult
;
});
checkUpdateShare
();
});
})
sendWebNet
(
WebNetName
.
myWallet
).
then
(
myWalletResult
=>
{
getPxTokenSave
().
then
(
token
=>
{
myWalletResultComplete
=
myWalletResult
;
sendWebNet
(
WebNetName
.
myWallet
,{
token
:
token
}).
then
(
myWalletResult
=>
{
checkUpdateShare
();
myWalletResultComplete
=
myWalletResult
;
});
checkUpdateShare
();
});
})
}
}
async
showSharePanel
()
{
async
showSharePanel
()
{
sendWebNet
(
WebNetName
.
myWallet
).
then
(
myWalletResult
=>
{
getPxTokenSave
().
then
(
token
=>
{
if
(
myWalletResult
.
data
.
experienceAmount
>=
myWalletResult
.
data
.
maxExperienceAmount
){
sendWebNet
(
WebNetName
.
myWallet
,{
token
:
token
}).
then
(
myWalletResult
=>
{
showPanel
(
ShareFailPanel
);
if
(
myWalletResult
.
data
.
experienceAmount
>=
myWalletResult
.
data
.
maxExperienceAmount
){
}
else
{
showPanel
(
ShareFailPanel
);
showPanel
(
ShareSuccessPanel
);
}
else
{
}
showPanel
(
ShareSuccessPanel
);
});
}
});
})
}
}
onPageVisibilityChange
=
async
(
visible
)
=>
{
onPageVisibilityChange
=
async
(
visible
)
=>
{
...
...
project/src/scenes/NewbieScene.ts
View file @
8e7bf13f
...
@@ -8,7 +8,7 @@ import TestButton from "../common/TestButton";
...
@@ -8,7 +8,7 @@ import TestButton from "../common/TestButton";
import
getQueryParams
from
"../getQueryParams"
;
import
getQueryParams
from
"../getQueryParams"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
RulePanel
}
from
"../panels/rule"
;
import
{
RulePanel
}
from
"../panels/rule"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
IndexScene
}
from
"./IndexScene"
;
import
{
IndexScene
}
from
"./IndexScene"
;
let
prize
;
let
prize
;
export
class
NewbieScene
extends
Scene
{
export
class
NewbieScene
extends
Scene
{
...
@@ -38,9 +38,12 @@ export class NewbieScene extends Scene {
...
@@ -38,9 +38,12 @@ export class NewbieScene extends Scene {
openPrize
()
{
openPrize
()
{
prize
=
1
;
prize
=
1
;
sendWebNet
(
WebNetName
.
acquireExperienceAmount
).
then
(
acquireExperienceAmount
=>
{
getPxTokenSave
().
then
(
token
=>
{
showPanel
(
PrizePanel
,
acquireExperienceAmount
.
data
);
sendWebNet
(
WebNetName
.
acquireExperienceAmount
,{
token
:
token
}).
then
(
acquireExperienceAmount
=>
{
})
showPanel
(
PrizePanel
,
acquireExperienceAmount
.
data
);
})
})
}
}
onClick_prizeBtn
()
{
onClick_prizeBtn
()
{
...
...
project/src/scenes/ShareScene.ts
View file @
8e7bf13f
...
@@ -4,14 +4,17 @@ import Marquee from "../common/Marquee";
...
@@ -4,14 +4,17 @@ import Marquee from "../common/Marquee";
import
getObject
from
"../getObject"
;
import
getObject
from
"../getObject"
;
import
getQueryParams
from
"../getQueryParams"
;
import
getQueryParams
from
"../getQueryParams"
;
import
{
AssistPanel
}
from
"../panels/assist"
;
import
{
AssistPanel
}
from
"../panels/assist"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
export
class
ShareScene
extends
Scene
{
export
class
ShareScene
extends
Scene
{
onClick_share_assist
(){
onClick_share_assist
(){
const
query
=
getQueryParams
();
const
query
=
getQueryParams
();
sendWebNet
(
WebNetName
.
assist
,{
code
:
query
.
shareCode
}).
then
(
res
=>
{
getPxTokenSave
().
then
(
token
=>
{
showPanel
(
AssistPanel
)
sendWebNet
(
WebNetName
.
assist
,{
code
:
query
.
shareCode
}).
then
(
res
=>
{
showPanel
(
AssistPanel
)
})
})
})
}
}
get
groupNames
()
{
return
[
"share"
]
}
get
groupNames
()
{
return
[
"share"
]
}
get
skinName
()
{
return
"share"
}
get
skinName
()
{
return
"share"
}
...
@@ -25,7 +28,10 @@ export class ShareScene extends Scene {
...
@@ -25,7 +28,10 @@ export class ShareScene extends Scene {
super
.
start
();
super
.
start
();
console
.
log
(
'ShareScene query>>'
,
JSON
.
stringify
(
data
.
query
));
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
=>
{
sendWebNet
(
WebNetName
.
carouselInfo
).
then
(
res
=>
{
console
.
log
(
'carouselInfo '
,
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