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
2e45c9c9
Commit
2e45c9c9
authored
Aug 13, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'disu0811' of
http://gitlab2.dui88.com/wildfirecode13/wfc13
into disu0811
parents
fa7892fe
27290ee0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
115 additions
and
33 deletions
+115
-33
index.do.json
project/mock/webNet/dazzle/index.do.json
+3
-3
WebNetName.ts
project/src/WebNetName.ts
+13
-3
cost.ts
project/src/panels/cost.ts
+21
-2
noprize.ts
project/src/panels/noprize.ts
+1
-1
prize.ts
project/src/panels/prize.ts
+5
-7
BoxGroup.ts
project/src/scenes/BoxGroup.ts
+3
-1
IndexScene.ts
project/src/scenes/IndexScene.ts
+69
-16
No files found.
project/mock/webNet/dazzle/index.do.json
View file @
2e45c9c9
{
"code"
:
null
,
"data"
:
{
"surplusCount"
:
11111
,
"credits"
:
2222
,
"surplusCount"
:
0
,
"credits"
:
2222
2
,
"needCredits"
:
3333
,
"type"
:
2
,
"isMember"
:
1
},
"message"
:
null
,
"success"
:
1
"success"
:
true
}
\ No newline at end of file
project/src/WebNetName.ts
View file @
2e45c9c9
...
...
@@ -13,7 +13,17 @@
/**
* 获取首页数据
*/
index
=
"/projectx/{projectId}/dazzle/index.do"
,
drawPrize
=
"/projectx/{projectId}/dazzle/drawPrize.do"
,
getFreeCount
=
"/projectx/{projectId}/dazzle/getFreeCount.do"
index
=
"/projectx/{projectId}/dazzle/index.do"
,
/**
* 获取奖品信息
*/
drawPrize
=
"/projectx/{projectId}/dazzle/drawPrize.do"
,
/**
* 分享获得免费次数
*/
getFreeCount
=
"/projectx/{projectId}/dazzle/getFreeCount.do"
,
/**
* 获取积分票据
*/
getCreditCost
=
"/projectx/{projectId}/credits/creditsCost.do"
}
\ No newline at end of file
project/src/panels/cost.ts
View file @
2e45c9c9
...
...
@@ -3,7 +3,10 @@ import { RES } from "../../module/RES";
import
{
Panel
}
from
"../../module/views/Panel"
;
import
centerTextField
from
"../common/centerTextField"
;
import
getObject
from
"../common/getObject"
;
import
{
sendLog
}
from
"../WebNet"
;
import
{
sendWebNetWithToken
}
from
"../sendWebNetWithToken"
;
import
{
sendLog
,
sendWebNet
}
from
"../WebNet"
;
import
{
WebNetName
}
from
"../WebNetName"
;
import
{
NoPrizePanel
}
from
"./noprize"
;
import
{
PrizePanel
}
from
"./prize"
;
let
section
;
...
...
@@ -17,7 +20,23 @@ export class CostPanel extends Panel {
sendLog
(
"click"
,
1
);
this
.
dispatchEvent
(
"stopIndexEnterFrame"
,
{
});
this
.
hidePanel
();
showPanel
(
PrizePanel
)
this
.
getPrize
();
}
getPrize
=
async
()
=>
{
const
result
=
await
sendWebNet
(
WebNetName
.
getCreditCost
,
{
toPlaywayId
:
'dazzle'
,
toActionId
:
'drawPrize'
});
if
(
result
&&
result
.
success
)
{
const
prizeData
=
await
sendWebNetWithToken
(
WebNetName
.
drawPrize
,
{
ticket
:
result
.
data
});
if
(
prizeData
&&
prizeData
.
success
)
{
if
(
prizeData
.
data
&&
prizeData
.
data
.
options
)
{
if
(
prizeData
.
data
.
options
.
optionId
==
"thanks"
)
{
showPanel
(
NoPrizePanel
)
}
else
{
showPanel
(
PrizePanel
);
}
}
}
}
}
get
groupNames
()
{
...
...
project/src/panels/noprize.ts
View file @
2e45c9c9
...
...
@@ -32,7 +32,7 @@ export class NoPrizePanel extends Panel {
this
.
addChild
(
indexsvga
);
this
.
addChild
(
prizePop
)
indexsvga
.
addEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
()
=>
{
if
(
indexsvga
.
currentFrame
==
indexsvga
.
totalFrames
-
1
0
)
{
if
(
indexsvga
.
currentFrame
==
indexsvga
.
totalFrames
-
1
3
)
{
prizePop
.
visible
=
true
;
}
},
this
)
...
...
project/src/panels/prize.ts
View file @
2e45c9c9
...
...
@@ -6,20 +6,18 @@ import { showPanel } from "../../module/ctrls";
import
{
getImage
}
from
"../common/getImage"
;
import
getObject
from
"../common/getObject"
;
import
{
CostPanel
}
from
"./cost"
;
import
{
sendLog
}
from
"../WebNet"
;
import
{
getWebData
,
sendLog
}
from
"../WebNet"
;
import
{
WebNetName
}
from
"../WebNetName"
;
let
section
;
export
class
PrizePanel
extends
Panel
{
start
()
{
super
.
start
();
const
prizename
=
'活动活动黑乎乎的后sdfsdffsdfsdff端df和'
;
const
prizeimg
=
'https://yun.duiba.com.cn/db_games/sxbank.png'
;
const
result
=
getWebData
(
WebNetName
.
drawPrize
);
const
size
=
164
;
getImage
(
prizeimg
,
this
.
prizeContainer
,
size
,
size
,
3
);
getObject
(
this
,
'prize_name'
).
text
=
prizename
;
getImage
(
result
.
data
.
optionImg
,
this
.
prizeContainer
,
size
,
size
,
3
);
getObject
(
this
,
'prize_name'
).
text
=
result
.
data
.
optionName
;
}
click_prize_open
()
{
...
...
project/src/scenes/BoxGroup.ts
View file @
2e45c9c9
import
{
showPanel
}
from
"../../module/ctrls"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
delayClick
}
from
"../common/delayClick"
;
import
{
CostPanel
}
from
"../panels/cost"
;
import
{
Box
}
from
"./Box"
;
...
...
@@ -10,7 +11,7 @@ export interface Move {
let
boxGroupUpLeft
=
[];
let
boxGroupDown
=
[];
let
boxGroupUpRight
=
[];
let
flag
=
0
;
export
class
BoxGroup
extends
FYGE
.
Sprite
{
indexsvga
;
constructor
()
{
...
...
@@ -72,6 +73,7 @@ export class BoxGroup extends FYGE.Sprite {
}
handleClick
(
e
)
{
delayClick
(
e
.
target
.
stage
);
const
indexsvga
=
this
.
indexsvga
=
new
FYGE
.
MovieClip
(
RES
.
getRes
(
'盲盒选中-输出.svga'
));
this
.
dispatchEvent
(
"stopIndexEnterFrame"
,
{
});
indexsvga
.
mouseChildren
=
indexsvga
.
mouseEnable
=
false
;
...
...
project/src/scenes/IndexScene.ts
View file @
2e45c9c9
...
...
@@ -16,10 +16,14 @@ import { BoxGroup } from "./BoxGroup";
import
{
ScrollItem
}
from
"./ScrollItem"
;
import
{
getWebData
,
sendWebNet
}
from
"../WebNet"
;
import
{
WebNetName
}
from
"../WebNetName"
;
import
{
layers
}
from
"../../module/views/layers"
;
import
{
showShareMask
}
from
"../common/ShareMask"
;
let
boxGroup
:
BoxGroup
;
let
boxArea
;
let
hand
:
FYGE
.
Sprite
;
let
shareButton
;
export
class
IndexScene
extends
Scene
{
get
groupNames
()
{
return
[
"index"
]
}
...
...
@@ -31,20 +35,35 @@ export class IndexScene extends Scene {
start
()
{
super
.
start
();
this
.
getIndex
();
getObject
(
this
,
'index_sharetips'
).
visible
=
false
;
// this.initNonmemberMask
();
//
getObject(this,'index_sharetips').visible=false;
this
.
initContainer
();
this
.
initmask
();
const
limit
=
getObject
(
this
,
'index_timestips2'
);
limit
.
position
.
set
(
255
,
1129
);
limit
.
position
.
set
(
245
,
1130
);
limit
.
size
=
25
;
const
credits
=
getObject
(
this
,
'index_moneytips2'
);
credits
.
position
.
set
(
608
,
1129
);
credits
.
position
.
set
(
600
,
1130
);
credits
.
size
=
25
;
const
index_moneytips
=
getObject
(
this
,
'index_moneytips'
);
index_moneytips
.
position
.
set
(
480
,
1131
);
const
index_timestips
=
getObject
(
this
,
'index_timestips'
);
index_timestips
.
position
.
set
(
127
,
1131
);
const
list
=
new
FYGE
.
ScrollList
(
ScrollItem
,
131
+
20
,
131
,
620
,
154
,
false
);
const
array
=
[
'//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'
,
'//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'
,
'//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'
,
'//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'
,
'//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'
];
list
.
updateData
(
array
);
list
.
position
.
set
(
80
,
1240
+
30
);
this
.
addChild
(
list
);
this
.
stage
.
addEventListener
(
"restartEnterFrame"
,
this
.
onRestartFrame
,
this
);
if
(
hand
)
{
const
tw
=
FYGE
.
Tween
.
get
(
hand
,
{
loop
:
true
}).
to
({
scaleX
:
1.5
,
scaleY
:
1.5
},
1000
).
to
({
scaleX
:
1
,
scaleY
:
1
},
1000
);
}
this
.
getIndex
();
this
.
stage
.
addEventListener
(
"restartEnterFrame"
,
this
.
onRestartFrame
,
this
);
boxGroup
.
addEventListener
(
"stopIndexEnterFrame"
,
this
.
removeEvent
,
this
);
shareButton
=
getObject
(
this
,
'index_sharetips'
);
shareButton
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
showShareMask
();
},
this
)
}
initContainer
()
{
...
...
@@ -55,6 +74,18 @@ export class IndexScene extends Scene {
boxArea
.
addChild
(
boxGroup
);
}
initNonmemberMask
()
{
const
mask
=
new
FYGE
.
Shape
();
mask
.
beginFill
(
0
,
1
);
mask
.
drawRect
(
0
,
0
,
750
,
1624
);
mask
.
endFill
();
mask
.
alpha
=
0
;
layers
.
topLayer
.
addChild
(
mask
);
mask
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
showPanel
(
memberGuidePanel
);
},
this
)
}
initmask
()
{
const
mask
=
new
FYGE
.
Shape
();
mask
.
beginFill
(
0
,
0.3
);
...
...
@@ -75,7 +106,6 @@ export class IndexScene extends Scene {
onEnterFrame
()
{
boxGroup
&&
boxGroup
.
move
();
boxGroup
.
addEventListener
(
"stopIndexEnterFrame"
,
this
.
removeEvent
,
this
);
}
onRestartFrame
()
{
...
...
@@ -91,21 +121,44 @@ export class IndexScene extends Scene {
this
.
removeEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
}
handleShare
=
async
()
=>
{
showShareMask
();
await
getWebData
(
WebNetName
.
getFreeCount
);
this
.
getIndex
();
}
getIndex
=
async
()
=>
{
const
result
=
getWebData
(
WebNetName
.
index
);
const
result
=
await
getWebData
(
WebNetName
.
index
);
hand
=
getObject
(
this
,
'index_sharehand'
);
this
.
addChild
(
hand
);
hand
.
visible
=
false
;
if
(
result
&&
result
.
data
)
{
const
getBoxButton
=
getObject
(
this
,
'index_opentips'
);
const
reDegree
=
getObject
(
this
,
'index_timestips2'
);
reDegree
.
text
=
result
.
data
.
surplusCount
;
const
credits
=
getObject
(
this
,
'index_moneytips2'
);
credits
.
text
=
result
.
data
.
credits
;
if
(
result
.
data
&&
result
.
data
.
credits
>
9999
)
{
credits
.
text
=
"9999"
+
"+"
;
}
else
{
credits
.
text
=
`
${
result
.
data
.
credits
}
`
;
}
const
needCredits
=
getObject
(
this
,
'index_costtips'
);
needCredits
.
text
=
result
.
data
.
needCredits
+
"积分/次"
;
if
(
result
.
data
.
type
==
2
)
{
}
else
if
(
result
.
data
.
type
==
2
)
{
needCredits
.
text
=
`
${
result
.
data
.
needCredits
}
`
+
"积分/次"
;
if
(
result
.
data
.
type
==
1
)
{
reDegree
.
text
=
`
${
result
.
data
.
surplusCount
}
`
;
if
(
result
.
data
.
surplusCount
<=
0
)
{
getBoxButton
.
visible
=
false
;
shareButton
.
visible
=
true
;
hand
.
visible
=
true
;
reDegree
.
text
=
'0'
;
}
else
{
getBoxButton
.
visible
=
true
;
shareButton
.
visible
=
false
;
}
}
else
{
needCredits
.
text
=
'免费拆盒1次'
;
reDegree
.
text
=
`
${
result
.
data
.
surplusCount
}
`
;
getBoxButton
.
visible
=
true
;
shareButton
.
visible
=
false
;
}
}
...
...
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