Commit 3bcda420 authored by haiyoucuv's avatar haiyoucuv

Success Panel Effect!

parent 28af48db
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9cef0552-af3c-4a1c-be1f-dc41ebe5b6db" name="Default Changelist" comment=""> <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$/.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$/mock/miniTb/babycare.getTaskList.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/miniTb/babycare.getTaskList.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/common/G_EVENT.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/common/G_EVENT.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$/src/panels/TaskPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/TaskPanel.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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -113,7 +111,7 @@ ...@@ -113,7 +111,7 @@
<workItem from="1594777357248" duration="24313000" /> <workItem from="1594777357248" duration="24313000" />
<workItem from="1594864188027" duration="20343000" /> <workItem from="1594864188027" duration="20343000" />
<workItem from="1594950738970" duration="22032000" /> <workItem from="1594950738970" duration="22032000" />
<workItem from="1595209499266" duration="5774000" /> <workItem from="1595209499266" duration="7026000" />
</task> </task>
<task id="LOCAL-00001" summary="111"> <task id="LOCAL-00001" summary="111">
<created>1594122339119</created> <created>1594122339119</created>
...@@ -269,7 +267,14 @@ ...@@ -269,7 +267,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1595214630434</updated> <updated>1595214630434</updated>
</task> </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 /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
...@@ -295,10 +300,10 @@ ...@@ -295,10 +300,10 @@
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </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="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="1595214630137"> <state x="754" y="183" key="CommitChangelistDialog2" timestamp="1595215296546">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="754" y="183" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1595214630137" /> <state x="754" y="183" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1595215296546" />
<state width="871" height="321" key="GridCell.Tab.0.bottom" timestamp="1595215073648"> <state width="871" height="321" key="GridCell.Tab.0.bottom" timestamp="1595215073648">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
...@@ -331,10 +336,10 @@ ...@@ -331,10 +336,10 @@
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="300" y="248" key="SettingsEditor/31.23.1889.1177@31.23.1889.1177" timestamp="1594798992724" /> <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="1595214634021"> <state x="92" y="351" key="Vcs.Push.Dialog.v2" timestamp="1595215298063">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="92" y="351" key="Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177" timestamp="1595214634021" /> <state x="92" y="351" key="Vcs.Push.Dialog.v2/31.23.1889.1177@31.23.1889.1177" timestamp="1595215298063" />
<state x="87" y="216" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser" timestamp="1594705166397"> <state x="87" y="216" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser" timestamp="1594705166397">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
......
...@@ -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,
......
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', // 更新签到
} }
...@@ -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,17 +31,60 @@ export class TaskPanel extends Panel { ...@@ -27,17 +31,60 @@ 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 = { const taskData = {
'browseGoods': this.taskBtn1, 'browseGoods': this.taskBtn1,
'invites': this.taskBtn2, 'invites': this.taskBtn2,
'follow': this.taskBtn3, 'follow': this.taskBtn3,
...@@ -47,7 +94,10 @@ export class TaskPanel extends Panel { ...@@ -47,7 +94,10 @@ export class TaskPanel extends Panel {
(success, res) => { (success, res) => {
if (!success) return; if (!success) return;
res.data.forEach((v) => { 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 { ...@@ -59,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);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment