Commit 15aadf7b authored by wildfirecode's avatar wildfirecode

1

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