| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- /** 提现结果 */
- 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)
- }
- }
- }
|