using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Device;
using UnityEngine.UI;

public class Thefifthstep : MonoBehaviour
{
    /// <summary>
    /// 初始化第五步操作
    /// </summary>
    public RectTransform thefifthsteppanl;
    /// <summary>
    /// 页面1
    /// </summary>
    public RectTransform thefifthsteppanl1;
    /// <summary>
    /// 第五步页面工单编号
    /// </summary>
    public InputField inputid5;
    /// <summary>
    /// 待办按钮
    /// </summary>
    public Button waittobedonebutton;
    /// <summary>
    /// 页面2
    /// </summary>
    public RectTransform thefifthsteppanl2;
    /// <summary>
    /// 输入工单编号输入框
    /// </summary>
    public InputField inputfid5;
    /// <summary>
    /// 查询工单按钮
    /// </summary>
    public Button viewbutton5;
    /// <summary>
    /// 页面3
    /// </summary>
    public RectTransform thefifthsteppanl3;
    /// <summary>
    /// 勾选高亮选择
    /// </summary>
    public Toggle serialtoggle;
    /// <summary>
    /// 高量图片选择
    /// </summary>
    public Image serial5;
    /// <summary>
    /// 合同违约按钮
    /// </summary>
    public Button contractbutton;
    /// <summary>
    /// 签收按钮
    /// </summary>
    public Button signforbutton5;
    /// <summary>
    /// 签收成功图片
    /// </summary>
    public Image signforimage5;
    /// <summary>
    /// 页面4
    /// </summary>
    public RectTransform thefifthsteppanl4;
    /// <summary>
    /// 高亮选项
    /// </summary>
    public Toggle examinetoggle5;
    /// <summary>
    /// 确认按钮
    /// </summary>
    public Button sendbutton55;
    void Start()
    {
        waittobedonebutton.onClick.AddListener(() =>
        {
            thefifthsteppanl1.gameObject.SetActive(false);
            thefifthsteppanl2.gameObject.SetActive(true);
        });
        viewbutton5.onClick.AddListener(() =>
        {
            thefifthsteppanl2.gameObject.SetActive(false);
            thefifthsteppanl3.gameObject.SetActive(true);   
        });
        serialtoggle.onValueChanged.AddListener(delegate
        {
            Getreveal(serialtoggle);
        });
        contractbutton.onClick.AddListener(() =>
        {
            thefifthsteppanl3.gameObject.SetActive(false);
            thefifthsteppanl4.gameObject.SetActive(true);

        });
        signforbutton5.onClick.AddListener(() =>
        {
            signforimage5.gameObject.SetActive(true);
            Invoke("Getreveal2", 1.5f);
        });
        sendbutton55.onClick.AddListener(() =>
        {
            thefifthsteppanl4.gameObject.SetActive(false);
        });
    }
    /// <summary>
    /// 关闭签收成功按钮
    /// </summary>
    private void Getreveal2()
    {
        signforimage5.gameObject.SetActive(false);
    }

    /// <summary>
    /// 图片显示高亮
    /// </summary>
    /// <param name="toggle"></param>
    private void Getreveal(Toggle toggle)
    {
        if (toggle.isOn)
        {
            serial5.gameObject.SetActive(true);
        }
        else
        {
            serial5.gameObject.SetActive(false);
        }
    }

    /// <summary>
    /// 初始化第五步界面
    /// </summary>
    public void Getscreen()
    {
        thefifthsteppanl.gameObject.SetActive(true);
    }
    void Update()
    {

    }
}
