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
7ad92407
Commit
7ad92407
authored
Oct 25, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
cb6cf2a3
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
75 additions
and
6 deletions
+75
-6
scratch_card_90.png
egret/resource/assets/scratch/scratch_card_90.png
+0
-0
scratch_card_92.png
egret/resource/assets/scratch/scratch_card_92.png
+0
-0
scratch_card_94.png
egret/resource/assets/scratch/scratch_card_94.png
+0
-0
scratch_card_96.png
egret/resource/assets/scratch/scratch_card_96.png
+0
-0
scratch_card_98.png
egret/resource/assets/scratch/scratch_card_98.png
+0
-0
scratch_card_bg.png
egret/resource/assets/scratch/scratch_card_bg.png
+0
-0
scratch_user1.png
egret/resource/assets/scratch/scratch_user1.png
+0
-0
scratch_user2.png
egret/resource/assets/scratch/scratch_user2.png
+0
-0
default.res.json
egret/resource/default.res.json
+41
-1
ScratchPrizeSkin.exml
egret/resource/skins/ScratchPrizeSkin.exml
+1
-1
ScratchSkin.exml
egret/resource/skins/ScratchSkin.exml
+3
-1
ScratchPanel.ts
egret/src/panels/ScratchPanel.ts
+30
-3
No files found.
egret/resource/assets/scratch/scratch_card_90.png
0 → 100644
View file @
7ad92407
19.2 KB
egret/resource/assets/scratch/scratch_card_92.png
0 → 100644
View file @
7ad92407
18 KB
egret/resource/assets/scratch/scratch_card_94.png
0 → 100644
View file @
7ad92407
15.5 KB
egret/resource/assets/scratch/scratch_card_96.png
0 → 100644
View file @
7ad92407
13.8 KB
egret/resource/assets/scratch/scratch_card_98.png
0 → 100644
View file @
7ad92407
12.2 KB
egret/resource/assets/scratch/scratch_card_bg.png
0 → 100644
View file @
7ad92407
18.4 KB
egret/resource/assets/scratch/scratch_user1.png
0 → 100644
View file @
7ad92407
17.2 KB
egret/resource/assets/scratch/scratch_user2.png
0 → 100644
View file @
7ad92407
18.8 KB
egret/resource/default.res.json
View file @
7ad92407
...
@@ -129,7 +129,7 @@
...
@@ -129,7 +129,7 @@
"name"
:
"friendshare"
"name"
:
"friendshare"
},
},
{
{
"keys"
:
"scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png"
,
"keys"
:
"scratch_bg_png,scratch_hongbao_png,scratch_help_png,scratch_progress_bg_png,scratch_wx_tip_png,scratchbg2_png,scratch_invite_png
,scratch_card_92_png,scratch_card_98_png,scratch_card_96_png,scratch_card_bg_png,scratch_card_94_png,scratch_card_90_png,scratch_user2_png,scratch_user1_png
"
,
"name"
:
"scratch"
"name"
:
"scratch"
},
},
{
{
...
@@ -2592,6 +2592,46 @@
...
@@ -2592,6 +2592,46 @@
"url"
:
"assets/back/backbg.png"
,
"url"
:
"assets/back/backbg.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"backbg_png"
"name"
:
"backbg_png"
},
{
"url"
:
"assets/scratch/scratch_card_92.png"
,
"type"
:
"image"
,
"name"
:
"scratch_card_92_png"
},
{
"url"
:
"assets/scratch/scratch_card_98.png"
,
"type"
:
"image"
,
"name"
:
"scratch_card_98_png"
},
{
"url"
:
"assets/scratch/scratch_card_96.png"
,
"type"
:
"image"
,
"name"
:
"scratch_card_96_png"
},
{
"url"
:
"assets/scratch/scratch_card_bg.png"
,
"type"
:
"image"
,
"name"
:
"scratch_card_bg_png"
},
{
"url"
:
"assets/scratch/scratch_card_94.png"
,
"type"
:
"image"
,
"name"
:
"scratch_card_94_png"
},
{
"url"
:
"assets/scratch/scratch_card_90.png"
,
"type"
:
"image"
,
"name"
:
"scratch_card_90_png"
},
{
"url"
:
"assets/scratch/scratch_user2.png"
,
"type"
:
"image"
,
"name"
:
"scratch_user2_png"
},
{
"url"
:
"assets/scratch/scratch_user1.png"
,
"type"
:
"image"
,
"name"
:
"scratch_user1_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/skins/ScratchPrizeSkin.exml
View file @
7ad92407
egret/resource/skins/ScratchSkin.exml
View file @
7ad92407
...
@@ -7,7 +7,9 @@
...
@@ -7,7 +7,9 @@
<e:Image
y=
"259.33"
source=
"scratch_bg_png"
horizontalCenter=
"0"
/>
<e:Image
y=
"259.33"
source=
"scratch_bg_png"
horizontalCenter=
"0"
/>
<e:Group
id=
"con"
y=
"-67"
/>
<e:Group
id=
"con"
y=
"-67"
/>
<e:Label
id=
"numLabel"
text=
"共2位好友帮你刮了90.3%"
y=
"381.33"
textColor=
"0xF54500"
size=
"28"
horizontalCenter=
"0"
fontFamily=
"Lucida Family"
verticalAlign=
"middle"
textAlign=
"center"
/>
<e:Label
id=
"numLabel"
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:Image
y=
"414"
horizontalCenter=
"0"
source=
"scratch_card_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"435"
source=
""
width=
"510"
height=
"228"
horizontalCenter=
"0"
/>
<e:Image
id=
"scratch_progress"
y=
"414"
horizontalCenter=
"0"
x=
"10"
source=
"scratch_card_90_png"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"605"
y=
"219.33"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"605"
y=
"219.33"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Skin
states=
"up,down,disabled"
xmlns:w=
"http://ns.egret.com/wing"
>
...
...
egret/src/panels/ScratchPanel.ts
View file @
7ad92407
...
@@ -8,7 +8,6 @@ import ScratchRulePanel from "./ScratchRulePanel";
...
@@ -8,7 +8,6 @@ import ScratchRulePanel from "./ScratchRulePanel";
import
CutTimer
from
"../CutTimer"
;
import
CutTimer
from
"../CutTimer"
;
export
default
class
ScratchPanel
extends
Panel
{
export
default
class
ScratchPanel
extends
Panel
{
private
invite_img
:
egret
.
Texture
;
private
cutTimer
:
CutTimer
;
private
cutTimer
:
CutTimer
;
constructor
(
data
)
{
constructor
(
data
)
{
...
@@ -89,13 +88,23 @@ export default class ScratchPanel extends Panel {
...
@@ -89,13 +88,23 @@ export default class ScratchPanel extends Panel {
this
.
data
.
invitationUser
=
[];
this
.
data
.
invitationUser
=
[];
}
}
// 添加邀请图标
let
dNum
=
this
.
data
.
invitationCount
-
this
.
data
.
invitationUser
.
length
;
let
dNum
=
this
.
data
.
invitationCount
-
this
.
data
.
invitationUser
.
length
;
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
:
"scratch_invite_png"
,
});
});
}
}
// 添加假用户
this
.
data
.
invitationUser
.
unshift
({
nickname
:
"nickname"
,
avatar
:
"scratch_user1_png"
,
},
{
nickname
:
"nickname"
,
avatar
:
"scratch_user2_png"
,
});
// 添加回调函数
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
)
=>
{
...
@@ -148,6 +157,25 @@ export default class ScratchPanel extends Panel {
...
@@ -148,6 +157,25 @@ export default class ScratchPanel extends Panel {
let
dProgress
=
Math
.
abs
(
progress
-
this
[
"progress"
].
width
/
this
[
"progressBg"
].
width
);
// 比当前进度的差值的绝对值
let
dProgress
=
Math
.
abs
(
progress
-
this
[
"progress"
].
width
/
this
[
"progressBg"
].
width
);
// 比当前进度的差值的绝对值
let
_duration
=
1000
*
dProgress
/
100
;
// 算出变化的时间
let
_duration
=
1000
*
dProgress
/
100
;
// 算出变化的时间
egret
.
Tween
.
get
(
this
[
"progress"
]).
to
({
width
:
_width
},
_duration
);
egret
.
Tween
.
get
(
this
[
"progress"
]).
to
({
width
:
_width
},
_duration
);
let
i
=
new
eui
.
Image
();
if
(
progress
>=
100
){
this
[
"scratch_progress"
].
visible
=
false
;
}
else
if
(
progress
>=
98
&&
progress
<
100
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_98_png"
;
}
else
if
(
progress
>=
96
&&
progress
<
98
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_96_png"
;
}
else
if
(
progress
>=
94
&&
progress
<
96
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_94_png"
;
}
else
if
(
progress
>=
92
&&
progress
<
96
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_92_png"
;
}
else
if
(
progress
<
92
){
this
[
"scratch_progress"
].
visible
=
true
;
this
[
"scratch_progress"
].
source
=
"scratch_card_90_png"
;
}
}
}
private
setWXShareTip
()
{
private
setWXShareTip
()
{
...
@@ -177,7 +205,6 @@ export default class ScratchPanel extends Panel {
...
@@ -177,7 +205,6 @@ export default class ScratchPanel extends Panel {
}
}
private
async
getGameRes
()
{
private
async
getGameRes
()
{
this
.
invite_img
=
await
RES
.
getResAsync
(
"scratch_invite_png"
);
}
}
get
skinKey
()
{
get
skinKey
()
{
...
...
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