void tryToLoadDeal(MainData.SimpleOrderModule module) { ByteBuffer buffer = ByteBuffer.Allocate(1024); buffer.skip(4); buffer.WriteString("LookDealOrder"); buffer.WriteLong(module.dealId); buffer.WriteLong(module.orderId);//编号 NetUtil.getInstance.SendMessage(buffer); }
void refresh() { MyUtilTools.clearChild(transform); float len = 140, start = 180; for (int i = 0; i < MainData.instance.user.recentOrders.Count; i++) { MainData.SimpleOrderModule module = MainData.instance.user.recentOrders[i]; GameObject summary = NGUITools.AddChild(gameObject, pref_simple); summary.transform.localPosition = new Vector3(0, start, 0); summary.name = "module_" + i; UILabel content = summary.transform.FindChild("title").GetComponent <UILabel>(); content.text = module.content; UILabel time = summary.transform.FindChild("timeLable").GetComponent <UILabel>(); time.text = module.time; UIButton button = summary.transform.FindChild("open").GetComponent <UIButton>(); EventDelegate eventDelegate = new EventDelegate(this, "tryToLoadDeal"); eventDelegate.parameters[0] = new EventDelegate.Parameter(); eventDelegate.parameters[0].obj = module; button.onClick.Add(eventDelegate); start -= len; } }