Example #1
0
    public void SendReceiveEmail()
    {
        WWWForm form = new WWWForm();

        form.AddField("appId", GlobalData.mAppId);
        form.AddField("pid", PlayerInfo.Instance.mPlayerPid.ToString());
        //   form.AddField("pid", "1430");
        form.AddField("id", emailData.emailId);
        form.AddField("time", TimeUtils.ConvertToTime(DateTime.Now).ToString()); //当前时间戳
        form.AddField("sig", "tobeadded");
        string url = GlobalData.mConstBaseServerUrl + MsgContainer.ServerUrlTitle.Url_ReceiveEmail;

        StartCoroutine(GlobalData.SendPost(url, form, delegate(WWW www)
        {
            Debug.Log("邮件领取结果:" + www.text);
            if (www.text == "success")
            {
                PlayerInfo.Instance.AddRoomCard(int.Parse(mEmailData.rcNum  = mEmailData.rcNum ?? "0"));
                PlayerInfo.Instance.UpdateGold(int.Parse(mEmailData.goldNum = mEmailData.goldNum ?? "0"));

                ArgsReceiveEmail args = new ArgsReceiveEmail();
                args.emailId          = mEmailData.emailId;
                EmailManager.Instance.PlayTween(ref emailData, this.transform.parent.parent.parent);
                HadGet();//整体item的显示的变化
                //领取成功
                NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGetEmailSuccess, args);
            }
            else
            {
                UIManagers.Instance.EnqueueTip("领取失败");
            }
        }));
    }
Example #2
0
    //测试用
    public void Test()
    {
        ArgsReceiveEmail args = new ArgsReceiveEmail();

        args.emailId = mEmailData.emailId;
        EmailManager.Instance.PlayTween(ref emailData, transform.parent.parent.parent.parent);
        HadGet();//整体item的显示的变化
        //领取成功
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGetEmailSuccess, args);
    }