41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using System;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class BuyProduct23 : MonoBehaviour
|
|||
|
{
|
|||
|
public async Task<BuyProductResponse> BuyProduct(int productId, int userId, string receiveName, string receivePhone, string area, string address)
|
|||
|
{
|
|||
|
// <><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
|
|||
|
Dictionary<string, string> head23 = new Dictionary<string, string>
|
|||
|
{
|
|||
|
{ "Authorization", Global.global.serverResponse.data.token }
|
|||
|
};
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
BuyProductBody BuyProductBody = new BuyProductBody
|
|||
|
{
|
|||
|
productId = productId,
|
|||
|
userId = userId,
|
|||
|
receiveName = receiveName,
|
|||
|
receivePhone = receivePhone,
|
|||
|
area = area,
|
|||
|
address = address
|
|||
|
};
|
|||
|
|
|||
|
Debug.Log("====<3D><><EFBFBD><EFBFBD>====" + JsonConvert.SerializeObject(BuyProductBody));
|
|||
|
// <20>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
string response23 = await web.SendRequest(web.URL + "/snail/product/buy", "POST", JsonConvert.SerializeObject(BuyProductBody), head23);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|||
|
Debug.Log("2.3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ:=============== " + response23);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6> JSON <20><><EFBFBD><EFBFBD>
|
|||
|
BuyProductResponse buyProductResponse = JsonConvert.DeserializeObject<BuyProductResponse>(response23);
|
|||
|
return buyProductResponse;
|
|||
|
}
|
|||
|
}
|