Commit 20ab641b authored by Trisno's avatar Trisno

filter pickup

parent f7eeee7f
...@@ -65,7 +65,7 @@ class PickupName extends React.Component { ...@@ -65,7 +65,7 @@ class PickupName extends React.Component {
this.getOutlet() this.getOutlet()
} }
getOutletDetail(id, name,address) { getOutletDetail(id, name, address) {
let OutletChange = { let OutletChange = {
outlet_id: id, outlet_id: id,
...@@ -103,7 +103,7 @@ class PickupName extends React.Component { ...@@ -103,7 +103,7 @@ class PickupName extends React.Component {
Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_list", params).then(res => { Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_list", params).then(res => {
let dataOutlets = res.data.outlets; let dataOutlets = res.data.outlets;
console.log("INI ADALAH DATA OUTLETS : " + JSON.stringify(dataOutlets)) // console.log("INI ADALAH DATA OUTLETS : " + JSON.stringify(dataOutlets))
for (let i = 0; i < dataOutlets.length; i++) { for (let i = 0; i < dataOutlets.length; i++) {
dataOutlets[i]['distance'] = this.distance(dataOutlets[i]['lat'], dataOutlets[i]['long']); dataOutlets[i]['distance'] = this.distance(dataOutlets[i]['lat'], dataOutlets[i]['long']);
let address = dataOutlets[i]['address']; let address = dataOutlets[i]['address'];
...@@ -201,11 +201,13 @@ class PickupName extends React.Component { ...@@ -201,11 +201,13 @@ class PickupName extends React.Component {
RenderItem = ({ item }) => { RenderItem = ({ item }) => {
return ( return (
<View> <View>
{item.can_accept_order == true ? ( {
item.pickup == true ? (
item.can_accept_order == true ? (
<View> <View>
<TouchableOpacity onPress={() => this.getOutletDetail(item.id, item.name,item.full_address)}> <TouchableOpacity onPress={() => this.getOutletDetail(item.id, item.name, item.full_address)}>
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{top:10}}> <View style={{ top: 10 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<View style={styles.list_addrees}> <View style={styles.list_addrees}>
...@@ -237,9 +239,9 @@ class PickupName extends React.Component { ...@@ -237,9 +239,9 @@ class PickupName extends React.Component {
</View> </View>
) : (<View> ) : (<View>
<View> <View>
<TouchableOpacity onPress={() => Alert.alert('','Mohon Maaf Outlet Tutup !')}> <TouchableOpacity onPress={() => Alert.alert('', 'Mohon Maaf Outlet Tutup !')}>
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{top:10}}> <View style={{ top: 10 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<View style={styles.list_addrees}> <View style={styles.list_addrees}>
...@@ -270,7 +272,11 @@ class PickupName extends React.Component { ...@@ -270,7 +272,11 @@ class PickupName extends React.Component {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View>)} </View>)
) : (
null
)
}
</View> </View>
...@@ -287,7 +293,7 @@ class PickupName extends React.Component { ...@@ -287,7 +293,7 @@ class PickupName extends React.Component {
/> */} /> */}
<View style={styles.searchbar}> <View style={styles.searchbar}>
<View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row' }}> <View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row' }}>
<View style={{ flex: 1,top:5 }}> <View style={{ flex: 1, top: 5 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<View style={{ flex: 6 }}> <View style={{ flex: 6 }}>
...@@ -345,9 +351,9 @@ const styles = StyleSheet.create({ ...@@ -345,9 +351,9 @@ const styles = StyleSheet.create({
searchbar: { searchbar: {
flex: 0.5, flex: 0.5,
justifyContent: 'center', justifyContent: 'center',
top:10, top: 10,
marginRight: 20, marginRight: 20,
marginLeft:20, marginLeft: 20,
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment