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
3bcda420
Commit
3bcda420
authored
Jul 20, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Success Panel Effect!
parent
28af48db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
28 deletions
+92
-28
workspace.xml
.idea/workspace.xml
+15
-10
babycare.getTaskList.json
mock/miniTb/babycare.getTaskList.json
+9
-9
G_EVENT.ts
src/common/G_EVENT.ts
+0
-3
TaskPanel.ts
src/panels/TaskPanel.ts
+68
-6
No files found.
.idea/workspace.xml
View file @
3bcda420
...
...
@@ -3,11 +3,9 @@
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"9cef0552-af3c-4a1c-be1f-dc41ebe5b6db"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/resource/res.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/resource/res.json"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/ResJson.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/ResJson.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/panels/SuccessPrizePanel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/panels/SuccessPrizePanel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/mock/miniTb/babycare.getTaskList.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/mock/miniTb/babycare.getTaskList.json"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/common/G_EVENT.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/common/G_EVENT.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/panels/TaskPanel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/panels/TaskPanel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/scene/map/MapScene.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/scene/map/MapScene.ts"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -113,7 +111,7 @@
<workItem
from=
"1594777357248"
duration=
"24313000"
/>
<workItem
from=
"1594864188027"
duration=
"20343000"
/>
<workItem
from=
"1594950738970"
duration=
"22032000"
/>
<workItem
from=
"1595209499266"
duration=
"
5774
000"
/>
<workItem
from=
"1595209499266"
duration=
"
7026
000"
/>
</task>
<task
id=
"LOCAL-00001"
summary=
"111"
>
<created>
1594122339119
</created>
...
...
@@ -269,7 +267,14 @@
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1595214630434
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"23"
/>
<task
id=
"LOCAL-00023"
summary=
"Success Panel Effect!"
>
<created>
1595215296744
</created>
<option
name=
"number"
value=
"00023"
/>
<option
name=
"presentableId"
value=
"LOCAL-00023"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1595215296744
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"24"
/>
<servers
/>
</component>
<component
name=
"TypeScriptGeneratedFilesManager"
>
...
...
@@ -295,10 +300,10 @@
<screen
x=
"31"
y=
"23"
width=
"1889"
height=
"1177"
/>
</state>
<state
x=
"251"
y=
"471"
key=
"ANALYSIS_DLG_com.intellij.analysis.BaseAnalysisAction$1/31.23.1889.1177@31.23.1889.1177"
timestamp=
"1594113080922"
/>
<state
x=
"754"
y=
"183"
key=
"CommitChangelistDialog2"
timestamp=
"159521
4630137
"
>
<state
x=
"754"
y=
"183"
key=
"CommitChangelistDialog2"
timestamp=
"159521
5296546
"
>
<screen
x=
"31"
y=
"23"
width=
"1889"
height=
"1177"
/>
</state>
<state
x=
"754"
y=
"183"
key=
"CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177"
timestamp=
"159521
4630137
"
/>
<state
x=
"754"
y=
"183"
key=
"CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177"
timestamp=
"159521
5296546
"
/>
<state
width=
"871"
height=
"321"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1595215073648"
>
<screen
x=
"31"
y=
"23"
width=
"1889"
height=
"1177"
/>
</state>
...
...
@@ -331,10 +336,10 @@
<screen
x=
"31"
y=
"23"
width=
"1889"
height=
"1177"
/>
</state>
<state
x=
"300"
y=
"248"
key=
"SettingsEditor/31.23.1889.1177@31.23.1889.1177"
timestamp=
"1594798992724"
/>
<state
x=
"92"
y=
"351"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"159521
4634021
"
>
<state
x=
"92"
y=
"351"
key=
"Vcs.Push.Dialog.v2"
timestamp=
"159521
5298063
"
>
<screen
x=
"31"
y=
"23"
width=
"1889"
height=
"1177"
/>
</state>
<state
x=
"92"
y=
"351"
key=
"Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177"
timestamp=
"159521
4634021
"
/>
<state
x=
"92"
y=
"351"
key=
"Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177"
timestamp=
"159521
5298063
"
/>
<state
x=
"87"
y=
"216"
key=
"com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser"
timestamp=
"1594705166397"
>
<screen
x=
"31"
y=
"23"
width=
"1889"
height=
"1177"
/>
</state>
...
...
mock/miniTb/babycare.getTaskList.json
View file @
3bcda420
...
...
@@ -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
}
src/common/G_EVENT.ts
View file @
3bcda420
export
enum
G_EVENT
{
ON_SHOW
=
'onShow'
,
// 页面显示
ON_HIDE
=
'onHide'
,
// 页面隐藏
UPDATE_BAG
=
'UpdateBag'
,
// 更新背包
UPDATE_SHOP
=
'UpdateShop'
,
// 更新商店
UPDATE_TASK
=
'UpdateTask'
,
// 更新任务
UPDATE_SIGN
=
'UpdateSign'
,
// 更新签到
}
src/panels/TaskPanel.ts
View file @
3bcda420
...
...
@@ -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,17 +31,60 @@ 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
=
{
const
taskData
=
{
'browseGoods'
:
this
.
taskBtn1
,
'invites'
:
this
.
taskBtn2
,
'follow'
:
this
.
taskBtn3
,
...
...
@@ -47,7 +94,10 @@ export class TaskPanel extends Panel {
(
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
;
}
});
}
);
...
...
@@ -59,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
);
}
}
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