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
Show 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
,
"code"
:
null
,
"data"
:
{
"data"
:
{
"surplusCount"
:
1
,
"surplusCount"
:
0
,
"credits"
:
22222
,
"credits"
:
22222
,
"needCredits"
:
3333
,
"needCredits"
:
3333
,
"type"
:
2
,
"type"
:
2
,
...
...
project/src/WebNetName.ts
View file @
3abecebc
...
@@ -21,5 +21,9 @@
...
@@ -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";
...
@@ -3,6 +3,10 @@ import { RES } from "../../module/RES";
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
centerTextField
from
"../common/centerTextField"
;
import
centerTextField
from
"../common/centerTextField"
;
import
getObject
from
"../common/getObject"
;
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"
;
import
{
PrizePanel
}
from
"./prize"
;
let
section
;
let
section
;
...
@@ -15,8 +19,23 @@ export class CostPanel extends Panel {
...
@@ -15,8 +19,23 @@ export class CostPanel extends Panel {
cost_open
()
{
cost_open
()
{
this
.
dispatchEvent
(
"stopIndexEnterFrame"
,
{
});
this
.
dispatchEvent
(
"stopIndexEnterFrame"
,
{
});
this
.
hidePanel
();
this
.
hidePanel
();
this
.
getPrize
();
}
showPanel
(
PrizePanel
)
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
()
{
get
groupNames
()
{
...
...
project/src/panels/prize.ts
View file @
3abecebc
...
@@ -6,19 +6,18 @@ import { showPanel } from "../../module/ctrls";
...
@@ -6,19 +6,18 @@ import { showPanel } from "../../module/ctrls";
import
{
getImage
}
from
"../common/getImage"
;
import
{
getImage
}
from
"../common/getImage"
;
import
getObject
from
"../common/getObject"
;
import
getObject
from
"../common/getObject"
;
import
{
CostPanel
}
from
"./cost"
;
import
{
CostPanel
}
from
"./cost"
;
import
{
getWebData
}
from
"../WebNet"
;
import
{
WebNetName
}
from
"../WebNetName"
;
let
section
;
let
section
;
export
class
PrizePanel
extends
Panel
{
export
class
PrizePanel
extends
Panel
{
start
()
{
start
()
{
super
.
start
();
super
.
start
();
const
prizename
=
'活动活动黑乎乎的后sdfsdffsdfsdff端df和'
;
const
result
=
getWebData
(
WebNetName
.
drawPrize
);
const
prizeimg
=
'https://yun.duiba.com.cn/db_games/sxbank.png'
;
const
size
=
164
;
const
size
=
164
;
getImage
(
result
.
data
.
optionImg
,
this
.
prizeContainer
,
size
,
size
,
3
);
getImage
(
prizeimg
,
this
.
prizeContainer
,
size
,
size
,
3
);
getObject
(
this
,
'prize_name'
).
text
=
result
.
data
.
optionName
;
getObject
(
this
,
'prize_name'
).
text
=
prizename
;
}
}
click_prize_open
()
{
click_prize_open
()
{
...
...
project/src/scenes/IndexScene.ts
View file @
3abecebc
...
@@ -17,10 +17,13 @@ import { ScrollItem } from "./ScrollItem";
...
@@ -17,10 +17,13 @@ import { ScrollItem } from "./ScrollItem";
import
{
getWebData
,
sendWebNet
}
from
"../WebNet"
;
import
{
getWebData
,
sendWebNet
}
from
"../WebNet"
;
import
{
WebNetName
}
from
"../WebNetName"
;
import
{
WebNetName
}
from
"../WebNetName"
;
import
{
layers
}
from
"../../module/views/layers"
;
import
{
layers
}
from
"../../module/views/layers"
;
import
{
showShareMask
}
from
"../common/ShareMask"
;
let
boxGroup
:
BoxGroup
;
let
boxGroup
:
BoxGroup
;
let
boxArea
;
let
boxArea
;
let
hand
:
FYGE
.
Sprite
;
let
shareButton
;
export
class
IndexScene
extends
Scene
{
export
class
IndexScene
extends
Scene
{
get
groupNames
()
{
return
[
"index"
]
}
get
groupNames
()
{
return
[
"index"
]
}
...
@@ -51,10 +54,16 @@ export class IndexScene extends Scene {
...
@@ -51,10 +54,16 @@ export class IndexScene extends Scene {
list
.
updateData
(
array
);
list
.
updateData
(
array
);
list
.
position
.
set
(
80
,
1240
+
30
);
list
.
position
.
set
(
80
,
1240
+
30
);
this
.
addChild
(
list
);
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
.
getIndex
();
this
.
stage
.
addEventListener
(
"restartEnterFrame"
,
this
.
onRestartFrame
,
this
);
this
.
stage
.
addEventListener
(
"restartEnterFrame"
,
this
.
onRestartFrame
,
this
);
boxGroup
.
addEventListener
(
"stopIndexEnterFrame"
,
this
.
removeEvent
,
this
);
boxGroup
.
addEventListener
(
"stopIndexEnterFrame"
,
this
.
removeEvent
,
this
);
shareButton
=
getObject
(
this
,
'index_sharetips'
);
shareButton
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
showShareMask
();
},
this
)
}
}
initContainer
()
{
initContainer
()
{
...
@@ -112,14 +121,16 @@ export class IndexScene extends Scene {
...
@@ -112,14 +121,16 @@ export class IndexScene extends Scene {
this
.
removeEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
this
.
removeEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
}
}
handleShare
=
async
()
=>
{
showShareMask
();
await
getWebData
(
WebNetName
.
getFreeCount
);
this
.
getIndex
();
}
getIndex
=
async
()
=>
{
getIndex
=
async
()
=>
{
const
result
=
getWebData
(
WebNetName
.
index
);
const
result
=
await
getWebData
(
WebNetName
.
index
);
const
shareButton
=
getObject
(
this
,
'index_sharetips'
);
hand
=
getObject
(
this
,
'index_sharehand'
);
shareButton
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
()
=>
{
})
const
hand
=
getObject
(
this
,
'index_sharehand'
);
this
.
addChild
(
hand
);
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
;
hand
.
visible
=
false
;
if
(
result
&&
result
.
data
)
{
if
(
result
&&
result
.
data
)
{
const
getBoxButton
=
getObject
(
this
,
'index_opentips'
);
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