MapUI.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. stationInfo={state.stationInfo}
  76. onFavorite={onFavorite}
  77. onClose={onCloseInfo}
  78. />
  79. </View>
  80. </View>
  81. );
  82. }
  83. const styles = StyleSheet.create({
  84. logoView: {
  85. /*left: 0,
  86. right: 0,
  87. bottom: 0,
  88. zIndex: 1,
  89. alignItems: 'center',
  90. position: 'absolute',*/
  91. flex: 1,
  92. alignItems: 'center',
  93. justifyContent: 'center'
  94. },
  95. navIcon: {
  96. width: 42,
  97. height: 42,
  98. marginLeft: 4,
  99. marginRight: 2,
  100. alignItems: 'center',
  101. flexDirection: 'row',
  102. justifyContent: 'center'
  103. },
  104. searchView: {
  105. ...$padding(8, 16, 16),
  106. backgroundColor: colorThemes
  107. },
  108. searchInput: {
  109. alignItems: 'center',
  110. borderWidth: 1,
  111. borderStyle: 'solid',
  112. borderRadius: 60,
  113. borderColor: colorAccent,
  114. flexDirection: 'row',
  115. paddingLeft: 16,
  116. paddingRight: 16,
  117. backgroundColor: 'rgba(255, 255, 255, 0.5)'
  118. },
  119. searchText: {
  120. flex: 1,
  121. color: '#444',
  122. padding: 8,
  123. fontSize: 15
  124. },
  125. mapContent: {
  126. flex: 1,
  127. zIndex: 4,
  128. position: 'relative',
  129. }
  130. })