Exemple #1
0
    void OnIOSWeChatPayReslut(string argement)
    {
        //        SystemMsgView.SystemFunction(Function.Tip, argement);
        switch (argement)
        {
        case "0":

            PaySucc();

//                else if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
//                {
//                    OnCommitPay();
//                }

            SystemMsgView.SystemFunction(Function.Tip, Info.WXPaySucc);

            break;

        case "-1":
            SystemMsgView.SystemFunction(Function.Tip, Info.WXPayCancel);
            GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnWXPayfaid);

            break;

        case "-2":
            SystemMsgView.SystemFunction(Function.Tip, Info.WXPayCancel);

            break;

        default:

            break;
        }
        GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnPayEnded);
    }
Exemple #2
0
    /// <summary>
    /// 支付宝ios回调
    /// </summary>
    /// <param name="strResult"></param>
    void OnIOSAlipayReslut(string strResult)
    {
        //        SystemMsgView.SystemFunction(Function.Tip, strResult);

        if (strResult.Equals("9000"))
        {
            PaySucc();

            result = ENUM_AVATAR_RESULT.eResult_Success;
//            if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Login)
//            {
//                OnloginPayed();
//            }
//            else if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
//            {
//                OnCommitPay();
//            }
        }
        else
        {
            result = ENUM_AVATAR_RESULT.eResult_Failed;
            SystemMsgView.SystemFunction(Function.Tip, Info.WXPayCancel);

            GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnAliPayfaid);

            // 取消
        }
        GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnPayEnded);
    }
Exemple #3
0
    //-------------------------------------------------------------------------

    /// <summary>
    /// 微信支付0为成功,-1错误,-2取消
    /// </summary>
    /// <param name="errCode"></param>
    void OnWXPayCallback(string strResult)
    {
        //        SystemMsgView.SystemFunction(Function.Tip, strResult);

        switch (strResult)
        {
        case "0":
            PaySucc();

//                else if(PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
//                {
//                    OnCommitPay();
//                }

            break;

        case "-1":

            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", ENUM_AVATAR_RESULT.eResult_Cancel.ToString(), "支付失败"));
            GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnWXPayfaid);
            SystemMsgView.SystemFunction(Function.Tip, Info.WXPayCancel);

            break;

        case "-2":
            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "支付失败", "test1"));
            break;
        }
        GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnPayEnded);
    }
Exemple #4
0
 //点击添加好友
 private void OnClickAddFriend()
 {
     FriendsInfoController.Instance.AddFriend(LoginModel.Instance.Uid, playerID);
     ViewMgr.Instance.Open(ViewNames.SystemMsgView);
     SystemMsgView.SystemFunction(Function.Tip, "添加成功,等待对方接受", 2);
     //FriendsInfoController.Instance.currentPage = 1;
     //FriendsInfoController.Instance.RankListReq(LoginModel.Instance.Uid, 1);
 }
Exemple #5
0
    private void OnCommitPay()
    {
        ViewMgr.Instance.Close(ViewNames.PayChooseView);

        SystemMsgView.SystemFunction(Function.CloseDialog, Info.Exchange);
        ViewMgr.Instance.Close(ViewNames.StoreView);
        ViewMgr.Instance.Close(ViewNames.CommitView);
        GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnCommitSucc);
    }
Exemple #6
0
    private void OnloginPayed()
    {
        ViewMgr.Instance.Close(ViewNames.PayChooseView);
        SystemMsgView.SystemFunction(Function.CloseDialog, Info.Logined);

        PlayerSave.SetString("isFirstPay", "pay");

        GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnFirstPaySucc);
//        MTRunner.Instance.StartRunner(Wait(0.3f));
    }
Exemple #7
0
    private void CheckOrderCallBack(MsgRec msg)
    {
        if (msg._proto != null)
        {
            var proto = (Farm_Game_CheckOrder_Anw)msg._proto;
            OrderController.Instance.SetDatas(proto);

            GetDispatcher().Dispatch(CommitControllerEvent.OnOrderCallback);
        }
        else
        {
            SystemMsgView.SystemFunction(Function.Tip, Info.NoOrder);
        }
    }
Exemple #8
0
        private IEnumerator Wait()
        {
            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "waitfordisconnect", "test1"));

            //            if ( HeartBeatController.Instance.errorInfo == ErrorInfo.isLogined)
            //            {
            //                yield return "error";
            //
            //            }

            float time = 0;

            while (true)
            {
                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "检测是否断线", "test1"));

                yield return(0.5f);

                time++;
                //返回登录界面的时候就不显示重新登录界面
                if (_isneed2loginview)
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.DisconectedInfo);
                }
                Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "connecting", "test1"));

                if (SocketMgr.Instance.Status == status.Disconnect)
                {
                    LoginController.Instance.Connect2Sever();


                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", "send", "test1"));
                }

                //连接完成后就发送连接
                if (SocketMgr.Instance.Status == status.Connected)
                {
                    if (_isneed2loginview)
                    {
                        LoginController.Instance.ReqLogin(LoginModel.Instance.Uid, LoginModel.Instance.Token, (int)Application.platform);
                        SystemMsgView.SystemFunction(Function.Tip, Info.ConnectSuccess, 3);
                    }
                    isconnecting = false;

                    yield break;
                }
            }
        }
Exemple #9
0
    /// <summary>
    /// 支付宝回调
    /// </summary>
    void OnAlipayCallBack(string strResult)
    {
        //        SystemMsgView.SystemFunction(Function.Tip, strResult);

        if (strResult.Equals(ENUM_AVATAR_RESULT.eResult_Success.ToString()))
        {
            result = ENUM_AVATAR_RESULT.eResult_Success;
            PaySucc();

            //            if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Login)
            //            {
            //                OnloginPayed();
            //
            //            }
            //            else if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
            //            {
            //                OnCommitPay();
            //            }

            GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnCommitSucc);
        }
        else if (strResult.Equals(ENUM_AVATAR_RESULT.eResult_Cancel.ToString()))
        {
            result = ENUM_AVATAR_RESULT.eResult_Cancel;

            GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnAliPayfaid);
            SystemMsgView.SystemFunction(Function.Tip, Info.WXPayCancel);

            // 取消
        }
        else if (strResult.Equals(ENUM_AVATAR_RESULT.eResult_Failed.ToString()))
        {
            result = ENUM_AVATAR_RESULT.eResult_Failed;

            // 失败
        }
        GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnPayEnded);
    }
Exemple #10
0
    //3-30 支付成功服务器通知前端
    public void PaySuccCallBack(MsgRec msg)
    {
        var p = (Farm_Game_PaySucc_Anw)msg._proto;

        OrderController.Instance.SetData(p);
        if (p.Type == 1)
        {
//            MTRunner.Instance.StartRunner(Waitclose(0.3f));
            OnloginPayed();
            GlobalDispatcher.Instance.Dispatch(GlobalEvent.OnFirstPaySucc);

            SystemMsgView.SystemFunction(Function.Tip, Info.WXPaySucc);
        }
        else if (p.Type == 2)
        {
//            MTRunner.Instance.StartRunner(Waitclose(0.3f));
            OnCommitPay();
            if (ViewMgr.Instance.isOpen(ViewNames.MsgListView))
            {
                GetDispatcher().Dispatch(CommitControllerEvent.OnOrderCallback);
            }
            SystemMsgView.SystemFunction(Function.Tip, Info.Exchange);
        }
    }
Exemple #11
0
    IEnumerator Wait(float time)
    {
        yield return(time);

        SystemMsgView.SystemFunction(Function.GetDialog, gets);
    }