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
3abecebc
Commit
3abecebc
authored
Aug 13, 2021
by
shunx 马
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
501f13de
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
17 deletions
+50
-17
index.do.json
project/mock/webNet/dazzle/index.do.json
+1
-1
WebNetName.ts
project/src/WebNetName.ts
+5
-1
cost.ts
project/src/panels/cost.ts
+21
-2
prize.ts
project/src/panels/prize.ts
+5
-6
IndexScene.ts
project/src/scenes/IndexScene.ts
+18
-7
No files found.
project/mock/webNet/dazzle/index.do.json
View file @
3abecebc
{
"code"
:
null
,
"data"
:
{
"surplusCount"
:
1
,
"surplusCount"
:
0
,
"credits"
:
22222
,
"needCredits"
:
3333
,
"type"
:
2
,
...
...
project/src/WebNetName.ts
View file @
3abecebc
...
...
@@ -21,5 +21,9 @@
/**
* 分享获得免费次数
*/
getFreeCount
=
"/projectx/{projectId}/dazzle/getFreeCount.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 @
3abecebc
...
...
@@ -3,6 +3,10 @@ import { RES } from "../../module/RES";
import
{
Panel
}
from
"../../module/views/Panel"
;
import
centerTextField
from
"../common/centerTextField"
;
import
getObject
from
"../common/getObject"
;
import
{
sendWebNetWithToken
}
from
"../sendWebNetWithToken"
;
import
{
sendWebNet
}
from
"../WebNet"
;
import
{
WebNetName
}
from
"../WebNetName"
;
import
{
NoPrizePanel
}
from
"./noprize"
;
import
{
PrizePanel
}
from
"./prize"
;
let
section
;
...
...
@@ -15,8 +19,23 @@ export class CostPanel extends Panel {
cost_open
()
{
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/prize.ts
View file @
3abecebc
...
...
@@ -6,19 +6,18 @@ import { showPanel } from "../../module/ctrls";
import
{
getImage
}
from
"../common/getImage"
;
import
getObject
from
"../common/getObject"
;
import
{
CostPanel
}
from
"./cost"
;
import
{
getWebData
}
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/IndexScene.ts
View file @
3abecebc
...
...
@@ -17,10 +17,13 @@ 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"
]
}
...
...
@@ -51,10 +54,16 @@ export class IndexScene extends Scene {
list
.
updateData
(
array
);
list
.
position
.
set
(
80
,
1240
+
30
);
this
.
addChild
(
list
);
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
()
{
...
...
@@ -112,14 +121,16 @@ 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
shareButton
=
getObject
(
this
,
'index_sharetips'
);
shareButton
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
})
const
hand
=
getObject
(
this
,
'index_sharehand'
);
const
result
=
await
getWebData
(
WebNetName
.
index
);
hand
=
getObject
(
this
,
'index_sharehand'
);
this
.
addChild
(
hand
);
const
tw
=
FYGE
.
Tween
.
get
(
hand
,
{
loop
:
true
}).
to
({
scaleX
:
1.5
,
scaleY
:
1.5
},
1000
).
to
({
scaleX
:
1
,
scaleY
:
1
},
1000
);
hand
.
visible
=
false
;
if
(
result
&&
result
.
data
)
{
const
getBoxButton
=
getObject
(
this
,
'index_opentips'
);
...
...
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