Selaa lähdekoodia

修改一波巡检任务

Void_F 1 päivä sitten
vanhempi
sitoutus
9040387f88

+ 2 - 2
Assets/Prefabs/UI/Item/xunJianRenWuItem.prefab

@@ -556,7 +556,7 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 1, y: 1}
+  m_AnchorMax: {x: 0, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
@@ -865,7 +865,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!224 &885078420693354308
 RectTransform:
   m_ObjectHideFlags: 0

+ 1 - 1
Assets/Scripts/TextureLoadHelp.cs

@@ -84,7 +84,7 @@ public class TextureLoadHelp : MonoBehaviour
         }
         else
         {
-            waitLoadImgActionList_RawImg.Add(loadId, rawImg);
+            waitLoadImgActionList_RawImg.TryAdd(loadId, rawImg);
             StartCoroutine(DownLoadTex_Raw(path, loadId));
         }
 

+ 4 - 1
Assets/Scripts/UI/Item/B08_TaskListItem.cs

@@ -26,6 +26,8 @@ public class B08_TaskListItem : MonoBehaviour
     public GCYWLayer gcywLayer;
 
     public static B08_TaskListItem currentTaskListItem;
+
+    private int currentItemIndex;
     public void Init()
     {
         rect = this.GetComponent<RectTransform>();
@@ -77,8 +79,9 @@ public class B08_TaskListItem : MonoBehaviour
         
     }
 
-    public void SetData(GCYWLayer baseLayer,B08_TaskInfoData data,int typeIndex)
+    public void SetData(GCYWLayer baseLayer,B08_TaskInfoData data,int typeIndex,int itemIndex)
     {
+        currentItemIndex = itemIndex;
         gcywLayer = baseLayer;
         InfoData = data;
         string typeStr = "";

+ 8 - 3
Assets/Scripts/UI/UIView/GCYW/GCYWLayer.cs

@@ -365,10 +365,14 @@ public class GCYWLayer : YZTRootLayer
         TaskListPanelObj.SetActive(true);
     }
 
+    private B08_TaskItems[] currentTaskItems;
+    private string taskTime;
+    
     public void SetTaskImgPanelData(B08_TaskItems[] itemsArray,string _time)
     {
-        //Debug.Log(itemsArray.Length);
-        taskPhotoPanel.SetData(itemsArray,_time);
+        currentTaskItems = itemsArray;
+        taskTime = _time;
+        taskPhotoPanel.SetData(currentTaskItems[0],taskTime);
         taskPointLineRenderer.positionCount = 0;
         for (int i = 0; i < taskPointIcons.Count; i++)
         {
@@ -402,7 +406,8 @@ public class GCYWLayer : YZTRootLayer
 
     public void OpenTaskImgPanel(int openPage)
     {
-        taskPhotoPanel.ChangePage(openPage);
+        taskPhotoPanel.SetData(currentTaskItems[openPage],taskTime);
+        taskPhotoPanel.ChangePage(0);
         taskPhotoPanelObj.SetActive(true);
     }
 }

+ 1 - 1
Assets/Scripts/UI/UIView/GCYW/TaskListPanel.cs

@@ -42,7 +42,7 @@ public class TaskListPanel : MonoBehaviour
             {
                 B08_TaskListItem tempItem = Instantiate(taskItemPrefab, itemContent).GetComponent<B08_TaskListItem>();
                 tempItem.Init();
-                tempItem.SetData(gcywLayer, taskInfoList[j], type);
+                tempItem.SetData(gcywLayer, taskInfoList[j], type,j);
                 taskItemList.Add(tempItem);
             }
         }

+ 21 - 12
Assets/Scripts/UI/UIView/GCYW/TaskPhotoPanel.cs

@@ -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}";
     }
 }