Commit b19c448b authored by wildfirecode's avatar wildfirecode

1

parent 240d6e87
...@@ -8,6 +8,7 @@ import setGlow from "../setGlow"; ...@@ -8,6 +8,7 @@ import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2"; import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import MainScene from "../mainScene/MainScene";
export default class Buy1Panel extends Panel { export default class Buy1Panel extends Panel {
buyBtn: eui.Button buyBtn: eui.Button
...@@ -39,7 +40,12 @@ export default class Buy1Panel extends Panel { ...@@ -39,7 +40,12 @@ export default class Buy1Panel extends Panel {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if (success) {
this.hidePanel(); this.hidePanel();
showToast2(); if(SceneCtrl.instance.currentScene instanceof MainScene){
showToast('兑换成功');
}else {
showToast2();
}
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
}, window['collectRuleId']); }, window['collectRuleId']);
......
...@@ -8,6 +8,7 @@ import setGlow from "../setGlow"; ...@@ -8,6 +8,7 @@ import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2"; import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import MainScene from "../mainScene/MainScene";
export default class Buy2Panel extends Panel { export default class Buy2Panel extends Panel {
onTouchTap_closeBtn(){ onTouchTap_closeBtn(){
...@@ -33,7 +34,11 @@ export default class Buy2Panel extends Panel { ...@@ -33,7 +34,11 @@ export default class Buy2Panel extends Panel {
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if (success) {
showToast2(); if(SceneCtrl.instance.currentScene instanceof MainScene){
showToast('兑换成功');
}else {
showToast2();
}
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
......
...@@ -8,6 +8,7 @@ import setGlow from "../setGlow"; ...@@ -8,6 +8,7 @@ import setGlow from "../setGlow";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2"; import { showToast2 } from "../../libs/new_wx/ctrls/toastCtrl2";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import MainScene from "../mainScene/MainScene";
export default class Buy3Panel extends Panel { export default class Buy3Panel extends Panel {
onTouchTap_closeBtn(){ onTouchTap_closeBtn(){
...@@ -34,7 +35,11 @@ export default class Buy3Panel extends Panel { ...@@ -34,7 +35,11 @@ export default class Buy3Panel extends Panel {
NetManager.ins.hc_exchange((success) => { NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true; this.buyBtn.enabled = true;
if (success) { if (success) {
showToast2(); if(SceneCtrl.instance.currentScene instanceof MainScene){
showToast('兑换成功');
}else {
showToast2();
}
this.hidePanel(); this.hidePanel();
NetManager.ins.hc_home(() => { NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene(); SceneCtrl.instance.updateScene();
......
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