/** * Author:shaoyang * Date:2023/03/22 * Desc:恭喜获得通用弹框 */ import GameReport from "../../FrameWork/Report/ZyZyReport"; import AppPlatform from "../../FrameWork/Util/AppPlatform"; import Common5 from "../../Platform/th/Common5"; import BagManager, { GoodsProperty, GoodsLocalProperty } from "../Manager/BagManager"; import UserManager from "../Manager/UserManager"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage"; import ZhaoHuanTai from "../ZhaoHuanTai/ZhaoHuanTai"; const {ccclass, property} = cc._decorator; export enum GetAward_BtnStatus{ ChuShou, BeiBao, BuYao, LingQu } @ccclass export default class GetAward extends cc.Component { @property(cc.Node) lingquNode: cc.Node = null; @property(cc.Node) iconNode: cc.Node = null; @property(cc.Node) content1: cc.Node = null; @property(cc.Label) priceNum: cc.Label = null; @property(cc.Node) layOutBtn1: cc.Node = null; btnClickCallFunc = null curUiCfg:GoodsProperty = null; goodIdData = null allGoodsPrice = 0 curentContent:cc.Node = null goodIDArray = []; goodIds = null isHavePro = false start () { this.curentContent = this.content1 Common5.playRemoteAudioEffect("remotesound/effect/游戏点击音效") } initView(goodIds, callFunc?){ this.btnClickCallFunc = callFunc this.goodIdData = goodIds //console.log(goodIds, 'this.allGoodsPrice++++') this.goodIds = goodIds for(let i = 0; i= 1701 && data.goodId <= 1750) || (data.goodId >= 3700 && data.goodId <= 3739)){ this.isHavePro = true } } this.showGoodsInfos(this.goodIds) this.priceNum.string = '物品价值:'+ Common5.getNumberChangeHanzi(this.allGoodsPrice) if(this.isHavePro){ this.node.getChildByName('layBtnNode').getChildByName('lingqu').active = true this.node.getChildByName('layBtnNode').getChildByName('maichu').active = false }else{ this.node.getChildByName('layBtnNode').getChildByName('lingqu').active = false this.node.getChildByName('layBtnNode').getChildByName('maichu').active = true } this.node.scale = 0.1 cc.tween(this.node) .to(1.0, {scale:1},{easing:'elasticOut'}) .start() } refreshIconNode(node, goodsId, goodsNum){ let iconSpr = node.getChildByName('spr') let goodsNumNode = node.getChildByName('goodsNum') goodsNumNode.getComponent(cc.Label).string = goodsNum+'' //Common5.getSpriteFrameFromBundle("CommonRes","GoodIcon/texture/icon/"+ goodsId, iconSpr.getComponent(cc.Sprite)); Common5.addUrlSprite_custom("GoodIcon/texture/icon/"+ goodsId, iconSpr.getComponent(cc.Sprite)) let goodsName = node.getChildByName('goodsName').getComponent(cc.Label) let goodData = BagManager.getGoodsProperty(goodsId) goodsName.string = goodData.goodName } showGoodsInfos(goodIds){ this.goodIDArray = goodIds for(let i = 0; i{ GameReport.BtnsReport('直接领取') }) let goodIds = this.goodIds for(let i = 0; i{ // node.getComponent(ZhaoHuanTai).init(data.goodId) // }) // } } } PrefabManage.showTextTips('物品已放入背包') this.onCloseAward() } onCloseAward(){ this.btnClickCallFunc && this.btnClickCallFunc() this.node.removeFromParent() this.node.destroy() } fenxiangClickEvent(){ //Common5.playEffect("sound/按键点击") } getRewardClickEvent(event){ let target = event.target //Common5.playEffect("sound/按键点击") UserManager.addMoney(this.allGoodsPrice,target) this.onCloseAward() } getDoubleRewardClickEvent(event){ let target = event.target UserManager.addMoney(this.allGoodsPrice,target) this.onCloseAward() // let target = event.target // //Common5.playEffect("sound/按键点击") // let tab = { // onClose: (finish)=>{ // if (finish) { // Common5.ReportDY("inLevel", "物品奖励-AD-双倍领取"); // this.reportKey(()=>{ // GameReport.ADReport('双倍领取',1) // }) // let goodIds = this.goodIds // for(let i = 0; i{ // GameReport.ADReport('双倍领取',0) // }) // Common5.showTips_custom("广告未观看完"); // } // },onFailed:()=>{ // } // } // AppPlatform.playVideo_custom(tab) } specialSave(){ let goodIDArray = this.goodIDArray // for(let i = 0; i=0){ // UserManager.setShengXiaoList(data.goodId) // }else if(jinzhuanIndex>=0){ // UserManager.addGoldNum(goodsNum) // }else if(zhongziIndex>=0){ // //UserManager.addGoldNum(goodsNum) // InterfaceManager.setXuyuanDataStateZhongzi() // } // } } protected reportKey(sendCall:Function){ GameReport.SetCurGame('恭喜获得'); sendCall() } }