Commit 9c8e9df5 authored by Trisno's avatar Trisno

fix issue edit alamat tidak bisa save, dan update build 171

parent 1b94e9d7
{
"expo": {
"extra" : {
"buildNumber" : "170",
"buildNumber" : "171",
"remarks": ""
},
......
......@@ -51,7 +51,6 @@ const ActionType = {
SET_ACCOUNT_NUMBER:'SET_ACCOUNT_NUMBER',
SET_MEMBER:'SET_MEMBER',
SET_INBOX:'SET_INBOX',
SET_EDIT_ADDRESS: 'SET_EDIT_ADDRESS'
}
export default ActionType;
......@@ -100,8 +100,7 @@ const globalState = {
old_balance_claimed: true,
set_inbox :'',
email_confirm:false,
edit_address : false,
email_confirm:false
}
......@@ -164,13 +163,6 @@ const rootReducer = (state = globalState, action) => {
pointused: action.data.pointused,
}
}
case ActionType.SET_EDIT_ADDRESS: {
return {
...state,
edit_address: action.data.edit_address,
}
}
case ActionType.SET_PAGE: {
return {
...state,
......
This diff is collapsed.
......@@ -26,6 +26,7 @@ import DeliveryAddress from './DeliveryAddrees';
import PickupName from './PickupName';
import MenuConfirmation from './MenuConfirmation';
import AddressDetail from './AddreesDetail';
import EditAddressDetail from './EditAddressDetail';
import ShoppingCart from './ShoppingCart';
import TransferBalance from './TransferBalance';
import CardInfo from './CardInfo';
......@@ -521,6 +522,19 @@ class Auth extends React.Component {
textAlign: 'center'
}, title: 'TAMBAH ALAMAT'
}} />
<Stack.Screen name="Edit Address" component={EditAddressDetail} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize: 20,
color: 'white',
textAlign: 'center'
}, title: 'EDIT ALAMAT'
}} />
<Stack.Screen name="Menu Detail" component={MenuDetail}
options={({ route }) => ({
headerStyle: { backgroundColor: '#CFB368' },
......
import { EvilIcons, Ionicons, MaterialCommunityIcons } from '@expo/vector-icons';
import { EvilIcons, Ionicons, MaterialCommunityIcons, SimpleLineIcons } from '@expo/vector-icons';
import Axios from 'axios';
import i18n from 'i18n-js';
import React from 'react';
......@@ -54,8 +54,7 @@ class DeliveryAddrees extends React.Component {
}
Axios.post(this.props.BASE_URL + 'crm/v2/member/get_address', params).then(res => {
const dataAlamat = res.data.data;
// console.log("INI DATA :" + JSON.stringify(dataAlamat))
console.log("INI DATA :" + JSON.stringify(dataAlamat))
let address = []
for (let i = 0; i < dataAlamat.length; i++) {
const element = dataAlamat[i];
......@@ -74,8 +73,6 @@ class DeliveryAddrees extends React.Component {
data_alamat.push(b)
})
// console.log(this.state.data)
}).catch(error => {
let response = error.response.data;
......@@ -86,6 +83,8 @@ class DeliveryAddrees extends React.Component {
})
}
getRate(address_id) {
// console.log('ADdress id : ' + address_id)
......@@ -136,15 +135,7 @@ class DeliveryAddrees extends React.Component {
}
addAdreess() {
this.props.navigation.navigate('Address Detail', {data_address : "", 'data': 'sample', onChangeAddress: this.onChangeAddress })
}
EditAdreess(data_address) {
this.props.navigation.navigate('Address Detail', { data_address : data_address,'data': 'sample', onChangeAddress: this.onChangeAddress })
let setDataEditAddress = {
edit_address: true
}
this.props.editAddress(setDataEditAddress);
this.props.navigation.navigate('Address Detail', { 'data': 'sample', onChangeAddress: this.onChangeAddress })
}
......@@ -210,7 +201,7 @@ class DeliveryAddrees extends React.Component {
}
if (this.props.value_voucher !== "") {
if(this.props.value_voucher.reward.type == 'percentage' ) {
if (this.props.value_voucher.reward.type == 'percentage') {
this.handleVoucherSelect()
}
}
......@@ -320,6 +311,17 @@ class DeliveryAddrees extends React.Component {
);
}
handleEditAddress(id, name, address, description, lat, long) {
console.log('tes')
console.log(id)
console.log(name)
console.log(address)
console.log(description || 'kosong')
console.log(lat)
console.log(long)
this.props.navigation.navigate('Edit Address', { address_id: id, name: name, address: address, description: description, lat: lat, long: long })
}
renderItem = ({ item }) => {
return (
<View style={styles.list_addrees}>
......@@ -336,8 +338,8 @@ class DeliveryAddrees extends React.Component {
uncheckedColor="#ccb46c"
/>
</View>
<View style={{flex:3}}>
<Text style={{ textAlign: 'center', color: '#ccb46c', fontFamily: 'Gotham-Light', marginRight:5 }}>{i18n.t('selectaddress')}</Text>
<View style={{ bottom: 10 }}>
<Text style={{ textAlign: 'center', color: '#ccb46c', fontFamily: 'Gotham-Light' }}>{i18n.t('selectaddress')}</Text>
</View>
</View>
<View style={{ flex: 3, justifyContent: 'center' }}>
......@@ -348,17 +350,10 @@ class DeliveryAddrees extends React.Component {
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 1}}>
<TouchableOpacity style={{ flexDirection: 'row', justifyContent: "center" }} onPress={() =>this.EditAdreess(item)}>
<View style={{ alignSelf:'flex-end', marginTop: 20 }}>
{/* <EvilIcons name="pencil" size={40} color="#ccb46c" /> */}
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 1 }}>
<TouchableOpacity style={{ flexDirection: 'row', justifyContent: "center" }} onPress={() =>this.EditAdreess(item)}>
<View style={{ alignSelf: "center", marginTop: 20 }}>
<EvilIcons name="pencil" size={40} color="#ccb46c" />
<TouchableOpacity style={{ flex: 1, flexDirection: 'row', justifyContent: "center" }} onPress={() => this.handleEditAddress(item.id, item.name, item.address, item.description, item.lat, item.long)}>
<View style={{ alignSelf: "center", marginTop: 22, marginLeft: 35 }}>
<SimpleLineIcons name="pencil" size={25} color="#ccb46c" />
</View>
</TouchableOpacity>
</View>
......@@ -368,7 +363,6 @@ class DeliveryAddrees extends React.Component {
<EvilIcons name="trash" size={40} color="#ccb46c" />
</View>
</TouchableOpacity>
</View>
</View>
</View>
......@@ -404,7 +398,6 @@ class DeliveryAddrees extends React.Component {
</View>
</TouchableOpacity>
</View>
<View style={styles.listAddress}>
{this.state.indicator == true ? (
<ActivityIndicator size="large" color="#c9af6d" />
......@@ -520,13 +513,6 @@ const mapDispatchToProps = (dispacth) => {
}
}),
editAddress: (setDataEditAddress) => dispacth({
type: ActionType.SET_EDIT_ADDRESS,
data: {
edit_address:setDataEditAddress.edit_address
}
}),
setGrab: (setGrabProps) => dispacth({
type: ActionType.SET_GRAB,
data: {
......
This diff is collapsed.
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