Commit 6fcf4afd authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

xxx

parent 6be89811
......@@ -189,12 +189,6 @@ class MenuSelection extends React.Component {
this.setState({ isFetching: true }, function () { this.getMenuList() });
}
scrollToItem = () => {
this.props._scrollView.scrollTo({ y: 1 * 100 });
}
handleAdd(item, index) {
const order_item = {
......@@ -208,43 +202,30 @@ class MenuSelection extends React.Component {
}
let res = this.props.addToChart(order_item)
// console.log('After add : ' + JSON.stringify(res))
// const list_order_item = this.props.order_item;
// let is_xist = list_order_item.find(row => row.id == item.id)
// let quantity = 1
// if (is_xist) {
// console.log(is_xist.name + ' Item Sudah ada dengan quantity : ' + is_xist.quantity)
// quantity = is_xist.quantity
// }
// const listMenu = [...this.state.listMenu]
// listMenu[index].qty = quantity
// console.log("HASIL : " + listMenu[index].qty)
// this.setState({
// listMenu
// })
}
clearNegatif(item, index) {
const list_order_item = this.props.order_item;
for (let i = 0; i < list_order_item.length; index++) {
const row = list_order_item[i];
if (row.quantity !== 0) {
const order_item = {
id: item.id,
name: item.name,
price: item.price,
}
this.props.reduceQuantityItem(order_item)
}
}
onChange(value){
console.log( "INI TEXT NYA :"+ JSON.stringify(value))
}
// clearNegatif(item, index) {
// const list_order_item = this.props.order_item;
// for (let i = 0; i < list_order_item.length; index++) {
// const row = list_order_item[i];
// if (row.quantity !== 0) {
// const order_item = {
// id: item.id,
// name: item.name,
// price: item.price,
// }
// this.props.reduceQuantityItem(order_item)
// }
// }
// }
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 +275,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}
......@@ -387,6 +369,12 @@ const mapDispatchToProps = (dispacth) => {
name_outlet: OutletChange.name_outlet,
}
}),
setChangeQuantity: (item) => dispacth({
type: ActionType.CHANGE_TO_CHART,
data: {
item:item
}
}),
}
}
......
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