// Learn TypeScript: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html import { ryw_Event } from "../../FrameWork/Event/EventEnum"; import EventMgr from "../../FrameWork/Event/EventMgr"; import User from "../../FrameWork/User/User"; import AppPlatform from "../../FrameWork/Util/AppPlatform"; import Common5 from "../../Platform/th/Common5"; import UiBase from "../GameBase/UiBase"; import TaskManager from "../JuQingChat/TaskManager"; import LevelUpManager from "../Manager/LevelUpManager"; import UserManager from "../Manager/UserManager"; const { ccclass, property } = cc._decorator; @ccclass export default class shishenSC extends UiBase { @property(cc.Label) MoneyLabel: cc.Label = null; // LIFE-CYCLE CALLBACKS: // onLoad () {} lingquMoney = 250000 start(): void { let money = LevelUpManager.getAdReardMoneySC() if (money < this.lingquMoney) { } else { this.lingquMoney = money } this.MoneyLabel.string = Common5.getNumberChangeHanzi(this.lingquMoney, '1', 0) + '' // let desc = this.node.getChildByName('labDesc').getComponent(cc.Label) // let num = LevelUpManager.canLevelNum(this.lingquMoney) // desc.string = `哇,够我提升${num}级了` this.node.getChildByName('labDesc').active = false } lingquBtnClick(event) { //Common5.playEffect("sound/按键点击") let target = event.target let tab = { onClose: (finish) => { if (finish) { User.setShowAdNum(User.getShowAdNum() + 1) Common5.ReportDY("inLevel", `任务${TaskManager.getCurUnLockMainTaskId()}-AD-食神送财领取`) // Common5.ReportDY("inLevel", "食神送财-AD-领取"); let money = this.lingquMoney UserManager.addMoney(money, target) this.closeUi() EventMgr.emitEvent_custom(ryw_Event.ChaiShenEvent, true) } else { Common5.showTips_custom("广告未观看完"); } }, onFailed: () => { } } AppPlatform.playVideo_custom(tab) } noBtnClick() { //Common5.playEffect("sound/按键点击") this.closeUi() EventMgr.emitEvent_custom(ryw_Event.ChaiShenEvent, false) } // update (dt) {} }