Commit 689da5c8 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents da0eaad7 0b39053f
{ {
"expo": { "expo": {
"name": "Excelso_update v1. Sore_12.05.2020", "name": "Excelso_update v1. 13.05.2020",
"slug": "excelso-pro", "slug": "excelso-pro",
"privacy": "public", "privacy": "public",
"sdkVersion": "36.0.0", "sdkVersion": "36.0.0",
......
...@@ -294,7 +294,7 @@ class Home extends React.Component { ...@@ -294,7 +294,7 @@ class Home extends React.Component {
<TouchableOpacity style={styles.submitUpgradePemium} activeOpacity={.5} onPress={this.onPress}> <TouchableOpacity style={styles.submitUpgradePemium} activeOpacity={.5} onPress={this.onPress}>
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>TOP BALANCE </Text> <Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>TOP BALANCE </Text>
</TouchableOpacity> </TouchableOpacity>
<Text> sore 12 May 2019 </Text> <Text> 13 May 2020 </Text>
<View style={{ height: 60 }}></View> <View style={{ height: 60 }}></View>
</View> </View>
</View> </View>
......
...@@ -16,12 +16,12 @@ class MenuConfirmation extends React.Component { ...@@ -16,12 +16,12 @@ class MenuConfirmation extends React.Component {
ongkir: 0, ongkir: 0,
diskon: 0, diskon: 0,
totalOrder: 0, totalOrder: 0,
type:'', type: '',
spinner: false, spinner: false,
} }
} }
componentDidMount(){ componentDidMount() {
// console.log(" DESTINASI : "+ this.props.grabdestination) // console.log(" DESTINASI : "+ this.props.grabdestination)
// console.log("ONGKIR"+ this.props.grabamount) // console.log("ONGKIR"+ this.props.grabamount)
// console.log("drop off"+this.props.grabdropoff) // console.log("drop off"+this.props.grabdropoff)
...@@ -39,19 +39,19 @@ class MenuConfirmation extends React.Component { ...@@ -39,19 +39,19 @@ class MenuConfirmation extends React.Component {
}) })
if (is_pickup) { if (is_pickup) {
this.setState({ this.setState({
type : 'Pick Up' type: 'Pick Up'
}) })
} else { } else {
this.setState({ this.setState({
type : 'Delivery' type: 'Delivery'
}) })
} }
// console.log(is_pickup) // console.log(is_pickup)
let params = { let params = {
session_id : this.props.session_id, session_id: this.props.session_id,
outlet_id : this.props.outlet_id, outlet_id: this.props.outlet_id,
address_id : this.props.addressId, address_id: this.props.addressId,
trans_type: this.state.type, trans_type: this.state.type,
order_item: this.props.order_item, order_item: this.props.order_item,
delivery_charge: this.props.grabamount, delivery_charge: this.props.grabamount,
...@@ -74,17 +74,35 @@ class MenuConfirmation extends React.Component { ...@@ -74,17 +74,35 @@ class MenuConfirmation extends React.Component {
spinner: false, spinner: false,
}) })
let transIdProps = { let transIdProps = {
trans_id : data_order trans_id: data_order
} }
this.props.setTransId(transIdProps); this.props.setTransId(transIdProps);
// add API use voucher here // add API use voucher here
// let param = {
// session_id: this.props.session_id,
// reward_id: this.props.voucher.id,
// lat: this.props.lat,
// long: this.props.long
// }
// Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/use_reward', param).then(res => {
// console.log(res.data)
// }).catch(error => {
// const { navigation } = this.props
// let response = error.response.data
// session(response, navigation)
// Alert.alert(response.msg);
// this.setState({
// spinner: false,
// })
// })
Alert.alert( Alert.alert(
"Berhasil", "Berhasil",
"Transaksi sudah berhasil, terimakasih sudah menggunakan excelso untuk ngopi", "Transaksi sudah berhasil, terimakasih sudah menggunakan excelso untuk ngopi",
[ [
{ text: "OK", onPress: () => this.orderSuccess()} { text: "OK", onPress: () => this.orderSuccess() }
], ],
{ cancelable: false } { cancelable: false }
...@@ -110,7 +128,7 @@ class MenuConfirmation extends React.Component { ...@@ -110,7 +128,7 @@ class MenuConfirmation extends React.Component {
render() { render() {
// console.log(this.props) console.log(this.props.long)
let total = 0 let total = 0
return ( return (
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
...@@ -155,9 +173,9 @@ class MenuConfirmation extends React.Component { ...@@ -155,9 +173,9 @@ class MenuConfirmation extends React.Component {
</View> </View>
<View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}>
{this.props.type_pickup == true? ( {this.props.type_pickup == true ? (
null null
):( ) : (
<View> <View>
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Text>Delivery Charge</Text> <Text>Delivery Charge</Text>
...@@ -174,13 +192,13 @@ class MenuConfirmation extends React.Component { ...@@ -174,13 +192,13 @@ class MenuConfirmation extends React.Component {
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Text>Total</Text> <Text>Total</Text>
</View> </View>
{this.props.type_pickup == true? ( {this.props.type_pickup == true ? (
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Text>{ Math.max(0,this.props.order_total - this.props.voucher.reward.value)}</Text> <Text>{Math.max(0, this.props.order_total - this.props.voucher.reward.value)}</Text>
</View> </View>
):( ) : (
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Text>{this.props.order_total + this.props.grabamount + this.state.diskon }</Text> <Text>{this.props.order_total + this.props.grabamount + this.state.diskon}</Text>
</View> </View>
)} )}
...@@ -203,7 +221,7 @@ class MenuConfirmation extends React.Component { ...@@ -203,7 +221,7 @@ class MenuConfirmation extends React.Component {
</View> </View>
{this.props.type_pickup == true ? ( {this.props.type_pickup == true ? (
null null
):( ) : (
<View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', margin: 10, justifyContent: 'space-between' }}>
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Text>Delivery to</Text> <Text>Delivery to</Text>
...@@ -214,7 +232,7 @@ class MenuConfirmation extends React.Component { ...@@ -214,7 +232,7 @@ class MenuConfirmation extends React.Component {
</View> </View>
)} )}
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Button title='order' onPress={() => this.setOrder(this.props.type_pickup)}/> <Button title='order' onPress={() => this.setOrder(this.props.type_pickup)} />
</View> </View>
</ScrollView> </ScrollView>
) )
...@@ -276,12 +294,14 @@ const mapStateToProps = (state) => { ...@@ -276,12 +294,14 @@ const mapStateToProps = (state) => {
grabtype: state.grabtype, grabtype: state.grabtype,
grabamount: state.grabamount, grabamount: state.grabamount,
grabpickup: state.grabpickup, grabpickup: state.grabpickup,
grabdropoff:state.grabdropoff, grabdropoff: state.grabdropoff,
grabdestination:state.grabdestination, grabdestination: state.grabdestination,
balanceUsed: state.balanceUsed, balanceUsed: state.balanceUsed,
pointused: state.pointused, pointused: state.pointused,
addressId: state.addressId addressId: state.addressId,
lat: state.lat,
long: state.long
} }
} }
export default connect(mapStateToProps,mapDispatchToProps)(MenuConfirmation) export default connect(mapStateToProps, mapDispatchToProps)(MenuConfirmation)
...@@ -438,7 +438,7 @@ class ShoppingCart extends React.Component { ...@@ -438,7 +438,7 @@ class ShoppingCart extends React.Component {
</View> </View>
<View style={styles.voucher}> <View style={styles.voucher}>
{ {
this.props.voucher === [] ? ( this.props.value_voucher == '' ? (
<TouchableOpacity onPress={() => this.props.navigation.navigate('Reward Select')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Reward Select')}>
<Text style={{ color: '#ccb46c' }}>+ ADD VOUCHER</Text> <Text style={{ color: '#ccb46c' }}>+ ADD VOUCHER</Text>
</TouchableOpacity> </TouchableOpacity>
......
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