矿场合约10.3

This commit is contained in:
杨号敬 2024-12-05 17:02:12 +08:00
parent 1131f1a00b
commit ce49792625
8 changed files with 34 additions and 31 deletions

View File

@ -1726,9 +1726,9 @@ RectTransform:
m_Father: {fileID: 229120761}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 467.71002, y: -116}
m_SizeDelta: {x: 572, y: 218.0271}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &860805139
@ -2780,7 +2780,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1336997366
RectTransform:
m_ObjectHideFlags: 0

View File

@ -14,17 +14,17 @@ public class KuangChangPop : MonoBehaviour
// Start is called before the first frame update
async void Start()
{
//查询可购买的挖矿合约
miningContractList = await queryMiningContractList.QueryMiningContract();
Debug.Log(miningContractList.data.Count);
for (int i = miningContractList.data.Count -1; i >= 0; i--)
{
{
var miningContract = miningContractList.data[i];
GameObject item = Instantiate(kuanghcangItem);
item.transform.parent = ItemParent.transform;
NewkuangchangItem newiItem = item.GetComponent<NewkuangchangItem>();
newiItem.count.text = miningContract.voluteCoinBuy.ToString();
newiItem.miningContract = miningContractList.data[i];
newiItem.count.text = miningContract.voluteCoinBuy.ToString();//显示每一个合约的购买所需赋值
newiItem.miningContract = miningContractList.data[i];//给每一个合约赋值
}

View File

@ -23,20 +23,21 @@ public class KuangChangTest : MonoBehaviour
async void Start()
{
//queryMiningContractList.QueryMiningContract();
//miningContracDetail = await queryMiningContracDetail.QueryMiningContracDetail(2L);
////Debug.Log("====bbb======" + miningContracDetail.data.createTime);
miningContracDetail = await queryMiningContracDetail.QueryMiningContracDetail(3);
//bool isBuySucceed = await buyMiningContract.BuyMiningContract(1);
////Debug.Log("====¹ºÂò===" + isBuySucceed);
////Debug.Log(buyMiningContract.BuyMiningContract(2) + "==========Âò");
////Debug.Log(openSlot5.OpenSlot() + "===============¿ª¿¨²Û");
//queryMyPureContract.QueryMyPureContract();
//queryUserMiningSlot.QueryUserMiningSlot();
//查询矿厂卡槽分页:
queryUserMiningSlot.QueryUserMiningSlot();
//bool isSucceed = await bindSlot.BindSlot(1, 1);
////Debug.Log(isSucceed + "========°ó¶¨¿¨²Û");
miningContractList = await queryMiningContractList.QueryMiningContract();
//miningContractList = await queryMiningContractList.QueryMiningContract();
//矿厂主页刷新蜗壳值
QueryUserVoluteCoinResponse queryUserVoluteCoinResponse = await queryUserVoluteCoin.QueryUserVoluteCoin();
Userdata.text = queryUserVoluteCoinResponse.data.ToString();
ReturnButton.onClick.AddListener((() => { SceneManager.LoadScene(1);}));

View File

@ -18,8 +18,10 @@ public class NewkuangchangItem : MonoBehaviour
async void BuyItem()
{
buyMiningContract103 buyMiningContract = new buyMiningContract103();
bool isBuySucceed = await buyMiningContract.BuyMiningContract((long)miningContract.voluteCoinBuy);
Debug.Log(isBuySucceed);
Debug.Log(miningContract.id);
bool isBuySucceed = await buyMiningContract.BuyMiningContract(miningContract.id);
//bindSlot107 bindSlot = new bindSlot107();
//bindSlot.BindSlot()
}
// Update is called once per frame
void Update()

View File

@ -20,7 +20,7 @@ public class buyMiningContract103 : MonoBehaviour
body.userId = realPlayerInfo.data.userId;
body.contractId = contractId;
//Debug.Log(JsonConvert.SerializeObject(body)+"=====================================");
Debug.Log(JsonConvert.SerializeObject(body)+"====Èë²Î====");
// 异步发送请求以获取最新的蜗牛骑士信息
string response0103 = await web.SendRequest(web.URL + "/snail/mining/buyMiningContract" , "POST", JsonConvert.SerializeObject(body), head);

View File

@ -24,7 +24,7 @@ public class queryMiningContracDetail102 : MonoBehaviour
// 将响应反序列化为对象
MiningContracDetail miningContracDetail = JsonConvert.DeserializeObject<MiningContracDetail>(response0102);
Debug.Log(miningContracDetail.data.id);
// 返回解析后的对象
return miningContracDetail;
}

View File

@ -24,19 +24,19 @@ public class queryMiningContractList101 : MonoBehaviour
MiningContractList miningContractList = JsonConvert.DeserializeObject<MiningContractList>(response0101);
// 遍历 miningContractList.data 列表中的每个 MiningContract 对象
foreach (var contract in miningContractList.data)
{
Debug.Log($"合约ID: {contract.id}");
Debug.Log($"合约名称: {contract.name}");
Debug.Log($"状态: {contract.status}");
Debug.Log($"上架状态: {contract.onShelves}");
Debug.Log($"购买所需 VoluteCoin: {contract.voluteCoinBuy}");
Debug.Log($"挖矿天数: {contract.miningDays}");
Debug.Log($"挖矿奖励 VoluteCoin: {contract.voluteCoinReward}");
Debug.Log($"每秒奖励: {contract.eachSecondsReward}");
Debug.Log($"创建时间: {contract.createTime}");
Debug.Log($"更新时间: {contract.updateTime}");
}
//foreach (var contract in miningContractList.data)
//{
// Debug.Log($"合约ID: {contract.id}");
// Debug.Log($"合约名称: {contract.name}");
// Debug.Log($"状态: {contract.status}");
// Debug.Log($"上架状态: {contract.onShelves}");
// Debug.Log($"购买所需 VoluteCoin: {contract.voluteCoinBuy}");
// Debug.Log($"挖矿天数: {contract.miningDays}");
// Debug.Log($"挖矿奖励 VoluteCoin: {contract.voluteCoinReward}");
// Debug.Log($"每秒奖励: {contract.eachSecondsReward}");
// Debug.Log($"创建时间: {contract.createTime}");
// Debug.Log($"更新时间: {contract.updateTime}");
//}
// 返回解析后的对象
return miningContractList;

View File

@ -29,7 +29,7 @@ public class queryUserMiningSlot104 : MonoBehaviour
// 将响应反序列化为对象
UserMiningSlotResponse userMiningSlotResponse = JsonConvert.DeserializeObject<UserMiningSlotResponse>(response0104);
//Debug.Log("===========88============="+ userMiningSlotResponse.data.dataList[0].userId);
Debug.Log("===========88============="+ userMiningSlotResponse.data.dataList[0].userId);
// 返回解析后的对象
return userMiningSlotResponse;