MapUI.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /**
  2. * 首页地图定制布局
  3. * @邠心vbe on 2023/09/01
  4. */
  5. import React from 'react';
  6. import { View, Pressable, Image, StyleSheet } from 'react-native';
  7. import { Styles } from '../../components/Toolbar';
  8. import { PageList } from '../Router';
  9. import BottomSiteInfo from './maps/BottomSiteInfo';
  10. import Maps from './maps/Maps';
  11. import SearchTool from './maps/SearchTool';
  12. export default MapUI = ({
  13. state,
  14. navigation,
  15. onFilter,
  16. onMapReady,
  17. onFavorite,
  18. onLocation,
  19. showUserLocation,
  20. viewChargeStation
  21. }) => {
  22. return (
  23. <View style={ui.flex1}>
  24. <View style={Styles.toolbar}>
  25. <Pressable
  26. style={styles.navIcon}
  27. android_ripple = {rippleLess}
  28. onPress={() => {
  29. navigation?.toggleDrawer();
  30. }}>
  31. <EvilIcons
  32. name={'navicon'}
  33. size={28}
  34. color={colorPrimary}
  35. style={{width: 28, height: 28, lineHeight: 28}} />
  36. </Pressable>
  37. <View style={styles.logoView}>
  38. <Image
  39. source={require('../../images/tool-logo.png')}
  40. style={Styles.logo}
  41. resizeMode="contain"
  42. />
  43. </View>
  44. {/* <Text style={ui.flex1}></Text> */}
  45. <Pressable
  46. style={styles.navIcon}
  47. android_ripple = {rippleLess}
  48. onPress={() => startPage(PageList.scanqr, {actionDetail: true})}>
  49. <MaterialCommunityIcons
  50. name='line-scan'
  51. size={20}
  52. color={colorPrimary}
  53. />
  54. </Pressable>
  55. </View>
  56. <SearchTool
  57. count={state.stopList?.length}
  58. mapReady={state.mapReady}
  59. onFilter={onFilter}
  60. onLocation={onLocation}
  61. navigation={navigation}
  62. />
  63. <View style={styles.mapContent}>
  64. <Maps.Maps3
  65. region={state.region}
  66. stopList={state.stopList}
  67. onMapReady={onMapReady}
  68. onMarkerPress={viewChargeStation}
  69. showUserLocation={showUserLocation}
  70. />
  71. <BottomSiteInfo
  72. stationInfo={state.stationInfo}
  73. onFavorite={onFavorite}
  74. />
  75. </View>
  76. </View>
  77. );
  78. }
  79. const styles = StyleSheet.create({
  80. logoView: {
  81. /*left: 0,
  82. right: 0,
  83. bottom: 0,
  84. zIndex: 1,
  85. alignItems: 'center',
  86. position: 'absolute',*/
  87. flex: 1,
  88. alignItems: 'center',
  89. justifyContent: 'center'
  90. },
  91. navIcon: {
  92. width: 42,
  93. height: 42,
  94. marginLeft: 4,
  95. marginRight: 2,
  96. alignItems: 'center',
  97. flexDirection: 'row',
  98. justifyContent: 'center'
  99. },
  100. searchView: {
  101. ...$padding(8, 16, 16),
  102. backgroundColor: colorThemes
  103. },
  104. searchInput: {
  105. alignItems: 'center',
  106. borderWidth: 1,
  107. borderStyle: 'solid',
  108. borderRadius: 60,
  109. borderColor: colorAccent,
  110. flexDirection: 'row',
  111. paddingLeft: 16,
  112. paddingRight: 16,
  113. backgroundColor: 'rgba(255, 255, 255, 0.5)'
  114. },
  115. searchText: {
  116. flex: 1,
  117. color: '#444',
  118. padding: 8,
  119. fontSize: 15
  120. },
  121. mapContent: {
  122. flex: 1,
  123. zIndex: 4,
  124. position: 'relative',
  125. }
  126. })