Commit 457eabf4 authored by wildfirecode's avatar wildfirecode

1

parent bbb86211
......@@ -478,6 +478,13 @@ export default class MainBase extends eui.UILayer {
})
}
getInviteInfo() {
return new Promise((r) => {
NetManager.ins.getInviteInfo(() => {
r();
})
});
}
getSignConfig() {
return new Promise((r) => {
......@@ -518,6 +525,14 @@ export default class MainBase extends eui.UILayer {
});
}
hbRainBaseInfo() {
return new Promise((r) => {
NetManager.ins.hbRainBaseInfo(async () => {
r();
});
});
}
hcHome() {
return new Promise((r) => {
NetManager.ins.hc_home(() => {
......@@ -545,6 +560,8 @@ export default class MainBase extends eui.UILayer {
this.getBackReward(),
this.hcRedBoobBaseInfo(),
this.getSignConfig(),
this.getInviteInfo(),
this.hbRainBaseInfo(),
]);
//获取分享加体力的shareCode,不影响初始化场景,不进await
NetManager.ins.getUserShareCode(() => { })
......
......@@ -33,6 +33,10 @@ import TaskCenterIcon from "./icon/TaskCenterIcon";
import HbBombIcon from "./icon/HbBombIcon";
import { createEffect1MovieClip } from "../effect/createEffect1";
import { CodeChannels } from "../panels/ShareCodePanel";
import getIconGroup from "./getIconGroup";
import getSignBtn from "./getSignBtn";
import getAdBtn from "./getAdBtn";
import getInviteBtn from "./getInviteBtn";
let doHelpFlag = false;
// let doScratchHelpFlag = false;
......@@ -182,6 +186,8 @@ export default class MapScene extends Scene {
this.updateMyInfo();
this.updateAdData();
GDispatcher.dispatchEvent("getInviteInfo"); // 查询邀请信息,控制邀请有礼角标
this.updateIconLayout();
this['avatar'].mask = this['avatarMask'];
if (getBgOn() && MapScene['firstPlayBgTag'] == true) {
......@@ -803,6 +809,7 @@ export default class MapScene extends Scene {
if (!success || !res.data) {
return;
}
const flag = res.data.completeFlag;
switch (true) {
case (flag == 0): // 未完成
......@@ -870,11 +877,18 @@ export default class MapScene extends Scene {
PanelCtrl.instance.show('invite', res.data);
})
}
updateIcon(){
//1234变化的情况
updateIconLayout() {
const btnList = [];
if (getSignBtn()) btnList.push('signGroup');
if (getInviteBtn()) btnList.push('inviteGroup');
if (getAdBtn()) btnList.push('adBtn');
if (getIconGroup()) btnList.push('activitys');//0不显示,否则显示
btnList.forEach((btnName, index) => {
const btn = this[btnName];
btn.y = 172.57 + index * 150;
});
this['guideInner'].y = this['activitys'].y - 273;
}
//////////////////////////////////////// 邀请有礼角标 //////////////////////////////////////////////
/**
......@@ -888,6 +902,7 @@ export default class MapScene extends Scene {
if (!success || !res.data) {
return;
}
this.updateIconLayout();
const flag = res.data.completeFlag;
if (this.inviteTimer) {
this.inviteTimer.stop();
......@@ -897,8 +912,8 @@ export default class MapScene extends Scene {
this["inviteGroup"].visible = true;
this["inviteGroup"].touchEnabled = true;
if (!mapAdvert || mapAdvert.enable == false) {
this['activitys'].y = 458;
this['guideInner'].y = 185;
// this['activitys'].y = 458;
// this['guideInner'].y = 185;
}
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = true;
......@@ -914,8 +929,8 @@ export default class MapScene extends Scene {
this["inviteGroup"].visible = true;
this["inviteGroup"].touchEnabled = true;
if (!mapAdvert || mapAdvert.enable == false) {
this['activitys'].y = 458;
this['guideInner'].y = 185;
// this['activitys'].y = 458;
// this['guideInner'].y = 185;
}
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
......@@ -926,8 +941,8 @@ export default class MapScene extends Scene {
this["inviteGroup"].visible = true;
this["inviteGroup"].touchEnabled = true;
if (!mapAdvert || mapAdvert.enable == false) {
this['activitys'].y = 458;
this['guideInner'].y = 185;
// this['activitys'].y = 458;
// this['guideInner'].y = 185;
}
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = false;
......@@ -937,8 +952,8 @@ export default class MapScene extends Scene {
this["inviteGroup"].visible = true;
this["inviteGroup"].touchEnabled = true;
if (!mapAdvert || mapAdvert.enable == false) {
this['activitys'].y = 458;
this['guideInner'].y = 185;
// this['activitys'].y = 458;
// this['guideInner'].y = 185;
}
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = true;
......@@ -949,8 +964,8 @@ export default class MapScene extends Scene {
this["inviteGroup"].visible = true;
this["inviteGroup"].touchEnabled = true;
if (!mapAdvert || mapAdvert.enable == false) {
this['activitys'].y = 458;
this['guideInner'].y = 185;
// this['activitys'].y = 458;
// this['guideInner'].y = 185;
}
NetManager.ins.showLog(getlogItem(33));
this["inviteTipsBg"].visible = false;
......@@ -959,13 +974,13 @@ export default class MapScene extends Scene {
case (flag == 6): // 无入口
this["inviteGroup"].visible = false;
this["inviteGroup"].touchEnabled = false;
this['adBtn'].y = 323.76;
// this['adBtn'].y = 323.76;
if (mapAdvert && mapAdvert.enable) {
this['guideInner'].y = 185;
this['activitys'].y = 458;
// this['guideInner'].y = 185;
// this['activitys'].y = 458;
} else {
this['guideInner'].y = 30;
this['activitys'].y = 303.76;
// this['guideInner'].y = 30;
// this['activitys'].y = 303.76;
}
break;
default:
......@@ -1242,10 +1257,10 @@ export default class MapScene extends Scene {
})
}
updateSignBtn(){
this['signGroup'].visible=false;
updateSignBtn() {
this['signGroup'].visible = false;
const getSignConfig = DataManager.ins.getData('getSignConfig');
if(getSignConfig && getSignConfig.data && getSignConfig.data.closeStatus) {
if (getSignConfig && getSignConfig.data && getSignConfig.data.closeStatus) {
this['signGroup'].visible = true;
}
......
import { DataManager } from "../../libs/tw/manager/DataManager";
export default () => {
const hc_advert:any = DataManager.ins.getData('hc_advert').data || {};
let { mapAdvert } = hc_advert;
if (mapAdvert == null)
mapAdvert = { enable: false, advertList: [] }
return mapAdvert.enable;
}
import { DataManager } from "../../libs/tw/manager/DataManager";
import { NetName } from "../../libs/tw/enum/NetName";
export default () => {
let count = 0;
let hc_redBombBaseInfo = DataManager.ins.getData('hc_redBombBaseInfo');
if (hc_redBombBaseInfo.success && hc_redBombBaseInfo.data) {
count++;
}
let hbrain = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
if (hbrain.success && hbrain.data) {
const data = hbrain.data
if (data.currentSession) {
count++;
} else if (data.nextSession) {
count++;
}
}
return count;
}
\ No newline at end of file
import { NetName } from "../../libs/tw/enum/NetName";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default () => {
const inviteInfo = DataManager.ins.getData(NetName.GET_INVATE_INFO);
if (inviteInfo && inviteInfo.success && inviteInfo.data) {
const flag = inviteInfo.data.completeFlag;
if (flag >= 0 && flag <= 5) return 1
if (flag == 6) return 0;
}
return 0;
}
import { DataManager } from "../../libs/tw/manager/DataManager";
import { NetName } from "../../libs/tw/enum/NetName";
export default () => {
const getSignConfig = DataManager.ins.getData('getSignConfig');
if (getSignConfig && getSignConfig.data)
return getSignConfig.data.closeStatus;
return false;
}
\ No newline at end of file
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