Esempio n. 1
0
 public void doGrab()
 {
     if (!MainData.instance.user.login())
     {
         LoginEvent.tryToLogin();
         return;
     }
     ConfirmUtil.confirm("确定抢单?", confirmGrab);
 }
Esempio n. 2
0
 public override void click()
 {
     if (!MainData.instance.user.login())
     {
         LoginEvent.tryToLogin();
         return;
     }
     init();
     base.click();
 }
Esempio n. 3
0
 public void openInfo()
 {
     if (!MainData.instance.user.login())
     {
         LoginEvent.tryToLogin();
         return;
     }
     click();
     needshow[0].transform.FindChild("selectIcon").gameObject.SetActive(false);
     refreshInfo();
 }
Esempio n. 4
0
 void openRevert(DealBody item, LongParamter target)
 {
     if (!MainData.instance.user.login())
     {
         LoginEvent.tryToLogin();
         LoginEvent.callback = new EventDelegate(this, "back_deal_detail");
         LoginEvent.callback.parameters[0]     = new EventDelegate.Parameter();
         LoginEvent.callback.parameters[0].obj = item;
         return;
     }
     showSub("revert");
     //CameraUtil.push(3,2);
     dealRevertEvent.okback = new EventDelegate(backAndShow);
     dealRevertEvent.show(item, target.Value);
 }
Esempio n. 5
0
    void cancleFavorite(DealBody item)
    {
        if (!MainData.instance.user.login())
        {
            LoginEvent.tryToLogin();
            LoginEvent.callback = new EventDelegate(this, "back_deal_detail");
            LoginEvent.callback.parameters[0]     = new EventDelegate.Parameter();
            LoginEvent.callback.parameters[0].obj = item;
            return;
        }
        EventDelegate sure = new EventDelegate(this, "comfirmCancleFavorite");

        sure.parameters[0]     = new EventDelegate.Parameter();
        sure.parameters[0].obj = item;
        ConfirmUtil.confirm("取消收藏?", sure);
    }
Esempio n. 6
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);
    }
Esempio n. 7
0
    public void cancleFavorite()
    {
        if (!MainData.instance.user.login())
        {
            LoginEvent.tryToLogin();
            return;
        }
        DealBody   deal   = pushs[index];
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("DealFavorite");
        buffer.WriteInt(1);
        buffer.WriteLong(deal.id);
        buffer.WriteLong(MainData.instance.user.id);
        NetUtil.getInstance.SendMessage(buffer);
    }
Esempio n. 8
0
    public void search(GameObject obj)
    {
        if (!MainData.instance.user.login())
        {
            LoginEvent.tryToLogin();
            return;
        }
        int type = 0;

        if (obj.name.Equals("ddjy"))
        {
            type = 1;
        }
        else if (obj.name.Equals("zzjy"))
        {
            type = 2;
        }
        else if (obj.name.Equals("ddpj"))
        {
            type = 3;
        }
        else if (obj.name.Equals("ywcjy"))
        {
            type = 4;
        }
        else if (obj.name.Equals("wdct"))
        {
            type = 5;
        }
        else if (obj.name.Equals("wdscj"))
        {
            type = 6;
        }
        ByteBuffer buffer = ByteBuffer.Allocate(1024);

        buffer.skip(4);
        buffer.WriteString("DealSearch");
        buffer.WriteInt(type);
        buffer.WriteLong(MainData.instance.user.id);
        NetUtil.getInstance.SendMessage(buffer);
    }
Esempio n. 9
0
    void openGrab(DealBody item)
    {
        if (!MainData.instance.user.login())
        {
            LoginEvent.tryToLogin();
            LoginEvent.callback = new EventDelegate(this, "back_deal_detail");
            LoginEvent.callback.parameters[0]     = new EventDelegate.Parameter();
            LoginEvent.callback.parameters[0].obj = item;
            return;
        }
        detail_container.transform.parent.GetComponent <UIPanel>().alpha = 0.2f;
        GameObject grab = detail_container.transform.parent.parent.FindChild("grab").gameObject;

        grab.SetActive(true);
        DealGrab grab_scritp = grab.AddComponent <DealGrab>();

        grab_scritp.init(item, this);
        Transform do_trans = grab.transform.FindChild("do");

        do_trans.FindChild("inputer").GetComponent <GrabInputEvent>().init(item.curNum);
        //逻辑部分
        UIButton button_sure = do_trans.FindChild("sure").GetComponent <UIButton>();

        button_sure.onClick.Clear();
        button_sure.onClick.Add(new EventDelegate(grab_scritp.doGrab));
        UIButton button_cancle = do_trans.FindChild("cancle").GetComponent <UIButton>();

        button_cancle.onClick.Clear();
        button_cancle.onClick.Add(new EventDelegate(grab_scritp.grabBack));
        UIButton button_close = grab.transform.FindChild("tips").FindChild("close").GetComponent <UIButton>();

        button_close.onClick.Clear();
        button_close.onClick.Add(new EventDelegate(grab_scritp.grabBack));
        CameraUtil.push(3, 2);
        GameObject.Find("main").transform.FindChild("back").gameObject.SetActive(false);
    }
Esempio n. 10
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);
    }