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
02a93b8c
Commit
02a93b8c
authored
Mar 25, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到页面
parent
30f3e802
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
6 deletions
+57
-6
SignItem.ts
egret/src/panels/SignItem.ts
+0
-1
SignPanel.ts
egret/src/panels/SignPanel.ts
+57
-5
No files found.
egret/src/panels/SignItem.ts
View file @
02a93b8c
...
@@ -59,7 +59,6 @@ export default class SignItem extends eui.ItemRenderer {
...
@@ -59,7 +59,6 @@ export default class SignItem extends eui.ItemRenderer {
NetManager
.
ins
.
showLog
(
getlogItem
(
22
));
NetManager
.
ins
.
showLog
(
getlogItem
(
22
));
}
}
console
.
log
(
this
.
data
);
this
[
'btn1'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
[
'btn1'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
data
.
func
(
this
.
data
.
index
,
this
)
this
.
data
.
func
(
this
.
data
.
index
,
this
)
},
this
);
},
this
);
...
...
egret/src/panels/SignPanel.ts
View file @
02a93b8c
...
@@ -9,11 +9,13 @@ import wait from "../../libs/new_tc/wait";
...
@@ -9,11 +9,13 @@ 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
{
hortileLayout
}
from
"../layout/hortileLayout"
;
import
Utils
from
"../Utils"
;
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
;
signdata
:
Array
<
any
>
=
[];
async
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
super
.
start
();
...
@@ -68,7 +70,7 @@ export default class SignPanel extends Panel {
...
@@ -68,7 +70,7 @@ export default class SignPanel extends Panel {
item
.
setSinged
();
item
.
setSinged
();
// showToast('签到成功!快去闯关吧~');
// showToast('签到成功!快去闯关吧~');
// PanelCtrl.instance.show('signPrize');
// PanelCtrl.instance.show('signPrize');
PanelCtrl
.
instance
.
addToShowPanels
(
'signPrize'
);
//
PanelCtrl.instance.addToShowPanels('signPrize');
wait
(
200
).
then
(()
=>
{
wait
(
200
).
then
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
updateMainTimer
();
updateMainTimer
();
...
@@ -107,6 +109,8 @@ export default class SignPanel extends Panel {
...
@@ -107,6 +109,8 @@ export default class SignPanel extends Panel {
}
else
}
else
ele
.
btn
=
4
;
ele
.
btn
=
4
;
});
});
this
.
signdata
=
Utils
.
deepClone
(
list
);
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
list
);
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
list
);
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
useVirtualLayout
=
false
;
...
@@ -217,12 +221,60 @@ export default class SignPanel extends Panel {
...
@@ -217,12 +221,60 @@ export default class SignPanel extends Panel {
initEvents
(){
initEvents
(){
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['close2Btn'].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
);
}
}
signToday
(){
signToday
(){
console
.
log
(
this
.
signidx
);
if
(
this
.
signidx
!=-
1
){
console
.
log
(
this
.
list
);
try
{
if
(
window
[
'getRST'
])
window
[
'getRST'
]();
}
catch
(
error
)
{
console
.
warn
(
error
)
}
this
[
"btn1"
].
enabled
=
false
;
NetManager
.
ins
.
doSign
((
s
)
=>
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
22
));
this
[
"btn1"
].
enabled
=
true
;
var
signidx
=
this
.
signidx
;
this
.
signidx
=
-
1
;
wait
(
300
).
then
(()
=>
{
NetManager
.
ins
.
getSignInfo
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'signActivityId'
]);
});
if
(
s
)
{
const
{
customInfo
,
success
}
=
DataManager
.
ins
.
getData
(
'dosign'
);
if
(
!
success
||
!
customInfo
.
success
||
customInfo
.
prizeType
==
'none'
)
{
if
(
customInfo
.
code
==
100004
)
{
showToast
(
'哎呀,奖励擦肩而过!明天再来试试吧!'
);
}
else
{
showToast
(
'哎呀,奖励擦肩而过!'
);
}
return
;
}
this
.
signdata
[
signidx
].
signed
=
true
;
this
.
signdata
[
signidx
].
btn
=
2
;
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
this
.
signdata
);
// showToast('签到成功!快去闯关吧~');
// PanelCtrl.instance.show('signPrize');
// PanelCtrl.instance.addToShowPanels('signPrize');
wait
(
200
).
then
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
});
}
else
{
showToast
(
'哎呀,奖励擦肩而过!'
);
}
this
.
hidePanel
();
},
window
[
"signActivityId"
]);
}
}
removeEvents
(){
super
.
removeEvents
();
this
[
"closeBtn"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"btn1"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
signToday
,
this
);
}
}
}
}
\ 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