48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
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;
|
||
// 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);
|
||
}
|
||
|
||
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;
|
||
|
||
}
|
||
}
|
||
}
|