| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- /**
- * 首页地图定制布局
- * @邠心vbe on 2023/09/01
- */
- import React from 'react';
- import { View, Pressable, Image, StyleSheet } from 'react-native';
- import { Styles } from '../../components/Toolbar';
- import { PageList } from '../Router';
- import BottomSiteInfo from './maps/BottomSiteInfo';
- import Maps from './maps/Maps';
- import SearchTool from './maps/SearchTool';
- export default MapUI = ({
- state,
- navigation,
- onFilter,
- onMapReady,
- onFavorite,
- onLocation,
- showUserLocation,
- viewChargeStation
- }) => {
- return (
- <View style={ui.flex1}>
- <View style={Styles.toolbar}>
- <Pressable
- style={styles.navIcon}
- android_ripple = {rippleLess}
- onPress={() => {
- navigation?.toggleDrawer();
- }}>
- <EvilIcons
- name={'navicon'}
- size={28}
- color={colorPrimary}
- style={{width: 28, height: 28, lineHeight: 28}} />
- </Pressable>
- <View style={styles.logoView}>
- <Image
- source={require('../../images/tool-logo.png')}
- style={Styles.logo}
- resizeMode="contain"
- />
- </View>
- {/* <Text style={ui.flex1}></Text> */}
- <Pressable
- style={styles.navIcon}
- android_ripple = {rippleLess}
- onPress={() => startPage(PageList.scanqr, {actionDetail: true})}>
- <MaterialCommunityIcons
- name='line-scan'
- size={20}
- color={colorPrimary}
- />
- </Pressable>
- </View>
- <SearchTool
- count={state.stopList?.length}
- mapReady={state.mapReady}
- onFilter={onFilter}
- onLocation={onLocation}
- navigation={navigation}
- />
- <View style={styles.mapContent}>
- <Maps.Maps3
- region={state.region}
- stopList={state.stopList}
- onMapReady={onMapReady}
- onMarkerPress={viewChargeStation}
- showUserLocation={showUserLocation}
- />
- <BottomSiteInfo
- stationInfo={state.stationInfo}
- onFavorite={onFavorite}
- />
- </View>
- </View>
- );
- }
- const styles = StyleSheet.create({
- logoView: {
- /*left: 0,
- right: 0,
- bottom: 0,
- zIndex: 1,
- alignItems: 'center',
- position: 'absolute',*/
- flex: 1,
- alignItems: 'center',
- justifyContent: 'center'
- },
- navIcon: {
- width: 42,
- height: 42,
- marginLeft: 4,
- marginRight: 2,
- alignItems: 'center',
- flexDirection: 'row',
- justifyContent: 'center'
- },
- searchView: {
- ...$padding(8, 16, 16),
- backgroundColor: colorThemes
- },
- searchInput: {
- alignItems: 'center',
- borderWidth: 1,
- borderStyle: 'solid',
- borderRadius: 60,
- borderColor: colorAccent,
- flexDirection: 'row',
- paddingLeft: 16,
- paddingRight: 16,
- backgroundColor: 'rgba(255, 255, 255, 0.5)'
- },
- searchText: {
- flex: 1,
- color: '#444',
- padding: 8,
- fontSize: 15
- },
- mapContent: {
- flex: 1,
- zIndex: 4,
- position: 'relative',
- }
- })
|