Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신승민
/
pocketMovie
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
korkeep
2019-12-08 23:10:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f9b724dad883a4b0b2c48552ffad04b4309475f4
f9b724da
1 parent
ab2dcb58
AsyncStore로 두 페이지에서 DB연동 구현
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
Components/AppTabNavigator/MovieRankingTab.js
Components/AppTabNavigator/WantToWatchTab.js
Components/AppTabNavigator/MovieRankingTab.js
View file @
f9b724d
...
...
@@ -7,7 +7,7 @@ import {
SafeAreaView
,
ScrollView
,
Alert
,
TouchableOpacity
TouchableOpacity
,
}
from
"react-native"
;
import
{
Icon
}
from
"native-base"
;
import
{
AsyncStorage
}
from
"react-native"
;
...
...
@@ -207,9 +207,13 @@ export default class MovieRankingTab extends Component {
var
date
=
year
+
""
+
month
+
day
;
this
.
getMovieList
(
date
);
}
_onPressButton
(
temp
)
{
Alert
.
alert
(
temp
);
Alert
.
alert
(
temp
);
//메시지 띄우고
console
.
log
(
temp
);
//콘솔에 log 띄운다
AsyncStorage
.
setItem
(
'MovieLists'
,
temp
);
//DB에 저장한다
}
render
()
{
return
(
<
SafeAreaView
style
=
{
style
.
container
}
>
...
...
Components/AppTabNavigator/WantToWatchTab.js
View file @
f9b724d
...
...
@@ -80,14 +80,14 @@ export default class App extends Component {
}
//저장 함수
saveData
()
{
AsyncStorage
.
setItem
(
'test'
,
this
.
state
.
name0
);
}
//
saveData() {
//
AsyncStorage.setItem('test', this.state.name0);
//
}
//출력 함수
displayData
=
async
()
=>
{
try
{
let
user
=
await
AsyncStorage
.
getItem
(
'
test
'
);
let
user
=
await
AsyncStorage
.
getItem
(
'
MovieLists
'
);
alert
(
user
);
}
catch
(
error
)
{
...
...
@@ -100,14 +100,15 @@ export default class App extends Component {
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
top
}
>
<
TouchableOpacity
onPress
=
{
this
.
saveData
.
bind
(
this
)}
>
{
/* bind해주면 위에 saveData 돌아간다 */
}
{
/* <TouchableOpacity onPress={this.saveData.bind(this)}>
<Image
style={styles.poster}
source={{ uri: `${this.state.imgurl0}` }}
/>
<Text>{this.state.name0}</Text>
<Text style={styles.textStyle}>영화 정보 저장</Text>
<
/TouchableOpacity
>
</TouchableOpacity>
*/
}
<
/View
>
<
View
style
=
{
styles
.
bottom
}
>
...
...
Please
register
or
login
to post a comment