2025-08-27 01:05:19 +08:00
|
|
|
using HK.Keyboard;
|
2025-07-11 22:35:50 +08:00
|
|
|
using Runtime;
|
2025-07-10 23:16:27 +08:00
|
|
|
using UnityEngine.UI;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
2025-08-27 01:05:19 +08:00
|
|
|
using ZGame;
|
2025-07-10 23:16:27 +08:00
|
|
|
|
2025-08-20 11:14:21 +08:00
|
|
|
namespace HK.FUJIFILM
|
2025-07-10 23:16:27 +08:00
|
|
|
{
|
|
|
|
public class SubmitMessageUI : UIBase
|
|
|
|
{
|
|
|
|
[SerializeField] private UpMenuItem goUpMenu;
|
|
|
|
[SerializeField] private TMP_InputField inpName;
|
|
|
|
[SerializeField] private TMP_Text txtNameError;
|
|
|
|
[SerializeField] private TMP_InputField inpMobile;
|
|
|
|
[SerializeField] private TMP_Text txtModileError;
|
|
|
|
[SerializeField] private TMP_InputField inpEmail;
|
|
|
|
[SerializeField] private Toggle togIsAgree;
|
2025-07-11 22:35:50 +08:00
|
|
|
[SerializeField] private Button btnNext;
|
2025-07-10 23:16:27 +08:00
|
|
|
|
|
|
|
public override void OnInit()
|
|
|
|
{
|
|
|
|
base.OnInit();
|
|
|
|
|
|
|
|
#region AutoGen_Init
|
|
|
|
|
|
|
|
goUpMenu = GetValue<UpMenuItem>("goUpMenu");
|
|
|
|
inpName = GetValue<TMP_InputField>("inpName");
|
|
|
|
txtNameError = GetValue<TMP_Text>("txtNameError");
|
|
|
|
inpMobile = GetValue<TMP_InputField>("inpMobile");
|
|
|
|
txtModileError = GetValue<TMP_Text>("txtModileError");
|
|
|
|
inpEmail = GetValue<TMP_InputField>("inpEmail");
|
|
|
|
togIsAgree = GetValue<Toggle>("togIsAgree");
|
2025-07-11 22:35:50 +08:00
|
|
|
btnNext = GetValue<Button>("btnNext");
|
2025-07-10 23:16:27 +08:00
|
|
|
|
|
|
|
togIsAgree.onValueChanged.AddListener(OnValueChangedtogIsAgree);
|
2025-07-11 22:35:50 +08:00
|
|
|
btnNext.onClick.AddListener(OnCilckbtnNext);
|
2025-07-10 23:16:27 +08:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
2025-08-20 11:14:21 +08:00
|
|
|
goUpMenu.ReturnAction += Return;
|
2025-07-10 23:16:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private void Return()
|
|
|
|
{
|
2025-08-28 23:32:43 +08:00
|
|
|
EventManager.Instance.FireNow(this, new CloseKeyboardEventArgs());
|
2025-08-27 01:05:19 +08:00
|
|
|
// UIManager.Instance.BackLast();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnOpen(UIBase lastUI = null)
|
|
|
|
{
|
|
|
|
base.OnOpen(lastUI);
|
2025-08-28 23:32:43 +08:00
|
|
|
EventManager.Instance.FireNow(this, new CloseKeyboardEventArgs());
|
2025-07-10 23:16:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#region AutoGen_Method
|
|
|
|
|
2025-07-11 22:35:50 +08:00
|
|
|
private void OnCilckbtnNext()
|
|
|
|
{
|
2025-08-21 13:10:17 +08:00
|
|
|
if (string.IsNullOrEmpty(inpName.text))
|
|
|
|
{
|
|
|
|
txtNameError.gameObject.SetActive(true);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
txtNameError.gameObject.SetActive(false);
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(inpMobile.text))
|
|
|
|
{
|
|
|
|
txtModileError.gameObject.SetActive(true);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
txtModileError.gameObject.SetActive(false);
|
|
|
|
|
2025-08-28 23:32:43 +08:00
|
|
|
OnPause();
|
2025-07-11 22:35:50 +08:00
|
|
|
ShoppingCartManager.Instance.ShoppingCart.userName = inpName.text;
|
|
|
|
ShoppingCartManager.Instance.ShoppingCart.userModie = inpMobile.text;
|
|
|
|
ShoppingCartManager.Instance.ShoppingCart.userEmail = inpEmail.text;
|
|
|
|
ShoppingCartManager.Instance.ShoppingCart.isAgreeSubscribe = togIsAgree.isOn;
|
2025-08-21 13:10:17 +08:00
|
|
|
|
|
|
|
var i = PlayerPersistent.GetInt("OrderID");
|
|
|
|
ShoppingCartManager.Instance.ShoppingCart.orderID = $"{i}";
|
|
|
|
PlayerPersistent.SetInt("OrderID", i + 1);
|
2025-08-28 23:32:43 +08:00
|
|
|
EventManager.Instance.FireNow(this, new CloseKeyboardEventArgs());
|
2025-08-21 13:10:17 +08:00
|
|
|
UIManager.Instance.ShowUI(nameof(PrintReceiptUI), this);
|
2025-07-11 22:35:50 +08:00
|
|
|
}
|
|
|
|
|
2025-07-10 23:16:27 +08:00
|
|
|
private void OnValueChangedtogIsAgree(bool b)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
public override void OnDispose()
|
|
|
|
{
|
|
|
|
base.OnDispose();
|
2025-08-20 11:14:21 +08:00
|
|
|
goUpMenu.ReturnAction -= Return;
|
2025-07-10 23:16:27 +08:00
|
|
|
|
|
|
|
#region AutoGen_Dispose
|
|
|
|
|
|
|
|
togIsAgree.onValueChanged.RemoveListener(OnValueChangedtogIsAgree);
|
2025-07-11 22:35:50 +08:00
|
|
|
btnNext.onClick.RemoveListener(OnCilckbtnNext);
|
2025-07-10 23:16:27 +08:00
|
|
|
|
|
|
|
goUpMenu = null;
|
|
|
|
inpName = null;
|
|
|
|
txtNameError = null;
|
|
|
|
inpMobile = null;
|
|
|
|
txtModileError = null;
|
|
|
|
inpEmail = null;
|
|
|
|
togIsAgree = null;
|
|
|
|
btnNext = null;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|