Ejemplo n.º 1
0
 protected override void OnInit(QFramework.IUIData uiData)
 {
     mData = uiData as FamilySettingPanelData ?? new FamilySettingPanelData();
     // please add init code here
     StartRequestForFindMemberInfo();
     BtnConfirm.onClick.AddListener(() =>
     {
         AudioManager.PlaySound("Button_Audio");
         Log.I("mFamilyId: " + mFamilyModel.id);
         if (mFamilyModel.IsNull())
         {
             CommonUtil.toast("请选择成员");
         }
         else
         {
             if (mData.type == 0)
             {
                 UIMgr.OpenPanel <TipPanel>(new TipPanelData()
                 {
                     action  = TipAction.FamilySubtract,
                     message = "确定移除该家长?"
                 });
             }
             else
             {
                 UIMgr.OpenPanel <TipPanel>(new TipPanelData()
                 {
                     action  = TipAction.FamilyTransfer,
                     message = "确定将管理员转让给所选对象?"
                 });
             }
         }
     });
     BtnCancel.onClick.AddListener(() =>
     {
         AudioManager.PlaySound("Button_Audio");
         Back();
     });
     SimpleEventSystem.GetEvent <TipConfirmClick>()
     .Subscribe(_ =>
     {
         if (_.GetAction == TipAction.FamilySubtract)
         {
             StartRequestForDoRejectMember();
         }
     }).AddTo(this);
     SimpleEventSystem.GetEvent <TipConfirmClick>()
     .Subscribe(_ =>
     {
         if (_.GetAction == TipAction.FamilyTransfer)
         {
             StartRequestForDoTransferManager();
         }
     }).AddTo(this);
 }