Commit 8d4c9546 authored by wildfirecode's avatar wildfirecode

1

parent 4b79e829
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<body> <body>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" <div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main"
data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="750" data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="750"
data-content-height="1624" data-multi-fingered="2" data-show-fps="true" data-show-log="false" data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="false"
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"> data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div> </div>
......
...@@ -446,6 +446,20 @@ export class NetManager extends ABNetManager { ...@@ -446,6 +446,20 @@ export class NetManager extends ABNetManager {
}; };
this.send(net); this.send(net);
} }
hc_openTreasureBox(callback: Function): void {
const net: INetData = {
name: 'hc_openTreasureBox',
uri: '/customActivity/happyclear/openTreasureBox',
type: 'post',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId
},
hideMsg: true,
callback: callback
};
this.send(net);
}
getOrderStatus(callback: Function, orderId: number, pollingCheck?: Function, pollingCount = 10): void { getOrderStatus(callback: Function, orderId: number, pollingCheck?: Function, pollingCount = 10): void {
const param: any = { const param: any = {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<e:Label id="totalStarTxt" text="210/210" x="34.68" verticalAlign="middle" textAlign="left" size="24" verticalCenter="1.5"/> <e:Label id="totalStarTxt" text="210/210" x="34.68" verticalAlign="middle" textAlign="left" size="24" verticalCenter="1.5"/>
</e:Group> </e:Group>
<e:Image id="box" source="宝箱_png" right="34" verticalCenter="3" anchorOffsetX="34" anchorOffsetY="34"/> <e:Image id="box" source="宝箱_png" right="34" verticalCenter="3" anchorOffsetX="34" anchorOffsetY="34"/>
<e:Group id="boxiconWrapper" x="193.68" y="34.86"> <e:Group id="boxiconWrapper" x="193.68" y="34.86" touchEnabled="false" touchChildren="false">
<e:Image x="8.32" y="0" source="iconbg_png"/> <e:Image x="8.32" y="0" source="iconbg_png"/>
<e:Label id="boxNumsTxt" text="88" x="0" verticalAlign="middle" textAlign="center" size="18" width="46" y="6.14"/> <e:Label id="boxNumsTxt" text="88" x="0" verticalAlign="middle" textAlign="center" size="18" width="46" y="6.14"/>
</e:Group> </e:Group>
......
...@@ -8,6 +8,7 @@ import setGlow from "../setGlow"; ...@@ -8,6 +8,7 @@ import setGlow from "../setGlow";
import MapBottomPart from "./MapBottomPart"; import MapBottomPart from "./MapBottomPart";
import MapRpeatPart from "./MapRpeatPart"; import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart"; import MapTopPart from "./MapTopPart";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -42,8 +43,6 @@ export default class MapScene extends Scene { ...@@ -42,8 +43,6 @@ export default class MapScene extends Scene {
this.scrollGroup.addChild(data.bottom); this.scrollGroup.addChild(data.bottom);
data.bottom.y = data.top.height + (data.list.length * data.list[0].height); data.bottom.y = data.top.height + (data.list.length * data.list[0].height);
// this.setGray(1);
for (const key in MapScene.iconHash) { for (const key in MapScene.iconHash) {
const element = MapScene.iconHash[key]; const element = MapScene.iconHash[key];
element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
...@@ -51,15 +50,9 @@ export default class MapScene extends Scene { ...@@ -51,15 +50,9 @@ export default class MapScene extends Scene {
NetManager.ins.clickLog(getlogItem(19)) NetManager.ins.clickLog(getlogItem(19))
}, this) }, this)
} }
// setTimeout(() => {
// PanelCtrl.instance.show('quit');
// // getSharePic(this);
// }, 2000);
this.updateHomeData(); this.updateHomeData();
this.showLog(); this.showLog();
this.updateBox();
} }
disableIcon(level) { disableIcon(level) {
...@@ -78,6 +71,13 @@ export default class MapScene extends Scene { ...@@ -78,6 +71,13 @@ export default class MapScene extends Scene {
NetManager.ins.showLog(getlogItem(5)); NetManager.ins.showLog(getlogItem(5));
} }
updateBox() {
const homeData = getHomeData();
this['boxiconWrapper'].visible = homeData.canReceiveTreasureBoxNum > 0;
this['totalStarTxt'].text = `${homeData.totalStarts}/${homeData.canReceiveTreasureBoxNum}`;
this['boxNumsTxt'].text = `${homeData.canReceiveTreasureBoxNum}`;
}
updateScene() { updateScene() {
this.updateHomeData(); this.updateHomeData();
} }
...@@ -85,8 +85,7 @@ export default class MapScene extends Scene { ...@@ -85,8 +85,7 @@ export default class MapScene extends Scene {
const homeData = getHomeData(); const homeData = getHomeData();
this['bloodTxt'].text = `${homeData.remainEnargy}/5`; this['bloodTxt'].text = `${homeData.remainEnargy}/5`;
this['goldTxt'].text = `${homeData.wealth}`; this['goldTxt'].text = `${homeData.wealth}`;
this['totalStarTxt'].text = `${homeData.totalStarts}/${homeData.canReceiveTreasureBoxNum}`;
this['boxNumsTxt'].text = `${homeData.canReceiveTreasureBoxNum}`;
for (let j = 0; j < 70; j++) { for (let j = 0; j < 70; j++) {
this.disableIcon(j + 1); this.disableIcon(j + 1);
} }
...@@ -107,7 +106,26 @@ export default class MapScene extends Scene { ...@@ -107,7 +106,26 @@ export default class MapScene extends Scene {
this['bloodBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_bloodBtn, this) this['bloodBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_bloodBtn, this)
this['settingBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.toggleSettings, this) this['settingBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.toggleSettings, this)
this['shopBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_shopBtn, this) this['shopBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_shopBtn, this)
this['questionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this) this['questionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this);
this['box'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_box, this);
}
onTap_box() {
const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) {
this['box'].touchEnabled = false;
NetManager.ins.hc_openTreasureBox((success) => {
this['box'].touchEnabled = true;
if(success) {
const boxdata = DataManager.ins.getData('hc_openTreasureBox').data;
const homeData = DataManager.ins.getData('hc_home').data;
homeData.canReceiveTreasureBoxNum=boxdata.canReceiveTreasureBoxNum;
homeData.nextRangeStarsNum=boxdata.nextRangeStarsNum;
homeData.totalStarts=boxdata.totalStarts;
this.updateBox();
}
})
}
} }
onTap_questionBtn() { onTap_questionBtn() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"code":"0000000000", "code":"0000000000",
"data":{ "data":{
"askForEnergy":true, "askForEnergy":true,
"canReceiveTreasureBoxNum":23, "canReceiveTreasureBoxNum":10,
"nextRangeStarsNum":10, "nextRangeStarsNum":10,
"remainEnargy":11, "remainEnargy":11,
"remainProp" :[ "remainProp" :[
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"code":"0000000000", "code":"0000000000",
"data":{ "data":{
"canReceiveTreasureBoxNum":2, "canReceiveTreasureBoxNum":2,
"nextRangeStarsNum":25, "nextRangeStarsNum":99,
"totalStarts":0,
"orderNum":"2323" "orderNum":"2323"
}, },
"desc":"OK", "desc":"OK",
......
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