Exemple #1
0
 public void deleteMore()
 {
     if (list_container != null)
     {
         string    ids   = "";
         Transform trans = list_container.transform;
         for (int i = 0; i < trans.childCount; i++)
         {
             Transform sun    = trans.GetChild(i);
             UIToggle  toggle = sun.FindChild("delete-flag").GetComponent <UIToggle>();
             if (toggle.value)
             {
                 string[] ss = sun.name.Split("-"[0]);
                 ids += ss[1] + ",";
             }
         }
         if (!MyUtilTools.stringIsNull(ids))
         {
             SendMessageEntity entity = new SendMessageEntity();
             entity.buffer.skip(4);
             entity.buffer.WriteString("DeleteEmail");
             entity.buffer.WriteLong(MainData.instance.user.id);
             entity.buffer.WriteString(ids);
             EventDelegate sure = new EventDelegate(this, "confirmDeleteMore");
             sure.parameters[0]     = new EventDelegate.Parameter();
             sure.parameters[0].obj = entity;
             ConfirmUtil.confirm("是否删除选中的邮件", sure);
         }
         else
         {
             DialogUtil.tip("请选择要删除的邮件");
         }
     }
 }
Exemple #2
0
    public void searh()
    {
        Transform   transform = gameObject.transform;
        UIPopupList list      = transform.FindChild("type").GetComponent <UIPopupList>();
        string      typeStr   = list.value.Equals("全部") ? "null" : list.value;
        string      bourse    = "null";

        if (typeStr.Equals("入库"))
        {
            Transform wjs_trans = transform.FindChild("wjs-select");
            list = wjs_trans.GetComponent <UIPopupList>();
            if (list.value.Equals("其他文交所"))
            {
                UIInput bourse_input = wjs_trans.FindChild("inputer").GetComponent <UIInput>();
                bourse = MyUtilTools.stringIsNull(bourse_input.value) ? "null" : bourse_input.value;
            }
            else if (!list.value.Equals("所有文交所"))
            {
                bourse = list.value;
            }
        }
        else if (typeStr.Equals("现货"))
        {
            Transform address_trans = transform.FindChild("address");
            list = address_trans.GetComponent <UIPopupList>();
            if (list.value.Equals("其他"))
            {
                UIInput address_input = address_trans.FindChild("inputer").GetComponent <UIInput>();
                bourse = MyUtilTools.stringIsNull(address_input.value) ? "null" : address_input.value;
            }
            else if (!list.value.Equals("不限"))
            {
                bourse = list.value;
            }
        }
        UIInput input = transform.FindChild("title").GetComponent <UIInput>();
        string  title = MyUtilTools.stringIsNull(input.value) ? "null" : input.value;

        input = transform.FindChild("seller").GetComponent <UIInput>();
        string seller = MyUtilTools.stringIsNull(input.value) ? "null" : input.value;

        input = transform.FindChild("buyer").GetComponent <UIInput>();
        string buyer = MyUtilTools.stringIsNull(input.value) ? "null" : input.value;

        list = transform.FindChild("validTime").GetComponent <UIPopupList>();
        string valid     = list.value.Equals("不限有效期") ? "null" : list.value;
        string searchStr = "{\"type\":\"" + typeStr + "\"," +
                           "\"flag\":\"null\"," +
                           "\"bourse\":\"" + bourse + "\"," +
                           "\"title\":\"" + title + "\"," +
                           "\"seller\":\"" + seller + "\"," +
                           "\"buyer\":\"" + buyer + "\"," +
                           "\"valid\":\"" + valid + "\"}";
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("AgencyEnter");
        buffer.WriteString(searchStr);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #3
0
    void sure(GameObject container, bool flag)
    {
        Transform level      = container.transform.FindChild("level");
        UIToggle  good       = level.FindChild("good").GetComponent <UIToggle>();
        UIToggle  normal     = level.FindChild("normal").GetComponent <UIToggle>();
        byte      type       = (byte)(good.value ? 3 : (normal ? 2 : 1));
        UIInput   inputFiled = container.transform.FindChild("inputer").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(inputFiled.value))
        {
            UILabel label = inputFiled.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("Appraise");
        buffer.WriteByte((byte)(flag?1:0));
        buffer.WriteLong(order.dealId);
        buffer.WriteLong(order.id);
        buffer.WriteByte(type);
        buffer.WriteString(inputFiled.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #4
0
 void back(string str)
 {
     if (!MyUtilTools.stringIsNull(str))
     {
         if (!flag)
         {
             string[] ss  = str.Split(" "[0]);
             string[] ssy = ss[0].Split("-"[0]);
             year.value  = ssy[0];
             month.value = ssy[1];
             day.value   = ssy[2];
             string[] sst = ss[1].Split(":"[0]);
             hour.value   = sst[0];
             minute.value = sst[1];
         }
         else
         {
             UILabel time_label = transform.parent.FindChild("value").GetComponent <UILabel>();
             if (justDate)
             {
                 string[] ss = str.Split(" "[0]);
                 time_label.text = ss[0];
             }
             else
             {
                 time_label.text = str;
             }
         }
     }
     panel.alpha = 1f;
     CameraUtil.pop(5);
 }
Exemple #5
0
    public void change()
    {
        Transform  container      = needshow[0].transform.FindChild("scroll").FindChild("body").FindChild("container");
        UISprite   icon           = container.FindChild("icon").GetComponent <UISprite>();
        UILabel    signature_save = container.FindChild("signature").FindChild("save").GetComponent <UILabel>();
        UIInput    name           = container.FindChild("name").FindChild("inputer").GetComponent <UIInput>();
        UIInput    indent         = container.FindChild("indent").FindChild("inputer").GetComponent <UIInput>();
        UIToggle   toggle         = container.FindChild("push-flag").FindChild("toggle").GetComponent <UIToggle>();
        ByteBuffer buffer         = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("UserUpdate");
        buffer.WriteLong(MainData.instance.user.id);//编号
        buffer.WriteString(icon.spriteName);
        buffer.WriteString(signature_save.text);
        buffer.WriteByte((byte)(toggle.value ? 1 : 0));
        if (!MyUtilTools.stringIsNull(name.value))
        {
            buffer.WriteString(name.value);
        }
        else
        {
            buffer.WriteString("");
        }
        if (!MyUtilTools.stringIsNull(indent.value))
        {
            buffer.WriteString(indent.value);
        }
        else
        {
            buffer.WriteString("");
        }
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #6
0
    public void doAddAccount()
    {
        Transform   container = needshow[0].transform.FindChild("account-body").FindChild("add");
        Transform   name_tran = container.FindChild("name");
        UIPopupList list      = name_tran.GetComponent <UIPopupList>();
        string      name      = null;

        if (list.value.Equals("其他银行"))
        {
            UIInput input = name_tran.FindChild("inputer").GetComponent <UIInput>();
            name = input.value;
            if (MyUtilTools.stringIsNull(name))
            {
                DialogUtil.tip(input.transform.FindChild("tips").GetComponent <UILabel>().text);
                return;
            }
        }
        else
        {
            name = list.value;
        }
        UIInput account_input = container.FindChild("account").GetComponent <UIInput>();
        string  account       = account_input.value;

        if (MyUtilTools.stringIsNull(account))
        {
            DialogUtil.tip(account_input.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        account_input = container.FindChild("openAddress").GetComponent <UIInput>();
        string openName = account_input.value;

        if (MyUtilTools.stringIsNull(openName))
        {
            DialogUtil.tip(account_input.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        account_input = container.FindChild("openNames").GetComponent <UIInput>();
        string openPeopleName = account_input.value;

        if (MyUtilTools.stringIsNull(openPeopleName))
        {
            DialogUtil.tip(account_input.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("AddAccount");
        buffer.WriteLong(MainData.instance.user.id);        //编号
        buffer.WriteString(name);
        buffer.WriteString(account);
        buffer.WriteString(openName);
        buffer.WriteString(openPeopleName);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #7
0
 // Update is called once per frame
 void Update()
 {
     if (target != null)
     {
         if (gameObject.activeSelf && !MyUtilTools.stringIsNull(target.text))
         {
             gameObject.SetActive(false);
         }
     }
 }
Exemple #8
0
    public void search()
    {
        Transform   transform = gameObject.transform;
        UIPopupList list      = transform.FindChild("type").GetComponent <UIPopupList>();
        string      typeStr   = list.value.Equals("全部") ? "null" : list.value;
        string      bourse    = "null";

        if (typeStr.Equals("入库"))
        {
            Transform wjs_trans = transform.FindChild("wjs-select");
            list = wjs_trans.GetComponent <UIPopupList>();
            if (list.value.Equals("其他文交所"))
            {
                UIInput bourse_input = wjs_trans.FindChild("inputer").GetComponent <UIInput>();
                bourse = MyUtilTools.stringIsNull(bourse_input.value) ? "null" : bourse_input.value;
            }
            else if (!list.value.Equals("所有文交所"))
            {
                bourse = list.value;
            }
        }
        else if (typeStr.Equals("现货"))
        {
            Transform address_trans = transform.FindChild("address");
            list = address_trans.GetComponent <UIPopupList>();
            if (list.value.Equals("其他"))
            {
                UIInput address_input = address_trans.FindChild("inputer").GetComponent <UIInput>();
                bourse = MyUtilTools.stringIsNull(address_input.value) ? "null" : address_input.value;
            }
            else if (!list.value.Equals("不限"))
            {
                bourse = list.value;
            }
        }
        UIInput input = transform.FindChild("title").GetComponent <UIInput>();
        string  title = MyUtilTools.stringIsNull(input.value) ? "null" : input.value;

        input = transform.FindChild("seller").GetComponent <UIInput>();
        string seller = MyUtilTools.stringIsNull(input.value) ? "null" : input.value;

        input = transform.FindChild("buyer").GetComponent <UIInput>();
        string buyer = MyUtilTools.stringIsNull(input.value) ? "null" : input.value;

        list = transform.FindChild("validTime").GetComponent <UIPopupList>();
        string valid     = list.value.Equals("不限有效期") ? "null" : list.value;
        string searchStr = "{\"type\":\"" + typeStr + "\"," +
                           "\"bourse\":\"" + bourse + "\"," +
                           "\"title\":\"" + title + "\"," +
                           "\"seller\":\"" + seller + "\"," +
                           "\"buyer\":\"" + buyer + "\"," +
                           "\"valid\":\"" + valid + "\"}";

        dealEvent.tryToSearch(searchStr);
    }
Exemple #9
0
 public void checkShow()
 {
     if (target == null)
     {
         target = transform.parent.FindChild("show").GetComponent <UILabel>();
     }
     if (target != null && MyUtilTools.stringIsNull(target.text))
     {
         gameObject.SetActive(true);
     }
 }
Exemple #10
0
    public void tryToAddFriend()
    {
        UIInput num_input = transform.FindChild("find-body").FindChild("inputer").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(num_input.value))
        {
            DialogUtil.tip("请输入手机号码或者昵称");
            return;
        }
        justUseAddFriend = num_input.value;
        sendAddMessage();
    }
Exemple #11
0
    void doOpenOther(MainData.FriendBody friend)
    {
        if (MyUtilTools.stringIsNull(friend.other))
        {
            return;
        }
        transform.FindChild("new-body").GetComponent <UIWidget>().alpha = 0.2f;
        Transform pop = transform.FindChild("pop");

        pop.gameObject.SetActive(true);
        pop.GetComponent <JustChangeLayer>().change(10);
        CameraUtil.push(8, 2);
        UILabel content = pop.FindChild("content").GetComponent <UILabel>();

        content.text = friend.other;
    }
Exemple #12
0
    public void search()
    {
        UIInput input = transform.FindChild("left").FindChild("search").FindChild("inputer").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(input.value))
        {
            DialogUtil.tip(input.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("AdminMemberSearch");
        buffer.WriteString(input.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #13
0
    public void send()
    {
        if (!MainData.instance.user.login())
        {
            LoginEvent.tryToLogin();
            return;
        }
        Transform container      = transform.FindChild("send");
        UIInput   input_accepter = container.FindChild("accepter").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(input_accepter.value))
        {
            UILabel label = input_accepter.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        if (input_accepter.value.Equals(MainData.instance.user.nikeName))
        {
            DialogUtil.tip("不能给自己发邮件");
            return;
        }
        UIInput input_theme = container.FindChild("theme").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(input_theme.value))
        {
            UILabel label = input_theme.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UIInput input_content = container.FindChild("content").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(input_content.value))
        {
            UILabel label = input_content.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("SendEmail");
        buffer.WriteLong(MainData.instance.user.id);//编号
        buffer.WriteString(input_accepter.value);
        buffer.WriteString(input_theme.value);
        buffer.WriteString(input_content.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #14
0
 public void next()
 {
     if (num_input.value != null && startTime == 0)
     {
         if (MyUtilTools.stringIsNull(num_input.value))
         {
             DialogUtil.tip("请输入手机号码");
             return;
         }
         ByteBuffer buffer = ByteBuffer.Allocate(1024);
         buffer.skip(4);
         buffer.WriteString("FindPassword");
         buffer.WriteString(num_input.value);
         NetUtil.getInstance.SendMessage(buffer);
         tips_obj.SetActive(false);
     }
 }
Exemple #15
0
    void backFromSignature()
    {
        show(curShow, false);
        show(preShow, true);
        clears();
        title.GetComponentInChildren <UILabel>().text = "个人中心";
        callback = null;
        UIInput input = needshow[0].transform.FindChild("signature-body").FindChild("inputer").GetComponent <UIInput>();

        if (!MyUtilTools.stringIsNull(input.value))
        {
            UILabel signature      = needshow[0].transform.FindChild("scroll").FindChild("body").FindChild("container").FindChild("signature").GetComponent <UILabel>();
            UILabel signature_save = signature.transform.FindChild("save").GetComponent <UILabel>();
            MyUtilTools.insertStr(signature, input.value, 300);
            signature_save.text = input.value;
        }
    }
Exemple #16
0
 public void send(UIInput input)
 {
     if (MyUtilTools.stringIsNull(input.value))
     {
         DialogUtil.tip("请输入手机号码");
         return;
     }
     if (startTime == 0)
     {
         ByteBuffer buffer = ByteBuffer.Allocate(1024);
         buffer.skip(4);
         buffer.WriteString("Token");
         buffer.WriteString(input.value);
         buffer.WriteString("1");
         NetUtil.getInstance.SendMessage(buffer);
     }
 }
Exemple #17
0
    public void sure()
    {
        UIInput input = gameObject.GetComponentInChildren <UIInput>();

        if (MyUtilTools.stringIsNull(input.value))
        {
            DialogUtil.tip("请输入要回复的内容");
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("RevertAdd");
        buffer.WriteLong(curItem.id);
        buffer.WriteLong(MainData.instance.user.id);
        buffer.WriteLong(target);
        buffer.WriteString(input.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #18
0
    public void sendStringMessage(MainData.FriendBody friend)
    {
        UIInput input = transform.FindChild("message-detail").FindChild("inputers").FindChild("inputer").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(input.value))
        {
            DialogUtil.tip("不能发送空的消息");
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("FriendMessage");
        buffer.WriteLong(MainData.instance.user.id); //自己编号
        buffer.WriteLong(friend.fid);                //好友编号
        buffer.WriteByte(0);                         //0 文字内容,1图片
        buffer.WriteString(input.value);             //内容
        NetUtil.getInstance.SendMessage(buffer);
        input.value = "";
    }
Exemple #19
0
    public void login()
    {
        if (MyUtilTools.stringIsNull(account.value))
        {
            DialogUtil.tip("请输入您的账号 ");
            return;
        }
        if (MyUtilTools.stringIsNull(pwd.value))
        {
            DialogUtil.tip("请输入您的密码 ");
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("Login");
        buffer.WriteString(account.value);
        buffer.WriteString(pwd.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
    public void reset()
    {
        UIInput account  = transform.FindChild("account").GetComponent <UIInput>();
        UIInput safecode = transform.FindChild("code").GetComponent <UIInput>();
        UIInput pwd      = transform.FindChild("pwd").GetComponent <UIInput>();
        UIInput rpwd     = transform.FindChild("rpwd").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(account.value))
        {
            DialogUtil.tip(account.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        if (MyUtilTools.stringIsNull(safecode.value))
        {
            DialogUtil.tip(safecode.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        if (MyUtilTools.stringIsNull(pwd.value))
        {
            DialogUtil.tip(pwd.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        if (MyUtilTools.stringIsNull(rpwd.value))
        {
            DialogUtil.tip(rpwd.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        if (!pwd.value.Equals(rpwd.value))
        {
            DialogUtil.tip("两次输入的密码不匹配");
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("AdminResetPwd");
        buffer.WriteString(account.value);
        buffer.WriteString(safecode.value);
        buffer.WriteString(pwd.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #21
0
    public void login()
    {
        UIInput account = transform.FindChild("account").GetComponent <UIInput>();
        UIInput pwd     = transform.FindChild("pwd").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(account.value))
        {
            DialogUtil.tip(account.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        if (MyUtilTools.stringIsNull(pwd.value))
        {
            DialogUtil.tip(pwd.transform.FindChild("tips").GetComponent <UILabel>().text);
            return;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("AdminLogin");
        buffer.WriteString(account.value);
        buffer.WriteString(pwd.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #22
0
    public void search()
    {
        UIInput input = transform.FindChild("list").FindChild("body").FindChild("container").FindChild("search").FindChild("inputer").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(input.value))
        {
            DialogUtil.tip("请输入要查找的用户的昵称或者手机号");
            return;
        }
        bool needNet = true;
        List <MainData.FriendBody> friends = MainData.instance.user.friends;

        MainData.FriendBody target = null;
        for (int i = 0; i < friends.Count; i++)
        {
            MainData.FriendBody friend = friends[i];
            if (friend.fName.Equals(input.value) || friend.account.Equals(input.value))
            {
                needNet = false;
                target  = friend;
                break;
            }
        }
        if (needNet)
        {
            ByteBuffer buffer = ByteBuffer.Allocate(1024);
            buffer.skip(4);
            buffer.WriteString("FriendSearch");
            buffer.WriteString(input.value);//内容
            NetUtil.getInstance.SendMessage(buffer);
        }
        else
        {
            string resultStr = "2" + "," + target.fName;
            openSearchResult(resultStr, target);
        }
    }
Exemple #23
0
    public void doRZ(GameObject container)
    {
        UIPopupList type_list = container.transform.FindChild("type").GetComponent <UIPopupList>();
        UIInput     key_input = container.transform.FindChild("key").GetComponent <UIInput>();

        if (MyUtilTools.stringIsNull(key_input.value))
        {
            UILabel label = key_input.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UITexture texture = container.transform.FindChild("front").FindChild("context").GetComponent <UITexture>();

        if (texture.mainTexture == null)
        {
            DialogUtil.tip("请拍摄证件正面");
            return;
        }
        SendMessageEntity entity = new SendMessageEntity();
        Texture2D         t2d    = (Texture2D)texture.mainTexture;
        EventDelegate     ok     = new EventDelegate(this, "uploadPicOk");

        ok.parameters[0]     = new EventDelegate.Parameter();
        ok.parameters[0].obj = entity;
        System.DateTime tody    = System.DateTime.Now;
        string          dateStr = tody.Year + "-" + tody.Month + "-" + tody.Day + "-" + tody.Hour + "-" + tody.Minute + "-" + tody.Second + ".jpg";
        string          picName = MainData.instance.user.account + "-sellercommit-" + dateStr;

        entity.buffer.skip(4);
        entity.buffer.WriteString("SellerCommit");
        entity.buffer.WriteLong(MainData.instance.user.id);
        entity.buffer.WriteByte((byte)(type_list.value.Equals("个人") ? 0 : 1));
        entity.buffer.WriteString(key_input.value);
        entity.buffer.WriteString(picName);
        LoadUtil.show(true, "上传图片中请稍后");
        JustRun.Instance.upLoadPic(picName, t2d.EncodeToJPG(), ok, new EventDelegate(uploadPicFail));
    }
Exemple #24
0
    public void upload(GameObject container)
    {
        UIPopupList wjs_list    = container.transform.FindChild("wjs").GetComponent <UIPopupList>();
        UIPopupList yhk_list    = container.transform.FindChild("yhk").GetComponent <UIPopupList>();
        UIInput     tel_input   = container.transform.FindChild("tel").GetComponent <UIInput>();
        UIInput     email_input = container.transform.FindChild("email").GetComponent <UIInput>();

        //UIInput token_input = container.transform.FindChild("token").GetComponent<UIInput>();
        if (MyUtilTools.stringIsNull(tel_input.value))
        {
            DialogUtil.tip("请输入开户手机号码");
            return;
        }
        if (tel_input.value.Length != 11)
        {
            DialogUtil.tip("手机号码尾数不对");
            return;
        }
        if (!MyUtilTools.checkEmail(email_input.value))
        {
            DialogUtil.tip("请输入合法的email");
            return;
        }

        /*
         * if (MyUtilTools.checkEmail(token_input.value))
         * {
         *  DialogUtil.tip("请输入验证码");
         *  return;
         * }*/
        Transform indent_trans         = container.transform.FindChild("indents");
        UITexture indent_front_texture = indent_trans.FindChild("front").FindChild("context").GetComponent <UITexture>();

        if (indent_front_texture.mainTexture == null)
        {
            DialogUtil.tip("请上传身份证正面");
            return;
        }
        UITexture indent_back_texture = indent_trans.FindChild("back").FindChild("context").GetComponent <UITexture>();

        if (indent_back_texture.mainTexture == null)
        {
            DialogUtil.tip("请上传身份证反面");
            return;
        }
        UITexture bank_texture = container.transform.FindChild("bank").FindChild("front").FindChild("context").GetComponent <UITexture>();

        if (bank_texture.mainTexture == null)
        {
            DialogUtil.tip("请上传银行卡正面");
            return;
        }
        SendMessageEntity entity = new SendMessageEntity();

        System.DateTime tody    = System.DateTime.Now;
        string          dateStr = tody.Year + "-" + tody.Month + "-" + tody.Day + "-" + tody.Hour + "-" + tody.Minute + "-" + tody.Second + ".jpg";

        entity.names.Add(tel_input.value + "-indent-front-" + dateStr);
        entity.names.Add(tel_input.value + "-indent-back-" + dateStr);
        entity.names.Add(tel_input.value + "-bank-front-" + dateStr);
        entity.buffer.skip(4);
        entity.buffer.WriteString("OpenAccountApply");
        entity.buffer.WriteString(wjs_list.value);
        entity.buffer.WriteString(yhk_list.value);
        entity.buffer.WriteString(tel_input.value);
        entity.buffer.WriteString(email_input.value);
        //entity.buffer.WriteString(token_input.value);
        entity.buffer.WriteString(entity.names[0]);
        entity.buffer.WriteString(entity.names[1]);
        entity.buffer.WriteString(entity.names[2]);
        if (!isUploaded)
        {
            EventDelegate ok = new EventDelegate(this, "uploadPicOk");
            ok.parameters[0]     = new EventDelegate.Parameter();
            ok.parameters[0].obj = entity;
            ok.parameters[1]     = new EventDelegate.Parameter();
            ok.parameters[1].obj = indent_back_texture;
            ok.parameters[2]     = new EventDelegate.Parameter();
            ok.parameters[2].obj = bank_texture;
            LoadUtil.show(true, "上传图片中请稍后");
            JustRun.Instance.upLoadPic(entity.names[0], ((Texture2D)indent_front_texture.mainTexture).EncodeToJPG(), ok, new EventDelegate(uploadPicFail));
        }
        else
        {
            sendMessage(entity);
        }
    }
Exemple #25
0
    void readXLSX()
    {
        WebViewBehavior webBody = GetComponent <WebViewBehavior>();

        webBody.setCallback(new WebViewCallback());
        UIAtlas    baseAtlass = Resources.Load <UIAtlas>("Atlass/WebIcons");
        GameObject newObj     = new GameObject();
        TextAsset  binAsset   = Resources.Load <TextAsset>("excel/bourse");

        string[]   lineArray = binAsset.text.Split(new char[] { '\r', '\n' });
        float      start     = 300;
        float      x         = -start;
        float      y         = 450;
        GameObject container = transform.FindChild("scroll").FindChild("body").FindChild("container").gameObject;

        for (int i = 1; i < lineArray.Length; i++)
        {
            string str = lineArray[i].Trim();
            if (MyUtilTools.stringIsNull(str))
            {
                continue;
            }
            string[]   ss         = str.Split(","[0]);
            string     spriteName = ss[0] + ss[1];
            string     url        = ss[2];
            string     name       = ss[3];
            GameObject sun        = NGUITools.AddChild(container, newObj);
            sun.name = name;
            sun.transform.localPosition = new Vector3(x, y, 0);
            UISprite sprite = sun.AddComponent <UISprite>();
            sprite.atlas                 = baseAtlass;
            sprite.spriteName            = spriteName;
            sprite.width                 = 100;
            sprite.height                = 100;
            sprite.depth                 = 1;
            sprite.autoResizeBoxCollider = true;
            BoxCollider collider = sun.AddComponent <BoxCollider>();
            collider.size = new Vector3(100, 100, 0);
            UIButton     button = sun.AddComponent <UIButton>();
            BourseEntity bourse = sun.AddComponent <BourseEntity>();
            bourse.init(name, url);
            EventDelegate event_select = new EventDelegate(bourse, "select");
            event_select.parameters[0]     = new EventDelegate.Parameter();
            event_select.parameters[0].obj = webBody;
            event_select.parameters[1]     = new EventDelegate.Parameter();
            event_select.parameters[1].obj = needshow[0].transform.parent.parent.parent.parent.gameObject;
            button.onClick.Add(event_select);
            GameObject font_obj = NGUITools.AddChild(sun, newObj);
            font_obj.transform.localPosition = new Vector3(0, -80, 0);
            font_obj.name = "label_" + name;
            UILabel label = font_obj.AddComponent <UILabel>();
            label.trueTypeFont = labelFont;
            label.fontSize     = 30;
            label.text         = name;
            label.width        = 120;
            label.height       = 50;
            label.color        = Color.black;
            label.depth        = 2;
            x += 120;
            if (x > start)
            {
                x  = -start;
                y -= 180;
            }
        }
        Destroy(newObj);
    }
Exemple #26
0
    public void sure()
    {
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("DealEdit");
        buffer.WriteLong(curItem.id);//编号
        Transform   container = transform.FindChild("seller");
        UIPopupList pop_type  = container.FindChild("type").GetComponent <UIPopupList>();

        buffer.WriteByte(pop_type.value.Equals("入库") ? (byte)0 : (byte)1);//交割方式
        if (curItem.seller)
        {
            string wjs = null;
            if (pop_type.value.Equals("入库"))
            {
                UIPopupList pop_select = container.FindChild("wjs-select").GetComponent <UIPopupList>();
                if (pop_select.value.Equals("其他文交所"))
                {
                    UIInput input = container.FindChild("wjs-select").GetComponentInChildren <UIInput>();
                    wjs = "1," + input.value;
                }
                else
                {
                    wjs = "0," + pop_select.value;
                }
            }
            else
            {
                GameObject  address_obj = container.FindChild("address").gameObject;
                UIPopupList addressList = address_obj.GetComponent <UIPopupList>();
                wjs = addressList.value;
                if (wjs.Equals("其他"))
                {
                    UIInput input = address_obj.GetComponentInChildren <UIInput>();
                    if (MyUtilTools.stringIsNull(input.value))
                    {
                        DialogUtil.tip("请输入交易城市");
                        return;
                    }
                    wjs = "1," + input.value;
                }
                else
                {
                    wjs = "0," + addressList.value;
                }
            }
            buffer.WriteString(wjs);
            UIInput input_title = container.FindChild("title").GetComponentInChildren <UIInput>();
            string  title       = input_title.value;
            buffer.WriteString(title);

            UIInput input_price = container.FindChild("price").GetComponentInChildren <UIInput>();
            string  price       = input_price.value;
            buffer.WriteString(price);

            UIInput input_num = container.FindChild("num").GetComponentInChildren <UIInput>();
            string  num       = input_num.value;
            if (!MyUtilTools.stringIsNull(num))
            {
                buffer.WriteInt(int.Parse(num));
            }
            else
            {
                buffer.WriteInt(0);
            }
            UIInput input_minNum = container.FindChild("minNum").GetComponentInChildren <UIInput>();
            string  minNum       = input_minNum.value;
            buffer.WriteInt(int.Parse(minNum));

            UILabel label_time = container.FindChild("time").FindChild("show").GetComponentInChildren <UILabel>();
            string  time       = label_time.text;
            buffer.WriteString(time);

            UIInput input_other = container.FindChild("other").GetComponentInChildren <UIInput>();
            string  other       = input_other.value;
            buffer.WriteString(other);
        }
        else
        {
            container = gameObject.transform.FindChild("buyer");
            string wjs = null;
            if (pop_type.value.Equals("入库"))
            {
                UIPopupList pop_select = container.FindChild("wjs-select").GetComponent <UIPopupList>();
                if (pop_select.value.Equals("其他文交所"))
                {
                    UIInput input = container.FindChild("wjs-select").GetComponentInChildren <UIInput>();
                    wjs = "1," + input.value;
                }
                else
                {
                    wjs = "0," + pop_select.value;
                }
            }
            else
            {
                GameObject  address_obj = container.FindChild("address").gameObject;
                UIPopupList addressList = address_obj.GetComponent <UIPopupList>();
                wjs = addressList.value;
                if (wjs.Equals("其他"))
                {
                    UIInput input = address_obj.GetComponentInChildren <UIInput>();
                    if (MyUtilTools.stringIsNull(input.value))
                    {
                        DialogUtil.tip("请输入交易城市");
                        return;
                    }
                    wjs = "1," + input.value;
                }
                else
                {
                    wjs = "0," + addressList.value;
                }
            }
            buffer.WriteString(wjs);
            UIInput input_name = container.FindChild("name").GetComponentInChildren <UIInput>();
            string  name       = input_name.value;
            buffer.WriteString(name);
            UIInput input_price = container.FindChild("price").GetComponentInChildren <UIInput>();
            string  price       = input_price.value;
            buffer.WriteString(price);
            UIInput input_num = container.FindChild("num").GetComponentInChildren <UIInput>();
            string  num       = input_num.value;
            if (!MyUtilTools.stringIsNull(num))
            {
                buffer.WriteInt(int.Parse(num));
            }
            else
            {
                buffer.WriteInt(0);
            }
            buffer.WriteInt(0);
            UILabel label_time = container.FindChild("time").FindChild("show").GetComponentInChildren <UILabel>();
            string  time       = label_time.text;
            buffer.WriteString(time);
            UIInput input_other = container.FindChild("other").GetComponentInChildren <UIInput>();
            string  other       = input_other.value;
            buffer.WriteString(other);
        }
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #27
0
    public void refreshInfo()
    {
        //填充数据
        Transform container = needshow[0].transform.FindChild("scroll").FindChild("body").FindChild("container");

        container.parent.GetComponent <UIPanel>().clipOffset = Vector2.zero;
        container.parent.localPosition = new Vector3(0, 0, 0);
        UISprite icon = container.FindChild("icon").GetComponent <UISprite>();

        icon.spriteName = MainData.instance.user.face;
        UILabel signature      = container.FindChild("signature").GetComponent <UILabel>();
        UILabel signature_save = signature.transform.FindChild("save").GetComponent <UILabel>();

        MyUtilTools.insertStr(signature, MainData.instance.user.signature, signature.width / 2);
        signature_save.text = MainData.instance.user.signature;
        UILabel account = container.FindChild("account").GetComponent <UILabel>();

        account.text = MainData.instance.user.account;
        UILabel nikeName = container.FindChild("nikeName").GetComponent <UILabel>();

        nikeName.text = MainData.instance.user.nikeName;
        UILabel title = container.FindChild("title").FindChild("value").GetComponent <UILabel>();

        title.text = MainData.instance.user.title;
        UILabel registTime = container.FindChild("registTime").FindChild("value").GetComponent <UILabel>();

        string[] ss  = MainData.instance.user.registTime.Split(" "[0]);
        string[] ssy = ss[0].Split("-"[0]);
        registTime.text = ssy[0] + "年" + ssy[1] + "月" + ssy[2] + "日";
        UILabel bank_list = container.FindChild("bank").FindChild("value").GetComponent <UILabel>();

        if (MainData.instance.user.bacnkAccount.names.Count > 0)
        {
            bank_list.text = MainData.instance.user.bacnkAccount.accounts[0];
        }
        else
        {
            bank_list.text = "未绑定";
        }
        UIButton button = bank_list.transform.GetComponent <UIButton>();

        button.onClick.Clear();
        button.onClick.Add(new EventDelegate(showBankAccount));

        UILabel address_label = container.FindChild("address").FindChild("value").GetComponent <UILabel>();

        if (MainData.instance.user.addresses.Count > 0)
        {
            MyUtilTools.insertStr(address_label, MainData.instance.user.addresses[0], 300);
        }
        else
        {
            address_label.text = "未设置收货地址";
        }
        UIInput name = container.FindChild("name").FindChild("inputer").GetComponent <UIInput>();

        name.value = MainData.instance.user.realyName;
        if (!MyUtilTools.stringIsNull(MainData.instance.user.realyName))
        {
            name.transform.parent.FindChild("arraw").gameObject.SetActive(false);
        }
        UIInput indent = container.FindChild("indent").FindChild("inputer").GetComponent <UIInput>();

        indent.value = MainData.instance.user.indentity;
        if (!MyUtilTools.stringIsNull(MainData.instance.user.indentity))
        {
            indent.transform.parent.FindChild("arraw").gameObject.SetActive(false);
        }
        UIToggle toggle = container.FindChild("push-flag").FindChild("toggle").GetComponent <UIToggle>();

        toggle.value = MainData.instance.user.pushFlag;
        //信用
        refreshCredit(container.FindChild("credit").FindChild("suns"));
        //财富
        Transform credit_recharge = container.FindChild("recharge").FindChild("suns");
        UILabel   cur_value       = credit_recharge.FindChild("cur-value").FindChild("Label").GetComponent <UILabel>();

        cur_value.text = MainData.instance.user.recharge.curMoney + "邮游币";
        UILabel history_value = credit_recharge.FindChild("history-value").FindChild("Label").GetComponent <UILabel>();

        history_value.text = MainData.instance.user.recharge.historyMoney + "邮游币";
        //认证中心
        refreshRZ(container.FindChild("rzzx").FindChild("suns"));
    }
Exemple #28
0
    void refreshUser(MainData.UserData user)
    {
        Transform right     = transform.FindChild("right");
        Transform container = right.FindChild("user-look");

        right.FindChild("order-help").gameObject.SetActive(false);
        container.gameObject.SetActive(true);
        container.FindChild("account").FindChild("value").GetComponent <UILabel>().text  = user.account;
        container.FindChild("nickName").FindChild("value").GetComponent <UILabel>().text = user.nikeName;
        container.FindChild("name").FindChild("value").GetComponent <UILabel>().text     = user.realyName;
        container.FindChild("ident").FindChild("value").GetComponent <UILabel>().text    = user.indentity;
        container.FindChild("type").FindChild("value").GetComponent <UILabel>().text     = user.permission == 1 ? "买家" : "卖家";
        container.FindChild("title").FindChild("value").GetComponent <UILabel>().text    = user.title;
        container.FindChild("deposit").FindChild("value").GetComponent <UILabel>().text  = user.deposit + "";
        container.FindChild("deal").FindChild("value").GetComponent <UILabel>().text     = user.credit.totalDealValue + "";
        container.FindChild("credit-c").FindChild("value").GetComponent <UILabel>().text = user.credit.maxValue + "";
        container.FindChild("credit-t").FindChild("value").GetComponent <UILabel>().text = user.credit.tempMaxValue + "";
        container.FindChild("hp").FindChild("value").GetComponent <UILabel>().text       = user.credit.hp + "";
        container.FindChild("zp").FindChild("value").GetComponent <UILabel>().text       = user.credit.zp + "";
        container.FindChild("cp").FindChild("value").GetComponent <UILabel>().text       = user.credit.cp + "";
        container.FindChild("regist").FindChild("value").GetComponent <UILabel>().text   = user.registTime;
        container.FindChild("time").FindChild("value").GetComponent <UILabel>().text     = user.endTime;
        container.FindChild("wg").FindChild("value").GetComponent <UILabel>().text       = user.breach + "";
        Transform fh_body = container.FindChild("fh").FindChild("body");
        UILabel   reason  = fh_body.FindChild("value").GetComponent <UILabel>();

        if (user.forbid.endTime.Equals("forever"))
        {
            reason.text = "永久封号";
            fh_body.FindChild("time").FindChild("value").GetComponent <UILabel>().text = "永久";
        }
        else if (user.forbid.endTime.Equals("null"))
        {
            reason.text = "未被封号";
            fh_body.FindChild("time").FindChild("value").GetComponent <UILabel>().text = "无";
        }
        else
        {
            reason.text = user.forbid.reason + "";
            fh_body.FindChild("time").FindChild("value").GetComponent <UILabel>().text = user.forbid.endTime;
        }
        if (user.addresses.Count > 0)
        {
            container.FindChild("address").FindChild("value").GetComponent <UILabel>().text = user.addresses[0];
        }
        else
        {
            container.FindChild("address").FindChild("value").GetComponent <UILabel>().text = "未绑定地址";
        }
        if (user.bacnkAccount.names.Count > 0)
        {
            container.FindChild("bank").FindChild("value").GetComponent <UILabel>().text = user.bacnkAccount.names[0] + " " + user.bacnkAccount.accounts[0];
        }
        else
        {
            container.FindChild("bank").FindChild("value").GetComponent <UILabel>().text = "未绑定银行卡";
        }
        container.FindChild("other").FindChild("value").GetComponent <UILabel>().text = MyUtilTools.stringIsNull(user.other) ? "没有备注" : user.other;
    }
Exemple #29
0
    public void regist()
    {
        UIInput account = inputs["account"];

        if (MyUtilTools.stringIsNull(account.value))
        {
            UILabel label = account.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UIInput token = inputs["token"];

        if (MyUtilTools.stringIsNull(token.value))
        {
            UILabel label = token.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UIInput pwd = inputs["pwd"];

        if (MyUtilTools.stringIsNull(pwd.value))
        {
            UILabel label = pwd.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        if (pwd.value.Length < 6 || pwd.value.Length > 32)
        {
            DialogUtil.tip("密码长度6~32");
            return;
        }
        UIInput rpwd = inputs["rpwd"];

        if (MyUtilTools.stringIsNull(rpwd.value))
        {
            UILabel label = rpwd.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        if (rpwd.value.Length < 6 || rpwd.value.Length > 32)
        {
            DialogUtil.tip("密码长度6~32");
            return;
        }
        if (!pwd.value.Equals(rpwd.value))
        {
            DialogUtil.tip("两次输入不匹配");
            return;
        }
        UIInput nikeName = inputs["nikeName"];

        if (MyUtilTools.stringIsNull(nikeName.value))
        {
            UILabel label = nikeName.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        if (nikeName.value.Length > 12)
        {
            DialogUtil.tip("昵称过长");
            return;
        }
        UIInput name    = inputs["name"];
        UIInput address = inputs["address"];

        if (isOpen)
        {
            if (MyUtilTools.stringIsNull(name.value))
            {
                UILabel label = name.transform.FindChild("tips").GetComponent <UILabel>();
                DialogUtil.tip(label.text);
                return;
            }
            if (MyUtilTools.stringIsNull(address.value))
            {
                UILabel label = address.transform.FindChild("tips").GetComponent <UILabel>();
                DialogUtil.tip(label.text);
                return;
            }
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("Regist");
        buffer.WriteString(account.value);
        buffer.WriteString(token.value);
        buffer.WriteString(pwd.value);
        buffer.WriteString(nikeName.value);
        buffer.WriteString(name.value);
        buffer.WriteString(address.value);
        NetUtil.getInstance.SendMessage(buffer);
    }
Exemple #30
0
    void send(GameObject container, bool flag)
    {
        if (!MainData.instance.user.login())
        {
            LoginEvent.tryToLogin();
            return;
        }
        if (flag && !MainData.instance.user.recharge.haveMoney(10))
        {
            DialogUtil.tip("您的邮游币不足,无法推送发布。");
            return;
        }
        Transform   trans      = container.transform;
        UIPopupList typeList   = trans.FindChild("type").GetComponent <UIPopupList>();
        string      addressStr = "";

        if (typeList.value.Equals("现货"))
        {
            Transform   address_tran = trans.FindChild("address");
            UIPopupList addressList  = address_tran.GetComponent <UIPopupList>();
            if (addressList.value.Equals("其他"))
            {
                UIInput input = address_tran.FindChild("inputer").GetComponent <UIInput>();
                if (MyUtilTools.stringIsNull(input.value))
                {
                    UILabel label = input.transform.FindChild("tips").GetComponent <UILabel>();
                    DialogUtil.tip(label.text);
                    return;
                }
                addressStr = "1," + input.value;
            }
            else
            {
                addressStr = "0," + addressList.value;
            }
        }
        else
        {
            Transform   wjs_tran = trans.FindChild("wjs-select");
            UIPopupList wjsList  = wjs_tran.GetComponent <UIPopupList>();
            if (wjsList.value.Equals("其他文交所"))
            {
                UIInput input = wjs_tran.FindChild("inputer").GetComponent <UIInput>();
                if (MyUtilTools.stringIsNull(input.value))
                {
                    UILabel label = input.transform.FindChild("tips").GetComponent <UILabel>();
                    DialogUtil.tip(label.text);
                    return;
                }
                addressStr = "1," + input.value;
            }
            else
            {
                addressStr = "0," + wjsList.value;
            }
        }
        UIInput input_name = trans.FindChild("name").GetComponent <UIInput>();
        string  name       = input_name.value;

        if (MyUtilTools.stringIsNull(name))
        {
            UILabel label = input_name.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UIInput input_num = trans.FindChild("num").GetComponent <UIInput>();
        string  num       = input_num.value;

        if (MyUtilTools.stringIsNull(num))
        {
            UILabel label = input_num.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UIInput input_price = trans.FindChild("price").GetComponent <UIInput>();
        string  price       = input_price.value;

        if (MyUtilTools.stringIsNull(price))
        {
            UILabel label = input_price.transform.FindChild("tips").GetComponent <UILabel>();
            DialogUtil.tip(label.text);
            return;
        }
        UIPopupList danweiList  = trans.FindChild("danwei").GetComponent <UIPopupList>();
        Transform   time_trans  = trans.FindChild("time");
        UIInput     year        = time_trans.FindChild("year").GetComponent <UIInput>();
        UIInput     month       = time_trans.FindChild("month").GetComponent <UIInput>();
        UIInput     day         = time_trans.FindChild("day").GetComponent <UIInput>();
        UIInput     hour        = time_trans.FindChild("hour").GetComponent <UIInput>();
        UIInput     minute      = time_trans.FindChild("minute").GetComponent <UIInput>();
        string      time        = year.value + "-" + month.value + "-" + day.value + " " + hour.value + ":" + minute.value + ":00";
        UIInput     input_other = trans.FindChild("other").GetComponent <UIInput>();
        string      other       = input_other.value;
        UIToggle    toggle      = trans.FindChild("flag").GetComponent <UIToggle>();
        ByteBuffer  buffer      = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("BuyDeploy");
        buffer.WriteByte((byte)(flag ? 1 : 0));
        buffer.WriteLong(MainData.instance.user.id);
        buffer.WriteByte((byte)(typeList.value.Equals("入库") ? 0 : 1));
        buffer.WriteString(addressStr);
        buffer.WriteString(name);
        buffer.WriteInt(int.Parse(num));
        buffer.WriteString(danweiList.value);
        buffer.WriteString(price);
        buffer.WriteString(time);
        buffer.WriteString(other);
        buffer.WriteByte((byte)(toggle.value ? 1 : 0));
        NetUtil.getInstance.SendMessage(buffer);
    }