| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- import { AdFun } from "../../data/AdData";
- import { VideoAdType } from "../../data/GameData";
- import CheckButton from "./CheckButton";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class WalletCashOut extends cc.Component {
- @property({displayName: '公告', type: cc.Label})
- private lbl_notice: cc.Label = null;
- @property({displayName: '进度条', type: cc.Sprite})
- private sp_progress: cc.Sprite = null;
- @property({displayName: '提示', type: cc.Label})
- private lbl_tip: cc.Label = null;
- @property({displayName: '6个选择按钮', type: CheckButton})
- private check_button: CheckButton[] = [];
- private curChooseIndex: number = 0;
- start(){
- mk.ad.showNative(4);
-
- let data = [{}, {}, {}, {}, {}, {}];
- for(let i = 0; i != this.check_button.length; ++i)
- {
- if(i < data.length)
- {
- this.check_button[i].setShowUI(data[i]);
- }else
- {
- this.check_button[i].setShowUI(null);
- }
- }
- }
- private clickChooseBtn(event, customEvenData)
- {
- mk.audio.playEffect('button');
- let id = parseInt(customEvenData);
- if(id == this.curChooseIndex)
- {
- return;
- }
-
- if(this.check_button[id].getIsCanNotChoose())
- {
- return;
- }
- this.curChooseIndex = id;
- for(let i = 0; i != this.check_button.length; ++i)
- {
- if(i == this.curChooseIndex)
- {
- this.check_button[i].setIsChoose(true);
- }else
- {
- this.check_button[i].setIsChoose(false);
- }
- }
- }
- private clickCashOutBtn()
- {
- mk.audio.playEffect("button");
- //this.check_button[this.curChooseIndex].setIsCanNotChoose();
- }
- private clickAddProgressBtn()
- {
- mk.audio.playEffect("button");
- mk.ad.videoAdType = VideoAdType.CashOutNoviceWelfare;
- // 看广告
- mk.ad.watchAd((success: boolean) => {
- mk.console.log("watchAD:" + success);
- if (success) {
- gData.adData.watchVideo(AdFun.cashOutNoviceWelfare);
- mk.ad.destroyNativeAd();
- }
- });
- }
- private clickAddCashBtn()
- {
- mk.audio.playEffect("button");
- mk.ad.videoAdType = VideoAdType.CashOutNoviceWelfare;
- // 看广告
- mk.ad.watchAd((success: boolean) => {
- mk.console.log("watchAD:" + success);
- if (success) {
- gData.adData.watchVideo(AdFun.cashOutAddCash);
- mk.ad.destroyNativeAd();
- }
- });
- }
- private clickEnoughCashOutBtn()
- {
- mk.audio.playEffect("button");
- }
- private clickCloseBtn()
- {
- mk.audio.playEffect("closeButton");
- }
- }
|