Commit 9c8e9df5 authored by Trisno's avatar Trisno

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

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