Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_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
clone_excelso
Commits
0d42aa0a
Commit
0d42aa0a
authored
Jun 17, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
# Conflicts: # view/Home.js
parents
ecbc05a7
88e02761
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
210 additions
and
119 deletions
+210
-119
Home.js
view/Home.js
+15
-18
New_Register.js
view/New_Register.js
+73
-71
TransactionHistory.js
view/TransactionHistory.js
+122
-30
No files found.
view/Home.js
View file @
0d42aa0a
...
@@ -41,7 +41,7 @@ class Home extends React.Component {
...
@@ -41,7 +41,7 @@ class Home extends React.Component {
componentDidMount
()
{
componentDidMount
()
{
// const { navigation } = this.props
// const { navigation } = this.props
// CheckVersion(navigation)
// CheckVersion(navigation)
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
this
.
setState
({
this
.
setState
({
slider_height
:
screenWidth
slider_height
:
screenWidth
...
@@ -66,7 +66,7 @@ class Home extends React.Component {
...
@@ -66,7 +66,7 @@ class Home extends React.Component {
this
.
_account
();
this
.
_account
();
if
(
this
.
props
.
outlet_id
==
''
&&
this
.
props
.
name_outlet
==
''
&&
this
.
props
.
outlet_detailadress
==
''
)
{
if
(
this
.
props
.
outlet_id
==
''
&&
this
.
props
.
name_outlet
==
''
&&
this
.
props
.
outlet_detailadress
==
''
)
{
this
.
_getPermissions
()
this
.
_getPermissions
()
}
else
{
}
else
{
this
.
setState
({
this
.
setState
({
indicator
:
false
,
indicator
:
false
,
...
@@ -316,8 +316,8 @@ class Home extends React.Component {
...
@@ -316,8 +316,8 @@ class Home extends React.Component {
{i18n.t('orderInfo')}
{i18n.t('orderInfo')}
</Text> */
}
</Text> */
}
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#838383'
}}
>
{
i18n
.
t
(
'orderInfo'
)}
{
i18n
.
t
(
'orderInfo'
)}
<
/Text
>
<
/Text
>
{
this
.
state
.
indicator
==
true
?
(
{
this
.
state
.
indicator
==
true
?
(
<
ActivityIndicator
size
=
"small"
color
=
"#c9af6d"
/>
<
ActivityIndicator
size
=
"small"
color
=
"#c9af6d"
/>
)
:
(
)
:
(
...
@@ -385,20 +385,17 @@ class Home extends React.Component {
...
@@ -385,20 +385,17 @@ class Home extends React.Component {
)
:
)
:
this
.
state
.
account_number
===
""
?
(
this
.
state
.
account_number
===
""
?
(
<
View
style
=
{
styles
.
card
}
>
<
View
style
=
{
styles
.
card
}
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
}}
>
<
Card
style
=
{{
padding
:
10
,
margin
:
10
,
alignContent
:
'center'
,
backgroundColor
:
'#838383'
}}
>
<
Text
style
=
{{
textAlign
:
"center"
,
fontFamily
:
'Gotham-Light'
}}
>
{
i18n
.
t
(
'NotActivate'
)}
<
/Text
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'grey'
,
height
:
150
,
borderRadius
:
20
,
marginRight
:
10
,
marginLeft
:
10
,
justifyContent
:
'center'
}}
>
<
Text
>
<
View
style
=
{{
justifyContent
:
'center'
}}
>
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Card Activation'
)}
>
<
Text
style
=
{{
textAlign
:
"center"
,
fontSize
:
40
,
color
:
'#c9af6d'
}}
>
<
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
>
<
/View
>
<
View
style
=
{
styles
.
line
}
><
/View
>
<
/TouchableOpacity
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontWeight
:
'bold'
}}
>
{
'
\
n'
}
<
/View
>
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
line
}
><
/View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontWeight
:
'bold'
}}
>
{
'
\
n'
}
<
/Text
>
<
/Card
>
<
/Card
>
<
/View
>
<
/View
>
)
:
)
:
...
@@ -672,7 +669,7 @@ const mapStateToProps = (state) => {
...
@@ -672,7 +669,7 @@ const mapStateToProps = (state) => {
// login
// login
in_payment
:
state
.
in_payment
,
in_payment
:
state
.
in_payment
,
BASE_URL
:
state
.
BASE_URL
,
BASE_URL
:
state
.
BASE_URL
,
email
:
state
.
email
,
email
:
state
.
email
,
outlet_id
:
state
.
outlet_id
,
outlet_id
:
state
.
outlet_id
,
name_outlet
:
state
.
name_outlet
,
name_outlet
:
state
.
name_outlet
,
...
...
view/New_Register.js
View file @
0d42aa0a
...
@@ -59,19 +59,19 @@ class NewRegister extends React.Component {
...
@@ -59,19 +59,19 @@ class NewRegister extends React.Component {
let
date_list
=
[]
let
date_list
=
[]
for
(
let
i
=
1
;
i
<=
31
;
i
++
)
{
for
(
let
i
=
1
;
i
<=
31
;
i
++
)
{
date_list
.
push
({
label
:
String
(
i
),
value
:
i
});
date_list
.
push
({
label
:
String
(
i
),
value
:
i
});
}
}
let
month_list
=
[]
let
month_list
=
[]
for
(
let
i
=
1
;
i
<=
12
;
i
++
)
{
for
(
let
i
=
1
;
i
<=
12
;
i
++
)
{
const
month_name
=
month
[
i
];
const
month_name
=
month
[
i
];
month_list
.
push
({
label
:
month_name
,
value
:
i
});
month_list
.
push
({
label
:
month_name
,
value
:
i
});
}
}
let
year_list
=
[]
let
year_list
=
[]
let
current_year
=
new
Date
().
getFullYear
();
let
current_year
=
new
Date
().
getFullYear
();
let
start_year
=
current_year
-
65
;
let
start_year
=
current_year
-
65
;
let
end_year
=
current_year
-
13
;
let
end_year
=
current_year
-
13
;
for
(
let
i
=
start_year
;
i
<=
end_year
;
i
++
)
{
for
(
let
i
=
start_year
;
i
<=
end_year
;
i
++
)
{
year_list
.
push
({
label
:
String
(
i
),
value
:
i
});
year_list
.
push
({
label
:
String
(
i
),
value
:
i
});
}
}
this
.
setState
({
this
.
setState
({
date
:
date_list
,
date
:
date_list
,
...
@@ -91,7 +91,7 @@ class NewRegister extends React.Component {
...
@@ -91,7 +91,7 @@ class NewRegister extends React.Component {
for
(
const
key
in
list_gender
)
{
for
(
const
key
in
list_gender
)
{
if
(
list_gender
.
hasOwnProperty
(
key
))
{
if
(
list_gender
.
hasOwnProperty
(
key
))
{
const
row
=
list_gender
[
key
];
const
row
=
list_gender
[
key
];
gender_list
.
push
({
label
:
row
,
value
:
key
})
gender_list
.
push
({
label
:
row
,
value
:
key
})
}
}
}
}
this
.
setState
({
this
.
setState
({
...
@@ -245,16 +245,18 @@ class NewRegister extends React.Component {
...
@@ -245,16 +245,18 @@ class NewRegister extends React.Component {
this
.
props
.
navigation
.
navigate
(
'Email Confirmation'
)
this
.
props
.
navigation
.
navigate
(
'Email Confirmation'
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
this
.
setState
({
spinner
:
false
,
})
// console.log(JSON.stringify(error.response));
// console.log(JSON.stringify(error.response));
let
response
=
error
.
response
.
data
;
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
Alert
.
alert
(
''
,
''
,
response
.
msg
,
response
.
msg
,
[
[
{
text
:
'OK'
}
{
text
:
'OK'
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
,
})
}
]
]
)
)
})
})
...
@@ -344,73 +346,73 @@ class NewRegister extends React.Component {
...
@@ -344,73 +346,73 @@ class NewRegister extends React.Component {
<
View
style
=
{
styles
.
items1
}
>
<
View
style
=
{
styles
.
items1
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'dob'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'dob'
)}
<
/Text
>
<
/View
>
<
/View
>
{
Platform
.
OS
===
'ios'
?
(
{
Platform
.
OS
===
'ios'
?
(
<
View
style
=
{
styles
.
itemPicker
}
>
<
View
style
=
{
styles
.
itemPicker
}
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
marginLeft
:
10
}}
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
marginLeft
:
10
}}
>
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
dob_day
:
value
})}
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
dob_day
:
value
})}
items
=
{
this
.
state
.
date
}
items
=
{
this
.
state
.
date
}
placeholder
=
{{
label
:
'-- Select --'
}}
placeholder
=
{{
label
:
'-- Select --'
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
/
>
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
}}
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
}}
>
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
dob_month
:
value
})}
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
dob_month
:
value
})}
items
=
{
this
.
state
.
month
}
items
=
{
this
.
state
.
month
}
placeholder
=
{{
label
:
'-- Select --'
}}
placeholder
=
{{
label
:
'-- Select --'
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
/
>
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
marginRight
:
10
}}
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
marginRight
:
10
}}
>
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
dob_year
:
value
})}
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
dob_year
:
value
})}
items
=
{
this
.
state
.
year
}
items
=
{
this
.
state
.
year
}
placeholder
=
{{
label
:
'-- Select --'
}}
placeholder
=
{{
label
:
'-- Select --'
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
/
>
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
:
(
)
:
(
<
View
style
=
{
styles
.
itemPicker
}
>
<
View
style
=
{
styles
.
itemPicker
}
>
<
View
style
=
{{
height
:
35
,
flex
:
1
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
height
:
35
,
flex
:
1
,
alignItems
:
'center'
}}
>
<
Picker
<
Picker
mode
=
"dropdown"
mode
=
"dropdown"
selectedValue
=
{
this
.
state
.
dob_day
}
selectedValue
=
{
this
.
state
.
dob_day
}
style
=
{{
height
:
35
,
width
:
100
}}
style
=
{{
height
:
35
,
width
:
100
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
dob_day
:
itemValue
})}
>
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
dob_day
:
itemValue
})}
>
{
date
.
map
((
itemValue
,
itemIndex
)
=>
{
{
date
.
map
((
itemValue
,
itemIndex
)
=>
{
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
})}
})}
<
/Picker
>
<
/Picker
>
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
35
,
flex
:
1
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
height
:
35
,
flex
:
1
,
alignItems
:
'center'
}}
>
<
Picker
<
Picker
mode
=
"dropdown"
mode
=
"dropdown"
selectedValue
=
{
this
.
state
.
dob_month
}
selectedValue
=
{
this
.
state
.
dob_month
}
style
=
{{
height
:
35
,
width
:
100
}}
style
=
{{
height
:
35
,
width
:
100
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
dob_month
:
itemValue
})
this
.
setState
({
dob_month
:
itemValue
})
}
>
}
>
{
month
.
map
((
itemValue
,
itemIndex
)
=>
{
{
month
.
map
((
itemValue
,
itemIndex
)
=>
{
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemIndex
}
key
=
{
itemIndex
}
/>
)
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemIndex
}
key
=
{
itemIndex
}
/>
)
})}
})}
<
/Picker
>
<
/Picker
>
<
/View
>
<
View
style
=
{{
height
:
35
,
flex
:
1
,
alignItems
:
'center'
}}
>
<
Picker
mode
=
"dropdown"
selectedValue
=
{
this
.
state
.
dob_year
}
style
=
{{
height
:
35
,
width
:
100
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
dob_year
:
itemValue
})
}
>
{
year
.
map
((
itemValue
,
itemIndex
)
=>
{
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
})}
<
/Picker
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
35
,
flex
:
1
,
alignItems
:
'center'
}}
>
<
Picker
mode
=
"dropdown"
selectedValue
=
{
this
.
state
.
dob_year
}
style
=
{{
height
:
35
,
width
:
100
}}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
dob_year
:
itemValue
})
}
>
{
year
.
map
((
itemValue
,
itemIndex
)
=>
{
return
(
<
Picker
.
Item
label
=
{
itemValue
}
value
=
{
itemValue
}
key
=
{
itemIndex
}
/>
)
})}
<
/Picker
>
<
/View
>
<
/View
>
)}
)}
<
/View
>
<
/View
>
...
@@ -421,27 +423,27 @@ class NewRegister extends React.Component {
...
@@ -421,27 +423,27 @@ class NewRegister extends React.Component {
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'gender'
)}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
color
:
'#CFB368'
,
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'gender'
)}
<
/Text
>
<
/View
>
<
/View
>
{
Platform
.
OS
===
'ios'
?
(
{
Platform
.
OS
===
'ios'
?
(
<
View
style
=
{
styles
.
pickerGender
}
>
<
View
style
=
{
styles
.
pickerGender
}
>
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
gender
:
value
})}
<
RNPickerSelect
onValueChange
=
{(
value
)
=>
this
.
setState
({
gender
:
value
})}
items
=
{
this
.
state
.
gender_list
}
items
=
{
this
.
state
.
gender_list
}
placeholder
=
{{
label
:
'-- Select --'
}}
placeholder
=
{{
label
:
'-- Select --'
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
style
=
{{
inputIOSContainer
:
{
paddingVertical
:
10
,
alignItems
:
'center'
}
}}
/
>
/
>
<
/View
>
<
/View
>
)
:
(
)
:
(
<
View
style
=
{
styles
.
pickerGender
}
>
<
View
style
=
{
styles
.
pickerGender
}
>
<
Picker
selectedValue
=
{
this
.
state
.
gender
}
<
Picker
selectedValue
=
{
this
.
state
.
gender
}
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
gender
:
itemValue
})}
>
onValueChange
=
{(
itemValue
,
itemIndex
)
=>
this
.
setState
({
gender
:
itemValue
})}
>
<
Picker
.
Item
label
=
'Pilih'
value
=
''
/>
<
Picker
.
Item
label
=
'Pilih'
value
=
''
/>
{
{
Object
.
entries
(
this
.
state
.
list_gender
).
map
((
item
,
key
)
=>
Object
.
entries
(
this
.
state
.
list_gender
).
map
((
item
,
key
)
=>
<
Picker
.
Item
label
=
{
item
[
1
]}
key
=
{
key
}
value
=
{
item
[
0
]}
>
<
Picker
.
Item
label
=
{
item
[
1
]}
key
=
{
key
}
value
=
{
item
[
0
]}
>
<
/Picker.Item
>
<
/Picker.Item
>
)
)
}
}
<
/Picker
>
<
/Picker
>
<
/View
>
<
/View
>
)}
)}
<
/View
>
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
validate
()}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
validate
()}
>
<
View
style
=
{
styles
.
button
}
>
<
View
style
=
{
styles
.
button
}
>
...
@@ -453,8 +455,8 @@ class NewRegister extends React.Component {
...
@@ -453,8 +455,8 @@ class NewRegister extends React.Component {
<
Text
style
=
{{
color
:
'#CFB368'
}}
>
{
i18n
.
t
(
'login'
)}
<
/Text
>
<
Text
style
=
{{
color
:
'#CFB368'
}}
>
{
i18n
.
t
(
'login'
)}
<
/Text
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
Image
source
=
{
require
(
'../assets/images/file-register.png'
)}
resizeMethod
=
'resize'
resizeMode
=
'contain'
style
=
{{
height
:
300
,
width
:
'100%'
}}
><
/Image
>
<
Image
source
=
{
require
(
'../assets/images/file-register.png'
)}
resizeMethod
=
'resize'
resizeMode
=
'contain'
style
=
{{
height
:
300
,
width
:
'100%'
}}
><
/Image
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
...
@@ -511,7 +513,7 @@ const styles = StyleSheet.create({
...
@@ -511,7 +513,7 @@ const styles = StyleSheet.create({
borderWidth
:
1
,
borderWidth
:
1
,
borderRadius
:
10
,
borderRadius
:
10
,
height
:
40
,
height
:
40
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
},
},
titleText
:
{
titleText
:
{
...
@@ -519,7 +521,7 @@ const styles = StyleSheet.create({
...
@@ -519,7 +521,7 @@ const styles = StyleSheet.create({
fontSize
:
26
,
fontSize
:
26
,
fontWeight
:
'bold'
,
fontWeight
:
'bold'
,
color
:
'white'
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
fontFamily
:
'Gotham-Black'
},
},
textInput
:
{
textInput
:
{
height
:
40
,
height
:
40
,
...
...
view/TransactionHistory.js
View file @
0d42aa0a
...
@@ -5,6 +5,7 @@ import { connect } from 'react-redux';
...
@@ -5,6 +5,7 @@ import { connect } from 'react-redux';
import
Axios
from
'axios'
;
import
Axios
from
'axios'
;
import
moment
from
'moment'
import
moment
from
'moment'
import
MyStatusBar
from
'./MyStatusBar'
;
import
MyStatusBar
from
'./MyStatusBar'
;
import
NumberFormat
from
'react-number-format'
;
class
TransactionHistory
extends
React
.
Component
{
class
TransactionHistory
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -16,6 +17,7 @@ class TransactionHistory extends React.Component {
...
@@ -16,6 +17,7 @@ class TransactionHistory extends React.Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
this
.
props
.
session_id
)
this
.
getTransactionHistory
()
this
.
getTransactionHistory
()
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
this
.
_unsubscribe
=
this
.
props
.
navigation
.
addListener
(
'focus'
,
()
=>
{
...
@@ -88,43 +90,133 @@ class TransactionHistory extends React.Component {
...
@@ -88,43 +90,133 @@ class TransactionHistory extends React.Component {
this
.
state
.
history_list
.
map
((
item
)
=>
(
this
.
state
.
history_list
.
map
((
item
)
=>
(
item
.
transactions
.
map
((
i
,
k
)
=>
(
item
.
transactions
.
map
((
i
,
k
)
=>
(
i
.
type
==
2
?
(
<
TouchableOpacity
key
=
{
k
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
i
.
id
})}
>
i
.
type
==
1
?
(
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
trans_type_display
}
<
/Text
>
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
i
.
id
})}
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
,
marginVertical
:
5
}}
>
<
View
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
12
,
textAlign
:
'center'
,
paddingHorizontal
:
5
}}
>
Lihat
Detail
Pemesanan
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
12
}}
><
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
12
}}
>
{
i
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
)
:
(
)
:
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
i
.
type
==
2
?
(
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
TouchableOpacity
key
=
{
k
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
i
.
id
})}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
outlet
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
trans_type_display
}
<
/Text
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Order Detail'
,
{
idTrans
:
i
.
id
})}
>
<
View
style
=
{{
height
:
40
,
borderRadius
:
10
,
backgroundColor
:
'#CFB368'
,
justifyContent
:
'center'
,
marginVertical
:
5
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
12
,
textAlign
:
'center'
,
paddingHorizontal
:
5
}}
>
Lihat
Detail
Pemesanan
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
12
}}
>
{
i
.
trans_status_display
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
/View
>
<
View
>
<
/TouchableOpacity
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
12
}}
><
/Text
>
)
:
i
.
type
==
3
?
(
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
i
.
point_add
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
:
)
i
.
type
==
4
?
(
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
i
.
point_add
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
:
i
.
type
==
5
?
(
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
i
.
point_reduce
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>-
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
:
i
.
type
==
6
?
(
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
i
.
point_add
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
:
(
<
View
style
=
{{
marginTop
:
5
}}
key
=
{
k
}
>
<
View
style
=
{{
flex
:
2
,
height
:
120
,
margin
:
5
,
borderRadius
:
5
,
borderWidth
:
1
,
borderColor
:
'#838383'
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1.1
,
justifyContent
:
'center'
,
margin
:
10
}}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
i
.
type_display
}
<
/Text
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
,
fontSize
:
12
,
margin
:
2
}}
>
{
moment
(
i
.
trans_time
).
format
(
"DD MMMM YYYY, hh:mm A"
)}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
0.9
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
margin
:
10
,
marginLeft
:
15
,
borderLeftWidth
:
1
,
borderColor
:
'#838383'
}}
>
<
View
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
i
.
point_reduce
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
}}
>-
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
))
))
))
))
...
...
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