public void OnConvert(RewardItemView item) { RewardItemData data = item.GetData <RewardItemData>(); switch (data.Type) { case 0: var win = CreateChildWindow("DefAddressWindow"); if (win == null) { return; } win.UpdateViewWithCallBack(data.Id, item.UpdateBtns); break; case 1: case 2: Facade.Instance <TwManger>().SendAction("userAddress_yr", new Dictionary <string, object>() { { "id", data.Id } }, msg => { item.UpdateBtns(null); ShowRewardInfo(msg); }); break; } }
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.CreateItemGrid(ItemsGridPrefab, ref _itemGrid); _itemGrid.onCustomSort = OnCustomSort; var tsParent = _itemGrid.transform; for (var i = 0; i < count; i++) { var obj = list[i]; if (obj == null) { continue; } 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(); } }
public void OnShowInfo(RewardItemView item) { RewardItemData data = item.GetData <RewardItemData>(); Facade.Instance <TwManger>().SendAction("userAddress_yr", new Dictionary <string, object>() { { "id", data.Id } }, mes => { ShowRewardInfo(mes); }); }