|
|
@@ -3,7 +3,7 @@
|
|
|
* @邠心vbe on 2021/06/08
|
|
|
*/
|
|
|
import React, { Component } from 'react';
|
|
|
-import { View, Text, ImageBackground, Image, StyleSheet, Pressable } from 'react-native';
|
|
|
+import { View, Text, Image, StyleSheet, Pressable } from 'react-native';
|
|
|
import apiUser from '../../api/apiUser';
|
|
|
import { ElevationObject } from '../../components/Button';
|
|
|
import Dialog from '../../components/Dialog';
|
|
|
@@ -91,6 +91,7 @@ export default class VehicleList extends Component {
|
|
|
return (
|
|
|
<Pressable
|
|
|
key={index}
|
|
|
+ style={styles.vehicleView}
|
|
|
onPress={() => {
|
|
|
startPage(PageList.editVehicle, {id: item.vehiclePk});
|
|
|
}}
|
|
|
@@ -100,42 +101,40 @@ export default class VehicleList extends Component {
|
|
|
} else {
|
|
|
this.removeVehicle(item.vehiclePk)
|
|
|
}
|
|
|
- }}
|
|
|
- style={$padding(16, 16, 0)}>
|
|
|
- <ImageBackground
|
|
|
- style={styles.vehicleView}
|
|
|
+ }}>
|
|
|
+ <Image
|
|
|
resizeMode="contain"
|
|
|
- source={require('../../images/user/bg-vehicles.png')}>
|
|
|
- <View style={styles.vehicleRow}>
|
|
|
- <Image
|
|
|
- style={styles.vehicleIcon}
|
|
|
- source={require('../../images/user/ic-vehicle-model.png')}/>
|
|
|
- <Text style={styles.vehicleName}>{item.brand} {item.model}</Text>
|
|
|
- </View>
|
|
|
- <Text style={styles.vehicleModle}>{item.licensePlate}</Text>
|
|
|
- <View style={styles.vehicleRow}>
|
|
|
- <View style={styles.vehicleTypeRow}>
|
|
|
- <View style={styles.vehicleTypeIcon}>
|
|
|
- <VehicleType size={10}/>
|
|
|
- </View>
|
|
|
- <Text style={styles.vehicleType}>TYPE {item.connectorType}</Text>
|
|
|
+ style={styles.vehicleViewBg}
|
|
|
+ source={require('../../images/user/bg-vehicles.png')}/>
|
|
|
+ <View style={styles.vehicleRow}>
|
|
|
+ <Image
|
|
|
+ style={styles.vehicleIcon}
|
|
|
+ source={require('../../images/user/ic-vehicle-model.png')}/>
|
|
|
+ <Text style={styles.vehicleName}>{item.brand} {item.model}</Text>
|
|
|
+ </View>
|
|
|
+ <Text style={styles.vehicleModle}>{item.licensePlate}</Text>
|
|
|
+ <View style={styles.vehicleRow}>
|
|
|
+ <View style={styles.vehicleTypeRow}>
|
|
|
+ <View style={styles.vehicleTypeIcon}>
|
|
|
+ <VehicleType size={10}/>
|
|
|
</View>
|
|
|
- {/* <Image
|
|
|
- style={styles.vehicleIcon}
|
|
|
- source={type?.icon}/>
|
|
|
- <Text style={styles.vehicleName}>{type?.name}</Text> */}
|
|
|
+ <Text style={styles.vehicleType}>TYPE {item.connectorType}</Text>
|
|
|
</View>
|
|
|
- <Pressable
|
|
|
- style={styles.closeIcon}
|
|
|
- android_ripple={rippleLess}
|
|
|
- onPress={() => this.removeVehicle(item.vehiclePk)}>
|
|
|
- <MaterialCommunityIcons
|
|
|
- name="close"
|
|
|
- size={20}
|
|
|
- color={textCancel}
|
|
|
- />
|
|
|
- </Pressable>
|
|
|
- </ImageBackground>
|
|
|
+ {/* <Image
|
|
|
+ style={styles.vehicleIcon}
|
|
|
+ source={type?.icon}/>
|
|
|
+ <Text style={styles.vehicleName}>{type?.name}</Text> */}
|
|
|
+ </View>
|
|
|
+ <Pressable
|
|
|
+ style={styles.closeIcon}
|
|
|
+ android_ripple={rippleLess}
|
|
|
+ onPress={() => this.removeVehicle(item.vehiclePk)}>
|
|
|
+ <MaterialCommunityIcons
|
|
|
+ name="close"
|
|
|
+ size={20}
|
|
|
+ color={textCancel}
|
|
|
+ />
|
|
|
+ </Pressable>
|
|
|
</Pressable>
|
|
|
);
|
|
|
})
|
|
|
@@ -146,10 +145,19 @@ export default class VehicleList extends Component {
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
vehicleView: {
|
|
|
- ...$padding(12, 16, 20),
|
|
|
borderRadius: 8,
|
|
|
overflow: 'hidden',
|
|
|
- ...ElevationObject(5)
|
|
|
+ ...ElevationObject(5),
|
|
|
+ ...$margin(16, 16, 0),
|
|
|
+ ...$padding(12, 16, 20),
|
|
|
+ backgroundColor: colorLight
|
|
|
+ },
|
|
|
+ vehicleViewBg: {
|
|
|
+ right: 8,
|
|
|
+ bottom: 8,
|
|
|
+ width: 111,
|
|
|
+ height: 54,
|
|
|
+ position: 'absolute'
|
|
|
},
|
|
|
vehicleRow: {
|
|
|
alignItems: 'center',
|