Guest User

Untitled

a guest
Aug 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <ScrollableTabView
  2. style={{marginTop: 0, backgroundColor: '#1C4747', }}
  3. tabBarUnderlineStyle={{backgroundColor: "#fff"}}
  4. tabBarActiveTextColor={"#fff"}
  5. tabBarInactiveTextColor={"#ccc"}
  6. initialPage={0}
  7. renderTabBar={() => <DefaultTabBar />}
  8. >
  9. <RotaEntrega tabLabel='ROTA' />
  10. <ChildOne tabLabel='ORDENS' text='ORDENS' size={17} weight="500" />
  11. <ChildTwo tabLabel='HISTÓRICO' text='HISTÓRICO' size={17} weight="500" />
  12.  
  13. </ScrollableTabView>
  14.  
  15. _route = async(codDriver) => {
  16. const apiCall = await fetch(`http://urlaqui.com.br/testes/api.php?driver=${codDriver}`);
  17. const response = await apiCall.json();
  18.  
  19. let latLongObj = {
  20. latitude: parseFloat(response.os[0].address.latitude),
  21. longitude: parseFloat(response.os[0].address.longitude)
  22. };
  23.  
  24. this.setState({
  25. route: response.success ? [ response.os[0] ] : [], //only first route in the list
  26. routeFound: response.success,
  27. orders: response.success ? response.os : [], //and put the all orders to this array
  28. destination: latLongObj
  29. });
  30. };
  31.  
  32. componentDidMount(){
  33. this._route("51ds515");
  34. }
Add Comment
Please, Sign In to add comment