|
@@ -28,13 +28,13 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
public XunJianException exception;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public Button lastBtn;
|
|
|
public Button nextBtn;
|
|
|
public Button completeBtn;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public XunJianPhotos UI2;
|
|
|
|
|
|
private Image showImage;
|
|
@@ -47,7 +47,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
|
|
|
#region 巡检更新项
|
|
|
- private bool isUpdata;
|
|
|
+ public bool isUpdata;
|
|
|
private List<string> listImageUrl;
|
|
|
private string recordMemo;
|
|
|
private string recordStatus;
|
|
@@ -59,7 +59,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
{
|
|
|
listImages[i].GetComponent<Button>().onClick.AddListener(() =>
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
if (!UI2.gameObject.activeSelf)
|
|
|
UI2.gameObject.SetActive(true);
|
|
|
|
|
@@ -78,7 +78,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
normalBG2.gameObject.SetActive(false);
|
|
|
warningBG1.gameObject.SetActive(false);
|
|
|
WarningBG2.gameObject.SetActive(true);
|
|
|
-
|
|
|
+ XunJianInitialize.Instance.checkTaskItem.errorObj.SetActive(false);
|
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>());
|
|
|
});
|
|
|
|
|
@@ -93,7 +93,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
normalBG2.gameObject.SetActive(true);
|
|
|
warningBG1.gameObject.SetActive(true);
|
|
|
WarningBG2.gameObject.SetActive(false);
|
|
|
-
|
|
|
+ XunJianInitialize.Instance.checkTaskItem.errorObj.SetActive(true);
|
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>());
|
|
|
});
|
|
|
|
|
@@ -102,7 +102,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
SubmitData();
|
|
|
XunJianInitialize.Instance.LastItem();
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
|
|
|
nextBtn.onClick.AddListener(() =>
|
|
@@ -111,7 +111,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
SubmitData();
|
|
|
|
|
|
XunJianInitialize.Instance.NextItem();
|
|
|
-
|
|
|
+
|
|
|
|
|
|
});
|
|
|
|
|
@@ -126,14 +126,14 @@ public class XunJianDetails : MonoBehaviour
|
|
|
}
|
|
|
public void InitData(RoomItem data)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
this.data = data;
|
|
|
this.oldData = data;
|
|
|
-
|
|
|
+
|
|
|
listImageUrl = null;
|
|
|
|
|
|
InitUI();
|
|
@@ -149,7 +149,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
for (int i = 0; i < data.recd.recordImgList.Count; i++)
|
|
|
{
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(data.recd.recordImgList[i]))
|
|
|
+ if (!string.IsNullOrEmpty(data.recd.recordImgList[i]) && data.recd.recordImgList[i] != "null")
|
|
|
{
|
|
|
Debug.Log(" DGJ ===> recordImgList " + data.recd.recordImgList[i]);
|
|
|
JsonData data2 = new JsonData();
|
|
@@ -163,7 +163,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
if (texture != null)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
for (int i = 0; i < data.recd.recordImgList.Count; i++)
|
|
|
{
|
|
|
Debug.Log("DGJ ===> DownLoadImage2 " + url + " " + data.recd.recordImgList[i]);
|
|
@@ -200,7 +200,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- exception.gameObject.SetActive(data.recd.recordStatus=="0");
|
|
|
+ exception.gameObject.SetActive(data.recd.recordStatus == "0");
|
|
|
|
|
|
|
|
|
|
|
@@ -209,17 +209,17 @@ public class XunJianDetails : MonoBehaviour
|
|
|
for (int i = 0; i < data.recd.recordImgList.Count; i++)
|
|
|
{
|
|
|
listImageUrl.Add(data.recd.recordImgList[i]);
|
|
|
- }
|
|
|
+ }
|
|
|
recordStatus = data.recd.recordStatus;
|
|
|
recordMemo = data.recd.recordMemo;
|
|
|
exception.scInput.text = data.recd.recordMemo;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- normalBG1.gameObject.SetActive(true);
|
|
|
- normalBG2.gameObject.SetActive(false);
|
|
|
- warningBG1.gameObject.SetActive(true);
|
|
|
- WarningBG2.gameObject.SetActive(false);
|
|
|
+ normalBG1.gameObject.SetActive(false);
|
|
|
+ normalBG2.gameObject.SetActive(true);
|
|
|
+ warningBG1.gameObject.SetActive(false);
|
|
|
+ WarningBG2.gameObject.SetActive(true);
|
|
|
|
|
|
listImageUrl = new List<string>();
|
|
|
recordStatus = null;
|
|
@@ -232,7 +232,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
private void InitUI()
|
|
|
{
|
|
|
- xjName.text = data.inspItemDesc;
|
|
|
+ xjName.text = XunJianInitialize.Instance.GetCheckItemNum().ToString() + "." + data.inspItemDesc;
|
|
|
for (int i = 0; i < listImages.Count; i++)
|
|
|
{
|
|
|
listImages[i].sprite = startImg;
|
|
@@ -251,25 +251,11 @@ public class XunJianDetails : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(data == XunJianAllData.listRoomItem[XunJianAllData.listRoomItem.Count-1])
|
|
|
+ if (data == XunJianAllData.listRoomItem[XunJianAllData.listRoomItem.Count - 1])
|
|
|
{
|
|
|
nextBtn.gameObject.SetActive(false);
|
|
|
completeBtn.gameObject.SetActive(true);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- private void ResubmitData()
|
|
|
- {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -287,7 +273,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void SetPhotosShowImage( Image image)
|
|
|
+ public void SetPhotosShowImage(Image image)
|
|
|
{
|
|
|
this.showImage = image;
|
|
|
}
|
|
@@ -305,13 +291,14 @@ public class XunJianDetails : MonoBehaviour
|
|
|
string fileName = SaveLocal(texture2D);
|
|
|
|
|
|
showImage.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), new Vector2(0.5f, 0.5f));
|
|
|
- StartCoroutine(LangChaoJiekou.Instance.UploadFile(fileName, "http://36.133.197.238:10002" + file_upload, (string msg) => {
|
|
|
+ StartCoroutine(LangChaoJiekou.Instance.UploadFile(fileName, "http://36.133.197.238:10002" + file_upload, (string msg) =>
|
|
|
+ {
|
|
|
|
|
|
|
|
|
Debug.Log("UploadFile===>" + msg);
|
|
|
JsonData data = JsonMapper.ToObject(msg);
|
|
|
|
|
|
- if (listImageUrl == null)
|
|
|
+ if (listImageUrl == null || listImageUrl.Count != listImages.Count)
|
|
|
{
|
|
|
listImageUrl = new List<string>();
|
|
|
for (int i = 0; i < listImages.Count; i++)
|
|
@@ -325,7 +312,7 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
if (data["code"].ToString() == "200")
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}));
|
|
|
}
|
|
@@ -339,14 +326,14 @@ public class XunJianDetails : MonoBehaviour
|
|
|
|
|
|
private string SaveLocal(Texture2D texture2D)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
byte[] bytes = texture2D.EncodeToPNG();
|
|
|
if (!Directory.Exists(Application.persistentDataPath + "/Image"))
|
|
|
Directory.CreateDirectory(Application.persistentDataPath + "/Image");
|
|
|
- string filename = Application.persistentDataPath + "/Image" + "/" +data.inspItemName+ showImage.name + ".png";
|
|
|
+ string filename = Application.persistentDataPath + "/Image" + "/" + data.inspItemName + showImage.name + ".png";
|
|
|
if (File.Exists(filename))
|
|
|
File.Delete(filename);
|
|
|
-
|
|
|
+
|
|
|
File.WriteAllBytes(filename, bytes);
|
|
|
|
|
|
return filename;
|