Compare commits
No commits in common. "eebc7f4307d9224b934344e3fc6a12868ea0e0b5" and "b1272d1424db798db683fcf2dfe96cccdad61722" have entirely different histories.
eebc7f4307
...
b1272d1424
@ -394,7 +394,7 @@ GameObject:
|
|||||||
- component: {fileID: 1939568758}
|
- component: {fileID: 1939568758}
|
||||||
- component: {fileID: 1939568757}
|
- component: {fileID: 1939568757}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: lianghaoCanvas
|
m_Name: Canvas
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class BuyGoodId42 : MonoBehaviour
|
|
||||||
{
|
|
||||||
public async Task<BuyGoodIdResponse> buyGoodId(int cutePoolId) // 4.2
|
|
||||||
{
|
|
||||||
// 准备请求的头部信息,包含授权令牌
|
|
||||||
Dictionary<string, string> head41 = new Dictionary<string, string>
|
|
||||||
{
|
|
||||||
{ "Authorization", Global.global.serverResponse.data.token }
|
|
||||||
};
|
|
||||||
|
|
||||||
// 请求体
|
|
||||||
BuyGoodIdBody buyGoodIdBody = new BuyGoodIdBody
|
|
||||||
{
|
|
||||||
userId = Global.global.serverResponse.data.userId,
|
|
||||||
cutePoolId = cutePoolId
|
|
||||||
};
|
|
||||||
|
|
||||||
// 异步发送请求
|
|
||||||
Debug.Log("======入参======" + JsonConvert.SerializeObject(buyGoodIdBody));
|
|
||||||
string response42 = await web.SendRequest(web.URL + "/snail/cutePool/buy", "POST", JsonConvert.SerializeObject(buyGoodIdBody), head41);
|
|
||||||
|
|
||||||
// 调试输出接收到的响应
|
|
||||||
Debug.Log("4.2购买靓号==" + response42);
|
|
||||||
|
|
||||||
// 将响应反序列化为对象
|
|
||||||
BuyGoodIdResponse buyGoodIdResponse = JsonConvert.DeserializeObject<BuyGoodIdResponse>(response42);
|
|
||||||
Debug.Log("8==================================D" + buyGoodIdResponse.Data.TotalCount);
|
|
||||||
return buyGoodIdResponse;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e55a4e0a058739742a83e8d77ae91065
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
@ -628,7 +628,7 @@ public class GoodIdItem
|
|||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string CuteNo { get; set; }
|
public string CuteNo { get; set; }
|
||||||
public decimal BeansCoin { get; set; }
|
public float BeansCoin { get; set; }
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public int Type { get; set; }
|
public int Type { get; set; }
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
@ -638,32 +638,4 @@ public class GoodIdItem
|
|||||||
public class GoodIdPageBody
|
public class GoodIdPageBody
|
||||||
{
|
{
|
||||||
public int orderByDesc { get; set; }
|
public int orderByDesc { get; set; }
|
||||||
}
|
}
|
||||||
//====4.2购买靓号=========================================================
|
|
||||||
//请求体
|
|
||||||
public class BuyGoodIdBody
|
|
||||||
{
|
|
||||||
public int userId { get; set; }
|
|
||||||
public int cutePoolId { get; set; }
|
|
||||||
}
|
|
||||||
//返回值
|
|
||||||
|
|
||||||
public class BuyGoodIdResponse : Response
|
|
||||||
{
|
|
||||||
public BuyGoodIdData Data { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BuyGoodIdData
|
|
||||||
{
|
|
||||||
public int PageNo { get; set; }
|
|
||||||
public int PageSize { get; set; }
|
|
||||||
public int TotalCount { get; set; }
|
|
||||||
public List<object> DataList { get; set; } // 你可以根据需要将List<object>替换为List<YourDataType>===========================================================
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -17,13 +17,12 @@ public class LoginItem :MonoBehaviour
|
|||||||
|
|
||||||
public async void Init()
|
public async void Init()
|
||||||
{
|
{
|
||||||
idResponse = await goodId.queryUnionPage();
|
idResponse=await goodId.queryUnionPage();
|
||||||
for (int i = 0; i < idResponse.Data.DataList.Count; i++)
|
for (int i = 0; i < idResponse.Data.DataList.Count; i++)
|
||||||
{
|
{
|
||||||
GameObject Lhitem = (GameObject)Instantiate(Resources.Load("LLPrefabs/Beautiful_numberttem"), contentItem);
|
GameObject Lhitem = (GameObject)Instantiate(Resources.Load("LLPrefabs/Beautiful_numberttem"),contentItem);
|
||||||
Lhitem.GetComponent<NumberTc>().BeautifulNumber.text = idResponse.Data.DataList[i].CuteNo;
|
Lhitem.GetComponent<NumberTc>().BeautifulNumber.text = idResponse.Data.DataList[i].CuteNo;
|
||||||
Lhitem.GetComponent<NumberTc>().price.text = idResponse.Data.DataList[i].BeansCoin.ToString();
|
Lhitem.GetComponent<NumberTc>().price.text = idResponse.Data.DataList[i].BeansCoin.ToString();
|
||||||
Lhitem.GetComponent<NumberTc>().id = idResponse.Data.DataList[i].Id;
|
|
||||||
if (idResponse.Data.DataList[i].Type == 1)
|
if (idResponse.Data.DataList[i].Type == 1)
|
||||||
{
|
{
|
||||||
Lhitem.GetComponent<NumberTc>().musk_show();
|
Lhitem.GetComponent<NumberTc>().musk_show();
|
||||||
|
@ -7,8 +7,6 @@ public class Nice_numPanel : MonoBehaviour
|
|||||||
public Button CancleBtn;
|
public Button CancleBtn;
|
||||||
public Button ConfirmBtn;
|
public Button ConfirmBtn;
|
||||||
public NumberTc numberTc;
|
public NumberTc numberTc;
|
||||||
BuyGoodIdResponse buyGoodIdResponse = new BuyGoodIdResponse();
|
|
||||||
BuyGoodId42 buyGoodId42 = new BuyGoodId42();
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
@ -18,23 +16,29 @@ public class Nice_numPanel : MonoBehaviour
|
|||||||
|
|
||||||
void CanclePanel()
|
void CanclePanel()
|
||||||
{
|
{
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
async void ConfirmBuy()
|
void ConfirmBuy()
|
||||||
{
|
{
|
||||||
//string pricetext = numberTc.price.text;
|
string pricetext = numberTc.price.text;
|
||||||
buyGoodIdResponse = await buyGoodId42.buyGoodId(numberTc.id);
|
if ((PlayerInfo.instance.Money - float.Parse(pricetext)) >= 0)
|
||||||
Debug.Log(buyGoodIdResponse);
|
{
|
||||||
numberTc.musk_show();
|
|
||||||
Destroy(this.gameObject);
|
numberTc.musk_show();
|
||||||
//Debug.Log("弹出蜗壳不足的弹窗");
|
Destroy(this.gameObject);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log("弹出蜗壳不足的弹窗");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,13 @@ public class NumberTc : MonoBehaviour
|
|||||||
{
|
{
|
||||||
public TextMeshProUGUI BeautifulNumber;
|
public TextMeshProUGUI BeautifulNumber;
|
||||||
public TextMeshProUGUI price;
|
public TextMeshProUGUI price;
|
||||||
public int id;
|
|
||||||
public Button Show_buy;
|
public Button Show_buy;
|
||||||
public Canvas jiemianCanvas;
|
public Canvas jiemianCanvas;
|
||||||
public GameObject musk;
|
public GameObject musk;
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
jiemianCanvas = GameObject.Find("lianghaoCanvas").GetComponent<Canvas>();
|
jiemianCanvas = GameObject.Find("Canvas").GetComponent<Canvas>();
|
||||||
Show_buy.onClick.AddListener(ShowBuy_TanChuang);
|
Show_buy.onClick.AddListener(ShowBuy_TanChuang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user