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

benerin bug card activation

parent f04a1869
...@@ -99,7 +99,8 @@ const globalState = { ...@@ -99,7 +99,8 @@ const globalState = {
is_expired_date: true, is_expired_date: true,
old_balance_claimed: true, old_balance_claimed: true,
set_inbox :'' set_inbox :'',
email_confirm:false
} }
...@@ -165,7 +166,8 @@ const rootReducer = (state = globalState, action) => { ...@@ -165,7 +166,8 @@ const rootReducer = (state = globalState, action) => {
case ActionType.SET_PAGE: { case ActionType.SET_PAGE: {
return { return {
...state, ...state,
pageEmailConfirmation: action.data.pageEmailConfirmation pageEmailConfirmation: action.data.pageEmailConfirmation,
email_confirm: action.data.email_confirm
} }
} }
......
...@@ -164,6 +164,7 @@ class Account extends React.Component { ...@@ -164,6 +164,7 @@ class Account extends React.Component {
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 let card_number = dataCard.card_number
let account_number = dataCard.account_number
if (kaspro === "") { if (kaspro === "") {
...@@ -180,13 +181,6 @@ class Account extends React.Component { ...@@ -180,13 +181,6 @@ class Account extends React.Component {
this.props.setCardactive(cardProps) this.props.setCardactive(cardProps)
} }
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,
...@@ -202,10 +196,15 @@ class Account extends React.Component { ...@@ -202,10 +196,15 @@ class Account extends React.Component {
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 card_number: card_number
}) })
let setCardNumberProps = {
card_number: this.state.card_number
}
this.props.setCardNumber(setCardNumberProps)
}).catch(error => { }).catch(error => {
// const { navigation } = this.props // const { navigation } = this.props
// let response = error.response.data // let response = error.response.data
...@@ -628,9 +627,9 @@ const mapDispatchToProps = (dispacth) => { ...@@ -628,9 +627,9 @@ const mapDispatchToProps = (dispacth) => {
type: ActionType.SET_ACCOUNT_NUMBER, type: ActionType.SET_ACCOUNT_NUMBER,
data: { data: {
card_number: setCardNumberProps.card_number, card_number: setCardNumberProps.card_number,
} }
}), }),
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(Account); export default connect(mapStateToProps, mapDispatchToProps)(Account);
......
...@@ -14,7 +14,7 @@ class CardActivation extends React.Component { ...@@ -14,7 +14,7 @@ class CardActivation extends React.Component {
session_id: "", session_id: "",
mobile_phone: "", mobile_phone: "",
card_number: "", card_number: "",
card_nums: this.props.route.params.cardNumber, card_nums: this.props.card_number,
token: "", token: "",
timer: 80, timer: 80,
onclickToken: false, onclickToken: false,
...@@ -26,8 +26,7 @@ class CardActivation extends React.Component { ...@@ -26,8 +26,7 @@ class CardActivation extends React.Component {
} }
componentDidMount() { componentDidMount() {
console.log("INI CARD NUMBER" + this.props.card_number) console.log("INI CARD NUMBER : "+this.props.card_number)
console.log("INI BASE_URL " + this.props.BASE_URL)
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
...@@ -329,7 +328,7 @@ class CardActivation extends React.Component { ...@@ -329,7 +328,7 @@ class CardActivation extends React.Component {
value={this.props.card_number} value={this.props.card_number}
editable={false} editable={false}
caretHidden={this.state.caretHidden} caretHidden={this.state.caretHidden}
defaultValue={this.props.card_nums} defaultValue={this.state.card_number}
onFocus={() => this.setState({ caretHidden: false })} onFocus={() => this.setState({ caretHidden: false })}
/> />
)} )}
......
...@@ -360,34 +360,4 @@ const mapDispatchToProps = (dispacth) => { ...@@ -360,34 +360,4 @@ const mapDispatchToProps = (dispacth) => {
} }
export default connect(mapStateToProps, mapDispatchToProps)(EmailConfirmation); 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
...@@ -22,7 +22,7 @@ import requestParams from '../helper/requestParams'; ...@@ -22,7 +22,7 @@ import requestParams from '../helper/requestParams';
class Home extends React.Component { class Home extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -89,7 +89,7 @@ class Home extends React.Component { ...@@ -89,7 +89,7 @@ class Home extends React.Component {
} }
CheckInbox() { CheckInbox() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
session_id: this.props.session_id, session_id: this.props.session_id,
}) })
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/inbox/unread_count', params).then(respon => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/inbox/unread_count', params).then(respon => {
...@@ -172,10 +172,10 @@ class Home extends React.Component { ...@@ -172,10 +172,10 @@ class Home extends React.Component {
} }
_account() { _account() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
session_id: this.props.session_id, session_id: this.props.session_id,
}) })
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 => {
const dataCard = res.data const dataCard = res.data
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
...@@ -200,6 +200,12 @@ class Home extends React.Component { ...@@ -200,6 +200,12 @@ class Home extends React.Component {
old_balance: old_balance, old_balance: old_balance,
card_number: card_number card_number: card_number
}) })
let setCardNumberProps = {
card_number: this.state.card_number
}
this.props.setCardNumber(setCardNumberProps)
}).catch(error => { }).catch(error => {
let response = error.response.data let response = error.response.data
// Alert.alert('',response.msg); // Alert.alert('',response.msg);
...@@ -209,13 +215,13 @@ class Home extends React.Component { ...@@ -209,13 +215,13 @@ class Home extends React.Component {
_getOutletClosest() { _getOutletClosest() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
session_id: this.props.session_id, session_id: this.props.session_id,
lat: this.state.my_lat, lat: this.state.my_lat,
long: this.state.my_long, 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 => { Axios.post(this.props.BASE_URL + 'crm/v2/outlet/get_closest', params).then(res => {
let outletId = res.data.data.outlet_id let outletId = res.data.data.outlet_id
let outletName = res.data.data.outlet_name let outletName = res.data.data.outlet_name
...@@ -238,7 +244,7 @@ class Home extends React.Component { ...@@ -238,7 +244,7 @@ class Home extends React.Component {
} }
handleuseBalance() { handleuseBalance() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
session_id: this.props.session_id, session_id: this.props.session_id,
}) })
Axios.post(this.props.BASE_URL + 'crm/v2/point/check', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/point/check', params).then(res => {
...@@ -276,7 +282,7 @@ class Home extends React.Component { ...@@ -276,7 +282,7 @@ class Home extends React.Component {
} }
handleClaimCredit() { handleClaimCredit() {
let params = Object.assign(requestParams,{ let params = Object.assign(requestParams, {
session_id: this.props.session_id, session_id: this.props.session_id,
}) })
Axios.post(this.props.BASE_URL + 'crm/v2/card/claim_old_balance', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/card/claim_old_balance', params).then(res => {
...@@ -307,14 +313,14 @@ class Home extends React.Component { ...@@ -307,14 +313,14 @@ class Home extends React.Component {
} }
render() { render() {
const {navigation} = this.props const { navigation } = this.props
navigation.setOptions({ navigation.setOptions({
headerRight: () => ( headerRight: () => (
<Text style={{color:'red'}}>hahah</Text> <Text style={{ color: 'red' }}>hahah</Text>
), ),
}) })
return ( return (
<View style={styles.container}> <View style={styles.container}>
<StatusBar backgroundColor='#CFB368' /> <StatusBar backgroundColor='#CFB368' />
<ScrollView> <ScrollView>
...@@ -829,6 +835,14 @@ const mapDispatchToProps = (dispacth) => { ...@@ -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