TaskPhotoPanel.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class TaskPhotoPanel : MonoBehaviour
  7. {
  8. // public RawImage img;
  9. // public Text posText;
  10. // public Text messageText;
  11. // public Text pageText;
  12. // public Button lastItem;
  13. // public Button nextItem;
  14. //
  15. // public B08_TaskItems task_item;
  16. // public int currentIndex = 0;
  17. //
  18. // public Text dateText;
  19. // public string _timeInfo;
  20. //
  21. // private void Awake()
  22. // {
  23. // lastItem.onClick.AddListener(Last);
  24. // nextItem.onClick.AddListener(Next);
  25. // }
  26. //
  27. // public void SetData(B08_TaskItems item, string _time)
  28. // {
  29. // currentIndex = 0;
  30. // task_item = item;
  31. // _timeInfo = _time;
  32. //
  33. // posText.text = task_item.faItemName;
  34. // messageText.text = task_item.itemDescription == null? "暂无内容": task_item.itemDescription;
  35. // dateText.text = task_item.finishedTime == null?_timeInfo: task_item.finishedTime;
  36. //
  37. // ChangePage(currentIndex);
  38. // }
  39. //
  40. // public void Next()
  41. // {
  42. // if (task_item is { files: not null } && currentIndex < task_item.files.Length - 1)
  43. // {
  44. // currentIndex++;
  45. // ChangePage(currentIndex);
  46. // }
  47. // }
  48. //
  49. // public void Last()
  50. // {
  51. // if (task_item is { files: not null } &&currentIndex > 0)
  52. // {
  53. // currentIndex--;
  54. // ChangePage(currentIndex);
  55. // }
  56. // }
  57. //
  58. // public void ChangePage(int pageIndex)
  59. // {
  60. // img.texture = null;
  61. // if (task_item?.files == null || task_item.files.Length < 1)
  62. // {
  63. // pageText.text = $"0/0";
  64. // return;
  65. // }
  66. // var currentData = task_item.files[pageIndex];
  67. // if (currentData.filePath!=null&&!currentData.filePath.Equals(""))
  68. // {
  69. // string path = "http://58.19.230.46:9180/prod-api/uploads/" + currentData.filePath;
  70. // TextureLoadHelp._Instance.LoadTexFromUrl(path, img);
  71. // }
  72. // else {
  73. // img.texture = null;
  74. // }
  75. // //Debug.Log(currentData.faItemName + " " + currentData.startTime + " " + currentData.finishedTime);
  76. //
  77. // pageText.text = $"{pageIndex + 1}/{task_item.files.Length}";
  78. // }
  79. }