Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
b5305459
Commit
b5305459
authored
Oct 12, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
849ad0dd
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
400 additions
and
190 deletions
+400
-190
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-0
cutTimeFont.fnt
egret/resource/assets/common/cutTimeFont.fnt
+12
-0
cutTimeFont.png
egret/resource/assets/common/cutTimeFont.png
+0
-0
invateCut_bg.png
egret/resource/assets/invite/cutTime/invateCut_bg.png
+0
-0
invateCut_btn.png
egret/resource/assets/invite/cutTime/invateCut_btn.png
+0
-0
invite_prize_ad.png
egret/resource/assets/invite/invite_prize_ad.png
+0
-0
invite_prize_bg.png
egret/resource/assets/invite/invite_prize_bg.png
+0
-0
invite_prize_btn.png
egret/resource/assets/invite/invite_prize_btn.png
+0
-0
invite_wx_tip.png
egret/resource/assets/invite/invite_wx_tip.png
+0
-0
invitePrize_bg.png
egret/resource/assets/invite/prize/invitePrize_bg.png
+0
-0
invitePrize_btn.png
egret/resource/assets/invite/prize/invitePrize_btn.png
+0
-0
invitePrize_game_btn.png
egret/resource/assets/invite/prize/invitePrize_game_btn.png
+0
-0
invite_rule_bg.png
egret/resource/assets/invite/rule/invite_rule_bg.png
+0
-0
default.res.json
egret/resource/default.res.json
+46
-21
default.thm.json
egret/resource/default.thm.json
+63
-62
InviteCutTimePanelSkin.exml
egret/resource/skins/InviteCutTimePanelSkin.exml
+24
-0
InvitePrizePanelSkin.exml
egret/resource/skins/InvitePrizePanelSkin.exml
+12
-4
InviteSkin.exml
egret/resource/skins/InviteSkin.exml
+4
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+98
-63
InviteCutTimePanel.ts
egret/src/panels/InviteCutTimePanel.ts
+80
-0
InvitePanel.ts
egret/src/panels/InvitePanel.ts
+41
-20
InvitePrizePanel.ts
egret/src/panels/InvitePrizePanel.ts
+10
-7
getInviteInfo.json
mock/happyclear/getInviteInfo.json
+8
-13
No files found.
egret/libs/new_wx/MainBase.ts
View file @
b5305459
...
...
@@ -50,6 +50,7 @@ import InviteRulePanel from "../../src/panels/InviteRulePanel";
import
InvitePrizePanel
from
"../../src/panels/InvitePrizePanel"
;
import
BagPanel
from
"../../src/panels/BagPanel"
;
import
H5Scene
from
"../../src/H5Scene"
;
import
InviteCutTimePanel
from
"../../src/panels/InviteCutTimePanel"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
...
...
@@ -89,6 +90,7 @@ export default class MainBase extends eui.UILayer {
[
'back'
,
{
cls
:
BackPanel
}],
[
'invite'
,
{
cls
:
InvitePanel
}],
[
'invitePrize'
,
{
cls
:
InvitePrizePanel
}],
[
'inviteCutTime'
,
{
cls
:
InviteCutTimePanel
}],
[
'inviteRule'
,
{
cls
:
InviteRulePanel
}],
[
'friend'
,
{
cls
:
FriendPanel
}],
[
'ad'
,
{
cls
:
ADPanel
}],
...
...
egret/resource/assets/common/cutTimeFont.fnt
0 → 100644
View file @
b5305459
{"file":"cutTimeFont.png","frames":{
":":{"x":240,"y":0,"w":16,"h":45,"offX":0,"offY":27,"sourceW":16,"sourceH":99},
"0":{"x":180,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"1":{"x":60,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"2":{"x":0,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"3":{"x":120,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"4":{"x":180,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"5":{"x":0,"y":198,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"6":{"x":120,"y":0,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"7":{"x":60,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"8":{"x":60,"y":198,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99},
"9":{"x":0,"y":99,"w":60,"h":99,"offX":0,"offY":0,"sourceW":60,"sourceH":99}}}
\ No newline at end of file
egret/resource/assets/common/cutTimeFont.png
0 → 100644
View file @
b5305459
19.5 KB
egret/resource/assets/invite/cutTime/invateCut_bg.png
0 → 100644
View file @
b5305459
41.4 KB
egret/resource/assets/invite/cutTime/invateCut_btn.png
0 → 100644
View file @
b5305459
17.6 KB
egret/resource/assets/invite/invite_prize_ad.png
deleted
100644 → 0
View file @
849ad0dd
76 KB
egret/resource/assets/invite/invite_prize_bg.png
deleted
100644 → 0
View file @
849ad0dd
185 KB
egret/resource/assets/invite/invite_prize_btn.png
deleted
100644 → 0
View file @
849ad0dd
19.1 KB
egret/resource/assets/invite/invite_wx_tip.png
0 → 100644
View file @
b5305459
5.2 KB
egret/resource/assets/invite/prize/invitePrize_bg.png
0 → 100644
View file @
b5305459
186 KB
egret/resource/assets/invite/prize/invitePrize_btn.png
0 → 100644
View file @
b5305459
21 KB
egret/resource/assets/invite/prize/invitePrize_game_btn.png
0 → 100644
View file @
b5305459
20.2 KB
egret/resource/assets/invite/invite_rule_bg.png
→
egret/resource/assets/invite/
rule/
invite_rule_bg.png
View file @
b5305459
File moved
egret/resource/default.res.json
View file @
b5305459
...
...
@@ -89,7 +89,7 @@
"name"
:
"friend"
},
{
"keys"
:
"invite_
rule_bg_png,invite_prize_btn_png,invite_prize_bg_png,invite_prize_ad_png,invite_invite_png,invite_help_png,invite_btn_png,invite_bg
_png"
,
"keys"
:
"invite_
invite_png,invite_help_png,invite_btn_png,invite_bg_png,invitePrize_btn_png,invitePrize_bg_png,invitePrize_game_btn_png,invateCut_bg_png,invateCut_btn_png,invite_wx_tip
_png"
,
"name"
:
"invite"
},
{
...
...
@@ -822,31 +822,11 @@
"type"
:
"image"
,
"name"
:
"invite_bg_png"
},
{
"url"
:
"assets/invite/invite_rule_bg.png"
,
"type"
:
"image"
,
"name"
:
"invite_rule_bg_png"
},
{
"url"
:
"assets/invite/invite_btn.png"
,
"type"
:
"image"
,
"name"
:
"invite_btn_png"
},
{
"url"
:
"assets/invite/invite_prize_ad.png"
,
"type"
:
"image"
,
"name"
:
"invite_prize_ad_png"
},
{
"url"
:
"assets/invite/invite_prize_bg.png"
,
"type"
:
"image"
,
"name"
:
"invite_prize_bg_png"
},
{
"url"
:
"assets/invite/invite_prize_btn.png"
,
"type"
:
"image"
,
"name"
:
"invite_prize_btn_png"
},
{
"url"
:
"assets/friend/friend_icon1.png"
,
"type"
:
"image"
,
...
...
@@ -2091,6 +2071,51 @@
"url"
:
"assets/mainScene/yezi1.png"
,
"type"
:
"image"
,
"name"
:
"yezi1_png"
},
{
"url"
:
"assets/invite/rule/invite_rule_bg.png"
,
"type"
:
"image"
,
"name"
:
"invite_rule_bg_png"
},
{
"url"
:
"assets/invite/prize/invitePrize_btn.png"
,
"type"
:
"image"
,
"name"
:
"invitePrize_btn_png"
},
{
"url"
:
"assets/invite/prize/invitePrize_bg.png"
,
"type"
:
"image"
,
"name"
:
"invitePrize_bg_png"
},
{
"url"
:
"assets/invite/prize/invitePrize_game_btn.png"
,
"type"
:
"image"
,
"name"
:
"invitePrize_game_btn_png"
},
{
"url"
:
"assets/invite/cutTime/invateCut_bg.png"
,
"type"
:
"image"
,
"name"
:
"invateCut_bg_png"
},
{
"url"
:
"assets/invite/cutTime/invateCut_btn.png"
,
"type"
:
"image"
,
"name"
:
"invateCut_btn_png"
},
{
"url"
:
"assets/invite/invite_wx_tip.png"
,
"type"
:
"image"
,
"name"
:
"invite_wx_tip_png"
},
{
"url"
:
"assets/common/cutTimeFont.fnt"
,
"type"
:
"font"
,
"name"
:
"cutTimeFont_fnt"
},
{
"url"
:
"assets/common/cutTimeFont.png"
,
"type"
:
"image"
,
"name"
:
"cutTimeFont_png"
}
]
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
b5305459
{
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"resource/skins/ADSkin.exml"
,
"resource/skins/ADSmallSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AvatarSkin.exml"
,
"resource/skins/BackSkin.exml"
,
"resource/skins/BagSkin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/FriendItem2Skin.exml"
,
"resource/skins/FriendItemSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
"resource/skins/InvitePrizePanelSkin.exml"
,
"resource/skins/InviteRulePanelSkin.exml"
,
"resource/skins/InviteSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/SignItemSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/TaskItemSkin.exml"
,
"resource/skins/TaskPrizeSkin.exml"
,
"resource/skins/TaskSkin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
],
"path"
:
"resource/default.thm.json"
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"resource/skins/ADSkin.exml"
,
"resource/skins/ADSmallSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AvatarSkin.exml"
,
"resource/skins/BackSkin.exml"
,
"resource/skins/BagSkin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/FriendItem2Skin.exml"
,
"resource/skins/FriendItemSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
"resource/skins/InvitePrizePanelSkin.exml"
,
"resource/skins/InviteRulePanelSkin.exml"
,
"resource/skins/InviteCutTimePanelSkin.exml"
,
"resource/skins/InviteSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/SignItemSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/TaskItemSkin.exml"
,
"resource/skins/TaskPrizeSkin.exml"
,
"resource/skins/TaskSkin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
],
"path"
:
"resource/default.thm.json"
}
\ No newline at end of file
egret/resource/skins/InviteCutTimePanelSkin.exml
0 → 100644
View file @
b5305459
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"InviteSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"216.33"
source=
"invateCut_bg_png"
horizontalCenter=
"0"
/>
<e:BitmapLabel
id=
"cutTimeLabel"
y=
"396.33"
font=
"cutTimeFont_fnt"
text=
"00:00:00"
letterSpacing=
"10"
horizontalCenter=
"0"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"615"
y=
"208.33"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"ok_btn"
label=
""
y=
"596"
anchorOffsetX=
"150"
anchorOffsetY=
"48"
horizontalCenter=
"0"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"invateCut_btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Component
y=
"726.33"
skinName=
"ADSmallSkin"
horizontalCenter=
"0"
/>
</e:Skin>
\ No newline at end of file
egret/resource/skins/InvitePrizePanelSkin.exml
View file @
b5305459
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"InviteSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"45.33"
horizontalCenter=
"0"
source=
"invite
_p
rize_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"4
31.33
"
source=
""
horizontalCenter=
"0"
/>
<e:Image
y=
"45.33"
horizontalCenter=
"0"
source=
"invite
P
rize_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"4
26.77
"
source=
""
horizontalCenter=
"0"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"632"
y=
"317.33"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
...
...
@@ -12,10 +12,18 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"ok_btn"
label=
""
y=
"7
48"
horizontalCenter=
"0"
anchorOffsetX=
"179"
anchorOffsetY=
"51
"
>
<e:Button
id=
"ok_btn"
label=
""
y=
"7
60"
anchorOffsetX=
"138.5"
anchorOffsetY=
"56.5"
x=
"236.5
"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
scaleX.down=
"0.9"
scaleY.down=
"0.9"
source=
"invite_prize_btn_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"invitePrize_btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"game_btn"
label=
""
y=
"760"
anchorOffsetX=
"139"
anchorOffsetY=
"56.5"
x=
"527"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"invitePrize_game_btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
...
...
egret/resource/skins/InviteSkin.exml
View file @
b5305459
...
...
@@ -35,4 +35,8 @@
</e:layout>
</e:Group>
</e:Scroller>
<e:Group
id=
"wxShareTip"
width=
"750"
height=
"1206"
y=
"0"
x=
"0"
visible=
"false"
>
<e:Rect
fillAlpha=
"0.7"
left=
"0"
top=
"0"
right=
"0"
bottom=
"0"
/>
<e:Image
source=
"invite_wx_tip_png"
x=
"484"
y=
"0"
/>
</e:Group>
</e:Skin>
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
b5305459
This diff is collapsed.
Click to expand it.
egret/src/panels/InviteCutTimePanel.ts
0 → 100644
View file @
b5305459
import
Panel
from
"../../libs/new_wx/components/Panel"
;
/**
* 邀请规则面板
*/
export
default
class
InviteCutTimePanel
extends
Panel
{
public
cutTimeLabel
:
eui
.
BitmapLabel
;
public
closeBtn
:
eui
.
Button
;
public
ok_btn
:
eui
.
Button
;
private
timer
:
egret
.
Timer
;
private
cutTime
:
number
;
constructor
(
data
)
{
super
();
this
.
data
=
data
;
}
start
()
{
super
.
start
();
}
protected
onSkinComplete
()
{
this
.
initUI
();
}
initEvents
()
{
super
.
initEvents
();
this
.
ok_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
this
.
ok_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
}
initUI
()
{
this
.
cutTime
=
this
.
data
.
endTime
-
this
.
data
.
sysTime
+
1000
;
this
.
timer
=
new
egret
.
Timer
(
1000
,
0
);
this
.
timer
.
addEventListener
(
egret
.
TimerEvent
.
TIMER
,
this
.
cutTimer
,
this
);
this
.
timer
.
start
();
this
.
cutTimer
();
}
private
cutTimer
()
{
let
timer
=
this
.
convertTime
(
this
.
cutTime
-=
1000
);
if
(
timer
.
hour
===
"00"
&&
timer
.
min
===
"00"
&&
timer
.
sec
===
"00"
)
{
this
.
timer
.
stop
();
this
.
hidePanel
();
}
this
.
cutTimeLabel
.
text
=
`
${
timer
.
hour
}
:
${
timer
.
min
}
:
${
timer
.
sec
}
`
;
}
private
convertTime
(
time
:
number
)
{
let
hour
=
~~
(
time
/
3600000
);
// 小时
let
min
=
~~
((
time
-
hour
*
3600000
)
/
60000
);
// 分
let
sec
=
~~
((
time
-
hour
*
3600000
-
min
*
60000
)
/
1000
);
// 秒
return
{
hour
:
this
.
prefixInteger
(
hour
,
2
),
min
:
this
.
prefixInteger
(
min
,
2
),
sec
:
this
.
prefixInteger
(
sec
,
2
)
}
}
prefixInteger
(
num
,
length
)
{
return
(
Array
(
length
).
join
(
'0'
)
+
num
).
slice
(
-
length
);
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
get
skinKey
()
{
return
'InviteCutTimePanel'
}
}
egret/src/panels/InvitePanel.ts
View file @
b5305459
...
...
@@ -11,6 +11,7 @@ export default class InvitePanel extends Panel {
public
numLabel
:
eui
.
Label
;
public
cutTimeLabel
:
eui
.
Label
;
public
list
:
eui
.
List
;
public
wxShareTip
:
eui
.
Group
;
private
invite_img
:
egret
.
Texture
;
private
timer
:
egret
.
Timer
;
...
...
@@ -60,6 +61,7 @@ export default class InvitePanel extends Panel {
}
initUI
()
{
this
.
setWXShareTip
();
this
.
prizeImg
.
source
=
this
.
data
.
img
;
let
dNum
=
this
.
data
.
invitationCount
-
this
.
data
.
invitationUser
.
length
;
this
.
numLabel
.
text
=
`仅差
${
dNum
}
人可获得`
;
...
...
@@ -67,6 +69,20 @@ export default class InvitePanel extends Panel {
this
.
data
.
invitationUser
.
push
({
nickname
:
"nickname"
,
avatar
:
this
.
invite_img
,
callFun
:
()
=>
{
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
let
shareCode
=
res
.
data
;
if
(
iswx
())
{
//微信端
this
.
wxShareTip
.
visible
=
true
;
}
else
{
//端内
this
.
wxShareTip
.
visible
=
true
;
// window["inviteShare"](shareCode);
}
});
}
});
}
this
.
list
.
useVirtualLayout
=
false
;
...
...
@@ -83,9 +99,9 @@ export default class InvitePanel extends Panel {
private
cutTimer
()
{
let
timer
=
this
.
convertTime
(
this
.
cutTime
-=
1000
);
if
(
timer
.
hour
===
0
&&
timer
.
min
===
0
&&
timer
.
sec
===
0
)
{
if
(
timer
.
hour
===
"00"
&&
timer
.
min
===
"00"
&&
timer
.
sec
===
"00"
)
{
this
.
timer
.
stop
();
this
.
hidePanel
();
}
...
...
@@ -93,17 +109,30 @@ export default class InvitePanel extends Panel {
}
private
convertTime
(
time
:
number
)
{
let
hour
=
~~
(
time
/
3600000
);
// 小时
let
min
=
~~
((
time
-
hour
*
3600000
)
/
60000
);
// 分
let
sec
=
~~
((
time
-
hour
*
3600000
-
min
*
60000
)
/
1000
);
// 秒
let
hour
=
~~
(
time
/
3600000
);
// 小时
let
min
=
~~
((
time
-
hour
*
3600000
)
/
60000
);
// 分
let
sec
=
~~
((
time
-
hour
*
3600000
-
min
*
60000
)
/
1000
);
// 秒
return
{
hour
:
hour
,
min
:
min
,
sec
:
sec
,
hour
:
this
.
prefixInteger
(
hour
,
2
)
,
min
:
this
.
prefixInteger
(
min
,
2
)
,
sec
:
this
.
prefixInteger
(
sec
,
2
)
}
}
prefixInteger
(
num
,
length
)
{
return
(
Array
(
length
).
join
(
'0'
)
+
num
).
slice
(
-
length
);
}
private
setWXShareTip
()
{
this
.
wxShareTip
.
visible
=
false
;
this
.
wxShareTip
.
width
=
this
.
width
/
window
.
innerWidth
*
window
.
innerWidth
;
this
.
wxShareTip
.
height
=
this
.
width
/
window
.
innerWidth
*
window
.
innerHeight
;
this
.
wxShareTip
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
wxShareTip
.
visible
=
false
;
},
this
);
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
...
...
@@ -133,17 +162,9 @@ class InviteItem extends eui.ItemRenderer {
dataChanged
()
{
this
.
img
.
source
=
this
.
data
.
avatar
;
this
.
img
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
let
shareCode
=
res
.
data
;
if
(
iswx
())
{
//微信端
}
else
{
//端内
window
[
"inviteShare"
](
shareCode
);
}
});
if
(
this
.
data
.
callFun
)
{
this
.
data
.
callFun
();
}
},
this
);
}
}
...
...
egret/src/panels/InvitePrizePanel.ts
View file @
b5305459
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
HtmlTextParser
}
from
"../../libs/new_wx/HtmlTextParser"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
Panel
from
"../../libs/new_wx/components/Panel"
;
/**
...
...
@@ -10,25 +7,31 @@ export default class InvitePrizePanel extends Panel {
public
prizeImg
:
eui
.
Image
;
public
closeBtn
:
eui
.
Button
;
public
ok_btn
:
eui
.
Button
;
public
game_btn
:
eui
.
Button
;
constructor
(
data
){
super
();
this
.
data
=
data
;
}
start
()
{
super
.
start
();
}
protected
onSkinComplete
()
{
this
.
initUI
();
}
initEvents
()
{
super
.
initEvents
();
// this['inviteBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this
.
ok_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapGoPrize
,
this
);
this
.
game_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
// this['inviteBtn'].removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this)
this
.
ok_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapGoPrize
,
this
);
this
.
game_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
}
onTapGoPrize
(){
...
...
@@ -36,7 +39,7 @@ export default class InvitePrizePanel extends Panel {
}
initUI
()
{
this
.
prizeImg
.
source
=
this
.
data
.
prizeImg
;
}
protected
get
closeBtns
():
eui
.
Button
[]
{
...
...
mock/happyclear/getInviteInfo.json
View file @
b5305459
...
...
@@ -5,9 +5,9 @@
"timestamp"
:
1566199822308
,
"data"
:
{
"invitationId"
:
"活动id"
,
"invitationCount"
:
3
,
"invitationCount"
:
4
,
"img"
:
"http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
,
"sysTime"
:
15705
864
00000
,
"sysTime"
:
15705
978
00000
,
"endTime"
:
1570672800000
,
"invitationUser"
:
[
{
...
...
@@ -15,16 +15,11 @@
"avatar"
:
"http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
}
],
"completeFlag"
:
true
,
"openPriz"
:
true
,
"openPrizMsg"
:
"图片"
,
"prizeInfo"
:
[
{
"prizeType"
:
"nickname"
,
"prizeName"
:
"nickname"
,
"prizeImg"
:
"nickname"
,
"facePrice"
:
"avatar"
}
]
"completeFlag"
:
2
,
"openPrizeMsg"
:
"图片"
,
"prizeType"
:
"nickname"
,
"prizeName"
:
"nickname"
,
"prizeImg"
:
"http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
,
"facePrice"
:
"avatar"
}
}
\ No newline at end of file
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