| using UnityEngine; | 
| using UnityEngine.UI; | 
|   | 
|   | 
| /// <summary> | 
| /// 淘金自动续费 | 
| /// </summary> | 
| public class GoldRushAutoBuyWin : UIBase | 
| { | 
|     [SerializeField] Text timeText; | 
|   | 
|     [SerializeField] Button closeBtn; | 
|     [SerializeField] Button buyBtn; | 
|     [SerializeField] Text buyText; | 
|     [SerializeField] Text buyTipsText; | 
|   | 
|   | 
|   | 
|     protected override void InitComponent() | 
|     { | 
|         closeBtn.AddListener(CloseWindow); | 
|         buyBtn.AddListener(Buy); | 
|     } | 
|   | 
|   | 
|   | 
|     protected override void OnPreOpen() | 
|     { | 
|         Display(); | 
|     } | 
|   | 
|   | 
|     void Display() | 
|     {  | 
|         var endTime = GoldRushManager.Instance.housekeeperEndTime; | 
|         if (endTime > 0 && TimeUtility.AllSeconds < endTime) | 
|         { | 
|             //续费 | 
|             buyTipsText.text = Language.Get("GoldRush45", GoldRushManager.Instance.buyAutoDaysList[0]); | 
|             RechargeManager.Instance.TryGetOrderInfo(GoldRushManager.Instance.buyAutoCTGIDList[0], out var orderInfo); | 
|             buyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale); | 
|             timeText.text = Language.Get("GoldRush48") + TimeUtility.SecondsToShortDHMS(endTime - TimeUtility.AllSeconds); | 
|         } | 
|     } | 
|   | 
|   | 
|   | 
|     void Buy() | 
|     { | 
|         RechargeManager.Instance.CTG(GoldRushManager.Instance.buyAutoCTGIDList[0]); | 
|         CloseWindow(); | 
|     } | 
|   | 
| } |