|
@@ -13,7 +13,7 @@ public class TaskPhotoPanel : MonoBehaviour
|
|
|
public Button lastItem;
|
|
|
public Button nextItem;
|
|
|
|
|
|
- public B08_TaskItems[] task_items;
|
|
|
+ public B08_TaskItems task_item;
|
|
|
public int currentIndex = 0;
|
|
|
|
|
|
public Text dateText;
|
|
@@ -25,17 +25,22 @@ public class TaskPhotoPanel : MonoBehaviour
|
|
|
nextItem.onClick.AddListener(Next);
|
|
|
}
|
|
|
|
|
|
- public void SetData(B08_TaskItems[] items, string _time)
|
|
|
+ public void SetData(B08_TaskItems item, string _time)
|
|
|
{
|
|
|
currentIndex = 0;
|
|
|
- task_items = items;
|
|
|
+ task_item = item;
|
|
|
_timeInfo = _time;
|
|
|
+
|
|
|
+ posText.text = task_item.faItemName;
|
|
|
+ messageText.text = task_item.remark == null? "暂无内容": task_item.remark;
|
|
|
+ dateText.text = task_item.finishedTime == null?_timeInfo: task_item.finishedTime;
|
|
|
+
|
|
|
ChangePage(currentIndex);
|
|
|
}
|
|
|
|
|
|
public void Next()
|
|
|
{
|
|
|
- if (currentIndex < task_items.Length - 1)
|
|
|
+ if (currentIndex < task_item.files.Length - 1)
|
|
|
{
|
|
|
currentIndex++;
|
|
|
ChangePage(currentIndex);
|
|
@@ -53,19 +58,23 @@ public class TaskPhotoPanel : MonoBehaviour
|
|
|
|
|
|
public void ChangePage(int pageIndex)
|
|
|
{
|
|
|
- var currentData = task_items[pageIndex];
|
|
|
- if (currentData.files.Length > 0)
|
|
|
+ img.texture = null;
|
|
|
+ if (task_item.files.Length < 1)
|
|
|
+ {
|
|
|
+ pageText.text = $"0/0";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var currentData = task_item.files[pageIndex];
|
|
|
+ if (currentData.filePath!=null&&!currentData.filePath.Equals(""))
|
|
|
{
|
|
|
- string path = "http://58.19.230.46:9180/prod-api/uploads/" + currentData.files[0].filePath;
|
|
|
+ string path = "http://58.19.230.46:9180/prod-api/uploads/" + currentData.filePath;
|
|
|
TextureLoadHelp._Instance.LoadTexFromUrl(path, img);
|
|
|
}
|
|
|
else {
|
|
|
img.texture = null;
|
|
|
}
|
|
|
- Debug.Log(currentData.faItemName + " " + currentData.startTime + " " + currentData.finishedTime);
|
|
|
- posText.text = currentData.faItemName;
|
|
|
- messageText.text = currentData.remark == null? "暂无内容": currentData.remark;
|
|
|
- pageText.text = $"{pageIndex + 1}/{task_items.Length}";
|
|
|
- dateText.text = currentData.finishedTime == null?_timeInfo: currentData.finishedTime;
|
|
|
+ //Debug.Log(currentData.faItemName + " " + currentData.startTime + " " + currentData.finishedTime);
|
|
|
+
|
|
|
+ pageText.text = $"{pageIndex + 1}/{task_item.files.Length}";
|
|
|
}
|
|
|
}
|