|
@@ -12,7 +12,7 @@ namespace GFGGame
|
|
private ValueBarController _valueBarController;
|
|
private ValueBarController _valueBarController;
|
|
private List<ShopCfg> _shopCfgs;
|
|
private List<ShopCfg> _shopCfgs;
|
|
private int menu2;
|
|
private int menu2;
|
|
- private int _itemId; //道具id,该页面目前只给:体力,金币使用
|
|
|
|
|
|
+ private int _itemId; //閬撳叿id,璇ラ〉闈㈢洰鍓嶅彧缁�:浣撳姏,閲戝竵浣跨敤
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
@@ -74,7 +74,7 @@ namespace GFGGame
|
|
EventAgent.RemoveEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT, UpdateView);
|
|
EventAgent.RemoveEventListener(ConstMessage.CONTINUOUS_REBATE_GIFT, UpdateView);
|
|
}
|
|
}
|
|
|
|
|
|
- //购买连续礼包之后,更新数据+更新界面
|
|
|
|
|
|
+ //璐�拱杩炵画绀煎寘涔嬪悗锛屾洿鏂版暟鎹�+鏇存柊鐣岄潰
|
|
// ReSharper disable Unity.PerformanceAnalysis
|
|
// ReSharper disable Unity.PerformanceAnalysis
|
|
private void UpDayRebateAndView(EventContext context)
|
|
private void UpDayRebateAndView(EventContext context)
|
|
{
|
|
{
|
|
@@ -109,7 +109,7 @@ namespace GFGGame
|
|
|
|
|
|
item.target.data = shopCfg;
|
|
item.target.data = shopCfg;
|
|
|
|
|
|
- //返利包
|
|
|
|
|
|
+ //杩斿埄鍖�
|
|
item.m_txtTitle.text = itemCfg.name;
|
|
item.m_txtTitle.text = itemCfg.name;
|
|
item.m_txtWeekPrompt.visible = false;
|
|
item.m_txtWeekPrompt.visible = false;
|
|
item.m_btnIcoWeekPromptTag.visible = false;
|
|
item.m_btnIcoWeekPromptTag.visible = false;
|
|
@@ -117,7 +117,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
item.m_txtWeekPrompt.visible = true;
|
|
item.m_txtWeekPrompt.visible = true;
|
|
item.m_btnIcoWeekPromptTag.visible = true;
|
|
item.m_btnIcoWeekPromptTag.visible = true;
|
|
- item.m_txtWeekPrompt.text = string.Format("连续{0}天每日获得", itemCfg.param2Arr[0]);
|
|
|
|
|
|
+ item.m_txtWeekPrompt.text = string.Format("杩炵画{0}澶╂瘡鏃ヨ幏寰�", itemCfg.param2Arr[0]);
|
|
}
|
|
}
|
|
|
|
|
|
int numItems;
|
|
int numItems;
|
|
@@ -130,20 +130,20 @@ namespace GFGGame
|
|
string mTxtOldPrice = string.Empty;
|
|
string mTxtOldPrice = string.Empty;
|
|
if (shopCfg.costType == CostType.ITEM)
|
|
if (shopCfg.costType == CostType.ITEM)
|
|
{
|
|
{
|
|
- //货币
|
|
|
|
|
|
+ //璐у竵
|
|
ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
|
|
ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
|
|
item.m_btnBuy.m_loaIcon.visible = true;
|
|
item.m_btnBuy.m_loaIcon.visible = true;
|
|
item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
|
|
item.m_btnBuy.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
|
|
}
|
|
}
|
|
else if (shopCfg.costType == CostType.RMB)
|
|
else if (shopCfg.costType == CostType.RMB)
|
|
{
|
|
{
|
|
- //人民币
|
|
|
|
- mTxtOldPrice = "元";
|
|
|
|
|
|
+ //浜烘皯甯�
|
|
|
|
+ mTxtOldPrice = "鍏�";
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //免费
|
|
|
|
- mTxtOldPrice = $"免费";
|
|
|
|
|
|
+ //鍏嶈垂
|
|
|
|
+ mTxtOldPrice = $"鍏嶈垂";
|
|
item.m_btnBuy.m_txtOldPrice.text = "";
|
|
item.m_btnBuy.m_txtOldPrice.text = "";
|
|
item.m_btnBuy.m_txtNewPrice.align = AlignType.Left;
|
|
item.m_btnBuy.m_txtNewPrice.align = AlignType.Left;
|
|
item.m_btnBuy.m_txtNewPrice.x = 90;
|
|
item.m_btnBuy.m_txtNewPrice.x = 90;
|
|
@@ -157,26 +157,26 @@ namespace GFGGame
|
|
{
|
|
{
|
|
var roundedNumStr = NumberUtil.CalculateDiscount(shopCfg.originalPrice, shopCfg.price);
|
|
var roundedNumStr = NumberUtil.CalculateDiscount(shopCfg.originalPrice, shopCfg.price);
|
|
item.m_comLeftGiftBox.m_comDiscount.target.visible = true;
|
|
item.m_comLeftGiftBox.m_comDiscount.target.visible = true;
|
|
- item.m_comLeftGiftBox.m_comDiscount.m_txtDiscountNum.text = $"{roundedNumStr}折"; //之后再计算赋值
|
|
|
|
|
|
+ item.m_comLeftGiftBox.m_comDiscount.m_txtDiscountNum.text = $"{roundedNumStr}鎶�"; //涔嬪悗鍐嶈�绠楄祴鍊�
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
|
|
item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
|
|
}
|
|
}
|
|
|
|
|
|
- if (shopCfg.refreshType == RefreshType.DAY) //也可以换成人民币来做条件
|
|
|
|
|
|
+ if (shopCfg.refreshType == RefreshType.DAY) //涔熷彲浠ユ崲鎴愪汉姘戝竵鏉ュ仛鏉′欢
|
|
{
|
|
{
|
|
- //日刷
|
|
|
|
|
|
+ //鏃ュ埛
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = false;
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = false;
|
|
- item.m_txtUrc.text = string.Format("今日剩余{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
|
|
|
|
- item.m_txtLrc.text = string.Format("可获得{0}会员积分", shopCfg.price * 10);
|
|
|
|
|
|
+ item.m_txtUrc.text = string.Format("浠婃棩鍓╀綑{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
|
|
|
|
+ item.m_txtLrc.text = string.Format("鍙�幏寰梴0}浼氬憳绉�垎", shopCfg.price * 10);
|
|
item.m_txtWeekPrompt.visible = false;
|
|
item.m_txtWeekPrompt.visible = false;
|
|
item.m_btnIcoWeekPromptTag.visible = false;
|
|
item.m_btnIcoWeekPromptTag.visible = false;
|
|
numItems = childItemCfg.itemsArr.Length;
|
|
numItems = childItemCfg.itemsArr.Length;
|
|
|
|
|
|
if (remainBuyNum == 0)
|
|
if (remainBuyNum == 0)
|
|
{
|
|
{
|
|
- //已售完
|
|
|
|
|
|
+ //宸插敭瀹�
|
|
item.m_btnBuy.target.visible = true;
|
|
item.m_btnBuy.target.visible = true;
|
|
item.m_btnCurReceive.target.visible = false;
|
|
item.m_btnCurReceive.target.visible = false;
|
|
item.m_btnBuy.m_bagYellow.visible = false;
|
|
item.m_btnBuy.m_bagYellow.visible = false;
|
|
@@ -184,7 +184,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //未售完
|
|
|
|
|
|
+ //鏈�敭瀹�
|
|
item.m_btnBuy.target.visible = true;
|
|
item.m_btnBuy.target.visible = true;
|
|
item.m_btnCurReceive.target.visible = false;
|
|
item.m_btnCurReceive.target.visible = false;
|
|
item.m_btnBuy.m_bagYellow.visible = true;
|
|
item.m_btnBuy.m_bagYellow.visible = true;
|
|
@@ -193,54 +193,54 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //周刷
|
|
|
|
|
|
+ //鍛ㄥ埛
|
|
var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
|
|
var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
|
|
var itemArr = itemCfg.itemsArr[0];
|
|
var itemArr = itemCfg.itemsArr[0];
|
|
- ItemCfg getItemCfg = ItemCfgArray.Instance.GetCfg(itemArr[0]); //及时获得的物品,读取第一个显示ICON
|
|
|
|
|
|
+ ItemCfg getItemCfg = ItemCfgArray.Instance.GetCfg(itemArr[0]); //鍙婃椂鑾峰緱鐨勭墿鍝�,璇诲彇绗�竴涓�樉绀篒CON
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.m_loaIcon.url = ResPathUtil.GetIconPath(getItemCfg);
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.m_loaIcon.url = ResPathUtil.GetIconPath(getItemCfg);
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.m_txtGetGold.text = itemArr[1].ToString();
|
|
item.m_comLeftGiftBox.m_comGouMaiGetText.m_txtGetGold.text = itemArr[1].ToString();
|
|
- item.m_txtUrc.text = string.Format("每周限购{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
|
|
|
|
|
|
+ item.m_txtUrc.text = string.Format("姣忓懆闄愯喘{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
|
|
int rebateDay = EnduringGiftBoxDataManager.Instance.GetItemRebateDay(itemCfg.id);
|
|
int rebateDay = EnduringGiftBoxDataManager.Instance.GetItemRebateDay(itemCfg.id);
|
|
string mTxtLrc = string.Empty;
|
|
string mTxtLrc = string.Empty;
|
|
if (rebateDay != 0)
|
|
if (rebateDay != 0)
|
|
{
|
|
{
|
|
- mTxtLrc = string.Format("剩余{0}天", rebateDay);
|
|
|
|
|
|
+ mTxtLrc = string.Format("鍓╀綑{0}澶�", rebateDay);
|
|
}
|
|
}
|
|
|
|
|
|
item.m_txtLrc.text = mTxtLrc;
|
|
item.m_txtLrc.text = mTxtLrc;
|
|
item.m_txtWeekPrompt.visible = true;
|
|
item.m_txtWeekPrompt.visible = true;
|
|
item.m_txtWeekPrompt.text =
|
|
item.m_txtWeekPrompt.text =
|
|
- string.Format("连续{0}天每日获得",
|
|
|
|
|
|
+ string.Format("杩炵画{0}澶╂瘡鏃ヨ幏寰�",
|
|
itemCfg.param2Arr[0] + 1); //NumberUtil.GetChiniseNumberText(itemCfg.param2Arr[0])
|
|
itemCfg.param2Arr[0] + 1); //NumberUtil.GetChiniseNumberText(itemCfg.param2Arr[0])
|
|
item.m_btnIcoWeekPromptTag.visible = true;
|
|
item.m_btnIcoWeekPromptTag.visible = true;
|
|
|
|
|
|
numItems = childItemCfg.param1Arr.Length;
|
|
numItems = childItemCfg.param1Arr.Length;
|
|
|
|
|
|
- //领取加红点
|
|
|
|
|
|
+ //棰嗗彇鍔犵孩鐐�
|
|
RedDotController.Instance.SetComRedDot(item.m_btnCurReceive.target, weekGiftBoxState);
|
|
RedDotController.Instance.SetComRedDot(item.m_btnCurReceive.target, weekGiftBoxState);
|
|
- //是否需要领取
|
|
|
|
|
|
+ //鏄�惁闇€瑕侀�鍙�
|
|
if (weekGiftBoxState)
|
|
if (weekGiftBoxState)
|
|
{
|
|
{
|
|
item.m_btnBuy.target.visible = false;
|
|
item.m_btnBuy.target.visible = false;
|
|
item.m_btnCurReceive.target.visible = true;
|
|
item.m_btnCurReceive.target.visible = true;
|
|
item.m_btnCurReceive.m_receive.visible = true;
|
|
item.m_btnCurReceive.m_receive.visible = true;
|
|
item.m_btnCurReceive.m_received.visible = false;
|
|
item.m_btnCurReceive.m_received.visible = false;
|
|
- item.m_btnCurReceive.m_txtRec.text = "领取";
|
|
|
|
|
|
+ item.m_btnCurReceive.m_txtRec.text = "棰嗗彇";
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //是否能购买
|
|
|
|
|
|
+ //鏄�惁鑳借喘涔�
|
|
if (remainBuyNum == 0)
|
|
if (remainBuyNum == 0)
|
|
{
|
|
{
|
|
- //已经领取
|
|
|
|
|
|
+ //宸茬粡棰嗗彇
|
|
if (EnduringGiftBoxDataManager.Instance.DayRebateItemIds.Contains(shopCfg.itemId))
|
|
if (EnduringGiftBoxDataManager.Instance.DayRebateItemIds.Contains(shopCfg.itemId))
|
|
{
|
|
{
|
|
item.m_btnBuy.target.visible = false;
|
|
item.m_btnBuy.target.visible = false;
|
|
item.m_btnCurReceive.target.visible = true;
|
|
item.m_btnCurReceive.target.visible = true;
|
|
item.m_btnCurReceive.m_receive.visible = false;
|
|
item.m_btnCurReceive.m_receive.visible = false;
|
|
item.m_btnCurReceive.m_received.visible = true;
|
|
item.m_btnCurReceive.m_received.visible = true;
|
|
- item.m_btnCurReceive.m_txtRec.text = "已领取";
|
|
|
|
|
|
+ item.m_btnCurReceive.m_txtRec.text = "宸查�鍙�";
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -252,7 +252,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //未售完
|
|
|
|
|
|
+ //鏈�敭瀹�
|
|
item.m_btnBuy.target.visible = true;
|
|
item.m_btnBuy.target.visible = true;
|
|
item.m_btnBuy.m_bagGrey.visible = false;
|
|
item.m_btnBuy.m_bagGrey.visible = false;
|
|
item.m_btnBuy.m_bagYellow.visible = true;
|
|
item.m_btnBuy.m_bagYellow.visible = true;
|
|
@@ -263,9 +263,9 @@ namespace GFGGame
|
|
|
|
|
|
item.m_btnIcoWeekPromptTag.onClick.Add(RuleController.ShowRuleView);
|
|
item.m_btnIcoWeekPromptTag.onClick.Add(RuleController.ShowRuleView);
|
|
item.m_btnIcoWeekPromptTag.data = 300013;
|
|
item.m_btnIcoWeekPromptTag.data = 300013;
|
|
- //领取按钮点击事件
|
|
|
|
|
|
+ //棰嗗彇鎸夐挳鐐瑰嚮浜嬩欢
|
|
item.m_btnCurReceive.target.onClick.Add(OnBtnCurReceiveClick);
|
|
item.m_btnCurReceive.target.onClick.Add(OnBtnCurReceiveClick);
|
|
- //购买按钮点击事件
|
|
|
|
|
|
+ //璐�拱鎸夐挳鐐瑰嚮浜嬩欢
|
|
item.m_btnBuy.target.onClick.Add(OnBtnBuyClick);
|
|
item.m_btnBuy.target.onClick.Add(OnBtnBuyClick);
|
|
|
|
|
|
item.m_list.data = shopCfg;
|
|
item.m_list.data = shopCfg;
|
|
@@ -290,7 +290,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //周刷
|
|
|
|
|
|
+ //鍛ㄥ埛
|
|
result = itemCfg.param1Arr;
|
|
result = itemCfg.param1Arr;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -305,7 +305,7 @@ namespace GFGGame
|
|
UI_ComItem.ProxyEnd();
|
|
UI_ComItem.ProxyEnd();
|
|
}
|
|
}
|
|
|
|
|
|
- //弹出物品详细描述框
|
|
|
|
|
|
+ //寮瑰嚭鐗╁搧璇︾粏鎻忚堪妗�
|
|
private void OnListSelectorItemClick(EventContext context)
|
|
private void OnListSelectorItemClick(EventContext context)
|
|
{
|
|
{
|
|
GObject item = context.sender as GObject;
|
|
GObject item = context.sender as GObject;
|
|
@@ -313,7 +313,7 @@ namespace GFGGame
|
|
GoodsItemTipsController.ShowItemTips(itemCfg.id);
|
|
GoodsItemTipsController.ShowItemTips(itemCfg.id);
|
|
}
|
|
}
|
|
|
|
|
|
- //领取按钮点击事件
|
|
|
|
|
|
+ //棰嗗彇鎸夐挳鐐瑰嚮浜嬩欢
|
|
// ReSharper disable Unity.PerformanceAnalysis
|
|
// ReSharper disable Unity.PerformanceAnalysis
|
|
private void OnBtnCurReceiveClick(EventContext context)
|
|
private void OnBtnCurReceiveClick(EventContext context)
|
|
{
|
|
{
|
|
@@ -328,11 +328,11 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- PromptController.Instance.ShowFloatTextPrompt("无法领取");
|
|
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("鏃犳硶棰嗗彇");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //购买按钮点击事件
|
|
|
|
|
|
+ //璐�拱鎸夐挳鐐瑰嚮浜嬩欢
|
|
// ReSharper disable Unity.PerformanceAnalysis
|
|
// ReSharper disable Unity.PerformanceAnalysis
|
|
private void OnBtnBuyClick(EventContext context)
|
|
private void OnBtnBuyClick(EventContext context)
|
|
{
|
|
{
|
|
@@ -350,7 +350,7 @@ namespace GFGGame
|
|
|
|
|
|
if (isSellOut)
|
|
if (isSellOut)
|
|
{
|
|
{
|
|
- PromptController.Instance.ShowFloatTextPrompt("已售罄");
|
|
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("宸插敭缃�");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|