首充数据更新的修改
This commit is contained in:
parent
3be5a00d13
commit
8575e51128
@ -9,20 +9,17 @@ public class FirstChargePanel : MonoBehaviour
|
|||||||
public GameObject firstitempr;
|
public GameObject firstitempr;
|
||||||
public Transform Connact;
|
public Transform Connact;
|
||||||
|
|
||||||
private void OnEnable()
|
List<GameObject> objlist = new List<GameObject>();
|
||||||
{
|
private async void OnEnable()
|
||||||
Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
async void Init()
|
|
||||||
{
|
{
|
||||||
productListResponse productListResponse = await Scene_main_jiekou.instance.ProductLists();
|
productListResponse productListResponse = await Scene_main_jiekou.instance.ProductLists();
|
||||||
for (int i = 0; i < productListResponse.Data.Count; i++)
|
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>().PackagesName.text = productListResponse.Data[i].Name;
|
||||||
obj.GetComponent<FirstChargeitem>().Number.text = productListResponse.Data[i].Amount.ToString();
|
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>().id = productListResponse.Data[i].Id;
|
||||||
obj.GetComponent<FirstChargeitem>().chargePanel = this;
|
obj.GetComponent<FirstChargeitem>().chargePanel = this;
|
||||||
if (productListResponse.Data[i].first_status == 1)
|
if (productListResponse.Data[i].first_status == 1)
|
||||||
@ -30,6 +27,25 @@ public class FirstChargePanel : MonoBehaviour
|
|||||||
obj.GetComponent<FirstChargeitem>().doubleLogo.gameObject.SetActive(true);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user