| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import Util from "../../../before/util/Util";
- import JsbSystem from "../../../mk/system/JsbSystem";
- import { AdFun } from "../../data/AdData";
- import { VideoAdType } from "../../data/GameData";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class ProductReward2 extends cc.Component {
- @property({ displayName: '数字组', type: cc.Label })
- private lbl_value: cc.Label[] = [];
- start() {
- //this.showChangePart();
- }
- // update() {
- // if (gData.harvestData.init_reward) {
- // gData.harvestData.init_reward = false;
- // //奖励弹窗
- // gData.reward.adData = gData.harvestData.adData;
- // mk.ui.openPanel('module/reward/reward');
- // }
- // }
- showChangePart() {
- //this.changePart.active = true
- let len = this.lbl_value.length;
- this.schedule(() => {
- for (var i = 0; i < len; i++) {
- let ran = Util.rnd(0, 9);
- this.lbl_value[i].string = `${ran}`;
- }
- }, 0.1)
- }
- private async clickVideoBtn() {
- mk.audio.playEffect("button");
- // 看广告
- mk.ad.videoAdType = VideoAdType.video_init_18;
- mk.ad.watchAd(async (success: boolean) => {
- mk.console.log("watchAD:" + success);
- if (success) {
- await gData.adData.watchVideo(AdFun.harvest);
- mk.ui.closePanel(this.node.name);
- }
- });
- }
- private clickCloseBtn() {
- mk.audio.playEffect("button");
- }
- private clickExitBtn() {
- JsbSystem.systemExit();
- }
- }
|