Commit 82acc429 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents be5fa969 501fb054
...@@ -480,11 +480,11 @@ const rootReducer = (state = globalState, action) => { ...@@ -480,11 +480,11 @@ const rootReducer = (state = globalState, action) => {
for (let i = 0; i < state.order_item.length; i++) { for (let i = 0; i < state.order_item.length; i++) {
const row = state.order_item[i]; const row = state.order_item[i];
let is_updated = state.menu_item.find(item => item.id == row.id) let is_updated = menu.find(item => item.id == row.id)
// Update Price in Cart // Update Price in Cart
if (is_updated) { if (is_updated) {
row.price = is_updated.price row.price = parseInt(is_updated.price)
} }
quantity += parseInt(row.quantity) quantity += parseInt(row.quantity)
......
...@@ -54,13 +54,13 @@ class DeliveryAddrees extends React.Component { ...@@ -54,13 +54,13 @@ class DeliveryAddrees extends React.Component {
getRate(address_id) { getRate(address_id) {
console.log('ADdress id : ' + address_id) // console.log('ADdress id : ' + address_id)
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
address_id: address_id, address_id: address_id,
} }
console.log("INI PRAMETER NYA : " + JSON.stringify(params)) // console.log("INI PRAMETER NYA : " + JSON.stringify(params))
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate', params).then(res => {
...@@ -84,8 +84,8 @@ class DeliveryAddrees extends React.Component { ...@@ -84,8 +84,8 @@ class DeliveryAddrees extends React.Component {
this.props.setGrab(setGrabProps); this.props.setGrab(setGrabProps);
this.props.setChangeOutletProps(OutletChange); this.props.setChangeOutletProps(OutletChange);
console.log("INI SUKSES RESPONNYA ") // console.log("INI SUKSES RESPONNYA ")
console.log('Delivery Amount Address : ' + res.data.data.amount) // console.log('Delivery Amount Address : ' + res.data.data.amount)
// let setOrdersProps = { // let setOrdersProps = {
...@@ -114,17 +114,62 @@ class DeliveryAddrees extends React.Component { ...@@ -114,17 +114,62 @@ class DeliveryAddrees extends React.Component {
this.props.setAddress(setDataAddress); this.props.setAddress(setDataAddress);
this.getRate(id) // this.getRate(id)
let params = {
session_id: this.props.session_id,
address_id: id,
}
this.props.setTypePickup(false) // console.log("INI PRAMETER NYA : " + JSON.stringify(params))
// console.log(this.props) Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate', params).then(res => {
if (this.props.route.params.from == 'shoppingCart') { // this.setState({
this.props.navigation.navigate('Shopping Cart') // grabamount: res.data.data.amount,
} else { // grabdestination: res.data.data.outlet_name,
this.props.navigation.navigate("Menu Select") // })
}
let setGrabProps = {
// grabdestination: this.state.grabdestination,
// grabamount: this.state.grabamount,
grabamount: res.data.data.amount
}
let OutletChange = {
outlet_id: res.data.data.outlet_id,
name_outlet: res.data.data.outlet_name,
}
this.props.setGrab(setGrabProps);
this.props.setChangeOutletProps(OutletChange);
// console.log("INI SUKSES RESPONNYA ")
// console.log('Delivery Amount Address : ' + res.data.data.amount)
// let setOrdersProps = {
// balanceUsed: this.state.balanceused,
// pointused: this.state.pointsused,
// }
// this.props.setOrder(setOrdersProps);
this.props.setTypePickup(false)
// console.log(this.props)
if (this.props.route.params.from == 'shoppingCart') {
this.props.navigation.navigate('Shopping Cart', {outlet_change: true, outlet_id: res.data.data.outlet_id})
} else {
this.props.navigation.navigate("Menu Select")
}
}).catch(error => {
console.log('ini error ' + error)
})
......
...@@ -55,6 +55,8 @@ class MenuConfirmation extends React.Component { ...@@ -55,6 +55,8 @@ class MenuConfirmation extends React.Component {
} }
} }
console.log('BOOK : ' + JSON.stringify(params))
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => {
this.setState({ this.setState({
......
...@@ -25,13 +25,13 @@ class OutletDetail extends React.Component { ...@@ -25,13 +25,13 @@ class OutletDetail extends React.Component {
getMaps() { getMaps() {
const { navigation, route } = this.props; const { navigation, route } = this.props;
const { id } = route.params const { id } = route.params
console.log(this.props.session_id) // console.log(this.props.session_id)
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
outlet_id: id outlet_id: id
} }
console.log("INI PARAMETERNYA" + JSON.stringify(params)) // console.log("INI PARAMETERNYA" + JSON.stringify(params))
Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_detail", params).then(res => { Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_detail", params).then(res => {
let data_details = res.data.outlet let data_details = res.data.outlet
......
...@@ -81,7 +81,7 @@ class PickupName extends React.Component { ...@@ -81,7 +81,7 @@ class PickupName extends React.Component {
this.props.setTypePickup(true); this.props.setTypePickup(true);
if (this.props.route.params.from == 'shoppingCart') { if (this.props.route.params.from == 'shoppingCart') {
this.props.navigation.navigate('Shopping Cart') this.props.navigation.navigate('Shopping Cart', {outlet_change: true, outlet_id: id})
} else { } else {
this.props.navigation.navigate('Home', { this.props.navigation.navigate('Home', {
......
...@@ -25,7 +25,6 @@ class ShoppingCart extends React.Component { ...@@ -25,7 +25,6 @@ class ShoppingCart extends React.Component {
pointsused: 0, pointsused: 0,
ongkir: 0, ongkir: 0,
diskon: 0, diskon: 0,
// order_item: this.props.order_item,
grabtype: '', grabtype: '',
grabamount: '', grabamount: '',
grabpickup: '', grabpickup: '',
...@@ -46,17 +45,32 @@ class ShoppingCart extends React.Component { ...@@ -46,17 +45,32 @@ class ShoppingCart extends React.Component {
this.getRate() this.getRate()
} }
this.getBalance() this.getBalance()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
if (!this.props.type_pickup) { if (!this.props.type_pickup) {
this.getRate() this.getRate()
} }
this.getBalance() this.getBalance()
});
// console.log('UPDATE PRICE')
let params = this.props.route.params;
if (params != undefined) {
if (params.outlet_change != undefined && params.outlet_change) {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/menu/get_list', {
outlet_id: params.outlet_id
}).then(res => {
let data = res.data.data
// console.log('UPDATEING PRICE :' + JSON.stringify(data.menu))
this.props.updateMenu(data.menu)
})
}
}
});
} }
componentWillUnmount() { componentWillUnmount() {
this._unsubscribe(); this._unsubscribe();
} }
...@@ -257,9 +271,6 @@ class ShoppingCart extends React.Component { ...@@ -257,9 +271,6 @@ class ShoppingCart extends React.Component {
this.props.setGrab(setGrabProps); this.props.setGrab(setGrabProps);
// console.log("INI SUKSES RESPONNYA ") // console.log("INI SUKSES RESPONNYA ")
// console.log('Delivery Amount Cart : ' + res.data.data.amount)
let OutletChange = { let OutletChange = {
outlet_id: res.data.data.outlet_id, outlet_id: res.data.data.outlet_id,
name_outlet: res.data.data.outlet_name, name_outlet: res.data.data.outlet_name,
...@@ -715,6 +726,12 @@ const styles = StyleSheet.create({ ...@@ -715,6 +726,12 @@ const styles = StyleSheet.create({
const mapDispatchToProps = (dispacth) => { const mapDispatchToProps = (dispacth) => {
return { return {
updateMenu: (menu) => dispacth({
type: ActionType.UPDATE_MENU,
data: {
menu: menu
}
}),
setChangeOutletProps: (OutletChange) => dispacth({ setChangeOutletProps: (OutletChange) => dispacth({
type: ActionType.SET_CHANGE_OUTLET, type: ActionType.SET_CHANGE_OUTLET,
data: { data: {
......
...@@ -34,9 +34,9 @@ class TransactionDetail extends React.Component { ...@@ -34,9 +34,9 @@ class TransactionDetail extends React.Component {
transaction_id: this.props.route.params.idTrans transaction_id: this.props.route.params.idTrans
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => {
console.log("INI DATA NYA LHOOOOO ......." + JSON.stringify(res.data)) // console.log("INI DATA NYA LHOOOOO ......." + JSON.stringify(res.data))
let data = res.data let data = res.data
console.log(data) // console.log(data)
this.setState({ this.setState({
trans_type_display: data.trans_type_display, trans_type_display: data.trans_type_display,
transId: data.trans_id, transId: data.trans_id,
......
...@@ -22,7 +22,7 @@ class TransactionHistory extends React.Component { ...@@ -22,7 +22,7 @@ class TransactionHistory extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/history', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/history', params).then(res => {
let data = res.data.transactions let data = res.data.transactions
console.log('ini datanya loh : ' + JSON.stringify(data)) // console.log('ini datanya loh : ' + JSON.stringify(data))
this.setState({ this.setState({
history_list: data history_list: data
}) })
......
...@@ -30,7 +30,7 @@ class TransferBalance extends React.Component { ...@@ -30,7 +30,7 @@ class TransferBalance extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => {
let data = res.data let data = res.data
console.log('ini res nya : ' + data.kaspro_balance) // console.log('ini res nya : ' + data.kaspro_balance)
this.setState({ this.setState({
full_name: data.name, full_name: data.name,
email: data.email, email: data.email,
...@@ -42,7 +42,7 @@ class TransferBalance extends React.Component { ...@@ -42,7 +42,7 @@ class TransferBalance extends React.Component {
}) })
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
console.log(response.msg); // console.log(response.msg);
}) })
} }
...@@ -54,9 +54,9 @@ class TransferBalance extends React.Component { ...@@ -54,9 +54,9 @@ class TransferBalance extends React.Component {
"reference": this.state.reference "reference": this.state.reference
} }
console.log(params); // console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/transfer', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/transfer', params).then(res => {
console.log('ini res ' + JSON.stringify(res.data)) // console.log('ini res ' + JSON.stringify(res.data))
Alert.alert('Transaksi Berhasil') Alert.alert('Transaksi Berhasil')
this.props.navigation.goBack() this.props.navigation.goBack()
}).catch(error => { }).catch(error => {
...@@ -196,7 +196,7 @@ const mapStateToProps = (state) => { ...@@ -196,7 +196,7 @@ const mapStateToProps = (state) => {
} }
const mapDispatchToProps = (dispacth) => { const mapDispatchToProps = (dispacth) => {
console.log(dispacth) // console.log(dispacth)
return { return {
setCardactive: (cardProps) => dispacth({ setCardactive: (cardProps) => dispacth({
type: ActionType.SET_CARD, type: ActionType.SET_CARD,
......
...@@ -147,7 +147,7 @@ class UpgradePremium extends React.Component { ...@@ -147,7 +147,7 @@ class UpgradePremium extends React.Component {
// console.log(params.customer_image); // console.log(params.customer_image);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/upgrade_premium', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/upgrade_premium', params).then(res => {
console.log('ini res ' + JSON.stringify(res.data)) // console.log('ini res ' + JSON.stringify(res.data))
Alert.alert( Alert.alert(
'', '',
'Permintaan upgrade premium anda telah kami terima, mohon menunggu 1x24 jam!' 'Permintaan upgrade premium anda telah kami terima, mohon menunggu 1x24 jam!'
......
...@@ -3,7 +3,7 @@ import { View, Text, TextInput, StyleSheet, Button } from 'react-native'; ...@@ -3,7 +3,7 @@ import { View, Text, TextInput, StyleSheet, Button } from 'react-native';
export default class VerifyEmail extends React.Component { export default class VerifyEmail extends React.Component {
submit() { submit() {
console.log('hai'); // console.log('hai');
} }
render() { render() {
......
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