소스 검색

added sending pin through homescreen

Ricardo-gonzalez32 2 년 전
부모
커밋
523fb8a7c6
3개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 3
    2
      MocionesIUPI/screens/HomeScreen.js
  2. 1
    1
      MocionesIUPI/screens/MocionScreen.js
  3. 3
    2
      MocionesIUPI/screens/PincodeScreen.js

+ 3
- 2
MocionesIUPI/screens/HomeScreen.js 파일 보기

@@ -9,7 +9,7 @@ export default App = ({ navigation }) => {
9 9
     // this connects us to the API and fetches the json file with the mociones
10 10
     const getMociones = async () => {
11 11
        try {
12
-        const response = await fetch('http://10.190.1.140:5000/send?PIN=121071'); // connection to the website 
12
+        const response = await fetch('http://10.0.0.66:5000/send?PIN=121071'); // connection to the website 
13 13
         const json = await response.json();
14 14
   
15 15
         // setting the content of each category 
@@ -23,7 +23,7 @@ export default App = ({ navigation }) => {
23 23
     }
24 24
 
25 25
     const pressHandler = () => {
26
-        navigation.navigate('Pinpage')
26
+        navigation.navigate('Pinpage', {Pin:PIN},)
27 27
     }
28 28
     
29 29
     useEffect(() => {
@@ -35,6 +35,7 @@ export default App = ({ navigation }) => {
35 35
             <Text style = {globalStyles.tittleText}>Home Screen</Text>
36 36
             <Button title='Ir a pagina de pin' onPress={pressHandler} />
37 37
         </View>
38
+
38 39
         
39 40
         
40 41
 

+ 1
- 1
MocionesIUPI/screens/MocionScreen.js 파일 보기

@@ -11,7 +11,7 @@ export default App = () => {
11 11
       // this connects us to the API and fetches the json file with the mociones
12 12
       const getMociones = async () => {
13 13
         try {
14
-         const response = await fetch('http://10.190.1.140:5000/send?PIN=121071'); // connection to the website 
14
+         const response = await fetch('http://10.0.0.66:5000/send?PIN=121071'); // connection to the website 
15 15
          const json = await response.json();
16 16
    
17 17
          // setting the content of each category 

+ 3
- 2
MocionesIUPI/screens/PincodeScreen.js 파일 보기

@@ -3,7 +3,8 @@ import { StyleSheet, View, Text, Button } from 'react-native';
3 3
 import { globalStyles } from "../styles/global";
4 4
 import SmoothPinCodeInput from 'react-native-smooth-pincode-input';
5 5
 
6
-const pin = 123456;
6
+
7
+
7 8
 
8 9
 export default class App extends React.Component {
9 10
     
@@ -19,7 +20,7 @@ export default class App extends React.Component {
19 20
     pinInput = React.createRef();
20 21
   
21 22
     _checkCode = (code) => {
22
-      if (code != pin) {
23
+      if (code != this.props.navigation.state.params.Pin) {
23 24
         this.pinInput.current.shake()
24 25
           .then(() => this.setState({ code: '' }));
25 26
       } else {