diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding.meta b/meng_yao/Assets/script/scene_Main/Islandownerbidding.meta new file mode 100644 index 00000000..b7256da0 --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff6b29309c45aaa4da821da053e0861c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioncertificate.cs b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioncertificate.cs new file mode 100644 index 00000000..3654bb2a --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioncertificate.cs @@ -0,0 +1,45 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; + +public class Auctioncertificate: MonoBehaviour +{ + public Dictionary CreateHeaders() + { + if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + return new Dictionary + { + + { "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token }, + { "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" } + }; + } + public async Task Island() + { + string response = await myWeb.SendRequest(myWeb.URL + "/api/island/cert_list", "GET", "{}", CreateHeaders()); + Debug.Log("岛主证书" + response); + certificateResponse certificate = JsonConvert.DeserializeObject(response); + //Debug.Log(teamInfo.Data.Info.Nickname); + return certificate; + } +} + +public class certificateResponse +{ + public certificateData Data { get; set; } +} +public class certificateData +{ + public string uid { get; set; } + public string nickname { get; set; } + public string serial_no { get; set; } + public int copies { get; set; } + public string island_name { get; set; } + public string issue_date { get; set; } +} \ No newline at end of file diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioncertificate.cs.meta b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioncertificate.cs.meta new file mode 100644 index 00000000..5bd1bfab --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioncertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acd9ea8f9fcf28f41ac1fe76a6a7e0a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioninformation.cs b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioninformation.cs new file mode 100644 index 00000000..2f207961 --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioninformation.cs @@ -0,0 +1,46 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; + +public class Auctioninformation: MonoBehaviour +{ + public Dictionary CreateHeaders() + { + if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + return new Dictionary + { + + { "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token }, + { "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" } + }; + } + public async Task Island(int count) + { + + string response = await myWeb.SendRequest(myWeb.URL + "/api/island/submit", "GET", "{}", CreateHeaders()); + Debug.Log("岛主信息" + response); + AuctionResponse Island = JsonConvert.DeserializeObject(response); + //Debug.Log(teamInfo.Data.Info.Nickname); + return Island; + } +} + +public class AuctionResponse +{ + public AuctionData Data { get; set; } +} +public class AuctionData +{ + public int gold { get; set; } + public string intro_text { get; set; } + public int countdown { get; set; } + public int island_id { get; set; } + public string island_name { get; set; } + public int invest_total { get; set; } +} \ No newline at end of file diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioninformation.cs.meta b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioninformation.cs.meta new file mode 100644 index 00000000..5fb80743 --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Auctioninformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82907bb754fe74643be310ebe0654f63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding/Islandownerbidding.cs b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Islandownerbidding.cs new file mode 100644 index 00000000..387843f5 --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Islandownerbidding.cs @@ -0,0 +1,46 @@ +using Newtonsoft.Json; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using UnityEngine; + +public class Islandownerbidding: MonoBehaviour +{ + public Dictionary CreateHeaders() + { + if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token)) + { + Debug.LogWarning("尝试创建请求头时,token 未设置。"); + return new Dictionary(); + } + return new Dictionary + { + + { "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token }, + { "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" } + }; + } + public async Task Island(Islandbody islandbody) + { + Debug.Log("岛主竞拍入参" + JsonConvert.SerializeObject(islandbody)); + string response = await myWeb.SendRequest(myWeb.URL + "/api/island/info", "POST", JsonConvert.SerializeObject(islandbody), CreateHeaders()); + Debug.Log("岛主竞拍" + response); + IslandResponse Island = JsonConvert.DeserializeObject(response); + //Debug.Log(teamInfo.Data.Info.Nickname); + return Island; + } +} + +public class Islandbody +{ + public int count; +} +public class IslandResponse +{ + public IslandData Data { get; set; } +} +public class IslandData +{ + public int balance { get; set; } + public int invest_total { get; set; } +} \ No newline at end of file diff --git a/meng_yao/Assets/script/scene_Main/Islandownerbidding/Islandownerbidding.cs.meta b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Islandownerbidding.cs.meta new file mode 100644 index 00000000..d967bd14 --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/Islandownerbidding/Islandownerbidding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70cf240f9a42b134181a608af77f0995 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: