Commit 15aadf7b authored by wildfirecode's avatar wildfirecode

1

parent aac4d300
...@@ -2,9 +2,10 @@ import { DataManager } from "../libs/tw/manager/DataManager"; ...@@ -2,9 +2,10 @@ import { DataManager } from "../libs/tw/manager/DataManager";
interface IHomeData { interface IHomeData {
levels:{levelNum,maxScore,stars}[]; levels:{levelNum,maxScore,stars}[];
totalRemainStarts; totalRemainStarts;
canReceiveTreasureBoxNum;
wealth; wealth;
heartNums; heartNums;
shared; askForEnergy:boolean;
props:{propType,nums}[] props:{propType,nums}[]
} }
export default ():IHomeData=>{ export default ():IHomeData=>{
......
...@@ -2,6 +2,7 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase"; ...@@ -2,6 +2,7 @@ import ComponentBase from "../../libs/new_wx/components/ComponentBase";
import MapScene from "./MapScene"; import MapScene from "./MapScene";
import MapStarComp from "./MapStarComp"; import MapStarComp from "./MapStarComp";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import setGray from "../setGray";
export default class MapBottomPart extends ComponentBase { export default class MapBottomPart extends ComponentBase {
static LEVEL_NUMS = 12; static LEVEL_NUMS = 12;
...@@ -9,13 +10,14 @@ export default class MapBottomPart extends ComponentBase { ...@@ -9,13 +10,14 @@ export default class MapBottomPart extends ComponentBase {
super.start(); super.start();
for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) { for (let i = 0; i < MapBottomPart.LEVEL_NUMS; i++) {
if (i == MapBottomPart.LEVEL_NUMS - 1) { if (i == MapBottomPart.LEVEL_NUMS - 1) {
setGray(this.getIcon(i));
this.getIcon(i).addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this.getIcon(i).addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
showToast('敬请期待更多关卡~'); showToast('敬请期待更多关卡~');
}, this); }, this);
return; return;
} }
const levelOrder = i + 1 + (70 - MapBottomPart.LEVEL_NUMS); const levelOrder = i + 1 + (70 - MapBottomPart.LEVEL_NUMS) + 1;
const icon = MapScene.iconHash[levelOrder] = this.getIcon(i); const icon = MapScene.iconHash[levelOrder] = this.getIcon(i);
const star = new MapStarComp(); const star = new MapStarComp();
......
import Scene from "../../libs/new_wx/components/Scene"; import Scene from "../../libs/new_wx/components/Scene";
import setGlow from "../setGlow";
import MapBottomPart from "./MapBottomPart";
import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes"; import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import { NetManager } from "../../libs/tw/manager/NetManager";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import getShowOffPic from "../getShowOffPic";
import getSharePic from "../getSharePic";
import { getlogItem } from "../Main"; import { getlogItem } from "../Main";
import { NetManager } from "../../libs/tw/manager/NetManager"; import setGlow from "../setGlow";
import MapBottomPart from "./MapBottomPart";
import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -65,13 +63,13 @@ export default class MapScene extends Scene { ...@@ -65,13 +63,13 @@ export default class MapScene extends Scene {
} }
disableIcon(level) { disableIcon(level) {
this.setGray(MapScene.iconHash[level]); this.setGray(level);
MapScene.starHash[level].visible = false; MapScene.starHash[level].visible = false;
} }
enableIcon(level) { enableIcon(level) {
MapScene.iconHash[level].filters = []; MapScene.iconHash[level].filters = [];
MapScene.starHash[level].visible = false; MapScene.starHash[level].visible = true;
} }
showLog() { showLog() {
...@@ -88,6 +86,10 @@ export default class MapScene extends Scene { ...@@ -88,6 +86,10 @@ export default class MapScene extends Scene {
this['bloodTxt'].text = `${homeData.heartNums}/5`; this['bloodTxt'].text = `${homeData.heartNums}/5`;
this['goldTxt'].text = `${homeData.wealth}`; this['goldTxt'].text = `${homeData.wealth}`;
this['totalStarTxt'].text = `${homeData.totalRemainStarts}/210`; this['totalStarTxt'].text = `${homeData.totalRemainStarts}/210`;
this['boxNumsTxt'].text = `${homeData.canReceiveTreasureBoxNum}`;
for (let j = 0; j < 70; j++) {
this.disableIcon(j + 1);
}
for (let i = 0; i < homeData.levels.length; i++) { for (let i = 0; i < homeData.levels.length; i++) {
const level = homeData.levels[i]; const level = homeData.levels[i];
const star = MapScene.starHash[i + 1]; const star = MapScene.starHash[i + 1];
...@@ -132,6 +134,8 @@ export default class MapScene extends Scene { ...@@ -132,6 +134,8 @@ export default class MapScene extends Scene {
setGray(order: number) { setGray(order: number) {
const d = MapScene.iconHash[order]; const d = MapScene.iconHash[order];
const colorMatrix = [ const colorMatrix = [
0.3, 0.6, 0, 0, 0, 0.3, 0.6, 0, 0, 0,
0.3, 0.6, 0, 0, 0, 0.3, 0.6, 0, 0, 0,
...@@ -143,4 +147,4 @@ export default class MapScene extends Scene { ...@@ -143,4 +147,4 @@ export default class MapScene extends Scene {
} }
get skinKey() { return 'Map' } get skinKey() { return 'Map' }
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ export default class BloodPanel extends Panel { ...@@ -22,7 +22,7 @@ export default class BloodPanel extends Panel {
this['bloodTxt'].text = `你的可用体力值为:${homeData.heartNums}`; this['bloodTxt'].text = `你的可用体力值为:${homeData.heartNums}`;
const data = getHomeData(); const data = getHomeData();
this['invitTxt'].text = `(已领0/1)`; this['invitTxt'].text = `(已领0/1)`;
if (data.shared) if (data.askForEnergy)
this['invitTxt'].text = `(已领1/1)`; this['invitTxt'].text = `(已领1/1)`;
} }
...@@ -49,7 +49,7 @@ export default class BloodPanel extends Panel { ...@@ -49,7 +49,7 @@ export default class BloodPanel extends Panel {
onTapInvite() { onTapInvite() {
NetManager.ins.clickLog(getlogItem(4)); NetManager.ins.clickLog(getlogItem(4));
const data = getHomeData(); const data = getHomeData();
if (data.shared) { if (data.askForEnergy) {
showToast('今日已经分享过了.'); showToast('今日已经分享过了.');
return; return;
} }
......
{ {
"code":"0000000000", "code":"0000000000",
"data":{ "data":{
"shared":1, "askForEnergy":true,
"canReceiveTreasureBoxNum":101,
"heartNums":1, "heartNums":1,
"props" :[ "props" :[
{"propType":1,"nums":1}, {"propType":1,"nums":1},
...@@ -13,6 +14,11 @@ ...@@ -13,6 +14,11 @@
"maxScore":23, "maxScore":23,
"stars":3 "stars":3
}, },
{
"levelNum":3,
"maxScore":23,
"stars":1
},
{ {
"levelNum":2, "levelNum":2,
"maxScore":45, "maxScore":45,
......
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