_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Scene_main/Scene_main_jiekou.cs

91 lines
2.3 KiB
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public class Scene_main_jiekou :Base
{
public static Scene_main_jiekou instance;
public mainBTN _mainBTN;
2024-11-27 22:22:41 +08:00
//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ
private RealPlayerInfo _realPlayerInfo;//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ<EFBFBD><EFBFBD><E1B9B9>
private queryPlayerInfo _queryPlayerInfo;//<2F>û<EFBFBD><C3BB><EFBFBD>Ϣ
//<2F>̳<EFBFBD><CCB3><EFBFBD>Ϣ
2024-11-27 23:22:34 +08:00
private MallResponsePro _mallResponsePro;//<2F>̳<EFBFBD><CCB3>б<EFBFBD><D0B1><EFBFBD><E1B9B9>
2024-11-27 22:22:41 +08:00
private getMallList21 _getMallList21;//<2F>̳<EFBFBD><CCB3>б<EFBFBD><D0B1><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
2024-11-27 23:22:34 +08:00
//<2F>̳<EFBFBD>info<66>ֵ<EFBFBD>
2024-11-27 23:39:41 +08:00
public Dictionary<int, ProductPro> shopItemDic = new Dictionary<int, ProductPro>();
2024-11-28 04:26:44 +08:00
public getProductResponse _getProductResponse;
// Start is called before the first frame update
private void Awake()
{
instance = this;
2024-11-27 22:22:41 +08:00
2024-11-27 22:29:31 +08:00
//testLogo();
2024-11-28 00:39:35 +08:00
getPlayerInfo();
2024-11-27 22:22:41 +08:00
// getShopInfo();
}
2024-11-27 22:22:41 +08:00
async void getPlayerInfo()
{
2024-11-27 22:22:41 +08:00
await PlayerInfoAsync();
/*Debug.Log(_realPlayerInfo.data.nickName);
Debug.Log(_realPlayerInfo.data.voluteCoin);
2024-11-27 22:22:41 +08:00
Debug.Log(_realPlayerInfo.data.beansCoin);*/
_mainBTN.UpDatePlayer(_realPlayerInfo.data.nickName, _realPlayerInfo.data.voluteCoin.ToString("f1") + "M", _realPlayerInfo.data.beansCoin.ToString("f1") + "M");
}
2024-11-27 22:22:41 +08:00
async Task PlayerInfoAsync()
{
2024-11-27 22:22:41 +08:00
_realPlayerInfo = new RealPlayerInfo();
_queryPlayerInfo = new queryPlayerInfo();
_realPlayerInfo = await _queryPlayerInfo.QueryPlayerInfoPro();
2024-11-28 04:26:44 +08:00
}
2024-11-27 22:22:41 +08:00
public async Task ShopInfo()
{
2024-11-27 23:39:41 +08:00
// ÿ<>ε<EFBFBD><CEB5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ֵ䣬ȷ<E4A3AC><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
shopItemDic.Clear();
// <20><><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><CCB3><EFBFBD><EFBFBD><EFBFBD>
2024-11-27 23:22:34 +08:00
_mallResponsePro = null;
_getMallList21 = null;
2024-11-27 23:39:41 +08:00
// <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><CCB3><EFBFBD><EFBFBD>ض<EFBFBD><D8B6><EFBFBD>
2024-11-27 22:22:41 +08:00
_mallResponsePro = new MallResponsePro();
_getMallList21 = new getMallList21();
2024-11-27 23:39:41 +08:00
// <20><EFBFBD><ECB2BD>ȡ<EFBFBD>̳<EFBFBD><CCB3><EFBFBD><EFBFBD><EFBFBD>
2024-11-27 22:22:41 +08:00
_mallResponsePro = await _getMallList21.getMallList(1, 1, 20);
2024-11-27 23:39:41 +08:00
// <20><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>
2024-11-27 23:22:34 +08:00
foreach (ProductPro go in _mallResponsePro.Data.DataList)
{
2024-11-27 23:39:41 +08:00
// <20><><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>е<EFBFBD><D0B5><EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ
shopItemDic[go.ProductId] = go;
}
2024-11-27 23:22:34 +08:00
2024-11-27 22:22:41 +08:00
}
2024-11-28 04:26:44 +08:00
public async Task ShopItemDetail(int id)
{
_getProductResponse = null;
productInfo22 _productInfo22 = new productInfo22();
_getProductResponse = await _productInfo22.productInfo(id);
}
2024-11-27 22:22:41 +08:00
2024-11-28 04:26:44 +08:00
}