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
1910cf58
Commit
1910cf58
authored
Mar 06, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feather-sign' into dev
parents
4bb5a534
831a6ee4
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
438 additions
and
72 deletions
+438
-72
MainBase.ts
egret/libs/new_wx/MainBase.ts
+26
-0
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+15
-0
SignItemSkin.exml
egret/resource/skins/SignItemSkin.exml
+1
-1
MapScene.ts
egret/src/mapScene/MapScene.ts
+46
-17
getAdBtn.ts
egret/src/mapScene/getAdBtn.ts
+10
-0
getIconGroup.ts
egret/src/mapScene/getIconGroup.ts
+21
-0
getInviteBtn.ts
egret/src/mapScene/getInviteBtn.ts
+12
-0
getSignBtn.ts
egret/src/mapScene/getSignBtn.ts
+9
-0
SignItem.ts
egret/src/panels/SignItem.ts
+37
-36
SignPanel.ts
egret/src/panels/SignPanel.ts
+101
-18
config.js
mock/config.js
+3
-0
getSignConfig.json
mock/happyclear/getSignConfig.json
+157
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
1910cf58
...
@@ -478,6 +478,21 @@ export default class MainBase extends eui.UILayer {
...
@@ -478,6 +478,21 @@ export default class MainBase extends eui.UILayer {
})
})
}
}
getInviteInfo
()
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
getInviteInfo
(()
=>
{
r
();
})
});
}
getSignConfig
()
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
getSignConfig
(()
=>
{
r
();
})
});
}
getAd
()
{
getAd
()
{
return
new
Promise
((
r
)
=>
{
return
new
Promise
((
r
)
=>
{
...
@@ -510,6 +525,14 @@ export default class MainBase extends eui.UILayer {
...
@@ -510,6 +525,14 @@ export default class MainBase extends eui.UILayer {
});
});
}
}
hbRainBaseInfo
()
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
hbRainBaseInfo
(
async
()
=>
{
r
();
});
});
}
hcHome
()
{
hcHome
()
{
return
new
Promise
((
r
)
=>
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
...
@@ -536,6 +559,9 @@ export default class MainBase extends eui.UILayer {
...
@@ -536,6 +559,9 @@ export default class MainBase extends eui.UILayer {
this
.
hc_userInfo
(),
this
.
hc_userInfo
(),
this
.
getBackReward
(),
this
.
getBackReward
(),
this
.
hcRedBoobBaseInfo
(),
this
.
hcRedBoobBaseInfo
(),
this
.
getSignConfig
(),
this
.
getInviteInfo
(),
this
.
hbRainBaseInfo
(),
]);
]);
//获取分享加体力的shareCode,不影响初始化场景,不进await
//获取分享加体力的shareCode,不影响初始化场景,不进await
NetManager
.
ins
.
getUserShareCode
(()
=>
{
})
NetManager
.
ins
.
getUserShareCode
(()
=>
{
})
...
...
egret/libs/tw/manager/NetManager.ts
View file @
1910cf58
...
@@ -2210,6 +2210,21 @@ export class NetManager extends ABNetManager {
...
@@ -2210,6 +2210,21 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
getSignConfig
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
name
:
'getSignConfig'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/happyclear/getSignConfig'
,
type
:
'get'
,
dataType
:
'json'
,
hideMsg
:
true
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
},
callback
:
callback
};
this
.
send
(
net
);
}
/**
/**
* 获取邀请码
* 获取邀请码
* @param callback
* @param callback
...
...
egret/resource/skins/SignItemSkin.exml
View file @
1910cf58
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<e:Image
id=
"steps"
source=
"signicon5_png"
x=
"104"
y=
"57"
visible=
"false"
/>
<e:Image
id=
"steps"
source=
"signicon5_png"
x=
"104"
y=
"57"
visible=
"false"
/>
<e:Image
id=
"blood"
x=
"98.04"
y=
"60.35"
source=
"signicon_blood_png"
visible=
"false"
/>
<e:Image
id=
"blood"
x=
"98.04"
y=
"60.35"
source=
"signicon_blood_png"
visible=
"false"
/>
<e:Image
id=
"random"
x=
"98.73"
y=
"50.4"
source=
"signicon6_png"
visible=
"false"
/>
<e:Image
id=
"random"
x=
"98.73"
y=
"50.4"
source=
"signicon6_png"
visible=
"false"
/>
<e:Image
id=
"quan
15"
x=
"95.42"
y=
"56.76"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan15_png"
visible=
"false
"
/>
<e:Image
id=
"quan
"
x=
"95.42"
y=
"53.76"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
""
width=
"76
"
/>
<e:Image
id=
"quan10"
x=
"95"
y=
"56"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan10_png"
visible=
"false"
/>
<e:Image
id=
"quan10"
x=
"95"
y=
"56"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan10_png"
visible=
"false"
/>
<e:Image
id=
"quan23"
x=
"95"
y=
"56"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan23_png"
visible=
"false"
/>
<e:Image
id=
"quan23"
x=
"95"
y=
"56"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan23_png"
visible=
"false"
/>
<e:Image
id=
"quan36"
x=
"95"
y=
"56"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan36_png"
visible=
"false"
/>
<e:Image
id=
"quan36"
x=
"95"
y=
"56"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
height=
"79.34"
source=
"sign_quan36_png"
visible=
"false"
/>
...
...
egret/src/mapScene/MapScene.ts
View file @
1910cf58
...
@@ -33,6 +33,10 @@ import TaskCenterIcon from "./icon/TaskCenterIcon";
...
@@ -33,6 +33,10 @@ import TaskCenterIcon from "./icon/TaskCenterIcon";
import
HbBombIcon
from
"./icon/HbBombIcon"
;
import
HbBombIcon
from
"./icon/HbBombIcon"
;
import
{
createEffect1MovieClip
}
from
"../effect/createEffect1"
;
import
{
createEffect1MovieClip
}
from
"../effect/createEffect1"
;
import
{
CodeChannels
}
from
"../panels/ShareCodePanel"
;
import
{
CodeChannels
}
from
"../panels/ShareCodePanel"
;
import
getIconGroup
from
"./getIconGroup"
;
import
getSignBtn
from
"./getSignBtn"
;
import
getAdBtn
from
"./getAdBtn"
;
import
getInviteBtn
from
"./getInviteBtn"
;
let
doHelpFlag
=
false
;
let
doHelpFlag
=
false
;
// let doScratchHelpFlag = false;
// let doScratchHelpFlag = false;
...
@@ -179,10 +183,12 @@ export default class MapScene extends Scene {
...
@@ -179,10 +183,12 @@ export default class MapScene extends Scene {
this
.
sendInvite
();
this
.
sendInvite
();
this
.
hcRedBoobBaseInfo
();
this
.
hcRedBoobBaseInfo
();
this
.
updateSignBtn
();
this
.
updateMyInfo
();
this
.
updateMyInfo
();
this
.
updateAdData
();
this
.
updateAdData
();
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
// 查询邀请信息,控制邀请有礼角标
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
// 查询邀请信息,控制邀请有礼角标
this
.
updateIconLayout
();
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
if
(
getBgOn
()
&&
MapScene
[
'firstPlayBgTag'
]
==
true
)
{
if
(
getBgOn
()
&&
MapScene
[
'firstPlayBgTag'
]
==
true
)
{
...
@@ -804,6 +810,7 @@ export default class MapScene extends Scene {
...
@@ -804,6 +810,7 @@ export default class MapScene extends Scene {
if
(
!
success
||
!
res
.
data
)
{
if
(
!
success
||
!
res
.
data
)
{
return
;
return
;
}
}
const
flag
=
res
.
data
.
completeFlag
;
const
flag
=
res
.
data
.
completeFlag
;
switch
(
true
)
{
switch
(
true
)
{
case
(
flag
==
0
):
// 未完成
case
(
flag
==
0
):
// 未完成
...
@@ -871,7 +878,19 @@ export default class MapScene extends Scene {
...
@@ -871,7 +878,19 @@ export default class MapScene extends Scene {
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
PanelCtrl
.
instance
.
show
(
'invite'
,
res
.
data
);
})
})
}
}
//1234变化的情况
updateIconLayout
()
{
const
btnList
=
[];
if
(
getSignBtn
())
btnList
.
push
(
'signGroup'
);
if
(
getInviteBtn
())
btnList
.
push
(
'inviteGroup'
);
if
(
getAdBtn
())
btnList
.
push
(
'adBtn'
);
if
(
getIconGroup
())
btnList
.
push
(
'activitys'
);
//0不显示,否则显示
btnList
.
forEach
((
btnName
,
index
)
=>
{
const
btn
=
this
[
btnName
];
btn
.
y
=
172.57
+
index
*
150
;
});
this
[
'guideInner'
].
y
=
this
[
'activitys'
].
y
-
273
;
}
//////////////////////////////////////// 邀请有礼角标 //////////////////////////////////////////////
//////////////////////////////////////// 邀请有礼角标 //////////////////////////////////////////////
/**
/**
* 查询邀请信息
* 查询邀请信息
...
@@ -884,6 +903,7 @@ export default class MapScene extends Scene {
...
@@ -884,6 +903,7 @@ export default class MapScene extends Scene {
if
(
!
success
||
!
res
.
data
)
{
if
(
!
success
||
!
res
.
data
)
{
return
;
return
;
}
}
this
.
updateIconLayout
();
const
flag
=
res
.
data
.
completeFlag
;
const
flag
=
res
.
data
.
completeFlag
;
if
(
this
.
inviteTimer
)
{
if
(
this
.
inviteTimer
)
{
this
.
inviteTimer
.
stop
();
this
.
inviteTimer
.
stop
();
...
@@ -893,8 +913,8 @@ export default class MapScene extends Scene {
...
@@ -893,8 +913,8 @@ export default class MapScene extends Scene {
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
this
[
'activitys'
].
y
=
458
;
//
this['activitys'].y = 458;
this
[
'guideInner'
].
y
=
185
;
//
this['guideInner'].y = 185;
}
}
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
this
[
"inviteTipsBg"
].
visible
=
true
;
this
[
"inviteTipsBg"
].
visible
=
true
;
...
@@ -910,8 +930,8 @@ export default class MapScene extends Scene {
...
@@ -910,8 +930,8 @@ export default class MapScene extends Scene {
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
this
[
'activitys'
].
y
=
458
;
//
this['activitys'].y = 458;
this
[
'guideInner'
].
y
=
185
;
//
this['guideInner'].y = 185;
}
}
this
[
"inviteTipsBg"
].
visible
=
true
;
this
[
"inviteTipsBg"
].
visible
=
true
;
this
[
"inviteTips"
].
visible
=
true
;
this
[
"inviteTips"
].
visible
=
true
;
...
@@ -922,8 +942,8 @@ export default class MapScene extends Scene {
...
@@ -922,8 +942,8 @@ export default class MapScene extends Scene {
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
this
[
'activitys'
].
y
=
458
;
//
this['activitys'].y = 458;
this
[
'guideInner'
].
y
=
185
;
//
this['guideInner'].y = 185;
}
}
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
this
[
"inviteTipsBg"
].
visible
=
false
;
this
[
"inviteTipsBg"
].
visible
=
false
;
...
@@ -933,8 +953,8 @@ export default class MapScene extends Scene {
...
@@ -933,8 +953,8 @@ export default class MapScene extends Scene {
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
this
[
'activitys'
].
y
=
458
;
//
this['activitys'].y = 458;
this
[
'guideInner'
].
y
=
185
;
//
this['guideInner'].y = 185;
}
}
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
this
[
"inviteTipsBg"
].
visible
=
true
;
this
[
"inviteTipsBg"
].
visible
=
true
;
...
@@ -945,8 +965,8 @@ export default class MapScene extends Scene {
...
@@ -945,8 +965,8 @@ export default class MapScene extends Scene {
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
visible
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
this
[
"inviteGroup"
].
touchEnabled
=
true
;
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
if
(
!
mapAdvert
||
mapAdvert
.
enable
==
false
)
{
this
[
'activitys'
].
y
=
458
;
//
this['activitys'].y = 458;
this
[
'guideInner'
].
y
=
185
;
//
this['guideInner'].y = 185;
}
}
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
NetManager
.
ins
.
showLog
(
getlogItem
(
33
));
this
[
"inviteTipsBg"
].
visible
=
false
;
this
[
"inviteTipsBg"
].
visible
=
false
;
...
@@ -955,13 +975,13 @@ export default class MapScene extends Scene {
...
@@ -955,13 +975,13 @@ export default class MapScene extends Scene {
case
(
flag
==
6
):
// 无入口
case
(
flag
==
6
):
// 无入口
this
[
"inviteGroup"
].
visible
=
false
;
this
[
"inviteGroup"
].
visible
=
false
;
this
[
"inviteGroup"
].
touchEnabled
=
false
;
this
[
"inviteGroup"
].
touchEnabled
=
false
;
this
[
'adBtn'
].
y
=
323.76
;
//
this['adBtn'].y = 323.76;
if
(
mapAdvert
&&
mapAdvert
.
enable
)
{
if
(
mapAdvert
&&
mapAdvert
.
enable
)
{
this
[
'guideInner'
].
y
=
185
;
//
this['guideInner'].y = 185;
this
[
'activitys'
].
y
=
458
;
//
this['activitys'].y = 458;
}
else
{
}
else
{
this
[
'guideInner'
].
y
=
30
;
//
this['guideInner'].y = 30;
this
[
'activitys'
].
y
=
303.76
;
//
this['activitys'].y = 303.76;
}
}
break
;
break
;
default
:
default
:
...
@@ -1237,6 +1257,15 @@ export default class MapScene extends Scene {
...
@@ -1237,6 +1257,15 @@ export default class MapScene extends Scene {
});
});
})
})
}
}
updateSignBtn
()
{
this
[
'signGroup'
].
visible
=
false
;
const
getSignConfig
=
DataManager
.
ins
.
getData
(
'getSignConfig'
);
if
(
getSignConfig
&&
getSignConfig
.
data
&&
getSignConfig
.
data
.
closeStatus
)
{
this
[
'signGroup'
].
visible
=
true
;
}
}
}
}
export
const
getNick
=
(
nickname
,
max
=
4
)
=>
{
export
const
getNick
=
(
nickname
,
max
=
4
)
=>
{
if
(
!
nickname
)
return
nickname
;
if
(
!
nickname
)
return
nickname
;
...
...
egret/src/mapScene/getAdBtn.ts
0 → 100644
View file @
1910cf58
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
()
=>
{
const
hc_advert
:
any
=
DataManager
.
ins
.
getData
(
'hc_advert'
).
data
||
{};
let
{
mapAdvert
}
=
hc_advert
;
if
(
mapAdvert
==
null
)
mapAdvert
=
{
enable
:
false
,
advertList
:
[]
}
return
mapAdvert
.
enable
;
}
egret/src/mapScene/getIconGroup.ts
0 → 100644
View file @
1910cf58
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
export
default
()
=>
{
let
count
=
0
;
let
hc_redBombBaseInfo
=
DataManager
.
ins
.
getData
(
'hc_redBombBaseInfo'
);
if
(
hc_redBombBaseInfo
.
success
&&
hc_redBombBaseInfo
.
data
)
{
count
++
;
}
let
hbrain
=
DataManager
.
ins
.
getData
(
NetName
.
HBRAIN_BASEINFO
);
if
(
hbrain
.
success
&&
hbrain
.
data
)
{
const
data
=
hbrain
.
data
if
(
data
.
currentSession
)
{
count
++
;
}
else
if
(
data
.
nextSession
)
{
count
++
;
}
}
return
count
;
}
\ No newline at end of file
egret/src/mapScene/getInviteBtn.ts
0 → 100644
View file @
1910cf58
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
()
=>
{
const
inviteInfo
=
DataManager
.
ins
.
getData
(
NetName
.
GET_INVATE_INFO
);
if
(
inviteInfo
&&
inviteInfo
.
success
&&
inviteInfo
.
data
)
{
const
flag
=
inviteInfo
.
data
.
completeFlag
;
if
(
flag
>=
0
&&
flag
<=
5
)
return
1
if
(
flag
==
6
)
return
0
;
}
return
0
;
}
egret/src/mapScene/getSignBtn.ts
0 → 100644
View file @
1910cf58
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../libs/tw/enum/NetName"
;
export
default
()
=>
{
const
getSignConfig
=
DataManager
.
ins
.
getData
(
'getSignConfig'
);
if
(
getSignConfig
&&
getSignConfig
.
data
)
return
getSignConfig
.
data
.
closeStatus
;
return
false
;
}
\ No newline at end of file
egret/src/panels/SignItem.ts
View file @
1910cf58
...
@@ -9,51 +9,52 @@ export default class SignItem extends eui.ItemRenderer {
...
@@ -9,51 +9,52 @@ export default class SignItem extends eui.ItemRenderer {
this
.
skinName
=
getSkinPath
(
'SignItem'
);
this
.
skinName
=
getSkinPath
(
'SignItem'
);
}
}
dataChanged
(){
dataChanged
()
{
this
[
'object'
].
visible
=
false
;
this
[
'object'
].
visible
=
false
;
this
[
'money'
].
visible
=
false
;
this
[
'money'
].
visible
=
false
;
this
[
'hammer'
].
visible
=
false
;
this
[
'hammer'
].
visible
=
false
;
this
[
'boom'
].
visible
=
false
;
this
[
'boom'
].
visible
=
false
;
this
[
'steps'
].
visible
=
false
;
this
[
'steps'
].
visible
=
false
;
this
[
'blood'
].
visible
=
false
;
this
[
'blood'
].
visible
=
false
;
this
[
'random'
].
visible
=
false
;
this
[
'random'
].
visible
=
false
;
this
[
'quan15'
].
visible
=
false
;
this
[
'quan58'
].
visible
=
false
;
this
[
'quan38'
].
visible
=
false
;
this
[
'btn1'
].
visible
=
false
;
this
[
'btn2'
].
visible
=
false
;
this
[
'btn1'
].
visible
=
false
;
this
[
'btn3'
].
visible
=
false
;
this
[
'btn2'
].
visible
=
false
;
this
[
'btn4'
].
visible
=
false
;
this
[
'btn3'
].
visible
=
false
;
this
[
'btn4'
].
visible
=
false
;
this
[
'line1'
].
visible
=
this
.
data
.
index
!=
6
;
this
[
'line2'
].
visible
=
!
this
[
'line1'
].
visible
;
this
[
'line1'
].
visible
=
this
.
data
.
index
!=
6
;
this
[
'light'
].
visible
=
this
.
data
.
signed
;
this
[
'line2'
].
visible
=!
this
[
'line1'
].
visible
;
this
[
'title'
].
text
=
`连续签到
${
this
.
data
.
index
+
1
}
天`
;
this
[
'light'
].
visible
=
this
.
data
.
signed
;
this
[
'title'
].
text
=
`连续签到
${
this
.
data
.
index
+
1
}
天`
;
this
[
'amount'
].
text
=
this
.
data
.
config
.
nums
;
this
[
'amount'
].
text
=
this
.
data
.
config
.
nums
;
if
(
this
.
data
.
config
.
nums
<=
0
)
if
(
this
.
data
.
config
.
nums
<=
0
)
this
[
'amount'
].
text
=
''
;
this
[
'amount'
].
text
=
''
;
this
[
this
.
data
.
config
.
type
].
visible
=
true
;
this
[
this
.
data
.
config
.
type
].
visible
=
true
;
this
[
'btn'
+
this
.
data
.
btn
].
visible
=
true
;
if
(
this
.
data
.
config
.
type
==
'quan'
)
if
(
this
.
data
.
btn
==
1
)
{
this
[
'quan'
].
source
=
this
.
data
.
config
.
imgurl
;
this
[
'btn'
+
this
.
data
.
btn
].
visible
=
true
;
if
(
this
.
data
.
btn
==
1
)
{
NetManager
.
ins
.
showLog
(
getlogItem
(
22
));
NetManager
.
ins
.
showLog
(
getlogItem
(
22
));
}
}
console
.
log
(
this
.
data
);
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
);
}
}
setSinged
(){
setSinged
()
{
this
[
'btn1'
].
visible
=
false
;
this
[
'btn1'
].
visible
=
false
;
this
[
'btn2'
].
visible
=
false
;
this
[
'btn2'
].
visible
=
false
;
this
[
'btn3'
].
visible
=
false
;
this
[
'btn3'
].
visible
=
false
;
this
[
'btn4'
].
visible
=
false
;
this
[
'btn4'
].
visible
=
false
;
this
[
'light'
].
visible
=
true
;
this
[
'light'
].
visible
=
true
;
this
[
'btn2'
].
visible
=
true
;
this
[
'btn2'
].
visible
=
true
;
}
}
}
}
\ No newline at end of file
egret/src/panels/SignPanel.ts
View file @
1910cf58
...
@@ -24,36 +24,36 @@ export default class SignPanel extends Panel {
...
@@ -24,36 +24,36 @@ export default class SignPanel extends Panel {
}
}
this
.
scroll
.
viewport
.
scrollV
=
todayIndex
*
162
;
this
.
scroll
.
viewport
.
scrollV
=
todayIndex
*
162
;
if
(
todayIndex
>=
4
)
{
if
(
todayIndex
>=
4
)
{
this
.
scroll
.
viewport
.
scrollV
=
4
*
162
;
this
.
scroll
.
viewport
.
scrollV
=
4
*
162
;
}
}
const
tomorrowIndex
=
todayIndex
+
1
;
const
tomorrowIndex
=
todayIndex
+
1
;
this
.
list
.
itemRenderer
=
SignItem
;
this
.
list
.
itemRenderer
=
SignItem
;
const
configs
=
window
[
'signconfigs'
]
;
const
configs
=
this
.
getConfigs
()
;
const
func
=
(
data
,
item
:
SignItem
)
=>
{
const
func
=
(
data
,
item
:
SignItem
)
=>
{
try
{
try
{
if
(
window
[
'getRST'
])
window
[
'getRST'
]();
if
(
window
[
'getRST'
])
window
[
'getRST'
]();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
warn
(
error
)
console
.
warn
(
error
)
}
}
item
[
'btn1'
].
enabled
=
false
;
item
[
'btn1'
].
enabled
=
false
;
NetManager
.
ins
.
doSign
((
s
)
=>
{
NetManager
.
ins
.
doSign
((
s
)
=>
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
22
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
22
));
item
[
'btn1'
].
enabled
=
true
;
item
[
'btn1'
].
enabled
=
true
;
wait
(
300
).
then
(()
=>
{
wait
(
300
).
then
(()
=>
{
NetManager
.
ins
.
getSignInfo
(()
=>
{
NetManager
.
ins
.
getSignInfo
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'signActivityId'
]);
},
window
[
'signActivityId'
]);
});
});
if
(
s
)
{
if
(
s
)
{
const
{
customInfo
,
success
}
=
DataManager
.
ins
.
getData
(
'dosign'
);
const
{
customInfo
,
success
}
=
DataManager
.
ins
.
getData
(
'dosign'
);
if
(
!
success
||
!
customInfo
.
success
||
customInfo
.
prizeType
==
'none'
)
{
if
(
!
success
||
!
customInfo
.
success
||
customInfo
.
prizeType
==
'none'
)
{
if
(
customInfo
.
code
==
100004
)
{
if
(
customInfo
.
code
==
100004
)
{
showToast
(
'哎呀,奖励擦肩而过!明天再来试试吧!'
);
showToast
(
'哎呀,奖励擦肩而过!明天再来试试吧!'
);
}
else
{
}
else
{
showToast
(
'哎呀,奖励擦肩而过!'
);
showToast
(
'哎呀,奖励擦肩而过!'
);
}
}
return
;
return
;
...
@@ -63,14 +63,14 @@ export default class SignPanel extends Panel {
...
@@ -63,14 +63,14 @@ export default class SignPanel extends Panel {
// 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
();
SceneCtrl
.
instance
.
updateScene
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
},
window
[
'collectRuleId'
]);
});
});
}
else
{
}
else
{
showToast
(
'哎呀,奖励擦肩而过!'
);
showToast
(
'哎呀,奖励擦肩而过!'
);
}
}
...
@@ -112,6 +112,89 @@ export default class SignPanel extends Panel {
...
@@ -112,6 +112,89 @@ export default class SignPanel extends Panel {
// this.showlog();
// this.showlog();
// this.data.img = DataManager.ins.getData('getPlugOrderStatus').lottery.imgurl;
// this.data.img = DataManager.ins.getData('getPlugOrderStatus').lottery.imgurl;
}
}
// { nums: '10元宝', type: 'money' },
// { nums: '*1', type: 'hammer' },
// { nums: '30元宝', type: 'money' },
// { nums: '*1', type: 'boom' },
// { nums: '50元宝', type: 'money' },
// { nums: '*1', type: 'steps' },
// { nums: '0.3元', type: 'quan30' }
private
getConfigs
()
{
const
getSignConfig
=
DataManager
.
ins
.
getData
(
'getSignConfig'
);
if
(
getSignConfig
&&
getSignConfig
.
data
&&
getSignConfig
.
data
.
sixDaysBeforeOptions
&&
getSignConfig
.
data
.
theSeventhDayOptions
)
{
const
{
sixDaysBeforeOptions
,
theSeventhDayOptions
}
=
getSignConfig
.
data
;
const
result
=
[];
sixDaysBeforeOptions
.
forEach
(
option
=>
{
//todo假设按天数排序
//类型 2 次数,3 道具,4 元宝,5其他
const
resultItem
=
this
.
getResultItem
(
option
);
result
.
push
(
resultItem
);
});
const
notGiftResult
=
this
.
isNotGift
(
theSeventhDayOptions
);
if
(
notGiftResult
)
{
result
.
push
(
this
.
getResultItem
(
notGiftResult
));
}
else
{
result
.
push
({
nums
:
'惊喜礼盒'
,
type
:
'object'
});
}
return
result
;
}
console
.
warn
(
'签到静态配置错误'
)
}
getResultItem
(
option
)
{
const
resultItem
:
any
=
{};
if
(
option
.
categoryType
==
2
)
{
resultItem
.
nums
=
`体力*
${
option
.
num
}
`
resultItem
.
type
=
'blood'
;
}
else
if
(
option
.
categoryType
==
3
)
{
resultItem
.
nums
=
`*1`
;
// resultItem.nums = `*${option.num}`;
resultItem
.
type
=
this
.
getPropType
(
option
.
propType
);
}
else
if
(
option
.
categoryType
==
4
)
{
resultItem
.
type
=
'money'
;
resultItem
.
nums
=
`
${
option
.
maxValue
}
元宝`
;
if
(
option
.
maxValue
!=
option
.
minValue
)
console
.
warn
(
'元宝配置错误'
);
}
else
if
(
option
.
categoryType
>=
5
)
{
resultItem
.
nums
=
`*1`
;
resultItem
.
type
=
'quan'
;
resultItem
.
imgurl
=
option
.
smallImg
;
}
return
resultItem
;
}
isNotGift
(
theSeventhDayOptions
:
any
[])
{
const
results
=
theSeventhDayOptions
.
filter
(
item
=>
item
.
rate
==
100
);
let
result
;
if
(
results
.
length
==
1
)
{
result
=
results
[
0
];
return
result
;
}
else
{
console
.
warn
(
'配置错误'
);
}
return
null
;
}
getPropType
(
type
)
{
const
map
=
{
'1'
:
'hammer'
,
'2'
:
'steps'
,
'3'
:
'boom'
,
}
return
map
[
type
]
}
typeMap
()
{
return
{
'2'
:
'blood'
,
// '3': (type2) => { return propsMap[type2] },
'4'
:
'money'
,
// '5':{}
}
}
// showlog() {
// showlog() {
// NetManager.ins.showLog(getlogItem(17));
// NetManager.ins.showLog(getlogItem(17));
// }
// }
...
...
mock/config.js
View file @
1910cf58
...
@@ -6,6 +6,9 @@ const config = {
...
@@ -6,6 +6,9 @@ const config = {
'/crecord/getrecord'
:
{
'/crecord/getrecord'
:
{
data
:
'./happyclear/getrecord.json'
data
:
'./happyclear/getrecord.json'
},
},
'/customActivity/happyclear/getSignConfig'
:
{
data
:
'./happyclear/getSignConfig.json'
},
'/customActivity/happyclear/hasBackReward'
:
{
'/customActivity/happyclear/hasBackReward'
:
{
data
:
'./happyclear/hasBackReward.json'
data
:
'./happyclear/hasBackReward.json'
},
},
...
...
mock/happyclear/getSignConfig.json
0 → 100644
View file @
1910cf58
{
"success"
:
true
,
"code"
:
"0000000000"
,
"desc"
:
"OK"
,
"timestamp"
:
1583390774876
,
"data"
:
{
"closeStatus"
:
true
,
"sixDaysBeforeOptions"
:
[
{
"id"
:
null
,
"day"
:
1
,
"categoryType"
:
7
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
null
,
"realValue"
:
null
,
"propType"
:
null
,
"num"
:
null
,
"img"
:
"//yun.dui88.com/images/202003/n3exi2tenh.png"
,
"smallImg"
:
"//yun.dui88.com/images/202003/cfay38i1rl.jpg"
,
"appItemId"
:
10361
,
"name"
:
"111"
,
"value"
:
"963"
},
{
"id"
:
null
,
"day"
:
2
,
"categoryType"
:
2
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
null
,
"realValue"
:
null
,
"propType"
:
null
,
"num"
:
2
,
"img"
:
null
,
"smallImg"
:
null
,
"appItemId"
:
null
,
"name"
:
null
,
"value"
:
null
},
{
"id"
:
null
,
"day"
:
3
,
"categoryType"
:
4
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
10
,
"maxValue"
:
10
,
"coinType"
:
1
,
"realValue"
:
null
,
"propType"
:
null
,
"num"
:
null
,
"img"
:
null
,
"smallImg"
:
null
,
"appItemId"
:
null
,
"name"
:
null
,
"value"
:
null
},
{
"id"
:
null
,
"day"
:
4
,
"categoryType"
:
3
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
null
,
"realValue"
:
null
,
"propType"
:
2
,
"num"
:
null
,
"img"
:
null
,
"smallImg"
:
null
,
"appItemId"
:
null
,
"name"
:
null
,
"value"
:
null
},
{
"id"
:
null
,
"day"
:
5
,
"categoryType"
:
4
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
10
,
"maxValue"
:
20
,
"coinType"
:
2
,
"realValue"
:
null
,
"propType"
:
null
,
"num"
:
null
,
"img"
:
null
,
"smallImg"
:
null
,
"appItemId"
:
null
,
"name"
:
null
,
"value"
:
null
},
{
"id"
:
null
,
"day"
:
6
,
"categoryType"
:
3
,
"title"
:
null
,
"rate"
:
null
,
"minValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
null
,
"realValue"
:
null
,
"propType"
:
2
,
"num"
:
null
,
"img"
:
null
,
"smallImg"
:
null
,
"appItemId"
:
null
,
"name"
:
null
,
"value"
:
null
}
],
"theSeventhDayOptions"
:
[
{
"id"
:
""
,
"day"
:
null
,
"categoryType"
:
2
,
"title"
:
"1"
,
"rate"
:
"100"
,
"minValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
null
,
"realValue"
:
null
,
"propType"
:
null
,
"num"
:
1
,
"img"
:
""
,
"smallImg"
:
null
,
"appItemId"
:
null
,
"name"
:
""
,
"value"
:
""
},
{
"id"
:
""
,
"day"
:
null
,
"categoryType"
:
7
,
"title"
:
"1122"
,
"rate"
:
"11"
,
"minValue"
:
null
,
"maxValue"
:
null
,
"coinType"
:
null
,
"realValue"
:
null
,
"propType"
:
null
,
"num"
:
null
,
"img"
:
"//yun.dui88.com/images/202003/cjusviko1v.png"
,
"smallImg"
:
"//yun.dui88.com/images/202003/1fcggjz048.jpg"
,
"appItemId"
:
10000
,
"name"
:
"虚拟"
,
"value"
:
"fe"
}
]
}
}
\ 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