Пример #1
0
        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();
            }
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        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();
        }
Пример #4
0
        /// <summary>
        /// 牌桌历史记录数据
        /// </summary>
        /// <param name="msg"></param>
        void GetHistoryTableItem(object msg)
        {
            if (msg == null)
            {
                TableNum = _tableNum;
                return;
            }
            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)
            {
                TeaTableItem item;
                if (_totalDatas.Count + objList.Count > Grid.transform.childCount)
                {
                    item = YxWindowUtils.CreateItem(TableItem, Grid.transform);
                }
                else
                {
                    item = _usedItemList[0];
                    _usedItemList.RemoveAt(0);
                }
                item.Id       = (_tableNum + 1).ToString();
                item.TeaPanel = this;
                item.SetTableState(TableState.Over);
                RoomInfoData roomInfo = new RoomInfoData();
                roomInfo.ParseData(info);
                if (TeaState == 2)
                {
                    item.CloseBt.SetActive(false);
                }
                item.UpdateView(roomInfo);
                _tableNum++;
            }
            TableNum = _tableNum;
            foreach (TeaTableItem item in _usedItemList)
            {
                if (item != null)
                {
                    DestroyImmediate(item.gameObject);
                }
            }
            if (Grid)
            {
                Grid.Reposition();
            }
        }
Пример #5
0
        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();
        }
Пример #6
0
        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)
            {
                TeaTableItem item;
                if (UsedItemList.Count > 0 && UsedItemList[0] != null)
                {
                    item = UsedItemList[0];
                    UsedItemList.RemoveAt(0);
                }
                else
                {
                    item = YxWindowUtils.CreateItem(TableItem, Grid.transform);
                }
                item.TeaPanel = this;
                item.SetTableState(TableState.Over);
                RoomInfoData roomInfo = new RoomInfoData();
                roomInfo.ParseData(info);
                item.UpdateView(roomInfo);
                TableNum++;
                ItemList.Add(item);
            }
            foreach (TeaTableItem item in UsedItemList)
            {
                if (item != null)
                {
                    Destroy(item.gameObject);
                }
            }
            if (Grid)
            {
                Grid.Reposition();
            }
        }