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(); }
// 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 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; }
public static void deserializeAll(ByteBuffer data) { int size = data.ReadInt(); for (int i = 0; i < size; i++) { MainData.UserData user = new MainData.UserData(); user.deserialize(data); datas.Add(user); } }
void _reject() { ConfirmUtil.TryToDispear(); MainData.UserData user = datas[selectIndex]; ByteBuffer buffer = ByteBuffer.Allocate(1024); buffer.skip(4); buffer.WriteString("AdminSellerOpration"); buffer.WriteInt(1); buffer.WriteLong(user.id); NetUtil.getInstance.SendMessage(buffer); }
void refreshRight() { Transform container = transform.FindChild("right"); if (datas.Count == 0) { container.gameObject.SetActive(false); return; } container.gameObject.SetActive(true); MainData.UserData user = datas[selectIndex]; 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; } //认证信息 Transform rz = container.FindChild("rz-body"); rz.FindChild("type").FindChild("value").GetComponent <UILabel>().text = user.seller.type == 0 ? "个人" : "公司"; rz.FindChild("key").FindChild("value").GetComponent <UILabel>().text = user.seller.key; JustRun.Instance.loadPic(user.seller.picName, rz.FindChild("pic").FindChild("context").GetComponent <UITexture>()); }
// Update is called once per frame void Update() { int count_mjfk = 0, count_mjqr = 0; foreach (DealBody.Order order in orders) { if (order.state == 1) { count_mjfk++; } else if (order.state == 4) { count_mjqr++; } } bool flag = count_mjfk != mjfk.FindChild("suns").childCount || count_mjqr != mjqr.FindChild("suns").childCount; if (flag) { refresh(); } ByteBuffer buffer = MyUtilTools.tryToLogic("AdminLookUser"); if (buffer != null) { MainData.UserData user = new MainData.UserData(); user.deserialize(buffer); refreshUser(user); } buffer = MyUtilTools.tryToLogic("AdminOrderRevoke"); if (buffer != null) { DialogUtil.tip("撤销成功", true); } buffer = MyUtilTools.tryToLogic("AdminDealOrderUpdate"); if (buffer != null) { DialogUtil.tip("操作成功", true); } Transform right = transform.FindChild("right"); if (orders.Count == 0) { right.FindChild("order-help").gameObject.SetActive(false); right.FindChild("appraise").gameObject.SetActive(false); right.FindChild("user-look").gameObject.SetActive(false); return; } }
public static void deserializeModuleOne(ByteBuffer data) { byte flag = data.ReadByte(); MainData.UserData user = new MainData.UserData(); user.deserialize(data); if (flag == JustRun.ADD_FLAG) { datas.Add(user); } else if (flag == JustRun.DEL_FLAG) { for (int i = 0; i < datas.Count; i++) { MainData.UserData _user = datas[i]; if (user.id == _user.id) { datas.Remove(_user); break; } } } }
public void pass() { MainData.UserData user = datas[selectIndex]; ConfirmUtil.confirm("确定通过此用户的卖家认证?", _pass); }
void refreshRight() { Transform container = transform.FindChild("right"); if (users.Count == 0) { container.gameObject.SetActive(false); return; } else { container.gameObject.SetActive(true); } MainData.UserData user = users[selectIndex]; container.FindChild("account").FindChild("value").GetComponent <UILabel>().text = user.account; container.FindChild("nickName").FindChild("inputer").GetComponent <UIInput>().value = user.nikeName; container.FindChild("name").FindChild("inputer").GetComponent <UIInput>().value = user.realyName; container.FindChild("ident").FindChild("inputer").GetComponent <UIInput>().value = user.indentity; UIPopupList type = container.FindChild("type").FindChild("value").GetComponent <UIPopupList>(); UIPopupList title = container.FindChild("title").FindChild("value").GetComponent <UIPopupList>(); if (user.permission == 1) { type.value = "买家"; title.items.Clear(); title.items.Add("普通买家"); title.items.Add("高级买家"); } else if (user.permission == 2) { type.value = "卖家"; title.items.Clear(); title.items.Add("普通营销员"); title.items.Add("高级营销员"); title.items.Add("金牌营销员"); } title.value = user.title; container.FindChild("deposit").FindChild("inputer").GetComponent <UIInput>().value = user.deposit + ""; container.FindChild("deal").FindChild("inputer").GetComponent <UIInput>().value = user.credit.totalDealValue + ""; container.FindChild("credit-c").FindChild("inputer").GetComponent <UIInput>().value = user.credit.maxValue + ""; container.FindChild("credit-t").FindChild("inputer").GetComponent <UIInput>().value = user.credit.tempMaxValue + ""; container.FindChild("hp").FindChild("inputer").GetComponent <UIInput>().value = user.credit.hp + ""; container.FindChild("zp").FindChild("inputer").GetComponent <UIInput>().value = user.credit.zp + ""; container.FindChild("cp").FindChild("inputer").GetComponent <UIInput>().value = 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("inputer").GetComponent <UIInput>().value = user.breach + ""; Transform fh_body = container.FindChild("fh").FindChild("body"); UIInput reason_input = fh_body.FindChild("inputer").GetComponent <UIInput>(); reason_input.value = user.forbid.reason + ""; string nowDateStr = System.DateTime.Now.Year + "-" + System.DateTime.Now.Month + "-" + System.DateTime.Now.Day + " 23:59:59"; if (user.forbid.endTime.Equals("forever")) { reason_input.value = "永久封号"; fh_body.FindChild("time").FindChild("value").GetComponent <UILabel>().text = nowDateStr; } else if (user.forbid.endTime.Equals("null")) { reason_input.value = "未被封号"; fh_body.FindChild("time").FindChild("value").GetComponent <UILabel>().text = nowDateStr; } else { reason_input.value = 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("inputer").GetComponent <UIInput>().value = user.other; }