using System;
using System.Collections;
using System.Collections.Generic;
using System.Xml.Serialization;
using UnityEngine;
using UnityEngine.UI;

public class Signforpanl : MonoBehaviour
{
    /// <summary>
    /// 签收页面
    /// </summary>
    public RectTransform signforpanl;
    /// <summary>
    /// 文本传递的内容
    /// </summary>
    public Text contenttext1;
    public Text contenttext2;
    public Text contenttext3;
    /// <summary>
    /// 签收确认按钮
    /// </summary>
    public Button isbutton;
    /// <summary>
    /// 显示查看信息页面
    /// </summary>
    public RectTransform controlspanl1;
    /// <summary>
    /// 传递文本内容
    /// </summary>
    public Text contenttext4, contenttext5, contenttext6;
    /// <summary>
    /// 查看人员信息按钮
    /// </summary>
    public Button viewbutton;
    /// <summary>
    /// 遮挡名字图片
    /// </summary>
    public Image zhednag;
    /// <summary>
    /// 显示名字文本
    /// </summary>
    public Text nametext;
    /// <summary>
    /// 派工按钮
    /// </summary>
    public Button sendworkbutton;
    /// <summary>
    /// 查找人员信息页面
    /// </summary>
    public RectTransform controlspanl2;
    /// <summary>
    /// 人员输入列表
    /// </summary>
    public InputField inputname;
    /// <summary>
    /// 人员查询按钮
    /// </summary>
    public Button inquirebuton;
    /// <summary>
    /// 显示人员信息面板
    /// </summary>
    public RectTransform controlspanl3;
    /// <summary>
    /// 点击高亮显示圆圈
    /// </summary>
    public Image checkimage;
    /// <summary>
    /// 点击显示按钮
    /// </summary>
    public Button checkbutton;
    /// <summary>
    /// 点击确认按钮
    /// </summary>
    public Button verifybutton;
    /// <summary>
    /// 第三步步骤显示
    /// </summary>
    public RectTransform thethirdsteppanl;
    void Start()
    {
        inquirebuton.onClick.AddListener(() =>
        {
            if (inputname.text.Contains("原"))
            {
                controlspanl2.gameObject.SetActive(false);
                controlspanl3.gameObject.SetActive(true);
            }
        });
        checkbutton.onClick.AddListener(() =>
        {
            checkimage.gameObject.SetActive(true);
        });
        verifybutton.onClick.AddListener(() =>
        {
            controlspanl3.gameObject.SetActive(false );
            zhednag.gameObject.SetActive(true);
            nametext.gameObject.SetActive(true);    
            controlspanl1.gameObject.SetActive(true);
        });
        sendworkbutton.onClick.AddListener(() =>
        {
            controlspanl1.gameObject.SetActive(false);
            thethirdsteppanl.gameObject.SetActive(true);    
        });
    }
    /// <summary>
    /// 传递参数
    /// </summary>
    /// <param name="str1"></param>
    /// <param name="str2"></param>
    /// <param name="str3"></param>
    public void Passbyvalue(string str1,string str2,string str3)
    {
        contenttext1.text = str1;
        contenttext2.text = str2;
        contenttext3.text = str3;
    }
    /// <summary>
    /// 准备执行按钮操作
    /// </summary>
    public void EquippingItems(Action action)
    {
        isbutton.onClick.AddListener(() =>
        {
            action?.Invoke();
        });
    }
    /// <summary>
    /// 初始化文本
    /// </summary>
    /// <param name="str1"></param>
    /// <param name="str2"></param>
    /// <param name="str3"></param>
    public void Getvalue(string str1, string str2, string str3)
    {
        contenttext4.text = str1;
        contenttext5.text = str2;
        contenttext6.text = str3;
    }
    public void EquippingItems2(Action action)
    {
        viewbutton.onClick.AddListener(() =>
        {
            action?.Invoke();
        });
    }
    void Update()
    {
        
    }
}
