using FGUI.tixian; using IgnoreOPS; namespace RedHotRoast { public class RedeemCodeUI : BaseUI { private RedeemCodeUICtrl ctrl; private RedeemCodeModel model; private com_redeem_code ui; public RedeemCodeUI(RedeemCodeUICtrl ctrl) : base(ctrl) { uiName = UIConst.RedeemCodeUI; this.ctrl = ctrl; } protected override void SetUIInfo(UIInfo uiInfo) { uiInfo.packageName = "tixian"; uiInfo.assetName = "com_redeem_code"; uiInfo.layerType = UILayerType.Popup; uiInfo.isNeedOpenAnim = true; uiInfo.isNeedCloseAnim = true; uiInfo.isNeedUIMask = true; } #region 生命周期 protected override void OnInit() { } protected override void OnClose() { GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true); } protected override void OnBind() { ui = baseUI as com_redeem_code; } protected override void OnOpenBefore(object args) { GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false); InitView(); } protected override void OnOpen(object args) { } #endregion private void InitView() { ui.lab_mn2.text = GameHelper.Get101Str(0); ui.lab_ticket.text = GameHelper.GetPriceInt(DataMgr.PettyAmount.Value); var strings = ConfigSystem.GetCommonConf().X_Redeemcode; ui.lab_code.text = strings; ui.text_rate.text = GameHelper.GetExchangeRateVo().Payicon + " 1"; ui.btn_copy.SetClick(() => { GameHelper.CopyText(ui.lab_code.text); }); ui.btn_contact_us.SetClick(() => { SDKOpenConfig openConfig = new SDKOpenConfig { normal = false, url = ConfigSystem.GetCommonConf().X_ShopURL }; CtrlDispatcher.Instance.Dispatch(CtrlMsg.open_wb, openConfig); CtrlCloseUI(); }); ui.btn_close1.SetClick(CtrlCloseUI); } #region 消息 protected override void AddListener() { } protected override void RemoveListener() { } #endregion } }