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

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

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