public void updateItemLogoByItemId(bool isShowButton, int productId = -1) { int key = ActivityTossDiscountManager.Instance.CurrentShangPinId; if (productId != -1) { key = productId; } ShangPin shangPin = null; if (DataReader <ShangPin> .Contains(key)) { shangPin = DataReader <ShangPin> .Get(key); } if (shangPin != null) { base.FindTransform("ButtonAlert").GetComponent <ButtonCustom>().get_gameObject().SetActive(isShowButton); base.FindTransform("ButtonSelectAlert").GetComponent <ButtonCustom>().get_gameObject().SetActive(!isShowButton); ResourceManager.SetSprite(base.FindTransform("ButtonAlert").FindChild("SelectProLogo2").GetComponent <Image>(), GameDataUtils.GetItemIcon(shangPin.goodsPool)); Items items = DataReader <Items> .Get(shangPin.goodsPool); if (items != null) { base.FindTransform("ButtonAlert").FindChild("Name").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(items.name, false)); } else { Debug.LogWarning("Items表没有此数据" + shangPin.goodsPool); } } base.FindTransform("ButtonAlert").FindChild("SelectProTitle").GetComponent <Text>().get_gameObject().SetActive(shangPin == null); }
public void UpdateItem(DiscountItemsInfo info, int type) { this.currentDiscountItemsInfo = info; this.currentShangPinId = info.id; this.selectType = type; base.get_transform().FindChild("ButtonChangePro").GetComponent <ButtonCustom>().get_gameObject().SetActive(false); ShangPin shangPin = DataReader <ShangPin> .Get(this.currentShangPinId); if (shangPin != null) { List <int> discount = shangPin.discount; if (discount.get_Count() > 0) { base.get_transform().FindChild("MinZheKouValue").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(1006008, false), (float)discount.get_Item(discount.get_Count() - 1) / 10f)); } else { base.get_transform().FindChild("MinZheKouValue").GetComponent <Text>().set_text(string.Empty); } base.get_transform().FindChild("ItemFlag").get_gameObject().SetActive(info.num <= 0); this.productSum.set_text(Utils.SwitchChineseNumber((long)info.num, 1)); ResourceManager.SetSprite(this.imgIcon, GameDataUtils.GetItemIcon(shangPin.goodsPool)); this.textCount.set_text("x" + shangPin.diamond); Items items = DataReader <Items> .Get(shangPin.goodsPool); if (items != null) { this.productName.set_text(GameDataUtils.GetChineseContent(items.name, false)); } else { Debug.LogWarning("Items表没有此数据" + shangPin.goodsPool); } int count = shangPin.discount.get_Count(); float num = (float)shangPin.discount.get_Item(count - 1); float num2 = info.discount / 10f; if (num2 < 10f) { int num3 = (int)Math.Ceiling((double)((float)shangPin.diamond * (num2 / 10f))); this.textCount.set_text("x" + num3); this.zhekouValue.set_text(num2 + "折"); this.zhekouBg.get_gameObject().SetActive(true); } else { this.zhekouBg.get_gameObject().SetActive(false); } } else { Debug.LogWarning("ShangPin表没有此数据" + this.currentShangPinId); } }
static void get(string sku) { try { string name = ShangPin.Search("http://nzdb.dian.nz/search/result?keyword=", sku); } catch (Exception ex) { L.File.ErrorFormat("sku={0} 错误={1}", sku, ex); } finally { ShangPin.itemCount++; } }
private void OnClickHeadAndBackLogic(bool isShow) { base.FindTransform("ResultBg").get_gameObject().SetActive(false); long num = BackpackManager.Instance.OnGetGoodCount(ActivityTossDiscountManager.gameNeedItemId); if (num <= 0L) { DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(1005022, false), "您的游戏券不够!", delegate { InstanceManager.TryPause(); }, GameDataUtils.GetNoticeText(102), "button_orange_1", null); return; } DiscountItemsInfo discountInfoById = ActivityTossDiscountManager.Instance.getDiscountInfoById(ActivityTossDiscountManager.Instance.CurrentShangPinId); if (discountInfoById.num <= 0) { DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(1005022, false), "该商品已经售完!", delegate { InstanceManager.TryPause(); }, GameDataUtils.GetNoticeText(102), "button_orange_1", null); return; } ShangPin shangPin = DataReader <ShangPin> .Get(ActivityTossDiscountManager.Instance.CurrentShangPinId); if (shangPin == null) { Debug.LogWarning("配置表没有此商品,id=" + shangPin.Id); } int count = shangPin.discount.get_Count(); float num2 = (float)shangPin.discount.get_Item(count - 1); float discountDataById = ActivityTossDiscountManager.Instance.getDiscountDataById(ActivityTossDiscountManager.Instance.CurrentShangPinId); if (discountDataById <= num2) { DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(1005022, false), GameDataUtils.GetChineseContent(1006005, false), delegate { InstanceManager.TryPause(); }, GameDataUtils.GetNoticeText(102), "button_orange_1", null); } else { this.sendFlipCoinReqLogic(isShow); } }
public void cleanDiscountData() { for (int i = 0; i < this.dataList.itemsInfo.get_Count(); i++) { DiscountItemsInfo discountItemsInfo = this.dataList.itemsInfo.get_Item(i); discountItemsInfo.isOpt = false; ShangPin shangPin = DataReader <ShangPin> .Get(discountItemsInfo.id); if (shangPin != null) { List <int> discount = shangPin.discount; if (discount.get_Count() > 0) { discountItemsInfo.discount = (float)discount.get_Item(0); } } } }
public void updateFlipCoinRes(FlipCoinRes flipCoinRes) { if (flipCoinRes != null) { if (this.spineId != -1) { FXSpineManager.Instance.DeleteSpine(this.spineId, true); } Text component = base.FindTransform("ProductLogoAndCount").FindChild("Count").GetComponent <Text>(); long num = BackpackManager.Instance.OnGetGoodCount(ActivityTossDiscountManager.gameNeedItemId); component.set_text("x" + num); int id = flipCoinRes.id; int discount = flipCoinRes.discount; bool result = flipCoinRes.result; ActivityTossDiscountManager.Instance.FlipCoinResult = null; if (DataReader <ShangPin> .Contains(id)) { ShangPin shangPin = DataReader <ShangPin> .Get(id); } int fxId; if (result) { this.setProductDiscountByPID(id, discount); if (ActivityTossDiscountManager.Instance.IsSelectHead) { fxId = 4702; } else { fxId = 4701; } ResourceManager.SetSprite(base.FindTransform("ResultBg").FindChild("ResultBgLogo").GetComponent <Image>(), ResourceManager.GetIconSprite("zksd_cg")); float num2 = (float)discount / 10f; if (num2 != 0f && num2 < 10f) { base.FindTransform("ResultBg").FindChild("GetZheKou").GetComponent <Text>().set_text("获得折扣:" + num2 + "折"); } } else { if (ActivityTossDiscountManager.Instance.IsSelectHead) { fxId = 4701; } else { fxId = 4702; } ResourceManager.SetSprite(base.FindTransform("ResultBg").FindChild("ResultBgLogo").GetComponent <Image>(), ResourceManager.GetIconSprite("zksd_sb")); base.FindTransform("ResultBg").FindChild("GetZheKou").GetComponent <Text>().set_text("获得折扣:无"); } this.playYingBiActionState(fxId, this.DiscountAction, null, 0f, 0f); this.discountActionId = FXSpineManager.Instance.PlaySpine(4704, this.DiscountAction, "ActivityTossDiscountUI", 3100, delegate { if (this.discountActionId != -1) { FXSpineManager.Instance.DeleteSpine(this.discountActionId, true); } TimerHeap.DelTimer(this.straightTimerResultID); this.straightTimerResultID = TimerHeap.AddTimer(200u, 0, new Action(this.playResultEffect)); }, "UI", 0f, 80f, 1f, 1f, false, FXMaskLayer.MaskState.None); } }
private void OnClickPanel(GameObject go) { if (this.currentDiscountItemsInfo.num <= 0) { DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(1005022, false), "该商品已经售完!", delegate { InstanceManager.TryPause(); }, GameDataUtils.GetNoticeText(102), "button_orange_1", null); return; } if (this.selectType == ActivityTossDiscountManager.selectProductSelectType) { int listDataIndexByID = ActivityTossDiscountManager.Instance.getListDataIndexByID(ActivityTossDiscountManager.Instance.CurrentShangPinId); if (listDataIndexByID != -1) { } this.selectProductLogic(); } else if (this.selectType == ActivityTossDiscountManager.payProductSelectType) { int key = this.currentShangPinId; ShangPin shangPin = null; if (DataReader <ShangPin> .Contains(key)) { shangPin = DataReader <ShangPin> .Get(key); } if (shangPin != null) { UIBase uIBase = UIManagerControl.Instance.OpenUI("BuyUI", UINodesManager.TopUIRoot, false, UIType.NonPush); uIBase.get_transform().SetAsLastSibling(); BuyUIViewModel.Instance.BuyCallback = delegate(int count) { this.DoOK(count); }; float discountDataById = ActivityTossDiscountManager.Instance.getDiscountDataById(shangPin.Id); float num = discountDataById / 10f; int price; if (num < 10f) { price = (int)Math.Ceiling((double)(num / 10f * (float)shangPin.diamond)); } else { price = shangPin.diamond; } BuyUIViewModel.Instance.RefreshInfo(shangPin.goodsPool, shangPin.num, price, 1); if (this.currentShangPinId == ActivityTossDiscountManager.Instance.CurrentShangPinId) { BuyUIViewModel.Instance.BtnOKName = GameDataUtils.GetChineseContent(508013, false); } else { BuyUIViewModel.Instance.BtnOKName = "获取折扣"; } } if (ActivityTossDiscountListAlert.Instance != null) { ActivityTossDiscountListAlert.Instance.RefreshUI(); } } }