觉醒时刻
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

60 lines
1.9 KiB

import AppPlatform from "../../../FrameWork/Util/AppPlatform";
import Common5 from "../../../Platform/th/Common5";
import { GamePropManage } from "./GameDataManage2";
const { ccclass, property } = cc._decorator;
@ccclass
export default class BuyPropNode2 extends cc.Component {
@property(cc.Node)
propIcon: cc.Node = null;
@property(cc.Node)
tittle: cc.Node = null;
@property(cc.Node)
desc: cc.Node = null;
@property([cc.SpriteFrame])
tittleSpFrameTab: cc.SpriteFrame[] = [];
@property([cc.SpriteFrame])
daoJuSpFrameTab: cc.SpriteFrame[] = [];
config = null
callFunc = null
start() {
}
initView(id, callFunc) {
this.config = GamePropManage.getDaoJuConfigById(id)
this.desc.getComponent(cc.Label).string = this.config.desc
// this.tittle.getComponent(cc.Label).string = this.config.daoJuName
this.callFunc = callFunc
this.propIcon.getComponent(cc.Sprite).spriteFrame = this.daoJuSpFrameTab[id]
this.tittle.getComponent(cc.Sprite).spriteFrame = this.tittleSpFrameTab[id]
}
onBtnClose() {
Common5.playEffectCustom("cainiaoxiaoxiao", "sound/UI按钮")
this.node.removeFromParent()
this.node.destroy()
}
onBtnADClick() {
Common5.playEffectCustom("cainiaoxiaoxiao", "sound/UI按钮")
let tab = {
onClose: (finish) => {
if (finish) {
Common5.ReportDY("inLevel", "冰川企鹅-AD-道具解锁" + this.config.daoJuName);
this.callFunc && this.callFunc()
this.node.removeFromParent()
this.node.destroy()
}
else {
Common5.showTips_custom("广告未观看完");
}
}, onFailed: () => {
}
}
AppPlatform.playVideo_custom(tab)
}
}