Commit dfedb06a authored by 邱旭's avatar 邱旭

1

parents 7c3f0db5 0a4b334d
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
<script src="libs/pad-zeropadding.js"></script> <script src="libs/pad-zeropadding.js"></script>
<img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" /> <img id="pic" style="width:100%;position: absolute;z-index: 999;display: none;" />
<script> <script>
<<<<<<< HEAD
/* /*
* 邀请有礼分享 * 邀请有礼分享
*/ */
...@@ -99,6 +100,9 @@ ...@@ -99,6 +100,9 @@
} }
</script> </script>
<script> <script>
=======
// window.isInvitePage = 1;
>>>>>>> 0a4b334dc0c6f0151f4a6f5714102d247466ff04
window['signconfigs'] = [ window['signconfigs'] = [
{ nums: '0.15元', type: 'quan15' }, { nums: '0.15元', type: 'quan15' },
{ nums: '*1', type: 'hammer' }, { nums: '*1', type: 'hammer' },
......
...@@ -49,6 +49,7 @@ import FriendPanel from "../../src/panels/FriendPanel"; ...@@ -49,6 +49,7 @@ import FriendPanel from "../../src/panels/FriendPanel";
import InviteRulePanel from "../../src/panels/InviteRulePanel"; import InviteRulePanel from "../../src/panels/InviteRulePanel";
import InvitePrizePanel from "../../src/panels/InvitePrizePanel"; import InvitePrizePanel from "../../src/panels/InvitePrizePanel";
import BagPanel from "../../src/panels/BagPanel"; import BagPanel from "../../src/panels/BagPanel";
import H5Scene from "../../src/H5Scene";
export default class MainBase extends eui.UILayer { export default class MainBase extends eui.UILayer {
constructor() { constructor() {
...@@ -94,6 +95,7 @@ export default class MainBase extends eui.UILayer { ...@@ -94,6 +95,7 @@ export default class MainBase extends eui.UILayer {
]; ];
const scenes = [ const scenes = [
[ModuleTypes.INVITE_SCENE, { cls: H5Scene }],
[ModuleTypes.START_SCENE, { cls: StartScene }], [ModuleTypes.START_SCENE, { cls: StartScene }],
[ModuleTypes.MAP_SCENE, { cls: MapScene }], [ModuleTypes.MAP_SCENE, { cls: MapScene }],
[ModuleTypes.PLAY_SCENE, { cls: PlayScene }], [ModuleTypes.PLAY_SCENE, { cls: PlayScene }],
...@@ -259,7 +261,9 @@ export default class MainBase extends eui.UILayer { ...@@ -259,7 +261,9 @@ export default class MainBase extends eui.UILayer {
} }
} }
if(window['isInvitePage'] == 1 )
SceneCtrl.instance.change(ModuleTypes.INVITE_SCENE);
else
this.createGameScene(); this.createGameScene();
} }
private svgaList = []; private svgaList = [];
...@@ -325,7 +329,7 @@ export default class MainBase extends eui.UILayer { ...@@ -325,7 +329,7 @@ export default class MainBase extends eui.UILayer {
MapScene.adData = DataManager.ins.getData('hc_advert'); MapScene.adData = DataManager.ins.getData('hc_advert');
Buried.init(); Buried.init();
///////////
SceneCtrl.instance.change(ModuleTypes.START_SCENE, this.svgaList); SceneCtrl.instance.change(ModuleTypes.START_SCENE, this.svgaList);
NetManager.ins.getShareInfo(() => { NetManager.ins.getShareInfo(() => {
......
export enum ModuleTypes { export enum ModuleTypes {
INVITE_SCENE,
START_SCENE, START_SCENE,
MAP_SCENE, MAP_SCENE,
PLAY_SCENE, PLAY_SCENE,
......
...@@ -1269,7 +1269,7 @@ export class NetManager extends ABNetManager { ...@@ -1269,7 +1269,7 @@ export class NetManager extends ABNetManager {
this.send(net); this.send(net);
} }
public mapRank(callback: Function): void { public hc_mapRank(callback: Function): void {
const net: INetData = { const net: INetData = {
name:'mapRank', name:'mapRank',
uri: window['duiba']+'/customActivity/happyclear/mapRank', uri: window['duiba']+'/customActivity/happyclear/mapRank',
...@@ -1283,6 +1283,36 @@ export class NetManager extends ABNetManager { ...@@ -1283,6 +1283,36 @@ export class NetManager extends ABNetManager {
}; };
this.send(net); this.send(net);
} }
public hc_levelNumRank(callback: Function,levelNum): void {
const net: INetData = {
name:'hc_levelNumRank',
uri: window['duiba']+'/customActivity/happyclear/levelNumRank',
type: 'post',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId,
levelNum: levelNum
},
hideMsg:true,
callback: callback
};
this.send(net);
}
public hc_userInfo(callback: Function): void {
const net: INetData = {
name:'hc_userInfo',
uri: window['duiba']+'/customActivity/happyclear/userInfo',
type: 'post',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId
},
hideMsg:true,
callback: callback
};
this.send(net);
}
public hc_advert(callback: Function): void { public hc_advert(callback: Function): void {
const net: INetData = { const net: INetData = {
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"h5","version":5,"files":["../assets/shop/按钮 副本.png"]}
\ No newline at end of file
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
{ {
"keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom18_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,guideBg_png,guideKnowBtn_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,guideTxt1_png,guideTxt2_png,guideTxt3_png,guideTxt4_png,guideTxt5_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,leftArrow_png,lightedStar_png,lineLight_png,lockDown_png,lockUp_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yezi1_png", "keys": "bonusFra1_png,bonusFra10_png,bonusFra11_png,bonusFra12_png,bonusFra13_png,bonusFra14_png,bonusFra15_png,bonusFra16_png,bonusFra17_png,bonusFra18_png,bonusFra19_png,bonusFra2_png,bonusFra20_png,bonusFra21_png,bonusFra22_png,bonusFra23_png,bonusFra24_png,bonusFra25_png,bonusFra26_png,bonusFra27_png,bonusFra3_png,bonusFra4_png,bonusFra5_png,bonusFra6_png,bonusFra7_png,bonusFra8_png,bonusFra9_png,bonusShoot_png,bonusTime_png,boom1_png,boom10_png,boom11_png,boom12_png,boom13_png,boom14_png,boom15_png,boom16_png,boom17_png,boom18_png,boom2_png,boom3_png,boom4_png,boom5_png,boom6_png,boom7_png,boom8_png,boom9_png,boomBtn_png,chooseRect_png,dangqianfenshu_png,ele0_png,ele0Exp_png,ele0Line_png,ele1_png,ele1Exp_png,ele1Line_png,ele2_png,ele2Exp_png,ele2Line_png,ele3_png,ele3Exp_png,ele3Line_png,ele4_png,ele4Exp_png,ele4Line_png,ele5_png,ele6_png,ele7_png,ele8_png,eleDis1_png,eleDis10_png,eleDis11_png,eleDis12_png,eleDis13_png,eleDis14_png,eleDis15_png,eleDis16_png,eleDis17_png,eleDis18_png,eleDis19_png,eleDis2_png,eleDis3_png,eleDis4_png,eleDis5_png,eleDis6_png,eleDis7_png,eleDis8_png,eleDis9_png,exLighting1_png,exLighting11_png,exLighting14_png,exLighting16_png,exLighting18_png,exLighting19_png,exLighting21_png,exLighting23_png,exLighting25_png,exLighting27_png,exLighting29_png,exLighting3_png,exLighting32_png,exLighting34_png,exLighting5_png,exLighting7_png,exLighting9_png,guideBg_png,guideKnowBtn_png,guidePropBoom_png,guidePropCow_png,guidePropHammer_png,guidePropHand_png,guidePropMsgPanel_png,guidePropShoe_png,guideTxt1_png,guideTxt2_png,guideTxt3_png,guideTxt4_png,guideTxt5_png,hammerBtn_png,ice2_png,ice3_png,ice4_png,ice5_png,ice6_png,leftArrow_png,lightedStar_png,lineLight_png,lockDown_png,lockUp_png,lockVine_png,magicLion_png,magicLionBg_png,mainMusicBtnOff_png,mainMusicBtnOn_png,mainQuestionBtn_png,mainQuitBtn_png,mainSettingBg_png,mainSoundBtnOff_png,mainSoundBtnOn_png,main_mapbottom_png,playSceneBg_jpg,progressDown_png,propNum0_png,propNum1_png,propNum2_png,propNum3_png,propNum4_png,propNum5_png,propNum6_png,propNum7_png,propNum8_png,propNum9_png,propNumBg_png,rectLat_png,rightArrow_png,rightMark_png,rock2_png,rock3_png,rock4_png,rock5_png,rock6_png,scoreNumber0_png,scoreNumber1_png,scoreNumber2_png,scoreNumber3_png,scoreNumber4_png,scoreNumber5_png,scoreNumber6_png,scoreNumber7_png,scoreNumber8_png,scoreNumber9_png,setting_png,starProgress_png,stepAni1_png,stepAni10_png,stepAni11_png,stepAni2_png,stepAni3_png,stepAni4_png,stepAni5_png,stepAni6_png,stepAni7_png,stepAni8_png,stepAni9_png,stepBtn_png,stepNumber0_png,stepNumber1_png,stepNumber2_png,stepNumber3_png,stepNumber4_png,stepNumber5_png,stepNumber6_png,stepNumber7_png,stepNumber8_png,stepNumber9_png,stepsBoard_png,targetBoard_png,targetNumber0_png,targetNumber1_png,targetNumber2_png,targetNumber3_png,targetNumber4_png,targetNumber5_png,targetNumber6_png,targetNumber7_png,targetNumber8_png,targetNumber9_png,unlightedStar_png,yezi1_png",
"name": "main2" "name": "main2"
},
{
"keys": "按钮 副本_png",
"name": "h5"
} }
], ],
"resources": [ "resources": [
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"resource/skins/FriendItem2Skin.exml", "resource/skins/FriendItem2Skin.exml",
"resource/skins/FriendItemSkin.exml", "resource/skins/FriendItemSkin.exml",
"resource/skins/FriendSkin.exml", "resource/skins/FriendSkin.exml",
"resource/skins/H5Skin.exml",
"resource/skins/IconButtonSkin.exml", "resource/skins/IconButtonSkin.exml",
"resource/skins/InviteItemSkin.exml", "resource/skins/InviteItemSkin.exml",
"resource/skins/InvitePrizePanelSkin.exml", "resource/skins/InvitePrizePanelSkin.exml",
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<e:Image id="avatar0" y="0" source="testavatar_png" width="60" height="60" x="0"/> <e:Image id="avatar0" y="0" source="testavatar_png" width="60" height="60" x="0"/>
<e:Rect id="avatarMask0" width="60" height="60" y="0" ellipseWidth="60" ellipseHeight="60"/> <e:Rect id="avatarMask0" width="60" height="60" y="0" ellipseWidth="60" ellipseHeight="60"/>
</e:Group> </e:Group>
<e:Label id="nickNameTxt" text="nickname" y="245" textColor="0x784325" horizontalCenter="6.5"/> <e:Label id="nameTxt0" text="nickname" y="245" textColor="0x784325" horizontalCenter="6.5"/>
<e:Label id="rankTxt" text="73" x="112" y="311" width="86" textAlign="center" verticalAlign="middle" height="52" size="48"/> <e:Label id="rankTxt" text="73" x="112" y="311" width="86" textAlign="center" verticalAlign="middle" height="52" size="48"/>
<e:Label id="nameTxt" text="Label" x="306" y="307" size="24"/> <e:Label id="nameTxt" text="Label" x="306" y="307" size="24"/>
<e:Label id="progress" text="第15关" x="306" y="340.79" size="24"/> <e:Label id="progress" text="第15关" x="306" y="340.79" size="24"/>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="H5Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<e:Label text="这里是h5页面" horizontalCenter="0" verticalCenter="0" textColor="0xa02c2c" size="65"/>
</e:Skin>
\ No newline at end of file
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</e:Button> </e:Button>
<e:Group x="84.67" y="0"> <e:Group x="84.67" y="0">
<e:Image source="invite_txtbg_png" x="0" y="0" touchEnabled="false"/> <e:Image source="invite_txtbg_png" x="0" y="0" touchEnabled="false"/>
<e:Label id="inviteTips" text="待领取" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center" textColor="0xffffff" size="18"/> <e:Label id="inviteTips" text="待领取取" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center" textColor="0xffffff" size="16"/>
</e:Group> </e:Group>
</e:Group> </e:Group>
<e:Group x="30" scaleX="1.4" scaleY="1.4" bottom="23"> <e:Group x="30" scaleX="1.4" scaleY="1.4" bottom="23">
......
import Scene from "../libs/new_wx/components/Scene";
export default class H5Scene extends Scene {
async start(data?) {
super.start();
console.log(666)
}
get skinKey() { return 'H5' }
}
...@@ -34,7 +34,7 @@ export default class MapScene extends Scene { ...@@ -34,7 +34,7 @@ export default class MapScene extends Scene {
async start(data?) { async start(data?) {
super.start(); super.start();
this.updateMyInfo();
this.updateAdData(); this.updateAdData();
this['avatar'].mask = this['avatarMask']; this['avatar'].mask = this['avatarMask'];
...@@ -55,7 +55,7 @@ export default class MapScene extends Scene { ...@@ -55,7 +55,7 @@ export default class MapScene extends Scene {
const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId); const oldTimerStr = localStorage.getItem('nowTimerStr' + window['CFG'].consumerId);
if (!readCache() && getHomeData().levels.length <= 0) { //引导 if (!readCache() && getHomeData().levels.length <= 0) { //引导
const guide = new GuideCon(()=>{ const guide = new GuideCon(() => {
const { signInfoVO } = DataManager.ins.getData('getSignInfo'); const { signInfoVO } = DataManager.ins.getData('getSignInfo');
if (signInfoVO.continueDay >= 7) return; if (signInfoVO.continueDay >= 7) return;
if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) { if (signInfoVO.todaySigned == 0 && oldTimerStr != nowTimerStr) {
...@@ -121,7 +121,7 @@ export default class MapScene extends Scene { ...@@ -121,7 +121,7 @@ export default class MapScene extends Scene {
const element = MapScene.iconHash[key]; const element = MapScene.iconHash[key];
element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => { element.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if ( if (
(levelOrder > (homeData.levels.length + 1) && levelOrder > 1 ) (levelOrder > (homeData.levels.length + 1) && levelOrder > 1)
|| (levelOrder > window['last_level']) || (levelOrder > window['last_level'])
) { ) {
// showToast('必须通关前面的关卡才能开启本关'); // showToast('必须通关前面的关卡才能开启本关');
...@@ -185,14 +185,26 @@ export default class MapScene extends Scene { ...@@ -185,14 +185,26 @@ export default class MapScene extends Scene {
} }
} }
updateAdData(){ updateMyInfo() {
this['avatar'].visible = false;
this['nameTxt'].text = '';
NetManager.ins.hc_userInfo(() => {
this['avatar'].visible = true;
const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = data.avatar;
this['nameTxt'].text = getNick(data.nickname);
});
}
updateAdData() {
// if(){ // if(){
// this['adBtn'].visible=false; // this['adBtn'].visible=false;
// } // }
// this['adBtn'].source = ''; // this['adBtn'].source = '';
this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{ this['adBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
// window.location.href = ''; // window.location.href = '';
},this); }, this);
} }
destroy() { destroy() {
...@@ -274,17 +286,17 @@ export default class MapScene extends Scene { ...@@ -274,17 +286,17 @@ export default class MapScene extends Scene {
updateScene() { updateScene() {
this.updateHomeData(); this.updateHomeData();
} }
addAvatar(level,data?){ addAvatar(level, data?) {
const item = MapScene.starHash[level]; const item = MapScene.starHash[level];
const parent = item.parent; const parent = item.parent;
const avatar = new AvatarComp(); const avatar = new AvatarComp();
avatar.loadSkin(); avatar.loadSkin();
avatar.start(data); avatar.start(data);
parent.addChild(avatar); parent.addChild(avatar);
avatar.x=item.x; avatar.x = item.x;
avatar.y=item.y - avatar.height; avatar.y = item.y - avatar.height;
} }
updateAvatars(){ updateAvatars() {
// 4 70 // 4 70
this.addAvatar(4); this.addAvatar(4);
this.addAvatar(70); this.addAvatar(70);
...@@ -343,9 +355,10 @@ export default class MapScene extends Scene { ...@@ -343,9 +355,10 @@ export default class MapScene extends Scene {
} }
this['bloodTxt'].text = `${data.remainEnargy}`; this['bloodTxt'].text = `${data.remainEnargy}`;
} }
onTap_taskBtn(){ onTap_taskBtn() {
PanelCtrl.instance.show('task'); PanelCtrl.instance.show('task');
} }
<<<<<<< HEAD
onTap_inviteBtn(){ onTap_inviteBtn(){
NetManager.ins.getInvateInfo((success, res)=>{ NetManager.ins.getInvateInfo((success, res)=>{
if(!success || !res.data){ if(!success || !res.data){
...@@ -353,17 +366,21 @@ export default class MapScene extends Scene { ...@@ -353,17 +366,21 @@ export default class MapScene extends Scene {
} }
PanelCtrl.instance.show('invite', res.data); PanelCtrl.instance.show('invite', res.data);
}); });
=======
onTap_inviteBtn() {
PanelCtrl.instance.show('invite');
>>>>>>> 0a4b334dc0c6f0151f4a6f5714102d247466ff04
} }
onTap_friendBtn(){ onTap_friendBtn() {
PanelCtrl.instance.show('friend'); PanelCtrl.instance.show('friend');
} }
onTap_adBtn(){ onTap_adBtn() {
console.log('onTap_adBtn') console.log('onTap_adBtn')
} }
onTap_signBtn(){ onTap_signBtn() {
NetManager.ins.getSignInfo(() => { NetManager.ins.getSignInfo(() => {
PanelCtrl.instance.show('sign'); PanelCtrl.instance.show('sign');
},window['signActivityId']) }, window['signActivityId'])
} }
protected initEvents() { protected initEvents() {
...@@ -546,3 +563,10 @@ export default class MapScene extends Scene { ...@@ -546,3 +563,10 @@ export default class MapScene extends Scene {
get skinKey() { return 'Map' } get skinKey() { return 'Map' }
} }
export const getNick = (nickname) => {
if(!nickname) return nickname;
const max = 4;
if (nickname.length > max)
return nickname.slice(0, max) + '...';
return nickname;
}
\ No newline at end of file
import getSkinPath from "../../libs/new_wx/utils/getSkinPath"; import getSkinPath from "../../libs/new_wx/utils/getSkinPath";
import { getNick } from "../mapScene/MapScene";
export default class FriendItem2Renderer extends eui.ItemRenderer { export default class FriendItem2Renderer extends eui.ItemRenderer {
constructor() { constructor() {
...@@ -8,7 +9,7 @@ export default class FriendItem2Renderer extends eui.ItemRenderer { ...@@ -8,7 +9,7 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
score: eui.Label; score: eui.Label;
dataChanged() { dataChanged() {
const rank = this.data; const {rank,nickName,avatar,maxScore}= this.data;
this['avatar'].mask = this['avatarMask']; this['avatar'].mask = this['avatarMask'];
...@@ -25,9 +26,11 @@ export default class FriendItem2Renderer extends eui.ItemRenderer { ...@@ -25,9 +26,11 @@ export default class FriendItem2Renderer extends eui.ItemRenderer {
this['rankbg'].visible = true; this['rankbg'].visible = true;
} }
this['nameTxt'].text = this.data + 'name'; this['avatar'].source = avatar
this['nameTxt'].text = getNick(nickName);
this.score.textFlow = (new egret.HtmlTextParser).parser( this.score.textFlow = (new egret.HtmlTextParser).parser(
`分数:<font color=0xff4501><b>${15}</b></font>分`); `分数:<font color=0xff4501><b>${maxScore}</b></font>分`);
} }
} }
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import FriendItemRenderer from "./FriendItemRenderer"; import FriendItemRenderer from "./FriendItemRenderer";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { getNick } from "../mapScene/MapScene";
export default class FriendPanel extends Panel { export default class FriendPanel extends Panel {
public list: eui.List; public list: eui.List;
...@@ -8,6 +11,9 @@ export default class FriendPanel extends Panel { ...@@ -8,6 +11,9 @@ export default class FriendPanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
this.updateMyInfo();
this.progress.textFlow = (new egret.HtmlTextParser).parser( this.progress.textFlow = (new egret.HtmlTextParser).parser(
`第<font color=0xfff000><b>${15}</b></font>关`); `第<font color=0xfff000><b>${15}</b></font>关`);
this.score.textFlow = (new egret.HtmlTextParser).parser( this.score.textFlow = (new egret.HtmlTextParser).parser(
...@@ -23,6 +29,23 @@ export default class FriendPanel extends Panel { ...@@ -23,6 +29,23 @@ export default class FriendPanel extends Panel {
this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this); this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapInvite, this);
} }
private updateMyInfo() {
this['avatar'].visible = false;
this['avatar0'].visible = false;
this['nameTxt'].text = '';
this['nameTxt0'].text = '';
NetManager.ins.hc_userInfo(() => {
this['avatar'].visible = true;
this['avatar0'].visible = true;
const { data } = DataManager.ins.getData('hc_userInfo');
this['avatar'].source = this['avatar0'].source = data.avatar;
this['nameTxt'].text = getNick(data.nickname);
this['nameTxt0'].text = getNick(data.nickname);
});
}
showlog() { showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
......
...@@ -18,6 +18,7 @@ import { ElementType } from "../something/enum/ElementType"; ...@@ -18,6 +18,7 @@ import { ElementType } from "../something/enum/ElementType";
import { PassType } from "../something/enum/PassType"; import { PassType } from "../something/enum/PassType";
import FriendItem2Renderer from "./FriendItem2Renderer"; import FriendItem2Renderer from "./FriendItem2Renderer";
import TargetItemRenderer from "./TargetItemRenderer"; import TargetItemRenderer from "./TargetItemRenderer";
import { DataManager } from "../../libs/tw/manager/DataManager";
export default class StartPanel extends Panel { export default class StartPanel extends Panel {
private _level; private _level;
...@@ -25,14 +26,18 @@ export default class StartPanel extends Panel { ...@@ -25,14 +26,18 @@ export default class StartPanel extends Panel {
public friendlist: eui.List; public friendlist: eui.List;
start(data) { start(data) {
super.start(); super.start();
this.friendlist.useVirtualLayout = false; this.friendlist.useVirtualLayout = false;
this.friendlist.itemRenderer = FriendItem2Renderer; this.friendlist.itemRenderer = FriendItem2Renderer;
const friends = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; this.friendlist.visible = false;
NetManager.ins.hc_levelNumRank(() => {
this.friendlist.visible = true;
const { data: friends } = DataManager.ins.getData('hc_levelNumRank');
if (friends.length > 5) if (friends.length > 5)
friends.length = 5; friends.length = 5;
const ac = new eui.ArrayCollection(friends); const ac = new eui.ArrayCollection(friends);
this.friendlist.dataProvider = ac; this.friendlist.dataProvider = ac;
}, data)
setGlow(this['levelTxt'], 0xfa4b09, 1); setGlow(this['levelTxt'], 0xfa4b09, 1);
this['levelTxt'].text = `第${data}关`; this['levelTxt'].text = `第${data}关`;
......
const path = require('path'); const path = require('path');
const config = { const config = {
'/customActivity/happyclear/userInfo': {
data: './happyclear/userInfo.json'
},
'/customActivity/happyclear/levelNumRank': {
data: './happyclear/levelNumRank.json'
},
'/customActivity/happyclear/mapRank': { '/customActivity/happyclear/mapRank': {
data: './happyclear/mapRank.json' data: './happyclear/mapRank.json'
}, },
......
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1566199822308,
"data": [
{
"nickName": "奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 11,
"rank": "1"
},
{
"nickName": "2奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 22,
"rank": "2"
},
{
"nickName": "3奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 333,
"rank": "3"
},
{
"nickName": "4奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 44444,
"rank": "4"
},
{
"nickName": "5奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 123,
"rank": "5"
},
{
"nickName": "6奈何本人没文化,一句卧槽行天下",
"avatar": "http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"stars": 1,
"maxScore": 555555,
"rank": "6"
}
]
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1570785133074,
"data":{
"id":27,
"consumerId":1539361,
"appId":1,
"partnerUserId":"1",
"nickname":"奈何本人没文化,一句卧槽行天下",
"avatar":"http://yun.dui88.com/images/201604/c6s5l4dgea.jpg",
"email":null,
"sex":null,
"gmtCreate":1447904240000,
"gmtModified":1564034789000
}
}
\ 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