Commit 63f561bc authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

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

# Conflicts:
#	view/MenuConfirmation.js
parents 6102760c eed0973c
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, ScrollView } from 'react-native'; import { View, Text, Alert, TextInput, StyleSheet, Button, ScrollView } from 'react-native';
import Axios from 'axios' import Axios from 'axios'
import { connect } from 'react-redux' import { connect } from 'react-redux'
class MenuConfirmation extends React.Component { class MenuConfirmation extends React.Component {
...@@ -24,10 +24,36 @@ class MenuConfirmation extends React.Component { ...@@ -24,10 +24,36 @@ class MenuConfirmation extends React.Component {
console.log("type" +this.props.grabtype) console.log("type" +this.props.grabtype)
console.log("BALANCED" +this.props.balanceUsed) console.log("BALANCED" +this.props.balanceUsed)
console.log("POINT" +this.props.pointsused) console.log("POINT" +this.props.pointsused)
this.setOrder()
}
setOrder() {
let params = {
session_id : this.props.session_id,
outlet_id : this.props.outlet_id,
address_id : this.props.addressId,
trans_type: "Delivery",
order_item: this.props.order_item,
delivery_charge: this.state.ongkir,
voucher: [],
payment: {
balance: this.props.route.params.balanceUsed,
point: this.props.route.params.pointused
}
}
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => {
console.log(res)
}).catch(error => {
let response = error.response.data;
Alert.alert(response.msg);
})
} }
render() { render() {
console.log(this.props) // console.log(this.props)
let total = 0 let total = 0
return ( return (
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
...@@ -106,7 +132,7 @@ class MenuConfirmation extends React.Component { ...@@ -106,7 +132,7 @@ class MenuConfirmation extends React.Component {
</View> </View>
</View> </View>
<View style={{ margin: 10 }}> <View style={{ margin: 10 }}>
<Button title='order'/> <Button title='order' onPress={this.setOrder()}/>
</View> </View>
</ScrollView> </ScrollView>
) )
...@@ -154,6 +180,7 @@ const mapStateToProps = (state) => { ...@@ -154,6 +180,7 @@ const mapStateToProps = (state) => {
grabdestination:state.grabdestination, grabdestination:state.grabdestination,
balanceUsed: state.balanceUsed, balanceUsed: state.balanceUsed,
pointused: state.pointsused, pointused: state.pointsused,
addressId: state.addressId
} }
} }
......
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