/** * 新版搜索列表复用组件 * @邠心vbe on 2023/02/03 */ import React from 'react'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import TextRadius from '../../components/TextRadius'; import utils from '../../utils/utils'; import Provider from '../charge/Provider'; import ConnectType from './ConnectType'; export default ListViewV2 = ({item, index, separators, onPress}) => { if (item.id) { return ( {item.name} {item.address} {/* */} {item.distance} {item.allConnector && item.allConnector.available > 0 && Available } {item.siteType == "Private" && Private Site } { utils.directMaps(item.latitude, item.longitude, item.address); }}> ); } else { return <>; } } const styles = StyleSheet.create({ itemView: { padding: 16, flexDirection: 'row', borderBottomWidth: 1, borderBottomColor: '#eee' }, stationInfo: { flex: 1, paddingLeft: 8 }, nameView: { paddingTop: 3, alignItems: 'center', flexDirection: 'row' }, stationName: { color: textPrimary, fontSize: 16, fontWeight: 'bold' }, stationAddress: { color: textCancel, fontSize: 14, paddingTop: 4, paddingBottom: 4 }, infoStatus: { fontSize: 12, borderRadius: 3, marginRight: 5, borderWidth: 1, ...$padding(3, 8, 2) }, selected: { color: textPrimary, borderColor: colorAccent }, available: { color: '#90DB0A', borderColor: '#90DB0A' }, unavailable: { color: '#999', fontSize: 10.5, paddingTop: 7, paddingLeft: 9, paddingRight: 9, paddingBottom: 7, backgroundColor: '#CCC' }, private: { color: '#FDB702', borderColor: '#FDB702' }, connectView: { paddingTop: 4, paddingBottom: 8, alignItems: 'center', flexDirection: 'row' }, connectType: { borderWidth: 1, borderColor: textPrimary, borderRadius: 3, marginRight: 16, alignItems: 'center', flexDirection: 'row', }, directView: { zIndex: 1, width: 32, height: 32, marginTop: 4, marginLeft: 8, alignItems: 'center' }, distanceText: { color: textPrimary, fontSize: 12, paddingTop: 2 }, })