Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InvestCustomer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Giang Tran
InvestCustomer
Commits
26a17b11
Commit
26a17b11
authored
May 14, 2021
by
Nguyễn Thị Thúy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
escrow UI
parent
a1b0df08
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
420 additions
and
233 deletions
+420
-233
build.gradle
android/app/build.gradle
+2
-4
EscrowCalculator.js
src/Screens/EscrowCalculator/EscrowCalculator.js
+16
-0
EscrowCalculatorView.js
src/Screens/EscrowCalculator/EscrowCalculatorView.js
+150
-0
PriceListView.js
src/Screens/Home/PriceListView.js
+2
-2
colors.js
src/assets/colors.js
+1
-0
InputMoney.js
src/components/Input/InputMoney.js
+5
-5
PickerItem.js
src/components/Picker/PickerItem.js
+226
-222
en.js
src/helper/i18/locales/en.js
+6
-0
vn.js
src/helper/i18/locales/vn.js
+6
-0
ScreenNames.js
src/routers/ScreenNames.js
+1
-0
StackNavigation.js
src/routers/StackNavigation.js
+5
-0
No files found.
android/app/build.gradle
View file @
26a17b11
...
@@ -132,7 +132,7 @@ android {
...
@@ -132,7 +132,7 @@ android {
applicationId
"com.dcv.invest"
applicationId
"com.dcv.invest"
minSdkVersion
rootProject
.
ext
.
minSdkVersion
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
4
versionCode
5
versionName
"1.3"
versionName
"1.3"
vectorDrawables
.
useSupportLibrary
=
true
vectorDrawables
.
useSupportLibrary
=
true
}
}
...
@@ -167,7 +167,7 @@ android {
...
@@ -167,7 +167,7 @@ android {
// see https://facebook.github.io/react-native/docs/signed-apk-android.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig
signingConfigs
.
release
signingConfig
signingConfigs
.
release
minifyEnabled
enableProguardInReleaseBuilds
minifyEnabled
enableProguardInReleaseBuilds
debuggable
tru
e
debuggable
fals
e
proguardFiles
getDefaultProguardFile
(
"proguard-android.txt"
),
"proguard-rules.pro"
proguardFiles
getDefaultProguardFile
(
"proguard-android.txt"
),
"proguard-rules.pro"
}
}
}
}
...
@@ -242,4 +242,3 @@ task copyDownloadableDepsToLibs(type: Copy) {
...
@@ -242,4 +242,3 @@ task copyDownloadableDepsToLibs(type: Copy) {
apply
plugin:
'com.google.gms.google-services'
apply
plugin:
'com.google.gms.google-services'
apply
from:
file
(
"../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"
);
applyNativeModulesAppBuildGradle
(
project
)
apply
from:
file
(
"../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"
);
applyNativeModulesAppBuildGradle
(
project
)
\ No newline at end of file
src/Screens/EscrowCalculator/EscrowCalculator.js
0 → 100644
View file @
26a17b11
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
EscrowCalculatorView
from
'./EscrowCalculatorView'
;
const
EscrowCalculator
=
(
props
)
=>
{
const
[
dataProduct
,
setDataProduct
]
=
useState
([])
const
setProduct
=
(
item
)
=>
{
}
return
(
<
EscrowCalculatorView
dataProduct
=
{
dataProduct
}
setProduct
=
{
setProduct
}
/
>
);
};
export
default
EscrowCalculator
;
src/Screens/EscrowCalculator/EscrowCalculatorView.js
0 → 100644
View file @
26a17b11
import
React
from
'react'
;
import
{
StyleSheet
,
Text
,
TouchableOpacity
,
View
}
from
'react-native'
;
import
HeaderBack
from
'../../components/Header/HeaderBack'
;
import
{
getFontXD
,
getWidth
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
import
I18n
from
'../../helper/i18/i18n'
;
import
PickerItem
from
'../../components/Picker/PickerItem'
;
import
TextMoney
from
'../../components/Input/InputMoney'
;
import
{
ADDMETHODPAY
}
from
'../../routers/ScreenNames'
;
import
Icon
from
'react-native-vector-icons/Entypo'
;
const
EscrowCalculatorView
=
(
props
)
=>
{
return
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'column'
,
backgroundColor
:
'white'
}}
>
<
HeaderBack
title
=
{
'EscrowCalculator'
}
isWhite
=
{
true
}
/
>
<
View
style
=
{
styles
.
viewInput
}
>
<
Text
style
=
{
styles
.
textTitle
}
>
{
I18n
.
t
(
'Product'
)}
<
/Text
>
<
PickerItem
data
=
{
props
.
dataProduct
}
onValueChange
=
{(
value
,
item
)
=>
{
props
.
setProduct
(
item
);
}}
iconSize
=
{
WIDTHXD
(
40
)}
iconColor
=
{
R
.
colors
.
black
}
/
>
<
TextMoney
onChangeText
=
{(
val
)
=>
{
}}
title
=
{
I18n
.
t
(
'LotTransactionNumber'
)}
value
=
{
1000
}
titleStyle
=
{{
color
:
R
.
colors
.
black
,
marginTop
:
HEIGHTXD
(
20
),
fontSize
:
getFontXD
(
39
)}}
/
>
<
TextMoney
onChangeText
=
{(
val
)
=>
{
}}
title
=
{
I18n
.
t
(
'FirstEscrow'
)}
value
=
{
1000
}
titleStyle
=
{{
color
:
R
.
colors
.
black
,
fontSize
:
getFontXD
(
39
)}}
editable
=
{
false
}
inputStyle
=
{{
backgroundColor
:
R
.
colors
.
gray7
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'flex-end'
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{
styles
.
containerBtn
}
>
<
Icon
name
=
{
'plus'
}
size
=
{
27
}
color
=
{
R
.
colors
.
white
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{{
paddingHorizontal
:
WIDTHXD
(
60
)}}
>
<
TextMoney
onChangeText
=
{(
val
)
=>
{
}}
title
=
{
I18n
.
t
(
'FirstEscrow'
)}
value
=
{
1000
}
titleStyle
=
{{
color
:
R
.
colors
.
black
,
marginTop
:
HEIGHTXD
(
180
),
fontSize
:
getFontXD
(
39
),
}}
/
>
<
TextMoney
onChangeText
=
{(
val
)
=>
{
}}
editable
=
{
false
}
title
=
{
I18n
.
t
(
'FirstEscrowTotal'
)}
value
=
{
1000
}
titleStyle
=
{{
color
:
R
.
colors
.
black
,
marginTop
:
HEIGHTXD
(
20
),
fontSize
:
getFontXD
(
39
)}}
inputStyle
=
{{
backgroundColor
:
R
.
colors
.
gray7
}}
/
>
<
Text
style
=
{
styles
.
textMessage
}
>
B
ạ
n
c
ó
th
ể
giao
d
ị
ch
c
á
c
h
ợ
p
đồ
ng
k
ể
tr
ê
n
v
ớ
i
m
ứ
c
k
ý
qu
ỹ
kh
ả
dung
hi
ệ
n
t
ạ
i
<
/Text
>
<
/View
>
<
View
style
=
{{
width
:
'100%'
,
flexDirection
:
'row'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
position
:
'absolute'
,
bottom
:
HEIGHTXD
(
50
),
}}
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{[
styles
.
btn
,
{
backgroundColor
:
R
.
colors
.
red2
,
marginRight
:
WIDTHXD
(
72
)}]}
>
<
Text
style
=
{
styles
.
txtButton
}
>
{
I18n
.
t
(
'Delete'
)}
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
}}
style
=
{
styles
.
btn
}
>
<
Text
style
=
{
styles
.
txtButton
}
>
{
I18n
.
t
(
'Calculator'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
);
};
export
default
EscrowCalculatorView
;
const
styles
=
StyleSheet
.
create
({
viewInput
:
{
marginHorizontal
:
WIDTHXD
(
36
),
marginTop
:
WIDTHXD
(
69
),
marginBottom
:
WIDTHXD
(
44
),
borderWidth
:
0.3
,
borderColor
:
'#707070'
,
paddingHorizontal
:
WIDTHXD
(
24
),
paddingVertical
:
WIDTHXD
(
24
),
},
textTitle
:
{
fontSize
:
getFontXD
(
39
),
color
:
R
.
colors
.
black
,
},
textMessage
:
{
fontSize
:
getFontXD
(
39
),
color
:
R
.
colors
.
black
,
marginTop
:
HEIGHTXD
(
68
)
},
containerBtn
:
{
marginHorizontal
:
WIDTHXD
(
36
),
backgroundColor
:
R
.
colors
.
main
,
width
:
WIDTHXD
(
144
),
height
:
WIDTHXD
(
144
),
justifyContent
:
'center'
,
alignItems
:
'center'
,
shadowColor
:
'#000'
,
shadowOffset
:
{
width
:
0
,
height
:
2
,
},
shadowOpacity
:
0.25
,
shadowRadius
:
3.84
,
elevation
:
3
,
borderRadius
:
30
,
},
btn
:
{
width
:
WIDTHXD
(
428
),
height
:
HEIGHTXD
(
120
),
justifyContent
:
'center'
,
alignItems
:
'center'
,
backgroundColor
:
R
.
colors
.
main
,
borderRadius
:
5
,
marginBottom
:
HEIGHTXD
(
42
),
},
txtButton
:
{
color
:
R
.
colors
.
white
,
fontSize
:
getFontXD
(
48
),
},
});
src/Screens/Home/PriceListView.js
View file @
26a17b11
...
@@ -11,7 +11,7 @@ import {
...
@@ -11,7 +11,7 @@ import {
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
import
ItemPrice
from
'./ItemPrice'
;
import
ItemPrice
from
'./ItemPrice'
;
import
{
PRODUCTDETAIL
}
from
'../../routers/ScreenNames'
;
import
{
PRODUCTDETAIL
,
ESCROWCALCULATOR
}
from
'../../routers/ScreenNames'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
PriceListView
=
(
props
)
=>
{
const
PriceListView
=
(
props
)
=>
{
...
@@ -74,7 +74,7 @@ const PriceListView = (props) => {
...
@@ -74,7 +74,7 @@ const PriceListView = (props) => {
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View>
}
<
/View>
}
renderItem
=
{({
item
})
=>
<
ItemPrice
item
=
{
item
}
renderItem
=
{({
item
})
=>
<
ItemPrice
item
=
{
item
}
onPress
=
{()
=>
navigate
.
navigate
(
PRODUCTDETAIL
,
{
onPress
=
{()
=>
navigate
.
navigate
(
ESCROWCALCULATOR
,
{
id
:
item
.
id
,
id
:
item
.
id
,
name
:
item
.
name
,
name
:
item
.
name
,
})}
/>
}
})}
/>
}
...
...
src/assets/colors.js
View file @
26a17b11
...
@@ -46,6 +46,7 @@ const colors = {
...
@@ -46,6 +46,7 @@ const colors = {
gray4
:
'#e6e6e6'
,
gray4
:
'#e6e6e6'
,
gray5
:
'rgba(226,232,235, 1)'
,
gray5
:
'rgba(226,232,235, 1)'
,
gray6
:
'#929292'
,
gray6
:
'#929292'
,
gray7
:
'#DBDBDB'
,
orange
:
'#FF9C00'
,
orange
:
'#FF9C00'
,
lightBlue
:
'#1a8cff'
,
lightBlue
:
'#1a8cff'
,
lightBlue1
:
'#008ae6'
,
lightBlue1
:
'#008ae6'
,
...
...
src/components/Input/InputMoney.js
View file @
26a17b11
...
@@ -5,16 +5,16 @@ import R from '../../assets/R';
...
@@ -5,16 +5,16 @@ import R from '../../assets/R';
import
{
toPriceVnd
}
from
'../../Config/Functions'
;
import
{
toPriceVnd
}
from
'../../Config/Functions'
;
const
TextMoney
=
(
props
)
=>
{
const
TextMoney
=
(
props
)
=>
{
const
{
title
,
onChangeText
,
maxLength
,
value
,
editable
}
=
props
;
const
{
title
,
onChangeText
,
maxLength
,
value
,
editable
,
titleStyle
,
inputStyle
}
=
props
;
return
(
return
(
<
View
style
=
{{
marginVertical
:
5
}}
>
<
View
style
=
{{
marginVertical
:
5
}}
>
<
Text
<
Text
style
=
{{
style
=
{
[
{
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
color777
,
color
:
R
.
colors
.
color777
,
marginBottom
:
5
,
marginBottom
:
5
,
}}
>
}
,
titleStyle
&&
titleStyle
]
}
>
{
title
?
title
:
''
}
{
title
?
title
:
''
}
<
/Text
>
<
/Text
>
<
TextInput
<
TextInput
...
@@ -25,7 +25,7 @@ const TextMoney = (props) => {
...
@@ -25,7 +25,7 @@ const TextMoney = (props) => {
value
=
{
toPriceVnd
(
value
)}
value
=
{
toPriceVnd
(
value
)}
keyboardType
=
{
'number-pad'
}
keyboardType
=
{
'number-pad'
}
onChangeText
=
{(
val
)
=>
onChangeText
(
val
.
split
(
','
).
join
(
''
))}
onChangeText
=
{(
val
)
=>
onChangeText
(
val
.
split
(
','
).
join
(
''
))}
style
=
{{
style
=
{
[
{
height
:
HEIGHTXD
(
109
),
height
:
HEIGHTXD
(
109
),
color
:
'black'
,
color
:
'black'
,
borderRadius
:
7
,
borderRadius
:
7
,
...
@@ -43,7 +43,7 @@ const TextMoney = (props) => {
...
@@ -43,7 +43,7 @@ const TextMoney = (props) => {
shadowOpacity
:
0.25
,
shadowOpacity
:
0.25
,
shadowRadius
:
1.84
,
shadowRadius
:
1.84
,
elevation
:
1
,
elevation
:
1
,
}}
}
,
inputStyle
&&
inputStyle
]
}
/
>
/
>
<
/View
>
<
/View
>
);
);
...
...
src/components/Picker/PickerItem.js
View file @
26a17b11
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
import
{
StyleSheet
,
StyleSheet
,
Text
,
Text
,
View
,
View
,
Image
,
Image
,
TouchableOpacity
,
TouchableOpacity
,
TouchableHighlight
,
TouchableHighlight
,
Dimensions
,
Dimensions
,
Platform
,
Platform
,
}
from
'react-native'
;
}
from
'react-native'
;
import
ModalDropdown
from
'react-native-modal-dropdown'
;
import
ModalDropdown
from
'react-native-modal-dropdown'
;
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
import
{
import
{
WIDTHXD
,
WIDTHXD
,
getFontXD
,
getFontXD
,
HEIGHTXD
,
HEIGHTXD
,
getHeight
,
getHeight
,
WIDTHXDICON
,
WIDTHXDICON
,
}
from
'../../Config/Functions'
;
}
from
'../../Config/Functions'
;
import
Icon
from
'react-native-vector-icons/AntDesign'
;
import
Icon
from
'react-native-vector-icons/AntDesign'
;
...
@@ -38,230 +38,234 @@ const data = [];
...
@@ -38,230 +38,234 @@ const data = [];
* other you can make minDate,maxDate... with props of libary react-native-datepicker
* other you can make minDate,maxDate... with props of libary react-native-datepicker
*/
*/
export
default
class
PickerItem
extends
Component
{
export
default
class
PickerItem
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
_button
=
null
;
this
.
_button
=
null
;
this
.
_buttonFrame
=
null
;
this
.
_buttonFrame
=
null
;
this
.
state
=
{
this
.
state
=
{
value
:
''
,
value
:
''
,
showInBottom
:
true
,
showInBottom
:
true
,
};
};
}
}
componentDidMount
()
{
this
.
_dropdown
.
select
(
0
);
}
_dropdownAdjustFrame
=
(
style
)
=>
{
componentDidMount
()
{
const
{
showInBottom
}
=
this
.
state
;
this
.
_dropdown
.
select
(
0
);
// alert(showInBottom);
let
stylez
=
style
;
if
(
!
showInBottom
)
{
stylez
.
height
+=
HEIGHTXD
(
99
)
*
(
6
-
Math
.
min
(
this
.
props
.
data
.
length
,
5
));
}
else
{
stylez
.
height
+=
HEIGHTXD
(
99
);
}
}
// stylez.left += 150;
return
stylez
;
};
_calcPosition
()
{
_dropdownAdjustFrame
=
(
style
)
=>
{
const
{
data
}
=
this
.
props
;
const
{
showInBottom
}
=
this
.
state
;
let
dropdownStyle
=
{
// alert(showInBottom);
// maxHeight: HEIGHTXD(99 * Math.min(data.length, 5)) + (6 - Math.min(data.length, 5)) * HEIGHTXD(105),
let
stylez
=
style
;
maxHeight
:
HEIGHTXD
(
99
*
Math
.
min
(
data
.
length
,
5
)
+
12
),
if
(
!
showInBottom
)
{
stylez
.
height
+=
HEIGHTXD
(
99
)
*
(
6
-
Math
.
min
(
this
.
props
.
data
.
length
,
5
));
}
else
{
stylez
.
height
+=
HEIGHTXD
(
99
);
}
// stylez.left += 150;
return
stylez
;
};
};
const
dimensions
=
Dimensions
.
get
(
'window'
);
const
windowHeight
=
dimensions
.
height
;
const
dropdownHeight
=
dropdownStyle
.
maxHeight
;
_calcPosition
()
{
const
{
data
}
=
this
.
props
;
let
dropdownStyle
=
{
// maxHeight: HEIGHTXD(99 * Math.min(data.length, 5)) + (6 - Math.min(data.length, 5)) * HEIGHTXD(105),
maxHeight
:
HEIGHTXD
(
99
*
Math
.
min
(
data
.
length
,
5
)
+
12
),
};
const
dimensions
=
Dimensions
.
get
(
'window'
);
const
windowHeight
=
dimensions
.
height
;
const
bottomSpace
=
const
dropdownHeight
=
dropdownStyle
.
maxHeight
;
windowHeight
-
this
.
_buttonFrame
.
y
-
this
.
_buttonFrame
.
h
;
const
showInBottom
=
bottomSpace
>=
dropdownHeight
||
bottomSpace
>=
this
.
_buttonFrame
.
y
;
this
.
setState
({
showInBottom
});
}
_updatePosition
()
{
const
bottomSpace
=
if
(
this
.
_button
&&
this
.
_button
.
measure
)
{
windowHeight
-
this
.
_buttonFrame
.
y
-
this
.
_buttonFrame
.
h
;
this
.
_button
.
measure
((
fx
,
fy
,
width
,
height
,
px
,
py
)
=>
{
const
showInBottom
=
this
.
_buttonFrame
=
{
x
:
px
,
y
:
py
,
w
:
width
,
h
:
height
};
bottomSpace
>=
dropdownHeight
||
bottomSpace
>=
this
.
_buttonFrame
.
y
;
this
.
_calcPosition
();
this
.
setState
({
showInBottom
});
});
}
}
}
render
()
{
_updatePosition
()
{
const
{
if
(
this
.
_button
&&
this
.
_button
.
measure
)
{
width
,
this
.
_button
.
measure
((
fx
,
fy
,
width
,
height
,
px
,
py
)
=>
{
onValueChange
,
this
.
_buttonFrame
=
{
x
:
px
,
y
:
py
,
w
:
width
,
h
:
height
};
containerStyle
,
this
.
_calcPosition
();
height
,
});
value
,
}
defaultValue
,
}
data
,
defaultIndex
,
render
()
{
iconDropdown
,
const
{
iconDropdownStyle
,
width
,
disabled
,
onValueChange
,
isTriangle
,
containerStyle
,
textStyle
,
height
,
}
=
this
.
props
;
value
,
return
(
defaultValue
,
<
View
style
=
{
styles
.
cell
}
>
data
,
<
TouchableOpacity
defaultIndex
,
disabled
=
{
disabled
}
iconDropdown
,
ref
=
{(
button
)
=>
{
iconDropdownStyle
,
this
.
_button
=
button
;
disabled
,
}}
isTriangle
,
onPress
=
{()
=>
{
textStyle
,
this
.
_dropdown
.
show
();
iconSize
,
this
.
_updatePosition
();
iconColor
,
}}
}
=
this
.
props
;
style
=
{[
return
(
styles
.
pickerStyle
,
<
View
style
=
{
styles
.
cell
}
>
containerStyle
!==
null
&&
containerStyle
,
<
TouchableOpacity
height
&&
{
height
},
disabled
=
{
disabled
}
width
&&
{
width
},
ref
=
{(
button
)
=>
{
]}
>
this
.
_button
=
button
;
<
Text
}}
numberOfLines
=
{
1
}
onPress
=
{()
=>
{
style
=
{[
this
.
_dropdown
.
show
();
styles
.
dropdown_row_text
,
this
.
_updatePosition
();
width
&&
{
width
:
width
-
WIDTHXD
(
125
)},
}}
textStyle
?
textStyle
:
{},
style
=
{[
]}
>
styles
.
pickerStyle
,
{
defaultValue
||
this
.
state
.
value
}
containerStyle
!==
null
&&
containerStyle
,
<
/Text
>
height
&&
{
height
},
{
iconDropdown
||
isTriangle
?
(
width
&&
{
width
},
<
Icon
name
=
{
'up'
}
size
=
{
20
}
color
=
{
R
.
colors
.
borderGray
}
/
>
]}
>
)
:
(
<
Text
<
Icon
name
=
{
'down'
}
size
=
{
20
}
color
=
{
R
.
colors
.
borderGray
}
/
>
numberOfLines
=
{
1
}
)}
style
=
{[
<
/TouchableOpacity
>
styles
.
dropdown_row_text
,
<
ModalDropdown
width
&&
{
width
:
width
-
WIDTHXD
(
125
)},
showsVerticalScrollIndicator
=
{
false
}
textStyle
?
textStyle
:
{},
ref
=
{(
el
)
=>
{
]}
>
this
.
_dropdown
=
el
;
{
defaultValue
||
this
.
state
.
value
}
}}
<
/Text
>
style
=
{[
styles
.
dropdown
,
width
&&
{
width
}]}
{
iconDropdown
||
isTriangle
?
(
defaultValue
=
{
defaultValue
||
'0'
}
<
Icon
name
=
{
'up'
}
size
=
{
iconSize
?
iconSize
:
20
}
color
=
{
iconColor
?
iconColor
:
R
.
colors
.
borderGray
}
/
>
defaultIndex
=
{
defaultIndex
||
0
}
)
:
(
textStyle
=
{
styles
.
dropdown_text
}
<
Icon
name
=
{
'down'
}
size
=
{
iconSize
?
iconSize
:
20
}
color
=
{
iconColor
?
iconColor
:
R
.
colors
.
borderGray
}
/
>
dropdownStyle
=
{[
)}
styles
.
dropdown_dropdown
,
<
/TouchableOpacity
>
{
maxHeight
:
HEIGHTXD
(
99
*
Math
.
min
(
data
.
length
,
6
)
+
12
)},
<
ModalDropdown
width
&&
{
width
},
showsVerticalScrollIndicator
=
{
false
}
]}
ref
=
{(
el
)
=>
{
options
=
{
data
!==
null
&&
data
}
this
.
_dropdown
=
el
;
onSelect
=
{(
value
)
=>
{
}}
onValueChange
&&
onValueChange
(
value
,
data
[
value
]);
style
=
{[
styles
.
dropdown
,
width
&&
{
width
}]}
this
.
setState
({
value
:
data
[
value
].
name
});
defaultValue
=
{
defaultValue
||
'0'
}
}}
defaultIndex
=
{
defaultIndex
||
0
}
renderRow
=
{(
option
,
index
,
isSelected
)
=>
(
textStyle
=
{
styles
.
dropdown_text
}
<
View
dropdownStyle
=
{[
style
=
{[
styles
.
dropdown_dropdown
,
styles
.
dropdown_row
,
{
maxHeight
:
HEIGHTXD
(
99
*
Math
.
min
(
data
.
length
,
6
)
+
12
)},
{
backgroundColor
:
isSelected
?
'#1C6AF6'
:
'#f2f2f2'
},
width
&&
{
width
},
]}
>
]}
<
Text
options
=
{
data
!==
null
&&
data
}
numberOfLines
=
{
1
}
onSelect
=
{(
value
)
=>
{
style
=
{[
onValueChange
&&
onValueChange
(
value
,
data
[
value
]);
styles
.
dropdown_row_text
,
this
.
setState
({
value
:
data
[
value
].
name
});
{
}}
marginHorizontal
:
WIDTHXD
(
30
),
renderRow
=
{(
option
,
index
,
isSelected
)
=>
(
color
:
isSelected
?
'white'
:
'black'
,
<
View
fontWeight
:
isSelected
?
'bold'
:
'300'
,
style
=
{[
},
styles
.
dropdown_row
,
]}
>
{
backgroundColor
:
isSelected
?
'#1C6AF6'
:
'#f2f2f2'
},
{
`
${
option
.
name
}
`
}
]}
>
<
/Text
>
<
Text
numberOfLines
=
{
1
}
style
=
{[
styles
.
dropdown_row_text
,
{
marginHorizontal
:
WIDTHXD
(
30
),
color
:
isSelected
?
'white'
:
'black'
,
fontWeight
:
isSelected
?
'bold'
:
'300'
,
},
]}
>
{
`
${
option
.
name
}
`
}
<
/Text
>
<
/View
>
)}
renderButtonText
=
{(
rowData
)
=>
this
.
renderButtonText
(
rowData
)}
adjustFrame
=
{(
style
)
=>
this
.
_dropdownAdjustFrame
(
style
)}
// renderSeparator={(sectionID, rowID, adjacentRowHighlighted) => this.renderSeparator(sectionID, rowID, adjacentRowHighlighted)}
/
>
<
/View
>
<
/View
>
)}
);
renderButtonText
=
{(
rowData
)
=>
this
.
renderButtonText
(
rowData
)}
}
adjustFrame
=
{(
style
)
=>
this
.
_dropdownAdjustFrame
(
style
)}
// renderSeparator={(sectionID, rowID, adjacentRowHighlighted) => this.renderSeparator(sectionID, rowID, adjacentRowHighlighted)}
/
>
<
/View
>
);
}
renderButtonText
=
()
=>
' '
;
renderButtonText
=
()
=>
' '
;
renderSeparator
=
(
rowID
)
=>
{
renderSeparator
=
(
rowID
)
=>
{
if
(
rowID
===
data
.
length
-
1
)
return
[];
if
(
rowID
===
data
.
length
-
1
)
{
let
key
=
`spr_
${
rowID
}
`
;
return
[];
return
<
View
style
=
{
styles
.
dropdown_separator
}
key
=
{
key
}
/>
;
}
};
let
key
=
`spr_
${
rowID
}
`
;
return
<
View
style
=
{
styles
.
dropdown_separator
}
key
=
{
key
}
/>
;
};
}
}
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
cell
:
{
cell
:
{
flex
:
0
,
flex
:
0
,
},
},
dropdown
:
{
dropdown
:
{
alignSelf
:
'center'
,
alignSelf
:
'center'
,
width
:
WIDTHXD
(
960
),
width
:
WIDTHXD
(
960
),
height
:
HEIGHTXD
(
0
),
height
:
HEIGHTXD
(
0
),
},
},
dropdown_text
:
{
dropdown_text
:
{
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
42
),
},
},
dropdown_dropdown
:
{
dropdown_dropdown
:
{
width
:
WIDTHXD
(
960
),
width
:
WIDTHXD
(
960
),
maxHeight
:
HEIGHTXD
(
200
),
maxHeight
:
HEIGHTXD
(
200
),
borderBottomLeftRadius
:
WIDTHXD
(
20
),
borderBottomLeftRadius
:
WIDTHXD
(
20
),
borderBottomRightRadius
:
WIDTHXD
(
20
),
borderBottomRightRadius
:
WIDTHXD
(
20
),
shadowColor
:
'#000'
,
shadowColor
:
'#000'
,
shadowOffset
:
{
shadowOffset
:
{
width
:
0
,
width
:
0
,
height
:
1
,
height
:
1
,
},
shadowOpacity
:
0.2
,
shadowRadius
:
1.41
,
elevation
:
2
,
marginTop
:
Platform
.
OS
==
'ios'
?
0
:
-
21
,
},
dropdown_row
:
{
flexDirection
:
'row'
,
height
:
HEIGHTXD
(
100
),
alignItems
:
'center'
,
paddingHorizontal
:
5
,
},
dropdown_row_text
:
{
// marginHorizontal: 4,
fontSize
:
getFontXD
(
42
),
textAlignVertical
:
'center'
,
},
dropdown_separator
:
{
borderBottomWidth
:
0.3
,
borderBottomColor
:
R
.
colors
.
iconGray
,
},
},
shadowOpacity
:
0.2
,
pickerStyle
:
{
shadowRadius
:
1.41
,
width
:
'100%'
,
elevation
:
2
,
height
:
HEIGHTXD
(
109
),
marginTop
:
Platform
.
OS
==
'ios'
?
0
:
-
21
,
flexDirection
:
'row'
,
},
paddingHorizontal
:
WIDTHXD
(
30
),
dropdown_row
:
{
justifyContent
:
'space-between'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
height
:
HEIGHTXD
(
100
),
alignSelf
:
'center'
,
alignItems
:
'center'
,
backgroundColor
:
'white'
,
paddingHorizontal
:
5
,
marginTop
:
5
,
},
borderRadius
:
7
,
dropdown_row_text
:
{
borderWidth
:
0.7
,
// marginHorizontal: 4,
borderColor
:
'#DBDBDB'
,
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
42
),
textAlignVertical
:
'center'
,
paddingVertical
:
5
,
},
paddingHorizontal
:
10
,
dropdown_separator
:
{
backgroundColor
:
'white'
,
borderBottomWidth
:
0.3
,
shadowColor
:
'#AFA9A9'
,
borderBottomColor
:
R
.
colors
.
iconGray
,
shadowOffset
:
{
},
width
:
0
,
pickerStyle
:
{
height
:
1
,
width
:
'100%'
,
},
height
:
HEIGHTXD
(
109
),
shadowOpacity
:
0.25
,
flexDirection
:
'row'
,
shadowRadius
:
1.84
,
paddingHorizontal
:
WIDTHXD
(
30
),
elevation
:
1
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
alignSelf
:
'center'
,
backgroundColor
:
'white'
,
marginTop
:
5
,
borderRadius
:
7
,
borderWidth
:
0.7
,
borderColor
:
'#DBDBDB'
,
fontSize
:
getFontXD
(
42
),
paddingVertical
:
5
,
paddingHorizontal
:
10
,
backgroundColor
:
'white'
,
shadowColor
:
'#AFA9A9'
,
shadowOffset
:
{
width
:
0
,
height
:
1
,
},
},
shadowOpacity
:
0.25
,
shadowRadius
:
1.84
,
elevation
:
1
,
},
});
});
src/helper/i18/locales/en.js
View file @
26a17b11
...
@@ -231,4 +231,10 @@ export default {
...
@@ -231,4 +231,10 @@ export default {
RejectVerify
:
'Reject verify'
,
RejectVerify
:
'Reject verify'
,
UploadImageFail
:
UploadImageFail
:
'The network connection is not stable, please check the connection'
,
'The network connection is not stable, please check the connection'
,
EscrowCalculator
:
'Escrow calculator'
,
Product
:
'Product'
,
LotTransactionNumber
:
'Lot transaction number'
,
FirstEscrow
:
'First escrow (VNĐ)'
,
FirstEscrowTotal
:
'First escrow total (VNĐ)'
,
Calculator
:
'Calculator'
,
};
};
src/helper/i18/locales/vn.js
View file @
26a17b11
...
@@ -233,4 +233,10 @@ export default {
...
@@ -233,4 +233,10 @@ export default {
RejectVerify
:
'Từ chối xác minh'
,
RejectVerify
:
'Từ chối xác minh'
,
UploadImageFail
:
UploadImageFail
:
'Đường truyền mạng không ổn định.Xin kiểm tra lại đường truyền!'
,
'Đường truyền mạng không ổn định.Xin kiểm tra lại đường truyền!'
,
EscrowCalculator
:
'Tính ký quỹ'
,
Product
:
'Mặt hàng'
,
LotTransactionNumber
:
'Số lot giao dịch'
,
FirstEscrow
:
'Ký quỹ ban đầu (VNĐ)'
,
FirstEscrowTotal
:
'Tổng ký quỹ ban đầu (VNĐ)'
,
Calculator
:
'Tính'
,
};
};
src/routers/ScreenNames.js
View file @
26a17b11
...
@@ -69,3 +69,4 @@ export const PRODUCTDETAIL = 'PRODUCTDETAIL';
...
@@ -69,3 +69,4 @@ export const PRODUCTDETAIL = 'PRODUCTDETAIL';
export
const
REGISTEROTP
=
'REGISTEROTP'
;
export
const
REGISTEROTP
=
'REGISTEROTP'
;
export
const
OTPWALLET
=
'OTPWALLET'
;
export
const
OTPWALLET
=
'OTPWALLET'
;
export
const
ESCROWCALCULATOR
=
'ESCROWCALCULATOR'
;
src/routers/StackNavigation.js
View file @
26a17b11
...
@@ -48,6 +48,7 @@ import DetailHistory from '../Screens/Action/History/DetailHistory';
...
@@ -48,6 +48,7 @@ import DetailHistory from '../Screens/Action/History/DetailHistory';
import
ProductDetail
from
'../Screens/Transaction/ProductDetail/ProductDetail'
;
import
ProductDetail
from
'../Screens/Transaction/ProductDetail/ProductDetail'
;
import
RegisterOTP
from
'../Screens/Authen/RegisterOTP'
;
import
RegisterOTP
from
'../Screens/Authen/RegisterOTP'
;
import
OTPWallet
from
'../Screens/Action/Wallet/OTPWallet'
;
import
OTPWallet
from
'../Screens/Action/Wallet/OTPWallet'
;
import
EscrowCalculator
from
'../Screens/EscrowCalculator/EscrowCalculator'
;
import
*
as
ScreenName
from
'./ScreenNames'
;
import
*
as
ScreenName
from
'./ScreenNames'
;
...
@@ -128,6 +129,10 @@ function MyStack(props) {
...
@@ -128,6 +129,10 @@ function MyStack(props) {
name
=
{
ScreenName
.
FORGOTPASSWORD
}
name
=
{
ScreenName
.
FORGOTPASSWORD
}
component
=
{
ForgotPassWord
}
component
=
{
ForgotPassWord
}
/
>
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
ESCROWCALCULATOR
}
component
=
{
EscrowCalculator
}
/
>
<
/Stack.Navigator
>
<
/Stack.Navigator
>
);
);
}
}
...
...
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