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-18 21:21:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac7e9a16c90e1c6fbc99394ff31c3b45b0684294
ac7e9a16
1 parent
39cec65b
Modify complete
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
6 additions
and
140 deletions
components/AppTabNavigator/HistoryTab.js
components/AppTabNavigator/HomeTab.js
components/AppTabNavigator/SettingTab.js
components/MainScreen.js
components/WasteDetail.js
source/AppTabNavigator/HistoryTab.js
source/AppTabNavigator/HomeTab.js
source/Login.js
source/MainScreen.js
components/AppTabNavigator/HistoryTab.js
deleted
100644 → 0
View file @
39cec65
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
HomeTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
HistoryTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
components/AppTabNavigator/HomeTab.js
deleted
100644 → 0
View file @
39cec65
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
WasteDetail
from
'../WasteDetail'
export
default
class
HomeTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
HomeTab
<
/Text
>
<
WasteDetail
><
/WasteDetail
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
}
});
components/AppTabNavigator/SettingTab.js
deleted
100644 → 0
View file @
39cec65
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
HomeTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
SettingTab
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
});
components/MainScreen.js
deleted
100644 → 0
View file @
39cec65
import
React
,
{
Component
}
from
'react'
;
import
{
StyleSheet
,
Platform
,
View
,
Text
}
from
'react-native'
;
import
{
createAppContainer
}
from
'react-navigation'
;
import
{
createMaterialTopTabNavigator
}
from
'react-navigation-tabs'
import
HomeTab
from
'./AppTabNavigator/HomeTab'
import
HistoryTab
from
'./AppTabNavigator/HistoryTab'
import
SettingTab
from
'./AppTabNavigator/SettingTab'
// 하단 탭 네비게이터 생성
const
AppTabNavigator
=
createMaterialTopTabNavigator
({
Home
:
{
screen
:
HomeTab
},
History
:
{
screen
:
HistoryTab
},
Setting
:
{
screen
:
SettingTab
}
},{
animationEnabled
:
true
,
swipeEnabled
:
true
,
tabBarPosition
:
"bottom"
,
tabBarOptions
:
{
style
:
{
...
Platform
.
select
({
android
:{
backgroundColor
:
'white'
,
}
})
},
iconStyle
:
{
height
:
10
},
activeTintColor
:
'#000'
,
inactiveTintColor
:
'#d1cece'
,
upperCaseLabel
:
true
,
showLabel
:
true
,
showIcon
:
true
,
}
});
const
AppTabContainet
=
createAppContainer
(
AppTabNavigator
);
export
default
class
MainScreen
extends
Component
{
static
navigationOptions
=
{
title
:
'FW IOT'
}
render
()
{
return
<
AppTabContainet
/>
;
// AppTabContainet 컴포넌트를 리턴한다.
}
}
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
});
components/WasteDetail.js
deleted
100644 → 0
View file @
39cec65
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
export
default
class
HomeTab
extends
Component
{
render
()
{
return
(
<
View
style
=
{
style
.
container
}
>
<
Text
>
총
3.8
kg
추가
<
/Text
>
<
/View
>
);
}
}
const
style
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
"rgba(230,230,230,0.5)"
}
});
source/AppTabNavigator/HistoryTab.js
View file @
ac7e9a1
...
...
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
RefreshControl
}
from
'react-native'
;
import
HistoryGraph
from
'../component/HistoryGraph'
import
SegmentedControlTab
from
"react-native-segmented-control-tab"
;
import
{
get_id
,
add_data
,
get_week_data
,
get_month_data
,
get_year_data
}
from
'../component/DBhelper.js'
;
import
{
get_id
,
add_data
,
get_week_data
,
get_month_data
,
get_year_data
,
get_recent_date
}
from
'../component/DBhelper.js'
;
//var today = new Date();
//today.setHours(today.getHours()+9);
...
...
@@ -68,7 +68,7 @@ export default class HomeTab extends Component {
},
body
:
JSON
.
stringify
({
ras_id
:
this
.
state
.
ID
,
date
:
"1576339901541"
,
date
:
String
(
get_recent_date
())
,
}),
})
.
then
((
response
)
=>
response
.
json
())
...
...
source/AppTabNavigator/HomeTab.js
View file @
ac7e9a1
...
...
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import
{
View
,
Text
,
StyleSheet
,
SafeAreaView
,
ScrollView
,
Image
}
from
'react-native'
;
import
Circle
from
'../component/circle_component'
import
{
Table
,
TableWrapper
,
Row
,
Rows
}
from
'react-native-table-component'
import
{
get_now_weight
,
get_today_data
,
add_data
,
get_id
}
from
'../component/DBhelper.js'
;
import
{
get_now_weight
,
get_today_data
,
add_data
,
get_id
,
get_recent_date
}
from
'../component/DBhelper.js'
;
var
date
=
new
Date
();
date
.
setHours
(
date
.
getHours
()
+
9
);
...
...
@@ -41,7 +41,7 @@ export default class HomeTab extends Component {
},
body
:
JSON
.
stringify
({
ras_id
:
this
.
state
.
ID
,
date
:
"1576648647000"
,
date
:
String
(
get_recent_date
())
,
}),
})
.
then
((
response
)
=>
response
.
json
())
...
...
@@ -83,7 +83,7 @@ export default class HomeTab extends Component {
<
Text
style
=
{
style
.
history
}
>
Today
's History</Text>
<Table>
<TableWrapper>
<Row data={['
시간
', '
증
감
량
', '
총량
']} flexArr={[1, 1, 1]} textStyle={style.row_style1}/>
<Row data={['
시간
', '
증
가
량
', '
총량
']} flexArr={[1, 1, 1]} textStyle={style.row_style1}/>
<Rows data={this.state.table_contents} flexArr={[1, 1, 1]} textStyle={style.row_style2}/>
</TableWrapper>
...
...
source/Login.js
View file @
ac7e9a1
...
...
@@ -57,8 +57,6 @@ export default class Login extends Component {
onChangeText
=
{(
text
)
=>
{
this
.
setState
({
ID
:
text
})}}
/
>
<
LoginButton
//onPress={()=>{this.getdata}}
//onPress={() =>{ this.props.navigation.navigate('MainScreen', { ID: this.state.ID });}}
onPress
=
{()
=>
{
this
.
getdata
().
then
(()
=>
{
this
.
props
.
navigation
.
navigate
(
'MainScreen'
,
{
ID
:
this
.
state
.
ID
})})
}}
/
>
<
/View
>
...
...
source/MainScreen.js
View file @
ac7e9a1
...
...
@@ -49,7 +49,7 @@ export default class MainScreen extends Component {
render
()
{
registerID
(
this
.
state
.
ID
);
return
<
AppTabContainer
/>
;
// AppTabContaine
t
컴포넌트를 리턴한다.
return
<
AppTabContainer
/>
;
// AppTabContaine
r
컴포넌트를 리턴한다.
}
}
...
...
Please
register
or
login
to post a comment