/** * @description 福袋数据 * @author kaka */ import { Data } from "../../../mk/data/Data"; export class BlessingBagData extends Data { _videoRbData: any = null; isPlayAniUpdate = false; init_videoRbData = false; get videoRbData() { return this._videoRbData; } set videoRbData(data) { this._videoRbData = data; this.init_videoRbData = true; } rbType = 0; rbNum = 0; init_openRb = false; bigRbNum: number = 0; taskRbId: number = 0; taskRbNum: number = 0; adsource_id_value = ""; init() { this.isPlayAniUpdate = false; this.videoRbData = gData.gameData.gameData.userTuCaoInfo; console.log("---------------->", this.videoRbData); } setAdData(data) { super.setAdData(data); this.UpdateVideoProgress(data); } /** * 打开任务红包页面 * @param taskRbNum 红包金额 * @param redMoneyId 任务红包id * @param type 打开红包类型 1 大额红包 2 任务红包 * @param num 红包金额 */ OpenTaskRbPanel(taskRbNum: number, redMoneyId: number, type: number, num: number) { this.taskRbId = redMoneyId; this.taskRbNum = taskRbNum; this.rbType = type; this.rbNum = num; this.init_openRb = true; } /**更新视频进度*/ async UpdateVideoProgress(data: any) { await mk.time.WaitForSeconds(0.5); this.isPlayAniUpdate = true; this.videoRbData = data.data; } /** * 免费加进度 * @param cb 提现回调 */ async HttpNoAdProgress() { let data = {}; let response = await mk.http.sendData('tuCaoRedMoney/noNeedVideo', data); if (response.errcode != 0) { return; } this.isPlayAniUpdate = true; this.videoRbData = response.data.UserRedMoneyInfo; } /** * 大额红包提现 * @param cb 提现回调 */ async HttpCashBig() { let data = {}; let response = await mk.http.sendData('redMoneyVideoCash', data); mk.console.logSingle('redMoneyVideoCash ', response); if (response.errcode != 0) { if (response.data.count) { gData.tipPanelData.openCashFailTip(response.data.count); } else { mk.tip.pop('提现排队中,多看视频优先提现'); } gData.cashPro.init_fail = true; return null; } this.isPlayAniUpdate = false; this.videoRbData = response.data.UserRedMoneyInfo; return response; } /** * 任务红包提现 * @param cb 提现回调 */ async HttpCashTask() { let data = { redMoneyId: this.taskRbId }; let response = await mk.http.sendData('tuCaoRedMoney/gearCash', data); mk.console.logSingle('gearCash ', response); if (response.errcode != 0) { if (response.data.count) { gData.tipPanelData.openCashFailTip(response.data.count); } else { mk.tip.pop('提现排队中,多看视频优先提现'); } gData.cashPro.init_fail = true; return null; } this.isPlayAniUpdate = false; this.videoRbData = response.data.UserRedMoneyInfo; const rewardNum = Math.round(gData.blessingBag.taskRbNum * 100); gData.receiptNotice.receip_rmb = rewardNum; gData.cashNormal.receip_total_rmb += gData.receiptNotice.receip_rmb; mk.ui.openPanel('module/receiptNotice/receiptNotice'); // if (response.data.code == 1) { // AdM.onSendEvent('VideoCash_' + this.taskRbId, '视频红包第' + this.taskRbId + '档领取成功', 'VideoCash'); // } return response } /**清空数据*/ async HttpInitAdRbData() { let data = {}; let response = await mk.http.sendData('tuCaoRedMoney/initUserInfo', data); if (response.errcode != 0) { return; } this.isPlayAniUpdate = false; this.videoRbData = response.data.UserRedMoneyInfo; // if (response.data.code == 1) { // AdM.onSendEvent('VideoCashBig_' + response.data.UserRedMoneyInfo.preLargeAmountCashId, ' 视频红包大额提现第' + response.data.UserRedMoneyInfo.preLargeAmountCashId + '档领取成功', 'VideoCashBig'); // } } /** * 红点功能 */ public redPoint(): boolean { return false; } } /* 1.RedPackageNode jinrititle mingrititle null let targetPos: cc.Vec2 = this.target.getPosition(); let bulletPos: cc.Vec2 = this.node.getPosition(); let normalizeVec: cc.Vec2 = targetPos.subtract(bulletPos).normalize(); //角度变化以y轴正方向为起点,逆时针角度递增 this.node.angle = cc.v2(0, 1).signAngle(normalizeVec) * 180 / Math.PI; */