Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
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
翁阳
babycare_xiaoxiao
Commits
3a9c0c89
Commit
3a9c0c89
authored
Jul 20, 2020
by
wjf
Browse files
Options
Browse Files
Download
Plain Diff
l
parents
cb1970a5
3bcda420
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
254 additions
and
160 deletions
+254
-160
workspace.xml
.idea/workspace.xml
+33
-34
babycare.getTaskList.json
mock/miniTb/babycare.getTaskList.json
+9
-9
res.json
resource/res.json
+48
-48
ResJson.ts
src/ResJson.ts
+48
-48
G_EVENT.ts
src/common/G_EVENT.ts
+0
-3
SuccessPrizePanel.ts
src/panels/SuccessPrizePanel.ts
+34
-0
TaskPanel.ts
src/panels/TaskPanel.ts
+75
-11
MapScene.ts
src/scene/map/MapScene.ts
+7
-7
No files found.
.idea/workspace.xml
View file @
3a9c0c89
This diff is collapsed.
Click to expand it.
mock/miniTb/babycare.getTaskList.json
View file @
3a9c0c89
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
"code"
:
"000000"
,
"code"
:
"000000"
,
"data"
:
[
"data"
:
[
{
{
"taskType"
:
"
member
"
,
"taskType"
:
"
browseGoods
"
,
"times"
:
1
,
"times"
:
3
,
"todayCompleteTimes"
:
0
,
"todayCompleteTimes"
:
0
,
"waitReceive"
:
0
,
"waitReceive"
:
0
,
"rewards"
:
65
"value"
:
""
,
"rewards"
:
10
},
},
{
{
"taskType"
:
"invites"
,
"taskType"
:
"invites"
,
...
@@ -25,12 +26,11 @@
...
@@ -25,12 +26,11 @@
"rewards"
:
7
"rewards"
:
7
},
},
{
{
"taskType"
:
"
browseGoods
"
,
"taskType"
:
"
member
"
,
"times"
:
3
,
"times"
:
1
,
"todayCompleteTimes"
:
0
,
"todayCompleteTimes"
:
1
,
"waitReceive"
:
0
,
"waitReceive"
:
0
,
"value"
:
""
,
"rewards"
:
65
"rewards"
:
10
}
}
],
],
"success"
:
true
,
"success"
:
true
,
...
...
resource/res.json
View file @
3a9c0c89
This diff is collapsed.
Click to expand it.
src/ResJson.ts
View file @
3a9c0c89
This diff is collapsed.
Click to expand it.
src/common/G_EVENT.ts
View file @
3a9c0c89
export
enum
G_EVENT
{
export
enum
G_EVENT
{
ON_SHOW
=
'onShow'
,
// 页面显示
ON_SHOW
=
'onShow'
,
// 页面显示
ON_HIDE
=
'onHide'
,
// 页面隐藏
ON_HIDE
=
'onHide'
,
// 页面隐藏
UPDATE_BAG
=
'UpdateBag'
,
// 更新背包
UPDATE_SHOP
=
'UpdateShop'
,
// 更新商店
UPDATE_TASK
=
'UpdateTask'
,
// 更新任务
UPDATE_TASK
=
'UpdateTask'
,
// 更新任务
UPDATE_SIGN
=
'UpdateSign'
,
// 更新签到
}
}
src/panels/SuccessPrizePanel.ts
View file @
3a9c0c89
...
@@ -9,6 +9,9 @@ import Container = FYGE.Container;
...
@@ -9,6 +9,9 @@ import Container = FYGE.Container;
import
{
PropType
}
from
"../something/enum/PropType"
;
import
{
PropType
}
from
"../something/enum/PropType"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
RES
}
from
"../../module/RES"
;
import
TextField
=
FYGE
.
TextField
;
import
TextField
=
FYGE
.
TextField
;
import
{
changeScene
}
from
"../../module/ctrls"
;
import
{
MapScene
}
from
"../scene/map/MapScene"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
export
class
SuccessPrizePanel
extends
Panel
{
export
class
SuccessPrizePanel
extends
Panel
{
get
groupNames
()
{
get
groupNames
()
{
...
@@ -110,8 +113,39 @@ export class SuccessPrizePanel extends Panel {
...
@@ -110,8 +113,39 @@ export class SuccessPrizePanel extends Panel {
super
.
start
();
super
.
start
();
}
}
/**
* 挑战满星
*/
private
again
()
{
changeScene
(
MapScene
,
{
level
:
this
.
data
.
level
});
super
.
hidePanel
();
}
/**
* 继续闯关
*/
private
continue
()
{
console
.
log
(
1
);
changeScene
(
MapScene
,
{
level
:
this
.
data
.
level
+
1
});
super
.
hidePanel
();
}
public
goPrize
(){
/// TODO 去抽奖
}
public
hidePanel
()
{
changeScene
(
MapScene
);
super
.
hidePanel
();
}
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
this
.
againBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
again
,
this
);
this
.
noPrizeAgainBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
continue
,
this
);
this
.
goPrizeBtn
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
goPrize
,
this
);
}
}
removeEvents
()
{
removeEvents
()
{
...
...
src/panels/TaskPanel.ts
View file @
3a9c0c89
...
@@ -4,6 +4,10 @@ import { sendTbNet, TbNetName } from "../TaoBaoNet";
...
@@ -4,6 +4,10 @@ import { sendTbNet, TbNetName } from "../TaoBaoNet";
import
Tween
=
FYGE
.
Tween
;
import
Tween
=
FYGE
.
Tween
;
import
Ease
=
FYGE
.
Ease
;
import
Ease
=
FYGE
.
Ease
;
import
Button
=
FYGE
.
Button
;
import
Button
=
FYGE
.
Button
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
{
Tools
}
from
"../Tools"
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
G_EVENT
}
from
"../common/G_EVENT"
;
export
class
TaskPanel
extends
Panel
{
export
class
TaskPanel
extends
Panel
{
get
groupNames
()
{
get
groupNames
()
{
...
@@ -27,26 +31,74 @@ export class TaskPanel extends Panel {
...
@@ -27,26 +31,74 @@ export class TaskPanel extends Panel {
}
}
closeBtn
:
Button
;
closeBtn
:
Button
;
taskBtn1
:
Button
;
taskBtn1
:
Button
;
// 浏览商品
taskBtn2
:
Button
;
taskBtn2
:
Button
;
// 邀请
taskBtn3
:
Button
;
taskBtn3
:
Button
;
// 关注
taskBtn4
:
Button
;
taskBtn4
:
Button
;
// 加入会员
initUi
()
{
initUi
()
{
this
.
updateTask
();
}
private
follow
()
{
GDispatcher
.
removeAllEventListenerByType
(
TbNetName
.
favorShop
);
sendTbNet
(
TbNetName
.
favorShop
,
{},
(
success
,
res
)
=>
{
if
(
!
success
)
{
return
;
}
sendTbNet
(
TbNetName
.
completeTask
,
{
taskName
:
'follow'
},
(
success
,
res
)
=>
{
GDispatcher
.
dispatchEvent
(
G_EVENT
.
UPDATE_TASK
);
if
(
!
success
)
return
;
}
);
},
true
);
}
private
invite
()
{
sendTbNet
(
TbNetName
.
showSharePanel
,
{
openId
:
Tools
.
globalData
.
openId
},
(
success
,
res
)
=>
{
}
);
}
}
private
browseGoods
()
{
/// TODO 浏览商品
console
.
log
(
'浏览商品'
);
}
private
memberUrl
:
string
;
private
member
()
{
/// TODO 加入会员
sendTbNet
(
TbNetName
.
showSharePanel
,
{
openId
:
Tools
.
globalData
.
openId
},
(
success
,
res
)
=>
{
}
);
}
public
updateTask
()
{
public
updateTask
()
{
// const _bd: { string: Button }
= {
const
taskData
=
{
//
'browseGoods': this.taskBtn1,
'browseGoods'
:
this
.
taskBtn1
,
//
'invites': this.taskBtn2,
'invites'
:
this
.
taskBtn2
,
//
'follow': this.taskBtn3,
'follow'
:
this
.
taskBtn3
,
//
'member': this.taskBtn4,
'member'
:
this
.
taskBtn4
,
//
}
}
sendTbNet
(
TbNetName
.
getTaskList
,
{},
sendTbNet
(
TbNetName
.
getTaskList
,
{},
(
success
,
res
)
=>
{
(
success
,
res
)
=>
{
if
(
!
success
)
return
;
if
(
!
success
)
return
;
res
.
data
.
forEach
((
v
)
=>
{
taskData
[
v
.
taskType
].
enabled
=
(
v
.
todayCompleteTimes
<
v
.
times
);
if
(
v
.
taskType
==
'member'
)
{
this
.
memberUrl
=
v
.
value
;
}
});
}
}
);
);
}
}
...
@@ -57,9 +109,21 @@ export class TaskPanel extends Panel {
...
@@ -57,9 +109,21 @@ export class TaskPanel extends Panel {
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
GDispatcher
.
addEventListener
(
G_EVENT
.
UPDATE_TASK
,
this
.
updateTask
,
this
);
GDispatcher
.
addEventListener
(
G_EVENT
.
ON_SHOW
,
this
.
updateTask
,
this
);
this
.
taskBtn1
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
browseGoods
,
this
);
this
.
taskBtn2
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
invite
,
this
);
this
.
taskBtn3
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
follow
,
this
);
this
.
taskBtn4
.
addEventListener
(
MouseEvent
.
CLICK
,
this
.
member
,
this
);
}
}
removeEvents
()
{
removeEvents
()
{
super
.
removeEvents
();
super
.
removeEvents
();
GDispatcher
.
removeEventListener
(
G_EVENT
.
UPDATE_TASK
,
this
.
updateTask
,
this
);
GDispatcher
.
removeEventListener
(
G_EVENT
.
ON_SHOW
,
this
.
updateTask
,
this
);
this
.
taskBtn1
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
browseGoods
,
this
);
this
.
taskBtn2
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
invite
,
this
);
this
.
taskBtn3
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
follow
,
this
);
this
.
taskBtn4
.
removeEventListener
(
MouseEvent
.
CLICK
,
this
.
member
,
this
);
}
}
}
}
src/scene/map/MapScene.ts
View file @
3a9c0c89
...
@@ -222,13 +222,13 @@ export class MapScene extends Scene {
...
@@ -222,13 +222,13 @@ export class MapScene extends Scene {
// score: 666,
// score: 666,
// stars: 3,
// stars: 3,
// isVisitSuccess: true,
// isVisitSuccess: true,
// isPrizeLevel:
tru
e,
// isPrizeLevel:
fals
e,
// tool: {
//
//
tool: {
// type: 'HAMMERS',
//
//
type: 'HAMMERS',
// },
//
//
},
//
//
prize: {
// prize: {
//
//
image: 'https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png',
// image: 'https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png',
//
//
}
// }
// });
// });
}
}
...
...
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