Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
new_excelso
Commits
01f9729e
Commit
01f9729e
authored
Jul 02, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin bug card activation
parent
f04a1869
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
59 deletions
+43
-59
globalReducer.js
redux/globalReducer.js
+4
-2
Account.js
view/Account.js
+9
-10
CardActivation.js
view/CardActivation.js
+3
-4
EmailConfirmation.js
view/EmailConfirmation.js
+1
-31
Home.js
view/Home.js
+26
-12
No files found.
redux/globalReducer.js
View file @
01f9729e
...
...
@@ -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
}
}
...
...
view/Account.js
View file @
01f9729e
...
...
@@ -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
...
...
@@ -628,9 +627,9 @@ const mapDispatchToProps = (dispacth) => {
type
:
ActionType
.
SET_ACCOUNT_NUMBER
,
data
:
{
card_number
:
setCardNumberProps
.
card_number
,
card_number
:
setCardNumberProps
.
card_number
,
}
}),
}),
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Account
);
...
...
view/CardActivation.js
View file @
01f9729e
...
...
@@ -14,7 +14,7 @@ class CardActivation extends React.Component {
session_id
:
""
,
mobile_phone
:
""
,
card_number
:
""
,
card_nums
:
this
.
props
.
route
.
params
.
cardN
umber
,
card_nums
:
this
.
props
.
card_n
umber
,
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
})}
/
>
)}
...
...
view/EmailConfirmation.js
View file @
01f9729e
...
...
@@ -360,34 +360,4 @@ const mapDispatchToProps = (dispacth) => {
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
EmailConfirmation
);
{
/* <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
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
EmailConfirmation
);
\ No newline at end of file
view/Home.js
View file @
01f9729e
...
...
@@ -22,7 +22,7 @@ import requestParams from '../helper/requestParams';
class
Home
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -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,10 +172,10 @@ class Home extends React.Component {
}
_account
()
{
let
params
=
Object
.
assign
(
requestParams
,{
let
params
=
Object
.
assign
(
requestParams
,
{
session_id
:
this
.
props
.
session_id
,
})
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/member/get_profile'
,
params
).
then
(
res
=>
{
const
dataCard
=
res
.
data
let
point
=
dataCard
.
kaspro_point
...
...
@@ -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,14 +313,14 @@ 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
(
<
View
style
=
{
styles
.
container
}
>
<
StatusBar
backgroundColor
=
'#CFB368'
/>
<
ScrollView
>
...
...
@@ -829,6 +835,14 @@ const mapDispatchToProps = (dispacth) => {
}
}),
setCardNumber
:
(
setCardNumberProps
)
=>
dispacth
({
type
:
ActionType
.
SET_ACCOUNT_NUMBER
,
data
:
{
card_number
:
setCardNumberProps
.
card_number
,
}
}),
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment