Commit 01c1429d authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

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

# Conflicts:
#	view/Renewal.js
parents 2b748105 3e3692ec
......@@ -22,9 +22,11 @@
"renew":"RENEW",
"message":"Message",
"changepassword":"CHANGE PASSWORD",
"changeEmail":"CHANGE EMAIL",
"save":"Save",
"currentpassword":"Current Password",
"newpassword":"New Password",
"headerNewPassword":"NEW PASSWORD",
"repeatpassword":"Repeat Password",
"language":"LANGUAGE",
"password":"Password",
......@@ -47,6 +49,7 @@
"cancel":"CANCEL",
"resendemail":"RENSEND EMAIL TOKEN",
"enterToken":"Enter Token",
"token":"Token",
"delivery":"DELIVERY",
"pickup":"PICKUP",
"orderInfo" : "YOU WILL PICKUP YOUR ORDER AT",
......@@ -77,6 +80,7 @@
"alertpoin":"Sorry, your points are not enough",
"alertselectpayment":"Please choose a payment method",
"alertbalance":"Sorry, your balance are not enough",
"alertbalancepoin":"Sorry, your balance and points are not enough"
"alertbalancepoin":"Sorry, your balance and points are not enough",
"headerResetPassword":"RESET PASSWORD"
}
\ No newline at end of file
......@@ -41,11 +41,14 @@
"detail":"Details",
"resendemail":"KIRIM ULANG EMAIL TOKEN",
"enterToken":"Masukan Token",
"token":"Token",
"delivery":"ANTAR",
"pickup":"AMBIL",
"changepassword":"GANTI KATA SANDI",
"changeEmail":"GANTI EMAIL",
"currentpassword":"Kata sandi lama",
"newpassword":"Kata sandi baru",
"headerNewPassword":"KATA SANDI BARU",
"repeatpassword":"Ulangi Kata sandi",
"save":"Simpan",
"language":"BAHASA",
......@@ -62,7 +65,7 @@
"topup":" PENGISIAN SALDO ",
"usebalance": "GUNAKAN SALDO",
"balance" :"SALDO",
"redeem":"REDEEM",
"redeem":"REDEEM@",
"point" : "POIN",
"profile" :"Profil",
"upgradePremium" :"TINGKATKAN PREMIUM",
......@@ -77,7 +80,8 @@
"alertpoin":"Maaf Point tidak cukup",
"alertselectpayment":"Silahkan pilih metode pembayaran",
"alertbalance":"Maaf Saldo tidak cukup",
"alertbalancepoin":"Maaf Saldo dan poin tidak cukup"
"alertbalancepoin":"Maaf Saldo dan poin tidak cukup",
"headerResetPassword":"GANTI PASSWORD"
}
......
......@@ -561,7 +561,7 @@ class Auth extends React.Component {
fontSize: 20,
color: 'white',
textAlign: 'center'
}, title: 'USE BALANCE'
}, title: i18n.t('usebalance')
}}
/>
<Stack.Screen name="PaymentCode" component={PaymentCode}
......@@ -598,7 +598,7 @@ class Auth extends React.Component {
fontFamily: 'Gotham-Black',
color: 'white'
},
headerTitle: 'New Password'
headerTitle: i18n.t('headerNewPassword')
}} />
{/* <Stack.Screen name="Login" component={Login} /> */}
......@@ -614,7 +614,7 @@ class Auth extends React.Component {
fontFamily: 'Gotham-Black',
color: 'white'
},
headerTitle: 'RESET PASSWORD'
headerTitle: i18n.t('headerResetPassword')
}} />
......
......@@ -5,6 +5,7 @@ import { BASE_URL_CHANGE_PASSWORD } from '../model/Base_Model';
import { connect } from 'react-redux';
import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
import Toast from 'react-native-tiny-toast';
class ChangePassword extends React.Component {
constructor(props) {
......@@ -30,6 +31,7 @@ class ChangePassword extends React.Component {
}
Axios.post(this.props.BASE_URL+'crm/v2/auth/change_password', params).then(res => {
this.props.navigation.navigate('Profile');
Toast.show('Ganti Password Berhasil')
}).catch(error => {
console.log(error)
let response = error.response.data;
......
......@@ -229,7 +229,7 @@ class EmailConfirmation extends React.Component {
</TouchableOpacity>
{this.props.proses == 'Register' ? (
<TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>{i18n.t('changeEmail')}</Text>
</TouchableOpacity>
) : (null)}
</View>
......
......@@ -6,6 +6,7 @@ import ActionType from '../redux/globalActionType';
import { BASE_URL_NEW_PASSWORD } from '../model/Base_Model'
import Spinner from 'react-native-loading-spinner-overlay';
import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
class NewPassword extends React.Component {
constructor(props) {
......@@ -83,28 +84,28 @@ class NewPassword extends React.Component {
/>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>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: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>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 }}
onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
value={this.state.confirmation_number} />
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>New Password</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 }}
onChangeText={(password) => this.setState({ password })}
value={this.state.password}
secureTextEntry={true} />
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Repeat Password</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 }}
onChangeText={(password_confirmation) => this.setState({ password_confirmation })}
value={this.state.password_confirmation}
secureTextEntry={true} />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}>
<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 }}>{i18n.t('submit')}</Text>
</View>
</TouchableOpacity>
</View>
......
......@@ -4,6 +4,7 @@ import { connect } from 'react-redux';
import Axios from 'axios';
import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
import Toast from 'react-native-tiny-toast';
class Renewal extends React.Component {
constructor(props) {
......@@ -22,6 +23,27 @@ class Renewal extends React.Component {
// console.log(this.props.BASE_URL)
}
<<<<<<< HEAD
=======
_handleRenewal() {
Alert.alert(
"Renewal",
"Are you sure want to renewal ?",
[
{
text: 'No',
onPress: () => console.log('Cancel Renewal'),
style: 'cancel',
},
{
text: 'Yes', onPress: () => this._renewal()
},
],
{ cancelable: false },
)
}
>>>>>>> 3e3692eccd3a8082482d5d3ac9218561fbefd778
_renewal() {
let params = {
session_id: this.props.session_id
......@@ -30,11 +52,12 @@ class Renewal extends React.Component {
Axios.post(this.props.BASE_URL+'crm/v2/card/renewal', params).then(res => {
// console.log('ini res ' + JSON.stringify(res.data))
this._getProfile();
this.props.navigation.navigate('HOME',{screen:'Account'});
Toast.show('Successfully Renewal')
this.props.navigation.navigate('Home', { screen: 'ACCOUNT' });
}).catch(error => {
let response = error.response.data;
// console.log(response.msg)
Alert.alert('',response.msg);
Alert.alert('', response.msg);
})
}
......@@ -54,10 +77,15 @@ class Renewal extends React.Component {
var date_string = c_renew_until
var date_arr = date_string.split('-');
var date = new Date(date_arr[0], date_arr[1], date_arr[2]);
date.setFullYear(date.getFullYear() + 1);
let date_nextyear_string = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate()
<<<<<<< HEAD
=======
console.log("INI YA : " + date_nextyear_string)
>>>>>>> 3e3692eccd3a8082482d5d3ac9218561fbefd778
this.setState({
current_balance: balance,
expired: expired,
......@@ -74,46 +102,46 @@ class Renewal extends React.Component {
<View style={styles.container}>
<MyStatusBar />
{/* <View style={styles.header}> */}
{/* <Text style={{ textAlign: 'center', margin: 20, fontSize: 25, alignSelf: 'center' }}>Renewal</Text> */}
{/* <Text style={{ textAlign: 'center', margin: 20, fontSize: 25, alignSelf: 'center' }}>Renewal</Text> */}
{/* </View> */}
<View style={styles.body}>
<View style={styles.cont_curent_balance}>
<View style={styles.current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'#CFB368' }}>{i18n.t('currentbalance')}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('currentbalance')}</Text>
</View>
<View style={styles.value_current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'gray' }}>IDR {this.state.current_balance}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.current_balance}</Text>
</View>
</View>
<View style={styles.cont_curent_balance}>
<View style={styles.current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'#CFB368' }}>{i18n.t('renewalfees')}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('renewalfees')}</Text>
</View>
<View style={styles.value_current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'gray' }}>IDR {this.state.biaya_renewal}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.biaya_renewal}</Text>
</View>
</View>
<View style={styles.cont_curent_balance}>
<View style={styles.current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'#CFB368' }}>{i18n.t('expired')}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('expired')}</Text>
</View>
<View style={styles.value_current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'gray' }}>{this.state.expired}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>{this.state.expired}</Text>
</View>
</View>
<View style={styles.cont_curent_balance}>
<View style={styles.current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'#CFB368' }}>{i18n.t('renewuntil')}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>{i18n.t('renewuntil')}</Text>
</View>
<View style={styles.value_current_balance}>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color:'gray' }}>{this.state.renew_until}</Text>
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: 'gray' }}>{this.state.renew_until}</Text>
</View>
</View>
{/* <View style={styles.btn_renewal}>
<Button title="Renew" onPress={() => this._renewal()}></Button>
</View> */}
<TouchableOpacity onPress={() => this._renewal()}>
<TouchableOpacity onPress={() => this._handleRenewal()}>
<View style={styles.button}>
<Text style={{ color: 'white', fontSize: 16, textAlign: 'center', fontFamily: 'Gotham-Black' }}>{i18n.t('renew')}</Text>
</View>
......@@ -138,32 +166,32 @@ const styles = StyleSheet.create({
marginTop: 12
},
cont_curent_balance: {
flex:0.2
flex: 0.2
},
current_balance: {
flex: 1,
// backgroundColor:'cyan',
justifyContent:'center',
justifyContent: 'center',
},
value_current_balance: {
flex: 1,
marginHorizontal:30,
marginHorizontal: 30,
paddingHorizontal: 10,
paddingVertical : 5,
justifyContent:'center',
borderWidth:1,
borderColor:'gray',
borderRadius:10,
paddingVertical: 5,
justifyContent: 'center',
borderWidth: 1,
borderColor: 'gray',
borderRadius: 10,
// backgroundColor:'maroon'
},
button: {
height: 40,
borderRadius: 10,
backgroundColor: '#CFB368',
justifyContent: 'center',
height: 40,
borderRadius: 10,
backgroundColor: '#CFB368',
justifyContent: 'center',
margin: 30,
padding: 5,
bottom: 5,
padding: 5,
bottom: 5,
},
})
......
......@@ -78,7 +78,7 @@ class ResetPassword extends React.Component {
/>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</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 }}
onChangeText={(email) => this.setState({ email })}
autoCapitalize="none"
......@@ -86,11 +86,11 @@ class ResetPassword extends React.Component {
keyboardType='email-address' />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}>
<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 }}>{i18n.t('submit')}</Text>
</View>
</TouchableOpacity>
<TouchableOpacity style={{ height: 60 }} onPress={() => this.handleEnterToken()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 }}>ENTER TOKEN</Text>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('enterToken')}</Text>
</TouchableOpacity>
</View>
</View>
......
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