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
3cbaf332
Commit
3cbaf332
authored
Apr 09, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
127b4bc6
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
301 additions
and
149 deletions
+301
-149
AccountVerificationView.js
src/Screens/AccountVerification/AccountVerificationView.js
+2
-2
Profile.js
src/Screens/AccountVerification/Tab/Profile.js
+6
-4
History.js
src/Screens/Action/History/History.js
+74
-3
HistoryView.js
src/Screens/Action/History/HistoryView.js
+62
-40
Item.js
src/Screens/Action/History/Item.js
+1
-1
WalletWithdraw.js
src/Screens/Action/Wallet/WalletWithdraw.js
+81
-57
Home.js
src/Screens/Home/Home.js
+2
-1
Calendar.js
src/Screens/NewFeed/Calendar/Calendar.js
+35
-1
item.js
src/Screens/NewFeed/Calendar/item.js
+3
-5
NewFeed.js
src/Screens/NewFeed/NewFeed.js
+2
-1
Widthdraw.js
src/apis/Functions/Widthdraw.js
+5
-0
url.js
src/apis/url.js
+3
-0
Aleart.js
src/components/Aleart.js
+25
-0
Aleart.tsx
src/components/Aleart.tsx
+0
-34
No files found.
src/Screens/AccountVerification/AccountVerificationView.js
View file @
3cbaf332
...
@@ -31,12 +31,12 @@ const AccountVerificationView = (props) => {
...
@@ -31,12 +31,12 @@ const AccountVerificationView = (props) => {
}}
>
}}
>
<
Tab
.
Screen
<
Tab
.
Screen
name
=
"GeneralInfor"
name
=
"GeneralInfor"
component
=
{
props
.
user
.
status
==
2
?
GeneralInfor
:
GeneralView
}
component
=
{
props
.
user
.
status
==
1
?
GeneralInfor
:
GeneralView
}
options
=
{{
tabBarLabel
:
'Thông tin chung'
}}
options
=
{{
tabBarLabel
:
'Thông tin chung'
}}
/
>
/
>
<
Tab
.
Screen
<
Tab
.
Screen
name
=
"Profile"
name
=
"Profile"
component
=
{
props
.
user
.
status
==
2
?
Profile
:
ProfileView
}
component
=
{
props
.
user
.
status
==
1
?
Profile
:
ProfileView
}
options
=
{{
tabBarLabel
:
'Hồ sơ'
}}
options
=
{{
tabBarLabel
:
'Hồ sơ'
}}
/
>
/
>
<
/Tab.Navigator
>
<
/Tab.Navigator
>
...
...
src/Screens/AccountVerification/Tab/Profile.js
View file @
3cbaf332
...
@@ -10,6 +10,8 @@ import {
...
@@ -10,6 +10,8 @@ import {
ScrollView
,
ScrollView
,
Platform
,
Platform
,
Dimensions
,
Dimensions
,
TouchableWithoutFeedback
,
Keyboard
,
}
from
'react-native'
;
}
from
'react-native'
;
import
Button
from
'../../../components/Button'
;
import
Button
from
'../../../components/Button'
;
import
PickerImgUni
from
'../../../components/Picker/PickerImgUni'
;
import
PickerImgUni
from
'../../../components/Picker/PickerImgUni'
;
...
@@ -207,10 +209,10 @@ const Profile = (props) => {
...
@@ -207,10 +209,10 @@ const Profile = (props) => {
/
>
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
btnSend
}
>
<
Button
title
=
{
'Xác minh'
}
onClick
=
{
onPress
}
/
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
<
View
style
=
{
styles
.
btnSend
}
>
<
Button
title
=
{
'Xác minh'
}
onClick
=
{
onPress
}
/
>
<
/View
>
<
/TouchableWithoutFeedback
>
<
/TouchableWithoutFeedback
>
<
/KeyboardAvoidingView
>
<
/KeyboardAvoidingView
>
);
);
...
@@ -219,7 +221,7 @@ const Profile = (props) => {
...
@@ -219,7 +221,7 @@ const Profile = (props) => {
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
btnSend
:
{
btnSend
:
{
width
:
'100%'
,
width
:
'100%'
,
margin
Bottom
:
1
0
,
margin
Vertical
:
3
0
,
},
},
btnNext
:
{
btnNext
:
{
borderRadius
:
30
,
borderRadius
:
30
,
...
...
src/Screens/Action/History/History.js
View file @
3cbaf332
import
React
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Alert
}
from
'react-native'
;
import
HistoryView
from
'./HistoryView'
;
import
HistoryView
from
'./HistoryView'
;
import
{
getListTransaction
}
from
'../../../apis/Functions/Widthdraw'
;
const
History
=
(
props
)
=>
{
const
History
=
(
props
)
=>
{
return
<
HistoryView
/>
;
const
[
selected
,
setSelected
]
=
useState
(
''
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
data
,
setData
]
=
useState
([]);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
const
[
fillters
,
setFillters
]
=
useState
([]);
useEffect
(()
=>
{
getData
();
},
[]);
// useEffect(() => {
// getData();
// }, [selected]);
const
getData
=
async
()
=>
{
setisRefresh
(
true
);
setPage
(
1
);
const
res
=
await
getListTransaction
({
keyword
:
''
,
type
:
'ALL'
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
start_date
:
''
,
end_date
:
''
,
});
console
.
log
(
res
);
setisRefresh
(
false
);
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
setTotalPage
(
res
.
data
.
meta
.
pages
);
}
else
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
}
};
const
onRefresh
=
()
=>
{
getData
();
};
const
onLoadMore
=
()
=>
{
console
.
log
(
tottalPage
);
// if (page < tottalPage) getDataLoadMore();
};
const
getDataLoadMore
=
async
()
=>
{
setisRefresh
(
true
);
const
res
=
await
getListNew
({
keyword
:
''
,
category_id
:
selected
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
page
+
1
,
});
setPage
(
page
+
1
);
if
(
res
.
data
.
code
==
200
)
{
setData
(
data
.
concat
(
res
.
data
.
data
));
}
setisRefresh
(
false
);
};
return
(
<
HistoryView
onLoadMore
=
{
onLoadMore
}
isRefresh
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
data
=
{
data
}
/
>
);
};
};
export
default
History
;
export
default
History
;
src/Screens/Action/History/HistoryView.js
View file @
3cbaf332
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
View
,
Text
,
FlatList
,
TouchableOpacity
,
StyleSheet
}
from
'react-native'
;
import
{
View
,
Text
,
FlatList
,
TouchableOpacity
,
StyleSheet
}
from
'react-native'
;
import
Header
SB
from
'../../../components/Header/HeaderSB
'
;
import
Header
Back
from
'../../../components/Header/HeaderBack
'
;
import
Item
from
'./Item'
;
import
Item
from
'./Item'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
const
Fillters
=
[
const
Fillters
=
[
...
@@ -27,50 +27,65 @@ const Fillters = [
...
@@ -27,50 +27,65 @@ const Fillters = [
},
},
];
];
const
data
=
[
// const data = [
{
// {
id
:
'1'
,
// id: '1',
money
:
10000000
,
// money: 10000000,
content
:
'Hoạt động: Nạp tiền'
,
// content: 'Hoạt động: Nạp tiền',
status
:
1
,
// status: 1,
date
:
'20/02/2021'
,
// date: '20/02/2021',
},
// },
{
// {
id
:
'2'
,
// id: '2',
money
:
2000000
,
// money: 2000000,
content
:
'Hoạt động: Nạp tiền'
,
// content: 'Hoạt động: Nạp tiền',
status
:
1
,
// status: 1,
date
:
'20/02/2021'
,
// date: '20/02/2021',
},
// },
{
// {
id
:
'3'
,
// id: '3',
day
:
'20'
,
// day: '20',
money
:
3000000
,
// money: 3000000,
content
:
'Hoạt động: Nạp tiền'
,
// content: 'Hoạt động: Nạp tiền',
status
:
1
,
// status: 1,
date
:
'20/02/2021'
,
// date: '20/02/2021',
},
// },
{
// {
id
:
'4'
,
// id: '4',
money
:
4000000
,
// money: 4000000,
content
:
'Hoạt động: Rút tiền'
,
// content: 'Hoạt động: Rút tiền',
status
:
2
,
// status: 2,
date
:
'20/02/2021'
,
// date: '20/02/2021',
},
// },
{
// {
id
:
'5'
,
// id: '5',
money
:
9000000
,
// money: 9000000,
content
:
'Hoạt động: Nạp tiền'
,
// content: 'Hoạt động: Nạp tiền',
status
:
1
,
// status: 1,
date
:
'20/02/2021'
,
// date: '20/02/2021',
},
// },
];
// {
// id: '6',
// money: 4000000,
// content: 'Hoạt động: Rút tiền',
// status: 2,
// date: '20/02/2021',
// },
// {
// id: '7',
// money: 9000000,
// content: 'Hoạt động: Nạp tiền',
// status: 1,
// date: '20/02/2021',
// },
// ];
const
HistoryView
=
(
props
)
=>
{
const
HistoryView
=
(
props
)
=>
{
const
{
isRefresh
,
onRefresh
,
onLoadMore
,
data
}
=
props
;
const
[
selected
,
setSelected
]
=
useState
(
'1'
);
const
[
selected
,
setSelected
]
=
useState
(
'1'
);
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
Header
SB
title
=
{
'LỊCH SỬ'
}
/
>
<
Header
Back
isWhite
=
{
true
}
title
=
{
'LỊCH SỬ'
}
/
>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
FlatList
<
FlatList
...
@@ -97,6 +112,13 @@ const HistoryView = (props) => {
...
@@ -97,6 +112,13 @@ const HistoryView = (props) => {
/
>
/
>
<
/View
>
<
/View
>
<
FlatList
<
FlatList
style
=
{{
flex
:
1
}}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
keyExtractor
=
{(
item
)
=>
item
.
id
}
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
data
=
{
data
}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
/>
}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
/>
}
...
...
src/Screens/Action/History/Item.js
View file @
3cbaf332
...
@@ -90,7 +90,7 @@ const styles = StyleSheet.create({
...
@@ -90,7 +90,7 @@ const styles = StyleSheet.create({
elevation
:
5
,
elevation
:
5
,
marginHorizontal
:
10
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
backgroundColor
:
R
.
colors
.
white
,
margin
Top
:
10
,
margin
Vertical
:
5
,
borderRadius
:
HEIGHTXD
(
30
),
borderRadius
:
HEIGHTXD
(
30
),
},
},
wrapRight
:
{
wrapRight
:
{
...
...
src/Screens/Action/Wallet/WalletWithdraw.js
View file @
3cbaf332
...
@@ -7,6 +7,9 @@ import {
...
@@ -7,6 +7,9 @@ import {
TouchableOpacity
,
TouchableOpacity
,
Platform
,
Platform
,
Alert
,
Alert
,
TouchableWithoutFeedback
,
Keyboard
,
KeyboardAvoidingView
,
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
HeaderBack
from
'../../../components/Header/HeaderBack'
;
import
HeaderBack
from
'../../../components/Header/HeaderBack'
;
...
@@ -25,6 +28,8 @@ import RadioForm from 'react-native-simple-radio-button';
...
@@ -25,6 +28,8 @@ import RadioForm from 'react-native-simple-radio-button';
import
{
widthDraw
,
getListWidthDraw
}
from
'../../../apis/Functions/Widthdraw'
;
import
{
widthDraw
,
getListWidthDraw
}
from
'../../../apis/Functions/Widthdraw'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
showLoading
,
hideLoading
}
from
'../../../actions/loadingAction'
;
import
{
showLoading
,
hideLoading
}
from
'../../../actions/loadingAction'
;
import
{
confirmAlert
}
from
'../../../components/Aleart'
;
import
{
ADDMETHODPAY
}
from
'../../../routers/ScreenNames'
;
var
radio_props
=
[
var
radio_props
=
[
{
label
:
'Từ ví'
,
value
:
'WALLET'
},
{
label
:
'Từ ví'
,
value
:
'WALLET'
},
...
@@ -42,19 +47,29 @@ const WalletWithdraw = (props) => {
...
@@ -42,19 +47,29 @@ const WalletWithdraw = (props) => {
const
navigate
=
useNavigation
();
const
navigate
=
useNavigation
();
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
();
const
unsubscribe
=
navigate
.
addListener
(
'focus'
,
()
=>
{
},
[]);
getData
();
});
return
unsubscribe
;
},
[
navigate
]);
const
getData
=
async
()
=>
{
const
getData
=
async
()
=>
{
const
res
=
await
getListWidthDraw
({
const
res
=
await
getListWidthDraw
({
platform
:
Platform
.
OS
,
platform
:
Platform
.
OS
,
});
});
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
console
.
log
(
res
.
data
.
data
);
if
(
res
.
data
.
data
.
length
==
0
)
{
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
confirmAlert
(
return
{...
e
,
value
:
e
.
id
,
name
:
e
.
method
};
'Bạn chưa có phương thức thanh toán.Đi đến cài đặt phương thức thanh toán?'
,
});
()
=>
navigate
.
navigate
(
ADDMETHODPAY
),
setData
(
newList
);
);
}
else
{
const
newList
=
res
.
data
.
data
.
map
((
e
)
=>
{
return
{...
e
,
value
:
e
.
id
,
name
:
e
.
method
};
});
setData
(
newList
);
}
}
else
{
}
else
{
alert
(
'Không lấy được danh sách phương thức!'
);
alert
(
'Không lấy được danh sách phương thức!'
);
}
}
...
@@ -94,10 +109,15 @@ const WalletWithdraw = (props) => {
...
@@ -94,10 +109,15 @@ const WalletWithdraw = (props) => {
};
};
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
KeyboardAvoidingView
<
HeaderBack
title
=
{
'Rút tiền'
}
/
>
behavior
=
{
Platform
.
Os
===
'ios'
?
'padding'
:
'height'
}
<
View
style
=
{
styles
.
container
}
>
style
=
{{
flex
:
1
}}
{
/* <View style={styles.wrapTop}>
keyboardVerticalOffset
=
{
-
50
}
>
<
TouchableWithoutFeedback
onPress
=
{
Keyboard
.
dismiss
}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'Rút tiền'
}
/
>
<
View
style
=
{
styles
.
container
}
>
{
/* <View style={styles.wrapTop}>
<View style={styles.itemTop}>
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>Ví</Text>
<Text style={styles.txtTitle}>Ví</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
...
@@ -109,53 +129,57 @@ const WalletWithdraw = (props) => {
...
@@ -109,53 +129,57 @@ const WalletWithdraw = (props) => {
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
<Text style={styles.txtMoney}>{toPriceVnd(1000000)}</Text>
</View>
</View>
</View> */
}
</View> */
}
<
View
style
=
{
styles
.
wrapBody
}
>
<
View
style
=
{
styles
.
wrapBody
}
>
<
Text
<
Text
style
=
{{
style
=
{{
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
color777
,
color
:
R
.
colors
.
color777
,
}}
>
}}
>
T
à
i
kho
ả
n
ngu
ồ
n
T
à
i
kho
ả
n
ngu
ồ
n
<
/Text
>
<
/Text
>
{
/* <View style={styles.row}> */
}
{
/* <View style={styles.row}> */
}
<
RadioForm
<
RadioForm
radio_props
=
{
radio_props
}
radio_props
=
{
radio_props
}
labelStyle
=
{{
fontSize
:
getFontXD
(
42
)}}
labelStyle
=
{{
fontSize
:
getFontXD
(
42
)}}
formHorizontal
=
{
true
}
formHorizontal
=
{
true
}
style
=
{
styles
.
row
}
style
=
{
styles
.
row
}
initial
=
{
0
}
initial
=
{
0
}
onPress
=
{(
value
)
=>
{
onPress
=
{(
value
)
=>
{
setSrc
(
value
);
setSrc
(
value
);
}}
}}
/
>
/
>
{
/* </View> */
}
{
/* </View> */
}
<
Text
<
Text
style
=
{{
style
=
{{
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
color777
,
color
:
R
.
colors
.
color777
,
}}
>
}}
>
Ch
ọ
n
t
à
i
kho
ả
n
h
ưở
ng
th
ụ
Ch
ọ
n
t
à
i
kho
ả
n
h
ưở
ng
th
ụ
<
/Text
>
<
/Text
>
<
PickerItem
<
PickerItem
width
=
{
width
-
20
}
width
=
{
width
-
20
}
data
=
{
data
}
data
=
{
data
}
onValueChange
=
{(
value
,
items
)
=>
{
onValueChange
=
{(
value
,
items
)
=>
{
setType
(
items
);
setType
(
items
);
}}
}}
/
>
/
>
<
TextField
<
TextField
onChangeText
=
{(
val
)
=>
setAmount
(
val
)}
onChangeText
=
{(
val
)
=>
setAmount
(
val
)}
title
=
{
'Số tiền'
}
title
=
{
'Số tiền'
}
isNumber
=
{
true
}
isNumber
=
{
true
}
/
>
/
>
<
TextMulti
<
TextMulti
onChangeText
=
{(
val
)
=>
setNotes
(
val
)}
title
=
{
'Ghi chú'
}
/
>
onChangeText
=
{(
val
)
=>
setNotes
(
val
)}
title
=
{
'Ghi chú'
}
/
>
<
/View
>
<
/View
>
<
TouchableOpacity
onPress
=
{
onPressWithdraw
}
style
=
{
styles
.
btnSend
}
>
<
Text
style
=
{
styles
.
txtSend
}
>
R
ú
t
ti
ề
n
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/TouchableWithoutFeedback
>
<
TouchableOpacity
onPress
=
{
onPressWithdraw
}
style
=
{
styles
.
btnSend
}
>
<
/KeyboardAvoidingView
>
<
Text
style
=
{
styles
.
txtSend
}
>
R
ú
t
ti
ề
n
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
);
);
};
};
...
...
src/Screens/Home/Home.js
View file @
3cbaf332
...
@@ -10,7 +10,8 @@ const Home = (props) => {
...
@@ -10,7 +10,8 @@ const Home = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
();
getData
();
},
[]);
},
[]);
console
.
log
();
props
.
user
;
const
getData
=
async
()
=>
{
const
getData
=
async
()
=>
{
const
res
=
await
getTransaction
({});
const
res
=
await
getTransaction
({});
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
...
...
src/Screens/NewFeed/Calendar/Calendar.js
View file @
3cbaf332
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
React
,
{
Component
,
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
View
,
Text
,
Platform
,
FlatList
}
from
'react-native'
;
import
{
View
,
Text
,
Platform
,
FlatList
}
from
'react-native'
;
import
{
getListCalendar
}
from
'../../../apis/Functions/NewFeed'
;
import
{
getListCalendar
}
from
'../../../apis/Functions/NewFeed'
;
import
{
convertTimeApi
}
from
'../../../Config/Functions'
;
import
{
convertTimeApi
}
from
'../../../Config/Functions'
;
...
@@ -6,10 +6,14 @@ import {convertTimeApi} from '../../../Config/Functions';
...
@@ -6,10 +6,14 @@ import {convertTimeApi} from '../../../Config/Functions';
import
Item
from
'./item'
;
import
Item
from
'./item'
;
const
NewFeed
=
(
props
)
=>
{
const
NewFeed
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
([]);
const
[
data
,
setData
]
=
useState
([]);
const
ListDayRef
=
useRef
(
null
);
useEffect
(()
=>
{
useEffect
(()
=>
{
getData
();
getData
();
},
[]);
},
[]);
useEffect
(()
=>
{
scrollToCurrent
();
},
[
data
]);
const
getData
=
async
()
=>
{
const
getData
=
async
()
=>
{
var
date
=
new
Date
(),
var
date
=
new
Date
(),
...
@@ -30,6 +34,34 @@ const NewFeed = (props) => {
...
@@ -30,6 +34,34 @@ const NewFeed = (props) => {
}
}
};
};
const
scrollToCurrent
=
()
=>
{
const
date
=
new
Date
();
let
index
=
0
;
const
today
=
convertTimeApi
(
date
);
if
(
data
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
data
[
i
].
start_date
.
substring
(
0
,
10
)
==
today
)
{
index
=
i
;
break
;
}
}
setTimeout
(()
=>
{
ListDayRef
.
current
.
scrollToIndex
({
animated
:
true
,
index
:
index
,
});
},
200
);
}
};
const
getItemLayout
=
(
data
,
index
)
=>
({
length
:
100
,
offset
:
80
*
index
,
index
,
});
return
(
return
(
<
View
<
View
style
=
{{
style
=
{{
...
@@ -40,6 +72,8 @@ const NewFeed = (props) => {
...
@@ -40,6 +72,8 @@ const NewFeed = (props) => {
paddingTop
:
10
,
paddingTop
:
10
,
}}
>
}}
>
<
FlatList
<
FlatList
ref
=
{
ListDayRef
}
getItemLayout
=
{
getItemLayout
}
data
=
{
data
}
data
=
{
data
}
showsVerticalScrollIndicator
=
{
false
}
showsVerticalScrollIndicator
=
{
false
}
keyExtractor
=
{(
item
)
=>
item
.
id
}
keyExtractor
=
{(
item
)
=>
item
.
id
}
...
...
src/Screens/NewFeed/Calendar/item.js
View file @
3cbaf332
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
TouchableOpacity
}
from
'react-native'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
import
Block
from
'../../../components/Block'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
...
@@ -7,9 +7,7 @@ import {convertDate} from '../../../Config/Functions';
...
@@ -7,9 +7,7 @@ import {convertDate} from '../../../Config/Functions';
const
Item
=
(
props
)
=>
{
const
Item
=
(
props
)
=>
{
const
{
title
,
date
,
time
,
start_date
}
=
props
.
item
;
const
{
title
,
date
,
time
,
start_date
}
=
props
.
item
;
return
(
return
(
<
TouchableOpacity
<
View
style
=
{
styles
.
container
}
>
onPress
=
{()
=>
console
.
log
(
'hello'
)}
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
left
}
>
<
View
style
=
{
styles
.
left
}
>
<
View
style
=
{
styles
.
dot
}
/
>
<
View
style
=
{
styles
.
dot
}
/
>
<
/View
>
<
/View
>
...
@@ -20,7 +18,7 @@ const Item = (props) => {
...
@@ -20,7 +18,7 @@ const Item = (props) => {
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
title
}
<
/Text
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
title
}
<
/Text
>
<
/View
>
<
/View
>
<
/
TouchableOpacity
>
<
/
View
>
);
);
};
};
...
...
src/Screens/NewFeed/NewFeed.js
View file @
3cbaf332
...
@@ -16,7 +16,7 @@ const NewFeed = (props) => {
...
@@ -16,7 +16,7 @@ const NewFeed = (props) => {
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderDrawer
title
=
{
'Tin tức'
}
isWhite
=
{
true
}
/
>
<
HeaderDrawer
title
=
{
'Tin tức'
}
isWhite
=
{
true
}
/
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
}}
>
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'white'
}}
>
<
Tab
.
Navigator
{
/*
<Tab.Navigator
initialRouteName="GeneralInfor"
initialRouteName="GeneralInfor"
swipeEnabled={false}
swipeEnabled={false}
tabBarOptions={{
tabBarOptions={{
...
@@ -52,6 +52,7 @@ const NewFeed = (props) => {
...
@@ -52,6 +52,7 @@ const NewFeed = (props) => {
options={{tabBarLabel: 'Biểu đồ'}}
options={{tabBarLabel: 'Biểu đồ'}}
/>
/>
</Tab.Navigator>
</Tab.Navigator>
*/
}
<
/View
>
<
/View
>
<
/View
>
<
/View
>
);
);
...
...
src/apis/Functions/Widthdraw.js
View file @
3cbaf332
...
@@ -29,3 +29,8 @@ export const updateMethodBank = async (body) =>
...
@@ -29,3 +29,8 @@ export const updateMethodBank = async (body) =>
PostData
(
url
.
urlUpdateMethodBank
,
body
)
PostData
(
url
.
urlUpdateMethodBank
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
.
catch
((
err
)
=>
err
);
export
const
getListTransaction
=
async
(
body
)
=>
GetData
(
url
.
urlGetListHistory
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
3cbaf332
...
@@ -24,4 +24,7 @@ export default {
...
@@ -24,4 +24,7 @@ export default {
//Home
//Home
urlGetTransaction
:
root
+
'api/v1/customers/statistic-transaction'
,
urlGetTransaction
:
root
+
'api/v1/customers/statistic-transaction'
,
//History
urlGetListHistory
:
root
+
'api/v1/customers/get-list-transaction-history'
,
};
};
src/components/Aleart.js
0 → 100644
View file @
3cbaf332
import
{
Alert
}
from
'react-native'
;
export
const
NotificationAlert
=
(
string
)
=>
{
Alert
.
alert
(
'Thông báo'
,
string
);
};
export
const
confirmAlert
=
(
title
,
callback
)
=>
{
Alert
.
alert
(
'Thông báo'
,
title
,
[
{
text
:
'Hủy'
,
style
:
'cancel'
,
},
{
text
:
'Đồng ý'
,
onPress
:
()
=>
{
callback
();
},
},
],
{
cancelable
:
false
},
);
};
src/components/Aleart.tsx
deleted
100644 → 0
View file @
127b4bc6
//@ts-ignore
import
{
Alert
}
from
'react-native'
;
const
AlertMessage
=
(
message
:
string
,
title
?:
string
,
onPressOk
?:
any
,
cancel
?:
boolean
)
=>
{
Alert
.
alert
(
title
||
''
,
message
,
cancel
?
[
{
text
:
'Đồng ý'
,
onPress
:
()
=>
{
if
(
typeof
onPressOk
===
'function'
)
{
onPressOk
();
}
},
style
:
'default'
,
},
]
:
[
{
text
:
"Từ chối"
,
onPress
:
()
=>
{
if
(
typeof
onPressOk
===
'function'
)
{
onPressOk
();
}
},
},
],
{
cancelable
:
false
},
);
};
export
default
AlertMessage
;
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