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
4a64ed70
Commit
4a64ed70
authored
Apr 02, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update newfeed api
parent
b9b6a73c
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
232 additions
and
132 deletions
+232
-132
Functions.js
src/Config/Functions.js
+7
-0
PacketCQG.js
src/Screens/Account/PacrtCQG/PacketCQG.js
+1
-1
AccountVerificationView.js
src/Screens/AccountVerification/AccountVerificationView.js
+2
-3
Profile.js
src/Screens/AccountVerification/Tab/Profile.js
+103
-27
Login.js
src/Screens/Authen/Login.js
+0
-2
GeneralInfor.js
src/Screens/Menu/Profile/Tab/GeneralInfor.js
+57
-51
Tab1.js
src/Screens/NewFeed/Tab1/Tab1.js
+52
-43
NewFeed.js
src/apis/Functions/NewFeed.js
+5
-0
url.js
src/apis/url.js
+1
-0
HeaderHome.js
src/components/Header/HeaderHome.js
+2
-3
HeaderSearch.js
src/components/Header/HeaderSearch.js
+0
-1
TextMulti.js
src/components/Input/TextMulti.js
+2
-1
No files found.
src/Config/Functions.js
View file @
4a64ed70
...
@@ -242,6 +242,13 @@ export const getTimeDDMM = (time) => {
...
@@ -242,6 +242,13 @@ export const getTimeDDMM = (time) => {
let
t1
=
new
Date
(
moment
(
time
,
'DD/MM/YYYY'
).
format
(
'MM/DD/YYYY'
)).
getTime
();
let
t1
=
new
Date
(
moment
(
time
,
'DD/MM/YYYY'
).
format
(
'MM/DD/YYYY'
)).
getTime
();
return
t1
;
return
t1
;
};
};
export
const
converStringToDate
=
(
time
)
=>
{
let
t1
=
new
Date
(
moment
(
time
,
'YYYY-MM-DD'
).
format
(
'MM/DD/YYYY'
)).
getTime
();
const
strDate
=
convertDate
(
t1
);
return
strDate
;
};
export
const
sortDataByTime
=
(
data
)
=>
{
export
const
sortDataByTime
=
(
data
)
=>
{
data
.
sort
((
a
,
b
)
=>
{
data
.
sort
((
a
,
b
)
=>
{
let
t1
=
moment
(
a
.
time
,
'DD-MM-YYYY'
).
format
(
'MM/YYYY'
);
let
t1
=
moment
(
a
.
time
,
'DD-MM-YYYY'
).
format
(
'MM/YYYY'
);
...
...
src/Screens/Account/PacrtCQG/PacketCQG.js
View file @
4a64ed70
...
@@ -60,7 +60,7 @@ const PacketCQG = (props) => {
...
@@ -60,7 +60,7 @@ const PacketCQG = (props) => {
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'Mở tài khoản CQG'
}
/
>
<
HeaderBack
title
=
{
'Mở tài khoản CQG'
}
/
>
<
ScrollView
showsVerticalScrollIndicator
=
{
tru
e
}
>
<
ScrollView
showsVerticalScrollIndicator
=
{
fals
e
}
>
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
txtNote
}
>
<
Text
style
=
{
styles
.
txtNote
}
>
L
ư
u
ý
:
Ph
í
đượ
c
t
í
nh
theo
th
á
ng
v
à
m
ứ
c
gi
á
n
à
y
đượ
c
á
p
d
ụ
ng
đế
n
h
ế
t
L
ư
u
ý
:
Ph
í
đượ
c
t
í
nh
theo
th
á
ng
v
à
m
ứ
c
gi
á
n
à
y
đượ
c
á
p
d
ụ
ng
đế
n
h
ế
t
...
...
src/Screens/AccountVerification/AccountVerificationView.js
View file @
4a64ed70
...
@@ -25,7 +25,6 @@ const AccountVerificationView = (props) => {
...
@@ -25,7 +25,6 @@ const AccountVerificationView = (props) => {
activeTintColor
:
'#1473E6'
,
activeTintColor
:
'#1473E6'
,
labelStyle
:
{
fontSize
:
getFontXD
(
36
)},
labelStyle
:
{
fontSize
:
getFontXD
(
36
)},
style
:
{
backgroundColor
:
'white'
},
style
:
{
backgroundColor
:
'white'
},
scrollEnabled
:
true
,
}}
>
}}
>
<
Tab
.
Screen
<
Tab
.
Screen
name
=
"GeneralInfor"
name
=
"GeneralInfor"
...
@@ -37,11 +36,11 @@ const AccountVerificationView = (props) => {
...
@@ -37,11 +36,11 @@ const AccountVerificationView = (props) => {
component
=
{
Profile
}
component
=
{
Profile
}
options
=
{{
tabBarLabel
:
'Hồ sơ'
}}
options
=
{{
tabBarLabel
:
'Hồ sơ'
}}
/
>
/
>
<
Tab
.
Screen
{
/*
<Tab.Screen
name="BankInfor"
name="BankInfor"
component={BankInfor}
component={BankInfor}
options={{tabBarLabel: 'Ngân hàng'}}
options={{tabBarLabel: 'Ngân hàng'}}
/
>
/>
*/
}
<
/Tab.Navigator
>
<
/Tab.Navigator
>
<
/View
>
<
/View
>
);
);
...
...
src/Screens/AccountVerification/Tab/Profile.js
View file @
4a64ed70
...
@@ -11,14 +11,18 @@ import {
...
@@ -11,14 +11,18 @@ import {
Platform
,
Platform
,
Dimensions
,
Dimensions
,
}
from
'react-native'
;
}
from
'react-native'
;
import
Button
from
'../../../components/Button'
;
import
PickerImgUni
from
'../../../components/Picker/PickerImgUni'
;
import
PickerImgUni
from
'../../../components/Picker/PickerImgUni'
;
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
TextField
from
'../../../components/Input/TextField'
;
import
TextField
from
'../../../components/Input/TextField'
;
import
{
connect
}
from
'react-redux'
;
import
{
showLoading
,
hideLoading
}
from
'../../../actions/loadingAction'
;
import
{
import
{
checkFormatArray
,
checkFormatArray
,
getFontXD
,
getFontXD
,
convertTime
,
convertTime
,
}
from
'../../../Config/Functions'
;
}
from
'../../../Config/Functions'
;
import
{
verifyAccountApi
}
from
'../../../apis/Functions/users'
;
import
PickerDate
from
'../../../components/Picker/PickerDate'
;
import
PickerDate
from
'../../../components/Picker/PickerDate'
;
import
PickerItem
from
'../../../components/Picker/PickerItem'
;
import
PickerItem
from
'../../../components/Picker/PickerItem'
;
const
{
width
}
=
Dimensions
.
get
(
'window'
);
const
{
width
}
=
Dimensions
.
get
(
'window'
);
...
@@ -42,45 +46,110 @@ const Profile = (props) => {
...
@@ -42,45 +46,110 @@ const Profile = (props) => {
const
[
urlFont
,
setUrlFont
]
=
useState
(
''
);
const
[
urlFont
,
setUrlFont
]
=
useState
(
''
);
const
[
urlBack
,
setUrlBack
]
=
useState
(
''
);
const
[
urlBack
,
setUrlBack
]
=
useState
(
''
);
const
[
urlSign
,
setUrlSign
]
=
useState
(
''
);
const
[
urlSign
,
setUrlSign
]
=
useState
(
''
);
const
[
cmnd
,
setCMND
]
=
useState
(
''
);
//
const [cmnd, setCMND] = useState('');
const
[
date_range
,
setDate_range
]
=
useState
(
new
Date
());
//
const [date_range, setDate_range] = useState(new Date());
const
[
type
,
setType
]
=
useState
();
const
[
type
,
setType
]
=
useState
();
const
onNextPress
=
()
=>
{
const
createFormData
=
(
identity_after
,
identity_before
,
sign_img
,
body
)
=>
{
const
data
=
new
FormData
();
data
.
append
(
'identity_after'
,
{
name
:
'identity_after.jpg'
,
type
:
'image/jpg'
,
uri
:
Platform
.
OS
===
'android'
?
identity_after
:
identity_after
.
replace
(
'file://'
,
''
),
});
data
.
append
(
'identity_before'
,
{
name
:
'identity_before.jpg'
,
type
:
'image/jpg'
,
uri
:
Platform
.
OS
===
'android'
?
identity_before
:
identity_before
.
replace
(
'file://'
,
''
),
});
data
.
append
(
'sign_image'
,
{
name
:
'sign_img.jpg'
,
type
:
'image/jpg'
,
uri
:
Platform
.
OS
===
'android'
?
sign_img
:
sign_img
.
replace
(
'file://'
,
''
),
});
Object
.
keys
(
body
).
forEach
((
key
)
=>
{
data
.
append
(
key
,
body
[
key
]);
});
return
data
;
};
const
onPress
=
async
()
=>
{
const
titles
=
[
const
titles
=
[
'loại thẻ'
,
'loại thẻ'
,
'số thẻ'
,
'ảnh CNND mặt trước'
,
'ảnh CNND mặt trước'
,
'ảnh CMND mặt sau'
,
'ảnh CMND mặt sau'
,
'ảnh chữ ký'
,
'ảnh chữ ký'
,
];
];
const
index
=
checkFormatArray
([
type
,
cmnd
,
urlFont
,
urlBack
,
urlSign
]);
const
index
=
checkFormatArray
([
type
,
urlFont
,
urlBack
,
urlSign
]);
if
(
index
===
true
)
{
if
(
index
===
true
)
{
props
.
navigation
.
navigate
(
'BankInfor'
,
{
const
data
=
createFormData
(
urlFont
,
urlBack
,
urlSign
,
{
body
:
{
cmnd
,
card_type
:
type
.
value
,
card_type
:
type
.
value
,
date_range
:
convertTime
(
date_range
)
,
uid
:
props
.
user
.
uid
,
...
props
.
route
.
params
,
...
props
.
route
.
params
,
},
img
:
{
urlFont
,
urlBack
,
urlSign
,
},
});
});
props
.
showLoading
();
const
res
=
await
verifyAccountApi
(
data
);
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
},
500
);
}
else
{
}
else
{
Alert
.
alert
(
'Vui lòng thêm '
+
titles
[
index
]);
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
},
500
);
}
}
else
{
Alert
.
alert
(
'Vui lòng điền '
+
titles
[
index
]);
}
}
};
};
// const onNextPress = () => {
// const titles = [
// 'loại thẻ',
// 'số thẻ',
// 'ảnh CNND mặt trước',
// 'ảnh CMND mặt sau',
// 'ảnh chữ ký',
// ];
// const index = checkFormatArray([urlFont, urlBack, urlSign]);
// if (index === true) {
// props.navigation.navigate('BankInfor', {
// body: {
// cmnd,
// card_type: type.value,
// date_range: convertTime(date_range),
// ...props.route.params,
// },
// img: {
// urlFont,
// urlBack,
// urlSign,
// },
// });
// } else {
// Alert.alert('Vui lòng thêm ' + titles[index]);
// }
// };
return
(
return
(
<
KeyboardAvoidingView
<
KeyboardAvoidingView
behavior
=
{
Platform
.
Os
===
'ios'
?
'padding'
:
'height'
}
behavior
=
{
Platform
.
Os
===
'ios'
?
'padding'
:
'height'
}
style
=
{{
flex
:
1
}}
style
=
{{
flex
:
1
}}
keyboardVerticalOffset
=
{
-
50
}
>
keyboardVerticalOffset
=
{
-
50
}
>
<
ScrollView
showsVerticalScrollIndicator
=
{
false
}
>
<
ScrollView
s
tyle
=
{{
flex
:
1
}}
s
howsVerticalScrollIndicator
=
{
false
}
>
<
View
<
View
style
=
{{
style
=
{{
flex
:
1
,
flex
:
1
,
...
@@ -101,7 +170,7 @@ const Profile = (props) => {
...
@@ -101,7 +170,7 @@ const Profile = (props) => {
setType
(
items
);
setType
(
items
);
}}
}}
/
>
/
>
{
/*
<TextField
<TextField
isNumber={true}
isNumber={true}
title={'Số thẻ'}
title={'Số thẻ'}
...
@@ -111,12 +180,13 @@ const Profile = (props) => {
...
@@ -111,12 +180,13 @@ const Profile = (props) => {
value={date_range}
value={date_range}
onValueChange={(val) => setDate_range(val)}
onValueChange={(val) => setDate_range(val)}
title={'Ngày cấp'}
title={'Ngày cấp'}
/
>
/>
*/
}
<
View
<
View
style
=
{{
style
=
{{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
flexWrap
:
'wrap'
,
flexWrap
:
'wrap'
,
flex
:
1
,
}}
>
}}
>
<
PickerImgUni
<
PickerImgUni
onSelectImg
=
{(
path
)
=>
setUrlFont
(
path
)}
onSelectImg
=
{(
path
)
=>
setUrlFont
(
path
)}
...
@@ -131,19 +201,20 @@ const Profile = (props) => {
...
@@ -131,19 +201,20 @@ const Profile = (props) => {
title
=
{
'Ảnh chữ ký'
}
title
=
{
'Ảnh chữ ký'
}
/
>
/
>
<
/View
>
<
/View
>
<
TouchableOpacity
onPress
=
{
onNextPress
}
style
=
{
styles
.
btnNext
}
>
<
Image
style
=
{{
width
:
30
,
height
:
30
}}
source
=
{
R
.
images
.
iconRight1
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
<
View
style
=
{
styles
.
btnSend
}
>
<
Button
title
=
{
'Xác minh'
}
onClick
=
{
onPress
}
/
>
<
/View
>
<
/KeyboardAvoidingView
>
<
/KeyboardAvoidingView
>
);
);
};
};
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
btnSend
:
{
width
:
'100%'
,
marginBottom
:
30
,
},
btnNext
:
{
btnNext
:
{
borderRadius
:
30
,
borderRadius
:
30
,
backgroundColor
:
'#1473E6'
,
backgroundColor
:
'#1473E6'
,
...
@@ -164,4 +235,9 @@ const styles = StyleSheet.create({
...
@@ -164,4 +235,9 @@ const styles = StyleSheet.create({
},
},
});
});
export
default
Profile
;
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
Profile
);
src/Screens/Authen/Login.js
View file @
4a64ed70
...
@@ -81,8 +81,6 @@ const Login = (props) => {
...
@@ -81,8 +81,6 @@ const Login = (props) => {
}
}
};
};
return
(
return
(
<
View
<
View
style
=
{{
style
=
{{
...
...
src/Screens/Menu/Profile/Tab/GeneralInfor.js
View file @
4a64ed70
...
@@ -13,18 +13,20 @@ import {
...
@@ -13,18 +13,20 @@ import {
Platform
,
Platform
,
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../../../../assets/R'
;
import
R
from
'../../../../assets/R'
;
import
RadioForm
,
{
const
dataTest
=
[
RadioButton
,
{
RadioButtonInput
,
value
:
'1'
,
RadioButtonLabel
,
name
:
'2020'
,
}
from
'react-native-simple-radio-button'
;
},
import
PickerDate
from
'../../../../components/Picker/PickerDate'
;
{
import
TextMulti
from
'../../../../components/Input/TextMulti'
;
value
:
'2'
,
import
{
connect
}
from
'react-redux'
;
name
:
'2021'
,
import
{
showLoading
,
hideLoading
}
from
'../../../../actions/loadingAction'
;
},
import
{
converStringToDate
}
from
'../../../../Config/Functions'
;
var
radio_props
=
[
{
label
:
'Nam'
,
value
:
0
},
{
label
:
'Nữ'
,
value
:
1
},
];
];
const
{
width
}
=
Dimensions
.
get
(
'window'
);
const
{
width
}
=
Dimensions
.
get
(
'window'
);
import
TextField
from
'../../../../components/Input/TextField'
;
import
TextField
from
'../../../../components/Input/TextField'
;
...
@@ -35,6 +37,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
...
@@ -35,6 +37,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
const
GeneralInfor
=
(
props
)
=>
{
const
GeneralInfor
=
(
props
)
=>
{
const
[
Select
,
setSelect
]
=
useState
(
'ABC'
);
const
[
Select
,
setSelect
]
=
useState
(
'ABC'
);
const
[
bank
,
setBank
]
=
useState
();
const
[
bank
,
setBank
]
=
useState
();
const
[
account
,
setAccount
]
=
useState
();
return
(
return
(
<
KeyboardAvoidingView
<
KeyboardAvoidingView
...
@@ -44,15 +47,21 @@ const GeneralInfor = (props) => {
...
@@ -44,15 +47,21 @@ const GeneralInfor = (props) => {
<
ScrollView
style
=
{{
flex
:
1
}}
showsVerticalScrollIndicator
=
{
false
}
>
<
ScrollView
style
=
{{
flex
:
1
}}
showsVerticalScrollIndicator
=
{
false
}
>
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
TextField
<
TextField
value
=
{
props
.
user
.
fullname
}
title
=
{
'Họ và tên'
}
title
=
{
'Họ và tên'
}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
/
>
/
>
<
TextField
<
TextField
title
=
{
'Điện thoại'
}
title
=
{
'Điện thoại'
}
value
=
{
props
.
user
.
phone
}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
/
>
/
>
<
TextField
title
=
{
'Email'
}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
/
>
<
TextField
title
=
{
'Email'
}
value
=
{
props
.
user
.
email
}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
/
>
{
/*
{
/*
<TextInput
<TextInput
style={styles.customTxt}
style={styles.customTxt}
...
@@ -60,49 +69,34 @@ const GeneralInfor = (props) => {
...
@@ -60,49 +69,34 @@ const GeneralInfor = (props) => {
placeholder="0000"
placeholder="0000"
/> */
}
/> */
}
<
Text
style
=
{
styles
.
txtTitle
}
>
Gi
ớ
i
t
í
nh
<
/Text
>
<
RadioForm
radio_props
=
{
radio_props
}
labelStyle
=
{{
fontSize
:
getFontXD
(
42
)}}
formHorizontal
=
{
true
}
style
=
{
styles
.
row
}
initial
=
{
0
}
onPress
=
{(
value
)
=>
{
setAccount
({
value
:
value
});
}}
/
>
<
View
style
=
{
styles
.
status
}
>
<
View
style
=
{
styles
.
status
}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
}}
>
<
View
style
=
{
styles
.
customAdd
}
>
<
Text
style
=
{{
fontSize
:
getFontXD
(
42
),
color
:
'#929292'
}}
>
+
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Tr
ạ
ng
th
á
i
<
/Text
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Tr
ạ
ng
th
á
i
<
/Text
>
<
/View
>
<
Text
style
=
{{
color
:
'#4FCD8D'
,
fontSize
:
getFontXD
(
42
)}}
>
<
Text
style
=
{{
color
:
'#4FCD8D'
,
fontSize
:
getFontXD
(
42
)}}
>
Đã
x
á
c
minh
Đã
x
á
c
minh
<
/Text
>
<
/Text
>
<
/View
>
<
/View
>
<
View
<
PickerDate
style
=
{{
value
=
{
converStringToDate
(
props
.
user
.
birthday
)}
borderTopWidth
:
1
,
title
=
{
'Ngày sinh'
}
borderTopColor
:
'#DBDBDB'
,
marginTop
:
20
,
paddingTop
:
10
,
}}
>
<
TextField
title
=
{
'Số tài khoản ngân hàng'
}
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
placeHolder
=
"Nhập số tài khoản ngân hàng"
/
>
/
>
<
Text
style
=
{
styles
.
txtTitle
}
>
T
ê
n
ng
â
n
h
à
ng
<
/Text
>
<
TextMulti
value
=
{
props
.
user
.
address
}
title
=
{
'Địa chỉ'
}
/
>
<
PickerItem
width
=
{
width
-
20
}
data
=
{
dataTest
}
onValueChange
=
{(
value
,
items
)
=>
{
setBank
(
items
);
}}
/
>
<
/View
>
<
/View
>
<
/ScrollView
>
<
View
style
=
{
styles
.
footer
}
>
<
View
style
=
{
styles
.
footer
}
>
<
TouchableOpacity
<
TouchableOpacity
onPress
=
{()
=>
console
.
log
(
'Hello'
)}
onPress
=
{()
=>
console
.
log
(
'Hello'
)}
...
@@ -110,8 +104,6 @@ const GeneralInfor = (props) => {
...
@@ -110,8 +104,6 @@ const GeneralInfor = (props) => {
<
Text
style
=
{
styles
.
txtBtn
}
>
C
ậ
p
nh
ậ
t
<
/Text
>
<
Text
style
=
{
styles
.
txtBtn
}
>
C
ậ
p
nh
ậ
t
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/ScrollView
>
<
/KeyboardAvoidingView
>
<
/KeyboardAvoidingView
>
);
);
};
};
...
@@ -146,18 +138,18 @@ const styles = StyleSheet.create({
...
@@ -146,18 +138,18 @@ const styles = StyleSheet.create({
status
:
{
status
:
{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
margin
Top
:
10
,
margin
Vertical
:
10
,
alignItems
:
'center'
,
alignItems
:
'center'
,
},
},
footer
:
{
footer
:
{
justifyContent
:
'center'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
margin
Top
:
30
,
margin
Bottom
:
30
,
},
},
btn
:
{
btn
:
{
width
:
WIDTHXD
(
521
),
width
:
WIDTHXD
(
521
),
height
:
HEIGHTXD
(
120
),
height
:
HEIGHTXD
(
120
),
borderRadius
:
1
5
,
borderRadius
:
1
0
,
backgroundColor
:
'#1C6AF6'
,
backgroundColor
:
'#1C6AF6'
,
justifyContent
:
'center'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
...
@@ -181,6 +173,20 @@ const styles = StyleSheet.create({
...
@@ -181,6 +173,20 @@ const styles = StyleSheet.create({
paddingTop
:
5
,
paddingTop
:
5
,
},
},
row
:
{
height
:
HEIGHTXD
(
109
),
width
:
'100%'
,
justifyContent
:
'space-between'
,
marginVertical
:
5
,
width
:
250
,
},
});
});
export
default
GeneralInfor
;
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
GeneralInfor
,
);
src/Screens/NewFeed/Tab1/Tab1.js
View file @
4a64ed70
...
@@ -12,85 +12,94 @@ import {
...
@@ -12,85 +12,94 @@ import {
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
Item
from
'./item'
;
import
Item
from
'./item'
;
import
{
getListNew
}
from
'../../../apis/Functions/NewFeed'
;
import
{
getListNew
,
getListCategoryNew
}
from
'../../../apis/Functions/NewFeed'
;
const
fillers
=
[
{
id
:
'1'
,
title
:
'Ngoại hối'
,
},
{
id
:
'2'
,
title
:
'Cổ phiếu'
,
},
{
id
:
'3'
,
title
:
'Hàng hoá'
,
},
{
id
:
'4'
,
title
:
'Chỉ số'
,
},
];
const
NewFeed
=
(
props
)
=>
{
const
NewFeed
=
(
props
)
=>
{
const
[
selected
,
setSelected
]
=
useState
(
1
);
const
[
selected
,
setSelected
]
=
useState
(
''
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
data
,
setData
]
=
useState
([]);
const
[
data
,
setData
]
=
useState
([]);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
const
[
fillters
,
setFillters
]
=
useState
([]);
const
getCategory
=
async
()
=>
{
const
res
=
await
getListCategoryNew
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
20
,
page_index
:
1
,
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setFillters
(
res
.
data
.
data
);
console
.
log
(
res
.
data
.
data
);
}
else
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
}
};
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
();
getData
();
getCategory
();
},
[]);
},
[]);
useEffect
(()
=>
{
getData
();
},
[
selected
]);
const
getData
=
async
()
=>
{
const
getData
=
async
()
=>
{
setisRefresh
(
true
);
setPage
(
1
);
const
res
=
await
getListNew
({
const
res
=
await
getListNew
({
keyword
:
''
,
keyword
:
''
,
category_id
:
''
,
category_id
:
selected
,
platform
:
Platform
.
OS
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_size
:
10
,
page_index
:
page
,
page_index
:
1
,
});
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
setData
(
res
.
data
.
data
);
setTotalPage
(
res
.
data
.
meta
.
pages
);
}
else
{
}
else
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
}
}
setisRefresh
(
false
);
};
};
const
onRefresh
=
()
=>
{
const
onRefresh
=
()
=>
{
console
.
log
(
'On Refersh'
);
getData
(
);
};
};
const
onLoadMore
=
()
=>
{
const
onLoadMore
=
()
=>
{
console
.
log
(
'Load more'
);
if
(
page
<
tottalPage
)
getDataLoadMore
(
);
};
};
// const getDataLoadMore=async ()=>{
const
getDataLoadMore
=
async
()
=>
{
// setisRefresh(true)
setisRefresh
(
true
);
// const res=await GetListNotification({keyword:txtSearch,page_index:page+1,page_size:8,platform:Platform.OS})
const
res
=
await
getListNew
({
// setPage(page+1)
keyword
:
''
,
category_id
:
''
,
// if(res.data.code==200){
platform
:
Platform
.
OS
,
// setData(data.concat(res.data.data))
page_size
:
10
,
// }
page_index
:
page
+
1
,
// setisRefresh(false)
});
// }
setPage
(
page
+
1
);
// const onLoadMore=()=>{
// if(page<tottalPage)
// getDataLoadMore()
// }
if
(
res
.
data
.
code
==
200
)
{
setData
(
data
.
concat
(
res
.
data
.
data
));
}
setisRefresh
(
false
);
};
return
(
return
(
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
}}
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
}}
>
<
View
style
=
{
styles
.
fillterView
}
>
<
View
style
=
{
styles
.
fillterView
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
fillers
.
map
((
e
)
=>
(
{
fill
t
ers
.
map
((
e
)
=>
(
<
TouchableOpacity
<
TouchableOpacity
onPress
=
{()
=>
setSelected
(
e
.
id
)}
onPress
=
{()
=>
{
console
.
log
(
e
.
id
);
setSelected
(
e
.
id
);
}}
key
=
{
e
.
id
}
key
=
{
e
.
id
}
style
=
{[
style
=
{[
styles
.
item
,
styles
.
item
,
...
@@ -101,7 +110,7 @@ const NewFeed = (props) => {
...
@@ -101,7 +110,7 @@ const NewFeed = (props) => {
styles
.
txt
,
styles
.
txt
,
e
.
id
==
selected
?
{
color
:
'#1C6AF6'
}
:
{},
e
.
id
==
selected
?
{
color
:
'#1C6AF6'
}
:
{},
]}
>
]}
>
{
e
.
titl
e
}
{
e
.
nam
e
}
<
/Text
>
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
))}
))}
...
...
src/apis/Functions/NewFeed.js
View file @
4a64ed70
...
@@ -6,3 +6,8 @@ export const getListNew = async (body) =>
...
@@ -6,3 +6,8 @@ export const getListNew = async (body) =>
GetData
(
url
.
urlGetListNew
,
body
)
GetData
(
url
.
urlGetListNew
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
.
catch
((
err
)
=>
err
);
export
const
getListCategoryNew
=
async
(
body
)
=>
GetData
(
url
.
urlGetCategoryNew
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
4a64ed70
...
@@ -10,4 +10,5 @@ export default {
...
@@ -10,4 +10,5 @@ export default {
urlVerifyAccount
:
root
+
'api/v1/customers/verify-account'
,
urlVerifyAccount
:
root
+
'api/v1/customers/verify-account'
,
urlGetListNew
:
root
+
'/api/v1/news/posts'
,
urlGetListNew
:
root
+
'/api/v1/news/posts'
,
urlGetCategoryNew
:
root
+
'api/v1/news/categories'
,
};
};
src/components/Header/HeaderHome.js
View file @
4a64ed70
...
@@ -104,10 +104,9 @@ const renderLabel = (status) => {
...
@@ -104,10 +104,9 @@ const renderLabel = (status) => {
const
HeaderHome
=
(
props
)
=>
{
const
HeaderHome
=
(
props
)
=>
{
const
navigate
=
useNavigation
();
const
navigate
=
useNavigation
();
console
.
log
(
props
.
user
.
status
);
const
copyToClipboard
=
()
=>
{
const
copyToClipboard
=
()
=>
{
Alert
.
alert
(
'Đã sao chép!'
);
Alert
.
alert
(
'Đã sao chép
link giới thiệu
!'
);
Clipboard
.
setString
(
props
.
user
.
sponsor_url
);
Clipboard
.
setString
(
props
.
user
.
sponsor_url
);
};
};
...
@@ -211,7 +210,7 @@ const styles = StyleSheet.create({
...
@@ -211,7 +210,7 @@ const styles = StyleSheet.create({
},
},
containerTop
:
{
containerTop
:
{
backgroundColor
:
'white'
,
backgroundColor
:
'white'
,
height
:
HEIGHTXD
(
856
)
,
height
:
290
,
width
:
'90%'
,
width
:
'90%'
,
borderRadius
:
10
,
borderRadius
:
10
,
shadowColor
:
'#000'
,
shadowColor
:
'#000'
,
...
...
src/components/Header/HeaderSearch.js
View file @
4a64ed70
...
@@ -15,7 +15,6 @@ import {
...
@@ -15,7 +15,6 @@ import {
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
import
{
getFontXD
,
HEIGHT
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
getFontXD
,
HEIGHT
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
LinearGradient
from
'react-native-linear-gradient'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
HEIGHTXD
}
from
'../../Config/Functions'
;
import
{
HEIGHTXD
}
from
'../../Config/Functions'
;
import
Modal
from
'react-native-modal'
;
import
Modal
from
'react-native-modal'
;
...
...
src/components/Input/TextMulti.js
View file @
4a64ed70
...
@@ -4,7 +4,7 @@ import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions';
...
@@ -4,7 +4,7 @@ import {HEIGHTXD, WIDTHXD, getFontXD} from '../../Config/Functions';
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
const
TextField
=
(
props
)
=>
{
const
TextField
=
(
props
)
=>
{
const
{
title
,
onChangeText
,
maxLength
}
=
props
;
const
{
title
,
onChangeText
,
maxLength
,
value
}
=
props
;
return
(
return
(
<
View
style
=
{{
marginVertical
:
5
}}
>
<
View
style
=
{{
marginVertical
:
5
}}
>
...
@@ -18,6 +18,7 @@ const TextField = (props) => {
...
@@ -18,6 +18,7 @@ const TextField = (props) => {
<
/Text
>
<
/Text
>
<
TextInput
<
TextInput
maxLength
=
{
maxLength
}
maxLength
=
{
maxLength
}
value
=
{
value
}
onChangeText
=
{(
val
)
=>
onChangeText
(
val
)}
onChangeText
=
{(
val
)
=>
onChangeText
(
val
)}
multiline
=
{
true
}
multiline
=
{
true
}
numberOfLines
=
{
3
}
numberOfLines
=
{
3
}
...
...
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