zhaoyang 2 vuotta sitten
vanhempi
commit
22320c2015

+ 2 - 26
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailySignView.cs

@@ -50,32 +50,8 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-
-            if (TimeHelper.ClientNow() < TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.refreshTime))
-            {
-                if (DateTime.Now.Day == 1)
-                {
-                    if (DateTime.Now.Month == 1)
-                    {
-                        _month = 12;
-                    }
-                    else
-                    {
-                        _month = DateTime.Now.Month - 1;
-                    }
-                    List<DailySignBonusCfg> cfgs = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month);
-                    _day = cfgs[cfgs.Count - 1].day;
-                }
-                else
-                {
-                    _day = DateTime.Now.Day - 1;
-                }
-            }
-            else
-            {
-                _month = DateTime.Now.Month;
-                _day = DateTime.Now.Day;
-            }
+            _month = TimeUtil.GetCurMonth();
+            _day = TimeUtil.GetCurDay();
             _ui.m_txtMonth.text = NumberUtil.GetOldChiniseNumberText(_month);
             UpdateSignView();
         }

+ 2 - 29
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailySupplyView.cs

@@ -57,35 +57,8 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            // _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("mrqd_bjbj");
-
-            // _valueBarController.OnShown();
-
-            if (TimeHelper.ClientNow() < TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.refreshTime))
-            {
-                if (DateTime.Now.Day == 1)
-                {
-                    if (DateTime.Now.Month == 1)
-                    {
-                        _month = 12;
-                    }
-                    else
-                    {
-                        _month = DateTime.Now.Month - 1;
-                    }
-                    List<DailySignBonusCfg> cfgs = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month);
-                    _day = cfgs[cfgs.Count - 1].day;
-                }
-                else
-                {
-                    _day = DateTime.Now.Day - 1;
-                }
-            }
-            else
-            {
-                _month = DateTime.Now.Month;
-                _day = DateTime.Now.Day;
-            }
+            _month = TimeUtil.GetCurMonth();
+            _day = TimeUtil.GetCurDay();
             UpdateSupplyView();
         }
 

+ 9 - 24
GameClient/Assets/Game/HotUpdate/Views/Store/StoreBlackCardRewardView.cs

@@ -43,24 +43,8 @@ namespace GFGGame
         {
             base.OnShown();
 
-
-            if (TimeHelper.ClientNow() < TimeUtil.GetCurDayTime(GlobalCfgArray.globalCfg.refreshTime))
-            {
-                if (DateTime.Now.Month == 1)
-                {
-                    _month = 12;
-                }
-                else
-                {
-                    _month = DateTime.Now.Month - 1;
-                }
-            }
-            else
-            {
-                _month = DateTime.Now.Month;
-            }
-            MonthlyCardCfg cardCfg = MonthlyCardCfgArray.Instance.GetCfg(MonthCardType.BlackGold);
-            _ui.m_list.numItems = cardCfg.clothesIdArr.Length;
+            _month = TimeUtil.GetCurMonth();
+            _ui.m_list.numItems = MonthlyCardClothesCfgArray.Instance.GetCfgsByyear(TimeUtil.GetCurYear()).Count;
         }
 
         protected override void OnHide()
@@ -77,15 +61,16 @@ namespace GFGGame
 
         private void RenderListItem(int index, GObject obj)
         {
-            MonthlyCardCfg cardCfg = MonthlyCardCfgArray.Instance.GetCfg(MonthCardType.BlackGold);
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cardCfg.clothesIdArr[index]);
 
-            UI_ListBlackRewardtem item = UI_ListBlackRewardtem.Proxy(obj);
 
+            UI_ListBlackRewardtem item = UI_ListBlackRewardtem.Proxy(obj);
+            MonthlyCardClothesCfg clothesCfg = MonthlyCardClothesCfgArray.Instance.GetCfgsByyear(TimeUtil.GetCurYear())[index];
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(clothesCfg.clothesArr[0]);
             item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
-            item.m_txtMonth.text = string.Format("{0}月", NumberUtil.GetChiniseNumberText(index + 1));
 
-            bool isCurMonth = index + 1 == _month;
+            item.m_txtMonth.text = string.Format("{0}月", clothesCfg.month);
+
+            bool isCurMonth = clothesCfg.month == _month;
             item.m_imgMask.visible = !isCurMonth;
             item.m_grpMonth.visible = isCurMonth;
             item.m_grpName.visible = isCurMonth;
@@ -94,7 +79,7 @@ namespace GFGGame
             {
                 item.target.onClick.Add(OnBtnGetClick);
             }
-            item.target.data = _month;
+            item.target.data = clothesCfg.month;
 
             UI_ListBlackRewardtem.ProxyEnd();
         }