Commit 67209cf9 authored by wildfirecode's avatar wildfirecode

1

parent 9fc63e49
...@@ -55,6 +55,7 @@ import RulePanel2 from "./components/RulePanel2"; ...@@ -55,6 +55,7 @@ import RulePanel2 from "./components/RulePanel2";
import ScratchPanel from "../../src/panels/ScratchPanel"; import ScratchPanel from "../../src/panels/ScratchPanel";
import ScratchPrizePanel from "../../src/panels/ScratchPrizePanel"; import ScratchPrizePanel from "../../src/panels/ScratchPrizePanel";
import TurntablePanel from "../../src/panels/TurntablePanel/TurntablePanel"; import TurntablePanel from "../../src/panels/TurntablePanel/TurntablePanel";
import BagQuitPanel from "../../src/panels/BagQuitPanel";
export default class MainBase extends eui.UILayer { export default class MainBase extends eui.UILayer {
constructor() { constructor() {
...@@ -74,6 +75,7 @@ export default class MainBase extends eui.UILayer { ...@@ -74,6 +75,7 @@ export default class MainBase extends eui.UILayer {
[ModuleTypes.PRIZE_PANEL, { cls: PrizePanel }], [ModuleTypes.PRIZE_PANEL, { cls: PrizePanel }],
[ModuleTypes.NO_PRIZE_PANEL, { cls: NoPrizePanel }], [ModuleTypes.NO_PRIZE_PANEL, { cls: NoPrizePanel }],
['bag', { cls: BagPanel }], ['bag', { cls: BagPanel }],
['bagquit', { cls: BagQuitPanel }],
['bloodPanel', { cls: BloodPanel }], ['bloodPanel', { cls: BloodPanel }],
['blood2Panel', { cls: BloodPanel2 }], ['blood2Panel', { cls: BloodPanel2 }],
['GoldPanel', { cls: GoldPanel }], ['GoldPanel', { cls: GoldPanel }],
......
import ComponentBase from "./ComponentBase";
import { HtmlTextParser } from "../HtmlTextParser";
import { gotoNextLevel } from "../../../src/panels/gotoNextLevel";
export default class Toast2 extends ComponentBase {
get skinResKey() { return 'common' }
get skinKey(): string { return 'Toast2' }
toastLabel:eui.Label;
start() {
this.toastLabel.textFlow = (new HtmlTextParser).parser('<u>继续闯关赢好礼</u>');
this.toastLabel.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
gotoNextLevel();
egret.Tween.removeTweens(this);
this.alpha=0;
},this);
return this;
}
}
\ No newline at end of file
import layers from "../views/layers";
import Toast2 from "../components/Toast2";
let inited = false;
let _toast: Toast2;
const initToast = () => {
if (!inited) {
inited = true;
const toast = new Toast2();
toast.loadSkin();
layers.toastLayer.addChild(toast);
toast.alpha = 0;
_toast = toast;
}
return _toast;
}
export const showToast2 = () => {
const toast = initToast().start();
egret.Tween.removeTweens(toast);
const tw = egret.Tween.get(toast);
tw.set({ y: -200, alpha: 1 }).to({ y: 400 }, 500, egret.Ease.quartOut)
.wait(3500)
.to({ alpha: 0 }, 300)
}
...@@ -904,6 +904,7 @@ export class NetManager extends ABNetManager { ...@@ -904,6 +904,7 @@ export class NetManager extends ABNetManager {
uri: window['duiba'] + '/customActivity/happyclear/exchange', uri: window['duiba'] + '/customActivity/happyclear/exchange',
type: 'post', type: 'post',
dataType: 'json', dataType: 'json',
hideMsg:true,
param: d, param: d,
callback: callback callback: callback
}; };
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"resource/skins/BagItem2Skin.exml", "resource/skins/BagItem2Skin.exml",
"resource/skins/BagItemSkin.exml", "resource/skins/BagItemSkin.exml",
"resource/skins/BagSkin.exml", "resource/skins/BagSkin.exml",
"resource/skins/BagQuitSkin.exml",
"resource/skins/Blood2Skin.exml", "resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml", "resource/skins/BloodSkin.exml",
"resource/skins/Box2Skin.exml", "resource/skins/Box2Skin.exml",
...@@ -71,6 +72,7 @@ ...@@ -71,6 +72,7 @@
"resource/skins/TaskPrizeSkin.exml", "resource/skins/TaskPrizeSkin.exml",
"resource/skins/TaskSkin.exml", "resource/skins/TaskSkin.exml",
"resource/skins/ToastSkin.exml", "resource/skins/ToastSkin.exml",
"resource/skins/Toast2Skin.exml",
"resource/skins/TurntablePanelSkin.exml", "resource/skins/TurntablePanelSkin.exml",
"resource/skins/VScrollBarSkin.exml" "resource/skins/VScrollBarSkin.exml"
], ],
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="BagQuitSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"> <e:Skin class="BagQuitSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="bag退出弹窗_png" y="211" horizontalCenter="0"/> <e:Image source="bag退出弹窗_png" y="211" horizontalCenter="0"/>
<e:Button label="" x="158" y="476"> <e:Group y="490" horizontalCenter="0">
<e:skinName> <e:Button id="quitbtn" label="" x="0" y="0">
<e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="bag退出按钮_png" source.down="bag退出按钮_png" source.disabled="bag退出按钮_png"/> <e:Image width="100%" height="100%" source="bag退出按钮_png" source.down="bag退出按钮_png" source.disabled="bag退出按钮_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/> <e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Button label="" x="473.44" y="546.5"> <e:Button id="resumebtn" label="" x="291.73" y="0">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="bag继续按钮_png" source.down="bag继续按钮_png" source.disabled="bag继续按钮_png"/> <e:Image width="100%" height="100%" source="bag继续按钮_png" source.down="bag继续按钮_png" source.disabled="bag继续按钮_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/> <e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
</e:Group>
<e:Button id="closeBtn" label="" x="611.94" y="201.92"> <e:Button id="closeBtn" label="" x="611.94" y="201.92">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing"> <e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Toast2Skin" width="750" height="122" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="168a2aff0ee"/>
<e:Image id="bg" source="toast_png" y="0" scale9Grid="131,22,48,10" width="403" height="122" horizontalCenter="0"/>
<e:Label text="购买成功" verticalAlign="middle" textAlign="center" height="61" textColor="0xffffff" size="28" lineSpacing="15" anchorOffsetX="0" y="6.08" horizontalCenter="0"/>
<e:Label id="toastLabel" text="继续闯关赢好礼" verticalAlign="middle" textAlign="center" textColor="0xFFFFFF" size="28" lineSpacing="15" anchorOffsetX="0" y="72.12" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import BagItemRenderer from "./bag/BagItemRenderer";
import BagIte2mRenderer from "./bag/BagItemRenderer2";
import { getPropNums } from "../getHomeData";
import PropType from "../PropType";
export default class BagQuitPanel extends Panel {
panel: string
start(data) {
super.start();
this.showlog();
this.panel = data;
}
showlog() {
// NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4));
}
initEvents() {
super.initEvents();
this['resumebtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onresumebtn, this)
}
onresumebtn() {
PanelCtrl.instance.show(this.panel)
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn'], this['quitbtn']] }
get skinKey() { return 'BagQuit' }
}
\ No newline at end of file
...@@ -6,9 +6,17 @@ import { getlogItem } from "../Main"; ...@@ -6,9 +6,17 @@ import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import setGlow from "../setGlow"; import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class Buy1Panel extends Panel { export default class Buy1Panel extends Panel {
buyBtn: eui.Button buyBtn: eui.Button
onTouchTap_closeBtn(){
super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','Buy1')
}
start(data) { start(data) {
super.start(); super.start();
...@@ -31,10 +39,12 @@ export default class Buy1Panel extends Panel { ...@@ -31,10 +39,12 @@ export default class Buy1Panel extends Panel {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if (success) {
this.hidePanel(); this.hidePanel();
showToast('兑换成功'); showToast2();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else {
showToast('哎呀,购买失败!\n元宝返回咯~')
} }
}, PropType.HAMMER);//兑换道具 }, PropType.HAMMER);//兑换道具
} }
......
...@@ -6,8 +6,14 @@ import { getlogItem } from "../Main"; ...@@ -6,8 +6,14 @@ import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import setGlow from "../setGlow"; import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class Buy2Panel extends Panel { export default class Buy2Panel extends Panel {
onTouchTap_closeBtn(){
super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','Buy2')
}
start(data) { start(data) {
super.start(); super.start();
...@@ -26,12 +32,14 @@ export default class Buy2Panel extends Panel { ...@@ -26,12 +32,14 @@ export default class Buy2Panel 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;
showToast('兑换成功'); showToast2();
if (success) { if (success) {
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else{
showToast('哎呀,购买失败!\n元宝返回咯~')
} }
}, PropType.BOOM);//兑换道具 }, PropType.BOOM);//兑换道具
} }
......
...@@ -6,8 +6,14 @@ import { getlogItem } from "../Main"; ...@@ -6,8 +6,14 @@ import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import setGlow from "../setGlow"; import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class Buy3Panel extends Panel { export default class Buy3Panel extends Panel {
onTouchTap_closeBtn(){
super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','Buy3')
}
start(data) { start(data) {
super.start(); super.start();
...@@ -26,13 +32,15 @@ export default class Buy3Panel extends Panel { ...@@ -26,13 +32,15 @@ export default class Buy3Panel extends Panel {
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) => {
showToast('兑换成功'); showToast2();
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if (success) {
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else{
showToast('哎呀,购买失败!\n元宝返回咯~')
} }
}, PropType.CHANCE_NUM);//兑换道具 }, PropType.CHANCE_NUM);//兑换道具
} }
......
...@@ -6,8 +6,14 @@ import { getlogItem } from "../Main"; ...@@ -6,8 +6,14 @@ import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl"; import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
import setGlow from "../setGlow"; import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
export default class ExchangePanel extends Panel { export default class ExchangePanel extends Panel {
onTouchTap_closeBtn(){
super.onTouchTap_closeBtn();
PanelCtrl.instance.show('bagquit','ExchangePanel')
}
start(data) { start(data) {
super.start(); super.start();
...@@ -26,13 +32,15 @@ export default class ExchangePanel extends Panel { ...@@ -26,13 +32,15 @@ export default class ExchangePanel extends Panel {
this.buyBtn.enabled = false; this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
showToast('兑换成功!去玩游戏~'); showToast2();
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if (success) {
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
}else{
showToast('哎呀,购买失败!\n元宝返回咯~')
} }
}, PropType.CASH_NUM);//兑换道具 }, PropType.CASH_NUM);//兑换道具
} }
......
{ {
"success":true "success":1
} }
\ 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