Commit f41fe2d1 authored by 邱旭's avatar 邱旭

1

parent ee2d4568
...@@ -37,13 +37,13 @@ export default class TurntableIcon extends IconBase { ...@@ -37,13 +37,13 @@ export default class TurntableIcon extends IconBase {
return; return;
} }
let data = res.data; let data = res.data;
this.visible = res.data.luckyDrawInfo.enable;
if (data.remainTimes > 0 || (getHomeData().wealth > data.nextTimeNeedCoin)) { if (data.remainTimes > 0 || (getHomeData().wealth > data.nextTimeNeedCoin)) {
this.tipsVisible = true; this.tipsVisible = true;
this.iconTips.text = "有优惠" this.iconTips.text = "有优惠"
} else { } else {
this.tipsVisible = false; this.tipsVisible = false;
} }
this.visible = res.data.luckyDrawInfo.enable;
if(!res.data.luckyDrawInfo.enable) if(!res.data.luckyDrawInfo.enable)
GDispatcher.dispatchEvent('updateScratchPosition'); GDispatcher.dispatchEvent('updateScratchPosition');
}) })
......
...@@ -11,8 +11,9 @@ export default class BagQuitPanel extends Panel { ...@@ -11,8 +11,9 @@ export default class BagQuitPanel extends Panel {
panel: string panel: string
start(data) { start(data) {
super.start(); super.start();
this.data = data;
this.showlog(); this.showlog();
this.panel = data; this.panel = data.from;
} }
showlog() { showlog() {
...@@ -26,7 +27,7 @@ export default class BagQuitPanel extends Panel { ...@@ -26,7 +27,7 @@ export default class BagQuitPanel extends Panel {
} }
onresumebtn() { onresumebtn() {
PanelCtrl.instance.show(this.panel) PanelCtrl.instance.show(this.panel, this.data.data);
NetManager.ins.clickLog(getlogItem(42)); NetManager.ins.clickLog(getlogItem(42));
} }
......
...@@ -12,6 +12,7 @@ import CountDown from "../mapScene/CountDown"; ...@@ -12,6 +12,7 @@ import CountDown from "../mapScene/CountDown";
import { showShare } from "../shareCtrl"; import { showShare } from "../shareCtrl";
import { gotoNextLevel } from "./gotoNextLevel"; import { gotoNextLevel } from "./gotoNextLevel";
import BloodPanel2 from "./BloodPanel2"; import BloodPanel2 from "./BloodPanel2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class BloodPanel extends Panel { export default class BloodPanel extends Panel {
start(data) { start(data) {
...@@ -19,43 +20,44 @@ export default class BloodPanel extends Panel { ...@@ -19,43 +20,44 @@ export default class BloodPanel extends Panel {
this.updateData(); this.updateData();
this.showlog(); this.showlog();
this['price1Txt'].text =`${ window['price1']}个元宝=1个体力值`; this['price1Txt'].text = `${window['price1']}个元宝=1个体力值`;
this['resumeBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{ this['resumeBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
gotoNextLevel(); gotoNextLevel();
},this); }, this);
} }
showlog(){ showlog() {
NetManager.ins.showLog(getlogItem(3)); NetManager.ins.showLog(getlogItem(3));
NetManager.ins.showLog(getlogItem(4)); NetManager.ins.showLog(getlogItem(4));
NetManager.ins.showLog(getlogItem(30)); NetManager.ins.showLog(getlogItem(30));
} }
static MAX =3; static MAX = 3;
private _countDown:CountDown; private _countDown: CountDown;
private updateData() { private updateData() {
if(this._countDown == null ) { if(this._countDown == null) {
this._countDown = new CountDown(this['countdownTxt'],(str)=>`距离下一次体力补给时间:${str}`); this._countDown = new CountDown(this['countdownTxt'], (str) => `距离下一次体力补给时间:${str}`);
} }
const homeData = getHomeData(); const homeData = getHomeData();
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`; this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
const data = getHomeData(); const data = getHomeData();
this['invitTxt'].text = `(已领${data.askForEnergy}/${BloodPanel.MAX})`; this['invitTxt'].text = `(已领${data.askForEnergy}/${BloodPanel.MAX})`;
if (data.askForEnergy >= BloodPanel.MAX){ if(data.askForEnergy >= BloodPanel.MAX) {
this['inviteBtn2'].visible=true; this['inviteBtn2'].visible = true;
} }
if(data.remainEnargy >= BLOOD_NUMS_MAX) { //满了 if(data.remainEnargy >= BLOOD_NUMS_MAX) { //满了
this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`; this['bloodTxt'].text = `你的可用体力值为:${homeData.remainEnargy}`;
this._countDown.stop(); this._countDown.stop();
this['countdownTxt'].visible=false; this['countdownTxt'].visible = false;
}else { } else {
this['countdownTxt'].visible=true; this['countdownTxt'].visible = true;
const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000); const left = data.refectionCountdown - Math.floor(new Date().getTime() / 1000);
this._countDown.reset(left); this._countDown.reset(left);
} }
} }
updateTimerView(){ updateTimerView() {
this.updateData(); this.updateData();
} }
...@@ -71,45 +73,52 @@ export default class BloodPanel extends Panel { ...@@ -71,45 +73,52 @@ export default class BloodPanel extends Panel {
this['buyBtn'].enabled = false; this['buyBtn'].enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this['buyBtn'].enabled = true; this['buyBtn'].enabled = true;
if (success) { if(success) {
showToast('兑换成功'); showToast('兑换成功');
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
this.updateData(); this.updateData();
updateMainTimer(); updateMainTimer();
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
} else {
PanelCtrl.instance.show('shopTip', {from: 'bloodPanel', data: null});
} }
}, 1); }, 1);
} }
onTapInvite() { onTapInvite() {
if (iswx()) { if(iswx()) {
getShareUrl(this.stage); getShareUrl(this.stage);
} else } else
showShare(1); showShare(1);
NetManager.ins.clickLog(getlogItem(4)); NetManager.ins.clickLog(getlogItem(4));
const data = getHomeData(); const data = getHomeData();
if (data.askForEnergy >= BloodPanel.MAX) { if(data.askForEnergy >= BloodPanel.MAX) {
showToast('对不起,索要体力的机会已经用完了~'); showToast('对不起,索要体力的机会已经用完了~');
return; return;
} }
this['inviteBtn'].enabled = false; this['inviteBtn'].enabled = false;
NetManager.ins.hc_askForEnergy((success) => { NetManager.ins.hc_askForEnergy((success) => {
this['inviteBtn'].enabled = true; this['inviteBtn'].enabled = true;
if (success) { if(success) {
} }
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
this.updateData(); this.updateData();
updateMainTimer(); updateMainTimer();
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
wait(2000).then(()=>{ wait(2000).then(() => {
showToast('分享成功~'); showToast('分享成功~');
}); });
}) })
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn'], this['resumeBtn']] }
get skinKey() { return 'Blood' } protected get closeBtns(): eui.Button[] {
return [this['closeBtn'], this['resumeBtn']]
}
get skinKey() {
return 'Blood'
}
} }
\ No newline at end of file
...@@ -13,17 +13,17 @@ import MainScene from "../mainScene/MainScene"; ...@@ -13,17 +13,17 @@ import MainScene from "../mainScene/MainScene";
export default class Buy1Panel extends Panel { export default class Buy1Panel extends Panel {
buyBtn: eui.Button buyBtn: eui.Button
onTouchTap_closeBtn(){ onTouchTap_closeBtn() {
super.onTouchTap_closeBtn(); super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','Buy1') PanelCtrl.instance.show('bagquit', {from: 'Buy1', data: this.data});
} }
start(data) { start(data) {
super.start(); super.start();
this.data = data;
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this); this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
this.showlog(); this.showlog();
this['priceTxt'].text = '-'+window['price3']; this['priceTxt'].text = '-' + window['price3'];
this['moneyTxt'].text = getHomeData().wealth; this['moneyTxt'].text = getHomeData().wealth;
setGlow(this['priceTxt'], 0x0083e8, 1); setGlow(this['priceTxt'], 0x0083e8, 1);
...@@ -38,22 +38,24 @@ export default class Buy1Panel extends Panel { ...@@ -38,22 +38,24 @@ export default class Buy1Panel extends Panel {
this.buyBtn.enabled = false; this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if(success) {
this.hidePanel(); this.hidePanel();
if(SceneCtrl.instance.currentScene instanceof MainScene){ if(SceneCtrl.instance.currentScene instanceof MainScene) {
showToast('兑换成功'); showToast('兑换成功');
}else { } else {
showToast2(); showToast2();
} }
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else { } else {
PanelCtrl.instance.show('shopTip'); PanelCtrl.instance.show('shopTip', this.data);
} }
}, PropType.HAMMER);//兑换道具 }, PropType.HAMMER);//兑换道具
} }
get skinKey() { return 'Buy1' } get skinKey() {
return 'Buy1'
}
} }
\ No newline at end of file
...@@ -13,10 +13,11 @@ import MainScene from "../mainScene/MainScene"; ...@@ -13,10 +13,11 @@ import MainScene from "../mainScene/MainScene";
export default class Buy2Panel extends Panel { export default class Buy2Panel extends Panel {
onTouchTap_closeBtn(){ onTouchTap_closeBtn(){
super.onTouchTap_closeBtn(); super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','Buy2') PanelCtrl.instance.show('bagquit',{from: 'Buy2', data: this.data})
} }
start(data) { start(data) {
super.start(); super.start();
this.data = data;
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this); this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
this.showlog(); this.showlog();
...@@ -44,7 +45,7 @@ export default class Buy2Panel extends Panel { ...@@ -44,7 +45,7 @@ export default class Buy2Panel extends Panel {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else{ }else{
PanelCtrl.instance.show('shopTip'); PanelCtrl.instance.show('shopTip', this.data);
} }
}, PropType.BOOM);//兑换道具 }, PropType.BOOM);//兑换道具
} }
......
...@@ -11,41 +11,49 @@ import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; ...@@ -11,41 +11,49 @@ import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import MainScene from "../mainScene/MainScene"; import MainScene from "../mainScene/MainScene";
export default class Buy3Panel extends Panel { export default class Buy3Panel extends Panel {
onTouchTap_closeBtn(){ onTouchTap_closeBtn() {
super.onTouchTap_closeBtn(); super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','Buy3') PanelCtrl.instance.show('bagquit', {from: 'Buy3', data: this.data})
} }
start(data) { start(data) {
super.start(); super.start();
this.data = data;
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this); this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
this.showlog(); this.showlog();
this['priceTxt'].text = '-'+window['price4']; this['priceTxt'].text = '-' + window['price4'];
setGlow(this['priceTxt'], 0x0083e8, 1); setGlow(this['priceTxt'], 0x0083e8, 1);
this['moneyTxt'].text = getHomeData().wealth; this['moneyTxt'].text = getHomeData().wealth;
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(14)); NetManager.ins.showLog(getlogItem(14));
} }
buyBtn: eui.Button buyBtn: eui.Button
get skinKey() { return 'Buy3' }
get skinKey() {
return 'Buy3'
}
ontap() { ontap() {
NetManager.ins.clickLog(getlogItem(14)); NetManager.ins.clickLog(getlogItem(14));
this.buyBtn.enabled = false; this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if(success) {
if(SceneCtrl.instance.currentScene instanceof MainScene){ if(SceneCtrl.instance.currentScene instanceof MainScene) {
showToast('兑换成功'); showToast('兑换成功');
}else { } else {
showToast2(); showToast2();
} }
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else{ } else {
PanelCtrl.instance.show('shopTip'); PanelCtrl.instance.show('shopTip', this.data);
} }
}, PropType.CHANCE_NUM);//兑换道具 }, PropType.CHANCE_NUM);//兑换道具
} }
......
...@@ -10,37 +10,44 @@ import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2"; ...@@ -10,37 +10,44 @@ import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class ExchangePanel extends Panel { export default class ExchangePanel extends Panel {
onTouchTap_closeBtn(){ onTouchTap_closeBtn() {
super.onTouchTap_closeBtn(); super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','ExchangePanel') PanelCtrl.instance.show('bagquit', {from: 'ExchangePanel', data: this.data})
} }
start(data) { start(data) {
super.start(); super.start();
this.data = data;
this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this); this['buyBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap, this);
this.showlog(); this.showlog();
this['priceTxt'].text = '-'+window['price5']; this['priceTxt'].text = '-' + window['price5'];
setGlow(this['priceTxt'], 0x0083e8, 1); setGlow(this['priceTxt'], 0x0083e8, 1);
this['moneyTxt'].text = getHomeData().wealth; this['moneyTxt'].text = getHomeData().wealth;
} }
showlog() { showlog() {
NetManager.ins.showLog(getlogItem(41)); NetManager.ins.showLog(getlogItem(41));
} }
buyBtn: eui.Button buyBtn: eui.Button
get skinKey() { return 'Exchange' }
get skinKey() {
return 'Exchange'
}
ontap() { ontap() {
NetManager.ins.clickLog(getlogItem(41)); NetManager.ins.clickLog(getlogItem(41));
this.buyBtn.enabled = false; this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if(success) {
showToast2(); showToast2();
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else{ } else {
PanelCtrl.instance.show('shopTip'); PanelCtrl.instance.show('shopTip', this.data);
} }
}, PropType.CASH_NUM);//兑换道具 }, PropType.CASH_NUM);//兑换道具
} }
......
...@@ -5,6 +5,8 @@ import { getlogItem } from "../Main"; ...@@ -5,6 +5,8 @@ import { getlogItem } from "../Main";
import Utils from "../Utils"; import Utils from "../Utils";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
const MIN: number = 1; const MIN: number = 1;
const MAX: number = 100; const MAX: number = 100;
...@@ -33,6 +35,7 @@ export default class RechargePanel extends Panel { ...@@ -33,6 +35,7 @@ export default class RechargePanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.data = data;
this.getYunZuan(); this.getYunZuan();
this.setNum(); this.setNum();
NetManager.ins.showLog(getlogItem(70)); NetManager.ins.showLog(getlogItem(70));
...@@ -160,9 +163,17 @@ export default class RechargePanel extends Panel { ...@@ -160,9 +163,17 @@ export default class RechargePanel extends Panel {
}, this.nowNumber); }, this.nowNumber);
} }
onTouchTap_closeBtn() { public onTouchTap_closeBtn() {
super.onTouchTap_closeBtn(); super.onTouchTap_closeBtn();
PanelCtrl.instance.show('Shop'); if(!this.data) return;
if(this.data.from == 'turnTable') {
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// await wait(100);
PanelCtrl.instance.show('turnTable', {mv: mv})
})
} else {
PanelCtrl.instance.show(this.data.from, this.data.data);
}
} }
private getYunZuan() { private getYunZuan() {
......
...@@ -26,7 +26,7 @@ export default class ShopPanel extends Panel { ...@@ -26,7 +26,7 @@ export default class ShopPanel extends Panel {
private goRecharge() { private goRecharge() {
NetManager.ins.clickLog(getlogItem(68)); NetManager.ins.clickLog(getlogItem(68));
PanelCtrl.instance.show('recharge'); PanelCtrl.instance.show('recharge', {from: 'Shop', data: null});
} }
destroy() { destroy() {
...@@ -47,12 +47,12 @@ export default class ShopPanel extends Panel { ...@@ -47,12 +47,12 @@ export default class ShopPanel extends Panel {
} }
onBuy4() { onBuy4() {
PanelCtrl.instance.show('ExchangePanel'); PanelCtrl.instance.show('ExchangePanel', {from: 'Shop', data: null});
NetManager.ins.clickLog(getlogItem(40)); NetManager.ins.clickLog(getlogItem(40));
} }
onBuy1() { onBuy1() {
PanelCtrl.instance.show('Buy1'); PanelCtrl.instance.show('Buy1', {from: 'Shop', data: null});
NetManager.ins.clickLog(getlogItem(9)); NetManager.ins.clickLog(getlogItem(9));
// this.buyBtn1.enabled = false; // this.buyBtn1.enabled = false;
// NetManager.ins.hc_exchange((success) => { // NetManager.ins.hc_exchange((success) => {
...@@ -66,7 +66,7 @@ export default class ShopPanel extends Panel { ...@@ -66,7 +66,7 @@ export default class ShopPanel extends Panel {
} }
onBuy2() { onBuy2() {
PanelCtrl.instance.show('Buy2'); PanelCtrl.instance.show('Buy2', {from: 'Shop', data: null});
NetManager.ins.clickLog(getlogItem(6)); NetManager.ins.clickLog(getlogItem(6));
// this.buyBtn2.enabled = false; // this.buyBtn2.enabled = false;
// NetManager.ins.hc_exchange((success) => { // NetManager.ins.hc_exchange((success) => {
...@@ -81,7 +81,7 @@ export default class ShopPanel extends Panel { ...@@ -81,7 +81,7 @@ export default class ShopPanel extends Panel {
onBuy3() { onBuy3() {
NetManager.ins.clickLog(getlogItem(12)); NetManager.ins.clickLog(getlogItem(12));
PanelCtrl.instance.show('Buy3'); PanelCtrl.instance.show('Buy3', {from: 'Shop', data: null});
// this.buyBtn3.enabled = false; // this.buyBtn3.enabled = false;
// NetManager.ins.hc_exchange((success) => { // NetManager.ins.hc_exchange((success) => {
// this.buyBtn3.enabled = true; // this.buyBtn3.enabled = true;
......
...@@ -2,6 +2,8 @@ import Panel from "../../libs/new_wx/components/Panel"; ...@@ -2,6 +2,8 @@ import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import { getlogItem } from "../Main"; import { getlogItem } from "../Main";
import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
export default class ShopTipPanel extends Panel { export default class ShopTipPanel extends Panel {
public closeBtn: eui.Button; public closeBtn: eui.Button;
...@@ -9,9 +11,23 @@ export default class ShopTipPanel extends Panel { ...@@ -9,9 +11,23 @@ export default class ShopTipPanel extends Panel {
start(data) { start(data) {
super.start(); super.start();
this.data = data;
NetManager.ins.showLog(getlogItem(69)); NetManager.ins.showLog(getlogItem(69));
} }
public onTouchTap_closeBtn() {
super.onTouchTap_closeBtn();
if(!this.data) return;
if(this.data.from == 'turnTable') {
loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// await wait(100);
PanelCtrl.instance.show('turnTable', {mv: mv})
})
} else {
PanelCtrl.instance.show(this.data.from, this.data.data);
}
}
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this); this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this);
...@@ -19,8 +35,7 @@ export default class ShopTipPanel extends Panel { ...@@ -19,8 +35,7 @@ export default class ShopTipPanel extends Panel {
onTouchBtn() { onTouchBtn() {
NetManager.ins.clickLog(getlogItem(69)); NetManager.ins.clickLog(getlogItem(69));
PanelCtrl.instance.show('recharge'); PanelCtrl.instance.show('recharge', this.data);
// this.onTouchTap_closeBtn();
} }
removeEvents() { removeEvents() {
......
...@@ -25,9 +25,11 @@ export default class StartPanel extends Panel { ...@@ -25,9 +25,11 @@ export default class StartPanel extends Panel {
static currlevel; static currlevel;
private _level; private _level;
private list: eui.List; private list: eui.List;
showlog(){
} showlog() {
}
start(data) { start(data) {
this.showlog() this.showlog()
super.start(); super.start();
...@@ -36,12 +38,11 @@ showlog(){ ...@@ -36,12 +38,11 @@ showlog(){
this['price4'].text = `-${window['price4']}元宝`; this['price4'].text = `-${window['price4']}元宝`;
const homedata = getHomeData(); const homedata = getHomeData();
if (data > homedata.levels.length) { if(data > homedata.levels.length) {
addAdComp(84, 901, this,29); addAdComp(84, 901, this, 29);
NetManager.ins.showLog(getlogItem(29)); NetManager.ins.showLog(getlogItem(29));
} } else
else addRankFriendList(84, 901, this, data);
addRankFriendList(84, 901, this,data);
setGlow(this['levelTxt'], 0xfa4b09, 1); setGlow(this['levelTxt'], 0xfa4b09, 1);
this['levelTxt'].text = `第${data}关`; this['levelTxt'].text = `第${data}关`;
...@@ -50,7 +51,7 @@ showlog(){ ...@@ -50,7 +51,7 @@ showlog(){
this['targetGroup'].visible = false; this['targetGroup'].visible = false;
this['scoreGroup'].visible = false; this['scoreGroup'].visible = false;
const levelType = getChapterData(mapDataIndex).passTarget.type; const levelType = getChapterData(mapDataIndex).passTarget.type;
if (levelType == PassType.ELEMENT_TARGET) { if(levelType == PassType.ELEMENT_TARGET) {
this['targetGroup'].visible = true; this['targetGroup'].visible = true;
// this['targetTxt'].text = '在规定步数内\n消除足够数量目标'; // this['targetTxt'].text = '在规定步数内\n消除足够数量目标';
...@@ -58,10 +59,9 @@ showlog(){ ...@@ -58,10 +59,9 @@ showlog(){
const ac = new eui.ArrayCollection(getChapterData(mapDataIndex).passTarget.elements); const ac = new eui.ArrayCollection(getChapterData(mapDataIndex).passTarget.elements);
this.list.dataProvider = ac; this.list.dataProvider = ac;
const elements = getChapterData(mapDataIndex).passTarget.elements; const elements = getChapterData(mapDataIndex).passTarget.elements;
if (elements.length == 1 && elements[0].type == ElementType.LOLLIPOP) if(elements.length == 1 && elements[0].type == ElementType.LOLLIPOP)
this['tips'].text = '在指定步数内将目标元素移至最底部'; this['tips'].text = '在指定步数内将目标元素移至最底部';
} } else if(levelType == PassType.SCORE_TARGET) {
else if (levelType == PassType.SCORE_TARGET) {
this['scoreGroup'].visible = true; this['scoreGroup'].visible = true;
this['targetScoreTxt'].text = `${getChapterData(mapDataIndex).passTarget.score}`; this['targetScoreTxt'].text = `${getChapterData(mapDataIndex).passTarget.score}`;
// this['targetTxt'].text = `在规定步数内\n分数达到${getChapterData(mapDataIndex).passTarget.score}分`; // this['targetTxt'].text = `在规定步数内\n分数达到${getChapterData(mapDataIndex).passTarget.score}分`;
...@@ -85,11 +85,11 @@ showlog(){ ...@@ -85,11 +85,11 @@ showlog(){
onTap_startBtn() { onTap_startBtn() {
const homeData = getHomeData(); const homeData = getHomeData();
if (homeData.remainEnargy <= 0) { if(homeData.remainEnargy <= 0) {
if (homeData.askForEnergy) { if(homeData.askForEnergy) {
PanelCtrl.instance.show('blood2Panel'); PanelCtrl.instance.show('blood2Panel');
} else { } else {
if (iswx()) { if(iswx()) {
getShareUrl(this.stage); getShareUrl(this.stage);
} else } else
showShare(1); showShare(1);
...@@ -121,7 +121,7 @@ showlog(){ ...@@ -121,7 +121,7 @@ showlog(){
wait(5000).then(() => { wait(5000).then(() => {
updateMainTimerAfterGetData(); updateMainTimerAfterGetData();
}); });
if (success) { if(success) {
// Loading.instace.show(); // Loading.instace.show();
this.hidePanel(); this.hidePanel();
try { try {
...@@ -129,27 +129,32 @@ showlog(){ ...@@ -129,27 +129,32 @@ showlog(){
await Promise.all([ await Promise.all([
RES.getResAsync(`${key}_json`), RES.getResAsync(`${key}_json`),
RES.getResAsync(`${key}_png`)]); RES.getResAsync(`${key}_png`)]);
} catch (error) { } catch(error) {
} }
// Loading.instace.hide(); // Loading.instace.hide();
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE, { chapter: this._level }); SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE, {chapter: this._level});
StartPanel.currlevel=this._level StartPanel.currlevel = this._level
} }
}, this._level); }, this._level);
} }
onTap_buy1btn() { onTap_buy1btn() {
PanelCtrl.instance.show('Buy1'); PanelCtrl.instance.show('Buy1', {from: 'StartPanel', data: this._level});
} }
onTap_buy2btn() { onTap_buy2btn() {
PanelCtrl.instance.show('Buy2'); PanelCtrl.instance.show('Buy2', {from: 'StartPanel', data: this._level});
} }
onTap_buy3btn() { onTap_buy3btn() {
PanelCtrl.instance.show('Buy3'); PanelCtrl.instance.show('Buy3', {from: 'StartPanel', data: this._level});
} }
get skinKey() { return 'StartPanel' } get skinKey() {
return 'StartPanel'
}
} }
\ No newline at end of file
...@@ -84,7 +84,8 @@ export default class Turntable extends Panel { ...@@ -84,7 +84,8 @@ export default class Turntable extends Panel {
this.setBtnTouch(false); // 锁定按钮 this.setBtnTouch(false); // 锁定按钮
Loading.instace.show(); Loading.instace.show();
if(this.remainTimes <= 0 && (getHomeData().wealth < this.nextTimeNeedCoin)) { if(this.remainTimes <= 0 && (getHomeData().wealth < this.nextTimeNeedCoin)) {
showToast("元宝不足咯~快去闯关赢元宝吧"); // showToast("元宝不足咯~快去闯关赢元宝吧");
PanelCtrl.instance.show('shopTip', {from: 'turnTable', data: null});
Loading.instace.hide(); Loading.instace.hide();
this.setBtnTouch(true); this.setBtnTouch(true);
return; return;
......
...@@ -1136,7 +1136,7 @@ ...@@ -1136,7 +1136,7 @@
"remainProp": [ "remainProp": [
{ {
"type": 2, "type": 2,
"num": 1 "num": 0
}, },
{ {
"type": 3, "type": 3,
......
...@@ -4,113 +4,10 @@ ...@@ -4,113 +4,10 @@
"remainTimes": 0, "remainTimes": 0,
"costCoinJoinTimes": 2, "costCoinJoinTimes": 2,
"luckyDrawInfo": { "luckyDrawInfo": {
"baseCount": 30, "baseCount": 0,
"bonusCount": 0, "bonusCount": 0,
"enable": true, "enable": true,
"prizeList": [ "prizeList": [],
{
"appItemId": null,
"coinType": 1,
"img": "",
"maxValue": 50,
"num": null,
"title": "50元宝",
"categoryType": 4,
"minValue": 50,
"realValue": null,
"rate": "40",
"name": "",
"id": "",
"propType": null,
"day": null,
"value": ""
},
{
"appItemId": null,
"coinType": null,
"img": "",
"maxValue": null,
"num": null,
"title": "道具",
"categoryType": 3,
"minValue": null,
"realValue": null,
"rate": "11",
"name": "",
"id": "",
"propType": 2,
"day": null,
"value": ""
},
{
"appItemId": 2191088,
"coinType": null,
"img": "//yun.duiba.com.cn/images/201911/pktvju5tgn.png",
"maxValue": null,
"num": null,
"title": "0.68元",
"categoryType": 7,
"minValue": null,
"realValue": null,
"rate": "1",
"name": "邀请5人0.68元现金券",
"id": "",
"propType": null,
"day": null,
"value": "297775348866940929"
},
{
"appItemId": null,
"coinType": null,
"img": "",
"maxValue": null,
"num": 3,
"title": "3体力",
"categoryType": 2,
"minValue": null,
"realValue": null,
"rate": "25",
"name": "",
"id": "",
"propType": null,
"day": null,
"value": ""
},
{
"appItemId": null,
"coinType": null,
"img": "",
"maxValue": null,
"num": null,
"title": "道具 锤子",
"categoryType": 3,
"minValue": null,
"realValue": null,
"rate": "11",
"name": "",
"id": "",
"propType": 1,
"day": null,
"value": ""
},
{
"appItemId": null,
"coinType": null,
"img": "",
"maxValue": null,
"num": null,
"title": "炸弹",
"categoryType": 3,
"minValue": null,
"realValue": null,
"rate": "12",
"name": "",
"id": "",
"propType": 3,
"day": null,
"value": ""
}
],
"id": null "id": null
}, },
"nextTimeNeedCoin": 1 "nextTimeNeedCoin": 1
......
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