vbea 3 лет назад
Родитель
Сommit
99bab71ab6
2 измененных файлов с 13 добавлено и 7 удалено
  1. 2 2
      Strides-APP/android/app/version.properties
  2. 11 5
      Strides-APP/app/pages/search/SearchV2.js

+ 2 - 2
Strides-APP/android/app/version.properties

@@ -1,2 +1,2 @@
-#Thu Feb 09 16:21:08 CST 2023
-VERSION_CODE=100
+#Thu Feb 09 16:27:26 CST 2023
+VERSION_CODE=101

+ 11 - 5
Strides-APP/app/pages/search/SearchV2.js

@@ -14,7 +14,11 @@ export default class SearchV2 extends Component {
     super(props);
     super(props);
     this.state = {
     this.state = {
       isSearch: false,
       isSearch: false,
-      searchResult: [{id:0}]
+      searchResult: [{id:0}],
+      latlng: {
+        lat: 0.00001,
+        lng: 0.00001
+      }
     };
     };
   }
   }
 
 
@@ -28,13 +32,16 @@ export default class SearchV2 extends Component {
         lat: location.coords.latitude,
         lat: location.coords.latitude,
         lng: location.coords.longitude
         lng: location.coords.longitude
       }
       }
+      this.setState({
+        latlng: latlng
+      })
       this.searchStation(latlng);
       this.searchStation(latlng);
     }, error => {
     }, error => {
       console.warn("getGeoLocation", error);
       console.warn("getGeoLocation", error);
     });
     });
   }
   }
 
 
-  searchStation(latlng) {
+  searchStation(latlng, time=2000) {
     this.setState({
     this.setState({
       isSearch: true
       isSearch: true
     });
     });
@@ -62,8 +69,7 @@ export default class SearchV2 extends Component {
             isSearch: false,
             isSearch: false,
             searchResult: list
             searchResult: list
           });
           });
-        }, 3000);
-        
+        }, time);
       }
       }
     }).catch(err => {
     }).catch(err => {
       console.log('err', err);
       console.log('err', err);
@@ -102,7 +108,7 @@ export default class SearchV2 extends Component {
               this.searchWorld = text;
               this.searchWorld = text;
             }}
             }}
             onSubmitEditing={() => {
             onSubmitEditing={() => {
-              this.getGeoLocation();
+              this.searchStation(this.state.latlng, 1000);
             }}/>
             }}/>
         </View>
         </View>
         { this.state.isSearch
         { this.state.isSearch