void GetTableItem(object msg) { Dictionary <string, object> dic = (Dictionary <string, object>)msg; if (dic.ContainsKey("totalCount")) { _totalCount = int.Parse(dic["totalCount"].ToString()); } object obj = dic["data"]; List <object> objList = (List <object>)obj; foreach (Dictionary <string, object> info in objList) { TeaRoomInfoItem item = YxWindowUtils.CreateItem(InfoItem, grid.transform); RoomInfoData roomInfo = new RoomInfoData(); roomInfo.ParseData(info); item.UpdateView(roomInfo); } grid.Reposition(); _request = false; if (ScrollView != null && _curPageNum == 2) { ScrollView.ResetPosition(); } }
private void BackHistoryList(object msg) { Dictionary <string, object> dic = (Dictionary <string, object>)msg; if (dic.ContainsKey("totalCount")) { _totalCount = int.Parse(dic["totalCount"].ToString()); } object obj = dic["data"]; List <object> objList = (List <object>)obj; foreach (Dictionary <string, object> info in objList) { TeaRoomInfoItem item = YxWindowUtils.CreateItem(InfoItem, grid.transform); item.SetIndex(_rowIndex++); item.TeaId = TeaId; item.JieSanBt.SetActive(false); RoomInfoData roomInfo = new RoomInfoData(); roomInfo.ParseData(info, true); item.UpdateView(roomInfo); } grid.Reposition(); _request = false; if (ScrollView != null && _curPageNum == 2) { ScrollView.ResetPosition(); } }
void GetTableItem(object msg) { Dictionary <string, object> dic = (Dictionary <string, object>)msg; object obj = dic["history"]; List <object> objList = (List <object>)obj; foreach (Dictionary <string, object> info in objList) { TeaRoomInfoItem item = YxWindowUtils.CreateItem(InfoItem, grid.transform); RoomInfoData roomInfo = new RoomInfoData(); roomInfo.ParseData(info); item.UpdateView(roomInfo); } grid.Reposition(); }
private void BackHistoryList(object msg) { int RowIndex = 1; Dictionary <string, object> dic = (Dictionary <string, object>)msg; object obj = dic["history"]; List <object> objList = (List <object>)obj; foreach (Dictionary <string, object> info in objList) { TeaRoomInfoItem item = YxWindowUtils.CreateItem(InfoItem, grid.transform); item.SetIndex(RowIndex++); item.TeaId = TeaId; item.JieSanBt.SetActive(false); RoomInfoData roomInfo = new RoomInfoData(); roomInfo.ParseData(info, true); item.UpdateView(roomInfo); } grid.Reposition(); }
public void CreateUserInfoWindow(TeaRoomInfoItem item) { YxWindow obj = CreateChildWindow("TeaUserInfoPanel"); TeaUserInfoPanel infoPanel = obj.GetComponent <TeaUserInfoPanel>(); infoPanel.GameName.text = item.RealGameName; infoPanel.RoomId.text = item.RoomId.text; infoPanel.RoundAndUse.text = string.Format("{0} {1}房卡", item.RealGameRound, item.UseNum); string rule = item.InfoStr; string[] strList = rule.Split(' '); rule = ""; for (int i = 0; i < strList.Length; i++) { if (strList[i] == "") { continue; } if (i == strList.Length - 1) { rule += strList[i]; continue; } rule += strList[i] + "\n"; } infoPanel.RuleInfo.text = rule; for (int i = 0; i < item.Golds.Length; i++) { infoPanel.UserNames[i].text = item.Names[i].text; infoPanel.UserNames[i].gameObject.SetActive(true); infoPanel.Scores[i].text = YxUtiles.GetShowNumber(long.Parse(item.Golds[i])).ToString(); infoPanel.Scores[i].gameObject.SetActive(true); infoPanel.Heads[i].mainTexture = item.Avatars[i].GetTexture(); infoPanel.Heads[i].gameObject.SetActive(true); if (infoPanel.Ids.Length != 0) { infoPanel.Ids[i].text = item.Ids[i]; } } }