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
ef173ada
Commit
ef173ada
authored
Oct 23, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7def75b5
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
729 additions
and
169 deletions
+729
-169
MainBase.ts
egret/libs/new_wx/MainBase.ts
+4
-0
scratchPrize_bg.png
egret/resource/assets/scratch/prize/scratchPrize_bg.png
+0
-0
scratchPrize_btn.png
egret/resource/assets/scratch/prize/scratchPrize_btn.png
+0
-0
scratchPrize_game_btn.png
...t/resource/assets/scratch/prize/scratchPrize_game_btn.png
+0
-0
scratch_rule_bg.png
egret/resource/assets/scratch/rule/scratch_rule_bg.png
+0
-0
scratch_bg.png
egret/resource/assets/scratch/scratch_bg.png
+0
-0
scratch_help.png
egret/resource/assets/scratch/scratch_help.png
+0
-0
scratch_hongbao.png
egret/resource/assets/scratch/scratch_hongbao.png
+0
-0
scratch_invite.png
egret/resource/assets/scratch/scratch_invite.png
+0
-0
scratch_progress_bg.png
egret/resource/assets/scratch/scratch_progress_bg.png
+0
-0
scratch_wx_tip.png
egret/resource/assets/scratch/scratch_wx_tip.png
+0
-0
scratchbg2.png
egret/resource/assets/scratch/scratchbg2.png
+0
-0
default.res.json
egret/resource/default.res.json
+67
-0
default.thm.json
egret/resource/default.thm.json
+71
-67
ScratchItemSkin.exml
egret/resource/skins/ScratchItemSkin.exml
+5
-0
ScratchPrizeSkin.exml
egret/resource/skins/ScratchPrizeSkin.exml
+31
-0
ScratchRuleSkin.exml
egret/resource/skins/ScratchRuleSkin.exml
+21
-0
ScratchSkin.exml
egret/resource/skins/ScratchSkin.exml
+55
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+129
-101
ScratchPanel.ts
egret/src/panels/ScratchPanel.ts
+221
-0
ScratchPrizePanel.ts
egret/src/panels/ScratchPrizePanel.ts
+75
-0
ScratchRulePanel.ts
egret/src/panels/ScratchRulePanel.ts
+49
-0
getInviteInfo.json
mock/happyclear/getInviteInfo.json
+1
-1
No files found.
egret/libs/new_wx/MainBase.ts
View file @
ef173ada
...
@@ -52,6 +52,8 @@ import BagPanel from "../../src/panels/BagPanel";
...
@@ -52,6 +52,8 @@ import BagPanel from "../../src/panels/BagPanel";
import
H5Scene
from
"../../src/H5Scene"
;
import
H5Scene
from
"../../src/H5Scene"
;
import
InviteCutTimePanel
from
"../../src/panels/InviteCutTimePanel"
;
import
InviteCutTimePanel
from
"../../src/panels/InviteCutTimePanel"
;
import
RulePanel2
from
"./components/RulePanel2"
;
import
RulePanel2
from
"./components/RulePanel2"
;
import
ScratchPanel
from
"../../src/panels/ScratchPanel"
;
import
ScratchPrizePanel
from
"../../src/panels/ScratchPrizePanel"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
constructor
()
{
...
@@ -94,6 +96,8 @@ export default class MainBase extends eui.UILayer {
...
@@ -94,6 +96,8 @@ export default class MainBase extends eui.UILayer {
[
'invitePrize'
,
{
cls
:
InvitePrizePanel
}],
[
'invitePrize'
,
{
cls
:
InvitePrizePanel
}],
[
'inviteCutTime'
,
{
cls
:
InviteCutTimePanel
}],
[
'inviteCutTime'
,
{
cls
:
InviteCutTimePanel
}],
[
'inviteRule'
,
{
cls
:
InviteRulePanel
}],
[
'inviteRule'
,
{
cls
:
InviteRulePanel
}],
[
'scratch'
,
{
cls
:
ScratchPanel
}],
[
'scratchPrize'
,
{
cls
:
ScratchPrizePanel
}],
[
'friend'
,
{
cls
:
FriendPanel
}],
[
'friend'
,
{
cls
:
FriendPanel
}],
[
'ad'
,
{
cls
:
ADPanel
}],
[
'ad'
,
{
cls
:
ADPanel
}],
];
];
...
...
egret/resource/assets/scratch/prize/scratchPrize_bg.png
0 → 100644
View file @
ef173ada
264 KB
egret/resource/assets/scratch/prize/scratchPrize_btn.png
0 → 100644
View file @
ef173ada
21.3 KB
egret/resource/assets/scratch/prize/scratchPrize_game_btn.png
0 → 100644
View file @
ef173ada
23.3 KB
egret/resource/assets/scratch/rule/scratch_rule_bg.png
0 → 100644
View file @
ef173ada
131 KB
egret/resource/assets/scratch/scratch_bg.png
0 → 100644
View file @
ef173ada
145 KB
egret/resource/assets/scratch/scratch_help.png
0 → 100644
View file @
ef173ada
1.22 KB
egret/resource/assets/scratch/scratch_hongbao.png
0 → 100644
View file @
ef173ada
3.74 KB
egret/resource/assets/scratch/scratch_invite.png
0 → 100644
View file @
ef173ada
3.36 KB
egret/resource/assets/scratch/scratch_progress_bg.png
0 → 100644
View file @
ef173ada
912 Bytes
egret/resource/assets/scratch/scratch_wx_tip.png
0 → 100644
View file @
ef173ada
5.45 KB
egret/resource/assets/scratch/scratchbg2.png
0 → 100644
View file @
ef173ada
114 KB
egret/resource/default.res.json
View file @
ef173ada
...
@@ -127,6 +127,18 @@
...
@@ -127,6 +127,18 @@
{
{
"keys"
:
"sharefriend_png"
,
"keys"
:
"sharefriend_png"
,
"name"
:
"friendshare"
"name"
:
"friendshare"
},
{
"keys"
:
"scratch_bg_png,scratch_help_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png,scratch_progress_bg_png,scratch_hongbao_png"
,
"name"
:
"scratch"
},
{
"keys"
:
"scratchPrize_bg_png,scratchPrize_btn_png,scratchPrize_game_btn_png"
,
"name"
:
"scratchprizepanel"
},
{
"keys"
:
"scratch_rule_bg_png"
,
"name"
:
"scratchrulepanel"
}
}
],
],
"resources"
:
[
"resources"
:
[
...
@@ -2274,6 +2286,61 @@
...
@@ -2274,6 +2286,61 @@
"url"
:
"assets/ad/adbg.png"
,
"url"
:
"assets/ad/adbg.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"adbg_png"
"name"
:
"adbg_png"
},
{
"url"
:
"assets/scratch/scratch_bg.png"
,
"type"
:
"image"
,
"name"
:
"scratch_bg_png"
},
{
"url"
:
"assets/scratch/scratch_help.png"
,
"type"
:
"image"
,
"name"
:
"scratch_help_png"
},
{
"url"
:
"assets/scratch/scratch_wx_tip.png"
,
"type"
:
"image"
,
"name"
:
"scratch_wx_tip_png"
},
{
"url"
:
"assets/scratch/scratchbg2.png"
,
"type"
:
"image"
,
"name"
:
"scratchbg2_png"
},
{
"url"
:
"assets/scratch/scratch_invite.png"
,
"type"
:
"image"
,
"name"
:
"scratch_invite_png"
},
{
"url"
:
"assets/scratch/prize/scratchPrize_bg.png"
,
"type"
:
"image"
,
"name"
:
"scratchPrize_bg_png"
},
{
"url"
:
"assets/scratch/prize/scratchPrize_btn.png"
,
"type"
:
"image"
,
"name"
:
"scratchPrize_btn_png"
},
{
"url"
:
"assets/scratch/prize/scratchPrize_game_btn.png"
,
"type"
:
"image"
,
"name"
:
"scratchPrize_game_btn_png"
},
{
"url"
:
"assets/scratch/rule/scratch_rule_bg.png"
,
"type"
:
"image"
,
"name"
:
"scratch_rule_bg_png"
},
{
"url"
:
"assets/scratch/scratch_progress_bg.png"
,
"type"
:
"image"
,
"name"
:
"scratch_progress_bg_png"
},
{
"url"
:
"assets/scratch/scratch_hongbao.png"
,
"type"
:
"image"
,
"name"
:
"scratch_hongbao_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
ef173ada
...
@@ -46,6 +46,10 @@
...
@@ -46,6 +46,10 @@
"resource/skins/RankSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ScratchItemSkin.exml"
,
"resource/skins/ScratchPrizeSkin.exml"
,
"resource/skins/ScratchRuleSkin.exml"
,
"resource/skins/ScratchSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareSkin.exml"
,
...
...
egret/resource/skins/ScratchItemSkin.exml
0 → 100644
View file @
ef173ada
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"InviteItemSkin"
width=
"90"
height=
"90"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
id=
"img"
source=
""
top=
"0"
left=
"0"
bottom=
"0"
right=
"0"
/>
<e:Rect
id=
"mask"
left=
"0"
top=
"0"
bottom=
"0"
right=
"0"
ellipseWidth=
"90"
ellipseHeight=
"90"
/>
</e:Skin>
\ No newline at end of file
egret/resource/skins/ScratchPrizeSkin.exml
0 → 100644
View file @
ef173ada
<?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=
"scratchPrize_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"426.77"
source=
""
horizontalCenter=
"0"
width=
"510"
height=
"228"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"624"
y=
"313.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=
"764"
anchorOffsetX=
"138.5"
anchorOffsetY=
"56.5"
x=
"236.5"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"scratchPrize_btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"game_btn"
label=
""
y=
"764"
anchorOffsetX=
"139"
anchorOffsetY=
"56.5"
x=
"527"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"scratchPrize_game_btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Skin>
\ No newline at end of file
egret/resource/skins/ScratchRuleSkin.exml
0 → 100644
View file @
ef173ada
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"InviteRuleSkin"
width=
"750"
height=
"1624"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Rect
left=
"0"
bottom=
"0"
top=
"0"
right=
"0"
fillColor=
"0x000000"
fillAlpha=
"0.7"
/>
<e:Image
id=
"ruleBg"
horizontalCenter=
"0.5"
y=
"152"
source=
"scratch_rule_bg_png"
/>
<e:Scroller
id=
"scroller"
width=
"545"
x=
"104.76"
height=
"507"
y=
"377.2"
>
<e:Group
id=
"group"
width=
"100%"
>
<e:Label
id=
"labContent"
width=
"100%"
text=
""
lineSpacing=
"10"
size=
"30"
multiline=
"true"
textColor=
"0xa54615"
/>
<e:layout>
<e:VerticalLayout/>
</e:layout>
</e:Group>
</e:Scroller>
<e:Button
id=
"closeBtn"
label=
""
x=
"614"
y=
"301"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<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:Skin>
\ No newline at end of file
egret/resource/skins/ScratchSkin.exml
0 → 100644
View file @
ef173ada
<?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"
>
<w:Config
id=
"16dd8f58b77"
visible=
"false"
/>
<e:Image
id=
"light2"
x=
"376"
y=
"317"
anchorOffsetX=
"356"
anchorOffsetY=
"296"
source=
"scratchbg2_png"
/>
<e:Image
id=
"light1"
x=
"376"
y=
"317"
anchorOffsetX=
"356"
anchorOffsetY=
"296"
source=
"scratchbg2_png"
/>
<e:Image
y=
"259.33"
source=
"scratch_bg_png"
horizontalCenter=
"0"
/>
<e:Group
id=
"con"
y=
"-67"
/>
<e:Label
text=
"共2位好友帮你刮了90.3%"
y=
"381.33"
textColor=
"0xF54500"
size=
"28"
horizontalCenter=
"0"
fontFamily=
"Lucida Family"
verticalAlign=
"middle"
textAlign=
"center"
/>
<e:Image
id=
"prizeImg"
y=
"439.33"
horizontalCenter=
"0.5"
source=
""
width=
"510"
height=
"228"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"605"
y=
"219.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=
"helpBtn"
label=
""
x=
"564"
y=
"376.33"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"scratch_help_png"
source.down=
"scratch_help_png"
source.disabled=
"scratch_help_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label
id=
"numLabel"
text=
"仅差3人可获得"
y=
"679.33"
textColor=
"0xf54500"
size=
"28"
horizontalCenter=
"0"
visible=
"false"
/>
<e:Label
id=
"cutTimeLabel"
text=
"将在23:43:21后失效"
y=
"883.33"
size=
"28"
textColor=
"0xffffff"
horizontalCenter=
"0"
/>
<e:Scroller
width=
"487"
height=
"90"
y=
"775"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
horizontalCenter=
"32.5"
>
<e:Group
anchorOffsetX=
"0"
y=
"2"
>
<e:List
id=
"list"
x=
"0"
y=
"0"
anchorOffsetX=
"0"
>
<e:layout>
<e:HorizontalLayout
horizontalAlign=
"center"
verticalAlign=
"middle"
gap=
"23"
/>
</e:layout>
</e:List>
<e:layout>
<e:HorizontalLayout
gap=
"66"
horizontalAlign=
"center"
verticalAlign=
"middle"
/>
</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
x=
"424"
y=
"0"
source=
"scratch_wx_tip_png"
/>
</e:Group>
<e:Group
x=
"133"
y=
"711"
width=
"437"
height=
"22"
>
<e:Image
id=
"progressMask"
source=
"scratch_progress_bg_png"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
<e:Group
id=
"progressGroup"
horizontalCenter=
"0"
verticalCenter=
"0"
>
<e:Image
id=
"progressBg"
source=
"scratch_progress_bg_png"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
x=
"0"
y=
"0"
width=
"437"
height=
"22"
/>
<e:Rect
id=
"progress"
fillColor=
"0xeb1917"
left=
"0"
verticalCenter=
"0"
width=
"99"
height=
"22"
/>
<e:Label
text=
"仅剩90.7%"
size=
"18"
verticalCenter=
"0"
horizontalCenter=
"0"
/>
</e:Group>
</e:Group>
<e:Image
id=
"hongbao"
x=
"586"
y=
"697"
source=
"scratch_hongbao_png"
/>
</e:Skin>
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
ef173ada
This diff is collapsed.
Click to expand it.
egret/src/panels/ScratchPanel.ts
0 → 100644
View file @
ef173ada
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
iswx
}
from
"../iswx"
;
import
Utils
from
"../Utils"
;
import
ScratchRulePanel
from
"./ScratchRulePanel"
;
export
default
class
ScratchPanel
extends
Panel
{
public
light2
:
eui
.
Image
;
public
light1
:
eui
.
Image
;
public
con
:
eui
.
Group
;
public
prizeImg
:
eui
.
Image
;
public
closeBtn
:
eui
.
Button
;
public
helpBtn
:
eui
.
Button
;
public
numLabel
:
eui
.
Label
;
public
cutTimeLabel
:
eui
.
Label
;
public
list
:
eui
.
List
;
public
wxShareTip
:
eui
.
Group
;
public
progressMask
:
eui
.
Image
;
public
progressGroup
:
eui
.
Group
;
public
progressBg
:
eui
.
Image
;
public
progress
:
eui
.
Rect
;
public
hongbao
:
eui
.
Image
;
private
invite_img
:
egret
.
Texture
;
private
timer
:
egret
.
Timer
;
private
cutTime
:
number
;
constructor
(
data
)
{
super
();
this
.
data
=
data
;
}
async
start
(
data
)
{
super
.
start
();
this
.
showlog
();
this
[
'light1'
].
visible
=
this
[
'light2'
].
visible
=
false
;
// this['con'].addChild(this.data.svga);
// this.data.svga.gotoAndPlay(1, true);
// this.data.svga.once(egret.Event.COMPLETE, () => {
// this.data.svga.stop(1);
// }, this);
setTimeout
(()
=>
{
this
.
playBgAni
();
},
500
);
}
playBgAni
()
{
this
[
'light1'
].
visible
=
this
[
'light2'
].
visible
=
true
;
const
time
=
7000
;
egret
.
Tween
.
get
(
this
[
'light1'
],
{
loop
:
true
}).
to
({
rotation
:
360
},
time
);
egret
.
Tween
.
get
(
this
[
'light2'
],
{
loop
:
true
}).
to
({
rotation
:
-
360
},
time
);
}
showlog
()
{
}
initEvents
()
{
super
.
initEvents
();
this
.
closeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
.
helpBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapRule
,
this
);
}
onTouchTap_closeBtn
()
{
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
super
.
onTouchTap_closeBtn
();
}
removeEvents
()
{
super
.
removeEvents
();
this
.
closeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
.
helpBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapRule
,
this
);
}
onTapRule
()
{
const
rule
=
new
ScratchRulePanel
();
rule
.
loadSkin
();
rule
.
start
();
this
.
addChild
(
rule
);
}
protected
onSkinComplete
()
{
this
.
getGameRes
().
then
(
r
=>
this
.
initUI
());
}
initUI
()
{
this
.
setWXShareTip
();
this
.
progressGroup
.
mask
=
this
.
progressMask
;
this
.
setProgress
(
90.7
);
// this.prizeImg.source = this.data.prizeImg;
// if (!this.data.invitationUser) {
// this.data.invitationUser = [];
// }
// let dNum = this.data.invitationCount - this.data.invitationUser.length;
// this.numLabel.text = `仅差${dNum}人可获得`;
//
// for (let i = 0; i < dNum; i++) {
// this.data.invitationUser.push({
// nickname: "nickname",
// avatar: this.invite_img,
// });
// }
// for (let i = 0; i < this.data.invitationUser.length; i++) {
// this.data.invitationUser[i]['callFun'] = () => {
// NetManager.ins.getShareCode((success, res) => {
// if (!success) {
// return;
// }
// let shareCode = res.data; // 分享码
// CFG.wxShareLink = window['h5URL'] + "&shareCode=" + shareCode; // 分享链接
// CFG.wxShareTitle = '狮狮连萌超好玩~我已经玩到第一了!';
// CFG.wxShareDesc = '我在萌狮消消乐等你来挑战哦';
// CFG.wxShareImg="http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg";
// if (iswx()) { //微信端
// this.wxShareTip.visible = true;
// window["invokeWX"]();
// } else {//端内
// this.wxShareTip.visible = false;
// window["inviteShare"](shareCode);
// }
// });
// }
// }
// this.list.useVirtualLayout = false;
// this.list.itemRenderer = ScratchItem;
// this.list.dataProvider = new eui.ArrayCollection(this.data.invitationUser);
//
// this.cutTime = this.data.endTime - this.data.sysTime + 5000;
// if (this.timer) {
// this.timer.stop();
// }
// this.timer = new egret.Timer(1000, 0);
// this.timer.addEventListener(egret.TimerEvent.TIMER, this.cutTimer, this);
// this.timer.start();
// this.cutTimer();
}
private
setProgress
(
progress
)
{
if
(
progress
>
100
)
{
progress
=
100
;
}
else
if
(
progress
<
0
)
{
progress
=
0
;
}
this
.
progress
.
width
=
this
.
progressBg
.
width
*
progress
/
100
;
}
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
:
Utils
.
prefixInteger
(
hour
,
2
),
min
:
Utils
.
prefixInteger
(
min
,
2
),
sec
:
Utils
.
prefixInteger
(
sec
,
2
)
}
}
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'
]]
}
private
async
getGameRes
()
{
this
.
invite_img
=
await
RES
.
getResAsync
(
"scratch_invite_png"
);
}
get
skinKey
()
{
return
'Scratch'
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
/**
* 邀请好友的列表项
*/
class
ScratchItem
extends
eui
.
ItemRenderer
{
public
img
:
eui
.
Image
;
public
mask
:
eui
.
Rect
;
constructor
()
{
super
();
this
.
skinName
=
getSkinPath
(
'ScratchItem'
);
}
dataChanged
()
{
this
.
img
.
mask
=
this
.
mask
console
.
log
(
this
.
data
);
this
.
img
.
source
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
this
.
img
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
this
.
data
.
callFun
)
{
this
.
data
.
callFun
();
}
},
this
);
}
}
egret/src/panels/ScratchPrizePanel.ts
0 → 100644
View file @
ef173ada
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
getHomeData
from
"../getHomeData"
;
import
{
changeMapScene
}
from
"../startScene/StartScene"
;
import
{
addAdComp
}
from
"./BoxPanel"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
/**
* 邀请规则面板
*/
export
default
class
ScratchPrizePanel
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
.
closeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
.
ok_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapGoPrize
,
this
);
this
.
game_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchOK
,
this
);
}
removeEvents
()
{
super
.
removeEvents
();
this
.
closeBtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
.
ok_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapGoPrize
,
this
);
this
.
game_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchOK
,
this
);
}
onTouchTap_closeBtn
()
{
// GDispatcher.dispatchEvent("getInviteInfo");
super
.
onTouchTap_closeBtn
();
}
onTouchOK
()
{
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
// GDispatcher.dispatchEvent("getInviteInfo");
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
}
onTapGoPrize
()
{
window
.
location
.
href
=
window
[
'__link__'
];
}
initUI
()
{
this
.
prizeImg
.
source
=
this
.
data
.
prizeImg
;
addAdComp
(
84
,
845.33
,
this
);
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
get
skinKey
()
{
return
'ScratchPrize'
}
}
egret/src/panels/ScratchRulePanel.ts
0 → 100644
View file @
ef173ada
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
HtmlTextParser
}
from
"../../libs/new_wx/HtmlTextParser"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
/**
* 邀请规则面板
*/
export
default
class
ScratchRulePanel
extends
Panel
{
public
scroller
:
eui
.
Scroller
;
public
group
:
eui
.
Group
;
public
labContent
:
eui
.
Label
;
public
closeBtn
:
eui
.
Button
;
private
_mask
:
egret
.
Sprite
;
start
()
{
super
.
start
();
this
.
addRule
();
this
.
closeBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
visible
=
false
;
},
this
);
}
loadSkin
()
{
this
.
skinName
=
getSkinPath
(
this
.
skinKey
);
if
(
this
.
skin
)
{
this
.
onSkinComplete
();
}
else
{
this
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
onSkinComplete
,
this
);
}
}
private
addRule
()
{
const
text
=
`<br>1、用户每天邀请指定数量的新玩家参与闯关,可获得指定的现金券奖励。
2、用户发起邀请后,需在24小时内完成邀请任务;超过24小时,邀请任务失败,无法获得奖励,需重新发起邀请。
3、新用户仅包含未参与过狮狮连萌活动的用户。
4、用户不可为自己助力,或重复为好友助力。
5、完成邀请任务后,玩家可点击首页“邀请得现金券”图标领取现金券。
6、发放的奖励请在规定的有效时间内尽快领取或使用,逾期未领取或使用的会失效哦。
7、活动过程中,凡以不正当手段(包括但不限于作弊、恶意套现、扰乱系统、网络攻击等违规行为)参与本次活动的用户,苏宁易购有权终止其参加活动,并取消其获得奖励的资格。
8、极少数特殊情况下,若用户在完成活动的任务中被系统判定异常账户或风控账户,则可能导致奖励发放异常。
9、如遇不可抗力(包括但不限于重大自然灾害事件、活动受政府机关指令需要停止举办或调整的、活动遭受严重网络攻击不能正常进行的),苏宁易购有权取消、修改或暂停活动。`
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
text
);
}
get
skinKey
()
{
return
'ScratchRule'
}
}
mock/happyclear/getInviteInfo.json
View file @
ef173ada
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
"avatar"
:
null
"avatar"
:
null
}
}
],
],
"completeFlag"
:
1
,
"completeFlag"
:
0
,
"openPrizeMsg"
:
"图片"
,
"openPrizeMsg"
:
"图片"
,
"prizeType"
:
"nickname"
,
"prizeType"
:
"nickname"
,
"prizeName"
:
"nickname"
,
"prizeName"
:
"nickname"
,
...
...
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