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
bb1a1c3c
Commit
bb1a1c3c
authored
Oct 17, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4abe6267
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
12 deletions
+73
-12
exml.json
egret/.wing/exml.json
+3
-0
invitebg2.png
egret/resource/assets/invite/invitebg2.png
+0
-0
default.res.json
egret/resource/default.res.json
+6
-1
InviteSkin.exml
egret/resource/skins/InviteSkin.exml
+6
-1
loadSvga.ts
egret/src/loadSvga.ts
+30
-1
InvitePanel.ts
egret/src/panels/InvitePanel.ts
+28
-9
No files found.
egret/.wing/exml.json
View file @
bb1a1c3c
...
@@ -217,5 +217,8 @@
...
@@ -217,5 +217,8 @@
"value"
:
"http://yun.duiba.com.cn/db_games/fishlogo.png"
"value"
:
"http://yun.duiba.com.cn/db_games/fishlogo.png"
}
}
]
]
},
"16dd8f58b77"
:
{
"bindingDataTestObj"
:
[]
}
}
}
}
\ No newline at end of file
egret/resource/assets/invite/invitebg2.png
0 → 100644
View file @
bb1a1c3c
114 KB
egret/resource/default.res.json
View file @
bb1a1c3c
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
"name"
:
"friend"
"name"
:
"friend"
},
},
{
{
"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,invite_rule_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,invite_rule_bg_png
,invitebg2_png
"
,
"name"
:
"invite"
"name"
:
"invite"
},
},
{
{
...
@@ -2259,6 +2259,11 @@
...
@@ -2259,6 +2259,11 @@
"url"
:
"assets/sharefriendwx.jpg"
,
"url"
:
"assets/sharefriendwx.jpg"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"sharefriendwx_jpg"
"name"
:
"sharefriendwx_jpg"
},
{
"url"
:
"assets/invite/invitebg2.png"
,
"type"
:
"image"
,
"name"
:
"invitebg2_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/skins/InviteSkin.exml
View file @
bb1a1c3c
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"InviteSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
<e:Skin
class=
"InviteSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"45.33"
horizontalCenter=
"0"
source=
"invite_bg_png"
/>
<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
id=
"prizeImg"
y=
"439.33"
horizontalCenter=
"0.5"
source=
""
width=
"510"
height=
"228"
/>
<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:Button
id=
"closeBtn"
label=
""
x=
"605"
y=
"227.33"
>
<e:skinName>
<e:skinName>
...
...
egret/src/loadSvga.ts
View file @
bb1a1c3c
...
@@ -9,7 +9,36 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) =>
...
@@ -9,7 +9,36 @@ export const loadSvga = (url: string, parent?: egret.DisplayObjectContainer) =>
parent
.
addChild
(
mv
);
parent
.
addChild
(
mv
);
mv
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
mv
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
()
=>
{
// console.log("播放完成")
console
.
log
(
"播放完成"
)
},
this
);
resolve
(
mv
);
},
(
error
)
=>
{
reject
(
error
.
message
);
})
});
}
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
);
},
this
);
resolve
(
mv
);
resolve
(
mv
);
...
...
egret/src/panels/InvitePanel.ts
View file @
bb1a1c3c
...
@@ -7,6 +7,8 @@ import Utils from "../Utils";
...
@@ -7,6 +7,8 @@ import Utils from "../Utils";
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
changeMapScene
}
from
"../startScene/StartScene"
;
import
{
changeMapScene
}
from
"../startScene/StartScene"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
{
GDispatcher
}
from
"../../libs/tc/util/GDispatcher"
;
import
{
loadSvga
,
loadSvga2
}
from
"../loadSvga"
;
import
getResPath
from
"../../libs/new_tc/getResPath"
;
export
default
class
InvitePanel
extends
Panel
{
export
default
class
InvitePanel
extends
Panel
{
public
prizeImg
:
eui
.
Image
;
public
prizeImg
:
eui
.
Image
;
...
@@ -29,6 +31,23 @@ export default class InvitePanel extends Panel {
...
@@ -29,6 +31,23 @@ export default class InvitePanel extends Panel {
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
showlog
();
this
.
showlog
();
this
[
'light1'
].
visible
=
this
[
'light2'
].
visible
=
false
;
loadSvga2
(
getResPath
()
+
'resource/assets/svgas/invite.svga'
,
this
[
'con'
],()
=>
{
}
);
setTimeout
(()
=>
{
this
.
playBgAni
();
},
800
);
}
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
()
{
showlog
()
{
...
@@ -68,27 +87,27 @@ export default class InvitePanel extends Panel {
...
@@ -68,27 +87,27 @@ export default class InvitePanel extends Panel {
initUI
()
{
initUI
()
{
this
.
setWXShareTip
();
this
.
setWXShareTip
();
this
.
prizeImg
.
source
=
this
.
data
.
prizeImg
;
this
.
prizeImg
.
source
=
this
.
data
.
prizeImg
;
if
(
!
this
.
data
.
invitationUser
)
{
if
(
!
this
.
data
.
invitationUser
)
{
this
.
data
.
invitationUser
=
[];
this
.
data
.
invitationUser
=
[];
}
}
let
dNum
=
this
.
data
.
invitationCount
-
this
.
data
.
invitationUser
.
length
;
let
dNum
=
this
.
data
.
invitationCount
-
this
.
data
.
invitationUser
.
length
;
this
.
numLabel
.
text
=
`仅差
${
dNum
}
人可获得`
;
this
.
numLabel
.
text
=
`仅差
${
dNum
}
人可获得`
;
for
(
let
i
=
0
;
i
<
dNum
;
i
++
)
{
for
(
let
i
=
0
;
i
<
dNum
;
i
++
)
{
this
.
data
.
invitationUser
.
push
({
this
.
data
.
invitationUser
.
push
({
nickname
:
"nickname"
,
nickname
:
"nickname"
,
avatar
:
this
.
invite_img
,
avatar
:
this
.
invite_img
,
});
});
}
}
for
(
let
i
=
0
;
i
<
this
.
data
.
invitationUser
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
data
.
invitationUser
.
length
;
i
++
)
{
this
.
data
.
invitationUser
[
i
][
'callFun'
]
=
()
=>
{
this
.
data
.
invitationUser
[
i
][
'callFun'
]
=
()
=>
{
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
}
}
let
shareCode
=
res
.
data
;
// 分享码
let
shareCode
=
res
.
data
;
// 分享码
CFG
.
wxShareLink
=
window
[
'h5URL'
]
+
"&shareCode="
+
shareCode
;
// 分享链接
CFG
.
wxShareLink
=
window
[
'h5URL'
]
+
"&shareCode="
+
shareCode
;
// 分享链接
if
(
iswx
())
{
//微信端
if
(
iswx
())
{
//微信端
this
.
wxShareTip
.
visible
=
true
;
this
.
wxShareTip
.
visible
=
true
;
window
[
"invokeWX"
]();
window
[
"invokeWX"
]();
}
else
{
//端内
}
else
{
//端内
...
@@ -103,7 +122,7 @@ export default class InvitePanel extends Panel {
...
@@ -103,7 +122,7 @@ export default class InvitePanel extends Panel {
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
this
.
data
.
invitationUser
);
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
this
.
data
.
invitationUser
);
this
.
cutTime
=
this
.
data
.
endTime
-
this
.
data
.
sysTime
+
5000
;
this
.
cutTime
=
this
.
data
.
endTime
-
this
.
data
.
sysTime
+
5000
;
if
(
this
.
timer
)
{
if
(
this
.
timer
)
{
this
.
timer
.
stop
();
this
.
timer
.
stop
();
}
}
this
.
timer
=
new
egret
.
Timer
(
1000
,
0
);
this
.
timer
=
new
egret
.
Timer
(
1000
,
0
);
...
@@ -114,7 +133,7 @@ export default class InvitePanel extends Panel {
...
@@ -114,7 +133,7 @@ export default class InvitePanel extends Panel {
private
cutTimer
()
{
private
cutTimer
()
{
let
timer
=
this
.
convertTime
(
this
.
cutTime
-=
1000
);
let
timer
=
this
.
convertTime
(
this
.
cutTime
-=
1000
);
if
(
timer
.
hour
===
"00"
if
(
timer
.
hour
===
"00"
&&
timer
.
min
===
"00"
&&
timer
.
min
===
"00"
&&
timer
.
sec
===
"00"
)
{
&&
timer
.
sec
===
"00"
)
{
this
.
timer
.
stop
();
this
.
timer
.
stop
();
...
@@ -174,7 +193,7 @@ class InviteItem extends eui.ItemRenderer {
...
@@ -174,7 +193,7 @@ class InviteItem extends eui.ItemRenderer {
console
.
log
(
this
.
data
);
console
.
log
(
this
.
data
);
this
.
img
.
source
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
this
.
img
.
source
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
this
.
img
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
img
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
this
.
data
.
callFun
)
{
if
(
this
.
data
.
callFun
)
{
this
.
data
.
callFun
();
this
.
data
.
callFun
();
}
}
},
this
);
},
this
);
...
...
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