Commit 335a7946 authored by Afid's avatar Afid
parents 9a70f352 0cb5cf69
......@@ -5,8 +5,18 @@ import ActionType from '../redux/globalActionType';
class Item extends React.Component {
handleChangeQuantity = (item, quantity) => {
this.props.changeQuantity({ item: item, quantity: quantity })
handleChangeQuantity = (item, qty) => {
this.props.onChange()
const order_item = {
id: item.id,
code: item.code,
name: item.name,
description: item.description,
note: 'jangan garing',
image: item.image,
price: parseInt(item.price),
}
this.props.changeQuantity({ item: order_item, quantity: qty })
}
render() {
......
......@@ -6,12 +6,23 @@ import ActionType from '../redux/globalActionType';
class ItemShoping extends React.Component {
handleChangeQuantity = (item, quantity) => {
console.log('CHange Quantity Shopping CHart : ' + JSON.stringify(item))
console.log('new quantity : ' + quantity)
this.props.changeQuantity({item: item, quantity: quantity})
// console.log('CHange Quantity Shopping CHart : ' + JSON.stringify(item))
// console.log('new quantity : ' + quantity)
this.props.onChange()
const order_item = {
id: item.id,
code: item.code,
name: item.name,
description: item.description,
note: 'jangan garing',
image: item.image,
price: parseInt(item.price),
}
this.props.changeQuantity({item: order_item, quantity: quantity})
}
render() {
const { item } = this.props
// console.log(this.props)
return (
<View style={{ flex: 1, margin: 10 }} key={item.id}>
......
......@@ -245,6 +245,11 @@ class MenuSelection extends React.Component {
}
}
onChange(params){
console.log(params);
}
handleMin(item, index) {
const list_order_item = this.props.order_item;
let is_xist = list_order_item.find(row => row.id == item.id)
......@@ -294,6 +299,7 @@ class MenuSelection extends React.Component {
item={item}
handleAdd={() => this.handleAdd(item, index)}
handleMin={() => this.handleMin(item, index)}
onChange={()=> this.onChange(item,index)}
/>
)}
keyExtractor={item => item.id}
......@@ -307,7 +313,10 @@ class MenuSelection extends React.Component {
<View style={{ flexDirection: 'row', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text>
{this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
)}
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
</View>
......@@ -348,6 +357,7 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => {
return {
type_pickup: state.type_pickup,
session_id: state.session_id,
grabamount: state.grabamount,
outlet_id: state.outlet_id,
......@@ -387,6 +397,7 @@ const mapDispatchToProps = (dispacth) => {
name_outlet: OutletChange.name_outlet,
}
}),
}
}
......
......@@ -332,7 +332,13 @@ class ShoppingCart extends React.Component {
onChange(){
this.setState({
checkedBalance: false,
checkedPoint: false,
checkedBalancePoint: false,
pointsused: 0,
balanceused: 0
})
}
checkOut() {
......
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