| using System; | 
| using UnityEngine; | 
| using UnityEngine.UI; | 
|   | 
| public class MailInfoAwardCell : CellView | 
| { | 
|     [SerializeField] ItemCell itemCell; | 
|     [SerializeField] ImageEx imgHave; | 
|     [SerializeField] ImageEx imgMask; | 
|     MailManager model { get { return MailManager.Instance; } } | 
|     public void Display(int index, CellView cellView) | 
|     { | 
|         string uuid = cellView.info.Value.infoStr1; | 
|         if (!model.TryGetMailData(uuid, out MailData mailData) || mailData == null || mailData.Items == null) | 
|             return; | 
|         if (index < 0 || index >= mailData.Items.Count) | 
|             return; | 
|         int mailState = mailData.MailState;//0-未知;1-未读;2-已读;3-已领; | 
|         MailItemData data = mailData.Items[index]; | 
|         itemCell.Init(new ItemCellModel((int)data.ItemID, true, data.Count)); | 
|         itemCell.button.SetListener(() => ItemTipUtility.Show((int)data.ItemID, true)); | 
|         float expiryDays = model.GetMailExpiryDays(mailData.CreateDateTime, mailData.LimitDays); | 
|         imgHave.SetActive(mailState == 3); | 
|         imgMask.SetActive(mailState == 3 || expiryDays <= 0); | 
|     } | 
| } |