Commit 20ed613c authored by wildfirecode's avatar wildfirecode

1

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