Commit 63fc3252 authored by William Goszal's avatar William Goszal 🚴
parents ea01af08 cf38c699
...@@ -143,5 +143,6 @@ ...@@ -143,5 +143,6 @@
"success":"SUCCESS", "success":"SUCCESS",
"alertyes":"Yes", "alertyes":"Yes",
"alertno":"No", "alertno":"No",
"active": "Active" "active": "Active",
"alertreedemexpired":"Sorry, the redemption code has expired, please cancel!"
} }
\ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"detail": "Details", "detail": "Details",
"resendemail": "KIRIM ULANG EMAIL TOKEN", "resendemail": "KIRIM ULANG EMAIL TOKEN",
"enterToken": "Masukan Token", "enterToken": "Masukan Token",
"token": "Token", "token": "TOKEN",
"delivery": "ANTAR", "delivery": "ANTAR",
"rateDelivery": "Ongkos Kirim", "rateDelivery": "Ongkos Kirim",
"price": "Harga", "price": "Harga",
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
"Usebalancepoint": "GUNAKAN SALDO / POINT", "Usebalancepoint": "GUNAKAN SALDO / POINT",
"Acitvatecard": "AKTIVASI KARTU", "Acitvatecard": "AKTIVASI KARTU",
"mobilePhone": "Nomor HP", "mobilePhone": "Nomor HP",
"resend": "Kirim Ulang", "resend": "KIRIM ULANG TOKEN",
"cardNumber": "Nomor Kartu", "cardNumber": "Nomor Kartu",
"activate": "AKTIVASI", "activate": "AKTIVASI",
"alertpoin": "Maaf Point tidak cukup", "alertpoin": "Maaf Point tidak cukup",
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
"success":"SUKSES", "success":"SUKSES",
"alertyes":"Ya", "alertyes":"Ya",
"alertno":"Tidak", "alertno":"Tidak",
"active": "Aktif " "active": "Aktif ",
"alertreedemexpired":"Mohon maaf kode redeem sudah tidak berlaku, Mohon Batalkan !"
} }
\ No newline at end of file
...@@ -45,7 +45,10 @@ const ActionType = { ...@@ -45,7 +45,10 @@ const ActionType = {
SET_CHANGE_RESET_PASSWORD : 'SET_CHANGE_RESET_PASSWORD', SET_CHANGE_RESET_PASSWORD : 'SET_CHANGE_RESET_PASSWORD',
//set url //set url
SET_BASE_URL :'SET_BASE_URL', SET_BASE_URL :'SET_BASE_URL',
SET_PICKIMAGE:'SET_PICKIMAGE' SET_PICKIMAGE:'SET_PICKIMAGE',
//set account number
SET_ACCOUNT_NUMBER:'SET_ACCOUNT_NUMBER'
} }
export default ActionType; export default ActionType;
\ No newline at end of file
...@@ -90,6 +90,8 @@ const globalState = { ...@@ -90,6 +90,8 @@ const globalState = {
isSubmitResetPassword: false, isSubmitResetPassword: false,
setpickimageSelfie: true, setpickimageSelfie: true,
card_number:"",
BASE_URL:'https://excelsocrm.ravintoladev.com/' BASE_URL:'https://excelsocrm.ravintoladev.com/'
...@@ -290,6 +292,13 @@ const rootReducer = (state = globalState, action) => { ...@@ -290,6 +292,13 @@ const rootReducer = (state = globalState, action) => {
} }
} }
case ActionType.SET_ACCOUNT_NUMBER: {
return {
...state,
card_number: action.data.card_number
}
}
case ActionType.SET_CORDINAT: { case ActionType.SET_CORDINAT: {
return { return {
...state, ...state,
......
...@@ -48,7 +48,8 @@ class Account extends React.Component { ...@@ -48,7 +48,8 @@ class Account extends React.Component {
clickSettings: 0, clickSettings: 0,
old_balance_claimed: false, old_balance_claimed: false,
old_balance: 0, old_balance: 0,
is_expired: false is_expired: false,
card_number:"",
} }
} }
...@@ -128,6 +129,7 @@ class Account extends React.Component { ...@@ -128,6 +129,7 @@ class Account extends React.Component {
} }
Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => {
console.log("INI DATANYA : " +JSON.stringify(res))
const dataCard = res.data const dataCard = res.data
console.log(dataCard) console.log(dataCard)
let email = dataCard.email let email = dataCard.email
...@@ -142,6 +144,7 @@ class Account extends React.Component { ...@@ -142,6 +144,7 @@ class Account extends React.Component {
let old_balance_claimed = dataCard.old_balance_claimed let old_balance_claimed = dataCard.old_balance_claimed
let old_balance = dataCard.old_balance let old_balance = dataCard.old_balance
let is_expired = dataCard.is_expired let is_expired = dataCard.is_expired
let card_number = dataCard.card_number
if (kaspro === "") { if (kaspro === "") {
...@@ -160,6 +163,11 @@ class Account extends React.Component { ...@@ -160,6 +163,11 @@ class Account extends React.Component {
let account_number = dataCard.card_number let account_number = dataCard.card_number
let setCardNumberProps = {
card_number : account_number
}
this.props.setCardNumber(setCardNumberProps)
this.setState({ this.setState({
email: email, email: email,
points: point, points: point,
...@@ -174,7 +182,8 @@ class Account extends React.Component { ...@@ -174,7 +182,8 @@ class Account extends React.Component {
indicator: false, indicator: false,
old_balance_claimed: old_balance_claimed, old_balance_claimed: old_balance_claimed,
old_balance: old_balance, old_balance: old_balance,
is_expired: is_expired is_expired: is_expired,
card_number:card_number
}) })
...@@ -253,7 +262,7 @@ class Account extends React.Component { ...@@ -253,7 +262,7 @@ class Account extends React.Component {
<View style={{ marginTop: 65 }}> <View style={{ marginTop: 65 }}>
<View style={{ flex: 1, backgroundColor: 'grey', height: 250, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, backgroundColor: 'grey', height: 250, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation',{ cardNumber: this.state.card_number })}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}> <View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text>
</View> </View>
...@@ -364,7 +373,7 @@ class Account extends React.Component { ...@@ -364,7 +373,7 @@ class Account extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('topup')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('topup')}</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{ padding: 10, height: 200, top: 10, margin: 10 }}> <View style={{ padding: 10, height: 200, top: 10, margin: 10 }}>
<ImageBackground style={{ width: '100%', height: '100%', padding: 0, margin: 0 }} resizeMode='stretch' source={this.state.img_card ? { uri: this.state.img_card } : {uri : "https://bandar-media.s3.amazonaws.com:443/card_series/f85b02c1-ab96-4808-99e3-b6b153be4e7c.PNG"}}> <ImageBackground style={{ width: '100%', height: '100%', padding: 0, margin: 0 }} resizeMode='stretch' source={this.state.img_card ? { uri: this.state.img_card } : null}>
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', margin: 15, fontSize: 14, color: '#c9af6d', top: 120 }}> <Text style={{ fontFamily: 'Gotham-Black', margin: 15, fontSize: 14, color: '#c9af6d', top: 120 }}>
{this.state.account_number} {this.state.account_number}
...@@ -598,6 +607,13 @@ const mapDispatchToProps = (dispacth) => { ...@@ -598,6 +607,13 @@ const mapDispatchToProps = (dispacth) => {
set_card: cardProps.set_card, set_card: cardProps.set_card,
} }
}), }),
setCardNumber: (setCardNumberProps) => dispacth({
type: ActionType.SET_ACCOUNT_NUMBER,
data: {
card_number: setCardNumberProps.card_number,
}
}),
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(Account); export default connect(mapStateToProps, mapDispatchToProps)(Account);
......
...@@ -36,6 +36,7 @@ class AddreesDetail extends React.Component { ...@@ -36,6 +36,7 @@ class AddreesDetail extends React.Component {
address_d: '', address_d: '',
spinner: false, spinner: false,
indicator: true, indicator: true,
caretHidden: true,
} }
} }
...@@ -229,6 +230,8 @@ class AddreesDetail extends React.Component { ...@@ -229,6 +230,8 @@ class AddreesDetail extends React.Component {
</View> </View>
<View style={{ flex: 6 }}> <View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari Alamat" <TextInput style={{ height: 45 }} placeholder="Cari Alamat"
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
onChangeText={(address) => this.setState({ address })}> onChangeText={(address) => this.setState({ address })}>
</TextInput> </TextInput>
</View> </View>
...@@ -292,7 +295,10 @@ class AddreesDetail extends React.Component { ...@@ -292,7 +295,10 @@ class AddreesDetail extends React.Component {
</View> </View>
<View style={styles.field_name_addrees}> <View style={styles.field_name_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('label')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('label')}</Text>
<TextInput style={{ color: 'grey', fontFamily: 'Gotham-Black', height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey', textAlign: 'center' }} onChangeText={(name) => this.setState({ name })} /> <TextInput style={{ color: 'grey', fontFamily: 'Gotham-Black', height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey', textAlign: 'center' }}
onChangeText={(name) => this.setState({ name })}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})} />
</View> </View>
<View style={styles.field_detail_addrees}> <View style={styles.field_detail_addrees}>
...@@ -301,7 +307,9 @@ class AddreesDetail extends React.Component { ...@@ -301,7 +307,9 @@ class AddreesDetail extends React.Component {
style={{ color: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', height: 70, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} style={{ color: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', height: 70, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }}
onChangeText={(description) => this.setState({ description })} onChangeText={(description) => this.setState({ description })}
numberOfLines={10} numberOfLines={10}
multiline={true} /> multiline={true}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})} />
</View> </View>
<View style={{ margin: 50, justifyContent: 'center' }}> <View style={{ margin: 50, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.saveAddress()}> <TouchableOpacity onPress={() => this.saveAddress()}>
......
...@@ -6,6 +6,7 @@ import ActionType from '../redux/globalActionType'; ...@@ -6,6 +6,7 @@ import ActionType from '../redux/globalActionType';
import MenuSelection from './MenuSelection'; import MenuSelection from './MenuSelection';
import { FontAwesome } from '@expo/vector-icons'; import { FontAwesome } from '@expo/vector-icons';
import Home from './Home'; import Home from './Home';
import { SimpleLineIcons } from '@expo/vector-icons';
import Login from './Login'; import Login from './Login';
import Register from './Register'; import Register from './Register';
import ResetPassword from './ResetPassword'; import ResetPassword from './ResetPassword';
...@@ -59,10 +60,11 @@ import UpdateVersion from './UpdateVersion'; ...@@ -59,10 +60,11 @@ import UpdateVersion from './UpdateVersion';
import SettingUrl from './setBaseUrl'; import SettingUrl from './setBaseUrl';
import InboxList from './InboxList'; import InboxList from './InboxList';
import InboxDetail from './InboxDetail'; import InboxDetail from './InboxDetail';
import badgeInbox from './Home';
import { useNavigation } from '@react-navigation/native';
enableScreens(); enableScreens();
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const BottomNavigation = ({ state, descriptors, navigation }) => { const BottomNavigation = ({ state, descriptors, navigation }) => {
...@@ -124,9 +126,7 @@ const BottomNavigation = ({ state, descriptors, navigation }) => { ...@@ -124,9 +126,7 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
onLongPress={onLongPress} onLongPress={onLongPress}
style={{ flex: 1, alignItems: 'center', backgroundColor: 'white', borderTopWidth: 1, borderTopColor: '#f0f0f0' }} style={{ flex: 1, alignItems: 'center', backgroundColor: 'white', borderTopWidth: 1, borderTopColor: '#f0f0f0' }}
> >
<Image source={icon} style={{ height: 50, width: 50, tintColor: isFocused ? '#CFB368' : 'gray' }} /> <Image source={icon} style={{ height: 50, width: 50, tintColor: isFocused ? '#CFB368' : 'gray' }} />
</TouchableOpacity> </TouchableOpacity>
); );
})} })}
...@@ -134,6 +134,16 @@ const BottomNavigation = ({ state, descriptors, navigation }) => { ...@@ -134,6 +134,16 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
) )
} }
function HandleInbox({ navigation }) {
return (
<View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Inbox List')}>
<SimpleLineIcons name="bell" size={24} color="white" />
</TouchableOpacity>
</View>
)
}
function HomePage({ navigation }) { function HomePage({ navigation }) {
return ( return (
<Tab.Navigator tabBar={props => <BottomNavigation {...props} />} <Tab.Navigator tabBar={props => <BottomNavigation {...props} />}
...@@ -319,6 +329,7 @@ class Auth extends React.Component { ...@@ -319,6 +329,7 @@ class Auth extends React.Component {
<Stack.Screen name="Home" component={HomePage} <Stack.Screen name="Home" component={HomePage}
options={{ options={{
headerShown: false, headerShown: false,
headerRight: props => <HandleInbox {...props} />,
title: 'TODAY PROMOTION', title: 'TODAY PROMOTION',
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' }, headerTitleContainerStyle: { alignContent: 'center' },
......
...@@ -14,46 +14,121 @@ class CardActivation extends React.Component { ...@@ -14,46 +14,121 @@ class CardActivation extends React.Component {
session_id: "", session_id: "",
mobile_phone: "", mobile_phone: "",
card_number: "", card_number: "",
card_nums: this.props.route.params.cardNumber,
token: "", token: "",
timer: 80, timer: 80,
onclickToken: false,
onclick: false, onclick: false,
spinner: false, spinner: false,
caretHidden: true,
} }
} }
componentDidMount() {
console.log("INI CARD NUMBER" + this.props.card_number)
console.log("INI BASE_URL " + this.props.BASE_URL)
}
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if (this.state.timer === 0) { if (this.state.timer === 0) {
clearInterval(this.interval); clearInterval(this.interval);
} }
} }
componentWillUnmount() { componentWillUnmount() {
clearInterval(this.interval); clearInterval(this.interval);
} }
handleToken() {
_getProfile() {
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
mobile_phone: this.state.mobile_phone lat: this.state.my_lat,
long: this.state.my_long,
closest_outlet: 1
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/get_token', params).then(res => {
this.setState({ Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => {
onclick: true console.log("INI DATANYA : " + JSON.stringify(res))
}) const dataCard = res.data
Alert.alert('Kami telah mengirimkan sms otp ke nomor anda!'); console.log(dataCard)
this.interval = setInterval( let email = dataCard.email
() => this.setState((prevState) => ({ timer: prevState.timer - 1 })), let point = dataCard.kaspro_point
1000 let balance = dataCard.kaspro_balance
); let img_card = dataCard.card_series_image
let member_since = dataCard.member_since
let expire = dataCard.expire_date
let premium = dataCard.kaspro_is_premium
let kaspro = dataCard.kaspro_account_number
let full_name = dataCard.name
let old_balance_claimed = dataCard.old_balance_claimed
let old_balance = dataCard.old_balance
let is_expired = dataCard.is_expired
let account_number = dataCard.card_number
this.setState({ this.setState({
onclick: true email: email,
points: point,
img_card: img_card,
member_since: member_since,
balance: balance,
account_number: account_number,
img_card: img_card,
expire_date: expire,
premium: premium,
full_name: full_name,
indicator: false,
old_balance_claimed: old_balance_claimed,
old_balance: old_balance,
is_expired: is_expired,
}) })
}).catch(error => { }).catch(error => {
let response = error.response.data;
// const { navigation } = this.props // const { navigation } = this.props
// let response = error.response.data
// session(response, navigation) // session(response, navigation)
Alert.alert('',response.msg); let response = error.response.data
// Alert.alert('',response.msg);
Toast.show(response.msg)
})
}
handleToken() {
this.setState({
spinner: true,
}) })
if (this.state.mobile_phone == '') {
Alert.alert('', 'Masukan No telp ');
} else {
let params = {
session_id: this.props.session_id,
mobile_phone: this.state.mobile_phone
}
Axios.post(this.props.BASE_URL + 'crm/v2/get_token', params).then(res => {
this.setState({
onclick: true
})
Alert.alert('Kami telah mengirimkan sms otp ke nomor anda!');
this.interval = setInterval(
() => this.setState((prevState) => ({ timer: prevState.timer - 1 })),
1000
);
this.setState({
onclick: true,
spinner:false
})
}).catch(error => {
let response = error.response.data;
// const { navigation } = this.props
// session(response, navigation)
Alert.alert('', response.msg);
})
}
} }
ResendToken() { ResendToken() {
...@@ -64,7 +139,7 @@ class CardActivation extends React.Component { ...@@ -64,7 +139,7 @@ class CardActivation extends React.Component {
session_id: this.props.session_id, session_id: this.props.session_id,
mobile_phone: this.state.mobile_phone mobile_phone: this.state.mobile_phone
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/resend_token', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/resend_token', params).then(res => {
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
...@@ -82,28 +157,76 @@ class CardActivation extends React.Component { ...@@ -82,28 +157,76 @@ class CardActivation extends React.Component {
spinner: false, spinner: false,
}) })
let response = error.response.data; let response = error.response.data;
Alert.alert('',response.msg); Alert.alert('', response.msg);
}) })
} }
handleActivate() { handlecardNumberNotnull() {
this.setState({
spinner: true,
})
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
mobile_phone: this.state.mobile_phone, mobile_phone: this.state.mobile_phone,
card_number: this.state.card_number, card_number: this.state.card_number,
token: this.state.token token: this.state.token
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/activate', params).then(res => {
console.log("INI PARAMS " + JSON.stringify(params))
Axios.post(this.props.BASE_URL + 'crm/v2/card/activate', params).then(res => {
let setCardNumberProps = {
card_number: ""
}
this.props.setCardNumber(setCardNumberProps)
Alert.alert(
"",
"Kartu anda berhasil di aktifkan",
[
{
text: "OK", onPress: () => {
this.setState({ spinner: false })
this.props.navigation.reset({
index: 0,
routes: [{ name: 'Home' }],
})
}
}
],
);
}).catch(error => {
let response = error.response.data;
Alert.alert(
'',
response.msg,
[
{ text: "OK", onPress: () => this.setState({ spinner: false }) }
],
);
})
}
handlecardNumbernull() {
let params = {
session_id: this.props.session_id,
mobile_phone: this.state.mobile_phone,
card_number: this.state.card_nums,
token: this.state.token
}
console.log("INI STATENYA " + this.state.card_nums)
console.log("INI PARAMS " + JSON.stringify(params))
Axios.post(this.props.BASE_URL + 'crm/v2/card/activate', params).then(res => {
let setCardNumberProps = {
card_number: ""
}
this.props.setCardNumber(setCardNumberProps)
Alert.alert( Alert.alert(
"", "",
"Kartu anda berhasil di aktifkan", "Kartu anda berhasil di aktifkan",
[ [
{ text: "OK", onPress: () => {
{ text: "OK", onPress: () => {
this.setState({spinner: false}) this.setState({ spinner: false })
this.props.navigation.reset({ this.props.navigation.reset({
index: 0, index: 0,
routes: [{ name: 'Home' }], routes: [{ name: 'Home' }],
...@@ -115,14 +238,27 @@ class CardActivation extends React.Component { ...@@ -115,14 +238,27 @@ class CardActivation extends React.Component {
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
Alert.alert( Alert.alert(
'', '',
response.msg, response.msg,
[ [
{ text: "OK", onPress: () => this.setState({spinner: false}) } { text: "OK", onPress: () => this.setState({ spinner: false }) }
], ],
); );
})
}
handleActivate() {
this.setState({
spinner: true,
}) })
if (this.props.card_number == '') {
this.handlecardNumberNotnull()
} else {
this.handlecardNumbernull()
}
} }
render() { render() {
...@@ -137,62 +273,84 @@ class CardActivation extends React.Component { ...@@ -137,62 +273,84 @@ class CardActivation extends React.Component {
<View style={styles.form}> <View style={styles.form}>
<View style={styles.field_phone}> <View style={styles.field_phone}>
<View style={{ flex: 1, margin: 10 }}> <View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('mobilePhone')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('mobilePhone')}</Text>
<TextInput <TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10,textAlign:'center',fontFamily:'Gotham-Black',color:'grey', fontSize:16}} style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={mobile_phone => this.setState({ mobile_phone })} onChangeText={mobile_phone => this.setState({ mobile_phone })}
keyboardType='numeric' keyboardType='numeric'
value={this.state.mobile_phone} value={this.state.mobile_phone}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
/> />
</View> </View>
<View style={styles.button}> <View style={styles.button}>
<TouchableOpacity style={{top:25}} onPress={() => this.handleToken()}> {this.state.onclick == true ? (null) : (
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}> <TouchableOpacity style={{ top: 25 }} onPress={() => this.handleToken()}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center',margin:10 }}>Token</Text> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
</View> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 10 }}>Token</Text>
</TouchableOpacity> </View>
</TouchableOpacity>
)}
</View> </View>
</View> </View>
{ {
this.state.onclick === true ? (<Text style={{ textAlign: 'center',fontFamily:'Gotham-Black' }}> 0:{this.state.timer} </Text>) : ( this.state.onclick === true ? (<Text style={{ textAlign: 'center', fontFamily: 'Gotham-Black',color:'red' }}> 0:{this.state.timer} </Text>) : (
null null
) )
} }
{ {
this.state.timer === 0 ? ( this.state.timer === 0 ? (
<TouchableOpacity onPress={() => this.ResendToken()}> <TouchableOpacity onPress={() => this.ResendToken()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', margin: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', margin: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>{i18n.t('resend')} Token</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>{i18n.t('resend')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
) : (null)} ) : (null)}
<View style={styles.field_email}> <View style={styles.field_email}>
<View style={{ flex: 1, margin: 10 }}> <View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('cardNumber')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>{i18n.t('cardNumber')}</Text>
<TextInput {this.state.card_nums == "" ? (
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10,textAlign:'center',fontFamily:'Gotham-Black',color:'grey', fontSize:16}} <TextInput
onChangeText={card_number => this.setState({ card_number })} style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
value={this.state.card_number} onChangeText={card_number => this.setState({ card_number })}
keyboardType='numeric' keyboardType='numeric'
/> caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
/>
) : (
<TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={card_nums => this.setState({ card_nums })}
value={this.props.card_number}
editable={false}
caretHidden={this.state.caretHidden}
defaultValue={this.props.card_nums}
onFocus={() => this.setState({ caretHidden: false })}
/>
)}
</View> </View>
</View> </View>
<View style={styles.field_email}> <View style={styles.field_email}>
<View style={{ flex: 1, margin: 10 }}> <View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>Token</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 19, textAlign: 'center', marginBottom: 5 }}>Token</Text>
<TextInput <TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10,textAlign:'center',fontFamily:'Gotham-Black',color:'grey', fontSize:16}} style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, borderRadius: 10, textAlign: 'center', fontFamily: 'Gotham-Black', color: 'grey', fontSize: 16 }}
onChangeText={token => this.setState({ token })} onChangeText={token => this.setState({ token })}
value={this.state.token} value={this.state.token}
keyboardType='numeric' keyboardType='numeric'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
/> />
</View> </View>
</View> </View>
<View style={styles.button}> <View style={styles.button}>
<TouchableOpacity onPress={() => this.handleActivate()}> <TouchableOpacity onPress={() => this.handleActivate()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', margin: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', margin: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>{i18n.t('activate')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>{i18n.t('activate')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -229,7 +387,6 @@ const styles = StyleSheet.create({ ...@@ -229,7 +387,6 @@ const styles = StyleSheet.create({
flexDirection: 'row' flexDirection: 'row'
}, },
button: { button: {
height: 50, height: 50,
margin: 10, margin: 10,
...@@ -240,9 +397,24 @@ const styles = StyleSheet.create({ ...@@ -240,9 +397,24 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
set_card: state.set_card set_card: state.set_card,
card_number: state.card_number,
BASE_URL: state.BASE_URL,
}
}
const mapDispatchToProps = (dispacth) => {
return {
setCardNumber: (setCardNumberProps) => dispacth({
type: ActionType.SET_ACCOUNT_NUMBER,
data: {
card_number: setCardNumberProps.card_number,
}
}),
} }
} }
export default connect(mapStateToProps)(CardActivation); export default connect(mapStateToProps, mapDispatchToProps)(CardActivation);
\ No newline at end of file \ No newline at end of file
...@@ -11,7 +11,8 @@ class ChangeEmail extends React.Component { ...@@ -11,7 +11,8 @@ class ChangeEmail extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
email: "" email: "",
caretHidden:true
} }
} }
...@@ -63,7 +64,9 @@ class ChangeEmail extends React.Component { ...@@ -63,7 +64,9 @@ class ChangeEmail extends React.Component {
value={this.state.email} value={this.state.email}
autoCapitalize="none" autoCapitalize="none"
value={this.state.email} value={this.state.email}
keyboardType='email-address' /> keyboardType='email-address'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}/>
<TouchableOpacity style={{ height: 100 }} onPress={() => this.changeEmail()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.changeEmail()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>SUBMIT</Text> <Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>SUBMIT</Text>
......
...@@ -15,6 +15,7 @@ class ChangePassword extends React.Component { ...@@ -15,6 +15,7 @@ class ChangePassword extends React.Component {
old_password: '', old_password: '',
Password: '', Password: '',
Password_confirmation: '', Password_confirmation: '',
caretHidden:true
} }
} }
...@@ -57,6 +58,8 @@ class ChangePassword extends React.Component { ...@@ -57,6 +58,8 @@ class ChangePassword extends React.Component {
onChangeText={(old_password) => this.setState({ old_password })} onChangeText={(old_password) => this.setState({ old_password })}
value={this.state.old_password} value={this.state.old_password}
secureTextEntry={true} secureTextEntry={true}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
textAlign='center' /> textAlign='center' />
</View> </View>
</View> </View>
...@@ -69,6 +72,8 @@ class ChangePassword extends React.Component { ...@@ -69,6 +72,8 @@ class ChangePassword extends React.Component {
onChangeText={(Password) => this.setState({ Password })} onChangeText={(Password) => this.setState({ Password })}
value={this.state.Password} value={this.state.Password}
secureTextEntry={true} secureTextEntry={true}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
textAlign='center' /> textAlign='center' />
</View> </View>
</View> </View>
...@@ -81,6 +86,8 @@ class ChangePassword extends React.Component { ...@@ -81,6 +86,8 @@ class ChangePassword extends React.Component {
onChangeText={(Password_confirmation) => this.setState({ Password_confirmation })} onChangeText={(Password_confirmation) => this.setState({ Password_confirmation })}
value={this.state.Password_confirmation} value={this.state.Password_confirmation}
secureTextEntry={true} secureTextEntry={true}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
textAlign='center' /> textAlign='center' />
</View> </View>
</View> </View>
......
...@@ -18,6 +18,7 @@ class ChangeProfil extends React.Component { ...@@ -18,6 +18,7 @@ class ChangeProfil extends React.Component {
gender_selected: '', gender_selected: '',
email: '', email: '',
no_tlp: '', no_tlp: '',
caretHidden:true
} }
// console.log('PROPS : ' + JSON.stringify(props.navigation)) // console.log('PROPS : ' + JSON.stringify(props.navigation))
} }
...@@ -100,12 +101,14 @@ class ChangeProfil extends React.Component { ...@@ -100,12 +101,14 @@ class ChangeProfil extends React.Component {
<View style={{ flex: 1, margin: 20,top:20 }}> <View style={{ flex: 1, margin: 20,top:20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Name</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Name</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(full_name) => this.setState({ full_name })} value={this.state.full_name}> onChangeText={(full_name) => this.setState({ full_name })} value={this.state.full_name}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}>
</TextInput> </TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Date of Birth</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Date of Birth</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
editable={false}> editable={false}>
{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year} {this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}
</TextInput> </TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin:3 }}>Gender</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin:3 }}>Gender</Text>
<View style={{justifyContent:'center',borderRadius:10,borderWidth:1,borderColor:'grey',height:40,marginRight:10,marginLeft:10}}> <View style={{justifyContent:'center',borderRadius:10,borderWidth:1,borderColor:'grey',height:40,marginRight:10,marginLeft:10}}>
...@@ -120,7 +123,9 @@ class ChangeProfil extends React.Component { ...@@ -120,7 +123,9 @@ class ChangeProfil extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Mobile</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Mobile</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(no_tlp) => this.setState({ no_tlp })} onChangeText={(no_tlp) => this.setState({ no_tlp })}
editable={true}> editable={true}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}>
</TextInput> </TextInput>
</View> </View>
</View> </View>
......
...@@ -20,6 +20,7 @@ class DeliveryAddrees extends React.Component { ...@@ -20,6 +20,7 @@ class DeliveryAddrees extends React.Component {
data_before_search: [], data_before_search: [],
search: '', search: '',
indicator: true, indicator: true,
caretHidden: true
// outlet_id: '', // outlet_id: '',
// grabamount: '' // grabamount: ''
} }
...@@ -311,6 +312,8 @@ class DeliveryAddrees extends React.Component { ...@@ -311,6 +312,8 @@ class DeliveryAddrees extends React.Component {
<TextInput style={{ height: 45 }} placeholder={i18n.t('searchaddress')} <TextInput style={{ height: 45 }} placeholder={i18n.t('searchaddress')}
onChangeText={text => this.filterData(text)} onChangeText={text => this.filterData(text)}
onClear={text => this.filterData('')} onClear={text => this.filterData('')}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
value={this.state.search}></TextInput> value={this.state.search}></TextInput>
</View> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
......
...@@ -15,7 +15,8 @@ class EmailConfirmation extends React.Component { ...@@ -15,7 +15,8 @@ class EmailConfirmation extends React.Component {
super(props); super(props);
this.state = { this.state = {
confirmation_number: "", confirmation_number: "",
spinner: false spinner: false,
caretHidden:true,
} }
} }
...@@ -213,7 +214,9 @@ class EmailConfirmation extends React.Component { ...@@ -213,7 +214,9 @@ class EmailConfirmation extends React.Component {
value={this.state.confirmation_number} value={this.state.confirmation_number}
autoCapitalize="none" autoCapitalize="none"
value={this.state.email} value={this.state.email}
keyboardType='numeric' /> keyboardType='numeric'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})} />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleSubmit()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.handleSubmit()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 10, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <View style={{ backgroundColor: '#CFB368', height: 45, top: 10, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text> <Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text>
......
...@@ -14,7 +14,8 @@ import CheckVersion from '../function/CheckVersion'; ...@@ -14,7 +14,8 @@ import CheckVersion from '../function/CheckVersion';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import Toast from 'react-native-tiny-toast'; import Toast from 'react-native-tiny-toast';
import i18n from 'i18n-js'; import i18n from 'i18n-js';
import { Badge } from 'react-native-elements' import { Badge } from 'react-native-elements';
import NumberFormat from 'react-number-format';
let version = info.expo.version let version = info.expo.version
let buildNumber = info.expo.android.versionCode let buildNumber = info.expo.android.versionCode
...@@ -39,12 +40,14 @@ class Home extends React.Component { ...@@ -39,12 +40,14 @@ class Home extends React.Component {
inbox: "0", inbox: "0",
is_expired_date: true, is_expired_date: true,
old_balance_claimed: true, old_balance_claimed: true,
member_since: "" member_since: "",
old_balance: 0,
card_number: ''
} }
} }
componentDidMount() { componentDidMount() {
this.CheckInbox() this.CheckInbox()
const screenWidth = Math.round(Dimensions.get('window').width); const screenWidth = Math.round(Dimensions.get('window').width);
this.setState({ this.setState({
...@@ -170,7 +173,7 @@ class Home extends React.Component { ...@@ -170,7 +173,7 @@ class Home extends React.Component {
} }
// console.log(params); // console.log(params);
Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => {
console.log("data" + JSON.stringify(res) )
const dataCard = res.data const dataCard = res.data
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
let balance = dataCard.kaspro_balance let balance = dataCard.kaspro_balance
...@@ -179,6 +182,8 @@ class Home extends React.Component { ...@@ -179,6 +182,8 @@ class Home extends React.Component {
let is_expired = dataCard.is_expired let is_expired = dataCard.is_expired
let old_balance_claimed = dataCard.old_balance_claimed let old_balance_claimed = dataCard.old_balance_claimed
let member_since = dataCard.member_since let member_since = dataCard.member_since
let old_balance = dataCard.old_balance
let card_number = dataCard.card_number
this.setState({ this.setState({
point: point, point: point,
...@@ -188,7 +193,9 @@ class Home extends React.Component { ...@@ -188,7 +193,9 @@ class Home extends React.Component {
indicatorProfileCard: false, indicatorProfileCard: false,
is_expired: is_expired, is_expired: is_expired,
old_balance_claimed: old_balance_claimed, old_balance_claimed: old_balance_claimed,
member_since: member_since member_since: member_since,
old_balance: old_balance,
card_number: card_number
}) })
}).catch(error => { }).catch(error => {
let response = error.response.data let response = error.response.data
...@@ -437,7 +444,7 @@ class Home extends React.Component { ...@@ -437,7 +444,7 @@ class Home extends React.Component {
<Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}>
<View style={{ flex: 1, backgroundColor: 'grey', height: 150, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, backgroundColor: 'grey', height: 150, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation', { cardNumber: this.state.card_number })}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}> <View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text>
</View> </View>
...@@ -446,7 +453,6 @@ class Home extends React.Component { ...@@ -446,7 +453,6 @@ class Home extends React.Component {
</View> </View>
</Card> </Card>
</View> </View>
) : ) :
this.state.account_number !== "" && this.state.is_expired == false ? ( this.state.account_number !== "" && this.state.is_expired == false ? (
<View style={styles.card}> <View style={styles.card}>
...@@ -456,12 +462,12 @@ class Home extends React.Component { ...@@ -456,12 +462,12 @@ class Home extends React.Component {
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}> {i18n.t('active')} {this.state.member_since}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}> {i18n.t('expired')} {this.state.member_since}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}> <Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number} {this.state.card_number}
</Text> </Text>
</View> </View>
<View style={styles.line}></View> <View style={styles.line}></View>
...@@ -488,7 +494,8 @@ class Home extends React.Component { ...@@ -488,7 +494,8 @@ class Home extends React.Component {
{this.state.old_balance_claimed == false ? ( {this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : 200.000 </Text> <NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center', color:'#838383' }}> CREDIT : {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
{/* <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> */}
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}> <TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -508,12 +515,12 @@ class Home extends React.Component { ...@@ -508,12 +515,12 @@ class Home extends React.Component {
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light', color: 'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}> <Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number} {this.state.card_number}
</Text> </Text>
</View> </View>
<View style={styles.line}></View> <View style={styles.line}></View>
...@@ -548,7 +555,8 @@ class Home extends React.Component { ...@@ -548,7 +555,8 @@ class Home extends React.Component {
{this.state.old_balance_claimed == false ? ( {this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : 200.000 </Text> {/* <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> */}
<NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center', color:'#838383' }}> CREDIT : {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}> <TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -566,13 +574,20 @@ class Home extends React.Component { ...@@ -566,13 +574,20 @@ class Home extends React.Component {
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> {
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text> this.state.is_expired_date == true ? (
</View> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light',color:'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View>
):(<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View>)
}
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}> <Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number} {this.state.card_number}
</Text> </Text>
</View> </View>
<View style={styles.line}></View> <View style={styles.line}></View>
...@@ -594,26 +609,28 @@ class Home extends React.Component { ...@@ -594,26 +609,28 @@ class Home extends React.Component {
</View> </View>
</View> </View>
<View style={styles.line2}></View> <View style={styles.line2}></View>
<View style={{ justifyContent: 'center', marginTop: 20 }}> {this.state.is_expired_date == true ? (
<View style={{ justifyContent: 'center', marginTop: 20 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Renewal')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Renewal')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', margin: 15 }}>RENEWAL</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', margin: 15 }}>RENEWAL</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
):(null)}
</Card> </Card>
</View> </View>
) )
} }
<View style={{ flexDirection: 'row', flex: 1,height:40,marginTop:40}}> <View style={{ flexDirection: 'row', flex: 1, height: 40, marginTop: 40 }}>
<View style={{justifyContent:'center',flex:1}}> <View style={{ justifyContent: 'center', flex: 1 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('TopUpInfo')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('TopUpInfo')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>{i18n.t('topup')}</Text> <Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>{i18n.t('topup')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{justifyContent:'center',flex:1}}> <View style={{ justifyContent: 'center', flex: 1 }}>
<TouchableOpacity onPress={() => this.handleuseBalance()}> <TouchableOpacity onPress={() => this.handleuseBalance()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>{i18n.t('usebalance')}</Text> <Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>{i18n.t('usebalance')}</Text>
......
...@@ -183,6 +183,12 @@ class Login extends React.Component { ...@@ -183,6 +183,12 @@ class Login extends React.Component {
proses: '' proses: ''
} }
let pageProps = {
pageEmailConfirmation: true
}
this.props.setPage(pageProps)
this.props.setProses(prosesProps); this.props.setProses(prosesProps);
this.props.setLoginInfo(loginProps); this.props.setLoginInfo(loginProps);
this.setState({ this.setState({
......
...@@ -12,6 +12,7 @@ class NewPassword extends React.Component { ...@@ -12,6 +12,7 @@ class NewPassword extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
caretHidden:true,
confirmation_number: '', confirmation_number: '',
email: this.props.email, email: this.props.email,
password: this.props.password, password: this.props.password,
...@@ -86,22 +87,25 @@ class NewPassword extends React.Component { ...@@ -86,22 +87,25 @@ class NewPassword extends React.Component {
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20 }}> <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('token')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('token')}</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(confirmation_number) => this.setState({ confirmation_number })} onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
value={this.state.confirmation_number} /> value={this.state.confirmation_number} />
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('newpassword')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('newpassword')}</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(password) => this.setState({ password })} onChangeText={(password) => this.setState({ password })}
value={this.state.password} value={this.state.password}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
secureTextEntry={true} /> secureTextEntry={true} />
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('repeatpassword')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('repeatpassword')}</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(password_confirmation) => this.setState({ password_confirmation })} onChangeText={(password_confirmation) => this.setState({ password_confirmation })}
value={this.state.password_confirmation} value={this.state.password_confirmation}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
secureTextEntry={true} /> secureTextEntry={true} />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
......
...@@ -32,6 +32,7 @@ class NewRegister extends React.Component { ...@@ -32,6 +32,7 @@ class NewRegister extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = ({ this.state = ({
caretHidden:true,
email: "", email: "",
password: "", password: "",
full_name: "", full_name: "",
...@@ -281,6 +282,8 @@ class NewRegister extends React.Component { ...@@ -281,6 +282,8 @@ class NewRegister extends React.Component {
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
style={styles.textInput} style={styles.textInput}
onChangeText={(email) => this.setState({ email })} onChangeText={(email) => this.setState({ email })}
value={this.state.email} value={this.state.email}
...@@ -300,6 +303,8 @@ class NewRegister extends React.Component { ...@@ -300,6 +303,8 @@ class NewRegister extends React.Component {
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
style={styles.textInput} style={styles.textInput}
onChangeText={(password) => this.setState({ password })} onChangeText={(password) => this.setState({ password })}
value={this.state.password} value={this.state.password}
...@@ -318,6 +323,8 @@ class NewRegister extends React.Component { ...@@ -318,6 +323,8 @@ class NewRegister extends React.Component {
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
onChangeText={(confirm_pass) => this.setState({ confirm_pass })} onChangeText={(confirm_pass) => this.setState({ confirm_pass })}
value={this.state.confirm_pass} value={this.state.confirm_pass}
secureTextEntry={true} secureTextEntry={true}
...@@ -335,6 +342,8 @@ class NewRegister extends React.Component { ...@@ -335,6 +342,8 @@ class NewRegister extends React.Component {
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
onChangeText={(full_name) => this.setState({ full_name })} onChangeText={(full_name) => this.setState({ full_name })}
value={this.state.full_name} value={this.state.full_name}
placeholder='Example' placeholder='Example'
......
...@@ -31,7 +31,8 @@ class OrderDetail extends React.Component { ...@@ -31,7 +31,8 @@ class OrderDetail extends React.Component {
is_reviewed: '', is_reviewed: '',
review_rating: 0, review_rating: 0,
cancelled_by_display: '', cancelled_by_display: '',
cancelled_reason: '' cancelled_reason: '',
caretHidden: true
} }
...@@ -40,7 +41,7 @@ class OrderDetail extends React.Component { ...@@ -40,7 +41,7 @@ class OrderDetail extends React.Component {
componentDidMount() { componentDidMount() {
// console.log("INI URL NYA : " + this.props.BASE_URL ) // console.log("INI URL NYA : " + this.props.BASE_URL )
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick); BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
this.getDetailTrans() this.getDetailTrans()
...@@ -92,7 +93,7 @@ class OrderDetail extends React.Component { ...@@ -92,7 +93,7 @@ class OrderDetail extends React.Component {
reason: "Cancelled By User" reason: "Cancelled By User"
} }
// console.log(params) // console.log(params)
Axios.post(this.props.BASE_URL+'crm/v2/transaction/cancel', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/transaction/cancel', params).then(res => {
let respon = res.data.status let respon = res.data.status
Alert.alert(respon, 'Order was canceled') Alert.alert(respon, 'Order was canceled')
this.props.navigation.navigate('Home', { screen: 'ORDER' }); this.props.navigation.navigate('Home', { screen: 'ORDER' });
...@@ -112,7 +113,7 @@ class OrderDetail extends React.Component { ...@@ -112,7 +113,7 @@ class OrderDetail extends React.Component {
transaction_id: this.props.route.params.idTrans transaction_id: this.props.route.params.idTrans
} }
// console.log("PARAMETER : " + JSON.stringify(params)) // console.log("PARAMETER : " + JSON.stringify(params))
Axios.post(this.props.BASE_URL+'crm/v2/transaction/detail', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/transaction/detail', params).then(res => {
let data = res.data let data = res.data
// console.log(data) // console.log(data)
if (data.trans_status_display == 'On Queue') { if (data.trans_status_display == 'On Queue') {
...@@ -153,6 +154,7 @@ class OrderDetail extends React.Component { ...@@ -153,6 +154,7 @@ class OrderDetail extends React.Component {
cancelled_reason: data.cancelled_reason cancelled_reason: data.cancelled_reason
}) })
console.log(this.state.detail_trans)
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
Alert.alert(error, response.msg); Alert.alert(error, response.msg);
...@@ -188,6 +190,8 @@ class OrderDetail extends React.Component { ...@@ -188,6 +190,8 @@ class OrderDetail extends React.Component {
onChangeText={(reason) => this.setState({ reason })} onChangeText={(reason) => this.setState({ reason })}
value={this.state.reason} value={this.state.reason}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })}
/> />
</View> </View>
<View> <View>
...@@ -243,125 +247,178 @@ class OrderDetail extends React.Component { ...@@ -243,125 +247,178 @@ class OrderDetail extends React.Component {
{ {
this.state.detail_trans.trans_type_display == 'Pick Up' ? ( this.state.detail_trans.trans_type == 1 ? (
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: 'grey', marginHorizontal: 10, padding: 10 }}> <View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}> <View style={{ flex: 0.1, justifyContent: 'center' }}>
<FontAwesome name="map-marker" size={24} color="#d34343" /> <FontAwesome name="map-marker" size={24} color="#d34343" />
</View> </View>
{ {
this.state.detail_trans.trans_type_display == 'Pick Up' ? ( this.state.detail_trans.trans_type == 1 ? (
<View style={{ flex: 0.6, justifyContent: 'center' }}> <View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text>
</View> </View>
) : this.state.detail_trans.trans_type == 2 ? (
<View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.recipient_address_name}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.recipient_address}</Text>
</View>
) : ( ) : (
<View style={{ flex: 0.6, justifyContent: 'center' }}> <View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.recipient_address_name}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.recipient_address}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text>
</View> </View>
)
)
} }
{ {
this.state.detail_trans.trans_type_display == 'Pick Up' ? ( this.state.detail_trans.trans_type == 1 ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text>
</View> </View>
) : this.state.detail_trans.trans_type == 2 ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text>
</View>
) : ( ) : (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>DINE IN</Text>
</View>
)
}
</View>
) : this.state.detail_trans.trans_type == 2 ? (
<View style={{ flex: 2 }}>
<View style={{ flex: 1, flexDirection: 'row', borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center', alignItems: 'center' }}>
<FontAwesome name="map-marker" size={24} color="#d34343" />
</View>
{
this.state.detail_trans.trans_type_display == 'Pick Up' ? (
<View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text>
</View>
) : (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.recipient_address_name}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.recipient_address}</Text>
</View>
)
}
{
this.state.detail_trans.trans_type_display == 'Pick Up' ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text>
</View> </View>
) : (
<View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text>
</View>
) )
} }
</View>
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}>
<Image source={require('../assets/grab-logo.png')} style={{ height: 32, width: 32, borderRadius: 5, }} />
</View>
{
this.state.detail_trans.grab_driver_name == '' ? (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-SemiBoldItalic', color: 'grey' }}>{i18n.t('lookingForDriver')}</Text>
</View>
) : (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.grab_driver_name}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.grab_driver_phone}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.grab_driver_license_plate}</Text>
</View>
)
}
{
this.state.detail_trans.grab_driver_name == '' ? (
null
) : (
this.state.trans_status == 4 || this.state.trans_status == -1 ? (
null
) : (
<View style={{ flex: 0.3, justifyContent: 'space-between', alignItems: 'center', flexDirection: 'row' }}>
<View style={{ paddingLeft: 30 }}>
<TouchableOpacity onPress={() => { Linking.openURL('tel:' + this.state.detail_trans.grab_driver_phone) }}>
<Icon
name='ios-call'
type='ionicon'
color='#838383'
size={30}
/>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity onPress={() => { Linking.openURL('whatsapp://send?text=say something&phone=' + this.state.detail_trans.grab_driver_phone) }}>
<Icon
name='whatsapp'
type='font-awesome'
color='green'
size={30}
/>
</TouchableOpacity>
</View>
</View>
)
)
}
</View>
</View> </View>
) : ( ) : (
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 2 }}> <View style={{ flex: 0.1, justifyContent: 'center' }}>
<View style={{ flex: 1, flexDirection: 'row', borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center', alignItems: 'center' }}>
<FontAwesome name="map-marker" size={24} color="#d34343" /> <FontAwesome name="map-marker" size={24} color="#d34343" />
</View> </View>
{ {
this.state.detail_trans.trans_type_display == 'Pick Up' ? ( this.state.detail_trans.trans_type == 1 ? (
<View style={{ flex: 0.6, justifyContent: 'center' }}> <View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text>
</View> </View>
) : this.state.detail_trans.trans_type == 2 ? (
<View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.recipient_address_name}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.recipient_address}</Text>
</View>
) : ( ) : (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}> <View style={{ flex: 0.6, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.recipient_address_name}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.outlet}</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.recipient_address}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.outlet_address}</Text>
</View> </View>
)
)
} }
{ {
this.state.detail_trans.trans_type_display == 'Pick Up' ? ( this.state.detail_trans.trans_type == 1 ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('pickup')}</Text>
</View> </View>
) : ( ) : this.state.detail_trans.trans_type == 2 ? (
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('delivery')}</Text>
</View>
)
}
</View>
<View style={{ flex: 1, flexDirection: 'row', borderBottomWidth: 1, borderColor: 'grey', marginHorizontal: 10, padding: 10 }}>
<View style={{ flex: 0.1, justifyContent: 'center' }}>
<Image source={require('../assets/grab-logo.png')} style={{ height: 32, width: 32, borderRadius: 5, }} />
</View>
{
this.state.detail_trans.grab_driver_name == '' ? (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-SemiBoldItalic', color: 'grey' }}>{i18n.t('lookingForDriver')}</Text>
</View> </View>
) : ( ) : (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>{this.state.detail_trans.grab_driver_name}</Text> <Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>DINE IN</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.grab_driver_phone}</Text> </View>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{this.state.detail_trans.grab_driver_license_plate}</Text> )
</View>
)
}
{
this.state.detail_trans.grab_driver_name == '' ? (
null
) : (
this.state.trans_status == 4 || this.state.trans_status == -1 ? (
null
) : (
<View style={{ flex: 0.3, justifyContent: 'space-between', alignItems: 'center', flexDirection: 'row' }}>
<View style={{ paddingLeft: 30 }}>
<TouchableOpacity onPress={() => { Linking.openURL('tel:' + this.state.detail_trans.grab_driver_phone) }}>
<Icon
name='ios-call'
type='ionicon'
color='#838383'
size={30}
/>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity onPress={() => { Linking.openURL('whatsapp://send?text=say something&phone=' + this.state.detail_trans.grab_driver_phone) }}>
<Icon
name='whatsapp'
type='font-awesome'
color='green'
size={30}
/>
</TouchableOpacity>
</View>
</View>
)
)
} }
</View> </View>
</View> )
)
} }
...@@ -402,7 +459,7 @@ class OrderDetail extends React.Component { ...@@ -402,7 +459,7 @@ class OrderDetail extends React.Component {
</View> </View>
<View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 10 }}> <View style={{ flex: 0.3, alignItems: 'flex-end', justifyContent: 'center', paddingRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.item_quantity * item.item_price} </Text> */} {/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.item_quantity * item.item_price} </Text> */}
<NumberFormat decimalScale={0} value={item.item_quantity * item.item_price} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={item.item_subtotal} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
</View> </View>
) )
...@@ -455,9 +512,27 @@ class OrderDetail extends React.Component { ...@@ -455,9 +512,27 @@ class OrderDetail extends React.Component {
</View> </View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}> <View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.point_booked}</Text> */} {/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.point_booked}</Text> */}
<NumberFormat decimalScale={0} value={this.state.detail_trans.point_booked} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={this.state.detail_trans.kaspro_point_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
</View> </View>
{/* Non Balance untuk Dine In */}
{
this.state.detail_trans.trans_type == 3 ? (
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', marginHorizontal: 10 }}>
<View style={{ flex: 0.5, marginLeft: 20, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Non Balance</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light' }}>{this.state.detail_trans.point_booked}</Text> */}
<NumberFormat decimalScale={0} value={parseInt(this.state.detail_trans.trans_total) - (parseInt(this.state.detail_trans.point_reduce) + parseInt(this.state.detail_trans.kaspro_point_reduce))} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
) : null
}
<View style={{ marginTop: 5, borderTopWidth: 1, borderColor: 'grey', marginHorizontal: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}> <View style={{ marginTop: 5, borderTopWidth: 1, borderColor: 'grey', marginHorizontal: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}> <View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('price')}</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('price')}</Text>
...@@ -506,15 +581,30 @@ class OrderDetail extends React.Component { ...@@ -506,15 +581,30 @@ class OrderDetail extends React.Component {
) : (null) ) : (null)
) : (null) ) : (null)
} }
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10, marginTop: 5 }}> {this.state.detail_trans != "" ? (
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}> this.state.detail_trans.used_reward.length ? (
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('total')}</Text> <View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10, marginTop: 5 }}>
</View> <View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}> <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('total')}</Text>
{/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */} </View>
<NumberFormat decimalScale={0} value={this.state.detail_trans.point_reduce} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
</View> {/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */}
</View> <NumberFormat decimalScale={0} value={parseInt(this.state.detail_trans.trans_total) - parseInt(this.state.detail_trans.used_reward[0].reward.value)} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
) : (
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1, marginHorizontal: 10, marginTop: 5 }}>
<View style={{ flex: 0.5, marginLeft: 10, marginVertical: 5 }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('total')}</Text>
</View>
<View style={{ flex: 0.5, marginVertical: 5, alignItems: 'flex-end', marginRight: 10 }}>
{/* <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>{this.state.detail_trans.trans_total}</Text> */}
<NumberFormat decimalScale={0} value={this.state.detail_trans.trans_total} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', textAlign: 'right', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
)) : null
}
{ {
this.state.trans_status < 4 && this.state.trans_status !== -1 ? (<TouchableOpacity onPress={() => { Linking.openURL('whatsapp://send?text=say something&phone=' + this.state.detail_trans.call_center_phone) }}> this.state.trans_status < 4 && this.state.trans_status !== -1 ? (<TouchableOpacity onPress={() => { Linking.openURL('whatsapp://send?text=say something&phone=' + this.state.detail_trans.call_center_phone) }}>
...@@ -656,7 +746,7 @@ const mapStateToProps = (state) => { ...@@ -656,7 +746,7 @@ const mapStateToProps = (state) => {
trans_id: state.trans_id, trans_id: state.trans_id,
lat: state.lat, lat: state.lat,
long: state.long, long: state.long,
BASE_URL : state.BASE_URL BASE_URL: state.BASE_URL
} }
} }
......
...@@ -14,6 +14,7 @@ class PaymentCode extends React.Component { ...@@ -14,6 +14,7 @@ class PaymentCode extends React.Component {
kaspro_point: '', kaspro_point: '',
redeem_balance: '', redeem_balance: '',
redeem_point: '', redeem_point: '',
caretHidden:true,
} }
} }
...@@ -85,6 +86,8 @@ class PaymentCode extends React.Component { ...@@ -85,6 +86,8 @@ class PaymentCode extends React.Component {
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(redeem_point) => this.setState({ redeem_point })} onChangeText={(redeem_point) => this.setState({ redeem_point })}
autoCapitalize="none" autoCapitalize="none"
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
keyboardType='numeric'>IDR.{this.state.kaspro_point}</TextInput> keyboardType='numeric'>IDR.{this.state.kaspro_point}</TextInput>
<TouchableOpacity style={{ height: 100 }} onPress={() => this.redeem()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.redeem()}>
<View style={{ backgroundColor: '#CFB368', height: 40, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <View style={{ backgroundColor: '#CFB368', height: 40, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
......
...@@ -29,6 +29,7 @@ class PickupName extends React.Component { ...@@ -29,6 +29,7 @@ class PickupName extends React.Component {
data_before_search: [], data_before_search: [],
spinner: false, spinner: false,
indicator: true, indicator: true,
caretHidden:true
} }
} }
...@@ -304,7 +305,9 @@ class PickupName extends React.Component { ...@@ -304,7 +305,9 @@ class PickupName extends React.Component {
<TextInput style={{ height: 45 }} placeholder={i18n.t('searchpickups')} <TextInput style={{ height: 45 }} placeholder={i18n.t('searchpickups')}
onChangeText={text => this.filterData(text)} onChangeText={text => this.filterData(text)}
onClear={text => this.filterData('')} onClear={text => this.filterData('')}
value={this.state.search}></TextInput> value={this.state.search}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}></TextInput>
</View> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
<Ionicons name="ios-search" size={32} color="#ccb46c" /> <Ionicons name="ios-search" size={32} color="#ccb46c" />
......
...@@ -23,6 +23,7 @@ class RatingOrder extends React.Component { ...@@ -23,6 +23,7 @@ class RatingOrder extends React.Component {
detail_trans: '', detail_trans: '',
trans_status: '', trans_status: '',
modalVisible: false, modalVisible: false,
caretHidden:true,
} }
} }
...@@ -126,6 +127,8 @@ class RatingOrder extends React.Component { ...@@ -126,6 +127,8 @@ class RatingOrder extends React.Component {
multiline={true} multiline={true}
numberOfLines={4} numberOfLines={4}
blurOnSubmit={false} blurOnSubmit={false}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.review()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.review()}>
......
...@@ -13,11 +13,12 @@ class RedeemCode extends React.Component { ...@@ -13,11 +13,12 @@ class RedeemCode extends React.Component {
super(props); super(props);
this.handleBackButtonClick = this.handleBackButtonClick.bind(this) this.handleBackButtonClick = this.handleBackButtonClick.bind(this)
this.state = { this.state = {
in_process_redeem: false,
} }
} }
componentDidMount() { componentDidMount() {
this.CheckReddemProses()
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick); BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
} }
...@@ -32,6 +33,24 @@ class RedeemCode extends React.Component { ...@@ -32,6 +33,24 @@ class RedeemCode extends React.Component {
return true; return true;
} }
CheckReddemProses() {
let params = {
session_id: this.props.session_id
}
Axios.post(this.props.BASE_URL + 'crm/v2/point/check', params).then(res => {
let in_process_redeem = res.data.in_process_redeem
this.setState({
in_process_redeem: in_process_redeem
})
console.log("DATA NYA : " + JSON.stringify(res))
}).catch(error => {
let response = error.response.data
Alert.alert(error, response.msg)
})
}
cancel() { cancel() {
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
...@@ -59,14 +78,14 @@ class RedeemCode extends React.Component { ...@@ -59,14 +78,14 @@ class RedeemCode extends React.Component {
} else { } else {
let response = error.response.data; let response = error.response.data;
Alert.alert('', response.msg); Alert.alert('', response.msg);
let redeemProps = { let redeemProps = {
in_payment: false, in_payment: false,
redeem_code: '', redeem_code: '',
balance_redeem: '', balance_redeem: '',
point_redeem: '' point_redeem: ''
} }
this.props.setRedeem(redeemProps) this.props.setRedeem(redeemProps)
this.props.navigation.navigate('Home', { screen: 'HOME' }); this.props.navigation.navigate('Home', { screen: 'HOME' });
} }
...@@ -118,6 +137,14 @@ class RedeemCode extends React.Component { ...@@ -118,6 +137,14 @@ class RedeemCode extends React.Component {
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('cancel')} {i18n.t('payment')}</Text> <Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('cancel')} {i18n.t('payment')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<View style={{ justifyContent: 'center', top: 20 }}>
{this.state.in_process_redeem == false ? (
<Text style={{ textAlign: 'center', fontSize: 14, fontFamily: 'Gotham-Light', color: 'red' }}>{i18n.t('alertreedemexpired')}</Text>
) : (null)}
</View>
</View> </View>
</View> </View>
) )
...@@ -172,6 +199,7 @@ const mapStateToProps = (state) => { ...@@ -172,6 +199,7 @@ const mapStateToProps = (state) => {
session_id: state.session_id, session_id: state.session_id,
redeem_code: state.redeem_code, redeem_code: state.redeem_code,
balance_redeem: state.balance_redeem, balance_redeem: state.balance_redeem,
BASE_URL: state.BASE_URL,
point_redeem: state.point_redeem point_redeem: state.point_redeem
} }
} }
......
...@@ -14,7 +14,8 @@ class ResetPassword extends React.Component { ...@@ -14,7 +14,8 @@ class ResetPassword extends React.Component {
this.state = { this.state = {
email: '', email: '',
language: 'id', language: 'id',
spinner: false spinner: false,
caretHidden:true
} }
} }
...@@ -87,7 +88,9 @@ class ResetPassword extends React.Component { ...@@ -87,7 +88,9 @@ class ResetPassword extends React.Component {
onChangeText={(email) => this.setState({ email })} onChangeText={(email) => this.setState({ email })}
autoCapitalize="none" autoCapitalize="none"
value={this.state.email} value={this.state.email}
keyboardType='email-address' /> keyboardType='email-address'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})} />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text> <Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text>
......
...@@ -18,7 +18,8 @@ class TransferBalance extends React.Component { ...@@ -18,7 +18,8 @@ class TransferBalance extends React.Component {
account_number: "", account_number: "",
destination: "", destination: "",
amount: "", amount: "",
reference: "" reference: "",
caretHidden:true,
} }
} }
...@@ -90,22 +91,30 @@ class TransferBalance extends React.Component { ...@@ -90,22 +91,30 @@ class TransferBalance extends React.Component {
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(destination) => this.setState({ destination })} onChangeText={(destination) => this.setState({ destination })}
value={this.state.destination} value={this.state.destination}
keyboardType='number-pad' /> keyboardType='number-pad'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}/>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('amount')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('amount')}</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(amount) => this.setState({ amount })} onChangeText={(amount) => this.setState({ amount })}
value={this.state.amount} value={this.state.amount}
keyboardType='number-pad'/> keyboardType='number-pad'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})} />
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('currentbalance')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('currentbalance')}</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(no_tlp) => this.setState({ no_tlp })} onChangeText={(no_tlp) => this.setState({ no_tlp })}
editable={false}> editable={false}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}>
{this.state.balance} {this.state.balance}
</TextInput> </TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('message')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('message')}</Text>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }} <TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(reference) => this.setState({ reference })} onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference}> value={this.state.reference}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}>
</TextInput> </TextInput>
</View> </View>
</View> </View>
......
...@@ -59,6 +59,7 @@ class UpgradePremium extends React.Component { ...@@ -59,6 +59,7 @@ class UpgradePremium extends React.Component {
uri_id: this.props.URI, uri_id: this.props.URI,
uri_selfie: this.props.URI_IDCARD, uri_selfie: this.props.URI_IDCARD,
spinner: false, spinner: false,
caretHidden:true,
} }
} }
...@@ -227,6 +228,8 @@ class UpgradePremium extends React.Component { ...@@ -227,6 +228,8 @@ class UpgradePremium extends React.Component {
onChangeText={(nama_depan) => this.setState({ nama_depan })} onChangeText={(nama_depan) => this.setState({ nama_depan })}
value={this.state.nama_depan} value={this.state.nama_depan}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -238,6 +241,8 @@ class UpgradePremium extends React.Component { ...@@ -238,6 +241,8 @@ class UpgradePremium extends React.Component {
onChangeText={(nama_belakang) => this.setState({ nama_belakang })} onChangeText={(nama_belakang) => this.setState({ nama_belakang })}
value={this.state.nama_belakang} value={this.state.nama_belakang}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -249,6 +254,8 @@ class UpgradePremium extends React.Component { ...@@ -249,6 +254,8 @@ class UpgradePremium extends React.Component {
onChangeText={(tempat_lahir) => this.setState({ tempat_lahir })} onChangeText={(tempat_lahir) => this.setState({ tempat_lahir })}
value={this.state.tempat_lahir} value={this.state.tempat_lahir}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -260,6 +267,8 @@ class UpgradePremium extends React.Component { ...@@ -260,6 +267,8 @@ class UpgradePremium extends React.Component {
onChangeText={(alamat_permanent) => this.setState({ alamat_permanent })} onChangeText={(alamat_permanent) => this.setState({ alamat_permanent })}
value={this.state.alamat_permanent} value={this.state.alamat_permanent}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -271,6 +280,8 @@ class UpgradePremium extends React.Component { ...@@ -271,6 +280,8 @@ class UpgradePremium extends React.Component {
onChangeText={(region) => this.setState({ region })} onChangeText={(region) => this.setState({ region })}
value={this.state.region} value={this.state.region}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
{/* <RNPickerSelect {/* <RNPickerSelect
value={this.state.region} value={this.state.region}
...@@ -287,6 +298,8 @@ class UpgradePremium extends React.Component { ...@@ -287,6 +298,8 @@ class UpgradePremium extends React.Component {
onChangeText={(city) => this.setState({ city })} onChangeText={(city) => this.setState({ city })}
value={this.state.city} value={this.state.city}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
{/* <RNPickerSelect {/* <RNPickerSelect
value={this.state.city} value={this.state.city}
...@@ -303,6 +316,8 @@ class UpgradePremium extends React.Component { ...@@ -303,6 +316,8 @@ class UpgradePremium extends React.Component {
onChangeText={(district) => this.setState({ district })} onChangeText={(district) => this.setState({ district })}
value={this.state.district} value={this.state.district}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -314,6 +329,8 @@ class UpgradePremium extends React.Component { ...@@ -314,6 +329,8 @@ class UpgradePremium extends React.Component {
onChangeText={(village) => this.setState({ village })} onChangeText={(village) => this.setState({ village })}
value={this.state.village} value={this.state.village}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -349,6 +366,8 @@ class UpgradePremium extends React.Component { ...@@ -349,6 +366,8 @@ class UpgradePremium extends React.Component {
onChangeText={(id_value) => this.setState({ id_value })} onChangeText={(id_value) => this.setState({ id_value })}
value={this.state.id_value} value={this.state.id_value}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
...@@ -360,6 +379,8 @@ class UpgradePremium extends React.Component { ...@@ -360,6 +379,8 @@ class UpgradePremium extends React.Component {
onChangeText={(nationality) => this.setState({ nationality })} onChangeText={(nationality) => this.setState({ nationality })}
value={this.state.nationality} value={this.state.nationality}
textAlign='center' textAlign='center'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}
/> />
</View> </View>
<View style={styles.textLabel}> <View style={styles.textLabel}>
......
...@@ -30,6 +30,7 @@ class UseBalance extends React.Component { ...@@ -30,6 +30,7 @@ class UseBalance extends React.Component {
checkedBalancePoint: false, checkedBalancePoint: false,
balanceused: 0, balanceused: 0,
pointsused: 0, pointsused: 0,
caretHidden:true
} }
} }
...@@ -349,7 +350,9 @@ class UseBalance extends React.Component { ...@@ -349,7 +350,9 @@ class UseBalance extends React.Component {
placeholder='0' placeholder='0'
placeholderTextColor='#838383' placeholderTextColor='#838383'
autoCapitalize="none" autoCapitalize="none"
keyboardType='numeric' /> keyboardType='numeric'
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({caretHidden: false})}/>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
......
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