public override void RefreshViewModel() { UserInfoOV.RefreshViewModel(); ProductInfoOV.RefreshViewModel(); IssueInfoOV.RefreshViewModel(); base.RefreshViewModel(); }
// 收到所监听的消息,做对应的处理 public override void HandleNotification(INotification notification) { switch (notification.Name) { case NotiConst.V_LoginResult: UnityEngine.Debug.Log("LoginMediator->HandleNotification,处理'V_LoginResult'消息"); LoginView.txtTips.text = "Login Success!"; UserInfoOV info = (UserInfoOV)notification.Body; BaseView.HideView <LoginView>(); SceneManager.Instance.LoadScene(AppConst.Game); break; default: break; } }
//请求登录 public void SendLoginMsg(UserOV data) { this.data = data; //与服务器通讯,返回消息处理玩之后,如果需要改变试图则调用下面消息 if (data.Name.Equals("tom") && data.Pwd == 123456) { Debug.Log("LoginProxy->SendLoginMsg,Model请求登录"); UserInfoOV uData = new UserInfoOV("Jack", 20); //Loom.RunAsync(() => //{ // Loom.QueueOnMainThread(() => LoginCallBack(uData), 4); //}); LoginCallBack(uData); } }
//登录返回 private void LoginCallBack(UserInfoOV data) //正规是用Json { Debug.Log("LoginProxy->LoginCallBack,Model登录回调"); Facade.SendNotification(NotiConst.V_LoginResult, data); }