using UnityEngine;
|
using UnityEngine.UI;
|
using TableConfig;
|
|
namespace Snxxz.UI
|
{
|
public class FBHelpPointExchageNotify : MonoBehaviour
|
{
|
[SerializeField] CommonItemBaisc itemBaisc;
|
[SerializeField] Text titleText;
|
[SerializeField] Button closeBtn;
|
[SerializeField] Button gotoBtn;
|
|
FBHelpPointExchageModel ExchageModel { get { return ModelCenter.Instance.GetModel<FBHelpPointExchageModel>(); } }
|
ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
|
public void Awake()
|
{
|
gotoBtn.AddListener(ClickGoto);
|
closeBtn.AddListener(GetNextPush);
|
}
|
|
public void SetDisplay()
|
{
|
int shopId = ExchageModel.currentShopId;
|
this.gameObject.SetActive(shopId != 0);
|
if (shopId == 0) return;
|
|
StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId);
|
if(storeConfig != null)
|
{
|
ItemCellModel cellModel = new ItemCellModel(storeConfig.ItemID);
|
itemBaisc.Init(cellModel);
|
itemBaisc.cellBtn.RemoveAllListeners();
|
itemBaisc.cellBtn.AddListener(()=>
|
{
|
ItemAttrData attrData = new ItemAttrData(storeConfig.ItemID);
|
tipsModel.SetItemTipsModel(attrData);
|
});
|
}
|
}
|
|
public void ClickGoto()
|
{
|
StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(ExchageModel.currentShopId);
|
switch ((StoreFunc)storeConfig.ShopType)
|
{
|
case StoreFunc.WeekStore:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc1);
|
break;
|
case StoreFunc.CommonStore:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc2);
|
break;
|
case StoreFunc.GrowStrongerStore:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc3);
|
break;
|
case StoreFunc.BindStore:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc4);
|
break;
|
case StoreFunc.IntegralStore:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc5);
|
break;
|
}
|
GetNextPush();
|
}
|
|
public void GetNextPush()
|
{
|
ExchageModel.GetNextHelpPointShop(ExchageModel.currentShopId);
|
}
|
}
|
}
|