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
8b21158f
Commit
8b21158f
authored
Apr 01, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到暂存
parent
6098d066
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
14 deletions
+77
-14
SignSkin.exml
egret/resource/skins/SignSkin.exml
+1
-1
SignItem.ts
egret/src/panels/SignItem.ts
+3
-0
SignPanel.ts
egret/src/panels/SignPanel.ts
+72
-12
doSign.json
mock/sign/doSign.json
+1
-1
No files found.
egret/resource/skins/SignSkin.exml
View file @
8b21158f
...
...
@@ -29,7 +29,7 @@
<e:Rect
id=
"mask1"
fillAlpha=
"0.8"
x=
"0"
y=
"0"
scaleX=
"1"
scaleY=
"1"
width=
"750"
height=
"1206"
/>
<e:Group
id=
"lightbot"
width=
"750"
height=
"1206"
x=
"0"
y=
"0"
/>
<e:Group
id=
"contmid"
width=
"750"
height=
"1206"
y=
"0"
x=
"0"
>
<e:Image
id=
"prizeimg"
scaleX=
"
1"
scaleY=
"1"
x=
"317"
y=
"545"
source=
"
"
/>
<e:Image
id=
"prizeimg"
scaleX=
"
2"
scaleY=
"2"
y=
"537"
source=
""
x=
"296
"
/>
<e:Image
id=
"prizeimg1"
source=
"turnprize_icon2_png"
scaleX=
"1"
scaleY=
"1"
x=
"317"
y=
"545"
visible=
"false"
/>
<e:Image
id=
"prizeimg2"
source=
"turnprize_icon2_png"
scaleX=
"1"
scaleY=
"1"
x=
"317"
y=
"545"
visible=
"false"
/>
<e:Group
id=
"numsgroup"
anchorOffsetX=
"0"
width=
"188"
anchorOffsetY=
"0"
height=
"62"
x=
"281"
y=
"684"
>
...
...
egret/src/panels/SignItem.ts
View file @
8b21158f
...
...
@@ -9,6 +9,7 @@ export default class SignItem extends eui.ItemRenderer {
this
.
skinName
=
getSkinPath
(
'SignItem'
);
}
prizeimg
:
eui
.
Image
;
dataChanged
()
{
this
[
'object'
].
visible
=
false
;
this
[
'money'
].
visible
=
false
;
...
...
@@ -50,6 +51,8 @@ export default class SignItem extends eui.ItemRenderer {
if
(
this
.
data
.
config
.
nums
<=
0
)
this
[
'amount'
].
text
=
''
;
this
[
this
.
data
.
config
.
type
].
visible
=
true
;
this
.
prizeimg
=
this
[
this
.
data
.
config
.
type
];
if
(
this
.
data
.
config
.
type
==
'quan'
)
this
[
'quan'
].
source
=
this
.
data
.
config
.
imgurl
;
...
...
egret/src/panels/SignPanel.ts
View file @
8b21158f
...
...
@@ -283,7 +283,7 @@ export default class SignPanel extends Panel {
}
this
.
signdata
[
signidx
].
signed
=
true
;
this
.
signdata
[
signidx
].
btn
=
2
;
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
this
.
signdata
);
//
this.list.dataProvider = new eui.ArrayCollection(this.signdata);
// showToast('签到成功!快去闯关吧~');
// PanelCtrl.instance.show('signPrize');
// PanelCtrl.instance.addToShowPanels('signPrize');
...
...
@@ -312,7 +312,12 @@ export default class SignPanel extends Panel {
this
[
"btn1"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
signToday
,
this
);
}
changeShowPrize
(
customInfo
){
movep1
:
egret
.
Point
;
movec1
:
egret
.
Point
;
movep2
:
egret
.
Point
;
moveimg
:
eui
.
Image
;
async
changeShowPrize
(
customInfo
){
this
[
"prizegroup"
].
visible
=
true
;
var
prizeType
=
customInfo
.
prizeType
;
...
...
@@ -320,7 +325,7 @@ export default class SignPanel extends Panel {
var
prizeCount
=
customInfo
.
prizeCount
;
var
itemid
=
customInfo
.
itemId
;
var
propType
=
customInfo
.
propType
;
var
propType
=
-
1
;
console
.
log
(
"签到完成,今日奖励"
,
customInfo
);
//奖品类型,none无奖励, object实物,
// virtual虚拟商品,coupon券,
...
...
@@ -330,9 +335,18 @@ export default class SignPanel extends Panel {
this
[
"prizeimg1"
].
source
=
logo
;
this
[
'numsgroup'
].
visible
=
false
;
}
else
{
if
(
itemid
){
this
[
'prizeimg2'
].
visible
=
true
;
this
[
'prizeimg2'
].
source
=
`http://yun.duiba.com.cn/db_games/
${
window
[
'imgver'
]}
/
${
customInfo
.
itemId
}
.png`
;
if
(
itemid
){
//暂猜测是道具的时候有
if
(
itemid
==
59029
){
propType
=
4
;
}
else
if
(
itemid
==
59030
){
propType
=
3
;
}
else
if
(
itemid
==
59031
){
propType
=
5
;
}
// this['prizeimg2'].visible = true;
// this['prizeimg2'].source = `http://yun.duiba.com.cn/db_games/${window['imgver']}/${customInfo.itemId}.png`;
console
.
log
(
"未处理图片"
,
`http://yun.duiba.com.cn/db_games/
${
window
[
'imgver'
]}
/
${
customInfo
.
itemId
}
.png`
);
}
}
this
[
'nums'
].
text
=
'x'
+
prizeCount
;
...
...
@@ -342,11 +356,11 @@ export default class SignPanel extends Panel {
var
showprizeimg
:
boolean
=
true
;
if
(
prizeType
==
'times'
){
this
[
'prizeimg'
].
source
=
'
hbPrize
_blood_png'
;
}
else
if
(
prizeType
==
'prop'
){
this
[
'prizeimg'
].
source
=
`
hbPrize_
icon
${
propType
}
_png`
;
this
[
'prizeimg'
].
source
=
'
signicon
_blood_png'
;
}
else
if
(
prizeType
==
'prop'
&&
propType
!=-
1
){
this
[
'prizeimg'
].
source
=
`
sign
icon
${
propType
}
_png`
;
}
else
if
(
prizeType
==
'coin'
){
this
[
'prizeimg'
].
source
=
'
hbPrize_money
_png'
;
this
[
'prizeimg'
].
source
=
'
signicon2
_png'
;
}
else
{
showprizeimg
=
false
;
console
.
log
(
"之前应该有处理"
);
...
...
@@ -373,8 +387,54 @@ export default class SignPanel extends Panel {
var
prizeimgy
=
item
[
'prizeimg'
].
y
;
var
wtopos
=
item
.
localToGlobal
(
prizeimgx
,
prizeimgy
);
var
wstpos
=
this
[
'contmid'
].
localToGlobal
(
this
[
'prizeimg'
].
x
,
this
[
'prizeimg'
].
y
);
// egret.Tween.get()
// console.log(item.x);
var
wctrlpos
=
item
.
localToGlobal
(
0
,
item
.
height
);
var
lstpos
=
this
.
globalToLocal
(
wstpos
.
x
,
wstpos
.
y
);
var
ltopos
=
this
.
globalToLocal
(
wtopos
.
x
,
wtopos
.
y
);
var
lctrlpos
=
this
.
globalToLocal
(
wctrlpos
.
x
,
wctrlpos
.
y
);
var
prizeimgtex
=
item
[
'prizeimg'
].
texture
;
this
.
moveimg
=
new
eui
.
Image
();
this
.
moveimg
.
source
=
this
[
'prizeimg'
].
source
;
this
.
addChild
(
this
.
moveimg
);
this
.
moveimg
.
scaleX
=
2
;
this
.
moveimg
.
scaleY
=
2
;
this
.
moveimg
.
x
=
lstpos
.
x
;
this
.
moveimg
.
y
=
lstpos
.
y
;
this
.
movep1
=
new
egret
.
Point
(
lstpos
.
x
,
lstpos
.
y
);
this
.
movec1
=
new
egret
.
Point
(
lctrlpos
.
x
,
lctrlpos
.
y
);
this
.
movep2
=
new
egret
.
Point
(
ltopos
.
x
,
ltopos
.
y
);
await
wait
(
1000
);
this
[
"prizegroup"
].
visible
=
false
;
egret
.
Tween
.
get
(
this
).
to
({
factor
:
1
},
500
).
call
(
this
.
moveOver
,
this
);
}
}
public
get
factor
():
number
{
return
0
;
}
public
set
factor
(
value
:
number
)
{
// console.log("动画移动:\n",this.movep1.x,this.movep1.x,'\n'
// ,this.movep2.x,this.movep2.y,'\n',
// this.movec1.x,this.movec1.y,'\n',
// this.moveimg.x,this.moveimg.y);
//(100,300)锚点坐标
this
.
moveimg
.
x
=
(
1
-
value
)
*
(
1
-
value
)
*
this
.
movep1
.
x
+
2
*
value
*
(
1
-
value
)
*
this
.
movec1
.
x
+
value
*
value
*
this
.
movep2
.
x
;
this
.
moveimg
.
y
=
(
1
-
value
)
*
(
1
-
value
)
*
this
.
movep1
.
y
+
2
*
value
*
(
1
-
value
)
*
this
.
movec1
.
y
+
value
*
value
*
this
.
movep2
.
y
;
var
mscale
=
(
1
-
value
)
*
(
1
-
value
)
*
2
+
2
*
value
*
(
1
-
value
)
*
1.4
+
value
*
value
*
1
;
this
.
moveimg
.
scaleX
=
mscale
;
this
.
moveimg
.
scaleY
=
mscale
;
}
moveOver
(){
this
.
moveimg
.
visible
=
false
;
//添加遮罩特效
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
this
.
signdata
);
}
//本页面专门的按钮动效
}
\ No newline at end of file
mock/sign/doSign.json
View file @
8b21158f
...
...
@@ -5,7 +5,7 @@
"success"
:
true
,
"errorMsg"
:
null
,
"code"
:
""
,
"prizeType"
:
"
coin
"
,
"prizeType"
:
"
times
"
,
"prizeName"
:
"奖品名称"
,
"logo"
:
"http://yun.duiba.com.cn/db_games/activity/game/guideImage/guide2.png"
,
"prizeCount"
:
11
,
...
...
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