PayItemPanel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace LoyalSoftSDK
  6. {
  7. public class PayItemPanel : MonoBehaviour
  8. {
  9. private Text productName;
  10. private Text orderId;
  11. private Text time;
  12. private Text amount;
  13. private Text status;
  14. // Use this for initialization
  15. public void SetInfo(string _productName, string _orderId, string _time, string _amount)
  16. {
  17. productName = this.transform.Find("ProductName").gameObject.GetComponent<Text>();
  18. orderId = this.transform.Find("OrderId").gameObject.GetComponent<Text>();
  19. time = this.transform.Find("Time").gameObject.GetComponent<Text>();
  20. amount = this.transform.Find("Amount").gameObject.GetComponent<Text>();
  21. status = this.transform.Find("Status").gameObject.GetComponent<Text>();
  22. status.text = "已完成";
  23. productName.text = _productName;
  24. orderId.text = _orderId;
  25. time.text = _time;
  26. float amt = float.Parse(_amount)/100;
  27. amount.text = amt.ToString("F2") + "元";
  28. }
  29. }
  30. }