void Update() { if (count % 200 == 0) { List <MainData.MessageBody> messages = getRecentlyMessage(friend); UILabel content = transform.FindChild("content").GetComponent <UILabel>(); MyUtilTools.insertStr(content, messages.Count > 0 ? messages[0].content : "暂时没有消息", 470); UILabel time = transform.FindChild("time").GetComponent <UILabel>(); if (messages.Count > 0) { string[] ss = messages[0].time.Split(" "[0]); string[] ssy = ss[0].Split("-"[0]); time.text = ssy[0] + "年" + ssy[1] + "月" + ssy[2] + "日"; if (messages[0].look == 0) { transform.FindChild("newFlag").gameObject.SetActive(true); } } else { time.gameObject.SetActive(false); } } count++; }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("Regist"); if (buffer != null) { //注册成功 DialogUtil.tip(buffer.ReadString()); clearInputs(); } buffer = MyUtilTools.tryToLogic("Token"); if (buffer != null) { startTime = System.DateTime.Now.Ticks / 10000000; tokenButton.SetState(UIButtonColor.State.Disabled, true); } if (startTime > 0) { long now = System.DateTime.Now.Ticks / 10000000; int fix = (int)(now - startTime); if (fix >= 60) { init(); } else { tokenLabe.text = "重发(" + MyUtilTools.numToString(60 - fix) + ")秒"; } } }
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); }
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); }
void refreshListDeal(List <DealBody> items) { MyUtilTools.clearChild(list_container.transform); if (items.Count == 0) { list_container.transform.parent.parent.FindChild("no-tip").gameObject.SetActive(true); return; } list_container.transform.parent.parent.FindChild("no-tip").gameObject.SetActive(false); float starty = 450, len = 140; for (int i = 0; i < items.Count; i++) { DealBody item = items[i]; GameObject summary = NGUITools.AddChild(list_container, pref_item_summary); summary.transform.localPosition = new Vector3(0, starty, 0); summary.name = "summary" + i; GameObject flg_obj = item.seller ? summary.transform.FindChild("sell-flag").gameObject : summary.transform.FindChild("buy-flag").gameObject; flg_obj.SetActive(true); summary.AddComponent <DealUpdate>().Body = item; UIButton button_event = summary.transform.FindChild("open").GetComponent <UIButton>(); EventDelegate event_delegate = new EventDelegate(this, "deal_detail"); event_delegate.parameters[0] = new EventDelegate.Parameter(); event_delegate.parameters[0].obj = item; button_event.onClick.Add(event_delegate); UILabel label = summary.transform.FindChild("owner").GetComponent <UILabel>(); label.text = item.userName; starty -= len; } }
public void logic() { GameObject link = transform.FindChild("inputer").gameObject; if (link != null) { UIPopupList selectList = transform.GetComponent <UIPopupList>(); Transform label_tran = transform.FindChild("Label"); if (selectList.value.Equals("其他文交所") || selectList.value.Equals("其他") || selectList.value.Equals("其他银行")) { link.SetActive(true); if (label_tran != null) { label_tran.gameObject.SetActive(false); } MyUtilTools.ChangeLayer(link, gameObject.layer); } else { if (label_tran != null) { label_tran.gameObject.SetActive(true); } link.SetActive(false); } } }
public static void tip(string str, bool flag = false, EventDelegate doSomthing = null) { if (currentTip == null) { currentTip = GameObject.Find("pops").transform.FindChild("tip").gameObject; currentTip.SetActive(true); } UILabel label = currentTip.transform.FindChild("label-tip").gameObject.GetComponent <UILabel>(); label.text = str; if (!currentTip.activeSelf) { currentTip.SetActive(true); } UISprite sprite = currentTip.transform.FindChild("flag").gameObject.GetComponent <UISprite>(); sprite.spriteName = flag ? "Checkmark" : "X Mark"; Transform trans_base = currentTip.transform.parent.parent; for (int i = 0; i < trans_base.childCount; i++) { Transform sun = trans_base.GetChild(i); if (!sun.Equals(currentTip.transform.parent)) { MyUtilTools.changeAlpha(0.2f, sun.gameObject); } } CameraUtil.push(2, 3); if (doSomthing != null) { currentTip.GetComponent <DialogUtil>().needDoSmoething = doSomthing; } }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("AdminMemberSearch"); if (buffer != null) { int size = buffer.ReadInt(); if (size > 0) { selectIndex = 0; users.Clear(); for (int i = 0; i < size; i++) { MainData.UserData user = new MainData.UserData(); user.deserialize(buffer); users.Add(user); } refresh(); } else { DialogUtil.tip("查找不到相关数据"); } } buffer = MyUtilTools.tryToLogic("AdminUserResetPwd"); if (buffer != null) { DialogUtil.tip(buffer.ReadString(), true); } buffer = MyUtilTools.tryToLogic("AdminUserCommit"); if (buffer != null) { DialogUtil.tip("提交成功", true); } }
void Update() { bool flag = false; ByteBuffer buffer = MyUtilTools.tryToLogic("DealDel"); if (buffer != null) { DialogUtil.tip("撤销成功", true); } buffer = MyUtilTools.tryToLogic("RevertDel"); if (buffer != null) { DialogUtil.tip("操作成功", true); } buffer = MyUtilTools.tryToLogic("UserLook"); if (buffer != null) { dealEvent.toLook(buffer); } buffer = MyUtilTools.tryToLogic("DealIssue"); if (buffer != null) { DialogUtil.tip(buffer.ReadString(), true); } if (flag) { dealEvent.updateList(); } }
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); }
public float update(GameObject obj_item, bool fix = true) { obj_item.transform.FindChild("icon").GetComponent <UISprite>().spriteName = icon; UILabel user_name = obj_item.transform.FindChild("user").GetComponent <UILabel>(); if (!tar.Equals("null")) { user_name.text = userName + " [0000ef]回复[-] " + tar; } else { user_name.text = userName; } obj_item.transform.FindChild("time").GetComponent <UILabel>().text = time; UILabel content_label = obj_item.transform.FindChild("content").GetComponent <UILabel>(); content_label.text = context; int len = MyUtilTools.computeRow(content_label); content_label.height = len * (content_label.fontSize + content_label.spacingY); float a = (len * content_label.fontSize + (len - 1) * content_label.spacingY) / 2; content_label.transform.localPosition = new Vector3(60, -70 - a, 0); if (len % 2 != 0) { a += content_label.fontSize / 2; } obj_item.transform.FindChild("event").localPosition = new Vector3(0, -180 - a, 0); return(fix ? (290 + a) : 200); }
public static void confirm(string tip, EventDelegate sure, EventDelegate cancle) { if (currentConfirm != null) { return; } currentConfirm = GameObject.Find("pops").transform.FindChild("confirm").gameObject; currentConfirm.SetActive(true); UILabel label = currentConfirm.transform.FindChild("label-con").gameObject.GetComponent <UILabel>(); label.text = tip; UIButton button = currentConfirm.transform.FindChild("sure-con").gameObject.GetComponent <UIButton>(); button.onClick.Clear(); button.onClick.Add(sure); button = currentConfirm.transform.FindChild("cancle-con").gameObject.GetComponent <UIButton>(); button.onClick.Clear(); button.onClick.Add(cancle); CameraUtil.push(1, 3); Transform trans_base = currentConfirm.transform.parent.parent; for (int i = 0; i < trans_base.childCount; i++) { Transform sun = trans_base.GetChild(i); if (!sun.Equals(currentConfirm.transform.parent)) { MyUtilTools.changeAlpha(0.2f, sun.gameObject); } } }
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); }
void backFromShowAddresses() { Transform address_trans = needshow[0].transform.FindChild("address-body"); Transform list_trans = address_trans.FindChild("list"); if (list_trans.gameObject.activeSelf) { show(curShow, false); show(preShow, true); clears(); title.GetComponentInChildren <UILabel>().text = "个人中心"; callback = null; UILabel address_label = needshow[0].transform.FindChild("scroll").FindChild("body").FindChild("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 = "未绑定收货地址"; } } else { address_trans.FindChild("add").gameObject.SetActive(false); list_trans.gameObject.SetActive(true); UILabel label = title.GetComponentInChildren <UILabel>(); label.text = "我的收货地址"; refreshAddressList(); } }
void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("AddAccount"); if (buffer != null) { MainData.instance.user.bacnkAccount.deserialize(buffer); DialogUtil.tip("添加成功", true, uEvent.callback); } buffer = MyUtilTools.tryToLogic("SellerCommit"); if (buffer != null) { MainData.instance.user.seller.deserialize(buffer); DialogUtil.tip("申请成功", true, new EventDelegate(uEvent.backFromRZAndRefresh)); } buffer = MyUtilTools.tryToLogic("UserUpdate"); if (buffer != null) { MainData.instance.user.deserialize(buffer); uEvent.backToCenter(); } buffer = MyUtilTools.tryToLogic("AddressChange"); if (buffer != null) { byte type = buffer.ReadByte(); MainData.instance.user.deserialize(buffer); DialogUtil.tip(type == 1 ? "删除成功" : "添加成功", true, uEvent.callback); } }
void refreshAddressList() { Transform container = needshow[0].transform.FindChild("address-body").FindChild("list").FindChild("body").FindChild("container"); container.parent.GetComponent <UIPanel>().clipOffset = Vector2.zero; container.parent.localPosition = new Vector3(0, 0, 0); float startY = 430, len = 110; if (pref_address_list == null) { pref_address_list = Resources.Load <GameObject>("prefabs/address-list"); } MyUtilTools.clearChild(container, new string[] { "addMore" }); for (int i = 0; i < MainData.instance.user.addresses.Count; i++) { GameObject address = NGUITools.AddChild(container.gameObject, pref_address_list); address.AddComponent <UserAddressDel>().init(i, this); address.transform.localPosition = new Vector3(0, startY, 0); address.name = "address_" + i; UILabel label = address.transform.FindChild("value").GetComponent <UILabel>(); label.text = MainData.instance.user.addresses[i]; startY -= len; } container.FindChild("addMore").transform.localPosition = new Vector3(0, startY == 430 ? 0 : startY, 0); }
// Update is called once per frame void Update() { if (pushs.Count == 0) { return; } if (!ConfirmUtil.isConfirmShow() && !LoadUtil.isActivity() && !DialogUtil.isPopTips()) { if (!isOpen) { tryToOpenPush(); } } ByteBuffer buffer = MyUtilTools.tryToLogic("DealGrab"); if (buffer != null) { DialogUtil.tip("抢单成功", true); } buffer = MyUtilTools.tryToLogic("DealFavorite"); if (buffer != null) { int type = buffer.ReadInt(); int len = buffer.ReadInt(); MainData.instance.user.favorites.Clear(); for (int i = 0; i < len; i++) { long value = buffer.ReadLong(); MainData.instance.user.favorites.Add(value); } DialogUtil.tip(type == 0 ? "收藏成功" : "取消收藏成功", true); } }
void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("AddressChange"); if (buffer != null) { byte type = buffer.ReadByte(); MainData.instance.user.deserialize(buffer); DialogUtil.tip(type == 1 ? "删除成功" : "添加成功", true, new EventDelegate(infoEvent.refreshAddressList)); } if (isPressed) { count++; if (count > 50) { openPop(); count = 0; } } else { if (delete_obj.activeSelf) { popCount--; if (popCount <= 0) { delete_obj.SetActive(false); } } } }
void refresh() { leftContainer.parent.localPosition = Vector3.zero; leftContainer.parent.GetComponent <UIPanel>().clipOffset = Vector2.zero; MyUtilTools.clearChild(leftContainer); float y = 800f; for (int i = 0; i < datas.Count; i++) { MainData.UserData user = datas[i]; GameObject user_summary = NGUITools.AddChild(leftContainer.gameObject, MemberManager.pref_user_info); user_summary.transform.localPosition = new Vector3(-180, y, 0); user_summary.name = "" + i; user_summary.transform.FindChild("icon").GetComponent <UISprite>().spriteName = user.face; user_summary.transform.FindChild("name").GetComponent <UILabel>().text = user.nikeName; Transform select_trans = user_summary.transform.FindChild("select"); select_trans.FindChild("show").gameObject.SetActive(i == selectIndex); UIButton button = select_trans.GetComponent <UIButton>(); EventDelegate event_delegate = new EventDelegate(this, "select"); event_delegate.parameters[0] = new EventDelegate.Parameter(); event_delegate.parameters[0].obj = user_summary; button.onClick.Add(event_delegate); y -= 80; } refreshRight(); }
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("请选择要删除的邮件"); } } }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("OpenAccountApply"); if (buffer != null) { isUploaded = false; DialogUtil.tip("申请成功", true, new EventDelegate(backToCenter)); } /* * buffer = MyUtilTools.tryToLogic("Token"); * if (buffer != null) * { * startTime = DateTime.Now.Ticks / 10000000; * tokenButton.SetState(UIButtonColor.State.Disabled,true); * } * if (startTime > 0) * { * long now = DateTime.Now.Ticks / 10000000; * int fix = (int)(now - startTime); * if (fix >= 60) * { * initPhoneSend(); * } * else * { * tokenLabe.text = "重发(" + MyUtilTools.numToString(60 - fix) + ")秒"; * } * }*/ }
void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("BankAccountDel"); if (buffer != null) { DialogUtil.tip("删除成功", true, new EventDelegate(infoEvent.refreshAccountList)); } if (isPressed) { count++; if (count > 50) { openPop(); count = 0; } } else { if (delete_obj.activeSelf) { popCount--; if (popCount <= 0) { delete_obj.SetActive(false); } } } }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("FindPassword"); if (buffer != null) { tips_obj.SetActive(true); startTime = System.DateTime.Now.Ticks / 10000000; labe.color = Color.red; button.SetState(UIButtonColor.State.Disabled, true); } if (startTime > 0) { long now = System.DateTime.Now.Ticks / 10000000; long fix = now - startTime; if (fix >= 60) { init(); } else { labe.text = "剩余" + (60 - fix) + " 秒"; } } }
void refreshMessage(MainData.FriendBody friend) { MyUtilTools.clearChild(messageDetailContainer); List <MainData.MessageBody> messages = getRecentlyMessage(friend); messageStarty = 450; for (int i = messages.Count - 1; i >= 0; i--) { MainData.MessageBody message = messages[i]; initMessage(message); } UIPanel panel = messageDetailContainer.parent.GetComponent <UIPanel>(); if (messages.Count > 0) { float y = 450 - messageStarty - panel.baseClipRegion.w + 50; panel.clipOffset = new Vector2(0, -y); messageDetailContainer.parent.localPosition = new Vector3(0, y + 50, 0); } else { panel.clipOffset = Vector2.zero; messageDetailContainer.parent.localPosition = new Vector3(0, 50, 0); } }
void refresh() { 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); MyUtilTools.clearChild(container); float starty = 440; for (int i = 0; i < entitys.Count; i++) { RankEntity entity = entitys[i]; GameObject summary = NGUITools.AddChild(container.gameObject, pref_obj); summary.name = "rank_" + i; summary.transform.localPosition = new Vector3(0, starty, 0); UISprite icon = summary.transform.FindChild("icon").GetComponent <UISprite>(); icon.spriteName = entity.face; UILabel name = summary.transform.FindChild("name").GetComponent <UILabel>(); name.text = entity.nikeName; UILabel context = summary.transform.FindChild("content").GetComponent <UILabel>(); float stand = 1000000f; string worthStr = (entity.worth > stand ? (entity.worth / stand + "万") : (entity.worth + "")); context.text = "总共完成 " + entity.count + " 笔交易,成交总金额 " + worthStr + "元"; starty -= 130; } }
public void close() { gameObject.SetActive(false); panel.alpha = 1f; CameraUtil.pop(5); temp = null; MyUtilTools.clearChild(transform.FindChild("container")); }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("AdminResetPwd"); if (buffer != null) { DialogUtil.tip("密码重置成功", true); } }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("BuyDeploy"); if (buffer != null) { buy.backToCenter(); } }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("Issue"); if (buffer != null) { sell.backToCenter(); } }
// Update is called once per frame void Update() { ByteBuffer buffer = MyUtilTools.tryToLogic("Notice"); if (buffer != null) { decode(buffer.ReadString()); } }