Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
ZeusHub_Unity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘梓豪
ZeusHub_Unity
Commits
4af3d27c
Commit
4af3d27c
authored
Jun 07, 2023
by
林杨欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
排除部分由于返回值为空产生的bug
parent
9f956b1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
ProductionDetail.cs
Assets/Scripts/Model/ProductionDetail.cs
+9
-7
No files found.
Assets/Scripts/Model/ProductionDetail.cs
View file @
4af3d27c
...
...
@@ -43,6 +43,7 @@ public class ProductionDetail : MonoBehaviour
yield
return
rq
.
SendWebRequest
();
if
(
string
.
IsNullOrEmpty
(
rq
.
error
))
{
Debug
.
Log
(
rq
.
downloadHandler
.
text
);
JsonData
jd
=
JsonMapper
.
ToObject
<
JsonData
>(
rq
.
downloadHandler
.
text
);
setData
(
jd
);
}
...
...
@@ -56,13 +57,13 @@ public class ProductionDetail : MonoBehaviour
tMP_Texts
[
1
].
text
=
jd
[
"field_information"
].
Count
>
0
?
jd
[
"field_information"
][
0
][
"value"
].
ToString
()
:
""
;
tMP_Texts
[
2
].
text
=
jd
.
ContainsKey
(
"field_course"
)?
AnalysisHtml5Tools
.
AnalysisRichTextMethod
(
jd
[
"field_course"
][
0
][
"value"
].
ToString
()):
""
;
tMP_Texts
[
2
].
text
=
(
jd
.
ContainsKey
(
"field_course"
)&&
jd
[
"field_course"
].
Count
>
0
)?
AnalysisHtml5Tools
.
AnalysisRichTextMethod
(
jd
[
"field_course"
][
0
][
"value"
].
ToString
()):
""
;
tMP_Texts
[
3
].
text
=
jd
.
ContainsKey
(
"field_base_setting"
)
?
AnalysisHtml5Tools
.
AnalysisRichTextMethod
(
jd
[
"field_base_setting"
][
0
][
"value"
].
ToString
()):
""
;
tMP_Texts
[
3
].
text
=
(
jd
.
ContainsKey
(
"field_base_setting"
)&&
jd
[
"field_base_setting"
].
Count
>
0
)
?
AnalysisHtml5Tools
.
AnalysisRichTextMethod
(
jd
[
"field_base_setting"
][
0
][
"value"
].
ToString
()):
""
;
tMP_Texts
[
4
].
text
=
jd
[
"field_like_num"
][
0
][
"value"
].
ToString
()
;
tMP_Texts
[
4
].
text
=
(
jd
.
ContainsKey
(
"field_like_num"
)
&&
jd
[
"field_like_num"
].
Count
>
0
)
?
jd
[
"field_like_num"
][
0
][
"value"
].
ToString
():
"0"
;
tMP_Texts
[
5
].
text
=
jd
[
"field_read_num"
][
0
][
"value"
].
ToString
()
;
tMP_Texts
[
5
].
text
=
(
jd
.
ContainsKey
(
"field_read_num"
)
&&
jd
[
"field_read_num"
].
Count
>
0
)
?
jd
[
"field_read_num"
][
0
][
"value"
].
ToString
():
"0"
;
if
(
jd
[
"field_kind"
][
0
][
"target_id"
].
ToString
()==
"1"
)
{
...
...
@@ -94,7 +95,6 @@ public class ProductionDetail : MonoBehaviour
public
IEnumerator
requestApi
(
string
ip
,
int
type
)
{
var
rq
=
UnityWebRequest
.
Get
(
Setting
.
IP
+
ip
);
if
(
manager
.
token
!=
null
)
{
rq
.
SetRequestHeader
(
"Authorization"
,
manager
.
token
);
...
...
@@ -103,14 +103,16 @@ public class ProductionDetail : MonoBehaviour
yield
return
rq
.
SendWebRequest
();
if
(
string
.
IsNullOrEmpty
(
rq
.
error
))
{
Debug
.
Log
(
rq
.
downloadHandler
.
text
);
JsonData
jd
=
JsonMapper
.
ToObject
<
JsonData
>(
rq
.
downloadHandler
.
text
);
if
(
type
==
1
)
{
tMP_Texts
[
4
].
text
=
jd
[
"num"
]
.
ToString
()
;
tMP_Texts
[
4
].
text
=
jd
[
"num"
]
!=
null
?
jd
[
"num"
].
ToString
():
"0"
;
}
else
if
(
type
==
2
)
{
tMP_Texts
[
5
].
text
=
jd
[
"num"
]
.
ToString
()
;
tMP_Texts
[
5
].
text
=
jd
[
"num"
]
!=
null
?
jd
[
"num"
].
ToString
()
:
"0"
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment