| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import { Data } from "../../../mk/data/Data";
- import JsbSystem from "../../../mk/system/JsbSystem";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class NewCashUI extends cc.Component {
- @property({ displayName: '兑换码', type: cc.Label })
- private lbl_redeem_code: cc.Label = null;
- @property(cc.Prefab)
- private videoPre: cc.Prefab = null;
- private coolTime = false;
- private videoNode = null
- onLoad(){
- }
- start(){
- this.coolTime = false;
- this.lbl_redeem_code.string = "";
- }
- private clickVideoBtn(){
- mk.audio.playEffect('button');
- if(this.coolTime)
- return;
- this.coolTime = true;
- this.videoNode = cc.instantiate(this.videoPre)
- this.videoNode.getChildByName('video').on("completed", this.onCompleted, this)
- this.node.addChild(this.videoNode)
- }
- private onCompleted(){
- this.videoNode.getChildByName('video').off("completed", this.onCompleted, this)
- this.videoNode.destroy()
- mk.audio.setResumeMusic();
- this.coolTime = false
- }
- private clickCopyBtn() {
- mk.audio.playEffect('button');
- JsbSystem.setClipboard(this.lbl_redeem_code.string)
- mk.tip.pop("复制成功");
- }
- private clickCloseBtn(){
- mk.audio.playEffect('button');
- mk.audio.setResumeMusic();
- // gData.gameData.init_redBagTask = true;
- // gData.gameData.init_productTask = true;
- }
- onDestroy(){
- }
-
- }
|