Commit ef861fa8 authored by wildfirecode's avatar wildfirecode

1

parent a009714c
import { Data } from "../tw/data/Data";
import { NetName } from "../tw/enum/NetName";
import showAlertPanel from "./ctrls/showAlertPanel";
import { showToast } from "./ctrls/toastCtrl";
export default (data?: Data, netname?: NetName) => {
if (!data) {
return showAlertPanel('网络异常\n请隔一段时间再尝试');
return showToast('网络异常\n请隔一段时间再尝试');
}
if (data.code == 'E999999999')//系统级别错误 系统异常,\n请刷新后重试。
showAlertPanel('网络异常\n请隔一段时间再尝试');
showToast('网络异常\n请隔一段时间再尝试');
else if (data.code == 'C600004')
showToast('元宝不足哦,快去玩游戏赢元宝吧');
else if (data.code == 'E100201001')
showAlertPanel('请登录后重试。')
showToast('请登录后重试。')
else if (data.code == 'E100201007') {
showAlertPanel(`对不起\n您的${CFG.unitName}不足`);
showToast(`对不起\n您的${CFG.unitName}不足`);
}
else if (data.code == 'E100202007' || data.code == 'E100202008' || data.code == 'E100202009' || data.code == 'E100202010')
showAlertPanel('对不起\n您的次数不足。')
showToast('对不起\n您的次数不足。')
else//其他异常
showAlertPanel('网络异常\n请隔一段时间再尝试')
showToast('网络异常\n请隔一段时间再尝试')
}
// export default (data: Data) => {
// if (data.code == 'E999999999')
......
......@@ -38,10 +38,12 @@ export default class BloodPanel extends Panel {
NetManager.ins.hc_exchange((success) => {
this['buyBtn'].enabled = true;
if (success) {
showToast('购买成功');
NetManager.ins.hc_home(() => {
this.updateData();
SceneCtrl.instance.updateScene();
}, window['collectRuleId'])
}, window['collectRuleId']);
}
}, 1);
}
......
......@@ -3,6 +3,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import PropType from "../PropType";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
export default class Buy1Panel extends Panel {
buyBtn: eui.Button
......@@ -24,6 +25,7 @@ export default class Buy1Panel extends Panel {
this.buyBtn.enabled = true;
if (success) {
this.hidePanel();
showToast('购买成功');
NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
......
......@@ -3,6 +3,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import PropType from "../PropType";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
export default class Buy2Panel extends Panel {
start(data) {
......@@ -20,6 +21,7 @@ export default class Buy2Panel extends Panel {
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
this.buyBtn.enabled = true;
showToast('购买成功');
if (success) {
this.hidePanel();
NetManager.ins.hc_home(() => {
......
......@@ -3,6 +3,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import PropType from "../PropType";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { getlogItem } from "../Main";
import { showToast } from "../../libs/new_wx/ctrls/toastCtrl";
export default class Buy3Panel extends Panel {
start(data) {
......@@ -20,6 +21,7 @@ export default class Buy3Panel extends Panel {
NetManager.ins.clickLog(getlogItem(14));
this.buyBtn.enabled = false;
NetManager.ins.hc_exchange((success) => {
showToast('购买成功');
this.buyBtn.enabled = true;
if (success) {
this.hidePanel();
......
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