Commit 0cb5cf69 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

ini terbaru

parent 864a60ee
...@@ -5,7 +5,8 @@ import ActionType from '../redux/globalActionType'; ...@@ -5,7 +5,8 @@ import ActionType from '../redux/globalActionType';
class Item extends React.Component { class Item extends React.Component {
handleChangeQuantity = (item, quantity) => { handleChangeQuantity = (item, qty) => {
this.props.onChange()
const order_item = { const order_item = {
id: item.id, id: item.id,
code: item.code, code: item.code,
...@@ -15,7 +16,7 @@ class Item extends React.Component { ...@@ -15,7 +16,7 @@ class Item extends React.Component {
image: item.image, image: item.image,
price: parseInt(item.price), price: parseInt(item.price),
} }
this.props.changeQuantity({ item: order_item, quantity: quantity }) this.props.changeQuantity({ item: order_item, quantity: qty })
} }
render() { render() {
......
...@@ -245,6 +245,11 @@ class MenuSelection extends React.Component { ...@@ -245,6 +245,11 @@ class MenuSelection extends React.Component {
} }
} }
onChange(params){
console.log(params);
}
handleMin(item, index) { handleMin(item, index) {
const list_order_item = this.props.order_item; const list_order_item = this.props.order_item;
let is_xist = list_order_item.find(row => row.id == item.id) let is_xist = list_order_item.find(row => row.id == item.id)
...@@ -294,6 +299,7 @@ class MenuSelection extends React.Component { ...@@ -294,6 +299,7 @@ class MenuSelection extends React.Component {
item={item} item={item}
handleAdd={() => this.handleAdd(item, index)} handleAdd={() => this.handleAdd(item, index)}
handleMin={() => this.handleMin(item, index)} handleMin={() => this.handleMin(item, index)}
onChange={()=> this.onChange(item,index)}
/> />
)} )}
keyExtractor={item => item.id} keyExtractor={item => item.id}
...@@ -307,7 +313,10 @@ class MenuSelection extends React.Component { ...@@ -307,7 +313,10 @@ class MenuSelection extends React.Component {
<View style={{ flexDirection: 'row', }}> <View style={{ flexDirection: 'row', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text> <Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text>
<Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </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> <Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
</View> </View>
...@@ -348,6 +357,7 @@ const styles = StyleSheet.create({ ...@@ -348,6 +357,7 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
type_pickup: state.type_pickup,
session_id: state.session_id, session_id: state.session_id,
grabamount: state.grabamount, grabamount: state.grabamount,
outlet_id: state.outlet_id, outlet_id: state.outlet_id,
...@@ -387,6 +397,7 @@ const mapDispatchToProps = (dispacth) => { ...@@ -387,6 +397,7 @@ const mapDispatchToProps = (dispacth) => {
name_outlet: OutletChange.name_outlet, name_outlet: OutletChange.name_outlet,
} }
}), }),
} }
} }
......
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