Commit 53a2ec51 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

item

parent 0594aa98
{ {
"expo": { "expo": {
"name": "Excelso_update v1.06062020", "name": "Excelso_update v1.08.05.2020",
"slug": "excelso-pro", "slug": "excelso-pro",
"privacy": "public", "privacy": "public",
"sdkVersion": "36.0.0", "sdkVersion": "36.0.0",
......
...@@ -4065,9 +4065,9 @@ ...@@ -4065,9 +4065,9 @@
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==" "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg=="
}, },
"html-entities": { "html-entities": {
"version": "1.2.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.3.1.tgz",
"integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" "integrity": "sha512-rhE/4Z3hIhzHAUKbW8jVcCyuT5oJCXXqhN/6mXXVCpzTmvJnoH2HL/bt3EZ6p55jbFJBeAe1ZNpL5BugLujxNA=="
}, },
"htmlparser2": { "htmlparser2": {
"version": "4.1.0", "version": "4.1.0",
......
...@@ -604,9 +604,9 @@ const rootReducer = (state = globalState, action) => { ...@@ -604,9 +604,9 @@ const rootReducer = (state = globalState, action) => {
let list_menu = [] let list_menu = []
let list_item = [] let list_item = []
// ini kalau sudah ada diupdate if (!isNaN(parseInt(new_quantity))) {
if (!isNaN(parseInt(new_quantity))) {
console.log('Number : ' + parseInt(new_quantity)) console.log('Number : ' + parseInt(new_quantity))
exist = false exist = false
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];
......
...@@ -284,7 +284,7 @@ class Home extends React.Component { ...@@ -284,7 +284,7 @@ class Home extends React.Component {
<TouchableOpacity style={styles.submitUpgradePemium} activeOpacity={.5} onPress={this.onPress}> <TouchableOpacity style={styles.submitUpgradePemium} activeOpacity={.5} onPress={this.onPress}>
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>TOP BALANCE </Text> <Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>TOP BALANCE </Text>
</TouchableOpacity> </TouchableOpacity>
<Text>UPDATE SORE </Text> <Text>8 May 2019 </Text>
<View style={{ height: 60 }}></View> <View style={{ height: 60 }}></View>
</View> </View>
</View> </View>
......
...@@ -5,18 +5,32 @@ import ActionType from '../redux/globalActionType'; ...@@ -5,18 +5,32 @@ import ActionType from '../redux/globalActionType';
class Item extends React.Component { class Item extends React.Component {
constructor(props) {
super(props)
this.state = {
value: 0
}
}
handleChangeQuantity = (item, qty) => { handleChangeQuantity = (item, qty) => {
this.props.onChange()
const order_item = { if (qty == '') {
id: item.id, qty=0
code: item.code, } else {
name: item.name,
description: item.description, const order_item = {
note: 'jangan garing', id: item.id,
image: item.image, code: item.code,
price: parseInt(item.price), name: item.name,
} description: item.description,
this.props.changeQuantity({ item: order_item, quantity: qty }) note: 'jangan garing',
image: item.image,
price: parseInt(item.price),
}
this.props.changeQuantity({ item: order_item, quantity: qty })
console.log("ini udah masuk sini");
}
} }
render() { render() {
......
...@@ -6,8 +6,12 @@ import ActionType from '../redux/globalActionType'; ...@@ -6,8 +6,12 @@ import ActionType from '../redux/globalActionType';
class ItemShoping extends React.Component { class ItemShoping extends React.Component {
handleChangeQuantity = (item, quantity) => { handleChangeQuantity = (item, quantity) => {
// console.log('CHange Quantity Shopping CHart : ' + JSON.stringify(item))
// console.log('new quantity : ' + quantity) console.log('CHange Quantity Shopping CHart : ' + JSON.stringify(item))
console.log('new quantity : ' + quantity)
if (quantity == '') {
item.quantity = 1
}
this.props.onChange() this.props.onChange()
const order_item = { const order_item = {
id: item.id, id: item.id,
......
...@@ -299,7 +299,6 @@ class MenuSelection extends React.Component { ...@@ -299,7 +299,6 @@ 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}
......
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