Commit 20ed613c authored by wildfirecode's avatar wildfirecode

1

parent eee8208d
......@@ -57,7 +57,7 @@
window['duiba'] = '';
// window['duiba'] = '/duiba';
window['registerWX']=(result)=>{console.log(result)}
window['price1']=1;
window['price1']=123;
window['price2']=2;
window['price3']=3;
window['price4']=4;
......
......@@ -3,6 +3,7 @@ interface IHomeData {
levels:{levelNum,maxScore,stars}[];
totalStars;
canReceiveTreasureBoxNum;
isGetAllTreasureBox;
wealth;
remainEnargy;
nextRangeStarsNum;
......
......@@ -223,6 +223,7 @@ export default class MapScene extends Scene {
this['boxiconWrapper'].visible = homeData.canReceiveTreasureBoxNum > 0;
this['totalStarTxt'].text = `${homeData.totalStars}/${homeData.nextRangeStarsNum}`;
this['boxNumsTxt'].text = `${homeData.canReceiveTreasureBoxNum}`;
this['treasureboxBtn'].visible= !homeData.isGetAllTreasureBox;
}
updateScene() {
......@@ -370,6 +371,7 @@ export default class MapScene extends Scene {
homeData.canReceiveTreasureBoxNum = boxdata.canReceiveTreasureBoxNum;
homeData.nextRangeStarsNum = boxdata.nextRangeStarsNum;
homeData.totalStarts = boxdata.totalStarts;
homeData.isGetAllTreasureBox = boxdata.isGetAllTreasureBox;
this.updateBox();
const data = DataManager.ins.getData('hc_openTreasureBox').data;
NetManager.ins.getPlugOrderStatus((s) => {
......
......@@ -5,11 +5,18 @@ import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import { Chapters } from "../something/Chapters";
import { PassType } from "../something/enum/PassType";
import { getPropNums } from "../getHomeData";
import getHomeData, { getPropNums } from "../getHomeData";
import PropType from "../PropType";
import hdGameDoDojoin from "../../libs/new_tw/ctrls/hdGameDoDojoin";
import TargetItemRenderer from "./TargetItemRenderer";
import { ElementType } from "../something/enum/ElementType";
import { iswx } from "../iswx";
import { getShareUrl } from "../getSharePic";
import { showShare } from "../shareCtrl";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import wait from "../../libs/new_tc/wait";
export default class StartPanel extends Panel {
private _level;
......@@ -61,6 +68,27 @@ export default class StartPanel extends Panel {
}
onTap_startBtn() {
const homeData = getHomeData();
if (homeData.remainEnargy <= 0) {
if (homeData.askForEnergy) {
PanelCtrl.instance.show('bloodPanel');
} else {
if (iswx()) {
getShareUrl(this.stage);
} else
showShare(1);
NetManager.ins.hc_askForEnergy((success) => {
NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
wait(2000).then(() => {
showToast('分享成功~');
});
})
}
return;
}
// Loading.instace.show();
this.touchChildren = false;
this.touchEnabled = false;
......@@ -89,7 +117,9 @@ export default class StartPanel extends Panel {
this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE, { chapter: this._level });
}
}, this._level)
}, this._level);
}
onTap_buy1btn() {
PanelCtrl.instance.show('Buy1');
......
......@@ -4,6 +4,7 @@
"desc": "OK",
"timestamp": 1566885811031,
"data": {
"isGetAllTreasureBox":0,
"wealth": 7960,
"totalStars": 145,
"levels": [
......@@ -153,7 +154,7 @@
"num": 10
}
],
"remainEnargy": 9979,
"remainEnargy": 0,
"askForEnergy": false,
"canReceiveTreasureBoxNum": 10,
"nextRangeStarsNum": 150
......
......@@ -6,6 +6,7 @@
"data": {
"canReceiveTreasureBoxNum": 99,
"nextRangeStarsNum": 25,
"isGetAllTreasureBox": 1,
"orderNum": "1078836456709300393",
"totalStars": 12
}
......
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