using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
public class Stepeightpanl : MonoBehaviour
{
///
/// 初始化页面
///
public RectTransform stepeightpanl;
///
/// 页面1
///
public RectTransform stepeightpanl1;
///
/// 复制编号
///
public InputField inputid8;
///
/// 待办工单按钮
///
public Button waittobedonebutton8;
///
/// 页面2
///
public RectTransform stepeightpanl2;
///
/// 输入工单编号
///
public InputField inputfid8;
///
/// 查询工单按钮
///
public Button inquirebutton8;
///
/// 页面3
///
public RectTransform stepeightpanl3;
///
/// 勾选高亮选择
///
public Toggle serialtoggle8;
///
/// 勾选图片
///
public Image serialimage8;
///
/// 合同违约归档按钮
///
public Button recyclebutton8;
///
/// 签收按钮
///
public Button signforbutton8;
///
/// 签收按钮开关
///
private bool signforisp = false;
///
/// 合同签收成功图片
///
public Image signforimage8;
///
/// 页面4
///
public RectTransform stepeightpanl4;
///
/// 归档按钮
///
public Button archivistbutton;
///
/// 提示页面
///
public Whetherthandinpapersornot whetherthandinpapersornot;
///
/// 归档按钮判断
///
private bool archivsisp=true;
///
/// 第八步操作
///
private float stepeight1;
private float stepeight2;
private float stepeight3;
void Start()
{
waittobedonebutton8.onClick.AddListener(() =>
{
archivsisp = true;
stepeightpanl1.gameObject.SetActive(false);
stepeightpanl2.gameObject.SetActive(true);
});
inquirebutton8.onClick.AddListener(() =>
{
stepeightpanl2.gameObject.SetActive(false);
stepeightpanl3.gameObject.SetActive(true);
});
serialtoggle8.onValueChanged.AddListener(delegate
{
Getpicture(serialtoggle8);
});
recyclebutton8.onClick.AddListener(() =>
{
stepeightpanl3.gameObject.SetActive(false);
stepeightpanl4.gameObject.SetActive(true);
});
signforbutton8.onClick.AddListener(() =>
{
signforisp = true;
signforimage8.gameObject.SetActive(true);
Invoke("Getpicture2", 1.5f);
});
archivistbutton.onClick.AddListener(() =>
{
if (archivsisp)
{
Debug.Log("第八步判分");
if (serialtoggle8.isOn)
{
ScoreManager.Instance.AddScore(1.5f);//是否勾选
stepeight1 = ScoreManager.Instance.scores[7] * 0.2f;
}
if (signforisp)
{
ScoreManager.Instance.AddScore(2);//签收
stepeight2 = ScoreManager.Instance.scores[7] * 0.2f;
}
ScoreManager.Instance.AddScore(9);
stepeight3 = ScoreManager.Instance.scores[7] * 0.6f;
float value = stepeight1 + stepeight2 + stepeight3;
ScoreManager.Instance.totalpoints.Add(value);
Debug.Log(ScoreManager.Instance.Score);
archivsisp = false;
}
whetherthandinpapersornot.gameObject.SetActive(true);
});
Tipspanl();
}
///
/// 提示是否交卷页面
///
private void Tipspanl()
{
whetherthandinpapersornot.Cancel(() =>
{
whetherthandinpapersornot.gameObject.SetActive(false);
});
whetherthandinpapersornot.Submitbon(() =>
{
if (ScoreManager.Instance.Subject==Subject.Performanceexamination)
{
Submit game1 = GameObject.Find("MianCanvas").GetComponent();
game1.Handinanexaminationpaper1();
}
});
}
public void Getpicture2()
{
signforimage8.gameObject.SetActive(false);
}
///
/// 显示图片
///
///
public void Getpicture(Toggle toggle)
{
if (toggle.isOn)
{
serialimage8.gameObject.SetActive(true);
}
else
{
serialimage8.gameObject.SetActive(false);
}
}
///
/// 初始化页面方法
///
public void Getpage8()
{
stepeightpanl.gameObject.SetActive(true);
}
///
/// 得分初始化步骤
///
public void Getrestore8()
{
inputfid8.text = null;
serialtoggle8.isOn = false;
serialimage8.gameObject.SetActive(false);
}
void Update()
{
}
}