Ejemplo n.º 1
0
        protected override void OnFreshView()
        {
            base.OnFreshView();
            if (Data is string) // 比赛类型
            {
                var param = new Dictionary <string, object>();
                param["type"] = Data.ToString();
                CurTwManager.SendAction(ActionName, param, UpdateView);
                return;
            }
            YxWindowUtils.CreateMonoParent(PrefabGridAdapter, ref _gridAdapter);
            //数据
            var dict = GetData <Dictionary <string, object> >();

            if (dict == null)
            {
                return;
            }
            List <object> list = null;

            if (dict.Parse("list", ref list))
            {
                FreshItems(list);
            }
        }
Ejemplo n.º 2
0
 private void DealContent()
 {
     RankItemView.RankType = RankTypes;
     if (_curTabData != null)
     {
         RankItemView.ItemNotice = _curTabData.Notice;
     }
     RankItemView.TotalCount = _data.RankCount;
     if (ShowPanel)
     {
         SpringPanel.Begin(ShowPanel.gameObject, Vector3.zero, int.MaxValue);
     }
     YxWindowUtils.CreateMonoParent(GridPrefab, ref _itemGrid);
     foreach (var rankItemData in _data.RankDatas)
     {
         var item = YxWindowUtils.CreateItem(PrefabItem, _itemGrid.transform);
         item.UpdateView(rankItemData);
     }
     _itemGrid.repositionNow = true;
     if (SelfRankItem == null)
     {
         return;
     }
     SelfRankItem.UpdateView(_data.SelfRankDatas);
 }
Ejemplo n.º 3
0
        protected override void OnFreshView()
        {
            var goodsDict = GetData <Dictionary <string, object> >();

            YxWindowUtils.CreateMonoParent(GridPerfab, ref _goodsgrid, null, "goodsContainer");
            if (goodsDict == null)
            {
                return;
            }
            if (!goodsDict.ContainsKey("goods"))
            {
                return;
            }
            var type  = goodsDict.ContainsKey("type") ? goodsDict["type"].ToString() : "";
            var goods = goodsDict["goods"] as Dictionary <string, object>;

            if (goods == null)
            {
                return;
            }
            var gridTs = _goodsgrid.transform;

            foreach (var keyValue in goods)
            {
                var item = YxWindowUtils.CreateItem(ItemViewPerfab, gridTs);
                item.Id = type;
                item.UpdateView(keyValue.Value);
            }
            _goodsgrid.Reposition();
        }
Ejemplo n.º 4
0
        protected override void OnFreshView()
        {
            if (!IsShow())
            {
                return;
            }
            var gdata = App.GetGameData <SlyzGameData>();

            if (gdata == null)
            {
                return;
            }
            // 先删除上次添加的ITEM
            YxWindowUtils.CreateMonoParent(GridPrefab, ref _curGrid, ScrollView.transform);
            var gridTs = _curGrid.transform;
            // 本次添加ITEM
            var pList = gdata.PrizeList;
            var len   = pList.Count;

            for (var i = 0; i < len; i++)
            {
                var prefItem = YxWindowUtils.CreateItem(PrizeItemPrefab, gridTs);
                prefItem.UpdateView(pList[i]);
            }

            _curGrid.repositionNow = true;
            _curGrid.Reposition();
            ScrollView.ResetPosition();
        }
Ejemplo n.º 5
0
        protected void UpdateTabs(IList <TabData> tabDatas)
        {
            if (TabelGridPerfab == null)
            {
                return;
            }
            YxWindowUtils.CreateMonoParent(TabelGridPerfab, ref _tabGrid);
            var count  = tabDatas.Count;
            var gridTs = _tabGrid.transform;

            _tabItems.Clear();
            for (var i = 0; i < count; i++)
            {
                if ((TabSatate & (1 << i)) == 0)
                {
                    continue;
                }
                var data = tabDatas[i];
                var item = YxWindowUtils.CreateItem(PerfabTableItem, gridTs);
                item.UpdateView(data);
                item.name    = i.ToString(CultureInfo.InvariantCulture);
                _tabItems[i] = item;
            }
            if (TabsView != null)
            {
                TabsView.localScale = _tabItems.Count < 2 ? new Vector3(0, 1, 1) : Vector3.one;
            }
            StartCoroutine(SelectFirst());
            _tabGrid.repositionNow = true;
            _tabGrid.Reposition();
        }
Ejemplo n.º 6
0
        protected override void OnFreshView()
        {
            if (!IsShow())
            {
                return;
            }
            var gdata = App.GetGameData <SlyzGameData>();

            if (gdata == null)
            {
                return;
            }
            YxWindowUtils.CreateMonoParent(GridPrefab, ref _curGrid);
            var gridTs = _curGrid.gameObject.transform;
            var list   = gdata.StartData.CardStatistics;
            var len    = list.Count;

            for (var i = 0; i < len; i++)
            {
                var item = YxWindowUtils.CreateItem(ItemPrefab, gridTs);
                item.UpdateView(list[i]);
            }
            _curGrid.repositionNow = true;
            if (ScrollView != null)
            {
                ScrollView.ResetPosition();
            }
        }
Ejemplo n.º 7
0
        protected override void OnFreshView()
        {
            UpUserInfo();
            base.OnFreshView();
            var back = UserInfoModel.Instance.BackPack;
            var keys = back.GetKeys();

            YxWindowUtils.CreateMonoParent(ItemGridPerfab, ref _itemGrid);
            var ts = _itemGrid.transform;

            foreach (var key in keys)
            {
                var count = back.GetItem(key);
                if (count < 1)
                {
                    continue;
                }
                var item = YxWindowUtils.CreateItem(ItemPerfab, ts);
                item.UpdateView();
            }
            if (_itemGrid is YxNguiGrid)
            {
                var iGrid = _itemGrid as YxNguiGrid;
                iGrid.Makeup();
            }
            _itemGrid.repositionNow = true;
            _itemGrid.Reposition();
        }
Ejemplo n.º 8
0
        protected override void OnFreshView()
        {
            base.OnFreshView();

            YxWindowUtils.CreateMonoParent(GridPrefab, ref _gridprefGrid);
            var data = App.GetGameData <BjlGameData>().TrendConfig;
            var list = data.HistoryData;

            if (list == null)
            {
                return;
            }

            if (Inverted)
            {
                for (int i = list.Count - 1; i >= 0; i--)
                {
                    CreateItem(list[i]);
                }
            }
            else
            {
                foreach (var item in list)
                {
                    CreateItem(item);
                }
            }

            _gridprefGrid.Reposition();
        }
Ejemplo n.º 9
0
        private void UpdateViewData(object msg)
        {
            YxWindowUtils.CreateMonoParent(ItemGridPrefab, ref _itemGrid);
            var info = msg as Dictionary <string, object>;

            if (info == null)
            {
                return;
            }
            var data = info.ContainsKey("data") ? info["data"] : null;
            var list = data as List <object>;

            if (list == null || list.Count < 1)
            {
                if (NoDataSign != null)
                {
                    NoDataSign.SetActive(true);
                }
                return;
            }
            if (NoDataSign != null)
            {
                NoDataSign.SetActive(false);
            }
            OnSetItems(list, _itemGrid);
        }
Ejemplo n.º 10
0
        protected override void OnFreshView()
        {
            YxWindowUtils.CreateMonoParent(GridPrefab, ref Grid);
            var resultCtrl = App.GetGameManager <BrnnGameManager>().ResultListCtrl;
            var list       = resultCtrl.HistoryData;

            if (list == null)
            {
                return;
            }

            if (Inverted)
            {
                for (int i = list.Count - 1; i >= 0; i--)
                {
                    CreateItem(list[i]);
                }
            }
            else
            {
                foreach (var data in list)
                {
                    CreateItem(data);
                }
            }

            Grid.repositionNow = true;
            Grid.Reposition();
        }
Ejemplo n.º 11
0
        protected override void OnFreshView()
        {
            YxWindowUtils.CreateMonoParent(ItemGridPrefab, ref _itemGrid);
            var dict = Data as IDictionary;

            if (dict == null)
            {
                return;
            }
            _roomId = dict.Contains("room_id") ? dict["room_id"].ToString() : "";
            if (RoomId != null)
            {
                RoomId.text = _roomId;
            }
            if (Round != null)
            {
                Round.text = dict.Contains("round") ? dict["round"].ToString() : "";
            }
            if (BetAnte != null)
            {
                BetAnte.text = dict.Contains("betAnte") ? dict["betAnte"].ToString() : "";
            }
            if (GameType != null)
            {
                GameType.text = dict.Contains("gameType") ? dict["gameType"].ToString() : "";
            }
            _gameKey  = dict.Contains("game_key_c") ? dict["game_key_c"].ToString() : "";
            _function = dict.Contains("function") ? dict["function"].ToString() : "";
            if (CreateDt != null)
            {
                CreateDt.text = dict.Contains("create_dt") ? dict["create_dt"].ToString() : "----/--/-- --:--:--";
            }
            if (DetialBtn.GetComponent <UIButton>().onClick.Count == 0)
            {
                DetialBtn.GetComponent <UIButton>().onClick.Add(new EventDelegate(OnDetialBtn));
            }
            if (!dict.Contains("overinfo"))
            {
                return;
            }
            if (!(dict["overinfo"] is List <object>))
            {
                return;
            }
            var infoLists = dict["overinfo"] as List <object>;

            foreach (var infoList in infoLists)
            {
                if (!(infoList is Dictionary <string, object>))
                {
                    continue;
                }
                var infoData = infoList as Dictionary <string, object>;
                var item     = YxWindowUtils.CreateItem(NnRecordItem, _itemGrid.transform);
                item.UpdateView(infoData);
            }
            _itemGrid.repositionNow = true;
        }
Ejemplo n.º 12
0
        protected virtual void RefreahAll(UserListType ult, int front = 0)
        {
            switch (ult)
            {
            case UserListType.User:
            {
                if (Players == null || Players.Length <= 0)
                {
                    if (_gridusers != null)
                    {
                        Destroy(_gridusers.gameObject);
                    }
                    return;
                }
                YxWindowUtils.CreateMonoParent(GridUsersPrefab, ref _gridusers);
                var len = front > 0 && front < Players.Length ? front : Players.Length;
                for (var i = 0; i < len; i++)
                {
                    var userItem = YxWindowUtils.CreateItem(UserItemPrefab, _gridusers.transform);
                    userItem.SetInfo(Players[i]);
                }
                _gridusers.gameObject.SetActive(_curUserlistType == ult);
                _gridusers.Reposition();
            }
            break;

            case UserListType.Banker:
            {
                if (BankersInfo == null || BankersInfo.Length <= 0)
                {
                    if (_gridBankers != null)
                    {
                        Destroy(_gridBankers.gameObject);
                    }
                    return;
                }
                YxWindowUtils.CreateMonoParent(GridBankersPrefab, ref _gridBankers);
                var bseat = App.GetGameData <BjlGameData>().BankSeat;
                var len   = front > 0 && front < BankersInfo.Length ? front : BankersInfo.Length;
                for (var i = 0; i < len; i++)
                {
                    var banker   = BankersInfo[i];
                    var userItem = YxWindowUtils.CreateItem(BankerItemPrefab, _gridBankers.transform);
                    userItem.SetInfo(banker, banker.Seat == bseat);
                }
                _gridBankers.gameObject.SetActive(_curUserlistType == ult);
                _gridBankers.Reposition();
            }
            break;
            }
        }
Ejemplo n.º 13
0
        protected override void OnFreshView()
        {
            List <object> list;

            if (Data is Dictionary <string, object> )
            {
                Dictionary <string, object> dic = (Dictionary <string, object>)Data;
                if (dic.ContainsKey("data"))
                {
                    list = dic["data"] as List <object>;
                }
                else
                {
                    list = null;
                }
            }
            else
            {
                list = Data as List <object>;
            }
            if (list == null)
            {
                return;
            }
            SpringPanel.Begin(ScrollView.gameObject, Vector3.zero, int.MaxValue);
            var count = list.Count;

            YxWindowUtils.CreateMonoParent(ItemsGridPrefab, ref _itemGrid);
            _itemGrid.onCustomSort = OnCustomSort;
            var tsParent = _itemGrid.transform;

            for (var i = 0; i < count; i++)
            {
                var obj  = list[i];
                var dict = obj as Dictionary <string, object>;
                if (dict == null)
                {
                    continue;
                }
                var item = YxWindowUtils.CreateItem(RewardItemPrefab, tsParent);
                var data = new RewardItemData(dict);
                item.UpdateViewWithCallBack(data, UpdateGrid);
            }
            UpdateGrid();
            if (ScrollView != null)
            {
                ScrollView.ResetPosition();
            }
        }
Ejemplo n.º 14
0
        private void UpdateViewData(object msg)
        {
            YxWindowUtils.CreateMonoParent(ItemGridPrefab, ref _itemGrid);
            var dict = msg as Dictionary <string, object>;

            if (dict == null)
            {
                return;
            }
            if (dict.ContainsKey("detail"))
            {
                var list   = dict["detail"] as List <object>;
                var weburl = "";
                if (dict.ContainsKey("web_host"))
                {
                    var temp = dict["web_host"];
                    weburl = temp.ToString();
                }
                if (list != null)
                {
                    var count = list.Count;
                    for (var i = 0; i < count; i++)
                    {
                        var obj = list[i];
                        if (!(obj is Dictionary <string, object>))
                        {
                            continue;
                        }
                        var cgdDict = obj as Dictionary <string, object>;
                        var item    = YxWindowUtils.CreateItem(ItemPrefab, _itemGrid.transform);
                        var cgdData = new CombatGainsDetailItemData(cgdDict)
                        {
                            Index   = (i + 1).ToString(),
                            WebHost = weburl
                        };
                        item.UpdateView(cgdData);
                    }
                }
            }
            if (dict.ContainsKey("room_id"))
            {
            }
            _itemGrid.repositionNow = true;
            _itemGrid.Reposition();
        }
Ejemplo n.º 15
0
        private void UpdateViewData(object msg)
        {
            YxWindowUtils.CreateMonoParent(ItemGridPrefab, ref _itemGrid);
            var list = msg as List <object>;

            if (list == null || list.Count < 1)
            {
                if (NoDataSign != null)
                {
                    NoDataSign.SetActive(true);
                }
                return;
            }
            if (NoDataSign != null)
            {
                NoDataSign.SetActive(false);
            }
            OnSetItems(list, _itemGrid);
        }
Ejemplo n.º 16
0
        protected override void OnFreshView()
        {
            base.OnFreshView();
            var dict = GetData <Dictionary <string, object> >();

            if (dict == null)
            {
                OnChangeState(false);
                return;
            }
            if (!dict.ContainsKey("data"))
            {
                OnChangeState(false);
                return;
            }
            var list = dict["data"] as List <object>;

            if (list == null || list.Count <= 0)
            {
                OnChangeState(false);
                return;
            }
            OnChangeState(true);
            var count = list.Count;

            YxWindowUtils.CreateMonoParent(PrefabGrid, ref _grid, PrefabGrid.transform.parent);
            var itemParent = _grid.transform;

            for (var i = 0; i < count; i++)
            {
                var itemData = list[i];
                var info     = new PromoteExtractRecordInfo();
                info.Parse(itemData);
                var item = CreateItem(itemParent);
                item.UpdateView(info);
            }
            _grid.Reposition();
        }
Ejemplo n.º 17
0
        protected override void OnFreshView()
        {
            base.OnFreshView();
            if (!IsShow())
            {
                return;
            }
            var gdata      = App.GetGameData <SlyzGameData>();
            var cardRecord = gdata.StartData.CardRecord;

            YxWindowUtils.CreateMonoParent(Grid, ref _itemGridParent, ScrollView.transform);
            var gridTs = _itemGridParent.transform;
            var len    = cardRecord.Count;

            for (var i = 0; i < len; i++)
            {
                var record = cardRecord[i];
                var item   = YxWindowUtils.CreateItem(ItemPrefab, gridTs);
                item.UpdateView(record);
            }
            _itemGridParent.repositionNow = true;
            _itemGridParent.Reposition();
        }
Ejemplo n.º 18
0
        private void UpdatePayTypes()
        {
            YxWindowUtils.CreateMonoParent(PrefabPayItemGrid, ref _payItemGrid);
            if (PayTypeList == null)
            {
                Close();
                return;
            }
            var len = PayTypeList.Count;

            if (len == 1 && NeedDirectPay)
            {
                var payInfo = new YxPayInfo();
                if (payInfo.Parse(PayTypeList[0]))
                {
                    OnPayClick(GetData <YxGoods>(), payInfo);
                }
            }
            var gridTs = _payItemGrid.transform;

            for (var i = 0; i < len; i++)
            {
                var dict = PayTypeList[i] as Dictionary <string, object>;
                if (dict == null)
                {
                    continue;
                }
                var payInfo = new YxPayInfo();
                if (!payInfo.Parse(PayTypeList[i]))
                {
                    continue;
                }
                var item = YxWindowUtils.CreateItem(PrefabPayItem, gridTs);
                item.UpdateView(payInfo);
            }
            _payItemGrid.Reposition();
        }
Ejemplo n.º 19
0
 protected override void OnFreshView()
 {
     YxWindowUtils.CreateMonoParent(GridPrefab, ref _grid);
     var itemData = GetData<GpsMoreItemData>();
     if (itemData == null) return;
     var gridTs = _grid.transform;
     var localPosition = gridTs.localPosition;
     localPosition.y = -ItemPadding.y;
     gridTs.localPosition = localPosition;
     SetTitle(itemData.Title);
     SetTitleBg(itemData.TitleType);
     var list = itemData.List;
     var count = list.Count;
     for (var i = 0; i < count; i++)
     {
         var info = list[i];
         if(info==null)continue;
         var item = YxWindowUtils.CreateItem(ItemViewPrefab, gridTs);
         item.UpdateView(info);
     }
     _grid.UpdateGrid();
     MackUp();
     CallBack(itemData.Id);
 }