void getNewMail(Variant data)
        {
            if (!isApplied)
            {
                return;
            }
            //if (data["mail"]["tp"]==4)
            //{
            //    if (data["mail"]["frmpinfo"]["cid"] == PlayerModel.getInstance().cid)
            //        return;
            //}
            debug.Log("获取新邮件");
            debug.Log(data.dump());
            Variant typeData = new Variant();

            typeData["tp"] = data["mail"]["tp"];
            if (typeData["tp"] == 4)
            {
                typeData["secondType"] = data["mail"]["frmpinfo"]["cid"];
            }
            dispatchEvent(GameEvent.Create(lis_unreadType, this, typeData));


            mailData dta = new mailData();

            dta.type    = data["mail"]["tp"];
            dta.id      = data["mail"]["id"];
            dta.time    = getTime(data["mail"]["tm"]);
            dta.seconds = data["mail"]["tm"]._int32;
            dta.msg     = KeyWord.filter(data["mail"]["msg"]);
            if (data["mail"]["frmpinfo"].ContainsKey("cid"))
            {
                dta.frmcid = data["mail"]["frmpinfo"]["cid"];
            }
            if (data["mail"]["frmpinfo"].ContainsKey("name"))
            {
                dta.frmname = data["mail"]["frmpinfo"]["name"];
                if (dta.type == 3 && dta.frmcid == PlayerModel.getInstance().cid)
                {
                    dispatchEvent(GameEvent.Create(lis_sendMail_res, this, typeData));
                }
            }
            if (data["mail"]["frmpinfo"].ContainsKey("sex"))
            {
                dta.frmsex = data["mail"]["frmpinfo"]["sex"];
            }
            if (data["mail"]["frmpinfo"].ContainsKey("clanc"))
            {
                dta.clanc = data["mail"]["frmpinfo"]["clanc"];
            }
            loadMailItems(data["mail"], dta);
            switch (dta.type)
            {
            case 1:

                E_mailModel.getInstance().systemMailDic.Add(dta);
                if (!isNotice)
                {
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_Mail);
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_MAIN);
                    isNotice = true;
                }
                break;

            case 2:
                bool isContain2 = false;
                foreach (int type in newType)
                {
                    if (type == 2)
                    {
                        isContain2 = true;
                        break;
                    }
                }
                if (!isContain2)
                {
                    newType.Add(2);
                }
                E_mailModel.getInstance().gameMailDic.Add(dta);
                if (!isNotice)
                {
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_Mail);
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_MAIN);
                    isNotice = true;
                }
                break;

            case 3:
                E_mailModel.getInstance().familyMailDic.Add(dta);
                string FamMsg = dta.frmcid.ToString() + "#!#&" + dta.frmsex.ToString() + "#!#&" + dta.cid.ToString()
                                + "#!#&" + dta.time + "#!#&" + dta.frmname + "#!#&" + dta.msg + "#!#&" + dta.seconds + "#!#&" + dta.clanc + "#)#&";
                dta.str = FamMsg;
                E_mailModel.getInstance().famLocalStr.Add(dta);
                E_mailModel.getInstance().saveLocalData(E_mailModel.getInstance().famLocalStr, 3);
                bool isContain3 = false;
                foreach (int type in newType)
                {
                    if (type == 3)
                    {
                        isContain3 = true;
                        break;
                    }
                }
                if (!isContain3)
                {
                    newType.Add(3);
                }

                if (!isNotice)
                {
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_Mail);
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_MAIN);
                    isNotice = true;
                }

                //FileMgr.saveString(FileMgr.TYPE_MAIL, "fam", FileMgr.loadString(FileMgr.TYPE_MAIL, "fam") + FamMsg);
                break;

            case 4:

                if (E_mailModel.getInstance().personalMailDic.ContainsKey(dta.frmcid))
                {
                    E_mailModel.getInstance().personalMailDic[dta.frmcid].Add(dta);
                }
                else
                {
                    List <mailData> d = new List <mailData>();
                    d.Add(dta);
                    E_mailModel.getInstance().personalMailDic.Add(dta.frmcid, d);
                    dispatchEvent(GameEvent.Create(lis_get_new_mail, this, null));
                }

                bool isContain4 = false;
                foreach (int type in newType)
                {
                    if (type == dta.frmcid)
                    {
                        isContain4 = true;
                        break;
                    }
                }
                if (!isContain4)
                {
                    newType.Add(dta.frmcid);
                }
                if (!isNotice)
                {
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_Mail);
                    //IconNoticeMgr.getInstance().showNotice(IconNoticeMgr.TYPE_MAIN);
                    isNotice = true;
                }

                string PerMsg = dta.frmcid.ToString() + "#!#&" + dta.frmsex.ToString() + "#!#&" + dta.cid.ToString()
                                + "#!#&" + dta.time + "#!#&" + dta.frmname + "#!#&" + dta.msg + dta.seconds + "#!#&" + dta.clanc + "#)#&";
                dta.str = PerMsg;
                E_mailModel.getInstance().perLocalStr.Add(dta);
                E_mailModel.getInstance().saveLocalData(E_mailModel.getInstance().perLocalStr, 4);
                //FileMgr.saveString(FileMgr.TYPE_MAIL, "per", FileMgr.loadString(FileMgr.TYPE_MAIL, "per") + PerMsg);

                break;

            //case 5: E_mailModel.getInstance().ahMailDic.Add(dta); break;
            default:
                break;
            }
        }
        //S2C
        void onloadE_mail(Variant data)
        {
            isApplied = true;
            debug.Log("获取邮件列表");
            debug.Log(data.dump());

            foreach (Variant mail in data["mails"]._arr)
            {
                mailData dta = new mailData();
                dta.type    = mail["tp"];
                dta.id      = mail["id"];
                dta.time    = getTime(mail["tm"]);
                dta.seconds = mail["tm"]._int32;
                dta.flag    = mail["flag"];
                dta.msg     = KeyWord.filter(mail["msg"]);
                loadMailItems(mail, dta);
                switch (dta.type)
                {
                case 1:
                    E_mailModel.getInstance().systemMailDic.Add(dta);
                    break;

                case 2:
                    E_mailModel.getInstance().gameMailDic.Add(dta);
                    break;

                case 3:
                    if (mail["frmpinfo"].ContainsKey("cid"))
                    {
                        dta.frmcid = mail["frmpinfo"]["cid"];
                    }
                    if (mail["frmpinfo"].ContainsKey("name"))
                    {
                        dta.frmname = mail["frmpinfo"]["name"];
                    }
                    if (mail["frmpinfo"].ContainsKey("sex"))
                    {
                        dta.frmsex = mail["frmpinfo"]["sex"];
                    }
                    if (mail["frmpinfo"].ContainsKey("clanc"))
                    {
                        dta.clanc = mail["frmpinfo"]["clanc"];
                    }
                    E_mailModel.getInstance().familyMailDic.Add(dta);

                    bool isContain3 = false;
                    foreach (int type in newType)
                    {
                        if (type == 3)
                        {
                            isContain3 = true;
                            break;
                        }
                    }
                    if (!isContain3)
                    {
                        newType.Add(3);
                    }

                    string FamMsg = dta.frmcid.ToString() + "#!#&" + dta.frmsex.ToString() + "#!#&" + dta.cid.ToString()
                                    + "#!#&" + dta.time + "#!#&" + dta.frmname + "#!#&" + dta.msg + "#!#&" + dta.seconds + "#!#&" + dta.clanc + "#)#&";
                    dta.str = FamMsg;
                    E_mailModel.getInstance().famLocalStr.Add(dta);
                    //FileMgr.saveString(FileMgr.TYPE_MAIL, "fam", FileMgr.loadString(FileMgr.TYPE_MAIL, "fam") + FamMsg);
                    break;

                case 4:
                    if (mail["frmpinfo"].ContainsKey("cid"))
                    {
                        dta.frmcid = mail["frmpinfo"]["cid"];
                    }
                    if (mail["frmpinfo"].ContainsKey("name"))
                    {
                        dta.frmname = mail["frmpinfo"]["name"];
                    }
                    if (mail["frmpinfo"].ContainsKey("sex"))
                    {
                        dta.frmsex = mail["frmpinfo"]["sex"];
                    }
                    if (mail["frmpinfo"].ContainsKey("clanc"))
                    {
                        dta.clanc = mail["frmpinfo"]["clanc"];
                    }
                    if (E_mailModel.getInstance().personalMailDic.ContainsKey(dta.frmcid))
                    {
                        E_mailModel.getInstance().personalMailDic[dta.frmcid].Add(dta);
                    }
                    else
                    {
                        List <mailData> d = new List <mailData>();
                        d.Add(dta);
                        E_mailModel.getInstance().personalMailDic.Add(dta.frmcid, d);
                        dispatchEvent(GameEvent.Create(lis_get_new_mail, this, null));
                    }

                    bool isContain4 = false;
                    foreach (int type in newType)
                    {
                        if (type == dta.frmcid)
                        {
                            isContain4 = true;
                            break;
                        }
                    }
                    if (!isContain4)
                    {
                        newType.Add(dta.frmcid);
                    }

                    string PerMsg = dta.frmcid.ToString() + "#!#&" + dta.frmsex.ToString() + "#!#&" + dta.cid.ToString()
                                    + "#!#&" + dta.time + "#!#&" + dta.frmname + "#!#&" + dta.msg + "#!#&" + dta.seconds + "#!#&" + dta.clanc + "#)#&";
                    dta.str = PerMsg;
                    E_mailModel.getInstance().perLocalStr.Add(dta);
                    //FileMgr.saveString(FileMgr.TYPE_MAIL, "per", FileMgr.loadString(FileMgr.TYPE_MAIL, "per") + PerMsg);
                    break;

                //case 5: E_mailModel.getInstance().ahMailDic.Add(dta); break;
                default:
                    break;
                }
            }
            E_mailModel.getInstance().saveLocalData(E_mailModel.getInstance().famLocalStr, 3);
            E_mailModel.getInstance().saveLocalData(E_mailModel.getInstance().perLocalStr, 4);
        }