/** 提现结果 */ import UsualCaidanData from "../datas/UsualCaidanData"; import AdM from "../manager/AdM"; import GameM, { AUDIO_TYPE } from "../manager/GameM"; import UiM, { PANEL_NAME } from "../manager/UiM"; import UsualCaidanNode from "./UsualCaidanNode"; const { ccclass, property } = cc._decorator; @ccclass export default class CashPro extends cc.Component { //提现成功 @property(cc.Node) loadPart: cc.Node = null; @property(cc.Animation) loadAni: cc.Animation = null; @property(cc.Node) moneyPart: cc.Node = null; @property(cc.Label) labFrom: cc.Label = null; @property(cc.Label) labRedMoney: cc.Label = null; @property(cc.Node) btnTixian: cc.Node = null; @property(cc.Node) btnAuth: cc.Node = null; @property(cc.Node) cashPro: cc.Node = null; @property(cc.Label) labMoney: cc.Label = null; //提现金额 money = 0 //点击冷却 hasTap = false //彩蛋类型 1 投放彩蛋 2 常规彩蛋 3 裂变彩蛋 fromType = 0 init(type, money) { this.fromType = type this.money = money UiM.Instance.openPanel(this.moneyPart) this.loadPart.active = false this.cashPro.active = false if (GameM.commonData.isAuth) { this.btnAuth.active = false this.btnTixian.active = true } else { this.btnAuth.active = true this.btnTixian.active = false } this.labFrom.string = `幸运彩蛋` if (this.fromType == 2) { this.labRedMoney.string = '' UsualCaidanData.Instance.getUsualEggCashMoney() } else { this.labRedMoney.string = `¥${this.money.toFixed(2)}` } // //test // this.btnAuth.active = false // this.btnTixian.active = true } showLoad() { this.loadPart.active = true this.loadAni.play('load', 0) } tixianSuccess(showPro = true, moneyNum = -1) { this.loadPart.active = false this.showCashPro(showPro, moneyNum) } showCashPro(showPro, moneyNum) { if (showPro) { console.log('showCashPro ') UiM.Instance.openPanel(this.cashPro) } if (moneyNum == -1) { this.labMoney.string = `¥${this.money.toFixed(2)}` } else { this.labMoney.string = `¥${(moneyNum * 0.01).toFixed(2)}` } } tixianFail() { console.log('tixianFail ') this.loadPart.active = false UiM.Instance.closePanelFromHome() UiM.Instance.offPanel(PANEL_NAME.CashProNode) } authBack() { this.btnAuth.active = false this.btnTixian.active = true } clickClose() { GameM.audioM.playEffect(AUDIO_TYPE.button) UiM.Instance.closePanelFromHome() this.scheduleOnce(() => { UiM.Instance.offPanel(PANEL_NAME.CashProNode) if (this.fromType == 2) { UiM.Instance.onPanel(PANEL_NAME.UsualCaidanNode, false, () => { UiM.Instance.usualCaidanNode.getComponent(UsualCaidanNode).init() }) } }, 0.5) } clickCash() { GameM.audioM.playEffect(AUDIO_TYPE.button) if (this.fromType == 2) { UsualCaidanData.Instance.usualeggCash() } } clickAuth() { GameM.audioM.playEffect(AUDIO_TYPE.button) if (!this.hasTap) { this.hasTap = true AdM.WxLogin() this.scheduleOnce(() => { this.hasTap = false }, 3) } } }