Commit c1d0391c authored by Trisno's avatar Trisno
parents b5240593 a5abe414
...@@ -169,13 +169,13 @@ class OrderDetail extends React.Component { ...@@ -169,13 +169,13 @@ class OrderDetail extends React.Component {
</View> </View>
<View> <View>
</View> </View>
<View style={{margin:5}}> <View style={{margin:5,flexDirection:'row'}}>
<TouchableOpacity style={{marginBottom:10}} onPress={() => this.handleOrderCancel()}> <TouchableOpacity style={{ margin:5}} onPress={() => this.handleOrderCancel()}>
<View style={styles.button2}> <View style={styles.button2}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Cancel</Text> <Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Cancel</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity onPress={() => this.handleBack()}> <TouchableOpacity style={{margin:5}} onPress={() => this.handleBack()}>
<View style={styles.button2}> <View style={styles.button2}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Back</Text> <Text style={{ color: 'white', fontWeight: 'bold', fontSize: 16 }}>Back</Text>
</View> </View>
...@@ -363,7 +363,6 @@ class OrderDetail extends React.Component { ...@@ -363,7 +363,6 @@ class OrderDetail extends React.Component {
</View> </View>
{ {
this.state.trans_status == 0 ? (<TouchableOpacity onPress={() => this.handleCancel()}> this.state.trans_status == 0 ? (<TouchableOpacity onPress={() => this.handleCancel()}>
<View style={styles.button}> <View style={styles.button}>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Cancel</Text> <Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Cancel</Text>
</View> </View>
......
...@@ -75,8 +75,7 @@ class RatingOrder extends React.Component { ...@@ -75,8 +75,7 @@ class RatingOrder extends React.Component {
} }
review() { review() {
let parameter = {
let paramater = {
session_id: this.props.session_id, session_id: this.props.session_id,
transaction_id: this.props.route.params.idTrans, transaction_id: this.props.route.params.idTrans,
rating: this.state.rating, rating: this.state.rating,
...@@ -84,18 +83,20 @@ class RatingOrder extends React.Component { ...@@ -84,18 +83,20 @@ class RatingOrder extends React.Component {
lat: this.props.lat, lat: this.props.lat,
long: this.props.long long: this.props.long
} }
if (parameter.rating < 4 && parameter.review == "") {
console.log("INI PARAMS" + JSON.stringify(paramater)); Alert.alert('', 'Review Wajib Diisi !');
} else {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/review/transaction', paramater).then(res => {
Alert.alert('', 'Terimakasih Atas masukan anda!') Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/review/transaction', parameter).then(res => {
this.props.navigation.navigate('Home'); Alert.alert('', 'Terimakasih Atas masukan anda!')
this.props.navigation.navigate('Home');
}).catch(error => {
console.log("INI error " + error) }).catch(error => {
let response = error.response.data; console.log("INI error " + error)
Alert.alert(response.msg); let response = error.response.data;
}) Alert.alert(response.msg);
})
}
} }
render() { render() {
...@@ -114,13 +115,14 @@ class RatingOrder extends React.Component { ...@@ -114,13 +115,14 @@ class RatingOrder extends React.Component {
size={30} size={30}
/> />
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3, top: 10 }}>Review</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3, top: 10 }}>Review</Text>
<TextInput style={{ height: 150, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20, top: 20 }} <TextInput style={{ height: 150, borderWidth: 1, padding: 10, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20, top: 20 }}
onChangeText={(review) => this.setState({ review })} onChangeText={(review) => this.setState({ review })}
value={this.state.review} value={this.state.review}
autoCapitalize="none" autoCapitalize="none"
value={this.state.review} value={this.state.review}
multiline={true} multiline={true}
numberOfLines={5} numberOfLines={4}
blurOnSubmit={false}
/> />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.review()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.review()}>
......
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