Commit ad483a18 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Auth.js
parents ed6ffdf3 699c0721
{
"expo": {
"name": "Excelso_update 11.30 / 18.05.2020",
"name": "Excelso_update 13.00 / 18.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
......@@ -8,8 +8,9 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { connect } from 'react-redux';
import Axios from 'axios';
import Spinner from 'react-native-loading-spinner-overlay';
import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons';
class AddreesDetail extends React.Component {
class AddreesDetail extends React.Component {
constructor(props) {
super(props)
......@@ -18,18 +19,18 @@ import Spinner from 'react-native-loading-spinner-overlay';
longitude: 0,
location: null,
error_message: null,
name:'',
address_id:'',
description:'',
lat:'',
long:'',
name: '',
address_id: '',
description: '',
lat: '',
long: '',
street: '',
city: '',
region: '',
name: '',
postalCode: '',
address: '',
address_d:'',
address_d: '',
spinner: false,
}
}
......@@ -74,7 +75,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
// name: detail[0].name,
region: detail[0].region,
postalCode: detail[0].postalCode,
})
......@@ -91,7 +92,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
Alert.alert('Alamat tidak di temukan!');
} else {
let detail = await Location.reverseGeocodeAsync(search_location[0])
this.setState({
latitude: search_location[0].latitude,
longitude: search_location[0].longitude,
......@@ -112,13 +113,13 @@ import Spinner from 'react-native-loading-spinner-overlay';
spinner: true,
})
const navigation = this.props.navigation
let params = {
session_id: this.props.session_id,
address_id: '',
address: this.state.street + ' ' + this.state.city + ' ' + this.state.region + ' ' + this.state.postalCode ,
address: this.state.street + ' ' + this.state.city + ' ' + this.state.region + ' ' + this.state.postalCode,
name: this.state.name,
description: this.state.description ,
description: this.state.description,
lat: this.state.latitude,
long: this.state.longitude
}
......@@ -128,7 +129,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
Alert.alert(
'Berhasil',
'Berhasil menambahkan Alamat !'
)
this.setState({
spinner: false,
......@@ -138,8 +139,8 @@ import Spinner from 'react-native-loading-spinner-overlay';
}).catch(error => {
let response = error.response.data;
const {navigation} = this.props
session(response,navigation)
const { navigation } = this.props
session(response, navigation)
Alert.alert(
'',
response.msg
......@@ -153,25 +154,26 @@ import Spinner from 'react-native-loading-spinner-overlay';
render() {
return (
<View style={styles.container}>
<Spinner
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<ScrollView>
<View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Tambah Alamat</Text>
</View>
<View style={styles.content}>
<View style={styles.field_search}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Cari</Text>
</View>
<View style={{ height: 45, borderRadius: 10, borderColor: 'grey', borderWidth: 1, flexDirection: 'row', marginTop: 15, marginLeft: 10, marginRight: 10 }}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }} onChangeText={(address) => this.setState({ address })} />
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari Alamat"
onChangeText={(address) => this.setState({ address })}>
</TextInput>
</View>
<View style={{ alignSelf: 'center' }}>
<Button title="cari" onPress={() => this._searchLocation()}></Button>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity onPress={() => this._searchLocation()}>
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</TouchableOpacity>
</View>
</View>
<View style={styles.cont_google_map}>
......@@ -189,45 +191,53 @@ import Spinner from 'react-native-loading-spinner-overlay';
loadingEnabled={true}
showsUserLocation={true}
showsScale={true}
style={styles.cont_google_map}
/>
style={styles.cont_google_map}>
<MapView.Marker
coordinate={{
latitude: this.state.latitude,
longitude:this.state.longitude
}}
title={"Lokasi Kamu "}
description={this.state.street}
/>
</MapView>
<View style={{ position: 'absolute', top: '50%', alignSelf: 'flex-end' }}>
<View style={{ margin: 15 }}>
<TouchableOpacity style={{ height: 30, width: 30, backgroundColor: '#e6e6e6' }} onPress={() => this._getLocationAsync()}>
<Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} />
{/* <Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> */}
</TouchableOpacity>
</View>
</View>
</View>
<View style={styles.name_addrees_input}>
<View style={{ flexDirection: 'row', top: 20 }}>
<View style={{ flex: 0.5 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={{ flex: 3 }}>
<Text style={{ fontFamily: 'Gotham-Light' }}>{this.state.street}</Text><Text style={{ fontFamily: 'Gotham-Light' }}>{this.state.city} <Text>{this.state.region}</Text><Text>{this.state.postalCode}</Text></Text>
</View>
</View>
<View style={styles.field_name_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Nama</Text>
<Text style={{ fontFamily: 'Gotham-Black', marginLeft: 10, color: "#ccb46c" }}>Nama</Text>
</View>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10 }} onChangeText={(name) => this.setState({ name })} />
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} onChangeText={(name) => this.setState({ name })} />
</View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Detail</Text>
</View>
<TextInput style={{ height: 80, borderWidth: 1, padding: 5, flex: 1, margin: 10 }} onChangeText={(description) => this.setState({ description })} />
</View>
<View style={styles.field_name_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Alamat</Text>
</View>
<View style={{ flex: 1, height: 80, borderWidth: 1, padding: 5, margin: 10 }}>
<View style={{ padding: 5 }}>
<Text>{this.state.street}</Text>
<Text>{this.state.city}</Text>
<Text>{this.state.region}</Text>
<Text>{this.state.postalCode}</Text>
</View>
<Text style={{ fontFamily: 'Gotham-Black', marginLeft: 10, color: "#ccb46c" }} >Detail</Text>
</View>
<TextInput style={{ height: 80, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} onChangeText={(description) => this.setState({ description })} />
</View>
<View style={{ margin: 50, justifyContent: 'center' }}>
<Button title="Simpan" onPress={() => this.saveAddress()} />
<TouchableOpacity onPress={() => this.saveAddress()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>+ Tambah Alamat</Text>
</View>
</TouchableOpacity>
</View>
</View>
</View>
......@@ -255,13 +265,12 @@ const styles = StyleSheet.create({
},
field_search: {
flexDirection: 'row'
flexDirection: 'column'
},
cont_google_map: {
flex: 1,
borderWidth: 1,
margin: 5,
top: 5,
height: 250,
},
......@@ -271,11 +280,13 @@ const styles = StyleSheet.create({
},
field_name_addrees: {
flexDirection: 'row'
flexDirection: 'column',
top: 25,
},
field_detail_addrees: {
flexDirection: 'row'
flexDirection: 'column',
top: 25,
},
button: {
......@@ -287,10 +298,12 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => {
return {
session_id: state.session_id,
session_id: state.session_id,
}
}
export default connect(mapStateToProps)(AddreesDetail)
\ No newline at end of file
}
export default connect(mapStateToProps)(AddreesDetail)
// <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10,borderRadius:5 }} onChangeText={(address) => this.setState({ address })} />
\ No newline at end of file
......@@ -232,20 +232,22 @@ class Auth extends React.Component {
textAlign: 'center'
}, title: 'PROFIL'
}} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
{/* <Stack.Screen name="Change Profil" component={ChangeProfile} /> */}
<Stack.Screen name="Change language" component={ChangeLanguage} />
<Stack.Screen name="Change password" component={ChangePassword} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'CHANGE PROFIL'
}} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
{/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Change password" component={ChangePassword} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'CHANGE PASSWORD'
}}/>
<Stack.Screen name="Card Activation" component={CardActivation} />
<Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} />
......@@ -267,7 +269,18 @@ class Auth extends React.Component {
},
title: 'Delivery Address'
}} />
<Stack.Screen name="Address Detail" component={AddressDetail} />
<Stack.Screen name="Address Detail" component={AddressDetail} options={{
headerStyle: { backgroundColor: "#ccb46c" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: ' Tambah Alamat'
}} />
<Stack.Screen name="Menu Detail" component={MenuDetail} options={({ route }) => ({
title: route.params.nameMenu,
headerStyle: { backgroundColor: '#CFB368' },
......@@ -382,19 +395,20 @@ class Auth extends React.Component {
title: 'REGISTER'
}} />
<Stack.Screen name="TopUpInfo" component={TopUpInfo} />
<Stack.Screen name="Reward Detail" component={RewardDetail} options={{
headerStyle: { backgroundColor: "#ccb46c" },
<Stack.Screen name="Reward Detail" component={RewardDetail} />
<Stack.Screen name="Reward Select" component={RewardSelect}
options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
fontSize: 18,
},
title: 'REWARD DETAIL'
title: 'REWARD SELECT'
}} />
<Stack.Screen name="Reward Select" component={RewardSelect} />
</Stack.Navigator>
)
}
......
import React, { Component, PureComponent } from 'react';
import { StyleSheet, Text, TextInput, View, Button,Alert } from 'react-native';
import { StyleSheet, Text, TextInput, View, Button, Alert, TouchableOpacity } from 'react-native';
import Axios from 'axios';
import {BASE_URL_CHANGE_PASSWORD} from '../model/Base_Model';
import { BASE_URL_CHANGE_PASSWORD } from '../model/Base_Model';
import { connect } from 'react-redux';
class ChangePassword extends React.Component {
......@@ -15,7 +15,7 @@ class ChangePassword extends React.Component {
}
}
componentDidMount(){
componentDidMount() {
}
......@@ -29,54 +29,71 @@ class ChangePassword extends React.Component {
Axios.post(BASE_URL_CHANGE_PASSWORD, params).then(res => {
this.props.navigation.navigate('Profile');
}).catch(error => {
let response = error.response.data;
Alert.alert(response.msg);
console.log(error)
let response = error.response;
Alert.alert('', response.msg);
})
}
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
{/* <View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Change Password</Text>
</View>
</View> */}
<View style={styles.form}>
<View style={styles.field_token}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Current Password</Text>
<View style={{ marginBottom: 25 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>Current Password</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 50, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(old_password) => this.setState({ old_password })}
value={this.state.old_password }
secureTextEntry={true}/>
<View style={styles.items2}>
<TextInput style={styles.textInput}
onChangeText={(old_password) => this.setState({ old_password })}
value={this.state.old_password}
secureTextEntry={true}
placeholder='******'
placeholderTextColor='gray'
textAlign='center' />
</View>
</View>
<View style={styles.field_new_password}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>New Password</Text>
<View style={styles.field_token}>
<View style={{ marginBottom: 25 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>New Password</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 50, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(Password) => this.setState({ Password })}
value={this.state.Password}
secureTextEntry={true}/>
<View style={styles.items2}>
<TextInput style={styles.textInput}
onChangeText={(Password) => this.setState({ Password })}
value={this.state.Password}
secureTextEntry={true}
placeholder='******'
placeholderTextColor='gray'
textAlign='center' />
</View>
</View>
<View style={styles.field_repeat_password}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Repeat Password</Text>
<View style={styles.field_token}>
<View style={{ marginBottom: 25 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>Repeat Password</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 50, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(Password_confirmation) => this.setState({ Password_confirmation })}
value={this.state.Password_confirmation}
secureTextEntry={true}/>
<View style={styles.items2}>
<TextInput style={styles.textInput}
onChangeText={(Password_confirmation) => this.setState({ Password_confirmation })}
value={this.state.Password_confirmation}
secureTextEntry={true}
placeholder='******'
placeholderTextColor='gray'
textAlign='center' />
</View>
</View>
<View style={styles.button}>
<Button title="Change Password" onPress={()=>this.changePassword()}></Button>
</View>
{/* <View style={styles.button}>
<Button title="Change Password" onPress={() => this.changePassword()}></Button>
</View> */}
<TouchableOpacity onPress={() => this.changePassword()}>
<View style={styles.button}>
<Text style={{ color: 'white', fontSize: 12, fontFamily: 'Gotham-Black' }}>Change Password</Text>
</View>
</TouchableOpacity>
</View>
</View>
)
......@@ -96,13 +113,12 @@ const styles = StyleSheet.create({
},
form: {
flex: 3,
margin: 10,
marginTop: 0,
flex: 0.8,
flexDirection: 'column',
},
field_token: {
flexDirection: 'row'
marginTop: 25
},
field_new_password: {
......@@ -113,11 +129,32 @@ const styles = StyleSheet.create({
flexDirection: 'row'
},
button: {
height: 50,
margin: 10,
items2: {
flex: 1,
height: 35,
marginHorizontal: 15,
justifyContent: 'center',
alignItems: 'stretch',
},
}
textInput: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
padding: 10,
margin: 30,
borderRadius: 10
},
button: {
backgroundColor: '#CFB368',
marginTop: 50,
marginHorizontal: 100,
borderRadius: 15,
padding:10,
alignItems: 'center',
justifyContent: 'center'
},
});
......
......@@ -209,31 +209,27 @@ class DeliveryAddrees extends React.Component {
return (
<View style={styles.list_addrees}>
<TouchableOpacity onPress={() => this.onSave(item.address, item.id)}>
<View style={{ flex: 1, flexDirection: 'row', margin: 20, }}>
<View style={{ flex: 1, flexDirection: 'row', margin: 5, }}>
<View style={{ flex: 1, marginBottom: 10, justifyContent: 'center' }}>
<CheckBox
center
checkedIcon='dot-circle-o'
uncheckedIcon='circle-o'
checked={this.state.checked}
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/>
<Text style={{ textAlign: 'center', color: '#ccb46c', fontFamily: 'Gotham-Light' }}>PILIH</Text>
</View>
<View style={{ flex: 3, justifyContent: 'center' }}>
<View style={{ margin: 5, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 19, marginBottom: 5 }}>{item.name}</Text>
<View>
<CheckBox
checkedIcon='dot-circle-o'
uncheckedIcon='circle-o'
checked={this.state.checked}
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/>
</View>
<View>
<Text style={{textAlign:'center', color: '#ccb46c', fontFamily: 'Gotham-Light' ,marginRight:20}}>PILIH</Text>
</View>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 15, marginBottom: 5 }}>{item.address}</Text>
</View>
<View style={{ flex: 1,justifyContent:'center' }}>
<View style={{ margin: 5, }}>
<Image
style={{height:20,width:20,tintColor:'#ccb46c'}}
source={require('../assets/ellipsis-v.png')}
/>
<View style={{ flex: 3, justifyContent: 'center' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 15 }}>{item.name}</Text>
</View>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 15 }}>{item.address}</Text>
</View>
</View>
</TouchableOpacity>
......
......@@ -208,11 +208,11 @@ class PickupName extends React.Component {
<View style={{ margin: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20 }}>{item.name}</Text>
<View style={{flexDirection:'row'}}>
{item.can_accept_order == true ? (<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c",top:5}}>OPEN : </Text>)
:(<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c"}}>CLOSED : </Text>) }
{item.can_accept_order == true ? (<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c",top:5}}>OPEN </Text>)
:(<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c"}}>CLOSED </Text>) }
</View>
</View>
<Text style={{ fontFamily: 'Gotham-Light', color: '#CFB368', fontSize: 15}}> Opening Hours : {item.open_time} - {item.close_time}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: '#CFB368'}}> Opening Hours : {item.open_time} - {item.close_time}</Text>
<Text style={{ margin: 5, color: '#b1b1b2',fontFamily: 'Gotham-Light' }}>
{item.full_address}
</Text>
......@@ -257,7 +257,6 @@ class PickupName extends React.Component {
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</View>
</View>
</View>
<View style={styles.body}>
<FlatList
......
......@@ -84,9 +84,9 @@ class RewardSelect extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
{/* <View style={styles.header}>
<Text style={{ color: 'white', textAlign: 'center', fontSize: 18, fontFamily: 'Gotham-Black' }}>REWARDS E-VOUCHER</Text>
</View>
</View> */}
<ScrollView style={styles.body}>
{
this.state.rewardsList.map((item, key) => (
......
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