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
6b930424
Commit
6b930424
authored
Oct 17, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bb1a1c3c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
94 additions
and
66 deletions
+94
-66
invite.tmproject
egret/resource/TextureMerger/invite.tmproject
+1
-1
invite_bg.png
egret/resource/assets/invite/invite_bg.png
+0
-0
InviteSkin.exml
egret/resource/skins/InviteSkin.exml
+4
-4
loadSvga.ts
egret/src/loadSvga.ts
+30
-30
MapScene.ts
egret/src/mapScene/MapScene.ts
+31
-9
InvitePanel.ts
egret/src/panels/InvitePanel.ts
+27
-21
getInviteInfo.json
mock/happyclear/getInviteInfo.json
+1
-1
No files found.
egret/resource/TextureMerger/invite.tmproject
View file @
6b930424
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"invite","version":5,"files":["../assets/invite/invite_invite.png","../assets/invite/invite_help.png","../assets/invite/invite_btn.png","../assets/invite/invite_bg.png","../assets/invite/prize/invitePrize_btn.png","../assets/invite/prize/invitePrize_bg.png","../assets/invite/prize/invitePrize_game_btn.png","../assets/invite/cutTime/invateCut_bg.png","../assets/invite/cutTime/invateCut_btn.png","../assets/invite/invite_wx_tip.png","../assets/invite/rule/invite_rule_bg.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"invite","version":5,"files":["../assets/invite/invite_invite.png","../assets/invite/invite_help.png","../assets/invite/invite_btn.png","../assets/invite/invite_bg.png","../assets/invite/prize/invitePrize_btn.png","../assets/invite/prize/invitePrize_bg.png","../assets/invite/prize/invitePrize_game_btn.png","../assets/invite/cutTime/invateCut_bg.png","../assets/invite/cutTime/invateCut_btn.png","../assets/invite/invite_wx_tip.png","../assets/invite/rule/invite_rule_bg.png","../assets/invite/invitebg2.png"]}
\ No newline at end of file
egret/resource/assets/invite/invite_bg.png
View replaced file @
bb1a1c3c
View file @
6b930424
242 KB
|
W:
|
H:
130 KB
|
W:
|
H:
2-up
Swipe
Onion skin
egret/resource/skins/InviteSkin.exml
View file @
6b930424
...
...
@@ -4,9 +4,9 @@
<w:Config
id=
"16dd8f58b77"
visible=
"false"
/>
<e:Image
id=
"light2"
source=
"invitebg2_png"
x=
"376"
y=
"317"
anchorOffsetX=
"356"
anchorOffsetY=
"296"
/>
<e:Image
id=
"light1"
source=
"invitebg2_png"
x=
"376"
y=
"317"
anchorOffsetX=
"356"
anchorOffsetY=
"296"
/>
<e:
Group
id=
"con"
y=
"-50
"
/>
<e:
Image
y=
"45.33"
horizontalCenter=
"0"
source=
"invite_bg_png"
visible=
"false
"
/>
<e:Label
text=
"邀请
"
y=
"679
.33"
textColor=
"0xF54500"
size=
"28"
horizontalCenter=
"0"
/>
<e:
Image
y=
"241.33"
horizontalCenter=
"0"
source=
"invite_bg_png
"
/>
<e:
Group
id=
"con"
y=
"-67
"
/>
<e:Label
text=
"邀请
好友闯关可得现金券!"
y=
"381
.33"
textColor=
"0xF54500"
size=
"28"
horizontalCenter=
"0"
/>
<e:Image
id=
"prizeImg"
y=
"439.33"
horizontalCenter=
"0.5"
source=
""
width=
"510"
height=
"228"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"605"
y=
"227.33"
>
<e:skinName>
...
...
@@ -26,7 +26,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Label
id=
"numLabel"
text=
"仅差3人可获得"
y=
"679.33"
textColor=
"0xf54500"
size=
"28"
horizontalCenter=
"0"
/>
<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=
"545"
height=
"90"
y=
"766.33"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
horizontalCenter=
"0"
>
<e:Group
anchorOffsetX=
"0"
>
...
...
egret/src/loadSvga.ts
View file @
6b930424
const
parser
=
new
window
[
"SVGA"
].
Parser
();
export
const
loadSvga
=
(
url
:
string
,
parent
?:
egret
.
DisplayObjectContainer
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
parser
=
new
window
[
"SVGA"
].
Parser
();
parser
.
load
(
url
,
(
videoItem
)
=>
{
const
mv
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
)
mv
.
gotoAndPlay
(
1
,
true
)
if
(
parent
)
parent
.
addChild
(
mv
);
...
...
@@ -20,31 +21,30 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) =>
});
}
export
const
loadSvga2
=
(
url
:
string
,
parent
:
egret
.
DisplayObjectContainer
,
callback
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
parser
=
new
window
[
"SVGA"
].
Parser
();
parser
.
load
(
url
,
(
videoItem
)
=>
{
const
mv
=
new
window
[
"SVGA"
].
EgretMovieClip
(
videoItem
)
mv
.
gotoAndStop
(
1
);
mv
.
visible
=
false
;
setTimeout
(()
=>
{
mv
.
visible
=
true
;
},
50
);
setTimeout
(()
=>
{
mv
.
gotoAndPlay
(
1
,
true
)
},
500
);
if
(
parent
)
parent
.
addChild
(
mv
);
mv
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
mv
.
stop
();
callback
();
},
this
);
resolve
(
mv
);
},
(
error
)
=>
{
reject
(
error
.
message
);
})
});
}
\ No newline at end of file
// export const loadSvga2 = (url: string, parent: egret.DisplayObjectContainer, callback) => {
// return new Promise((resolve, reject) => {
// const parser = new window["SVGA"].Parser();
// parser.load(url, (videoItem) => {
// const mv = new window["SVGA"].EgretMovieClip(videoItem)
// mv.visible=false;
// wait(100).then(()=>{
// mv.visible=true;
// })
// mv.gotoAndPlay(1, true)
// if (parent)
// parent.addChild(mv);
// // mv.addEventListener(egret.Event.COMPLETE, () => {
// // mv.stop();
// // callback();
// // }, this);
// resolve(mv);
// }, (error) => {
// reject(error.message);
// })
// });
// }
\ No newline at end of file
egret/src/mapScene/MapScene.ts
View file @
6b930424
...
...
@@ -21,6 +21,7 @@ import CountDown from "./CountDown";
import
AvatarComp
from
"./AvatarComp"
;
import
Utils
from
"../Utils"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
let
doHelpFlag
=
false
;
let
adTag
=
false
;
...
...
@@ -354,8 +355,8 @@ export default class MapScene extends Scene {
avatar
.
start
(
ele
);
parent
.
addChild
(
avatar
);
avatar
.
x
=
item
.
x
+
10
;
avatar
.
y
=
item
.
y
-
avatar
.
height
-
30
;
if
(
!
MapScene
.
starHash
[
level
].
visible
)
{
avatar
.
y
=
item
.
y
-
avatar
.
height
-
30
;
if
(
!
MapScene
.
starHash
[
level
].
visible
)
{
avatar
.
y
=
item
.
y
-
avatar
.
height
;
}
}
...
...
@@ -366,7 +367,7 @@ export default class MapScene extends Scene {
if
(
!
hc_mapRank
)
return
;
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
hc_mapRank
.
forEach
((
ele
)
=>
{
if
(
ele
.
levelNum
==
getHomeData
().
levels
.
length
+
1
)
{
if
(
ele
.
levelNum
==
getHomeData
().
levels
.
length
+
1
)
{
ele
.
rank
[
0
].
avatar
=
data
.
avatar
;
}
this
.
addAvatar
(
ele
.
levelNum
,
ele
.
rank
[
0
]);
...
...
@@ -440,7 +441,7 @@ export default class MapScene extends Scene {
let
flag
=
res
.
data
.
completeFlag
;
switch
(
true
)
{
case
(
flag
==
0
):
// 未完成
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
this
.
loadsvga
(
res
);
break
;
case
(
flag
==
1
):
// 完成未开奖 待领奖 请求领奖接口
try
{
...
...
@@ -466,11 +467,12 @@ export default class MapScene extends Scene {
PanelCtrl
.
instance
.
show
(
'inviteCutTime'
,
res
.
data
);
break
;
case
(
flag
==
4
):
// 可以开启下一次发任务
NetManager
.
ins
.
acceptInvitationInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
this
.
loadsvga
(
res
);
});
break
;
case
(
flag
==
5
):
// 可以开启下一次发任务
...
...
@@ -482,6 +484,26 @@ export default class MapScene extends Scene {
});
}
loadsvga
(
res
)
{
if
(
MapScene
[
'svga'
])
{
const
mv
=
MapScene
[
'svga'
]
mv
.
gotoAndStop
(
1
);
res
.
data
.
svga
=
mv
;
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
return
;
}
Loading
.
instace
.
show
();
loadSvga
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
).
then
(
async
(
mv
:
any
)
=>
{
console
.
log
(
'svga'
,
mv
)
MapScene
[
'svga'
]
=
mv
;
await
wait
(
200
);
Loading
.
instace
.
hide
();
mv
.
gotoAndStop
(
1
);
res
.
data
.
svga
=
mv
;
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
})
}
//////////////////////////////////////// 邀请有礼角标 //////////////////////////////////////////////
/**
* 查询邀请信息
...
...
egret/src/panels/InvitePanel.ts
View file @
6b930424
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
{
iswx
}
from
"../iswx"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
InviteRulePanel
from
"./InviteRulePanel
"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher
"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
iswx
}
from
"../iswx"
;
import
Utils
from
"../Utils"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
changeMapScene
}
from
"../startScene/StartScene"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
{
loadSvga
,
loadSvga2
}
from
"../loadSvga"
;
import
getResPath
from
"../../libs/new_tc/getResPath"
;
import
InviteRulePanel
from
"./InviteRulePanel"
;
import
wait
from
"../../libs/new_tc/wait"
;
export
default
class
InvitePanel
extends
Panel
{
public
prizeImg
:
eui
.
Image
;
...
...
@@ -28,26 +25,35 @@ export default class InvitePanel extends Panel {
this
.
data
=
data
;
}
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
this
.
showlog
();
this
[
'light1'
].
visible
=
this
[
'light2'
].
visible
=
false
;
loadSvga2
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
,
this
[
'con'
],()
=>
{
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
.
gotoAndPlay
(
1
);
},
this
);
}
);
setTimeout
(()
=>
{
this
.
playBgAni
();
},
800
);
},
500
);
// wait(500).then(()=>{
// loadSvga2(
// ,
// );
//
// });
}
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
);
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
()
{
...
...
mock/happyclear/getInviteInfo.json
View file @
6b930424
...
...
@@ -19,7 +19,7 @@
"avatar"
:
null
}
],
"completeFlag"
:
4
,
"completeFlag"
:
0
,
"openPrizeMsg"
:
"图片"
,
"prizeType"
:
"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