2024-11-27 17:11:15 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class OrderPanel : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public ScrollRect sv;
|
|
|
|
|
|
|
|
|
|
public GameObject orderObj;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string urlPath = "/snail/order/queryPage";
|
2024-11-27 23:18:16 +08:00
|
|
|
|
|
2024-11-27 17:11:15 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
private OrderInfo orderInfo;
|
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
ReGetOrder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public class OrderMsg
|
|
|
|
|
{
|
|
|
|
|
public int orderByDesc { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OrderInfo
|
|
|
|
|
{
|
|
|
|
|
public int code;
|
|
|
|
|
public string message;
|
|
|
|
|
public OrderData data = new OrderData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OrderData
|
|
|
|
|
{
|
|
|
|
|
public int pageNo;
|
|
|
|
|
public int pageSize;
|
|
|
|
|
public int totalCount;
|
|
|
|
|
public List<OrderList> dataList = new List<OrderList>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OrderList
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>id
|
|
|
|
|
public int userId;
|
|
|
|
|
//<2F><>Ʒid
|
|
|
|
|
public int productId;
|
|
|
|
|
public int productType;
|
|
|
|
|
//0֧<30><D6A7><EFBFBD>У<EFBFBD>1<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>2ʧ<32><CAA7>
|
|
|
|
|
public int payStatus;
|
|
|
|
|
public int price;
|
|
|
|
|
//<2F>µ<EFBFBD>ʱ<EFBFBD><CAB1>
|
|
|
|
|
public string createTime;
|
|
|
|
|
public string receiveName;
|
|
|
|
|
public string receivePhone;
|
|
|
|
|
public string area;
|
|
|
|
|
public string address;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OrderMsg msg = new OrderMsg() { orderByDesc = 1 };
|
|
|
|
|
|
|
|
|
|
//<><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
|
2024-11-27 23:18:16 +08:00
|
|
|
|
private Dictionary<string, string> headInfo = new Dictionary<string, string>();
|
2024-11-27 17:11:15 +08:00
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
public async Task ReGetOrder()
|
|
|
|
|
{
|
2024-11-27 23:18:16 +08:00
|
|
|
|
headInfo.Add("Authorization", Global.global.serverResponse.data.token);
|
2024-11-27 17:11:15 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//<2F>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
string responsel6 = await web.SendRequest(web.URL + "/snail/order/queryPage", "POST", JsonUtility.ToJson(msg), headInfo);
|
|
|
|
|
|
|
|
|
|
Debug.Log(responsel6);
|
|
|
|
|
//orderInfo = JsonUtility.FromJson<OrderInfo>(responsel6);
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
2024-11-30 17:28:53 +08:00
|
|
|
|
//orderInfo = new OrderInfo();
|
|
|
|
|
//orderInfo.data.dataList.Add(new OrderList());
|
|
|
|
|
//orderInfo.data.dataList.Add(new OrderList());
|
|
|
|
|
//orderInfo.data.dataList.Add(new OrderList());
|
2024-11-27 17:11:15 +08:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < orderInfo.data.dataList.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
GameObject go = Instantiate(orderObj);
|
|
|
|
|
go.transform.SetParent(sv.content, false);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
go.GetComponent<OrderObj>().UpdatePanel(orderInfo.data.dataList[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|