This commit is contained in:
wulongxiao 2024-11-28 04:26:44 +08:00
parent 58d0d0d961
commit cf3e3b01b6
3 changed files with 30 additions and 8 deletions

View File

@ -2066,6 +2066,14 @@ MonoBehaviour:
retbutton: {fileID: 0}
ClosureObj: {fileID: 0}
_mainBTN: {fileID: 332514051}
_getProductResponse:
code: 0
message:
Data:
PageNo: 0
PageSize: 0
TotalCount: 0
DataList: []
--- !u!114 &278122031
MonoBehaviour:
m_ObjectHideFlags: 0
@ -2527,8 +2535,8 @@ MonoBehaviour:
BTN7: {fileID: 1901054682}
BTN8: {fileID: 476418689}
BTN9: {fileID: 1936607147}
BTN10: {fileID: 0}
BTN11: {fileID: 0}
BTN10: {fileID: 1181500911}
BTN11: {fileID: 677536727}
panel5: {fileID: 4940716481564219981, guid: caa78c4293daf7d46a16e55bff3cef69, type: 3}
panel6: {fileID: 8100220736890640020, guid: 5864359501d16654890de332a070efdc, type: 3}
panel7: {fileID: 3340979652164545499, guid: 8f84b26647447444ab4ae056aa5fa849, type: 3}

View File

@ -19,6 +19,9 @@ public class Scene_main_jiekou :Base
//É̳Çinfo×Öµä
public Dictionary<int, ProductPro> shopItemDic = new Dictionary<int, ProductPro>();
public getProductResponse _getProductResponse;
// Start is called before the first frame update
private void Awake()
@ -45,10 +48,7 @@ public class Scene_main_jiekou :Base
_realPlayerInfo = new RealPlayerInfo();
_queryPlayerInfo = new queryPlayerInfo();
_realPlayerInfo = await _queryPlayerInfo.QueryPlayerInfoPro();
}
}
public async Task ShopInfo()
{
@ -75,5 +75,16 @@ public class Scene_main_jiekou :Base
}
public async Task ShopItemDetail(int id)
{
_getProductResponse = null;
productInfo22 _productInfo22 = new productInfo22();
_getProductResponse = await _productInfo22.productInfo(id);
}
}

View File

@ -34,8 +34,9 @@ public class shopPanel: ui_huodong
// 更新当前 itemInfo 显示项
itemInfos[index].gameObject.SetActive(true); // 显示当前项
itemInfos[index].initShow(go.Value.ProductId, go.Value.ProductName,go.Value.Price.ToString());
itemInfos[index].GetComponent<Button>().onClick.AddListener(()=> {
GameObject.Instantiate(Panel, GameObject.Find("Canvas").transform).GetComponent<wokePanel>().initShow(go.Value.ProductName, go.Value.ProductName, go.Value.Price.ToString(),"²âÊÔ") ;
itemInfos[index].GetComponent<Button>().onClick.AddListener(async()=> {
await Scene_main_jiekou.instance.ShopItemDetail(go.Value.ProductId);
GameObject.Instantiate(Panel, GameObject.Find("Canvas").transform).GetComponent<wokePanel>().initShow(go.Value.ProductName, go.Value.ProductName, go.Value.Price.ToString(), Scene_main_jiekou.instance._getProductResponse.Data.DataList[0].ProductName);
});
index++;
@ -48,6 +49,8 @@ public class shopPanel: ui_huodong
itemInfos[index].gameObject.SetActive(false); // 隐藏多余项
index++;
}
}
}