
using FGUI.A000_common;
using UnityEngine;
using FairyGUI;

namespace ScrewsMaster
{
    public class LoginAUI : BaseUI
    {
        private LoginAUICtrl ctrl;
        private LoginAModel model;
        private FGUI.SLoading.com_login_a ui;

        public LoginAUI(LoginAUICtrl ctrl) : base(ctrl)
        {
            uiName = UIConst.LoginAUI;
            this.ctrl = ctrl;
        }

        protected override void SetUIInfo(UIInfo uiInfo)
        {
            uiInfo.packageName = "SLoading";
            uiInfo.assetName = "com_login_a";
            uiInfo.layerType = UILayerType.Normal;
            uiInfo.isNeedOpenAnim = false;
            uiInfo.isNeedCloseAnim = false;
            uiInfo.isNeedUIMask = true;
        }

        #region 生命周期
        protected override void OnInit()
        {
            //model = ModuleManager.Instance.GetModel(ModelConst.LoginAModel) as LoginAModel;
        }

        protected override void OnClose()
        {
        }

        protected override void OnBind()
        {
            ui = baseUI as FGUI.SLoading.com_login_a;
        }

        protected override void OnOpenBefore(object args)
        {
            InitView();
        }

        protected override void OnOpen(object args)
        {
        }

        protected override void OnHide()
        {
        }

        protected override void OnDisplay(object args)
        {
        }
        #endregion

        #region 消息
        protected override void AddListener()
        {
            AppDispatcher.Instance.AddListener(AppMsg.Show_uid, Show_uid);
        }
        protected override void RemoveListener()
        {
            AppDispatcher.Instance.RemoveListener(AppMsg.Show_uid, Show_uid);
        }
        #endregion
        void Show_uid(object a = null)
        {
            ui.text_uid.text = "uid" + GameHelper.GetLoginModel().uid;
        }
        //初始化页面逻辑
        private void InitView()
        {

        }
    }
}