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.
72 lines
3.5 KiB
72 lines
3.5 KiB
//#region 文件引入
|
|
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText } from "cc";
|
|
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
|
|
import { Global } from "../../Global";
|
|
import { EVideoType, PropType, TXVideoMapping } from "../../const/GameEnum";
|
|
import UIMgr from "../../Mgr_UI/UIMgr";
|
|
import GDUtils from "../../ExCUtils/GDUtils";
|
|
import PlatformManager from "../../Platform/PlatformManager";
|
|
import { TXSDKMgr } from "../../Mgr_Ge/TXSDKMgr";
|
|
import { AD_DOUBLE_TYPE, GAME_PARAMS } from "../../const/GGameData";
|
|
import { EUIForms } from "../../const/UIFormCnf";
|
|
//#endregion 文件引入
|
|
const {ccclass, property,menu} = _decorator;
|
|
@ccclass("LookAdGetTJUI_Proxy")
|
|
export default class LookAdGetTJUI_Proxy extends BaseUIForm{
|
|
//#region 节点自动生成
|
|
@property(Node)
|
|
n_desc: Node = null;
|
|
@property(Node)
|
|
n_fgx: Node = null;
|
|
@property(Label)
|
|
lab_num: Label = null;
|
|
@property(Node)
|
|
n_dropdesc: Node = null;
|
|
@property(Label)
|
|
lab_lefttimes: Label = null;
|
|
@property(Button)
|
|
btn_Ad: Button = null;
|
|
//#endregion 节点自动生成
|
|
|
|
onButtonClick(button:Button){
|
|
|
|
/**点击事件触发*/
|
|
switch (button) {
|
|
case this.btn_Ad:
|
|
Global.showvideo({name: EVideoType.AddTjCoin, gamelv: this.mDataMgr.Scene.getRealLevel()},()=>{
|
|
let tjnum = GAME_PARAMS.AD_TJCOIN_NUM;
|
|
if(PlatformManager.instance.platData.ABTest.ad_drop_tj){
|
|
tjnum = PlatformManager.instance.platData.ABTest.ad_drop_tj.v;
|
|
}
|
|
const ab_double = PlatformManager.instance.platData.ABTest.ad_double;
|
|
if(ab_double && (ab_double.v == 1 || ab_double.v == 3)){
|
|
UIMgr.Ins.ShowUI(EUIForms.LookAdGetDouleUI,{param:{type:AD_DOUBLE_TYPE.AD_ADD_TJCOIN, coin:tjnum, callback: this.param.okcallback}});
|
|
}else{
|
|
this.mDataMgr.Token.addToken(PropType.eTaiJi, tjnum);
|
|
UIMgr.Ins.ShowTipsUI(`${GDUtils.getTokenName(PropType.eTaiJi)} +${tjnum}`);
|
|
this.param.okcallback && this.param.okcallback();
|
|
}
|
|
this.CloseUI();
|
|
});
|
|
break;
|
|
default:
|
|
ConsoleEx.Log(button);
|
|
break;
|
|
}
|
|
}
|
|
|
|
protected start(): void {
|
|
if(this.param.isMain){
|
|
CNodeUtils.setActive(this.n_desc, false);
|
|
CNodeUtils.setActive(this.n_fgx, false);
|
|
}else{
|
|
CNodeUtils.setActive(this.n_desc, true);
|
|
CNodeUtils.setActive(this.n_fgx, true);
|
|
}
|
|
const drop = (PlatformManager.instance.platData.ABTest.crit_drop_tj && PlatformManager.instance.platData.ABTest.crit_drop_tj.v > 0)?1 : Global.CsvMgr.getDropTJRate();
|
|
CNodeUtils.setActive(this.n_dropdesc, drop > 0);
|
|
const num = (PlatformManager.instance.platData.ABTest.ad_drop_tj && PlatformManager.instance.platData.ABTest.ad_drop_tj.v > 0)?PlatformManager.instance.platData.ABTest.ad_drop_tj.v:GAME_PARAMS.AD_TJCOIN_NUM;
|
|
CNodeUtils.switchText(this.lab_num,`+${num}`);
|
|
TXSDKMgr.ins.AD_UI_SHOW(TXVideoMapping[EVideoType.AddTjCoin]);
|
|
}
|
|
}
|