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
Hide 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 @@
"code"
:
"000000"
,
"data"
:
[
{
"taskType"
:
"
member
"
,
"times"
:
1
,
"taskType"
:
"
browseGoods
"
,
"times"
:
3
,
"todayCompleteTimes"
:
0
,
"waitReceive"
:
0
,
"rewards"
:
65
"value"
:
""
,
"rewards"
:
10
},
{
"taskType"
:
"invites"
,
...
...
@@ -25,14 +26,13 @@
"rewards"
:
7
},
{
"taskType"
:
"
browseGoods
"
,
"times"
:
3
,
"todayCompleteTimes"
:
0
,
"taskType"
:
"
member
"
,
"times"
:
1
,
"todayCompleteTimes"
:
1
,
"waitReceive"
:
0
,
"value"
:
""
,
"rewards"
:
10
"rewards"
:
65
}
],
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
}
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
{
ON_SHOW
=
'onShow'
,
// 页面显示
ON_HIDE
=
'onHide'
,
// 页面隐藏
UPDATE_BAG
=
'UpdateBag'
,
// 更新背包
UPDATE_SHOP
=
'UpdateShop'
,
// 更新商店
UPDATE_TASK
=
'UpdateTask'
,
// 更新任务
UPDATE_SIGN
=
'UpdateSign'
,
// 更新签到
}
src/panels/SuccessPrizePanel.ts
View file @
3a9c0c89
...
...
@@ -9,6 +9,9 @@ import Container = FYGE.Container;
import
{
PropType
}
from
"../something/enum/PropType"
;
import
{
RES
}
from
"../../module/RES"
;
import
TextField
=
FYGE
.
TextField
;
import
{
changeScene
}
from
"../../module/ctrls"
;
import
{
MapScene
}
from
"../scene/map/MapScene"
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
export
class
SuccessPrizePanel
extends
Panel
{
get
groupNames
()
{
...
...
@@ -110,8 +113,39 @@ export class SuccessPrizePanel extends Panel {
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
()
{
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
()
{
...
...
src/panels/TaskPanel.ts
View file @
3a9c0c89
...
...
@@ -4,6 +4,10 @@ import { sendTbNet, TbNetName } from "../TaoBaoNet";
import
Tween
=
FYGE
.
Tween
;
import
Ease
=
FYGE
.
Ease
;
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
{
get
groupNames
()
{
...
...
@@ -27,26 +31,74 @@ export class TaskPanel extends Panel {
}
closeBtn
:
Button
;
taskBtn1
:
Button
;
taskBtn2
:
Button
;
taskBtn3
:
Button
;
taskBtn4
:
Button
;
taskBtn1
:
Button
;
// 浏览商品
taskBtn2
:
Button
;
// 邀请
taskBtn3
:
Button
;
// 关注
taskBtn4
:
Button
;
// 加入会员
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
()
{
// const _bd: { string: Button }
= {
//
'browseGoods': this.taskBtn1,
//
'invites': this.taskBtn2,
//
'follow': this.taskBtn3,
//
'member': this.taskBtn4,
//
}
const
taskData
=
{
'browseGoods'
:
this
.
taskBtn1
,
'invites'
:
this
.
taskBtn2
,
'follow'
:
this
.
taskBtn3
,
'member'
:
this
.
taskBtn4
,
}
sendTbNet
(
TbNetName
.
getTaskList
,
{},
(
success
,
res
)
=>
{
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 {
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
()
{
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 {
// score: 666,
// stars: 3,
// isVisitSuccess: true,
// isPrizeLevel:
tru
e,
// tool: {
// type: 'HAMMERS',
// },
//
//
prize: {
//
//
image: 'https://img.alicdn.com/imgextra/i1/2275046294/O1CN01xTeKMI1wMhRux48Y6_!!2275046294-2-miniprogram.png',
//
//
}
// isPrizeLevel:
fals
e,
//
//
tool: {
//
//
type: 'HAMMERS',
//
//
},
// prize: {
// 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