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
d68ee068
Commit
d68ee068
authored
Nov 28, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
57adc7c2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
104 additions
and
34 deletions
+104
-34
TaskCenterNoPrizeSkin.exml
egret/resource/skins/TaskCenterNoPrizeSkin.exml
+2
-10
MapScene.ts
egret/src/mapScene/MapScene.ts
+13
-2
TaskCenterIcon.ts
egret/src/mapScene/icon/TaskCenterIcon.ts
+7
-0
TaskCenter.ts
egret/src/panels/TaskCenter/TaskCenter.ts
+6
-3
TaskCenterNoPrize.ts
egret/src/panels/TaskCenter/TaskCenterNoPrize.ts
+41
-16
TaskCenterPrize.ts
egret/src/panels/TaskCenter/TaskCenterPrize.ts
+28
-1
getTaskInfo.json
mock/happyclear/getTaskInfo.json
+5
-0
taskAward.json
mock/happyclear/taskAward.json
+2
-2
No files found.
egret/resource/skins/TaskCenterNoPrizeSkin.exml
View file @
d68ee068
...
...
@@ -14,18 +14,10 @@
<e:Group
id=
"duibaGroup"
horizontalCenter=
"0"
top=
"360"
visible=
"false"
>
<e:Label
text=
"啊哦,奖励擦肩而过…"
y=
"0"
textColor=
"0xf54500"
fontFamily=
"FZY3JW"
size=
"40"
horizontalCenter=
"0"
/>
</e:Group>
<e:Group
id=
"s
hop
Group"
horizontalCenter=
"0"
top=
"360"
>
<e:Label
text=
"继续逛逛店铺
,还可以获得更多奖励哦~"
y=
"20"
fontFamily=
"FZY3JW"
size=
"28"
horizontalCenter=
"0"
x=
"10"
textColor=
"0xfb6300"
/>
<e:Group
id=
"s
uning
Group"
horizontalCenter=
"0"
top=
"360"
>
<e:Label
id=
"suningLabel"
text=
"继续完成任务
,还可以获得更多奖励哦~"
y=
"20"
fontFamily=
"FZY3JW"
size=
"28"
horizontalCenter=
"0"
x=
"10"
textColor=
"0xfb6300"
/>
<e:Label
text=
"换个姿势,再来一次!"
y=
"-40"
textColor=
"0xF54500"
fontFamily=
"FZY3JW"
size=
"46"
horizontalCenter=
"0"
x=
"-30"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
<e:Group
id=
"watchGroup"
horizontalCenter=
"0"
top=
"360"
visible=
"false"
>
<e:Label
text=
"换个姿势,再来一次!"
y=
"-40"
textColor=
"0xF54500"
fontFamily=
"FZY3JW"
size=
"46"
horizontalCenter=
"0"
/>
<e:Label
text=
"继续浏览商品,还可以获得更多奖励哦~"
y=
"20"
fontFamily=
"FZY3JW"
size=
"28"
horizontalCenter=
"0"
x=
"10"
textColor=
"0xfb6300"
/>
</e:Group>
<e:Group
id=
"buyGroup"
horizontalCenter=
"0"
top=
"360"
visible=
"false"
>
<e:Label
text=
"换个姿势,再来一次!"
y=
"-40"
textColor=
"0xF54500"
fontFamily=
"FZY3JW"
size=
"46"
horizontalCenter=
"0"
/>
<e:Label
text=
"继续下单还可以获得更多奖励哦~"
y=
"20"
fontFamily=
"FZY3JW"
size=
"28"
horizontalCenter=
"0"
x=
"10"
textColor=
"0xfb6300"
/>
</e:Group>
<e:Group
id=
"btn"
x=
"196"
y=
"875"
width=
"358"
height=
"113"
>
<e:Button
label=
""
y=
"0"
x=
"0"
>
<e:skinName>
...
...
egret/src/mapScene/MapScene.ts
View file @
d68ee068
...
...
@@ -117,9 +117,13 @@ export default class MapScene extends Scene {
function
hbRainBaseInfo
()
{
return
new
Promise
((
resolve
,
reject
)
=>
NetManager
.
ins
.
hbRainBaseInfo
(()
=>
resolve
()));
}
function
getTaskInfo
()
{
return
new
Promise
((
resolve
,
reject
)
=>
NetManager
.
ins
.
getTaskInfo
(()
=>
resolve
()));
}
return
Promise
.
all
([
hbRainBaseInfo
(),
getTaskInfo
(),
]);
}
...
...
@@ -198,6 +202,15 @@ export default class MapScene extends Scene {
}
}
// 任务中心可领奖强提示
const
taskInfoRes
=
DataManager
.
ins
.
getData
(
NetName
.
GET_TASKINFO
);
if
(
taskInfoRes
&&
taskInfoRes
.
data
&&
taskInfoRes
.
data
.
length
>
0
){
for
(
let
i
=
0
;
i
<
taskInfoRes
.
data
.
length
;
i
++
){
if
(
taskInfoRes
.
data
[
i
].
count
>
0
){
panels
.
push
(
'task'
);
}
}
}
if
(
!
readCache
()
&&
getHomeData
().
levels
.
length
<=
0
)
{
//引导
const
guide
=
new
GuideCon
(()
=>
{
...
...
@@ -803,7 +816,6 @@ export default class MapScene extends Scene {
});
}
// 倒计时
private
inviteCutTimer
()
{
const
timer
=
this
.
convertTime
(
this
.
cutTime
-=
1000
);
...
...
@@ -828,7 +840,6 @@ export default class MapScene extends Scene {
sec
:
Utils
.
prefixInteger
(
sec
,
2
)
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
onTap_friendBtn
()
{
...
...
egret/src/mapScene/icon/TaskCenterIcon.ts
View file @
d68ee068
...
...
@@ -2,6 +2,8 @@ import IconBase from "./IconBase";
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
import
{
getLadderGap
}
from
"../../playScene/utils"
;
import
{
getlogItem
}
from
"../../Main"
;
export
default
class
TaskCenterIcon
extends
IconBase
{
constructor
(
name
:
string
,
group
:
eui
.
Group
,
btn
:
eui
.
Button
,
tipsBg
?:
eui
.
Image
,
tipsLabel
?:
eui
.
Label
)
{
...
...
@@ -12,12 +14,16 @@ export default class TaskCenterIcon extends IconBase {
super
.
start
();
NetManager
.
ins
.
getTaskInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
this
.
visible
=
false
;
return
;
}
const
data
=
res
.
data
;
if
(
!
data
||
data
.
length
<=
0
){
this
.
visible
=
false
;
GDispatcher
.
dispatchEvent
(
'updateTurnTablePosition'
);
}
else
{
this
.
visible
=
true
;
NetManager
.
ins
.
showLog
(
getlogItem
(
62
));
}
});
}
...
...
@@ -28,6 +34,7 @@ export default class TaskCenterIcon extends IconBase {
*/
protected
onTouchBtn
(
e
:
egret
.
TouchEvent
)
{
super
.
onTouchBtn
(
e
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
62
));
PanelCtrl
.
instance
.
show
(
'task'
);
}
...
...
egret/src/panels/TaskCenter/TaskCenter.ts
View file @
d68ee068
...
...
@@ -3,6 +3,7 @@ import getSkinPath from "../../../libs/new_wx/utils/getSkinPath";
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
import
{
getlogItem
}
from
"../../Main"
;
export
default
class
TaskCenter
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
...
...
@@ -99,21 +100,23 @@ class TaskCenterItem extends eui.ItemRenderer {
// 领奖
NetManager
.
ins
.
taskAward
((
success
,
res
)
=>
{
if
(
!
success
)
{
PanelCtrl
.
instance
.
show
(
'taskCenterNoPrize'
,
res
);
PanelCtrl
.
instance
.
show
(
'taskCenterNoPrize'
,
{
prizeData
:
res
,
taskData
:
this
.
data
}
);
return
;
}
if
(
!
res
.
data
.
option
||
res
.
data
.
option
.
categoryType
==
1
)
{
// 无奖励
PanelCtrl
.
instance
.
show
(
'taskCenterNoPrize'
,
res
);
PanelCtrl
.
instance
.
show
(
'taskCenterNoPrize'
,
{
prizeData
:
res
,
taskData
:
this
.
data
}
);
return
;
}
PanelCtrl
.
instance
.
show
(
'taskCenterPrize'
,
res
.
data
);
PanelCtrl
.
instance
.
show
(
'taskCenterPrize'
,
{
prizeData
:
res
,
taskData
:
this
.
data
}
);
},
this
.
data
.
subActivityId
);
},
this
);
}
else
if
(
done
<
limit
)
{
// 未完成
NetManager
.
ins
.
showLog
(
getlogItem
(
63
));
this
.
btnImg
.
source
=
'TaskCenter_'
+
'goTask'
+
'Btn_png'
;
this
.
btnLabel
.
text
=
`
${
appIncompleteText
}
(
${
done
}
/
${
limit
}
)`
;
this
.
btnLabel
.
strokeColor
=
0x1376df
;
this
.
btnGroup
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
63
));
// 跳转任务链接
window
.
open
(
this
.
data
.
appIncompletelink
);
},
this
);
...
...
egret/src/panels/TaskCenter/TaskCenterNoPrize.ts
View file @
d68ee068
import
Panel
from
"../../../libs/new_wx/components/Panel"
;
import
{
addAdComp
}
from
"../BoxPanel"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
getlogItem
}
from
"../../Main"
;
import
getHomeData
from
"../../getHomeData"
;
import
{
changeMapScene
}
from
"../../startScene/StartScene"
;
export
default
class
TaskCenterNoPrize
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
public
duibaGroup
:
eui
.
Group
;
public
shopGroup
:
eui
.
Group
;
public
watchGroup
:
eui
.
Group
;
public
buyGroup
:
eui
.
Group
;
public
suningGroup
:
eui
.
Group
;
public
suningLabel
:
eui
.
Label
;
public
btn
:
eui
.
Group
;
public
btnLabel
:
eui
.
Label
;
// duibaGroup 去闯关
// shopGroup 继续逛店铺
// watchGroup 继续浏览商品
...
...
@@ -20,24 +22,47 @@ export default class TaskCenterNoPrize extends Panel {
start
(
data
)
{
super
.
start
();
console
.
log
(
data
);
//
console.log(data);
switch
(
data
.
code
)
{
case
600063
:
// 当前活动未配置任务奖励
case
600068
:
// 未中奖 有可能是奖品概率小于100%
case
600067
:
// 当前任务未配置奖励
case
600066
:
// 当前任务不能领取奖励 领奖时,传参任务id对应的任务没有剩余领奖次数
break
;
const
prizeData
=
data
.
prizeData
;
const
taskData
=
data
.
taskData
;
// 修改按钮文案
// 修改按钮监听
// 修改提示文案
this
.
btnLabel
.
text
=
(
taskData
.
limit
==
taskData
.
done
)
?
"继续闯关"
:
(
taskData
.
tips
||
'继续完成'
);
this
.
btnLabel
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
taskData
.
limit
==
taskData
.
done
)
{
// 去闯关
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
}
else
{
window
.
open
(
taskData
.
data
.
appIncompletelink
);
}
},
this
);
switch
(
true
)
{
case
(
prizeData
.
code
==
600063
// 当前活动未配置任务奖励
||
prizeData
.
code
==
600068
// 未中奖 有可能是奖品概率小于100%
||
prizeData
.
code
==
600067
// 当前任务未配置奖励
||
prizeData
.
code
==
600066
):
// 当前任务不能领取奖励 领奖时,传参任务id对应的任务没有剩余领奖次数
this
.
duibaGroup
.
visible
=
true
;
break
;
case
600064
:
// 开发者无响应
case
600065
:
// 开发者响应内容异常
case
600070
:
// 开发者请求异常
case
600071
:
// 开发者响应业务处理失败 接口响应status非success或者ok
case
600069
:
// 苏宁风控
case
(
prizeData
.
code
==
600064
// 开发者无响应
||
prizeData
.
code
==
600065
// 开发者响应内容异常
||
prizeData
.
code
==
600070
// 开发者请求异常
||
prizeData
.
code
==
600071
// 开发者响应业务处理失败 接口响应status非success或者ok
||
prizeData
.
code
==
600069
):
// 苏宁风控
this
.
suningGroup
.
visible
=
true
;
break
;
default
:
this
.
duibaGroup
.
visible
=
true
;
break
;
}
...
...
egret/src/panels/TaskCenter/TaskCenterPrize.ts
View file @
d68ee068
import
Panel
from
"../../../libs/new_wx/components/Panel"
;
import
{
addAdComp
}
from
"../BoxPanel"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
{
getlogItem
}
from
"../../Main"
;
import
getHomeData
from
"../../getHomeData"
;
import
{
changeMapScene
}
from
"../../startScene/StartScene"
;
import
{
GDispatcher
}
from
"../../../libs/tc/util/GDispatcher"
;
export
default
class
TaskCenterPrize
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
...
...
@@ -18,7 +23,29 @@ export default class TaskCenterPrize extends Panel {
start
(
data
)
{
super
.
start
();
this
.
updateOption
(
data
.
option
);
// console.log(data);
this
.
updateOption
(
data
.
prizeData
.
data
.
option
);
const
taskData
=
data
.
taskData
;
this
.
btnLabel
.
text
=
(
taskData
.
limit
==
taskData
.
done
)
?
"继续闯关"
:
(
taskData
.
tips
||
'继续完成'
);
if
(
taskData
.
limit
==
taskData
.
done
)
{
NetManager
.
ins
.
showLog
(
getlogItem
(
66
));
}
this
.
btnLabel
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
taskData
.
limit
==
taskData
.
done
)
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
66
));
// 去闯关
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
}
else
{
window
.
open
(
taskData
.
data
.
appIncompletelink
);
}
},
this
);
// 埋点
addAdComp
(
84
,
830
,
this
);
}
...
...
mock/happyclear/getTaskInfo.json
View file @
d68ee068
...
...
@@ -15,6 +15,7 @@
"remark"
:
"正在完成的任务Remark"
,
"status"
:
0
,
"subActivityId"
:
"666"
,
"tips"
:
"去逛逛"
,
"browseSecond"
:
"倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。"
,
"completeLink"
:
"倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。"
,
...
...
@@ -45,6 +46,7 @@
"remark"
:
"可以领奖的任务Remark"
,
"status"
:
0
,
"subActivityId"
:
"777"
,
"tips"
:
"去看看"
,
"browseSecond"
:
"倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。"
,
"completeLink"
:
"倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。"
,
...
...
@@ -75,6 +77,7 @@
"remark"
:
"已完成的任务Remark"
,
"status"
:
0
,
"subActivityId"
:
"888"
,
"tips"
:
"去下单"
,
"browseSecond"
:
"倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。"
,
"completeLink"
:
"倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。"
,
...
...
@@ -105,6 +108,7 @@
"remark"
:
"已完成的任务Remark"
,
"status"
:
0
,
"subActivityId"
:
"888"
,
"tips"
:
"去逛"
,
"browseSecond"
:
"倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。"
,
"completeLink"
:
"倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。"
,
...
...
@@ -135,6 +139,7 @@
"remark"
:
"已完成的任务Remark"
,
"status"
:
0
,
"subActivityId"
:
"888"
,
"tips"
:
"去下逛"
,
"browseSecond"
:
"倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。"
,
"completeLink"
:
"倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。"
,
...
...
mock/happyclear/taskAward.json
View file @
d68ee068
{
"success"
:
tru
e
,
"code"
:
"
0000000000
"
,
"success"
:
fals
e
,
"code"
:
"
600064
"
,
"desc"
:
"OK"
,
"timestamp"
:
1572958024679
,
"data"
:
{
...
...
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