Commit 5e7a2c9f authored by 邱旭's avatar 邱旭

NoEnergyPanel

parent 3454b109
...@@ -2,14 +2,46 @@ ...@@ -2,14 +2,46 @@
<project version="4"> <project version="4">
<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 afterPath="$PROJECT_DIR$/resource/UseStep/useStepBg.png" afterDir="false" /> <change afterPath="$PROJECT_DIR$/resource/NoEnergyPanel/体力不足.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/UseStep/useStepCancel.png" afterDir="false" /> <change afterPath="$PROJECT_DIR$/resource/StartPanel/关卡弹窗Bg.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/UseStep/useStepOk.png" afterDir="false" /> <change afterPath="$PROJECT_DIR$/resource/common/panelBgS.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/panels/UseStep.ts" afterDir="false" />
<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$/mock/miniTb/babycare.getIndex.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/miniTb/babycare.getIndex.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/output.js" beforeDir="false" afterPath="$PROJECT_DIR$/output.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/BuyPowerPanel/增加体力背景.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/BuyPowerPanel/无字按钮底.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/CreditsOutPanel/积分不足背景.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/CreditsOutPanel/赚取积分.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/ExchangeSucPanel/兑换成功背景.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/ExchangeSucPanel/知道啦.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/JoinPanel/joinBg.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/JoinPanel/joinBtn.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/NoEnergyPanel/体力不足Bg.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/NoEnergyPanel/体力不足按钮.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/NoEnergyPanel/体力不足按钮.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/StartPanel/开始闯关Bg.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/StartPanelPrize/关卡弹窗Bg.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/ToolsOutPanel/道具不足背景.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/UseStep/useStepBg.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/UseToolPanel/使用道具背景.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/resource/res.json" beforeDir="false" afterPath="$PROJECT_DIR$/resource/res.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/resource/res.json" beforeDir="false" afterPath="$PROJECT_DIR$/resource/res.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ResJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/ResJson.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/ResJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/ResJson.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SkinJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/SkinJson.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/panels/BuyPowerPanel.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/CreditsOutPanel.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/ExchangeSucPanel.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/JoinPanel.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/NoEnergyPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/NoEnergyPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/NoStepPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/NoStepPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/StartPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/StartPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/StartPanelPrize.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/TaskPanel.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/ToolsOutPanel.ts" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/UseStep.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/UseStep.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/PlayScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/PlayScene.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/scene/PlayScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/PlayScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapUI.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapUI.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 +145,7 @@ ...@@ -113,7 +145,7 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1612576978320</updated> <updated>1612576978320</updated>
<workItem from="1612576979459" duration="13000" /> <workItem from="1612576979459" duration="13000" />
<workItem from="1612577003915" duration="15938000" /> <workItem from="1612577003915" duration="18185000" />
</task> </task>
<task id="LOCAL-00001" summary="斐乐消消乐"> <task id="LOCAL-00001" summary="斐乐消消乐">
<created>1612581213298</created> <created>1612581213298</created>
...@@ -143,7 +175,14 @@ ...@@ -143,7 +175,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1612598313143</updated> <updated>1612598313143</updated>
</task> </task>
<option name="localTasksCounter" value="5" /> <task id="LOCAL-00005" summary="Rule">
<created>1612599420632</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1612599420632</updated>
</task>
<option name="localTasksCounter" value="6" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
......
{ {
"code": "000000", "code": "000000",
"data": { "data": {
"currentLevel": 1, "currentLevel": 3,
"isFristLogin": false, "isFristLogin": false,
"visitors": [ "visitors": [
{
"activityId": "5f1a528e964f9796f92d3ccf",
"score": 18940,
"level": 3,
"createTime": 1595851954663,
"openId": "AAFgCvE-ALiIWXYsJuSLKdVt",
"isVisitSuccess": true,
"updateTime": 1595851954663,
"_id": "5f1ec4b367f137665474cffb",
"stars": 3,
"isPrizeLevel": false,
"sendAwardType": true
},
{ {
"activityId": "5f1a528e964f9796f92d3ccf", "activityId": "5f1a528e964f9796f92d3ccf",
"score": 960, "score": 960,
...@@ -51,7 +38,7 @@ ...@@ -51,7 +38,7 @@
"openId": "AAFgCvE-ALiIWXYsJuSLKdVt", "openId": "AAFgCvE-ALiIWXYsJuSLKdVt",
"prizes": [], "prizes": [],
"loginAddPower": 0, "loginAddPower": 0,
"power": 21, "power": 0,
"tools": { "tools": {
"HAMMERS": 9, "HAMMERS": 9,
"STEPS": 99, "STEPS": 99,
......
...@@ -17619,7 +17619,7 @@ var StartPanelPrize = (function (_super) { ...@@ -17619,7 +17619,7 @@ var StartPanelPrize = (function (_super) {
}; };
return StartPanelPrize; return StartPanelPrize;
}(Panel_1.Panel)); }(Panel_1.Panel));
exports.StartPanelPrize = StartPanelPrize; exports.StartPanel = StartPanelPrize;
/***/ }), /***/ }),
{ {
"groups": [ "groups": [
{
"keys": "增加体力背景.png,无字按钮底.png",
"name": "BuyPowerPanel"
},
{
"keys": "积分不足背景.png,赚取积分.png",
"name": "CreditsOutPanel"
},
{
"keys": "兑换成功背景.png,知道啦.png",
"name": "ExchangeSucPanel"
},
{ {
"keys": "失败Bg.png,失败重新闯关.png", "keys": "失败Bg.png,失败重新闯关.png",
"name": "FailedPanel" "name": "FailedPanel"
...@@ -21,11 +9,7 @@ ...@@ -21,11 +9,7 @@
"name": "FreePowerPanel" "name": "FreePowerPanel"
}, },
{ {
"keys": "joinBg.png,joinBtn.png", "keys": "体力不足.png,体力不足按钮.png",
"name": "JoinPanel"
},
{
"keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel" "name": "NoEnergyPanel"
}, },
{ {
...@@ -44,13 +28,9 @@ ...@@ -44,13 +28,9 @@
"keys": "ruleBtn.png,活动规则背景.png", "keys": "ruleBtn.png,活动规则背景.png",
"name": "RulePanel" "name": "RulePanel"
}, },
{
"keys": "开始闯关Bg.png",
"name": "StartPanel"
},
{ {
"keys": "关卡弹窗Bg.png", "keys": "关卡弹窗Bg.png",
"name": "StartPanelPrize" "name": "StartPanel"
}, },
{ {
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png", "keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
...@@ -61,23 +41,15 @@ ...@@ -61,23 +41,15 @@
"name": "TaskPanel" "name": "TaskPanel"
}, },
{ {
"keys": "道具不足背景.png", "keys": "useStepCancel.png,useStepOk.png",
"name": "ToolsOutPanel"
},
{
"keys": "useStepBg.png,useStepCancel.png,useStepOk.png",
"name": "UseStep" "name": "UseStep"
}, },
{
"keys": "使用道具背景.png",
"name": "UseToolPanel"
},
{ {
"keys": "0250abc4-fabc-4bf3-970a-46ceeb12d416.png,03756d82-4e5c-4bdc-8247-7f704ed92ba7.png,0b1a21c5-2e2f-43bc-81f7-ee1c4474d07f.png,0f025d15-5a0b-4e5d-81e9-4a822c469467.png,445121aa-3bae-4b89-a8e9-fd41e2779276.png,54e427a5-b930-4506-a07d-8f1d7eb83ff5.png,560f6473-1e86-433f-a2fb-8e6d0c06d32f.png,8d000f4d-318a-47a1-9fa4-53c7b203a8fd.png,9ed4a149-8df3-45d4-b531-63b82833255a.png,b0c2b486-8dab-4c34-bec4-02e4b4ef835b.png,cd544214-fe15-402a-99a0-a57072952722.png", "keys": "0250abc4-fabc-4bf3-970a-46ceeb12d416.png,03756d82-4e5c-4bdc-8247-7f704ed92ba7.png,0b1a21c5-2e2f-43bc-81f7-ee1c4474d07f.png,0f025d15-5a0b-4e5d-81e9-4a822c469467.png,445121aa-3bae-4b89-a8e9-fd41e2779276.png,54e427a5-b930-4506-a07d-8f1d7eb83ff5.png,560f6473-1e86-433f-a2fb-8e6d0c06d32f.png,8d000f4d-318a-47a1-9fa4-53c7b203a8fd.png,9ed4a149-8df3-45d4-b531-63b82833255a.png,b0c2b486-8dab-4c34-bec4-02e4b4ef835b.png,cd544214-fe15-402a-99a0-a57072952722.png",
"name": "bonus_lottie" "name": "bonus_lottie"
}, },
{ {
"keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png", "keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,panelBgS.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png",
"name": "common" "name": "common"
}, },
{ {
......
...@@ -8,13 +8,7 @@ import { ResJson } from "./ResJson"; ...@@ -8,13 +8,7 @@ import { ResJson } from "./ResJson";
import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet"; import { destroyNetData, sendTbNet, TbNetName } from "./TaoBaoNet";
import { SkinJson } from "./SkinJson"; import { SkinJson } from "./SkinJson";
import { G_EVENT } from "./common/G_EVENT"; import { G_EVENT } from "./common/G_EVENT";
import { MapScene } from "./scene/map/MapScene";
import { PlayScene } from "./scene/PlayScene";
import { LoadingScene } from "./scene/LoadingScene"; import { LoadingScene } from "./scene/LoadingScene";
import { JoinPanel } from "./panels/JoinPanel";
import { NoStepPanel } from "./panels/NoStepPanel";
import { NoPrizePanel } from "./panels/NoPrizePanel";
import { LotteryScene } from "./scene/LotteryScene";
/** /**
* 全局事件,为了和小程序交互 * 全局事件,为了和小程序交互
......
export const ResJson = { export const ResJson = {
"groups": [ "groups": [
{
"keys": "增加体力背景.png,无字按钮底.png",
"name": "BuyPowerPanel"
},
{
"keys": "积分不足背景.png,赚取积分.png",
"name": "CreditsOutPanel"
},
{
"keys": "兑换成功背景.png,知道啦.png",
"name": "ExchangeSucPanel"
},
{ {
"keys": "失败Bg.png,失败重新闯关.png", "keys": "失败Bg.png,失败重新闯关.png",
"name": "FailedPanel" "name": "FailedPanel"
...@@ -21,11 +9,7 @@ export const ResJson = { ...@@ -21,11 +9,7 @@ export const ResJson = {
"name": "FreePowerPanel" "name": "FreePowerPanel"
}, },
{ {
"keys": "joinBg.png,joinBtn.png", "keys": "体力不足.png,体力不足按钮.png",
"name": "JoinPanel"
},
{
"keys": "体力不足Bg.png,体力不足按钮.png",
"name": "NoEnergyPanel" "name": "NoEnergyPanel"
}, },
{ {
...@@ -44,13 +28,9 @@ export const ResJson = { ...@@ -44,13 +28,9 @@ export const ResJson = {
"keys": "ruleBtn.png,活动规则背景.png", "keys": "ruleBtn.png,活动规则背景.png",
"name": "RulePanel" "name": "RulePanel"
}, },
{
"keys": "开始闯关Bg.png",
"name": "StartPanel"
},
{ {
"keys": "关卡弹窗Bg.png", "keys": "关卡弹窗Bg.png",
"name": "StartPanelPrize" "name": "StartPanel"
}, },
{ {
"keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png", "keys": "star_dis.png,star_en.png,去抽奖.png,圆角矩形 648.png,开奖按钮120.png,道具圆圈.png,闯关成功.png,闯关成功Bg.png,闯关成功不满星按钮.png",
...@@ -61,23 +41,15 @@ export const ResJson = { ...@@ -61,23 +41,15 @@ export const ResJson = {
"name": "TaskPanel" "name": "TaskPanel"
}, },
{ {
"keys": "道具不足背景.png", "keys": "useStepCancel.png,useStepOk.png",
"name": "ToolsOutPanel"
},
{
"keys": "useStepBg.png,useStepCancel.png,useStepOk.png",
"name": "UseStep" "name": "UseStep"
}, },
{
"keys": "使用道具背景.png",
"name": "UseToolPanel"
},
{ {
"keys": "0250abc4-fabc-4bf3-970a-46ceeb12d416.png,03756d82-4e5c-4bdc-8247-7f704ed92ba7.png,0b1a21c5-2e2f-43bc-81f7-ee1c4474d07f.png,0f025d15-5a0b-4e5d-81e9-4a822c469467.png,445121aa-3bae-4b89-a8e9-fd41e2779276.png,54e427a5-b930-4506-a07d-8f1d7eb83ff5.png,560f6473-1e86-433f-a2fb-8e6d0c06d32f.png,8d000f4d-318a-47a1-9fa4-53c7b203a8fd.png,9ed4a149-8df3-45d4-b531-63b82833255a.png,b0c2b486-8dab-4c34-bec4-02e4b4ef835b.png,cd544214-fe15-402a-99a0-a57072952722.png", "keys": "0250abc4-fabc-4bf3-970a-46ceeb12d416.png,03756d82-4e5c-4bdc-8247-7f704ed92ba7.png,0b1a21c5-2e2f-43bc-81f7-ee1c4474d07f.png,0f025d15-5a0b-4e5d-81e9-4a822c469467.png,445121aa-3bae-4b89-a8e9-fd41e2779276.png,54e427a5-b930-4506-a07d-8f1d7eb83ff5.png,560f6473-1e86-433f-a2fb-8e6d0c06d32f.png,8d000f4d-318a-47a1-9fa4-53c7b203a8fd.png,9ed4a149-8df3-45d4-b531-63b82833255a.png,b0c2b486-8dab-4c34-bec4-02e4b4ef835b.png,cd544214-fe15-402a-99a0-a57072952722.png",
"name": "bonus_lottie" "name": "bonus_lottie"
}, },
{ {
"keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png", "keys": "boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,panelBgS.png,powerImg.png,stepBtn.png,target0.png,target1.png,target2.png,target3.png,target4.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png",
"name": "common" "name": "common"
}, },
{ {
......
...@@ -406,80 +406,6 @@ export const SkinJson = { ...@@ -406,80 +406,6 @@ export const SkinJson = {
"x": 0, "x": 0,
"y": 0, "y": 0,
"type": "container", "type": "container",
"children": [
{
"name": "开始闯关Bg",
"x": 55,
"y": 266,
"type": "sprite",
"props": {
"source": "开始闯关Bg.png"
}
},
{
"name": "开始闯关要能量",
"x": 163,
"y": 899,
"type": "button",
"props": {
"tUp": "开始闯关要能量.png"
},
"id": "startBtn"
},
{
"name": "开始闯关不要能量",
"x": 163,
"y": 899,
"type": "button",
"props": {
"tUp": "开始闯关不要能量.png"
},
"id": "startBtn2"
},
{
"name": "提示文案",
"x": 221,
"y": 847,
"type": "text",
"props": {
"text": "本关满星可获得随机道具",
"size": 28,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "tipsTex"
},
{
"name": "关卡文字",
"x": 317,
"y": 521,
"type": "text",
"props": {
"text": "第 6 关",
"size": 40,
"fillColor": "#df5942",
"textAlpha": 1,
"bold": true
},
"id": "checkTex"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{
"name": "StartPanelPrize",
"x": 0,
"y": 0,
"type": "container",
"children": [ "children": [
{ {
"name": "关卡弹窗Bg", "name": "关卡弹窗Bg",
...@@ -559,92 +485,6 @@ export const SkinJson = { ...@@ -559,92 +485,6 @@ export const SkinJson = {
} }
] ]
}, },
{
"name": "NoEnergyPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "体力不足Bg",
"x": 55,
"y": 497,
"type": "sprite",
"props": {
"source": "体力不足Bg.png"
}
},
{
"name": "体力不足按钮",
"x": 163,
"y": 880,
"type": "button",
"props": {
"tUp": "体力不足按钮.png"
},
"id": "okBtn"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{
"name": "BuyPowerPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "增加体力背景",
"x": 55,
"y": 498,
"type": "sprite",
"props": {
"source": "增加体力背景.png"
}
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
},
{
"name": "无字按钮底",
"x": 163,
"y": 805,
"type": "button",
"props": {
"tUp": "无字按钮底.png"
},
"id": "exchangeBtn"
},
{
"name": "文案",
"x": 426,
"y": 682,
"type": "text",
"props": {
"text": "+\t1",
"size": 36,
"fillColor": "#ffffff",
},
"id": "msgTxt"
}
]
},
{ {
"name": "RulePanel", "name": "RulePanel",
"x": 0, "x": 0,
...@@ -732,211 +572,6 @@ export const SkinJson = { ...@@ -732,211 +572,6 @@ export const SkinJson = {
} }
] ]
}, },
{
"name": "TaskPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "任务背景",
"x": 0,
"y": 579,
"type": "sprite",
"props": {
"source": "任务背景.png"
}
},
{
"name": "按钮4",
"x": 525,
"y": 1462,
"type": "button",
"props": {
"tUp": "去完成.png",
"tDisable": "去完成灰.png"
},
"id": "taskBtn4"
},
{
"name": "按钮3",
"x": 526,
"y": 1282,
"type": "button",
"props": {
"tUp": "去完成.png",
"tDisable": "去完成灰.png"
},
"id": "taskBtn3"
},
{
"name": "按钮2",
"x": 526,
"y": 1102,
"type": "button",
"props": {
"tUp": "去完成.png",
"tDisable": "去完成灰.png"
},
"id": "taskBtn2"
},
{
"name": "按钮1",
"x": 526,
"y": 923,
"type": "button",
"props": {
"tUp": "去完成.png",
"tDisable": "去完成灰.png"
},
"id": "taskBtn1"
},
{
"name": "关闭按钮",
"x": 671,
"y": 708,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
}
]
},
{
"name": "ToolsOutPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "道具不足背景",
"x": 55,
"y": 498,
"type": "sprite",
"props": {
"source": "道具不足背景.png"
}
},
{
"name": "文案",
"x": 203,
"y": 650,
"type": "text",
"props": {
"text": "要消耗200积分兑换码?",
"size": 34,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "msgTxt"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
},
{
"name": "确定",
"x": 383,
"y": 745,
"type": "button",
"props": {
"tUp": "确定.png"
},
"id": "sureBtn"
},
{
"name": "再想想",
"x": 93,
"y": 745,
"type": "button",
"props": {
"tUp": "再想想.png"
},
"id": "consideBtn"
}
]
},
{
"name": "ExchangeSucPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "兑换成功背景",
"x": 55,
"y": 337,
"type": "sprite",
"props": {
"source": "兑换成功背景.png"
}
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
},
{
"name": "知道啦",
"x": 163,
"y": 745,
"type": "button",
"props": {
"tUp": "知道啦.png"
},
"id": "knowBtn"
}
]
},
{
"name": "CreditsOutPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "积分不足背景",
"x": 55,
"y": 498,
"type": "sprite",
"props": {
"source": "积分不足背景.png"
}
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
},
{
"name": "赚取积分",
"x": 163,
"y": 745,
"type": "button",
"props": {
"tUp": "赚取积分.png"
},
"id": "earnBtn"
}
]
},
{ {
"name": "FreePowerPanel", "name": "FreePowerPanel",
"x": 0, "x": 0,
...@@ -974,65 +609,5 @@ export const SkinJson = { ...@@ -974,65 +609,5 @@ export const SkinJson = {
} }
] ]
}, },
{
"name": "UseToolPanel",
"x": 0,
"y": 0,
"type": "container",
"children": [
{
"name": "使用道具背景",
"x": 55,
"y": 498,
"type": "sprite",
"props": {
"source": "使用道具背景.png"
}
},
{
"name": "文案",
"x": 168,
"y": 619,
"type": "text",
"props": {
"text": "确认使用步数道具+10步吗?",
"size": 34,
"fillColor": "#df5942",
"textAlpha": 1
},
"id": "msgTxt"
},
{
"name": "关闭按钮",
"x": 631,
"y": 470,
"type": "button",
"props": {
"tUp": "关闭按钮.png"
},
"id": "closeBtn"
},
{
"name": "确定",
"x": 383,
"y": 745,
"type": "button",
"props": {
"tUp": "确定.png"
},
"id": "sureBtn"
},
{
"name": "再想想",
"x": 93,
"y": 745,
"type": "button",
"props": {
"tUp": "再想想.png"
},
"id": "consideBtn"
}
]
}
] ]
} }
...@@ -9,17 +9,21 @@ import { showPanel } from "../module/ctrls"; ...@@ -9,17 +9,21 @@ import { showPanel } from "../module/ctrls";
import { FailedPanel } from "./panels/FailedPanel"; import { FailedPanel } from "./panels/FailedPanel";
import { SuccessPrizePanel } from "./panels/SuccessPrizePanel"; import { SuccessPrizePanel } from "./panels/SuccessPrizePanel";
import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel"; import { SuccessNoPrizePanel } from "./panels/SuccessNoPrizePanel";
import { CreditsOutPanel } from "./panels/CreditsOutPanel";
/** /**
* 定制,记录一些全局量和方法 * 定制,记录一些全局量和方法
*/ */
export class Tools { export class Tools {
public static openTask(){
console.error('TODO 打开任务');
alert('TODO 打开任务');
}
/** /**
* 缓存key * 缓存key
*/ */
public static cacheKey: string = "guideThreeSquirrels" public static cacheKey: string = "guideFLXXL"
public static isMember: boolean; public static isMember: boolean;
...@@ -139,9 +143,9 @@ export class Tools { ...@@ -139,9 +143,9 @@ export class Tools {
showPanel(FailedPanel, data); showPanel(FailedPanel, data);
} else if ((data.prize && data.prize.image) || (data.tool && data.tool.type) || data.level == 120) { // 闯关成功,奖励关卡 } else if ((data.prize && data.prize.image) || (data.tool && data.tool.type) || data.level == 120) { // 闯关成功,奖励关卡
//120关,如果没有奖品图片,伪造一个 //120关,如果没有奖品图片,伪造一个
if (data.level == 120 && (!data.prize || !data.prize.image)) { if (data.level == 99 && (!data.prize || !data.prize.image)) {
data.prize = data.prize || {}; data.prize = data.prize || {};
data.prize.image = Tools.baseInfo.levelPrize['level_120']; data.prize.image = Tools.baseInfo.levelPrize['level_99'];
} }
showPanel(SuccessPrizePanel, data); showPanel(SuccessPrizePanel, data);
} else { // 闯关成功,不是奖励关卡 } else { // 闯关成功,不是奖励关卡
...@@ -149,45 +153,6 @@ export class Tools { ...@@ -149,45 +153,6 @@ export class Tools {
} }
} }
/**
* 兑换道具,根据返回参数判断
*/
public static async exchange(type: PropType): Promise<boolean | string> {
//先获取积分,判断是否有积分
var creditsData = await sendTbNet(TbNetName.queryCredits, null, null, true)
//接口失败,没数据时,返回false
if (!creditsData || !creditsData.data) {
showToast("网络异常,请重试")//上面禁掉了提示,这里提示下
return false
}
//非会员,返回会员路径
if (creditsData && !creditsData.success && !creditsData.data.isvip) {
return creditsData.data.url
}
//判断积分,不足兑换
if (!creditsData.data.credits ||
creditsData.data.credits < getTbData(TbNetName.getActivityBaseInfoById).data.buyCredits[type]
) {
showPanel(CreditsOutPanel)
return false
}
const res = await sendTbNet(TbNetName.exchange, { type, credits: creditsData.data.credits }, null, true)
if (res.success) {
//修改道具数量和体力
this.gameData.power = res.data.power;
this.gameData.tools = res.data.tools;
return true;//可根据gameData修改视图
} else {
//如果code积分不足,弹出赚积分弹窗
if (res.code == "730005") {
showPanel(CreditsOutPanel)
} else {
showToast(res.message || "网络开小差了,请重试")
}
return false;
}
}
/** /**
* 询问权限用 * 询问权限用
*/ */
......
import { Panel } from "../../module/views/Panel";
import { Tools } from "../Tools";
import { getCurrentScene, hideWaiting, showPanel, showToast, showWaiting } from "../../module/ctrls";
import { JoinPanel } from "./JoinPanel";
import { PropType } from "../something/enum/PropType";
import VERTICAL_ALIGN = FYGE.VERTICAL_ALIGN;
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import TextField = FYGE.TextField;
export class BuyPowerPanel extends Panel {
get groupNames() {
return ["BuyPowerPanel"]
}
get skinName() {
return "BuyPowerPanel"
}
msgTxt: FYGE.TextField;
exchangeBtn: FYGE.Button;
closeBtn: FYGE.Button;
initUi() {
const btnTxt: TextField = this.exchangeBtn.addChild(Tools.getText(
'1店铺积分', 36, '#ffffff',
TEXT_ALIGN.CENTER, this.exchangeBtn.width, 0, -6
));
btnTxt.textHeight = this.exchangeBtn.height;
btnTxt.verticalAlign = VERTICAL_ALIGN.MIDDLE;
btnTxt.bold = true;
btnTxt.stroke = 3;
btnTxt.strokeColor = '#21926e';
this.msgTxt.bold = true;
this.msgTxt.stroke = 3;
this.msgTxt.strokeColor = '#21926e';
this.exchangeBtn.addEventListener(FYGE.MouseEvent.CLICK, async () => {
//购买道具
showWaiting();
var res = await Tools.exchange(PropType.POWER);
hideWaiting();
//如果是链接,弹出加入会员弹框
if (typeof res == "string") {
showPanel(JoinPanel, { url: res });
}
//成功了,关闭弹框,修改道具信息
else if (res) {
showToast("兑换成功");
this.hidePanel();
getCurrentScene().updateScene();
}
}, this);
}
start(data) {
super.start();
}
initEvents() {
super.initEvents();
}
removeEvents() {
super.removeEvents();
}
}
import { Panel } from "../../module/views/Panel";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { Tools } from "../Tools";
export class CreditsOutPanel extends Panel {
get groupNames() { return ["CreditsOutPanel"] }
get skinName() { return "CreditsOutPanel" }
earnBtn: FYGE.Button;
closeBtn: FYGE.Button;
initUi() {
}
start(data) {
super.start();
}
initEvents() {
super.initEvents();
this.earnBtn.addEventListener(FYGE.MouseEvent.CLICK, () => {
Tools.btnDelay(this);
sendTbNet(TbNetName.navigateToOutside, {
url: "https://market.m.taobao.com/app/tb-source-app/shopact/pages/index?wh_weex=true&pathInfo=shop/activity&userId=2275046294&shopId=114637892&pageId=187145736&alisite=true"
})//赚积分路径
}, this)
}
removeEvents() {
super.removeEvents();
}
}
import { Panel } from "../../module/views/Panel";
export class ExchangeSucPanel extends Panel {
get groupNames() { return ["ExchangeSucPanel"] }
get skinName() { return "ExchangeSucPanel" }
knowBtn:FYGE.Button;
closeBtn:FYGE.Button;
get closeBtns(){
return [this.knowBtn,this.closeBtn]
}
}
import { Panel } from "../../module/views/Panel";
import { RES } from "../../module/RES";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { wait } from "../../module/ctrls";
import { GDispatcher } from "../Main";
import { G_EVENT } from "../common/G_EVENT";
export class JoinPanel extends Panel {
get groupNames() {
return ["JoinPanel"]
}
data: { url: string }
initUi() {
this.addChild(FYGE.Sprite.fromFrame("joinBg.png"))
this.addChild(new FYGE.Button(RES.getRes("关闭按钮.png")))
.addEventListener(FYGE.MouseEvent.CLICK, () => { this.hidePanel(); }, this)
.position.set(634, 472)
this.addChild(new FYGE.Button(RES.getRes("joinBtn.png")))
.addEventListener(FYGE.MouseEvent.CLICK, () => {
this.enableMouseEvt(false);
wait(() => { this.enableMouseEvt(true) }, 2000)
sendTbNet(TbNetName.navigateToOutside, { url: this.data.url })
//回来时关闭,回来讲道理必执行
GDispatcher.once(G_EVENT.ON_SHOW, () => {
this.hidePanel();
}, this)
}, this)
.position.set(166, 744)
}
}
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { showPanel } from "../../module/ctrls"; import { showPanel } from "../../module/ctrls";
import { BuyPowerPanel } from "./BuyPowerPanel"; import { Tools } from "../Tools";
import Button = FYGE.Button;
import { RES } from "../../module/RES";
export class NoEnergyPanel extends Panel { export class NoEnergyPanel extends Panel {
get groupNames() { get groupNames() {
return ["NoEnergyPanel"] return ["NoEnergyPanel"]
} }
get skinName() {
return "NoEnergyPanel"
}
closeBtn: FYGE.Button; closeBtn: FYGE.Button;
okBtn: FYGE.Button; okBtn: FYGE.Button;
initUi() { initUi() {
this.addChild(Tools.getSprite('panelBgS.png')).position.set(79, 513);
this.addChild(Tools.getSprite('体力不足.png')).position.set(171, 582);
this.okBtn = this.addChild(new Button(RES.getRes('体力不足按钮.png')));
this.okBtn.position.set(190, 830);
} }
start(data) { start(data) {
...@@ -26,7 +27,7 @@ export class NoEnergyPanel extends Panel { ...@@ -26,7 +27,7 @@ export class NoEnergyPanel extends Panel {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.okBtn.addEventListener(MouseEvent.CLICK, () => { this.okBtn.addEventListener(MouseEvent.CLICK, () => {
showPanel(BuyPowerPanel); Tools.openTask();
this.hidePanel(); this.hidePanel();
}, this); }, this);
} }
......
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import { Tools } from "../Tools"; import { Tools } from "../Tools";
import { getCurrentScene, showPanel } from "../../module/ctrls"; import { getCurrentScene, showPanel } from "../../module/ctrls";
import { ToolsOutPanel } from "./ToolsOutPanel";
import { PropType } from "../something/enum/PropType";
export class NoStepPanel extends Panel { export class NoStepPanel extends Panel {
get groupNames() { return ["NoStepPanel"] } get groupNames() { return ["NoStepPanel"] }
get skinName() { return "NoStepPanel" } get skinName() { return "NoStepPanel" }
...@@ -34,7 +32,7 @@ export class NoStepPanel extends Panel { ...@@ -34,7 +32,7 @@ export class NoStepPanel extends Panel {
this.liveBtn.addEventListener(FYGE.MouseEvent.CLICK, () => { this.liveBtn.addEventListener(FYGE.MouseEvent.CLICK, () => {
//无步数道具,弹出积分兑换 //无步数道具,弹出积分兑换
if (!Tools.gameData.tools.STEPS) { if (!Tools.gameData.tools.STEPS) {
showPanel(ToolsOutPanel, { type: PropType.STEPS, showSucPanel: false }) // showPanel(ToolsOutPanel, { type: PropType.STEPS, showSucPanel: false })
} else { } else {
this.data.reviveFun(); this.data.reviveFun();
this.hidePanel(); this.hidePanel();
......
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import { getChapterData } from "../something/chapters/getChapter";
import { Tools } from "../Tools";
import { ElementTargetData } from "../something/interface/ElementTargetData";
import Container = FYGE.Container;
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { changeScene, showPanel } from "../../module/ctrls"; import { changeScene, showPanel } from "../../module/ctrls";
import { PlayScene } from "../scene/PlayScene"; import { PlayScene } from "../scene/PlayScene";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import { Tools } from "../Tools";
import { sendTbNet, TbNetName } from "../TaoBaoNet"; import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { NoEnergyPanel } from "./NoEnergyPanel"; import { NoEnergyPanel } from "./NoEnergyPanel";
import { ElementTargetData } from "../something/interface/ElementTargetData";
import Container = FYGE.Container;
import { getChapterData } from "../something/chapters/getChapter";
export class StartPanel extends Panel { export class StartPanel extends Panel {
get groupNames() { get groupNames() {
...@@ -21,12 +23,6 @@ export class StartPanel extends Panel { ...@@ -21,12 +23,6 @@ export class StartPanel extends Panel {
return "StartPanel" return "StartPanel"
} }
closeBtn: FYGE.Button;
checkTex: FYGE.TextField;
tipsTex: FYGE.TextField;
startBtn2: FYGE.Button;
startBtn: FYGE.Button;
public showAni() { public showAni() {
if (this.isShowing) return; if (this.isShowing) return;
this.isShowing = true; this.isShowing = true;
...@@ -39,6 +35,13 @@ export class StartPanel extends Panel { ...@@ -39,6 +35,13 @@ export class StartPanel extends Panel {
}); });
} }
closeBtn: FYGE.Button;
startBtn: FYGE.Button;
startBtn2: FYGE.Button;
tipsTex: FYGE.TextField;
checkTex: FYGE.TextField;
prizeImg: Sprite;
initUi() { initUi() {
this.checkTex.textWidth = 750; this.checkTex.textWidth = 750;
this.checkTex.textAlign = TEXT_ALIGN.CENTER; this.checkTex.textAlign = TEXT_ALIGN.CENTER;
...@@ -47,12 +50,13 @@ export class StartPanel extends Panel { ...@@ -47,12 +50,13 @@ export class StartPanel extends Panel {
this.startBtn.visible = !this.data.isPlayed; this.startBtn.visible = !this.data.isPlayed;
this.startBtn2.visible = this.data.isPlayed; this.startBtn2.visible = this.data.isPlayed;
this.tipsTex.visible = !this.data.isPlayed;
this.addChild(new StartTarget(this.data.level)) this.addChild(new StartTarget(this.data.level))
.position.set(0, 682); .position.set(0, 682);
// console.log(this.data); this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${this.data.level}`]);
this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 750 / 2;
} }
start(data) { start(data) {
...@@ -64,17 +68,18 @@ export class StartPanel extends Panel { ...@@ -64,17 +68,18 @@ export class StartPanel extends Panel {
if (!this.data.isPlayed && Tools.gameData.power <= 0) {// 体力不足 if (!this.data.isPlayed && Tools.gameData.power <= 0) {// 体力不足
showPanel(NoEnergyPanel); showPanel(NoEnergyPanel);
this.enableMouseEvt(true); this.enableMouseEvt(true);
this.hidePanel();
return; return;
} }
sendTbNet(TbNetName.dojoin, {level: this.data.level}, sendTbNet(TbNetName.dojoin, {level: this.data.level},
(success, res) => { (success, res) => {
this.enableMouseEvt(true); this.enableMouseEvt(true);
if (!success) return; if (!success) return;
Tools.gameData.power = res.data.power;
// 访问页面埋点 // 访问页面埋点
sendTbNet(TbNetName.reportAnalytics, {logkey: 'join'}); sendTbNet(TbNetName.reportAnalytics, {logkey: 'join'});
Tools.gameData.power = res.data.power;
changeScene(PlayScene, {chapter: this.data.level}); changeScene(PlayScene, {chapter: this.data.level});
this.hidePanel(); this.hidePanel();
} }
...@@ -94,6 +99,7 @@ export class StartPanel extends Panel { ...@@ -94,6 +99,7 @@ export class StartPanel extends Panel {
} }
} }
const pos = [ const pos = [
[325], [325],
[240, 410], [240, 410],
...@@ -151,3 +157,4 @@ export class StartTargetItem extends Container { ...@@ -151,3 +157,4 @@ export class StartTargetItem extends Container {
.to({scaleX: 1, scaleY: 1}, 500, Ease.backOut) .to({scaleX: 1, scaleY: 1}, 500, Ease.backOut)
} }
} }
import { Panel } from "../../module/views/Panel";
import MouseEvent = FYGE.MouseEvent;
import { changeScene, showPanel } from "../../module/ctrls";
import { PlayScene } from "../scene/PlayScene";
import { StartTarget } from "./StartPanel";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import Sprite = FYGE.Sprite;
import Texture = FYGE.Texture;
import { Tools } from "../Tools";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { NoEnergyPanel } from "./NoEnergyPanel";
export class StartPanelPrize extends Panel {
get groupNames() {
return ["StartPanelPrize"]
}
get skinName() {
return "StartPanelPrize"
}
public showAni() {
if (this.isShowing) return;
this.isShowing = true;
this.anchor.set(375, 812);
Tween.get(this)
.set({scaleX: 0, scaleY: 0})
.to({scaleX: 1, scaleY: 1}, 400, Ease.backOut)
.call(() => {
this.isShowing = false;
});
}
closeBtn: FYGE.Button;
startBtn: FYGE.Button;
startBtn2: FYGE.Button;
tipsTex: FYGE.TextField;
checkTex: FYGE.TextField;
prizeImg: Sprite;
initUi() {
this.checkTex.textWidth = 750;
this.checkTex.textAlign = TEXT_ALIGN.CENTER;
this.checkTex.x = 0;
this.checkTex.text = `第\t${this.data.level}\t关`;
this.startBtn.visible = !this.data.isPlayed;
this.startBtn2.visible = this.data.isPlayed;
this.addChild(new StartTarget(this.data.level))
.position.set(0, 682);
this.prizeImg.texture = Texture.fromUrl(Tools.baseInfo.levelPrize[`level_${this.data.level}`]);
this.prizeImg.anchorTexture.x = 0.5;
this.prizeImg.x = 750 / 2;
}
start(data) {
super.start();
}
private startGame() {
this.enableMouseEvt(false);
if (!this.data.isPlayed && Tools.gameData.power <= 0) {// 体力不足
showPanel(NoEnergyPanel);
this.enableMouseEvt(true);
return;
}
sendTbNet(TbNetName.dojoin, {level: this.data.level},
(success, res) => {
this.enableMouseEvt(true);
if (!success) return;
// 访问页面埋点
sendTbNet(TbNetName.reportAnalytics, {logkey: 'join'});
Tools.gameData.power = res.data.power;
changeScene(PlayScene, {chapter: this.data.level});
this.hidePanel();
}
);
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(MouseEvent.CLICK, this.startGame, this);
this.startBtn2.addEventListener(MouseEvent.CLICK, this.startGame, this);
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(MouseEvent.CLICK, this.startGame, this);
this.startBtn2.removeEventListener(MouseEvent.CLICK, this.startGame, this);
}
}
import { Panel } from "../../module/views/Panel";
import { layers } from "../../module/views/layers";
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";
import { RES } from "../../module/RES";
import { showWaiting, hideWaiting, showToast, getCurrentScene } from "../../module/ctrls";
//任务类型(member/invites/browseGoods/follow)
export enum TaskType {
member = "member",
invites = "invites",
browseGoods = "browseGoods",
follow = "follow"
}
interface TaskData {
/**
* 任务类型
*/
taskType: TaskType,
/**
* 加入会员的链接
*/
value?: string,
/**
* 奖励的体力值
*/
rewards: number
/**
* 当前完成次数
*/
todayCompleteTimes: number
/**
* 需要完成次数
*/
times: number
/**
* 待领取体力值
*/
waitReceive: number
}
export class TaskPanel extends Panel {
get groupNames() {
return ["TaskPanel"]
}
get skinName() {
return "TaskPanel"
}
public showAni() {
if (this.isShowing) return;
this.isShowing = true;
let oriY = 1624 - this.height - layers.stageOffsetY - 580;
this.y = layers.stageHeight + this.height;
Tween.get(this)
.to({ y: oriY }, 500, Ease.quartOut)
.call(() => {
this.isShowing = false;
});
}
closeBtn: Button;
taskBtn1: Button; // 浏览商品
taskBtn2: Button; // 邀请
taskBtn3: Button; // 关注
taskBtn4: Button; // 加入会员
[TaskType.browseGoods]: CusButton;
[TaskType.invites]: CusButton;
[TaskType.follow]: CusButton;
[TaskType.member]: CusButton;
initUi() {
//移除了吧,只需要位置
this.removeChild(this.taskBtn1)
this.removeChild(this.taskBtn2)
this.removeChild(this.taskBtn3)
this.removeChild(this.taskBtn4);
//四个按钮,先默认状态,然后start里刷任务接口
var ps = [this.taskBtn1, this.taskBtn2, this.taskBtn3, this.taskBtn4];
[TaskType.browseGoods, TaskType.invites, TaskType.follow, TaskType.member].forEach((e, i) => {
this[e] = this.addChild(new CusButton(e))
this[e].position.copy(ps[i].position);
this[e].visible = false;
})
}
start(data) {
super.start();
this.updateTask();
}
public updateTask() {
showWaiting();
sendTbNet(TbNetName.getTaskList, null,
(success, res) => {
hideWaiting();
if (!success) return;
var data: TaskData[] = res.data;
data.forEach((d) => {
this[d.taskType].visible = true;
//如果有入会链接
if (d.value) this[d.taskType].memberUrl = d.value;
//如果有待领取的
if (d.waitReceive) {
this[d.taskType].canGetStatus = true;
this[d.taskType].enabled = true;
}
//如果已全部完成
else if (d.todayCompleteTimes == d.times) {
this[d.taskType].canGetStatus = false;
this[d.taskType].enabled = false;
}
//去完成状态
else {
this[d.taskType].canGetStatus = false;
this[d.taskType].enabled = true;
}
})
}
);
}
initEvents() {
super.initEvents();
GDispatcher.addEventListener(G_EVENT.UPDATE_TASK, this.updateTask, this);
}
removeEvents() {
super.removeEvents();
GDispatcher.removeEventListener(G_EVENT.UPDATE_TASK, this.updateTask, this);
}
}
class CusButton extends Button {
private type: TaskType
private _canGetStatus: boolean;
get canGetStatus() {
return this._canGetStatus
}
set canGetStatus(value) {
this._canGetStatus = value;
var t: [FYGE.Texture, FYGE.Texture]
if (value) {//能领取时换图
t = [
RES.getRes("待领取.png"),
RES.getRes("待领取.png"),
]
} else {
t = [
RES.getRes("去完成.png"),
RES.getRes("去完成灰.png"),
]
}
this.changeTexture(t[0], t[0], t[1])
}
//外部自行赋值
memberUrl: string
constructor(type: TaskType) {
var t = [
RES.getRes("去完成.png"),
RES.getRes("去完成灰.png"),
]
super(t[0], t[0], t[1])
this.type = type;
//事件统一写吧
this.addEventListener(MouseEvent.CLICK, this.onClick, this)
}
onClick() {
if (this.canGetStatus) {//能领取,发接口
showWaiting();
sendTbNet(
TbNetName.receiveTaskRewards,
{ taskType: this.type },
(s, res) => {
hideWaiting();
if (s) {
//领取成功,TODO显示啥toast
showToast("领取成功");
//刷新任务列表
GDispatcher.dispatchEvent(G_EVENT.UPDATE_TASK);
//刷新体力
Tools.gameData.power = res.data.power;
getCurrentScene().updateScene()
}
}
)
} else {//发对应任务方法
//都弄个延时
Tools.btnDelay(this)
switch (this.type) {
case TaskType.follow:
GDispatcher.removeAllEventListenerByType(TbNetName.favorShop);
sendTbNet(TbNetName.favorShop, {},
(success, res) => {
if (!success) return;
//关注成功了,发完成接口,注意小程序那边就不用发接口了
sendTbNet(
TbNetName.completeTask,
{ taskType: TaskType.follow },
(success, res) => {
if (!success) return;
GDispatcher.dispatchEvent(G_EVENT.UPDATE_TASK);
}
);
}, true
);
break;
case TaskType.browseGoods:
sendTbNet(
TbNetName.navigateTo,
{ url: '/pages/browseProductList/browseProductList' },
() => { },
true
);
break;
case TaskType.invites:
sendTbNet(
TbNetName.showSharePanel,
{ openId: Tools.globalData.openId },//注意小程序那边处理参数
() => { },
true
);
break;
case TaskType.member:
sendTbNet(
TbNetName.navigateToOutside,
{ url: this.memberUrl },//下单页面路径待写
() => { },
true
);
break;
}
if (this.type == TaskType.browseGoods || this.type == TaskType.member) {
//都需要添加事件,回来时,派发事件刷任务接口
GDispatcher.once(G_EVENT.ON_SHOW, () => {
GDispatcher.dispatchEvent(G_EVENT.UPDATE_TASK)
}, this)
}
}
}
}
\ No newline at end of file
import { Panel } from "../../module/views/Panel";
import { PropType } from "../something/enum/PropType";
import { getTbData, TbNetName } from "../TaoBaoNet";
import { Tools } from "../Tools";
import { showWaiting, hideWaiting, getCurrentScene, showPanel, showToast } from "../../module/ctrls";
import { JoinPanel } from "./JoinPanel";
import { ExchangeSucPanel } from "./ExchangeSucPanel";
export class ToolsOutPanel extends Panel {
get groupNames() {
return ["ToolsOutPanel"]
}
get skinName() {
return "ToolsOutPanel"
}
get closeBtns() {
return [this.consideBtn, this.closeBtn]
}
consideBtn: FYGE.Button;
sureBtn: FYGE.Button;
closeBtn: FYGE.Button;
msgTxt: FYGE.TextField;
data: { type: PropType, showSucPanel: boolean }
initUi() {
// 文案居中
Tools.changeTextAlign(this.msgTxt, FYGE.TEXT_ALIGN.CENTER, 500)
}
start(data) {
super.start();
//文案按接口返回的来
this.msgTxt.text = "要消耗" +
getTbData(TbNetName.getActivityBaseInfoById).data.buyCredits[data.type] +
"积分兑换吗?"
}
initEvents() {
super.initEvents();
this.sureBtn.addEventListener(FYGE.MouseEvent.CLICK, async () => {
//购买道具
showWaiting();
var res = await Tools.exchange(this.data.type);
hideWaiting();
//如果是链接,弹出加入会员弹框
if (typeof res == "string") {
showPanel(JoinPanel, { url: res })
}
//成功了,关闭弹框,修改道具信息
else if (res) {
// showToast("兑换成功")
if (this.data.showSucPanel) showPanel(ExchangeSucPanel)
this.hidePanel();
getCurrentScene().updateScene()
}
}, this)
}
removeEvents() {
super.removeEvents();
}
}
...@@ -11,7 +11,7 @@ export class UseStep extends Panel { ...@@ -11,7 +11,7 @@ export class UseStep extends Panel {
}; };
initUi() { initUi() {
this.addChild(Tools.getSprite('useStepBg.png')).position.set(86, 512); this.addChild(Tools.getSprite('panelBgS.png')).position.set(86, 512);
this.addChild(Tools.getText( /// TODO 道具加步数 this.addChild(Tools.getText( /// TODO 道具加步数
`确定要使用步数道具+5步数吗?`, 33, '#744f1d', `确定要使用步数道具+5步数吗?`, 33, '#744f1d',
......
...@@ -919,7 +919,7 @@ export class PlayScene extends Scene { ...@@ -919,7 +919,7 @@ export class PlayScene extends Scene {
// ele.type != ElementType.ROCK && // ele.type != ElementType.ROCK &&
ele.type != ElementType.LOLLIPOP) { ele.type != ElementType.LOLLIPOP) {
this.elementContainer.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, fun, this); this.elementContainer.removeEventListener(FYGE.MouseEvent.MOUSE_DOWN, fun, this);
var index = ele.index; const index = ele.index;
this.sendPropUse(prop, index); this.sendPropUse(prop, index);
} }
}, this) }, this)
......
...@@ -10,7 +10,6 @@ import FrameAni = FYGE.FrameAni; ...@@ -10,7 +10,6 @@ import FrameAni = FYGE.FrameAni;
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import { showPanel } from "../../../module/ctrls"; import { showPanel } from "../../../module/ctrls";
import { StartPanel } from "../../panels/StartPanel"; import { StartPanel } from "../../panels/StartPanel";
import { StartPanelPrize } from "../../panels/StartPanelPrize";
import BitmapText = FYGE.BitmapText; import BitmapText = FYGE.BitmapText;
export enum CHECK_TYPE { export enum CHECK_TYPE {
...@@ -179,7 +178,7 @@ export default class CheckBtn extends Container { ...@@ -179,7 +178,7 @@ export default class CheckBtn extends Container {
public clickStart() { public clickStart() {
console.log(`关卡:${this.checkNum}`); console.log(`关卡:${this.checkNum}`);
console.log(this.checkData); console.log(this.checkData);
showPanel(StartPanelPrize, this.checkData); showPanel(StartPanel, this.checkData);
} }
} }
......
...@@ -7,7 +7,6 @@ import { Tools } from "../../Tools"; ...@@ -7,7 +7,6 @@ import { Tools } from "../../Tools";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
import { showPanel } from "../../../module/ctrls"; import { showPanel } from "../../../module/ctrls";
import { RulePanel } from "../../panels/RulePanel"; import { RulePanel } from "../../panels/RulePanel";
import { TaskPanel } from "../../panels/TaskPanel";
import { sendTbNet, TbNetName } from "../../TaoBaoNet"; import { sendTbNet, TbNetName } from "../../TaoBaoNet";
export default class MapUI extends Container { export default class MapUI extends Container {
...@@ -53,8 +52,7 @@ export default class MapUI extends Container { ...@@ -53,8 +52,7 @@ export default class MapUI extends Container {
break; break;
case this.taskBtn: case this.taskBtn:
console.log('任务'); Tools.openTask();
showPanel(TaskPanel);
break; break;
} }
} }
......
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