|
|
@@ -3,15 +3,14 @@
|
|
|
* @邠心vbe on 2022/12/23
|
|
|
*/
|
|
|
import React from 'react';
|
|
|
-import { Pressable, StyleSheet, View, Text, Image } from 'react-native';
|
|
|
+import { Pressable, StyleSheet, View, Text } from 'react-native';
|
|
|
import { ElevationObject } from '../../../components/Button';
|
|
|
import utils from '../../../utils/utils';
|
|
|
import { ChargeStyle } from '../../charge/Charging';
|
|
|
import { PageList } from '../../Router';
|
|
|
-import { ConnectType } from '../../search/Search';
|
|
|
-
|
|
|
-
|
|
|
-export default TopInfo = ({stationInfo = {}}) => {
|
|
|
+import ConnectType from '../../search/ConnectType';
|
|
|
+
|
|
|
+export default BottomSiteInfo = ({stationInfo = {}}) => {
|
|
|
const getAvailable = (type) => {
|
|
|
const all = stationInfo.allConnector;
|
|
|
if (all) {
|
|
|
@@ -45,6 +44,10 @@ export default TopInfo = ({stationInfo = {}}) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ const toChargePage = () => {
|
|
|
+ startPage(PageList.chargeDetailPage, {stationInfo: stationInfo, action: 'view', from: PageList.home})
|
|
|
+ }
|
|
|
+
|
|
|
if (stationInfo.id) {
|
|
|
return (
|
|
|
<View style={styles.stationBarView}>
|
|
|
@@ -52,7 +55,7 @@ export default TopInfo = ({stationInfo = {}}) => {
|
|
|
<Pressable
|
|
|
style={styles.stationInfo}
|
|
|
//onPress={() => startPage(PageList.chargeDetail, {stationInfo: stationInfo, action: 'view'})}}
|
|
|
- onPress={() => startPage(PageList.chargeDetailPage, {stationInfo: stationInfo, action: 'view', from: PageList.home})}>
|
|
|
+ onPress={toChargePage}>
|
|
|
<Text
|
|
|
ellipsizeMode='tail'
|
|
|
numberOfLines={1}
|
|
|
@@ -88,11 +91,11 @@ export default TopInfo = ({stationInfo = {}}) => {
|
|
|
</View>
|
|
|
<View style={ui.flex}>
|
|
|
<View style={styles.connectView}>
|
|
|
- <ConnectType {...stationInfo.acConnector}/>
|
|
|
- <ConnectType {...stationInfo.dcConnector}/>
|
|
|
+ <ConnectType {...stationInfo?.acConnector}/>
|
|
|
+ <ConnectType {...stationInfo?.dcConnector}/>
|
|
|
</View>
|
|
|
<View style={styles.stationStatusView}>
|
|
|
- { stationInfo.allConnector && stationInfo.allConnector.available > 0 &&
|
|
|
+ { (stationInfo.allConnector && stationInfo.allConnector.available > 0) &&
|
|
|
<Text style={[ChargeStyle.infoStatus, ChargeStyle.statusAvailable, styles.stationStatus]}>Available</Text>
|
|
|
}
|
|
|
<Text style={[ChargeStyle.infoStatus, stationInfo.siteType == 'Public' ? ChargeStyle.statusAvailable : ChargeStyle.statusWarning, styles.siteTypes]}>{stationInfo.siteType}</Text>
|
|
|
@@ -101,7 +104,7 @@ export default TopInfo = ({stationInfo = {}}) => {
|
|
|
<View style={styles.divideLine}></View>
|
|
|
<Pressable
|
|
|
style={styles.infoDetailsView}
|
|
|
- onPress={() => startPage(PageList.chargeDetailPage, {stationInfo: stationInfo, action: 'view', from: PageList.home})}>
|
|
|
+ onPress={toChargePage}>
|
|
|
<View style={ui.flex1}>
|
|
|
<Text style={styles.infoTitle}>Operating Hours</Text>
|
|
|
<View style={styles.infoView}>
|
|
|
@@ -119,7 +122,7 @@ export default TopInfo = ({stationInfo = {}}) => {
|
|
|
<View style={ui.flex1}>
|
|
|
<Text style={styles.infoTitle}>Additional Info</Text>
|
|
|
<View style={styles.infoView}>
|
|
|
- <Text style={styles.infoText}>{stationInfo.additionalNotes}</Text>
|
|
|
+ <Text style={styles.infoText}>{stationInfo?.additionalNotes}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
</Pressable>
|