From 7695960f14d945dba225d1081902a1f88e045bb4 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Wed, 27 Nov 2024 19:02:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8E=A5=E5=AE=8C=E5=95=A6?= =?UTF-8?q?=EF=BC=81=EF=BC=81=EF=BC=81=EF=BC=81=EF=BC=81=EF=BC=81=EF=BC=81?= =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scripts/Address/AddressPanel.cs | 3 +- .../Assets/Scripts/Address/NewAddressPanel.cs | 36 +++++++++++++ .../Scripts/Address/NewAddressPanel.cs.meta | 11 ++++ .../Assets/Scripts/Address/addressItem.cs | 6 ++- .../Scripts/AddressSystem8/newAddress81.cs | 2 +- .../prefabs/HYLPrefabs/NewAddressPanel.prefab | 18 +++++++ .../Assets/prefabs/HYLPrefabs/UI.unity | 54 +++++++++---------- 7 files changed, 99 insertions(+), 31 deletions(-) create mode 100644 TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs create mode 100644 TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs.meta diff --git a/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs b/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs index 0be2b04..6acc610 100644 --- a/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs +++ b/TheStrongestSnail/Assets/Scripts/Address/AddressPanel.cs @@ -25,7 +25,8 @@ public class AddressPanel : MonoBehaviour GameObject addres = GameObject.Instantiate(addressPrefab,trans); addres.name = "address_" + i; addressItem item = addres.GetComponent(); - item.SetInfo(); + Address address = adressResponse.data[i]; + item.SetInfo(address); } diff --git a/TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs b/TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs new file mode 100644 index 0000000..0512298 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +public class NewAddressPanel : MonoBehaviour +{ + public Button submitBtn;//保存按钮 + public TMP_InputField nameInput; + public TMP_InputField telInput; + public TMP_InputField addresInput; + public TMP_InputField detailInput; + + + // Start is called before the first frame update + void Start() + { + submitBtn.onClick.AddListener(NewAddress); + } + + // + public async void NewAddress() + { + newAddress81 newAddress81 = new newAddress81(); + newAddressResponse newAddressResponse = new newAddressResponse(); + newAddressResponse = await newAddress81.newAddress(nameInput.text,telInput.text,addresInput.text,detailInput.text); + } + + + // Update is called once per frame + void Update() + { + + } +} diff --git a/TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs.meta b/TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs.meta new file mode 100644 index 0000000..166baf2 --- /dev/null +++ b/TheStrongestSnail/Assets/Scripts/Address/NewAddressPanel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8df579c5d9c49946b093851a79e3a47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs b/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs index ae9bec3..48d0957 100644 --- a/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs +++ b/TheStrongestSnail/Assets/Scripts/Address/addressItem.cs @@ -23,8 +23,10 @@ public class addressItem : MonoBehaviour } - public void SetInfo() + public void SetInfo(Address address) { - + nameTxt.text = address.receiveName; + addressTxt.text = address.address; + telTxt.text = address.receivePhone; } } diff --git a/TheStrongestSnail/Assets/Scripts/AddressSystem8/newAddress81.cs b/TheStrongestSnail/Assets/Scripts/AddressSystem8/newAddress81.cs index a5b303a..0eaabd7 100644 --- a/TheStrongestSnail/Assets/Scripts/AddressSystem8/newAddress81.cs +++ b/TheStrongestSnail/Assets/Scripts/AddressSystem8/newAddress81.cs @@ -12,7 +12,7 @@ public class newAddress81 : MonoBehaviour //public async Task queryKnightBetResult(int KnightId) // 5.2.2//需传入KightId - public async Task newAddress(string receiveName, string receivePhone,string area, string address) + public async Task newAddress(string receiveName, string receivePhone,string area, string address) { // 准备请求的头部信息,包含授权令牌 Dictionary head81 = new Dictionary diff --git a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/NewAddressPanel.prefab b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/NewAddressPanel.prefab index bf0c504..9db7488 100644 --- a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/NewAddressPanel.prefab +++ b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/NewAddressPanel.prefab @@ -2772,6 +2772,7 @@ GameObject: m_Component: - component: {fileID: 2987401724823548006} - component: {fileID: 2987401724823548008} + - component: {fileID: 6307088045765265409} - component: {fileID: 2987401724823548007} m_Layer: 5 m_Name: NewAddressPanel @@ -2812,6 +2813,23 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2987401724823548005} m_CullTransparentMesh: 1 +--- !u!114 &6307088045765265409 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2987401724823548005} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f8df579c5d9c49946b093851a79e3a47, type: 3} + m_Name: + m_EditorClassIdentifier: + submitBtn: {fileID: 2987401723913972211} + nameInput: {fileID: 2987401724823610980} + telInput: {fileID: 2987401723687042710} + addresInput: {fileID: 2987401724969363256} + detailInput: {fileID: 2987401724644137107} --- !u!114 &2987401724823548007 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity index 701f6b0..a10d891 100644 --- a/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity +++ b/TheStrongestSnail/Assets/prefabs/HYLPrefabs/UI.unity @@ -948,27 +948,27 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 870.8313 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 122.7744 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 435.41565 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724014986002, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: -462.8004 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724065773185, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_RootOrder @@ -976,27 +976,27 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 870.8313 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 122.7744 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 435.41565 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724358874646, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: -61.3872 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724360385202, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_fontAsset @@ -1044,51 +1044,51 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 870.8313 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 122.7744 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 435.41565 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724514752353, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: -328.996 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.x - value: 870.8313 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_SizeDelta.y - value: 122.7744 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.x - value: 435.41565 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724723304547, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_AnchoredPosition.y - value: -195.19159 + value: 0 objectReference: {fileID: 0} - target: {fileID: 2987401724787116905, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_fontAsset @@ -1120,7 +1120,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 2987401724823548005, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 2987401724823548006, guid: eff2da918a3a81741b2b794c44b1545e, type: 3} propertyPath: m_Pivot.x @@ -1586,7 +1586,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4499171977555058829, guid: b7a2ccb5cba723240b3b23ecbfd825e2, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: -937.7574 objectReference: {fileID: 0} - target: {fileID: 4499171977774247193, guid: b7a2ccb5cba723240b3b23ecbfd825e2, type: 3} propertyPath: m_Name @@ -1594,7 +1594,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4499171977774247193, guid: b7a2ccb5cba723240b3b23ecbfd825e2, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 4499171977774247194, guid: b7a2ccb5cba723240b3b23ecbfd825e2, type: 3} propertyPath: m_Pivot.x