大侠
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.
 
 
 

48 lines
1.7 KiB

//#region 文件引入
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText, EditBox } from "cc";
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
import UIMgr from "../../Mgr_UI/UIMgr";
import { TDAnalyticsMgr } from "../../Mgr_Ge/TDAnalyticsMgr";
import { GEData } from "../../Mgr_Ge/GeDifine";
//#endregion 文件引入
const {ccclass, property,menu} = _decorator;
@ccclass("RedemptionUI_Proxy")
export default class RedemptionUI_Proxy extends BaseUIForm{
//#region 节点自动生成
@property(Button)
btn_confirm: Button = null;
@property(Label)
lab_exchange: Label = null;
@property(EditBox)
ed_exchange:EditBox = null;
//#endregion 节点自动生成
onButtonClick(button:Button){
/**点击事件触发*/
switch (button) {
case this.btn_confirm:
this.exchangeReward()
default:
ConsoleEx.Log(button);
break;
}
}
private exchangeReward()
{
const code = this.ed_exchange.string;
console.log("兑换:", code);
if(code.length > 0){
const res = this.mDataMgr.Role.redeemCode(code);
if(res){
TDAnalyticsMgr.ins.TrySendtrack(GEData.GEeventName.get_reward, {
enter_level_id: this.mDataMgr.Scene.getRealLevel(),
reward_id: code
});
this.CloseUI();
}
}else{
UIMgr.Ins.ShowTipsUI("兑换失败,请输入兑换码");
}
}
}