95 lines
3.0 KiB
C#
95 lines
3.0 KiB
C#
using Runtime;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace HK
|
|
{
|
|
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;
|
|
[SerializeField] private Button btnNext;
|
|
[SerializeField] private Image Keyboard_Name;
|
|
[SerializeField] private Image Keyboard_Mobile;
|
|
[SerializeField] private Image Keyboard_Email;
|
|
|
|
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");
|
|
btnNext = GetValue<Button>("btnNext");
|
|
Keyboard_Name = GetValue<Image>("Keyboard_Name");
|
|
Keyboard_Mobile = GetValue<Image>("Keyboard_Mobile");
|
|
Keyboard_Email = GetValue<Image>("Keyboard_Email");
|
|
|
|
togIsAgree.onValueChanged.AddListener(OnValueChangedtogIsAgree);
|
|
btnNext.onClick.AddListener(OnCilckbtnNext);
|
|
|
|
#endregion
|
|
|
|
goUpMenu.OnClickReturn += Return;
|
|
}
|
|
|
|
private void Return()
|
|
{
|
|
UIManager.Instance.BackLast();
|
|
}
|
|
|
|
#region AutoGen_Method
|
|
|
|
private void OnCilckbtnNext()
|
|
{
|
|
ShoppingCartManager.Instance.ShoppingCart.userName = inpName.text;
|
|
ShoppingCartManager.Instance.ShoppingCart.userModie = inpMobile.text;
|
|
ShoppingCartManager.Instance.ShoppingCart.userEmail = inpEmail.text;
|
|
ShoppingCartManager.Instance.ShoppingCart.isAgreeSubscribe = togIsAgree.isOn;
|
|
UIManager.Instance.ShowUIOnly(nameof(PrintReceiptUI));
|
|
}
|
|
|
|
private void OnValueChangedtogIsAgree(bool b)
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
public override void OnDispose()
|
|
{
|
|
base.OnDispose();
|
|
goUpMenu.OnClickReturn += Return;
|
|
|
|
#region AutoGen_Dispose
|
|
|
|
togIsAgree.onValueChanged.RemoveListener(OnValueChangedtogIsAgree);
|
|
btnNext.onClick.RemoveListener(OnCilckbtnNext);
|
|
|
|
goUpMenu = null;
|
|
inpName = null;
|
|
txtNameError = null;
|
|
inpMobile = null;
|
|
txtModileError = null;
|
|
inpEmail = null;
|
|
togIsAgree = null;
|
|
btnNext = null;
|
|
Keyboard_Name = null;
|
|
Keyboard_Mobile = null;
|
|
Keyboard_Email = null;
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
} |