84 lines
2.2 KiB
C#
84 lines
2.2 KiB
C#
using Components;
|
||
using JData;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
//============================================================
|
||
//支持中文,文件使用UTF-8编码
|
||
//@author YangHua
|
||
//@create 20230914
|
||
//@company Adam
|
||
//
|
||
//@description:工作卡控制器
|
||
//============================================================
|
||
namespace Adam
|
||
{
|
||
public class JobCardController : MonoBehaviour
|
||
{
|
||
public string url = "http://111.229.30.246:10013/Handler/Taiqu.ashx?action=kh&bianhao=";
|
||
public InputField[] userIDs;
|
||
public InputField[] userNames;
|
||
public InputField[] workSpace;
|
||
public GameObject jobCardPanel;
|
||
public GameObject jobChoiceQuestionPanel;
|
||
public OptionItem optionItemPrefab;
|
||
public Transform optionItemContent;
|
||
/// <summary>
|
||
/// 风险点分析
|
||
/// </summary>
|
||
public Button RiskPointAnalysisBtn;
|
||
/// <summary>
|
||
/// 安全措施
|
||
/// </summary>
|
||
public Button SafetyMeasuresBtn;
|
||
// Use this for initialization
|
||
private void Start()
|
||
{
|
||
for (int i = 0; i < userIDs.Length; i++)
|
||
{
|
||
int index = i;
|
||
userIDs[index].onSubmit.AddListener((string numb) =>
|
||
{
|
||
GetValue(numb, index);
|
||
});
|
||
}
|
||
|
||
|
||
|
||
jobCardPanel.SetActive(false);
|
||
jobChoiceQuestionPanel.SetActive(false);
|
||
}
|
||
|
||
public async void GetValue(string numb, int _index)
|
||
{
|
||
Debug.Log(numb);
|
||
string _url = url + numb;
|
||
JobCardData jData = await AsyncWebReq.Get<JobCardData>(_url);
|
||
userNames[_index].text = jData.data.name;
|
||
workSpace[_index].text = jData.data.adress;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 0- 风险点,1-安全措施
|
||
/// </summary>
|
||
/// <param name="index"></param>
|
||
public void OnClick(int index)
|
||
{
|
||
jobChoiceQuestionPanel.SetActive(true);
|
||
if (index == 0)
|
||
{
|
||
|
||
}
|
||
else if (index == 1)
|
||
{
|
||
|
||
}
|
||
else
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|