MapUI.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 { BackButton, 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. <BackButton
  28. style={styles.navIcon}
  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. </BackButton>
  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. <BackButton
  47. style={styles.navIcon}
  48. onPress={() => startPage(PageList.scanqr, {actionDetail: true})}>
  49. <MaterialCommunityIcons
  50. name='line-scan'
  51. size={20}
  52. color={colorPrimary}
  53. />
  54. </BackButton>
  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. useApplesMap={useApplesMap}
  69. onMarkerPress={viewChargeStation}
  70. showUserLocation={showUserLocation}
  71. />
  72. <BottomSiteInfo
  73. visible={state.showStation}
  74. stationInfo={state.stationInfo}
  75. onFavorite={onFavorite}
  76. onClose={onCloseInfo}
  77. />
  78. </View>
  79. </View>
  80. );
  81. }
  82. const styles = StyleSheet.create({
  83. logoView: {
  84. /*left: 0,
  85. right: 0,
  86. bottom: 0,
  87. zIndex: 1,
  88. alignItems: 'center',
  89. position: 'absolute',*/
  90. flex: 1,
  91. alignItems: 'center',
  92. justifyContent: 'center'
  93. },
  94. navIcon: {
  95. width: 42,
  96. height: 42,
  97. marginLeft: 4,
  98. marginRight: 2,
  99. alignItems: 'center',
  100. flexDirection: 'row',
  101. justifyContent: 'center'
  102. },
  103. searchView: {
  104. ...$padding(8, 16, 16),
  105. backgroundColor: colorThemes
  106. },
  107. searchInput: {
  108. alignItems: 'center',
  109. borderWidth: 1,
  110. borderStyle: 'solid',
  111. borderRadius: 60,
  112. borderColor: colorAccent,
  113. flexDirection: 'row',
  114. paddingLeft: 16,
  115. paddingRight: 16,
  116. backgroundColor: 'rgba(255, 255, 255, 0.5)'
  117. },
  118. searchText: {
  119. flex: 1,
  120. color: '#444',
  121. padding: 8,
  122. fontSize: 15
  123. },
  124. mapContent: {
  125. flex: 1,
  126. zIndex: 4,
  127. position: 'relative',
  128. }
  129. })