536 lines
14 KiB
C#
536 lines
14 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
using static UnityEngine.LightProbeProxyVolume;
|
|
|
|
public class Stepfourpanl : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 初始化面板
|
|
/// </summary>
|
|
public RectTransform stepfourpanl;
|
|
/// <summary>
|
|
/// 页面1
|
|
/// </summary>
|
|
public RectTransform stepfourpanl1;
|
|
/// <summary>
|
|
/// 复制的工单号
|
|
/// </summary>
|
|
public InputField workorderinput;
|
|
/// <summary>
|
|
/// 工单确认按钮
|
|
/// </summary>
|
|
public Button workorderbutton4;
|
|
/// <summary>
|
|
/// 页面2
|
|
/// </summary>
|
|
public RectTransform stepfourpanl2;
|
|
/// <summary>
|
|
/// 输入id
|
|
/// </summary>
|
|
public InputField inputid;
|
|
/// <summary>
|
|
/// 查询按钮
|
|
/// </summary>
|
|
public Button buttoninquire;
|
|
/// <summary>
|
|
/// 选择按钮
|
|
/// </summary>
|
|
public Toggle selecttoggle;
|
|
/// <summary>
|
|
/// 图片显示
|
|
/// </summary>
|
|
public Image select2;
|
|
/// <summary>
|
|
/// 合同违约按钮
|
|
/// </summary>
|
|
public Button breakbutton;
|
|
/// <summary>
|
|
/// 签收按钮
|
|
/// </summary>
|
|
public Button signforbutton4;
|
|
/// <summary>
|
|
/// 签到分数只保存一次
|
|
/// </summary>
|
|
private bool signisp = false;
|
|
/// <summary>
|
|
/// 签收成功图片
|
|
/// </summary>
|
|
public Image tipsiamge;
|
|
/// <summary>
|
|
/// 页面3
|
|
/// </summary>
|
|
public RectTransform stepfourpanl3;
|
|
/// <summary>
|
|
/// 退补按钮
|
|
/// </summary>
|
|
public Button refundbutton;
|
|
/// <summary>
|
|
/// 页面4
|
|
/// </summary>
|
|
public RectTransform stepfourpanl4;
|
|
/// <summary>
|
|
/// 选择的选项
|
|
/// </summary>
|
|
public Dropdown dropdownprice;
|
|
/// <summary>
|
|
/// 新增按钮
|
|
/// </summary>
|
|
public Button newbutton;
|
|
|
|
/// <summary>
|
|
/// 提示选择图片
|
|
/// </summary>
|
|
public Image promptpicture;
|
|
/// <summary>
|
|
/// 页面5
|
|
/// </summary>
|
|
public RectTransform stepfourpanl5;
|
|
/// <summary>
|
|
/// 选择日期按钮
|
|
/// </summary>
|
|
public Button databutton3;
|
|
/// <summary>
|
|
/// 页面6
|
|
/// </summary>
|
|
public RectTransform stepfourpanl6;
|
|
/// <summary>
|
|
/// 输入日期的初始时间
|
|
/// </summary>
|
|
public InputField inputdata1;
|
|
/// <summary>
|
|
/// 输入日期结束时间
|
|
/// </summary>
|
|
public InputField inputdata2;
|
|
/// <summary>
|
|
/// 查询按钮
|
|
/// </summary>
|
|
public Button inquirebutton6;
|
|
// 定义日期格式,可以根据需要添加更多格式
|
|
private string[] dateFormats = new string[] { "yyyy-MM-dd", "dd/MM/yyyy", "MM/dd/yyyy" };
|
|
/// <summary>
|
|
/// 页面7
|
|
/// </summary>
|
|
public RectTransform stepfourpanl7;
|
|
/// <summary>
|
|
/// 显示的文本
|
|
/// </summary>
|
|
public Text revealtext1, revealtext2, revealtext3, revealtext4;
|
|
/// <summary>
|
|
/// 勾选选择显示
|
|
/// </summary>
|
|
public Toggle selecttoggle3;
|
|
/// <summary>
|
|
/// 勾选显示图片
|
|
/// </summary>
|
|
public Toggle selecttoggle4;
|
|
/// <summary>
|
|
/// 显示勾选图片
|
|
/// </summary>
|
|
public Image select6;
|
|
/// <summary>
|
|
/// 确认按钮
|
|
/// </summary>
|
|
public Button verifybutton6;
|
|
/// <summary>
|
|
/// 页面8
|
|
/// </summary>
|
|
public RectTransform stepfourpanl8;
|
|
/// <summary>
|
|
/// 查询的按钮
|
|
/// </summary>
|
|
public Button inquirebutton7;
|
|
/// <summary>
|
|
/// 页面9
|
|
/// </summary>
|
|
public RectTransform stepfourpanl9;
|
|
/// <summary>
|
|
/// 勾线显示
|
|
/// </summary>
|
|
public Toggle checktoggle1, checktoggle2, checktoggle3, checktoggle4, checktoggle5;
|
|
/// <summary>
|
|
/// 图片显示
|
|
/// </summary>
|
|
public Image check2;
|
|
/// <summary>
|
|
/// 确认按钮
|
|
/// </summary>
|
|
public Button verifybutton8;
|
|
/// <summary>
|
|
/// 页面10
|
|
/// </summary>
|
|
public RectTransform stepfourpanl10;
|
|
/// <summary>
|
|
/// 保存按钮
|
|
/// </summary>
|
|
public Button savebutton4;
|
|
/// <summary>
|
|
/// 页面11
|
|
/// </summary>
|
|
public RectTransform stepfourpanl11;
|
|
/// <summary>
|
|
/// 输入电费的倍数
|
|
/// </summary>
|
|
public InputField electricityinput;
|
|
/// <summary>
|
|
/// 保存按钮
|
|
/// </summary>
|
|
public Button savebutton8;
|
|
/// <summary>
|
|
/// 显示保存的图片
|
|
/// </summary>
|
|
public Image saveimage6;
|
|
/// <summary>
|
|
/// 发送按钮
|
|
/// </summary>
|
|
public Button sendbutton6;
|
|
|
|
void Start()
|
|
{
|
|
workorderbutton4.onClick.AddListener(() =>
|
|
{
|
|
|
|
|
|
|
|
stepfourpanl1.gameObject.SetActive(false);
|
|
stepfourpanl2.gameObject.SetActive(true);
|
|
});
|
|
selecttoggle.onValueChanged.AddListener((ison) =>
|
|
{
|
|
if (ison)
|
|
{
|
|
select2.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
select2.gameObject.SetActive(false);
|
|
}
|
|
});
|
|
breakbutton.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl2.gameObject.SetActive(false);
|
|
stepfourpanl3.gameObject.SetActive(true);
|
|
});
|
|
signforbutton4.onClick.AddListener(() =>
|
|
{
|
|
|
|
signisp = true;
|
|
tipsiamge.gameObject.SetActive(true);
|
|
Invoke("Getreveal", 1.5f);
|
|
});
|
|
refundbutton.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl3.gameObject.SetActive(false);
|
|
stepfourpanl4.gameObject.SetActive(true);
|
|
});
|
|
newbutton.onClick.AddListener(() =>
|
|
{
|
|
|
|
if (dropdownprice.captionText.text.Length > 0)
|
|
{
|
|
stepfourpanl4.gameObject.SetActive(false);
|
|
stepfourpanl5.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
promptpicture.gameObject.SetActive(true);
|
|
Invoke("Getreveal2", 1.5f);
|
|
}
|
|
});
|
|
databutton3.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl5.gameObject.SetActive(false);
|
|
stepfourpanl6.gameObject.SetActive(true);
|
|
});
|
|
inquirebutton6.onClick.AddListener(Comparedata);
|
|
selecttoggle3.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture(selecttoggle3);
|
|
});
|
|
selecttoggle4.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture10(selecttoggle4);
|
|
});
|
|
verifybutton6.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl7.gameObject.SetActive(false);
|
|
stepfourpanl8.gameObject.SetActive(true);
|
|
});
|
|
inquirebutton7.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl8.gameObject.SetActive(false);
|
|
stepfourpanl9.gameObject.SetActive(true);
|
|
});
|
|
checktoggle4.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture2(checktoggle4);
|
|
});
|
|
checktoggle1.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture8(checktoggle1);
|
|
});
|
|
checktoggle2.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture8(checktoggle2);
|
|
});
|
|
checktoggle3.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture8(checktoggle3);
|
|
});
|
|
checktoggle5.onValueChanged.AddListener(delegate
|
|
{
|
|
Getpicture8(checktoggle5);
|
|
});
|
|
verifybutton8.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl9.gameObject.SetActive(false);
|
|
stepfourpanl10.gameObject.SetActive(true);
|
|
});
|
|
savebutton4.onClick.AddListener(() =>
|
|
{
|
|
stepfourpanl10.gameObject.SetActive(false);
|
|
stepfourpanl11.gameObject.SetActive(true);
|
|
});
|
|
savebutton8.onClick.AddListener(() =>
|
|
{
|
|
if (electricityinput.text.Length > 0)
|
|
{
|
|
saveimage6.gameObject.SetActive(true);
|
|
Invoke("Getpicture3", 1.5f);
|
|
}
|
|
});
|
|
sendbutton6.onClick.AddListener(() =>
|
|
{
|
|
Debug.Log("第四步判分");
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexercise ||
|
|
ScoreManager.Instance.Subject == Subject.Electricchargeexercise ||
|
|
ScoreManager.Instance.Subject == Subject.Aluminoelectricexercise)
|
|
{
|
|
Practicescore4();
|
|
}
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexamination)
|
|
{
|
|
Judgmentstep4();
|
|
}
|
|
stepfourpanl11.gameObject.SetActive(false);
|
|
});
|
|
}
|
|
/// <summary>
|
|
/// 练习步骤得分
|
|
/// </summary>
|
|
private void Practicescore4()
|
|
{
|
|
if (selecttoggle.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(2.5f);//是否勾选
|
|
}
|
|
if (signisp)
|
|
{
|
|
ScoreManager.Instance.AddScore(2);//签收
|
|
}
|
|
if (dropdownprice.captionText.text == "价格表")
|
|
{
|
|
ScoreManager.Instance.AddScore(2f);//判断是否选择价格表
|
|
}
|
|
if (selecttoggle3.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(2);
|
|
}
|
|
if (checktoggle4.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(2);
|
|
}
|
|
if (electricityinput.text == "3")
|
|
{
|
|
ScoreManager.Instance.AddScore(2);//判断是否输入三倍
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 考试步骤得分
|
|
/// </summary>
|
|
private void Judgmentstep4()
|
|
{
|
|
float score = 0f;
|
|
string str;
|
|
if(selecttoggle.isOn)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[3]) * 0.2f);
|
|
}
|
|
if (signisp)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[3]) * 0.16f);
|
|
}
|
|
if (dropdownprice.captionText.text == "价格表")
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[3]) * 0.16f);
|
|
}
|
|
if (selecttoggle3.isOn)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[3]) * 0.16f);
|
|
}
|
|
if (checktoggle4.isOn)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[3]) * 0.16f);
|
|
}
|
|
if (electricityinput.text == "3")
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[3]) * 0.16f);
|
|
}
|
|
if ((score - Mathf.Floor(score)) < 0.001f)
|
|
{
|
|
str = score.ToString();
|
|
}
|
|
else
|
|
{
|
|
str = score.ToString("0.000");
|
|
}
|
|
ScoreManager.Instance.Honourscores[3] = float.Parse(str);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 消失保存图片
|
|
/// </summary>
|
|
private void Getpicture3()
|
|
{
|
|
saveimage6.gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 显示对应图片
|
|
/// </summary>
|
|
/// <param name="toggle"></param>
|
|
private void Getpicture2(Toggle toggle)
|
|
{
|
|
if (toggle.isOn)
|
|
{
|
|
|
|
check2.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
|
|
check2.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 显示对应图片
|
|
/// </summary>
|
|
/// <param name="toggle"></param>
|
|
private void Getpicture8(Toggle toggle)
|
|
{
|
|
if (toggle.isOn)
|
|
{
|
|
check2.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
check2.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 比较两个日期的大小
|
|
/// </summary>
|
|
private void Comparedata()
|
|
{
|
|
DateTime datevalue1;
|
|
DateTime datevalue2;
|
|
if (DateTime.TryParseExact(inputdata1.text, dateFormats, null, System.Globalization.DateTimeStyles.None, out datevalue1) &&
|
|
DateTime.TryParseExact(inputdata2.text, dateFormats, null, System.Globalization.DateTimeStyles.None, out datevalue2))
|
|
{
|
|
if (DateTime.Compare(DateTime.Parse(inputdata1.text), DateTime.Parse(inputdata2.text)) < 0)
|
|
{
|
|
stepfourpanl6.gameObject.SetActive(false);
|
|
revealtext1.text = inputdata1.text;
|
|
revealtext2.text = inputdata2.text;
|
|
revealtext3.text = inputdata1.text;
|
|
revealtext4.text = inputdata2.text;
|
|
stepfourpanl7.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 关闭提示
|
|
/// </summary>
|
|
private void Getreveal2()
|
|
{
|
|
promptpicture.gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 关闭提示
|
|
/// </summary>
|
|
private void Getreveal()
|
|
{
|
|
tipsiamge.gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化显示面板方法
|
|
/// </summary>
|
|
public void Getinception(bool bol)
|
|
{
|
|
stepfourpanl.gameObject.SetActive(bol);
|
|
}
|
|
/// <summary>
|
|
/// 显示的勾选图片
|
|
/// </summary>
|
|
public void Getpicture(Toggle toggle)
|
|
{
|
|
if (toggle.isOn)
|
|
{
|
|
|
|
select6.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
|
|
select6.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 显示的勾选图片
|
|
/// </summary>
|
|
public void Getpicture10(Toggle toggle)
|
|
{
|
|
if (toggle.isOn)
|
|
{
|
|
select6.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
select6.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 初始化页面
|
|
/// </summary>
|
|
public void Getrestore4()
|
|
{
|
|
inputid.text = null;
|
|
selecttoggle.isOn = false;
|
|
select2.gameObject.SetActive(false);
|
|
dropdownprice.value = 0;
|
|
inputdata1.text = null;
|
|
inputdata2.text = null;
|
|
selecttoggle3.isOn = false;
|
|
selecttoggle4.isOn = false;
|
|
select6.gameObject.SetActive(false);
|
|
checktoggle1.isOn = false;
|
|
checktoggle2.isOn = false;
|
|
checktoggle3.isOn = false;
|
|
checktoggle4.isOn = false;
|
|
checktoggle5.isOn = false;
|
|
check2.gameObject.SetActive(false);
|
|
electricityinput.text = null;
|
|
}
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
}
|