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

benerin bug card activation

parent f04a1869
......@@ -99,7 +99,8 @@ const globalState = {
is_expired_date: true,
old_balance_claimed: true,
set_inbox :''
set_inbox :'',
email_confirm:false
}
......@@ -165,7 +166,8 @@ const rootReducer = (state = globalState, action) => {
case ActionType.SET_PAGE: {
return {
...state,
pageEmailConfirmation: action.data.pageEmailConfirmation
pageEmailConfirmation: action.data.pageEmailConfirmation,
email_confirm: action.data.email_confirm
}
}
......
......@@ -164,6 +164,7 @@ class Account extends React.Component {
let old_balance = dataCard.old_balance
let is_expired = dataCard.is_expired
let card_number = dataCard.card_number
let account_number = dataCard.account_number
if (kaspro === "") {
......@@ -180,13 +181,6 @@ class Account extends React.Component {
this.props.setCardactive(cardProps)
}
let account_number = dataCard.card_number
let setCardNumberProps = {
card_number : account_number
}
this.props.setCardNumber(setCardNumberProps)
this.setState({
email: email,
points: point,
......@@ -202,10 +196,15 @@ class Account extends React.Component {
old_balance_claimed: old_balance_claimed,
old_balance: old_balance,
is_expired: is_expired,
card_number:card_number
card_number: card_number
})
let setCardNumberProps = {
card_number: this.state.card_number
}
this.props.setCardNumber(setCardNumberProps)
}).catch(error => {
// const { navigation } = this.props
// let response = error.response.data
......
......@@ -14,7 +14,7 @@ class CardActivation extends React.Component {
session_id: "",
mobile_phone: "",
card_number: "",
card_nums: this.props.route.params.cardNumber,
card_nums: this.props.card_number,
token: "",
timer: 80,
onclickToken: false,
......@@ -26,8 +26,7 @@ class CardActivation extends React.Component {
}
componentDidMount() {
console.log("INI CARD NUMBER" + this.props.card_number)
console.log("INI BASE_URL " + this.props.BASE_URL)
console.log("INI CARD NUMBER : "+this.props.card_number)
}
componentDidUpdate(prevProps) {
......@@ -329,7 +328,7 @@ class CardActivation extends React.Component {
value={this.props.card_number}
editable={false}
caretHidden={this.state.caretHidden}
defaultValue={this.props.card_nums}
defaultValue={this.state.card_number}
onFocus={() => this.setState({ caretHidden: false })}
/>
)}
......
......@@ -361,33 +361,3 @@ const mapDispatchToProps = (dispacth) => {
export default connect(mapStateToProps, mapDispatchToProps)(EmailConfirmation);
\ No newline at end of file
{/* <Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<View style={{ margin: 10, top: 10 }}>
<TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
value={this.state.confirmation_number}
/>
</View>
<View style={{ margin: 10 }}>
<Button title="Submit" onPress={() => this.handleSubmit()} />
</View>
<View style={{ margin: 10 }}>
<Button title="Cancel" onPress={() => this.handleCancel()} />
</View>
<View>
<TouchableOpacity onPress={() => this.handleResend()}>
<Text style={{ color: 'red', textAlign: 'center' }}>Resend email token</Text>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ color: 'red', textAlign: 'center' }}> Change email</Text>
</TouchableOpacity>
</View> */}
\ No newline at end of file
......@@ -89,7 +89,7 @@ class Home extends React.Component {
}
CheckInbox() {
let params = Object.assign(requestParams,{
let params = Object.assign(requestParams, {
session_id: this.props.session_id,
})
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/inbox/unread_count', params).then(respon => {
......@@ -172,7 +172,7 @@ class Home extends React.Component {
}
_account() {
let params = Object.assign(requestParams,{
let params = Object.assign(requestParams, {
session_id: this.props.session_id,
})
......@@ -200,6 +200,12 @@ class Home extends React.Component {
old_balance: old_balance,
card_number: card_number
})
let setCardNumberProps = {
card_number: this.state.card_number
}
this.props.setCardNumber(setCardNumberProps)
}).catch(error => {
let response = error.response.data
// Alert.alert('',response.msg);
......@@ -209,13 +215,13 @@ class Home extends React.Component {
_getOutletClosest() {
let params = Object.assign(requestParams,{
let params = Object.assign(requestParams, {
session_id: this.props.session_id,
lat: this.state.my_lat,
long: this.state.my_long,
})
console.log("INI DATANYA "+ JSON.stringify(params));
console.log("INI DATANYA " + JSON.stringify(params));
Axios.post(this.props.BASE_URL + 'crm/v2/outlet/get_closest', params).then(res => {
let outletId = res.data.data.outlet_id
let outletName = res.data.data.outlet_name
......@@ -238,7 +244,7 @@ class Home extends React.Component {
}
handleuseBalance() {
let params = Object.assign(requestParams,{
let params = Object.assign(requestParams, {
session_id: this.props.session_id,
})
Axios.post(this.props.BASE_URL + 'crm/v2/point/check', params).then(res => {
......@@ -276,7 +282,7 @@ class Home extends React.Component {
}
handleClaimCredit() {
let params = Object.assign(requestParams,{
let params = Object.assign(requestParams, {
session_id: this.props.session_id,
})
Axios.post(this.props.BASE_URL + 'crm/v2/card/claim_old_balance', params).then(res => {
......@@ -307,10 +313,10 @@ class Home extends React.Component {
}
render() {
const {navigation} = this.props
const { navigation } = this.props
navigation.setOptions({
headerRight: () => (
<Text style={{color:'red'}}>hahah</Text>
<Text style={{ color: 'red' }}>hahah</Text>
),
})
return (
......@@ -829,6 +835,14 @@ const mapDispatchToProps = (dispacth) => {
}
}),
setCardNumber: (setCardNumberProps) => dispacth({
type: ActionType.SET_ACCOUNT_NUMBER,
data: {
card_number: setCardNumberProps.card_number,
}
}),
}
}
......
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