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
73ce2275
Commit
73ce2275
authored
Aug 10, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
3adad886
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
19 deletions
+82
-19
acquireExperienceAmount.do.json
project/mock/webNet/wallet/acquireExperienceAmount.do.json
+1
-1
myWallet.do.json
project/mock/webNet/wallet/myWallet.do.json
+1
-1
Mask.ts
project/src/common/Mask.ts
+16
-0
datas.ts
project/src/datas.ts
+3
-1
prize.ts
project/src/panels/prize.ts
+26
-3
IndexScene.ts
project/src/scenes/IndexScene.ts
+2
-2
NewbieScene.ts
project/src/scenes/NewbieScene.ts
+33
-11
No files found.
project/mock/webNet/wallet/acquireExperienceAmount.do.json
View file @
73ce2275
{
"code"
:
null
,
"data"
:
500
000
,
"data"
:
1
000
,
"message"
:
123
,
"success"
:
true
}
\ No newline at end of file
project/mock/webNet/wallet/myWallet.do.json
View file @
73ce2275
...
...
@@ -4,7 +4,7 @@
"alreadyOpenAccount"
:
false
,
"assistFriendNum"
:
1
,
"canWithdraw"
:
true
,
"experienceAmount"
:
512
00
,
"experienceAmount"
:
10
00
,
"maxExperienceAmount"
:
2500
,
"millionShares"
:
null
,
"otherExperienceAmount"
:
1
,
...
...
project/src/common/Mask.ts
0 → 100644
View file @
73ce2275
export
default
class
Mask
extends
FYGE
.
Sprite
{
constructor
(
color
=
0
,
alpha
=
.
7
,
container
?)
{
super
();
const
bg
=
new
FYGE
.
Shape
();
bg
.
beginFill
(
color
,
alpha
);
bg
.
drawRect
(
0
,
0
,
750
,
1624
);
bg
.
endFill
();
this
.
addChild
(
bg
);
if
(
container
)
container
.
addChild
(
this
);
}
}
project/src/datas.ts
View file @
73ce2275
export
const
MAX_MONEY
=
10
*
10000
;
\ No newline at end of file
export
const
MAX_MONEY
=
10
*
10000
;
export
const
MONEY_PERCENT
=
0.1
;
\ No newline at end of file
project/src/panels/prize.ts
View file @
73ce2275
...
...
@@ -4,6 +4,7 @@ import { Panel } from "../../module/views/Panel";
import
getObject
from
"../common/getObject"
;
import
{
ProgressBarS
}
from
"../common/ProgressBarS"
;
import
{
showShareMask
}
from
"../common/ShareMask"
;
import
{
MONEY_PERCENT
}
from
"../datas"
;
import
{
IndexScene
}
from
"../scenes/IndexScene"
;
import
updateShareFunc
from
"../share"
;
import
{
getPxTokenSave
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
...
...
@@ -11,11 +12,33 @@ export class PrizePanel extends Panel {
amountTxt
:
FYGE
.
TextField
;
percentTxt
:
FYGE
.
TextField
;
inviteBtn
;
wrapper
;
showAni
()
{
if
(
this
.
isShowing
)
return
;
this
.
isShowing
=
true
;
let
oriY
=
this
.
y
||
0
;
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
this
.
position
.
set
(
750
/
2
,
1624
/
2
);
FYGE
.
Tween
.
get
(
this
)
.
to
({
scaleX
:
1
,
scaleY
:
1
,
x
:
skin
.
x
,
y
:
skin
.
y
},
300
,
FYGE
.
Ease
.
getBackOut
(
2
))
.
call
(()
=>
{
this
.
isShowing
=
false
;
})
}
initUi
()
{
super
.
initUi
();
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
this
.
position
.
set
(
skin
.
x
,
skin
.
y
);
this
.
inviteBtn
=
getObject
(
this
,
'prize_invite'
);
this
.
scaleX
=
0
;
this
.
scaleY
=
0
;
this
.
anchorX
=
-
1
;
this
.
anchorY
=
-
1
;
}
async
start
(
data
)
{
...
...
@@ -28,12 +51,12 @@ 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`
;
let
percent
=
0.05
;
let
percent
=
MONEY_PERCENT
;
if
(
data
/
1000000
>
percent
)
{
percent
=
data
/
1000000
;
}
...
...
@@ -42,7 +65,7 @@ export class PrizePanel extends Panel {
progressBar
.
value
=
percent
;
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
createItem
,
{
token
:
token
}).
then
(
createItemResult
=>
{
sendWebNet
(
WebNetName
.
createItem
,
{
token
:
token
}).
then
(
createItemResult
=>
{
updateShareFunc
(
'inPrizePanel'
,
createItemResult
.
data
)
});
})
...
...
project/src/scenes/IndexScene.ts
View file @
73ce2275
...
...
@@ -9,7 +9,7 @@ import Marquee from '../common/Marquee';
import
{
ProgressBarS
}
from
'../common/ProgressBarS'
;
import
{
hideShareMask
,
showShareMask
}
from
'../common/ShareMask'
;
import
{
getStageHeight
,
getStageOffset
}
from
'../common/stage'
;
import
{
MAX_MONEY
}
from
'../datas'
;
import
{
MAX_MONEY
,
MONEY_PERCENT
}
from
'../datas'
;
import
{
DrawPanel
}
from
'../panels/draw'
;
import
{
RulePanel
}
from
'../panels/rule'
;
import
{
ShareFailPanel
}
from
'../panels/share_fail'
;
...
...
@@ -33,7 +33,7 @@ export class IndexScene extends Scene {
// index_experienceAmountTips.x = (750 - w) / 2;
// index_experienceAmountTips2.x = index_experienceAmountTips.x + index_experienceAmountTips.textWidth;
let
percent
=
0.05
;
let
percent
=
MONEY_PERCENT
;
if
(
experienceAmount
/
MAX_MONEY
>
percent
)
{
percent
=
experienceAmount
/
MAX_MONEY
;
}
...
...
project/src/scenes/NewbieScene.ts
View file @
73ce2275
import
{
unwatchPageVisibility
,
watchPageVisibility
}
from
"@spark/utils"
;
import
{
changeScene
,
closeCurrentPanel
,
hideWaiting
,
showPanel
,
showWaiting
}
from
"../../module/ctrls"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
layers
}
from
"../../module/views/layers"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
getObject
from
"../common/getObject"
;
import
getQueryParams
from
"../common/getQueryParams"
;
import
Marquee
from
"../common/Marquee"
;
import
Mask
from
"../common/Mask"
;
import
{
hideShareMask
}
from
"../common/ShareMask"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
RulePanel
}
from
"../panels/rule"
;
...
...
@@ -28,16 +30,10 @@ export class NewbieScene extends Scene {
async
start
(
data
)
{
super
.
start
();
const
query
=
getQueryParams
();
if
(
query
.
autoprize
==
1
)
{
this
.
openPrize
();
}
const
indexsvga
=
new
FYGE
.
MovieClip
(
RES
.
getRes
(
'index.svga'
));
indexsvga
.
mouseChildren
=
indexsvga
.
mouseEnable
=
false
;
this
.
addChild
(
indexsvga
);
}
openPrize
()
{
...
...
@@ -46,8 +42,26 @@ export class NewbieScene extends Scene {
getPxTokenSave
().
then
(
token
=>
{
sendWebNet
(
WebNetName
.
acquireExperienceAmount
,
{
token
:
token
}).
then
(
acquireExperienceAmount
=>
{
hideWaiting
();
if
(
acquireExperienceAmount
.
success
)
showPanel
(
PrizePanel
,
acquireExperienceAmount
.
data
);
const
mask
=
new
Mask
();
layers
.
topLayer
.
addChild
(
mask
);
const
opensvga
=
new
FYGE
.
MovieClip
(
RES
.
getRes
(
'open.svga'
));
opensvga
.
mouseChildren
=
opensvga
.
mouseEnable
=
false
;
layers
.
topLayer
.
addChild
(
opensvga
);
opensvga
.
startAniRange
(
1
,
opensvga
.
totalFrames
,
1
,
()
=>
{
FYGE
.
Tween
.
get
(
opensvga
).
to
({
alpha
:
0
},
200
).
call
(()
=>
{
layers
.
topLayer
.
removeChild
(
opensvga
);})
});
const
func
=
()
=>
{
if
(
opensvga
.
currentFrame
==
70
)
{
opensvga
.
removeEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
func
,
this
);
layers
.
topLayer
.
removeChild
(
mask
);
if
(
acquireExperienceAmount
.
success
)
showPanel
(
PrizePanel
,
acquireExperienceAmount
.
data
);
}
};
opensvga
.
addEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
func
,
this
);
})
})
...
...
@@ -64,10 +78,12 @@ export class NewbieScene extends Scene {
initUi
()
{
super
.
initUi
();
const
layer
=
new
FYGE
.
Sprite
;
layer
.
mouseEnable
=
layer
.
mouseChildren
=
false
;
this
.
addChild
(
layer
);
sendWebNet
(
WebNetName
.
carouselInfo
).
then
(
res
=>
{
const
template
=
'{phone}邀请了1位好友,获得了{amount}体验金'
;
const
datas
=
res
.
data
.
map
(
item
=>
{
let
str
=
template
.
replace
(
'{phone}'
,
item
.
nickname
);
...
...
@@ -75,10 +91,16 @@ export class NewbieScene extends Scene {
str
=
str
.
replace
(
'{amount}'
,
item
.
amount
);
return
str
});
const
q
=
this
.
addChild
(
new
Marquee
(
datas
));
const
q
=
layer
.
addChild
(
new
Marquee
(
datas
));
q
.
x
=
135
;
q
.
y
=
448
;
window
[
'q'
]
=
q
;
});
const
indexsvga
=
new
FYGE
.
MovieClip
(
RES
.
getRes
(
'index.svga'
));
indexsvga
.
mouseChildren
=
indexsvga
.
mouseEnable
=
false
;
this
.
addChild
(
indexsvga
);
this
.
addChild
(
getObject
(
this
,
'newbie_pic2'
));
}
initEvents
()
{
...
...
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