Commit 31ce1e2d authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

- memperbaiki bug token

- jika card number kosong editable true jika tidak maka editable false
parent 97e9badc
...@@ -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>
...@@ -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);
......
This diff is collapsed.
...@@ -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>
......
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