MapUI.js 3.0 KB

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