Commit baf57aa8 authored by Trisno's avatar Trisno

update

parent 03cdc02e
......@@ -58,7 +58,8 @@ const globalState = {
order_quantity: 0,
order_total: 0,
address:''
address:'',
addressId:''
}
const rootReducer = (state = globalState, action) => {
......@@ -205,8 +206,8 @@ const rootReducer = (state = globalState, action) => {
case ActionType.SET_ADDRESS:{
return{
...state,
address: action.data.address
address: action.data.address,
addressId:action.data.addressId
}
}
case ActionType.SET_LOGOUT:{
......
......@@ -15,7 +15,7 @@ class DeliveryAddrees extends React.Component {
componentDidMount() {
this.getAddreess()
console.log(this.props)
console.log("INI ID ADDRESS : "+ this.props.addressId)
}
onChangeAddress = data => {
......@@ -35,12 +35,13 @@ class DeliveryAddrees extends React.Component {
for (let i = 0; i < dataAlamat.length; i++) {
const element = dataAlamat[i];
address.push(element)
}
this.setState({
data: address
})
console.log(this.state.data[0].id)
}).catch(error => {
let response = error.response.data;
......@@ -69,7 +70,8 @@ class DeliveryAddrees extends React.Component {
)
let setDataAddress = {
address : address
address : address,
addressId : this.state.data[0].id
}
this.props.setAddress(setDataAddress);
......@@ -162,9 +164,11 @@ const styles = StyleSheet.create({
})
const mapStateToProps = (state) => {
console.log("INI STATE : "+ JSON.stringify(state))
return {
session_id: state.session_id,
addressId : state.addressId
}
}
......@@ -177,6 +181,7 @@ const mapDispatchToProps = (dispacth) => {
data: {
address: setDataAddress.address,
addressId: setDataAddress.addressId
}
}),
}
......
......@@ -28,7 +28,7 @@ class MenuSelection extends React.Component {
this.getMenuList()
// console.log("INI TOTAL ORDER : " + this.props.orders)
// console.log("INI TOTAL QTY :" + this.props.quantity)
console.log("INI ORDERAN NYA :" + JSON.stringify(this.props.cart_shop))
console.log("INI OETLET :" + JSON.stringify(this.props.outlet_id))
}
getMenuList() {
......@@ -245,7 +245,8 @@ const mapStateToProps = (state) => {
order_quantity: state.order_quantity,
order_total: state.order_total,
quantity: state.quantity,
address: state.address
address: state.address,
// qty: state.qty,
// totalOrder: state.totalOrder,
// totalQty: state.totalQty,
......
......@@ -64,8 +64,15 @@ class PickupName extends React.Component {
this.getOutlet()
}
getOutletDetail(id) {
this.props.navigation.navigate('Outlet Detail',{id:id})
getOutletDetail(id,name) {
let OutletChange = {
outlet_id: id ,
name_outlet:name,
}
this.props.setChangeOutletProps(OutletChange);
this.props.navigation.navigate("Menu Select")
}
getOutlet() {
......@@ -190,7 +197,7 @@ class PickupName extends React.Component {
</Text>
</View>
<View>
<TouchableOpacity onPress={() => this.getOutletDetail(item.id)}>
<TouchableOpacity onPress={() => this.getOutletDetail(item.id, item.name)}>
<CheckBox
center
checkedIcon='dot-circle-o'
......
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