Toggle navigation
Toggle navigation
This project
Loading...
Sign in
유희정
/
fwiot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이윤영
2019-12-14 11:33:10 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
26ef81c93b3b1764967e07391521e575a997a333
26ef81c9
1 parent
7093e447
Modify HomeTab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
source/AppTabNavigator/HistoryTab.js
source/AppTabNavigator/HomeTab.js
source/component/DBhelper.js
source/AppTabNavigator/HistoryTab.js
View file @
26ef81c
...
...
@@ -79,6 +79,29 @@ export default class HomeTab extends Component {
break
;
}
};
get_diff_data
(){
return
fetch
(
'http://10.0.2.2:3000/app/get_diff_data/'
,{
method
:
'POST'
,
headers
:
{
'Accept'
:
'application/json'
,
'Content-Type'
:
'application/json'
,
},
body
:
JSON
.
stringify
({
ras_id
:
this
.
state
.
ID
,
date
:
this
.
state
.
today
,
}),
})
.
then
((
response
)
=>
console
.
log
(
response
.
json
()))
.
then
((
responseJson
)
=>
{
console
.
log
(
responseJson
)
alert
(
responseJson
[
0
].
ras_id
.
S
);
},
function
(){
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
})
}
render
()
{
// const fill = 'rgb(134, 65, 244)'
...
...
source/AppTabNavigator/HomeTab.js
View file @
26ef81c
...
...
@@ -16,7 +16,8 @@ export default class HomeTab extends Component {
super
(
props
);
this
.
state
=
{
ID
:
this
.
props
.
navigation
.
getParam
(
'id'
,
'pi1'
),
today
:
date
.
getFullYear
()
+
"."
+
month
+
"."
+
date
.
getDate
(),
// today : date.getFullYear() + "." + month + "." + date.getDate(),
today
:
"1576237044146.4011"
,
current_weight
:
get_now_weight
()
,
table_contents
:
[[
'오후'
,
'6:12:15'
,
'+0.25kg'
,
'Total : 1.5 kg'
],[
'오후'
,
'4:27:52'
,
'+0.12kg'
,
'Total : 1.38kg'
],
[
'오후'
,
'6:12:15'
,
'+0.25kg'
,
'Total : 1.5 kg'
],[
'오후'
,
'6:12:15'
,
'+0.25kg'
,
'Total : 1.5 kg'
],
...
...
@@ -36,11 +37,13 @@ export default class HomeTab extends Component {
},
body
:
JSON
.
stringify
({
ras_id
:
this
.
state
.
ID
,
date
:
this
.
state
.
today
,
//date : this.state.today,
date
:
"1576237047226.6567"
}),
})
.
then
((
response
)
=>
console
.
log
(
response
.
json
()))
.
then
((
responseJson
)
=>
{
//alert(responseJson[0][0].ras_id.S);
console
.
log
(
responseJson
)
},
function
(){
})
...
...
source/component/DBhelper.js
View file @
26ef81c
...
...
@@ -54,16 +54,15 @@ export function add_data(responseJson){
}
return
responseJson
.
length
;
}
}
ㅊ
export
function
get_now_weight
(){
let
wastes
=
realm
.
objects
(
'Waste'
);
let
recent
=
realm
.
objects
(
'Waste'
).
max
(
'date'
).
date
;
let
recentWeight
=
wastes
.
filtered
(
'date = 1576223063238.5166'
);
//"id == %@", id!
console
.
log
(
String
(
wastes
.
lenth
));
return
recentWeight
[
0
].
weight
;
// return "3.8"
}
export
function
get_recent_date
(){
...
...
Please
register
or
login
to post a comment