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
9d919a69
Commit
9d919a69
authored
Apr 01, 2020
by
邱旭
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab2.dui88.com/wanghongyuan/xiaoxiaole
into dev
parents
02587b60
6098d066
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
2 deletions
+122
-2
SignSkin.exml
egret/resource/skins/SignSkin.exml
+22
-0
SignPanel.ts
egret/src/panels/SignPanel.ts
+100
-2
No files found.
egret/resource/skins/SignSkin.exml
View file @
9d919a69
...
@@ -25,4 +25,26 @@
...
@@ -25,4 +25,26 @@
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Group
id=
"prizegroup"
width=
"750"
height=
"1206"
x=
"0"
y=
"0"
>
<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=
"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"
>
<e:Label
id=
"nums"
text=
"×8"
size=
"48"
verticalAlign=
"middle"
fontFamily=
"FZY3JW"
textColor=
"0xC17343"
bold=
"true"
y=
"7"
x=
"68"
/>
</e:Group>
</e:Group>
<e:Group
id=
"lightop"
width=
"750"
height=
"1206"
>
</e:Group>
<e:Button
id=
"btn2"
label=
""
horizontalCenter=
"0"
bottom=
"242"
x=
"191"
y=
"861"
scaleX=
"1"
scaleY=
"1"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"signprize_btn_png"
source.down=
"signprize_btn_png"
source.disabled=
"signprize_btn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/src/panels/SignPanel.ts
View file @
9d919a69
...
@@ -8,15 +8,18 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
...
@@ -8,15 +8,18 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import
wait
from
"../../libs/new_tc/wait"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
hortileLayout
}
from
"../layout/hortileLayout"
;
import
Utils
from
"../Utils"
;
import
Utils
from
"../Utils"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
hortileLayout
}
from
"../layout/hortileLayout"
;
export
default
class
SignPanel
extends
Panel
{
export
default
class
SignPanel
extends
Panel
{
list
:
eui
.
List
;
list
:
eui
.
List
;
scroll
:
eui
.
Scroller
;
scroll
:
eui
.
Scroller
;
signidx
:
number
=-
1
;
signidx
:
number
=-
1
;
todayidx
:
number
=
0
;
signdata
:
Array
<
any
>
=
[];
signdata
:
Array
<
any
>
=
[];
showsxbtn
:
boolean
=
false
;
sevenIsGift
:
boolean
=
false
;
async
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
super
.
start
();
...
@@ -26,6 +29,12 @@ export default class SignPanel extends Panel {
...
@@ -26,6 +29,12 @@ export default class SignPanel extends Panel {
if
(
!
signInfoVO
.
todaySigned
)
{
if
(
!
signInfoVO
.
todaySigned
)
{
todayIndex
=
signInfoVO
.
continueDay
;
todayIndex
=
signInfoVO
.
continueDay
;
}
}
this
[
"prizegroup"
].
visible
=
false
;
this
.
once
(
egret
.
TouchEvent
.
ADDED_TO_STAGE
,
()
=>
{
this
[
"mask1"
].
height
=
this
.
stage
.
stageHeight
;
this
[
"mask1"
].
y
=
(
this
[
"prizegroup"
].
height
-
this
[
"mask1"
].
height
)
/
2
;
},
this
);
// this.scroll.viewport.scrollV = todayIndex * 162;
// this.scroll.viewport.scrollV = todayIndex * 162;
// if (todayIndex >= 4) {
// if (todayIndex >= 4) {
...
@@ -88,6 +97,9 @@ export default class SignPanel extends Panel {
...
@@ -88,6 +97,9 @@ export default class SignPanel extends Panel {
console
.
log
(
data
);
console
.
log
(
data
);
};
};
const
list
:
any
[]
=
[{},
{},
{},
{},
{},
{},
{}];
const
list
:
any
[]
=
[{},
{},
{},
{},
{},
{},
{}];
console
.
log
(
"签到数据"
,
configs
);
list
.
forEach
((
ele
,
index
)
=>
{
list
.
forEach
((
ele
,
index
)
=>
{
ele
.
index
=
index
;
ele
.
index
=
index
;
ele
.
config
=
configs
[
index
];
ele
.
config
=
configs
[
index
];
...
@@ -105,6 +117,7 @@ export default class SignPanel extends Panel {
...
@@ -105,6 +117,7 @@ export default class SignPanel extends Panel {
ele
.
btn
=
1
;
ele
.
btn
=
1
;
this
.
signidx
=
index
;
this
.
signidx
=
index
;
}
}
this
.
todayidx
=
index
;
}
else
if
(
index
==
tomorrowIndex
)
{
}
else
if
(
index
==
tomorrowIndex
)
{
ele
.
btn
=
3
;
ele
.
btn
=
3
;
}
else
}
else
...
@@ -112,6 +125,11 @@ export default class SignPanel extends Panel {
...
@@ -112,6 +125,11 @@ export default class SignPanel extends Panel {
});
});
this
.
signdata
=
Utils
.
deepClone
(
list
);
this
.
signdata
=
Utils
.
deepClone
(
list
);
if
(
this
.
signidx
==
6
&&
this
.
sevenIsGift
){
this
.
showsxbtn
=
true
;
}
else
{
this
.
showsxbtn
=
false
;
}
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
list
);
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
list
);
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
useVirtualLayout
=
false
;
...
@@ -136,6 +154,8 @@ export default class SignPanel extends Panel {
...
@@ -136,6 +154,8 @@ export default class SignPanel extends Panel {
// { nums: '0.3元', type: 'quan30' }
// { nums: '0.3元', type: 'quan30' }
private
getConfigs
()
{
private
getConfigs
()
{
let
config
=
DataManager
.
ins
.
getData
(
NetName
.
GET_CONFIG
).
data
;
let
config
=
DataManager
.
ins
.
getData
(
NetName
.
GET_CONFIG
).
data
;
console
.
log
(
"签到原始数据"
,
config
);
let
getSignConfig
=
config
&&
config
.
signConf
;
let
getSignConfig
=
config
&&
config
.
signConf
;
if
(
getSignConfig
&&
getSignConfig
.
sixDaysBeforeOptions
&&
getSignConfig
.
theSeventhDayOptions
)
{
if
(
getSignConfig
&&
getSignConfig
.
sixDaysBeforeOptions
&&
getSignConfig
.
theSeventhDayOptions
)
{
const
{
sixDaysBeforeOptions
,
theSeventhDayOptions
}
=
getSignConfig
;
const
{
sixDaysBeforeOptions
,
theSeventhDayOptions
}
=
getSignConfig
;
...
@@ -146,6 +166,7 @@ export default class SignPanel extends Panel {
...
@@ -146,6 +166,7 @@ export default class SignPanel extends Panel {
result
.
push
(
resultItem
);
result
.
push
(
resultItem
);
});
});
const
notGiftResult
=
this
.
isNotGift
(
theSeventhDayOptions
);
const
notGiftResult
=
this
.
isNotGift
(
theSeventhDayOptions
);
this
.
sevenIsGift
=
!
notGiftResult
;
if
(
notGiftResult
)
{
if
(
notGiftResult
)
{
result
.
push
(
this
.
getResultItem
(
notGiftResult
));
result
.
push
(
this
.
getResultItem
(
notGiftResult
));
}
else
{
}
else
{
...
@@ -186,6 +207,7 @@ export default class SignPanel extends Panel {
...
@@ -186,6 +207,7 @@ export default class SignPanel extends Panel {
isNotGift
(
theSeventhDayOptions
:
any
[])
{
isNotGift
(
theSeventhDayOptions
:
any
[])
{
const
results
=
theSeventhDayOptions
.
filter
(
item
=>
item
.
rate
==
100
);
const
results
=
theSeventhDayOptions
.
filter
(
item
=>
item
.
rate
==
100
);
let
result
;
let
result
;
console
.
log
(
"礼盒检测"
,
result
);
if
(
results
.
length
==
1
)
{
if
(
results
.
length
==
1
)
{
result
=
results
[
0
];
result
=
results
[
0
];
return
result
;
return
result
;
...
@@ -224,6 +246,10 @@ export default class SignPanel extends Panel {
...
@@ -224,6 +246,10 @@ export default class SignPanel extends Panel {
super
.
initEvents
();
super
.
initEvents
();
this
[
"closeBtn"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"closeBtn"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"btn1"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
signToday
,
this
);
this
[
"btn1"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
signToday
,
this
);
this
[
"btn2"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
kaixinshouxia
,
this
);
}
kaixinshouxia
(){
this
[
"prizegroup"
].
visible
=
false
;
}
}
signToday
(){
signToday
(){
if
(
this
.
signidx
!=-
1
){
if
(
this
.
signidx
!=-
1
){
...
@@ -252,6 +278,7 @@ export default class SignPanel extends Panel {
...
@@ -252,6 +278,7 @@ export default class SignPanel extends Panel {
}
else
{
}
else
{
showToast
(
'哎呀,奖励擦肩而过!'
);
showToast
(
'哎呀,奖励擦肩而过!'
);
}
}
this
.
signidx
=
signidx
;
//签到没成功,重签
return
;
return
;
}
}
this
.
signdata
[
signidx
].
signed
=
true
;
this
.
signdata
[
signidx
].
signed
=
true
;
...
@@ -267,10 +294,15 @@ export default class SignPanel extends Panel {
...
@@ -267,10 +294,15 @@ export default class SignPanel extends Panel {
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
});
});
this
.
changeShowPrize
(
customInfo
);
}
else
{
}
else
{
this
.
signidx
=
signidx
;
//签到没成功,重签
showToast
(
'哎呀,奖励擦肩而过!'
);
showToast
(
'哎呀,奖励擦肩而过!'
);
}
}
this
.
hidePanel
();
//
this.hidePanel();
},
window
[
"signActivityId"
]);
},
window
[
"signActivityId"
]);
}
}
}
}
...
@@ -279,4 +311,70 @@ export default class SignPanel extends Panel {
...
@@ -279,4 +311,70 @@ export default class SignPanel extends Panel {
this
[
"closeBtn"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"closeBtn"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"btn1"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
signToday
,
this
);
this
[
"btn1"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
signToday
,
this
);
}
}
changeShowPrize
(
customInfo
){
this
[
"prizegroup"
].
visible
=
true
;
var
prizeType
=
customInfo
.
prizeType
;
var
logo
=
customInfo
.
logo
;
var
prizeCount
=
customInfo
.
prizeCount
;
var
itemid
=
customInfo
.
itemId
;
var
propType
=
customInfo
.
propType
;
console
.
log
(
"签到完成,今日奖励"
,
customInfo
);
//奖品类型,none无奖励, object实物,
// virtual虚拟商品,coupon券,
// 道具prop,元宝coin,体力times,
if
(
logo
&&
prizeType
!=
'times'
&&
prizeType
!=
'coin'
&&
prizeType
!=
'prop'
){
this
[
"prizeimg1"
].
visible
=
true
;
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`
;
}
}
this
[
'nums'
].
text
=
'x'
+
prizeCount
;
// if(prizeType=='prop') {
// this['numsgroup'].y=380.8;
// }
var
showprizeimg
:
boolean
=
true
;
if
(
prizeType
==
'times'
){
this
[
'prizeimg'
].
source
=
'hbPrize_blood_png'
;
}
else
if
(
prizeType
==
'prop'
){
this
[
'prizeimg'
].
source
=
`hbPrize_icon
${
propType
}
_png`
;
}
else
if
(
prizeType
==
'coin'
){
this
[
'prizeimg'
].
source
=
'hbPrize_money_png'
;
}
else
{
showprizeimg
=
false
;
console
.
log
(
"之前应该有处理"
);
}
this
[
'prizeimg'
].
visible
=
showprizeimg
;
if
(
showprizeimg
){
if
(
this
[
"prizeimg1"
].
visible
){
this
[
"prizeimg1"
].
visible
=
false
;
}
if
(
this
[
'prizeimg2'
].
visible
){
this
[
"prizeimg2"
].
visible
=
false
;
}
}
this
[
"btn2"
].
visible
=
this
.
showsxbtn
;
if
(
this
.
showsxbtn
){
//手动关闭
}
else
{
//自动关闭
var
item
=
this
.
list
.
getChildAt
(
this
.
todayidx
);
var
prizeimgx
=
item
[
'prizeimg'
].
x
;
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);
}
}
}
}
\ No newline at end of file
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