Commit 90d58a2c authored by 邱旭's avatar 邱旭

m

parent ceab59e4
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="0d3cb18d-e144-41a0-bc8b-4877c2e1fef1" name="默认的" comment=""> <list default="true" id="0d3cb18d-e144-41a0-bc8b-4877c2e1fef1" name="默认的" 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$/src/something/class/Element.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/something/class/Element.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TaoBaoNet.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/TaoBaoNet.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Tools.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/Tools.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" />
...@@ -135,7 +137,7 @@ ...@@ -135,7 +137,7 @@
<workItem from="1612577003915" duration="21094000" /> <workItem from="1612577003915" duration="21094000" />
<workItem from="1612662929222" duration="40609000" /> <workItem from="1612662929222" duration="40609000" />
<workItem from="1613698993022" duration="22309000" /> <workItem from="1613698993022" duration="22309000" />
<workItem from="1613785579125" duration="1777000" /> <workItem from="1613785579125" duration="2245000" />
</task> </task>
<task id="LOCAL-00001" summary="斐乐消消乐"> <task id="LOCAL-00001" summary="斐乐消消乐">
<created>1612581213298</created> <created>1612581213298</created>
...@@ -312,7 +314,14 @@ ...@@ -312,7 +314,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1613730899385</updated> <updated>1613730899385</updated>
</task> </task>
<option name="localTasksCounter" value="26" /> <task id="LOCAL-00026" summary="m">
<created>1613787371878</created>
<option name="number" value="00026" />
<option name="presentableId" value="LOCAL-00026" />
<option name="project" value="LOCAL" />
<updated>1613787371878</updated>
</task>
<option name="localTasksCounter" value="27" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
......
...@@ -14,6 +14,8 @@ export enum TbNetName { ...@@ -14,6 +14,8 @@ export enum TbNetName {
// 领取权益奖励 // 领取权益奖励
receiveEnamePrize = "feile.receiveEnamePrize", receiveEnamePrize = "feile.receiveEnamePrize",
getRemainTimes = "feile.getRemainTimes",
/** /**
* 活动基本信息 * 活动基本信息
* @param activityId * @param activityId
......
...@@ -96,28 +96,44 @@ export class Tools { ...@@ -96,28 +96,44 @@ export class Tools {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sendTbNet(TbNetName.consumerTools, { type }, async (s, res) => { sendTbNet(TbNetName.consumerTools, { type }, async (s, res) => {
if (s) { if (s) {
//修改道具数量
// this.gameData.tools = res.data.tools;
await Tools.updateTools(); await Tools.updateTools();
resolve(true) resolve(true);
} else { } else {
// reject() resolve(false);
resolve(false)
} }
}) })
}) })
} }
/**
* 更新道具
*/
public static updateTools() { public static updateTools() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
sendTbNet(TbNetName.getToolsInfo, {}, (s, res) => { sendTbNet(TbNetName.getToolsInfo, {}, (s, res) => {
if (s) { if (s) {
//修改道具数量 //修改道具数量
this.gameData.tools = res.data.tools; this.gameData.tools = res.data.tools;
resolve(true) resolve(true);
} else {
resolve(false);
}
});
});
}
/**
* 更新体力
*/
public static updatePower() {
return new Promise((resolve, reject) => {
sendTbNet(TbNetName.getRemainTimes, {}, (s, res) => {
if (s) {
//修改体力数量
this.gameData.power = res.data.reaminTimes;
resolve(true);
} else { } else {
// reject() resolve(false);
resolve(false)
} }
}); });
}); });
......
...@@ -201,6 +201,7 @@ export class MapScene extends Scene { ...@@ -201,6 +201,7 @@ export class MapScene extends Scene {
public async updateScene() { public async updateScene() {
super.updateScene(); super.updateScene();
await Tools.updatePower();
this.uiLayer.updateUI(); this.uiLayer.updateUI();
} }
......
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