Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
429ec53a
Commit
429ec53a
authored
Oct 20, 2020
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页暂存
parent
6cdb0879
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
355 additions
and
6446 deletions
+355
-6446
MainBase.ts
egret/libs/new_wx/MainBase.ts
+5
-0
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+16
-0
getFriendSharePic.ts
egret/src/getFriendSharePic.ts
+1
-1
getHomeData.ts
egret/src/getHomeData.ts
+2
-1
getSharePic.ts
egret/src/getSharePic.ts
+1
-1
getShowOffPic.ts
egret/src/getShowOffPic.ts
+1
-1
levelHomeData.ts
egret/src/levelHomeData.ts
+113
-0
MainScene.ts
egret/src/mainScene/MainScene.ts
+4
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+29
-312
HbNoPrize.ts
egret/src/panels/HongbaoRain/HbNoPrize.ts
+2
-2
HbNoPrize2.ts
egret/src/panels/HongbaoRain/HbNoPrize2.ts
+2
-2
HbPrize.ts
egret/src/panels/HongbaoRain/HbPrize.ts
+2
-2
InviteCutTimePanel.ts
egret/src/panels/InviteCutTimePanel.ts
+2
-2
InvitePrizePanel.ts
egret/src/panels/InvitePrizePanel.ts
+2
-2
ScratchPrizePanel.ts
egret/src/panels/ScratchPrizePanel.ts
+2
-2
StartPanel.ts
egret/src/panels/StartPanel.ts
+1
-1
TaskCenterNoPrize.ts
egret/src/panels/TaskCenter/TaskCenterNoPrize.ts
+2
-2
TaskCenterPrize.ts
egret/src/panels/TaskCenter/TaskCenterPrize.ts
+2
-2
gotoNextLevel.ts
egret/src/panels/gotoNextLevel.ts
+1
-1
shareCtrl.ts
egret/src/shareCtrl.ts
+2
-2
shareCtrl3.ts
egret/src/shareCtrl3.ts
+1
-1
config.js
mock/config.js
+3
-0
home.json
mock/happyclear/home.json
+1
-6109
homelevel.json
mock/happyclear/homelevel.json
+158
-0
No files found.
egret/libs/new_wx/MainBase.ts
View file @
429ec53a
...
...
@@ -82,6 +82,7 @@ import HelpBloodPanel from "../../src/panels/help/HelpBloodPanel";
import
HelpInvitePanel
from
"../../src/panels/help/HelpInvitePanel"
;
import
HelpScratchPanel
from
"../../src/panels/help/HelpScratchPanel"
;
import
HelpInvitePanel2
from
"../../src/panels/help/HelpInvitePanel2"
;
import
levelHomeData
from
"../../src/levelHomeData"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
...
...
@@ -610,6 +611,10 @@ export default class MainBase extends eui.UILayer {
window
[
'getaward'
]
=
()
=>
{
getRedBombAward
((
param
)
=>
{
console
.
log
(
param
)
})
};
localStorage
.
setItem
(
'taskCenter'
+
window
[
'CFG'
].
consumerId
,
'true'
);
// 任务中心强提示,每次进入游戏只强提示一次
await
this
.
hcHome
();
let
playerlevel
=
getHomeData
().
playerlevel
;
console
.
error
(
"玩家level===>"
,
playerlevel
);
await
levelHomeData
.
initMapLevelData
();
console
.
log
(
"获取到玩家level数据==>"
);
await
Promise
.
all
([
// this.getAd(),
this
.
ajaxElement
(),
...
...
egret/libs/tw/manager/NetManager.ts
View file @
429ec53a
...
...
@@ -2605,4 +2605,20 @@ export class NetManager extends ABNetManager {
};
this
.
send
(
net
);
}
public
hc_levelhome
(
callback
:
Function
,
pageNo
:
Number
,
pageSize
:
Number
):
void
{
const
net
:
INetData
=
{
name
:
'hc_levelhome'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/happyclear/findConsumerRecords'
,
type
:
'get'
,
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
pageNo
:
pageNo
,
pageSize
:
pageSize
},
callback
:
callback
};
this
.
send
(
net
);
}
}
\ No newline at end of file
egret/src/getFriendSharePic.ts
View file @
429ec53a
...
...
@@ -9,7 +9,7 @@ class FriendWxShare extends ComponentBase {
start
(
rank
)
{
const
data
=
getHomeData
();
this
[
'ranktxt'
].
text
=
`我在好友中排名第
${
rank
}
`
;
this
[
'lvTxt'
].
text
=
data
.
levels
.
length
==
0
?
1
:
data
.
levels
.
length
;
this
[
'lvTxt'
].
text
=
data
.
playerlevel
==
0
?
1
:
data
.
playerlevel
;
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
const
{
data
:
user
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
this
[
'avatar'
].
source
=
user
.
avatar
;
...
...
egret/src/getHomeData.ts
View file @
429ec53a
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
interface
IHomeData
{
levels
:{
levelNum
,
maxScore
,
stars
}[];
// levels:{levelNum,maxScore,stars}[];
playerlevel
:
number
;
totalStars
;
canReceiveTreasureBoxNum
;
isGetAllTreasureBox
;
...
...
egret/src/getSharePic.ts
View file @
429ec53a
...
...
@@ -7,7 +7,7 @@ import { DataManager } from "../libs/tw/manager/DataManager";
class
Share
extends
ComponentBase
{
start
()
{
const
data
=
getHomeData
();
this
[
'lvTxt'
].
text
=
data
.
levels
.
length
==
0
?
1
:
data
.
levels
.
length
;
this
[
'lvTxt'
].
text
=
data
.
playerlevel
==
0
?
1
:
data
.
playerlevel
;
}
get
skinKey
()
{
return
'Share'
}
...
...
egret/src/getShowOffPic.ts
View file @
429ec53a
...
...
@@ -5,7 +5,7 @@ class ShowOff extends ComponentBase {
pic
;
start
()
{
const
data
=
getHomeData
();
this
[
'lvTxt'
].
text
=
data
.
levels
.
length
;
this
[
'lvTxt'
].
text
=
data
.
playerlevel
;
this
[
'tipsTxt'
].
text
=
`超过了
${
Math
.
ceil
(
Math
.
random
()
*
100
)}
%的好友`
;
}
...
...
egret/src/levelHomeData.ts
0 → 100644
View file @
429ec53a
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
getHomeData
from
"./getHomeData"
;
import
MapBottomPart
from
"./mapScene/MapBottomPart"
;
import
MapRpeatPart
from
"./mapScene/MapRpeatPart"
;
import
MapTopPart
from
"./mapScene/MapTopPart"
;
export
default
class
levelHomeData
{
static
leveldata
=
{};
static
getlevelData
(
idx
)
{
if
(
this
.
leveldata
[
idx
])
{
return
this
.
leveldata
[
idx
].
stars
;
}
else
{
console
.
error
(
"未取到对应数据===》"
,
idx
);
return
1
;
}
}
static
async
getPageLevelData
(
idx
,
pagesize
=
30
)
{
return
new
Promise
((
r
)
=>
{
let
playerlevel
=
getHomeData
().
playerlevel
;
if
(
idx
>
playerlevel
){
return
r
();
}
let
chalevel
=
playerlevel
-
idx
;
let
pageno
=
Math
.
floor
(
chalevel
/
pagesize
);
let
startidx
=
playerlevel
-
pageno
*
pagesize
;
let
endidx
=
startidx
-
pagesize
;
if
(
endidx
<
0
)
{
endidx
=
0
;
}
let
shouldget
=
false
;
for
(
let
i1
=
endidx
+
1
;
i1
<
startidx
;
i1
++
)
{
if
(
!
this
.
leveldata
[
i1
])
{
// console.log("33",this.leveldata[i1],this.leveldata,i1);
shouldget
=
true
;
break
;
}
}
if
(
!
shouldget
)
{
// console.error("已存在,不必请求");
return
r
();
}
else
{
// console.error("还需要请求=====》",endidx,startidx,idx,this.leveldata);
}
NetManager
.
ins
.
hc_levelhome
((
s
,
data
)
=>
{
// console.error("hc_levelhome",s,data);
if
(
s
)
{
if
(
data
&&
data
.
data
)
{
let
levels
=
data
.
data
;
let
levelsleng
=
levels
.
length
-
1
;
let
j
=
0
;
for
(
let
i
=
levelsleng
;
i
>
-
1
;
i
--
)
{
let
idata
=
levels
[
i
];
this
.
leveldata
[
startidx
-
j
]
=
idata
;
j
++
;
}
}
// console.error("请求一次page", pageno);
// console.log("获取levelData===>", this.leveldata.length, pageno);
}
r
();
},
pageno
,
pagesize
);
return
;
})
}
static
updateLevelData
(
idx
,
pagesize
=
30
)
{
let
playerlevel
=
getHomeData
().
playerlevel
;
let
chalevel
=
playerlevel
-
idx
;
let
pageno
=
Math
.
floor
(
chalevel
/
pagesize
);
let
startidx
=
playerlevel
-
pageno
*
pagesize
;
NetManager
.
ins
.
hc_levelhome
((
s
,
data
)
=>
{
if
(
s
){
if
(
data
&&
data
.
data
){
let
levels
=
data
.
data
;
let
levelsleng
=
levels
.
length
-
1
;
let
j
=
0
;
for
(
let
i
=
levelsleng
;
i
>-
1
;
i
--
){
let
idata
=
levels
[
i
];
this
.
leveldata
[
startidx
-
j
]
=
idata
;
j
++
;
}
}
}
},
pageno
,
pagesize
);
return
;
// let pageno = Math.ceil(idx / pagesize);
// let startidx = pagesize * (pageno - 1);
// NetManager.ins.hc_levelhome((s, data1) => {
// if (s) {
// let data = data1;
// if (data && data.data && data.data.levels) {
// let levels = data.data.levels;
// let levelsleng = levels.length - 1;
// for (let i = levelsleng; i > -1; i--) {
// let idata = levels[i];
// this.leveldata[i + startidx] = idata;
// }
// }
// }
// }, pageno, pagesize);
}
static
async
initMapLevelData
()
{
let
playerlevel
=
getHomeData
().
playerlevel
;
if
(
playerlevel
>
30
){
if
(
playerlevel
>
60
){
await
this
.
getPageLevelData
(
8
);
}
await
this
.
getPageLevelData
(
playerlevel
-
30
);
}
await
this
.
getPageLevelData
(
playerlevel
);
}
}
\ No newline at end of file
egret/src/mainScene/MainScene.ts
View file @
429ec53a
...
...
@@ -125,6 +125,7 @@ import Food from '../something/class/Food';
import
foodAni
from
'../something/anis/foodAni'
;
import
shuzhi
from
'../something/class/shuzhi'
;
import
gamePool
from
'../configData/gamePool'
;
import
levelHomeData
from
'../levelHomeData'
;
const
aniClass
=
{
"BoomAni"
:
BoomAni
,
...
...
@@ -5185,6 +5186,9 @@ export default class MainScene extends Scene {
},
1300
)
}
}
//更新地图关卡数据
levelHomeData
.
updateLevelData
(
this
.
chapter
)
},
DataManager
.
ins
.
getData
(
"hc_doJoin"
).
data
,
this
.
chapter
,
...
...
egret/src/mapScene/MapScene.ts
View file @
429ec53a
...
...
@@ -40,19 +40,13 @@ import getInviteBtn from "./getInviteBtn";
import
{
play2
,
play1
}
from
"../panels/help/svgaTool"
;
import
{
snpmAdStatic
}
from
"../statics/snpmAdStatic"
;
import
MapStarComp
from
"./MapStarComp"
;
import
levelHomeData
from
"../levelHomeData"
;
let
doHelpFlag
=
false
;
// let doScratchHelpFlag = false;
// let adTag = false;
export
default
class
MapScene
extends
Scene
{
static
adData
;
scrollGroup
:
eui
.
Group
;
scroll
:
eui
.
Scroller
;
// topPart: MapTopPart;
// bottomPart: MapBottomPart;
// repeatsPart: MapRpeatPart[];
// static iconHash: any = {};
// static starHash: any = {};
_data
;
private
icons
=
{};
...
...
@@ -209,14 +203,6 @@ export default class MapScene extends Scene {
console
.
log
(
"时间弹出广告结束"
);
}
// if (noticeAdvert && noticeAdvert.enable && nowTimerStr2 != oldTimerStr2) {
// // if (!adTag) {
// panels.push('ad');
// // adTag = true;
// // }
// localStorage.setItem('nowTimer2Str' + window['CFG'].consumerId, nowTimerStr2);
// }
const
backData
=
DataManager
.
ins
.
getData
(
'hc_hasBackReward'
);
if
(
backData
.
success
)
{
backData
.
success
=
false
;
...
...
@@ -273,7 +259,7 @@ export default class MapScene extends Scene {
}
}
if
(
!
readCache
()
&&
getHomeData
().
levels
.
length
<=
0
)
{
//引导
if
(
!
readCache
()
&&
getHomeData
().
playerlevel
<=
0
)
{
//引导
const
guide
=
new
GuideCon
(()
=>
{
PanelCtrl
.
instance
.
showPanels
(
panels
,
parmas
,
this
.
onAllPanelHide
);
});
...
...
@@ -321,7 +307,7 @@ export default class MapScene extends Scene {
// console.log("scroll--------height",scrollheight,this.scrollMapy);
this
.
scroll
.
height
=
this
.
stage
.
stageHeight
;
this
.
scrollGroup
.
height
=
scrollheight
;
var
nowlevel
=
getHomeData
().
levels
.
length
;
var
nowlevel
=
getHomeData
().
playerlevel
;
// console.log("玩家level",nowlevel);
this
.
maptoppart
.
y
=
this
.
scrollMapy
[
0
];
this
.
scrollGroup
.
addChild
(
this
.
maptoppart
);
...
...
@@ -343,28 +329,13 @@ export default class MapScene extends Scene {
const
homeData
=
getHomeData
();
//关于滚动,可以仅在第一次打开时自动滚到到最新位置,其余情况不动
let
lastOrder
=
homeData
.
levels
.
length
+
1
;
if
(
homeData
.
levels
.
length
>=
window
[
'total_level'
])
let
lastOrder
=
homeData
.
playerlevel
+
1
;
if
(
homeData
.
playerlevel
>=
window
[
'total_level'
])
lastOrder
=
window
[
'total_level'
];
this
.
scroll
.
viewport
.
scrollV
=
this
.
getScrollV
(
lastOrder
,
this
.
stage
.
stageHeight
);
// console.log("滚动设置",this.scroll.viewport.scrollV,this.scrollGroup.height,this.scroll.height,this.stage.stageHeight);
// console.log("滚动设置",lastOrder,this.scroll.viewport.scrollV);
this
.
setScrollVShow
();
// console.log('地图数据-----',this._data);
// this.topPart = this._data.top;
// this.repeatsPart = this._data.list;
// this.bottomPart = this._data.bottom;
// this.scroll.height = this.stage.stageHeight;
// this.scrollGroup.addChild(this._data.top);
// this._data.list.forEach((ele, index) => {
// this.scrollGroup.addChild(ele);
// ele.y = this._data.top.height + (index * ele.height);
// });
// this.scrollGroup.addChild(this._data.bottom);
// this._data.bottom.y = this._data.top.height + (this._data.list.length * this._data.list[0].height);
setTimeout
(()
=>
{
...
...
@@ -468,182 +439,12 @@ export default class MapScene extends Scene {
}
stopGamebg
();
// NetManager.ins.getSignInfo(() => {
// const parmas = [];
// const panels = [];
// const result = this.sendInvite(panels, parmas);
// if (result) {
// this.updateSign();
// PanelCtrl.instance.showPanels(panels, parmas, this.onAllPanelHide);
// return;
// }
// const date = new Date();
// date.setHours(0, 0, 0, 0);
// const nowTimerStr = date.getTime() + '';
// const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId);
// const nowTimerStr2 = date.getTime() + '';
// const oldTimerStr2 = localStorage.getItem('nowTimer2Str' + window['CFG'].consumerId);
// const hc_advert = DataManager.ins.getData('hc_advert').data || {};
// let { noticeAdvert } = hc_advert;
// if (noticeAdvert == null) {
// noticeAdvert = { enable: false }
// }
// if (noticeAdvert && noticeAdvert.enable && nowTimerStr2 != oldTimerStr2) {
// // if (!adTag) {
// panels.push('ad');
// // adTag = true;
// // }
// localStorage.setItem('nowTimer2Str' + window['CFG'].consumerId, nowTimerStr2);
// }
// const backData = DataManager.ins.getData('hc_hasBackReward');
// if (backData.success) {
// backData.success = false;
// panels.push('BackIndex');
// }
// const { signInfoVO } = DataManager.ins.getData('getSignInfo');
// if (signInfoVO && signInfoVO.continueDay < 7) { //表示明天还可以签到
// if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr && getSignBtn()) {
// panels.push('sign');
// localStorage.setItem('nowTimerStr' + window['CFG'].consumerId, nowTimerStr);
// }
// }
// this.updateSign();
// // 红包雨强提示
// const hbRainRes = DataManager.ins.getData(NetName.HBRAIN_BASEINFO);
// if (hbRainRes.data) {
// if (hbRainRes.data.currentSession || hbRainRes.data.nextSession) {
// const sessionId = hbRainRes.data.currentSession ? hbRainRes.data.currentSession.sessionIndex : hbRainRes.data.nextSession.sessionIndex; // 场次ID
// const nowTimerStr3 = date.getTime() + sessionId + '';
// const oldTimerStr3 = localStorage.getItem('nowTimer3Str' + window['CFG'].consumerId);
// if (nowTimerStr3 != oldTimerStr3) {
// panels.push('HbCutTime');
// localStorage.setItem('nowTimer3Str' + window['CFG'].consumerId, nowTimerStr3);
// }
// }
// }
// // 任务中心可领奖强提示
// let canShow = localStorage.getItem('taskCenter' + window['CFG'].consumerId);
// if (canShow == 'true') {
// const taskInfoRes = DataManager.ins.getData(NetName.GET_TASKINFO);
// if (taskInfoRes && taskInfoRes.data && taskInfoRes.data.length > 0) {
// for (let i = 0; i < taskInfoRes.data.length; i++) {
// if (taskInfoRes.data[i].count > 0) {
// panels.push('task');
// break;
// }
// }
// }
// }
// localStorage.setItem('taskCenter' + window['CFG'].consumerId, 'false');
// let res = DataManager.ins.getData('hc_redBombBaseInfo');
// if (res && res.data) {
// let _t = res.data.redBombSwitchTime || "";
// if (res.data.remain > 0) {
// let showBomb = localStorage.getItem('showBomb' + window['CFG'].consumerId);
// if (showBomb != _t.toString() && _t != "") {
// localStorage.setItem('showBomb' + window['CFG'].consumerId, _t.toString());
// panels.push('BombTips2Panel');
// }
// }
// }
// if (!readCache() && getHomeData().levels.length <= 0) { //引导
// const guide = new GuideCon(() => {
// PanelCtrl.instance.showPanels(panels, parmas, this.onAllPanelHide);
// });
// this.addChild(guide);
// guide.play(1)
// // console.log(guide)
// } else { //不用引导
// PanelCtrl.instance.showPanels(panels, parmas, this.onAllPanelHide);
// }
// }, window['signActivityId']);
this
.
initSound
();
this
.
_data
=
data
;
//滚动的背景变黑
// this['rectbg'].height = this.stage.stageHeight;
// //进度条的遮罩
// this['progressfront'].mask = this['rect'];
// this['rect'].scaleX = 0.5
// //进度条文本发光
// setGlow(this['totalStarTxt'], 0x0083e8, 1);
// this.topPart = data.top;
// this.repeatsPart = data.list;
// this.bottomPart = data.bottom;
// console.log(data);
// this.scroll.height = this.stage.stageHeight;
// this.scrollGroup.addChild(data.top);
// data.list.forEach((ele, index) => {
// this.scrollGroup.addChild(ele);
// ele.y = data.top.height + (index * ele.height);
// });
// this.scrollGroup.addChild(data.bottom);
// data.bottom.y = data.top.height + (data.list.length * data.list[0].height);
// let target;
const
homeData
=
getHomeData
();
// if (homeData.levels.length == 0) {
// target = 1;
// } else if (homeData.levels.length == window['total_level']) {
// target = window['total_level'] + 1;
// } else {
// target = homeData.levels.length + 1;
// }
// for (const key in MapScene.iconHash) {
// const levelOrder = parseInt(key);
// const element = MapScene.iconHash[key];
// if (!element.hasEventListener(egret.TouchEvent.TOUCH_TAP)) {
// element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// if (
// (levelOrder > (getHomeData().levels.length + 1) && levelOrder > 1)
// || (levelOrder > window['last_level'])
// ) {
// // showToast('必须通关前面的关卡才能开启本关');
// console.log('必须通关前面的关卡才能开启本关');
// } else
// PanelCtrl.instance.show('StartPanel', key);
// NetManager.ins.clickLog(getlogItem(19));
// }, this);
// }
// }
// 当前关卡的水花动效
// console.log(homeData.levels,window['last_level'],target);
// if (homeData.levels.length < window['last_level']) {
// // console.log("添加水花动画0000000000");
// this.creatPic();
// const targetIcon = MapScene.iconHash[target];
// targetIcon.mappart.addChildAt(this.pic, 1);
// // targetIcon.parent.addChildAt(pic, 0);
// this.pic.x = targetIcon.x + 50;
// this.pic.y = targetIcon.y + 37 + 7;
// // pic.x = 50 - 2;
// // pic.y = 37 + 10;
// egret.Tween.get(this.pic, { loop: true })
// .set({
// scaleX:1,
// scaleY:1,
// alpha:1
// })
// .to({ scaleX: 2, scaleY: 2, alpha: 0 }, 1000).wait(1000);
// }
this
.
updateHomeData
();
this
.
updateFriends
();
...
...
@@ -667,91 +468,11 @@ export default class MapScene extends Scene {
}
},
this
);
// //关于滚动,可以仅在第一次打开时自动滚到到最新位置,其余情况不动
// let lastOrder = homeData.levels.length + 1;
// if (homeData.levels.length >= window['total_level'])
// lastOrder = window['total_level'];
// this.scroll.viewport.scrollV = this.getScrollV(lastOrder, this.stage.stageHeight);
// this.setScrollVShow();
// console.warn(this.getScrollV(lastOrder, this.stage.stageHeight));
// setTimeout(() => {
// try {
// const key = 'main2';
// Promise.all([
// RES.getResAsync(`${key}_json`),
// RES.getResAsync(`${key}_png`)]);
// } catch (error) {
// }
// console.log("开始加载一系列资源");
// RES.getResAsync('candydis0_json');
// RES.getResAsync('candydis1_json');
// RES.getResAsync('candydis2_json');
// RES.getResAsync('candydis3_json');
// RES.getResAsync('candydis4_json');
// RES.getResAsync('candydie0_json');
// RES.getResAsync('candydie1_json');
// RES.getResAsync('candydie2_json');
// RES.getResAsync('candydie3_json');
// RES.getResAsync('candydie4_json');
// RES.getResAsync('candysub_json');
// RES.getResAsync('monsterState_json');
// RES.getResAsync('honeymc_json');
// RES.getResAsync('candydiebg_json');
// RES.getResAsync('redrainbg_jpg');
// RES.getResAsync('hbRule_bg_png');
// loadSvga(getResPath() + 'resource/assets/svgas/fish.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/monster0.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/monster1.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/monster2.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/monster3.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/monster4.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/box.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/invite.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/turnprize.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/sprize.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/monster.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/honeypot1.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/honeypot2.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/honeypot3.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/honeypot_dispear.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/honeypot_change.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/honeypot_bubble.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/sand_standby.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/sand_move.svga');
// loadSvga(getResPath() + 'resource/assets/svgas/sand_dis.svga');
// // loadSvga(getResPath() + 'resource/assets/svgas/fireworks.svga');
// console.log("一系列资源加载完毕");
// if (!window['development']) {
// RES.getResAsync(`inviterulepanel_json`);
// }
// }, 20 * 1000);
// loadFireworks();
// this.scroll.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
this
.
scroll
.
addEventListener
(
egret
.
Event
.
CHANGE
,
this
.
onEnterFrame
,
this
);
}
onAllPanelHide
=
()
=>
{
if
(
!
localStorage
.
getItem
(
'activityguide'
))
{
// NetManager.ins.hbRainBaseInfo((success, res) => {
// if(!success) {
// if(res.code == "600054" || res.code == "600055") {
// this['guide'].visible = false;
// }
// return;
// }
// const data = res.data;
// if(!data.currentSession && !data.nextSession) {
// this['guide'].visible = false;
// return;
// }
if
(
this
[
'actsShowBtn'
].
visible
)
this
[
'guide'
].
visible
=
true
;
...
...
@@ -764,32 +485,14 @@ export default class MapScene extends Scene {
const
offset
=
0
;
const
y0
=
this
.
scroll
.
viewport
.
scrollV
+
offset
;
const
y1
=
this
.
stage
.
stageHeight
+
this
.
scroll
.
viewport
.
scrollV
-
offset
;
// console.log(y0, y1);
// let count = 0;
// for (const key in MapScene.iconHash) {
// const icon = MapScene.iconHash[key];
// if (icon['visibleY'] >= y0 && icon['visibleY'] <= y1) {
// icon.show();
// } else if (icon.parent) {
// icon.hide();
// }
// if (icon.parent)
// count++;
// }
// if (this._avatarsCache) {
// this._avatarsCache.forEach((item) => {
// if (item.parent) item.parent.addChild(item);
// });
// }
}
scrollMapy
:
Array
<
number
>
=
[];
/**
* 调整块显示
*/
setScrollVShow
(){
async
setScrollVShow
(){
var
scrollv
=
this
.
scroll
.
viewport
.
scrollV
;
var
stageh
=
this
.
stage
.
stageHeight
;
var
y0
=
scrollv
;
...
...
@@ -869,7 +572,20 @@ export default class MapScene extends Scene {
}
var
i3startlevel
=
MapTopPart
.
LEVEL_NUMS
+
(
i3
-
1
)
*
MapRpeatPart
.
LEVEL_NUMS
;
// console.log("局部显示",i3,i3mapy,i3startlevel,lidx,nidx);
//todo
console
.
error
(
"修改显示233========》"
,
i3startlevel
);
let
i3endlevel
=
i3startlevel
+
MapRpeatPart
.
LEVEL_NUMS
;
let
pagesize
=
30
;
let
playerlevel
=
getHomeData
().
playerlevel
;
let
page1
=
Math
.
floor
((
playerlevel
-
i3endlevel
)
/
pagesize
);
let
page2
=
Math
.
floor
((
playerlevel
-
i3startlevel
)
/
pagesize
);
if
(
page1
!=
page2
){
await
levelHomeData
.
getPageLevelData
(
i3startlevel
);
await
levelHomeData
.
getPageLevelData
(
i3endlevel
);
}
else
{
await
levelHomeData
.
getPageLevelData
(
i3endlevel
);
}
this
.
changePartLevelShow
(
i3map
,
i3startlevel
,
"mid"
);
}
}
...
...
@@ -913,20 +629,21 @@ export default class MapScene extends Scene {
icon
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
showToastQd
,
this
);
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
false
;
this
.
setGray
(
icon
);
}
else
if
(
levelOrder
<
homeData
.
levels
.
length
+
1
){
}
else
if
(
levelOrder
<
homeData
.
playerlevel
+
1
){
if
(
havewater_light
){
// console.log("当前关卡,移除water_light",levelOrder);
icon
.
removeChild
(
this
.
pic
);
}
this
.
setGray
(
icon
,
2
);
var
leveldata
=
homeData
.
levels
[
levelOrder
-
1
];
//
console.log("关卡测试:"+levelOrder)
;
// todo
//
var leveldata = homeData.levels[levelOrder-1]
;
(
icon
[
'nums'
]
as
eui
.
Image
).
source
=
'icon_png'
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
visible
=
true
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
font
=
'nums_fnt'
;
(
icon
[
'starsp'
]
as
MapStarComp
).
setStar
(
leveldata
.
stars
);
// (icon['starsp'] as MapStarComp).setStar(leveldata.stars);
(
icon
[
'starsp'
]
as
MapStarComp
).
setStar
(
levelHomeData
.
getlevelData
(
levelOrder
-
1
));
(
icon
[
'starsp'
]
as
MapStarComp
).
visible
=
true
;
}
else
if
(
levelOrder
==
homeData
.
levels
.
length
+
1
){
}
else
if
(
levelOrder
==
homeData
.
playerlevel
+
1
){
this
.
setGray
(
icon
,
2
);
(
icon
[
'nums'
]
as
eui
.
Image
).
source
=
'iconnow_png'
;
(
icon
[
'bmptxt'
]
as
eui
.
BitmapLabel
).
visible
=
true
;
...
...
@@ -1038,7 +755,7 @@ export default class MapScene extends Scene {
// console.log('关卡点击',txt.text);
var
homeData
=
getHomeData
();
var
clicklevel
=
Number
(
txt
.
text
);
if
(
clicklevel
<=
homeData
.
levels
.
length
+
1
){
//可进行关卡
if
(
clicklevel
<=
homeData
.
playerlevel
+
1
){
//可进行关卡
PanelCtrl
.
instance
.
show
(
'StartPanel'
,
clicklevel
);
NetManager
.
ins
.
clickLog
(
getlogItem
(
19
));
}
else
{
...
...
@@ -1351,7 +1068,7 @@ export default class MapScene extends Scene {
if
(
!
hc_mapRank
)
return
;
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
hc_mapRank
.
forEach
((
ele
)
=>
{
if
(
ele
.
levelNum
==
getHomeData
().
levels
.
length
+
1
)
{
if
(
ele
.
levelNum
==
getHomeData
().
playerlevel
+
1
)
{
if
(
data
==
null
)
ele
.
rank
[
0
].
avatar
=
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
else
...
...
egret/src/panels/HongbaoRain/HbNoPrize.ts
View file @
429ec53a
...
...
@@ -64,12 +64,12 @@ export default class HbNoPrize extends Panel {
onTouchOK
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
60
));
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
protected
get
closeBtns
():
eui
.
Button
[]
{
...
...
egret/src/panels/HongbaoRain/HbNoPrize2.ts
View file @
429ec53a
...
...
@@ -50,12 +50,12 @@ export default class HbNoPrize extends Panel {
onTouchOK
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
60
));
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
protected
get
closeBtns
():
eui
.
Button
[]
{
...
...
egret/src/panels/HongbaoRain/HbPrize.ts
View file @
429ec53a
...
...
@@ -94,12 +94,12 @@ export default class HbPrize extends Panel {
onTouchOK
()
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
59
));
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
protected
get
closeBtns
():
eui
.
Button
[]
{
...
...
egret/src/panels/InviteCutTimePanel.ts
View file @
429ec53a
...
...
@@ -49,13 +49,13 @@ export default class InviteCutTimePanel extends Panel {
}
onTouchOK
()
{
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
initUI
()
{
...
...
egret/src/panels/InvitePrizePanel.ts
View file @
429ec53a
...
...
@@ -50,13 +50,13 @@ export default class InvitePrizePanel extends Panel {
}
onTouchOK
()
{
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
GDispatcher
.
dispatchEvent
(
"getInviteInfo"
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
onTapGoPrize
()
{
...
...
egret/src/panels/ScratchPrizePanel.ts
View file @
429ec53a
...
...
@@ -56,12 +56,12 @@ export default class ScratchPrizePanel extends Panel {
window
.
location
.
href
=
window
[
'__link__'
];
break
;
case
(
e
.
target
==
this
.
game_btn
):
// 继续闯关
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
break
;
default
:
...
...
egret/src/panels/StartPanel.ts
View file @
429ec53a
...
...
@@ -44,7 +44,7 @@ export default class StartPanel extends Panel {
},
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
)
}
if
(
data
>
homedata
.
levels
.
length
)
{
if
(
data
>
homedata
.
playerlevel
)
{
addAdComp
(
68
,
890
+
10
,
this
,
29
);
NetManager
.
ins
.
showLog
(
getlogItem
(
29
));
}
else
...
...
egret/src/panels/TaskCenter/TaskCenterNoPrize.ts
View file @
429ec53a
...
...
@@ -32,12 +32,12 @@ export default class TaskCenterNoPrize extends Panel {
this
.
btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
taskData
.
status
==
1
)
{
// 去闯关
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
else
{
window
.
open
(
taskData
.
appIncompletelink
);
super
.
hidePanel
();
...
...
egret/src/panels/TaskCenter/TaskCenterPrize.ts
View file @
429ec53a
...
...
@@ -35,12 +35,12 @@ export default class TaskCenterPrize extends Panel {
if
(
taskData
.
status
==
1
)
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
66
));
// 去闯关
if
((
getHomeData
().
levels
.
length
+
1
)
>
window
[
'last_level'
])
{
if
((
getHomeData
().
playerlevel
+
1
)
>
window
[
'last_level'
])
{
changeMapScene
();
super
.
hidePanel
();
return
;
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
playerlevel
+
1
);
}
else
{
window
.
location
.
href
=
taskData
.
appIncompletelink
;
super
.
hidePanel
();
...
...
egret/src/panels/gotoNextLevel.ts
View file @
429ec53a
...
...
@@ -7,7 +7,7 @@ import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export
const
gotoNextLevel
=
(
currentLevel
?)
=>
{
if
(
!
currentLevel
)
{
currentLevel
=
getHomeData
().
levels
.
length
;
currentLevel
=
getHomeData
().
playerlevel
;
}
const
onMapScene
=
SceneCtrl
.
instance
.
currentScene
instanceof
MapScene
;
...
...
egret/src/shareCtrl.ts
View file @
429ec53a
...
...
@@ -31,8 +31,8 @@ class Share2 extends ComponentBase {
const
data
=
getHomeData
();
this
[
'tipsTxt0'
].
text
=
`超过了
${
Math
.
ceil
(
Math
.
random
()
*
100
)}
%的好友`
;
this
[
'lvTxt'
].
text
=
data
.
levels
.
length
==
0
?
1
:
data
.
levels
.
length
;
this
[
'lvTxt0'
].
text
=
data
.
levels
.
length
;
this
[
'lvTxt'
].
text
=
data
.
playerlevel
==
0
?
1
:
data
.
playerlevel
;
this
[
'lvTxt0'
].
text
=
data
.
playerlevel
;
this
[
'btn1'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
iswx
())
{
//微信端
...
...
egret/src/shareCtrl3.ts
View file @
429ec53a
...
...
@@ -30,7 +30,7 @@ class Share3 extends ComponentBase {
const
data
=
getHomeData
();
this
[
'lvTxt'
].
text
=
data
.
levels
.
length
==
0
?
1
:
data
.
levels
.
length
;
this
[
'lvTxt'
].
text
=
data
.
playerlevel
==
0
?
1
:
data
.
playerlevel
;
this
[
'btn1'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
iswx
())
{
//微信端
...
...
mock/config.js
View file @
429ec53a
...
...
@@ -210,6 +210,9 @@ const config = {
'/customActivity/happyclear/getConfigInfo'
:{
data
:
'./happyclear/getConfigInfo.json'
},
'/customActivity/happyclear/findConsumerRecords'
:
{
data
:
'./happyclear/homelevel.json'
},
};
for
(
let
item
in
config
)
{
...
...
mock/happyclear/home.json
View file @
429ec53a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
mock/happyclear/homelevel.json
0 → 100644
View file @
429ec53a
{
"success"
:
true
,
"code"
:
"0000000000"
,
"desc"
:
"OK"
,
"timestamp"
:
1566885811031
,
"data"
:
[
{
"levelNum"
:
1
,
"maxScore"
:
39870
,
"stars"
:
3
},
{
"levelNum"
:
2
,
"maxScore"
:
36770
,
"stars"
:
2
},
{
"levelNum"
:
3
,
"maxScore"
:
28800
,
"stars"
:
3
},
{
"levelNum"
:
4
,
"maxScore"
:
36340
,
"stars"
:
2
},
{
"levelNum"
:
5
,
"maxScore"
:
64750
,
"stars"
:
3
},
{
"levelNum"
:
6
,
"maxScore"
:
59590
,
"stars"
:
2
},
{
"levelNum"
:
7
,
"maxScore"
:
37810
,
"stars"
:
3
},
{
"levelNum"
:
8
,
"maxScore"
:
24050
,
"stars"
:
2
},
{
"levelNum"
:
9
,
"maxScore"
:
43210
,
"stars"
:
3
},
{
"levelNum"
:
10
,
"maxScore"
:
25630
,
"stars"
:
2
},
{
"levelNum"
:
11
,
"maxScore"
:
25420
,
"stars"
:
3
},
{
"levelNum"
:
12
,
"maxScore"
:
32580
,
"stars"
:
2
},
{
"levelNum"
:
13
,
"maxScore"
:
56700
,
"stars"
:
3
},
{
"levelNum"
:
14
,
"maxScore"
:
34450
,
"stars"
:
2
},
{
"levelNum"
:
15
,
"maxScore"
:
42080
,
"stars"
:
3
},
{
"levelNum"
:
16
,
"maxScore"
:
18990
,
"stars"
:
2
},
{
"levelNum"
:
17
,
"maxScore"
:
51180
,
"stars"
:
3
},
{
"levelNum"
:
18
,
"maxScore"
:
38390
,
"stars"
:
2
},
{
"levelNum"
:
19
,
"maxScore"
:
20160
,
"stars"
:
3
},
{
"levelNum"
:
20
,
"maxScore"
:
55860
,
"stars"
:
2
},
{
"levelNum"
:
21
,
"maxScore"
:
21630
,
"stars"
:
3
},
{
"levelNum"
:
22
,
"maxScore"
:
115670
,
"stars"
:
2
},
{
"levelNum"
:
23
,
"maxScore"
:
26840
,
"stars"
:
3
},
{
"levelNum"
:
24
,
"maxScore"
:
39310
,
"stars"
:
2
},
{
"levelNum"
:
25
,
"maxScore"
:
28010
,
"stars"
:
3
},
{
"levelNum"
:
21
,
"maxScore"
:
21630
,
"stars"
:
3
},
{
"levelNum"
:
22
,
"maxScore"
:
115670
,
"stars"
:
2
},
{
"levelNum"
:
23
,
"maxScore"
:
26840
,
"stars"
:
3
},
{
"levelNum"
:
24
,
"maxScore"
:
39310
,
"stars"
:
2
},
{
"levelNum"
:
25
,
"maxScore"
:
28010
,
"stars"
:
3
}
]
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment