首充数据更新的修改

This commit is contained in:
liuliang 2024-12-29 11:52:15 +08:00
parent 3be5a00d13
commit 8575e51128

View File

@ -9,20 +9,17 @@ public class FirstChargePanel : MonoBehaviour
public GameObject firstitempr;
public Transform Connact;
private void OnEnable()
{
Init();
}
async void Init()
List<GameObject> objlist = new List<GameObject>();
private async void OnEnable()
{
productListResponse productListResponse = await Scene_main_jiekou.instance.ProductLists();
for (int i = 0; i < productListResponse.Data.Count; i++)
{
GameObject obj = Instantiate(firstitempr,Connact);
GameObject obj = Instantiate(firstitempr, Connact);
objlist.Add(obj);
obj.GetComponent<FirstChargeitem>().PackagesName.text = productListResponse.Data[i].Name;
obj.GetComponent<FirstChargeitem>().Number.text = productListResponse.Data[i].Amount.ToString();
obj.GetComponent<FirstChargeitem>().price.text = "£¤"+productListResponse.Data[i].Price.ToString();
obj.GetComponent<FirstChargeitem>().price.text = "£¤" + productListResponse.Data[i].Price.ToString();
obj.GetComponent<FirstChargeitem>().id = productListResponse.Data[i].Id;
obj.GetComponent<FirstChargeitem>().chargePanel = this;
if (productListResponse.Data[i].first_status == 1)
@ -30,6 +27,25 @@ public class FirstChargePanel : MonoBehaviour
obj.GetComponent<FirstChargeitem>().doubleLogo.gameObject.SetActive(true);
}
}
}
async void Init()//¸üÐÂÊ׳ä½çÃæÊý¾Ý
{
productListResponse productListResponse = await Scene_main_jiekou.instance.ProductLists();
for (int i = 0; i < objlist.Count; i++)
{
objlist[i].GetComponent<FirstChargeitem>().PackagesName.text = productListResponse.Data[i].Name;
objlist[i].GetComponent<FirstChargeitem>().Number.text = productListResponse.Data[i].Amount.ToString();
objlist[i].GetComponent<FirstChargeitem>().price.text = "£¤" + productListResponse.Data[i].Price.ToString();
objlist[i].GetComponent<FirstChargeitem>().id = productListResponse.Data[i].Id;
objlist[i].GetComponent<FirstChargeitem>().chargePanel = this;
if (productListResponse.Data[i].first_status == 1)
{
objlist[i].GetComponent<FirstChargeitem>().doubleLogo.gameObject.SetActive(true);
}
}
}