Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eCartPro-Customer
Project
Project
Details
Activity
Releases
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
Dida Adams Arizona
eCartPro-Customer
Commits
d8553111
Commit
d8553111
authored
Jul 22, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updare oder
parent
44e1c06e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
362 additions
and
42 deletions
+362
-42
CheckOutScreen.js
App/Containers/CheckOutScreen.js
+217
-34
DeliveryScreen.js
App/Containers/DeliveryScreen.js
+64
-0
PaymentMethodScreen.js
App/Containers/PaymentMethodScreen.js
+58
-6
DeliveryScreenStyle.js
App/Containers/Styles/DeliveryScreenStyle.js
+6
-0
PaymentMethodScreenStyle.js
App/Containers/Styles/PaymentMethodScreenStyle.js
+10
-1
icon_check.png
App/Images/Icons/icon_check.png
+0
-0
icon_coupon.png
App/Images/Icons/icon_coupon.png
+0
-0
icon_info.png
App/Images/Icons/icon_info.png
+0
-0
icon_pembayaran.png
App/Images/Icons/icon_pembayaran.png
+0
-0
icon_rewardsoutline.png
App/Images/Icons/icon_rewardsoutline.png
+0
-0
AppNavigation.js
App/Navigation/AppNavigation.js
+2
-0
Images.js
App/Themes/Images.js
+5
-1
No files found.
App/Containers/CheckOutScreen.js
View file @
d8553111
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
View
,
TouchableOpacity
,
Image
}
from
'react-native'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
View
,
TouchableOpacity
,
Image
,
AsyncStorage
,
Switch
,
BackHandler
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// import YourActions from '../Redux/YourRedux'
...
@@ -12,74 +12,257 @@ import { Images } from '../Themes'
...
@@ -12,74 +12,257 @@ import { Images } from '../Themes'
import
BaseText
from
'../Components/BaseText'
import
BaseText
from
'../Components/BaseText'
import
{
titleCase
,
formatRp
}
from
'../Lib/Utils'
import
{
titleCase
,
formatRp
}
from
'../Lib/Utils'
import
FontAwesome
from
'react-native-vector-icons/FontAwesome'
import
FontAwesome
from
'react-native-vector-icons/FontAwesome'
import
Constant
from
'../Lib/Constant'
import
BaseButton
from
'../Components/BaseButton'
import
Api
from
'../Services/Api'
import
{
NavigationEvents
}
from
'react-navigation'
class
CheckOutScreen
extends
Component
{
class
CheckOutScreen
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
loading
:
false
loading
:
false
,
currency
:
''
,
switch
:
false
,
address
:
{},
dataCheckout
:
[],
totalCheckout
:
0
,
}
}
}
}
componentDidMount
(){
let
params
=
this
.
props
.
navigation
.
state
.
params
==
undefined
?
null
:
this
.
props
.
navigation
.
state
.
params
if
(
params
!=
null
)
{
this
.
setState
({
dataCheckout
:
params
.
dataCheckout
},
()
=>
{
this
.
getTotalCheckout
()
})
}
this
.
getAddress
()
this
.
getCurrency
()
BackHandler
.
addEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
}
backAction
=
()
=>
{
this
.
props
.
navigation
.
goBack
()
return
true
;
};
componentWillUnmount
()
{
BackHandler
.
removeEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
}
getAddress
()
{
Api
.
create
().
getAddress
().
then
((
response
)
=>
{
let
address
=
{}
if
(
response
.
data
.
status
==
'success'
)
{
let
data
=
response
.
data
.
data
data
.
map
((
item
,
index
)
=>
{
if
(
item
.
select_status
==
1
)
{
address
=
item
}
})
}
else
{
address
=
null
}
this
.
setState
({
address
})
})
}
refreshScreen
()
{
this
.
getAddress
()
this
.
getCurrency
()
}
async
getCurrency
()
{
let
currency
=
await
AsyncStorage
.
getItem
(
Constant
.
GLOBAL_CURRENCY
)
this
.
setState
({
currency
})
}
getTotalCheckout
()
{
let
totalCheckout
=
0
this
.
state
.
dataCheckout
.
map
((
item
,
index
)
=>
{
totalCheckout
+=
item
.
total_price
})
this
.
setState
({
totalCheckout
})
}
render
()
{
render
()
{
return
(
return
(
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#4cc9f0'
}}
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#4cc9f0'
}}
>
<
NavigationEvents
onDidFocus
=
{()
=>
this
.
refreshScreen
()}
/
>
<
BaseHeader
onBackPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
leftText
=
{
'Atur Pesanan'
}
/
>
<
BaseHeader
onBackPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
leftText
=
{
'Atur Pesanan'
}
/
>
{
this
.
state
.
loading
?
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
,
borderTopLeftRadius
:
32
,
borderTopRightRadius
:
32
}}
>
{
this
.
state
.
loading
?
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
,
borderTopLeftRadius
:
32
,
borderTopRightRadius
:
32
}}
>
<
BarIndicator
count
=
{
5
}
color
=
'#4cc9f0'
size
=
{
25
}
/
>
<
BarIndicator
count
=
{
5
}
color
=
'#4cc9f0'
size
=
{
25
}
/
>
<
/View>
:
<
/View>
:
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
style
=
{[
styles
.
scrollContent
,
{
zIndex
:
1
}]}
>
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
style
=
{[
styles
.
scrollContent
,
{
zIndex
:
1
}]}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingVertical
:
20
,
paddingHorizontal
:
20
}}
>
<
View
style
=
{{
alignItems
:
'center'
,
justifyContent
:
'center'
,}}
>
<
Image
source
=
{
Images
.
mapgray
}
style
=
{{
width
:
25
,
height
:
30
,
resizeMode
:
'stretch'
,
marginLeft
:
10
}}
/
>
<
/View
>
<
View
style
=
{{
paddingLeft
:
10
,
flexGrow
:
1
,
justifyContent
:
'center'
,}}
>
<
BaseText
text
=
{
"Alamat Pengiriman"
}
type
=
{
"bold"
}
/
>
<
/View
>
<
/View
>
<
View
>
<
View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingVertical
:
20
,
paddingHorizontal
:
20
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingVertical
:
20
,
paddingHorizontal
:
20
}}
>
<
View
style
=
{{
alignItems
:
'center'
,
justifyContent
:
'center'
,}}
>
<
View
style
=
{{
alignItems
:
'center'
,
justifyContent
:
'center'
,}}
>
<
Image
source
=
{
Images
.
icon_pesanansaya_gray
}
style
=
{{
width
:
25
,
height
:
30
,
resizeMode
:
'stretch'
,
marginLeft
:
10
}}
/
>
<
Image
source
=
{
Images
.
mapgray
}
style
=
{{
width
:
25
,
height
:
30
,
resizeMode
:
'stretch'
,
marginLeft
:
10
}}
/
>
<
/View
>
<
View
style
=
{{
paddingLeft
:
10
,
flexGrow
:
1
,
justifyContent
:
'center'
,}}
>
<
BaseText
text
=
{
"Alamat Pengiriman"
}
type
=
{
"bold"
}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
padding
:
20
,
borderTopColor
:
'#e0e0e0'
,
borderTopWidth
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,}}
>
<
View
style
=
{{
width
:
'80%'
}}
>
<
BaseText
text
=
{
"Alamat Pengiriman"
}
type
=
{
"regular"
}
style
=
{{
fontSize
:
10
,
color
:
'#4b4b4b'
,
opacity
:
.
7
}}
/
>
<
BaseText
text
=
{
`
${
this
.
state
.
address
.
receiver_name
}
(
${
this
.
state
.
address
.
type_address
}
)\n
${
this
.
state
.
address
.
receiver_phone
}
`
}
type
=
{
"bold"
}
style
=
{{
fontSize
:
12
,
color
:
'#4b4b4b'
,
opacity
:
.
9
,
marginVertical
:
5
}}
/
>
<
BaseText
text
=
{
`
${
this
.
state
.
address
.
address
}
,
${
this
.
state
.
address
.
kelurahan_name
}
,
${
this
.
state
.
address
.
kecamatan_name
}
,
${
this
.
state
.
address
.
kabupaten_kota_name
}
,
${
this
.
state
.
address
.
provinsi_name
}
${
this
.
state
.
address
.
kode_pos
}
`
}
type
=
{
"regular"
}
style
=
{{
fontSize
:
11
,
color
:
'#4b4b4b'
,
opacity
:
1
}}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
paddingLeft
:
10
,
flexGrow
:
1
}}
>
<
View
style
=
{{
width
:
'20%'
,
flexGrow
:
1
}}
>
<
BaseText
text
=
{
"Paket 1"
}
type
=
{
"bold"
}
/
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'ListAddressScreen'
)}
style
=
{{
alignItems
:
'center'
,
borderColor
:
'#4cc9f0'
,
borderWidth
:
1
,
paddingVertical
:
5
,
borderRadius
:
5
}}
>
<
BaseText
text
=
{
"Dijual oleh e-CartPro"
}
type
=
{
"regular"
}
style
=
{{
opacity
:
.
8
}}
/
>
<
BaseText
text
=
{
'Ganti'
}
type
=
{
'bold'
}
style
=
{{
fontSize
:
12
,
color
:
'#4cc9f0'
}}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
padding
:
20
,
borderTopColor
:
'#ececec'
,
borderTopWidth
:
1
,
backgroundColor
:
'#f5f5f5'
}}
>
<
View
style
=
{{
height
:
10
,
width
:
'100%'
,
backgroundColor
:
'#e0e0e0'
}}
/
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
/View
>
<
View
style
=
{{
width
:
'25%'
,
alignItems
:
'center'
,
justifyContent
:
'center'
}}
>
<
Image
source
=
{
Images
.
jaket
}
style
=
{{
width
:
75
,
height
:
75
,
resizeMode
:
'cover'
,
borderRadius
:
10
}}
/
>
{
/* Product */
}
{
this
.
state
.
dataCheckout
.
map
((
item
,
index
)
=>
{
return
(
<
View
key
=
{
index
}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingVertical
:
20
,
paddingHorizontal
:
20
}}
>
<
View
style
=
{{
alignItems
:
'center'
,
justifyContent
:
'center'
,}}
>
<
Image
source
=
{
Images
.
icon_pesanansaya_gray
}
style
=
{{
width
:
25
,
height
:
30
,
resizeMode
:
'stretch'
,
marginLeft
:
10
}}
/
>
<
/View
>
<
View
style
=
{{
paddingLeft
:
10
,
flexGrow
:
1
}}
>
<
BaseText
text
=
{
"Paket 1"
}
type
=
{
"bold"
}
/
>
<
BaseText
text
=
{
"Dijual oleh e-CartPro"
}
type
=
{
"regular"
}
style
=
{{
opacity
:
.
8
}}
/
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
marginLeft
:
5
,
flexDirection
:
'column'
,
justifyContent
:
'space-between'
,
flexGrow
:
1
,
width
:
'70%
'
}}
>
<
View
style
=
{{
padding
:
20
,
borderTopColor
:
'#ececec'
,
borderTopWidth
:
1
,
backgroundColor
:
'#f5f5f5
'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginLeft
:
5
}}
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
View
style
=
{{
width
:
'
60%
'
}}
>
<
View
style
=
{{
width
:
'
25%'
,
alignItems
:
'center'
,
justifyContent
:
'center
'
}}
>
<
BaseText
text
=
{
titleCase
(
'Iniiiii'
)}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
6
}}
/
>
<
Image
source
=
{{
uri
:
item
.
varient_image
}}
style
=
{{
width
:
75
,
height
:
75
,
resizeMode
:
'cover'
,
borderRadius
:
10
}}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
alignItems
:
'flex-end'
,
width
:
'40%'
,
flexGrow
:
1
}}
>
<
View
style
=
{{
marginLeft
:
5
,
flexDirection
:
'column'
,
justifyContent
:
'space-between'
,
flexGrow
:
1
,
width
:
'70%'
}}
>
<
BaseText
text
=
{
"x1"
}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
,
color
:
'gray'
}}
/
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
width
:
'60%'
}}
>
<
BaseText
text
=
{
titleCase
(
item
.
product_name
)}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
6
}}
/
>
<
/View
>
<
View
style
=
{{
alignItems
:
'flex-end'
,
width
:
'40%'
,
flexGrow
:
1
}}
>
<
BaseText
text
=
{
`x
${
item
.
quantity
}
`
}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
,
color
:
'gray'
}}
/
>
<
/View
>
<
/View
>
<
View
>
<
BaseText
text
=
{
String
(
formatRp
(
this
.
state
.
currency
,
item
.
total_price
))}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
5
,
color
:
'gray'
}}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
>
<
/View
>
<
BaseText
text
=
{
String
(
formatRp
(
'Rp'
,
200000
))}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
5
,
color
:
'gray'
}}
/
>
<
View
style
=
{{
borderTopColor
:
'#4cc9f0'
,
borderTopWidth
:
1
,
borderBottomWidth
:
1
,
borderBottomColor
:
'#4cc9f0'
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'DeliveryScreen'
)}
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
20
,
backgroundColor
:
'rgba(76, 201, 240, .2)'
}}
>
<
BaseText
type
=
{
'regular'
}
text
=
{
'Opsi Pengiriman'
}
/
>
<
FontAwesome
name
=
{
'angle-right'
}
size
=
{
20
}
/
>
<
/TouchableOpacity
>
<
View
style
=
{{
padding
:
20
,
borderTopColor
:
'#e0e0e0'
,
borderTopWidth
:
1
,
backgroundColor
:
'rgba(76, 201, 240, .2)'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,}}
>
<
BaseText
text
=
{
'Reguler'
}
type
=
{
'bold'
}
/
>
<
BaseText
text
=
{
'Akan diterima pada tanggal 27 Mei - 30 Mei 2020'
}
type
=
{
'italic'
}
style
=
{{
fontSize
:
10
,
color
:
'gray'
}}
/
>
<
/View
>
<
BaseText
text
=
{
'Anter Aja'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
6
,
fontSize
:
12
,
marginTop
:
5
}}
/
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
marginTop
:
10
}}
>
<
BaseText
text
=
{
'Biaya Pengiriman'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
6
,
fontSize
:
12
}}
/
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
View
>
<
Image
source
=
{
Images
.
icon_freedeliv
}
style
=
{{
width
:
60
,
height
:
26
,
resizeMode
:
'stretch'
}}
/
>
<
/View
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
10000
)}
type
=
{
'regular'
}
style
=
{{
fontSize
:
10
,
color
:
'gray'
,
textDecorationLine
:
'line-through'
,
marginLeft
:
5
}}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
20
}}
>
<
BaseText
text
=
{
'Total Pesanan'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
9
}}
/
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
item
.
price
)}
type
=
{
'bold'
}
style
=
{{
color
:
'#4cc9f0'
}}
/
>
<
/View
>
<
View
style
=
{{
height
:
10
,
width
:
'100%'
,
backgroundColor
:
'#e0e0e0'
}}
/
>
<
/View
>
)
})}
{
/* Kupon and Rewards */
}
<
View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
20
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Image
source
=
{
Images
.
icon_coupon
}
style
=
{{
width
:
30
,
height
:
20
,
resizeMode
:
'stretch'
}}
/
>
<
BaseText
text
=
{
'Gunakan Kupon Belanja'
}
style
=
{{
marginLeft
:
10
,
fontSize
:
12
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Image
source
=
{
Images
.
icon_check
}
style
=
{{
height
:
20
,
width
:
20
,
marginRight
:
15
}}
/
>
<
FontAwesome
name
=
{
'angle-right'
}
size
=
{
20
}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
borderTopColor
:
'#e0e0e0'
,
borderTopWidth
:
1
,
padding
:
20
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
20
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
BaseText
type
=
{
'regular'
}
text
=
{
'Opsi Pengiriman'
}
/
>
<
View
style
=
{{
width
:
30
,
alignItems
:
'center'
,}}
>
<
FontAwesome
name
=
{
'angle-right'
}
size
=
{
25
}
/
>
<
Image
source
=
{
Images
.
icon_rewards
}
style
=
{{
width
:
20
,
height
:
25
,
resizeMode
:
'stretch'
}}
/
>
<
/View
>
<
BaseText
text
=
{
'Gunakan Rewards'
}
style
=
{{
marginLeft
:
10
,
fontSize
:
12
}}
/
>
<
Image
source
=
{
Images
.
icon_info
}
style
=
{{
width
:
15
,
height
:
15
,
resizeMode
:
'stretch'
,
marginLeft
:
5
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Switch
style
=
{{
marginRight
:
-
10
}}
trackColor
=
{{
false
:
"#767577"
,
true
:
"#d8d8d8"
}}
thumbColor
=
{
this
.
state
.
switch
?
"green"
:
"#f4f3f4"
}
ios_backgroundColor
=
"#3e3e3e"
onValueChange
=
{(
e
)
=>
this
.
setState
({
switch
:
e
})}
value
=
{
this
.
state
.
switch
}
/
>
<
/View
>
<
/View
>
<
View
style
=
{{
padding
:
20
,
borderTopColor
:
'#ececec'
,
borderTopWidth
:
1
}}
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,}}
>
<
View
style
=
{{
height
:
10
,
width
:
'100%'
,
backgroundColor
:
'#e0e0e0'
}}
/
>
<
BaseText
text
=
{
'Reguler'
}
type
=
{
'regular'
}
/
>
<
/View
>
<
BaseText
text
=
{
'Akan diterima pada tanggal 27 Mei - 30 Mei 2020'
}
type
=
{
'italic'
}
style
=
{{
fontSize
:
10
}}
/
>
{
/* Metode Pembayaran */
}
<
View
>
<
View
style
=
{{
padding
:
20
}}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'PaymentMethodScreen'
)}
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
Image
source
=
{
Images
.
icon_pembayaran
}
style
=
{{
width
:
30
,
height
:
20
,
resizeMode
:
'stretch'
}}
/
>
<
BaseText
text
=
{
'Pilih Metode Pembayaran'
}
style
=
{{
marginLeft
:
10
,
fontSize
:
12
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
}}
>
<
FontAwesome
name
=
{
'angle-right'
}
size
=
{
20
}
/
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
BaseText
text
=
{
'Pembayaran menggunakan metode COD'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
6
,
fontSize
:
12
,
marginTop
:
10
}}
/
>
<
/View
>
<
View
style
=
{{
borderTopColor
:
'#e0e0e0'
,
borderTopWidth
:
1
,
padding
:
20
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
BaseText
text
=
{
'Subtotal Produk'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
this
.
state
.
totalCheckout
)}
type
=
{
'bold'
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
BaseText
text
=
{
'Subtotal Pengiriman'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
0
)}
type
=
{
'bold'
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
BaseText
text
=
{
'Total Pembayaran'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
9
}}
/
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
this
.
state
.
totalCheckout
)}
type
=
{
'bold'
}
style
=
{{
color
:
'#4cc9f0'
}}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{{
height
:
10
,
width
:
'100%'
,
backgroundColor
:
'#e0e0e0'
}}
/
>
<
/View
>
<
/View
>
<
/ScrollView>
}
<
/ScrollView>
}
<
View
style
=
{{
padding
:
20
,
alignSelf
:
'flex-end'
,
justifyContent
:
'flex-end'
,
backgroundColor
:
'white'
,
elevation
:
5
,
width
:
'100%'
,
borderTopWidth
:
1
,
borderTopColor
:
'#d8d8d8'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
width
:
'60%'
}}
>
<
BaseText
text
=
{
"Total"
}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
this
.
state
.
totalCheckout
)}
type
=
{
"bold"
}
style
=
{{
opacity
:
.
8
,
color
:
'#4cc9f0'
}}
/
>
<
/View
>
<
View
style
=
{{
width
:
'40%'
}}
>
<
BaseButton
text
=
{
'Buat Pesanan'
}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'CheckOutScreen'
)}
fontSizeText
=
{
14
}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
)
}
}
...
...
App/Containers/DeliveryScreen.js
0 → 100644
View file @
d8553111
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
BackHandler
,
View
}
from
'react-native'
import
{
connect
}
from
'react-redux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// Styles
import
styles
from
'./Styles/DeliveryScreenStyle'
import
{
NavigationEvents
}
from
'react-navigation'
;
import
BaseHeader
from
'../Components/BaseHeader'
;
import
{
BarIndicator
}
from
'react-native-indicators'
;
import
BaseButton
from
'../Components/BaseButton'
;
class
DeliveryScreen
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
loading
:
false
}
}
componentDidMount
()
{
BackHandler
.
addEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
}
backAction
=
()
=>
{
this
.
props
.
navigation
.
goBack
()
return
true
;
};
componentWillUnmount
()
{
BackHandler
.
removeEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
}
render
()
{
return
(
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#4cc9f0'
}}
>
{
/* <NavigationEvents onDidFocus={() => this.refreshScreen()}/> */
}
<
BaseHeader
onBackPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
leftText
=
{
'Opsi Pengiriman'
}
/
>
{
this
.
state
.
loading
?
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
,
borderTopLeftRadius
:
32
,
borderTopRightRadius
:
32
}}
>
<
BarIndicator
count
=
{
5
}
color
=
'#4cc9f0'
size
=
{
25
}
/
>
<
/View>
:
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
style
=
{[
styles
.
scrollContent
,
{
zIndex
:
1
}]}
>
<
/ScrollView>
}
<
View
style
=
{{
padding
:
20
,
alignSelf
:
'flex-end'
,
justifyContent
:
'flex-end'
,
backgroundColor
:
'white'
,
elevation
:
5
,
width
:
'100%'
,
borderTopWidth
:
1
,
borderTopColor
:
'#d8d8d8'
}}
>
<
BaseButton
text
=
{
'Tetapkan'
}
onPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
fontSizeText
=
{
14
}
/
>
<
/View
>
<
/View
>
)
}
}
const
mapStateToProps
=
(
state
)
=>
{
return
{
}
}
const
mapDispatchToProps
=
(
dispatch
)
=>
{
return
{
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
DeliveryScreen
)
App/Containers/PaymentMethodScreen.js
View file @
d8553111
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
}
from
'react-native'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
BackHandler
,
View
,
AsyncStorage
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
{
connect
}
from
'react-redux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
// import YourActions from '../Redux/YourRedux'
// Styles
// Styles
import
styles
from
'./Styles/PaymentMethodScreenStyle'
import
styles
from
'./Styles/PaymentMethodScreenStyle'
import
{
NavigationEvents
}
from
'react-navigation'
;
import
BaseHeader
from
'../Components/BaseHeader'
;
import
{
BarIndicator
}
from
'react-native-indicators'
;
import
BaseButton
from
'../Components/BaseButton'
;
import
BaseText
from
'../Components/BaseText'
;
import
{
formatRp
}
from
'../Lib/Utils'
;
import
Constant
from
'../Lib/Constant'
;
class
PaymentMethodScreen
extends
Component
{
class
PaymentMethodScreen
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
loading
:
false
,
currency
:
''
}
}
componentDidMount
()
{
this
.
getCurrency
()
BackHandler
.
addEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
}
backAction
=
()
=>
{
this
.
props
.
navigation
.
goBack
()
return
true
;
};
componentWillUnmount
()
{
BackHandler
.
removeEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
}
async
getCurrency
()
{
let
currency
=
await
AsyncStorage
.
getItem
(
Constant
.
GLOBAL_CURRENCY
)
this
.
setState
({
currency
})
}
render
()
{
render
()
{
return
(
return
(
<
ScrollView
style
=
{
styles
.
container
}
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#4cc9f0'
}}
>
<
KeyboardAvoidingView
behavior
=
'position'
>
{
/* <NavigationEvents onDidFocus={() => this.refreshScreen()}/> */
}
<
Text
>
PaymentMethodScreen
<
/Text
>
<
BaseHeader
onBackPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
leftText
=
{
'Metode Pembayaran'
}
/
>
<
/KeyboardAvoidingView
>
<
View
style
=
{[
styles
.
scrollContent
]}
>
<
/ScrollView
>
<
BaseText
type
=
{
'bold'
}
text
=
{
'Payment'
}
/
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
marginTop
:
10
}}
>
<
BaseText
text
=
{
'Order Amount'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
BaseText
text
=
{
formatRp
(
this
.
state
.
currency
,
2400000
)}
type
=
{
'bold'
}
style
=
{{
opacity
:
.
5
,
fontSize
:
12
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
}}
>
<
BaseText
text
=
{
'Use'
}
type
=
{
'regular'
}
style
=
{{
opacity
:
.
7
,
fontSize
:
12
}}
/
>
<
/View
>
<
/View
>
{
this
.
state
.
loading
?
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
,
borderTopLeftRadius
:
32
,
borderTopRightRadius
:
32
}}
>
<
BarIndicator
count
=
{
5
}
color
=
'#4cc9f0'
size
=
{
25
}
/
>
<
/View>
:
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
}}
>
<
/ScrollView>
}
<
View
style
=
{{
padding
:
20
,
alignSelf
:
'flex-end'
,
justifyContent
:
'flex-end'
,
backgroundColor
:
'white'
,
elevation
:
5
,
width
:
'100%'
,
borderTopWidth
:
1
,
borderTopColor
:
'#d8d8d8'
}}
>
<
BaseButton
text
=
{
'Tetapkan'
}
onPress
=
{()
=>
this
.
props
.
navigation
.
goBack
()}
fontSizeText
=
{
14
}
/
>
<
/View
>
<
/View
>
)
)
}
}
}
}
...
...
App/Containers/Styles/DeliveryScreenStyle.js
0 → 100644
View file @
d8553111
import
{
StyleSheet
}
from
'react-native'
import
{
ApplicationStyles
}
from
'../../Themes/'
export
default
StyleSheet
.
create
({
...
ApplicationStyles
.
screen
})
App/Containers/Styles/PaymentMethodScreenStyle.js
View file @
d8553111
...
@@ -2,5 +2,14 @@ import { StyleSheet } from 'react-native'
...
@@ -2,5 +2,14 @@ import { StyleSheet } from 'react-native'
import
{
ApplicationStyles
}
from
'../../Themes/'
import
{
ApplicationStyles
}
from
'../../Themes/'
export
default
StyleSheet
.
create
({
export
default
StyleSheet
.
create
({
...
ApplicationStyles
.
screen
...
ApplicationStyles
.
screen
,
scrollContent
:
{
paddingVertical
:
20
,
backgroundColor
:
'white'
,
borderTopLeftRadius
:
32
,
borderTopRightRadius
:
32
,
paddingHorizontal
:
25
,
borderBottomWidth
:
1
,
borderBottomColor
:
'#e0e0e0'
},
})
})
App/Images/Icons/icon_check.png
0 → 100644
View file @
d8553111
1.34 KB
App/Images/Icons/icon_coupon.png
0 → 100644
View file @
d8553111
798 Bytes
App/Images/Icons/icon_info.png
0 → 100644
View file @
d8553111
873 Bytes
App/Images/Icons/icon_pembayaran.png
0 → 100644
View file @
d8553111
769 Bytes
App/Images/Icons/icon_rewardsoutline.png
0 → 100644
View file @
d8553111
1.66 KB
App/Navigation/AppNavigation.js
View file @
d8553111
import
{
createAppContainer
}
from
'react-navigation'
import
{
createAppContainer
}
from
'react-navigation'
import
DeliveryScreen
from
'../Containers/DeliveryScreen'
import
DetailProductScreen
from
'../Containers/DetailProductScreen'
import
DetailProductScreen
from
'../Containers/DetailProductScreen'
import
ComplainOrderScreen
from
'../Containers/ComplainOrderScreen'
import
ComplainOrderScreen
from
'../Containers/ComplainOrderScreen'
import
ForgotPasswordScreen
from
'../Containers/ForgotPasswordScreen'
import
ForgotPasswordScreen
from
'../Containers/ForgotPasswordScreen'
...
@@ -43,6 +44,7 @@ import HomeNavigation from './HomeNavigation'
...
@@ -43,6 +44,7 @@ import HomeNavigation from './HomeNavigation'
// Manifest of possible screens
// Manifest of possible screens
const
PrimaryNav
=
createStackNavigator
({
const
PrimaryNav
=
createStackNavigator
({
DeliveryScreen
:
{
screen
:
DeliveryScreen
},
DetailProductScreen
:
{
screen
:
DetailProductScreen
},
DetailProductScreen
:
{
screen
:
DetailProductScreen
},
ComplainOrderScreen
:
{
screen
:
ComplainOrderScreen
},
ComplainOrderScreen
:
{
screen
:
ComplainOrderScreen
},
ForgotPasswordScreen
:
{
screen
:
ForgotPasswordScreen
},
ForgotPasswordScreen
:
{
screen
:
ForgotPasswordScreen
},
...
...
App/Themes/Images.js
View file @
d8553111
...
@@ -46,7 +46,11 @@ const images = {
...
@@ -46,7 +46,11 @@ const images = {
icon_wishlistgray
:
require
(
'../Images/Icons/icon_wishlistgray.png'
),
icon_wishlistgray
:
require
(
'../Images/Icons/icon_wishlistgray.png'
),
icon_sharegray
:
require
(
'../Images/Icons/icon_sharegray.png'
),
icon_sharegray
:
require
(
'../Images/Icons/icon_sharegray.png'
),
icon_chat
:
require
(
'../Images/Icons/icon_chat.png'
),
icon_chat
:
require
(
'../Images/Icons/icon_chat.png'
),
icon_rewardsoutline
:
require
(
'../Images/Icons/icon_rewardsoutline.png'
),
icon_info
:
require
(
'../Images/Icons/icon_info.png'
),
icon_coupon
:
require
(
'../Images/Icons/icon_coupon.png'
),
icon_check
:
require
(
'../Images/Icons/icon_check.png'
),
icon_pembayaran
:
require
(
'../Images/Icons/icon_pembayaran.png'
),
// big image
// big image
letter
:
require
(
'../Images/letter.png'
),
letter
:
require
(
'../Images/letter.png'
),
...
...
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