MapUI.js 3.1 KB

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