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
36a653ff
Commit
36a653ff
authored
Apr 08, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
4314d546
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
478 additions
and
112 deletions
+478
-112
TransferView.js
src/Screens/Action/Transfer/TransferView.js
+18
-2
Home.js
src/Screens/Home/Home.js
+18
-2
HomeView.js
src/Screens/Home/HomeView.js
+15
-8
AddMethod.js
src/Screens/MethodPay/AddMethod.js
+86
-23
Item.js
src/Screens/MethodPay/Item.js
+13
-11
MethodPay.js
src/Screens/MethodPay/MethodPay.js
+28
-2
MethodPayDetail.js
src/Screens/MethodPay/MethodPayDetail.js
+192
-0
MethodPayView.js
src/Screens/MethodPay/MethodPayView.js
+3
-51
Widthdraw.js
src/apis/Functions/Widthdraw.js
+18
-0
users.js
src/apis/Functions/users.js
+6
-1
url.js
src/apis/url.js
+8
-1
Aleart.tsx
src/components/Aleart.tsx
+3
-6
BankInfor.js
src/components/BankInfor.js
+51
-0
HeaderHome.js
src/components/Header/HeaderHome.js
+13
-5
ScreenNames.js
src/routers/ScreenNames.js
+1
-0
StackNavigation.js
src/routers/StackNavigation.js
+5
-0
No files found.
src/Screens/Action/Transfer/TransferView.js
View file @
36a653ff
...
...
@@ -9,7 +9,23 @@ const TransferView = (props) => {
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'Chuyển khoản'
}
/
>
<
View
style
=
{{
flex
:
1
,
paddingHorizontal
:
10
,
paddingTop
:
10
}}
>
<
View
style
=
{{
flex
:
1
,
paddingHorizontal
:
20
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
}}
>
<
Text
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
textAlign
:
'center'
,
}}
>
T
í
nh
n
ă
ng
đ
ang
đượ
c
ph
á
t
tri
ể
n
,
vui
l
ò
ng
quay
l
ạ
i
sau
!
<
/Text
>
<
/View
>
{
/* <View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}>
<TextField
onChangeText={(val) => consoele.log(val)}
title={'Số tiền'}
...
...
@@ -26,7 +42,7 @@ const TransferView = (props) => {
</View>
<View style={styles.containerBtn}>
<Button title={'Chuyển tiền'} />
<
/View
>
</View>
*/
}
<
/View
>
);
};
...
...
src/Screens/Home/Home.js
View file @
36a653ff
import
React
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
View
,
Alert
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
{
getTransaction
}
from
'../../apis/Functions/users'
;
import
HomeView
from
'./HomeView'
;
const
Home
=
(
props
)
=>
{
return
<
HomeView
/>
;
const
[
data
,
setData
]
=
useState
({
total_deposit
:
0
,
total_withdraw
:
0
});
useEffect
(()
=>
{
getData
();
},
[]);
const
getData
=
async
()
=>
{
const
res
=
await
getTransaction
({});
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
setData
(
res
.
data
.
data
);
}
else
{
Alert
.
alert
(
'Thông báo!'
,
'Không lấy được thông tin!'
);
}
};
return
<
HomeView
data
=
{
data
}
/>
;
};
const
mapStateToProps
=
(
state
)
=>
{
...
...
src/Screens/Home/HomeView.js
View file @
36a653ff
...
...
@@ -11,6 +11,7 @@ import Footer from './Footer';
import
{
HEIGHT
,
HEIGHTXD
,
toPriceVnd
,
getFontXD
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
const
HomeView
=
(
props
)
=>
{
const
{
total_deposit
,
total_withdraw
}
=
props
.
data
;
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderHome
/>
...
...
@@ -24,14 +25,22 @@ const HomeView = (props) => {
<
View
style
=
{
styles
.
row
}
>
<
View
style
=
{
styles
.
itemMenu
}
>
<
Text
style
=
{
styles
.
txtTitle
}
>
N
ạ
p
ti
ề
n
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
toPriceVnd
(
1000000
)}
Đ
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
' '
}
{
total_deposit
==
0
?
0
:
toPriceVnd
(
total_deposit
)}
Đ
{
' '
}
<
/Text
>
<
/View
>
<
View
style
=
{{
width
:
0.5
,
backgroundColor
:
R
.
colors
.
borderGray
}}
/
>
<
View
style
=
{
styles
.
itemMenu
}
>
<
Text
style
=
{
styles
.
txtTitle
}
>
R
ú
t
ti
ề
n
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
toPriceVnd
(
1000000
)}
Đ
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
' '
}
{
total_withdraw
==
0
?
0
:
toPriceVnd
(
total_withdraw
)}
Đ
{
' '
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
...
...
@@ -39,17 +48,14 @@ const HomeView = (props) => {
<
View
style
=
{
styles
.
row
}
>
<
View
style
=
{
styles
.
itemMenu
}
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Hoa
h
ồ
ng
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney1
}
>+
{
toPriceVnd
(
1000000
)}
Đ
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney1
}
>+
0
Đ
<
/Text
>
<
/View
>
<
View
style
=
{{
width
:
0.5
,
backgroundColor
:
R
.
colors
.
borderGray
}}
/
>
<
View
style
=
{
styles
.
itemMenu
}
>
<
Text
style
=
{
styles
.
txtTitle
}
>
L
ợ
i
nhu
ậ
n
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney1
}
>
{
' '
}
+
{
toPriceVnd
(
1000000
)}
Đ
{
' '
}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney1
}
>
0
Đ
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
...
...
@@ -99,8 +105,9 @@ const styles = StyleSheet.create({
},
txtTitle
:
{
fontSize
:
getFontXD
(
36
),
color
:
R
.
colors
.
txtMain2
,
color
:
'#00359C'
,
textTransform
:
'uppercase'
,
fontWeight
:
'bold'
,
},
txtMoney
:
{
fontSize
:
getFontXD
(
42
),
...
...
src/Screens/MethodPay/AddMethod.js
View file @
36a653ff
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
View
,
Text
,
...
...
@@ -6,57 +6,112 @@ import {
FlatList
,
Dimensions
,
TouchableOpacity
,
Alert
,
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
R
from
'../../assets/R'
;
import
HeaderBack
from
'../../components/Header/HeaderBack'
;
import
Item
from
'./Item'
;
import
{
getFontXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
getFontXD
,
WIDTHXD
,
checkFormatArray
}
from
'../../Config/Functions'
;
import
TextField
from
'../../components/Input/TextField'
;
import
PickerItem
from
'../../components/Picker/PickerItem'
;
import
{
getListBank
,
addMethodBank
}
from
'../../apis/Functions/Widthdraw'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
{
width
}
=
Dimensions
.
get
(
'window'
);
const
dataTest
=
[
{
value
:
'1'
,
name
:
'Vietnamese'
,
},
{
value
:
'2'
,
name
:
'English'
,
},
];
const
AddMethodPay
=
(
props
)
=>
{
const
[
language
,
setLanguage
]
=
useState
(
dataTest
[
0
].
name
);
const
[
data
,
setData
]
=
useState
([]);
const
navigate
=
useNavigation
();
const
[
bank_id
,
setBankID
]
=
useState
();
const
[
branch_name
,
setBankName
]
=
useState
();
const
[
account_name
,
setAccountName
]
=
useState
();
const
[
account_no
,
setAccountNo
]
=
useState
();
useEffect
(()
=>
{
getData
();
},
[]);
const
getData
=
async
()
=>
{
const
res
=
await
getListBank
({
platform
:
Platform
.
OS
,
});
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
setData
(
res
.
data
.
data
);
}
else
{
alert
(
'Không lấy được danh sách ngân hàng!'
);
}
};
const
onLick
=
async
()
=>
{
const
titles
=
[
'ngân hàng'
,
'chi nhánh'
,
'chủ tài khoản'
,
'số tài khoản ngân hàng'
,
];
const
index
=
checkFormatArray
([
bank_id
,
branch_name
,
account_name
,
account_no
,
]);
if
(
index
===
true
)
{
props
.
showLoading
();
const
res
=
await
addMethodBank
({
platform
:
Platform
.
OS
,
bank_id
:
bank_id
.
id
,
branch_name
,
account_name
,
account_no
,
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
navigate
.
goBack
();
},
500
);
}
else
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
},
500
);
}
}
else
{
Alert
.
alert
(
'Vui lòng điền '
+
titles
[
index
]);
}
};
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'Thêm phương thức thanh toán'
}
/
>
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Ch
ọ
n
ng
â
n
h
à
ng
<
/Text
>
<
PickerItem
defaultValue
=
{
language
}
value
=
{
language
}
data
=
{
dataTest
}
value
=
{
bank_id
}
data
=
{
data
}
onValueChange
=
{(
value
,
items
)
=>
{
set
Language
(
items
.
name
);
set
BankID
(
items
);
}}
/
>
<
TextField
onChangeText
=
{(
val
)
=>
consoele
.
log
(
val
)}
onChangeText
=
{(
val
)
=>
setBankName
(
val
)}
title
=
{
'Chi nhánh'
}
/
>
<
TextField
onChangeText
=
{(
val
)
=>
consoele
.
log
(
val
)}
onChangeText
=
{(
val
)
=>
setAccountName
(
val
)}
title
=
{
'Tên chủ tài khoản'
}
/
>
<
TextField
onChangeText
=
{(
val
)
=>
consoele
.
log
(
val
)}
onChangeText
=
{(
val
)
=>
setAccountNo
(
val
)}
title
=
{
'Số tài khoản ngân hàng'
}
isNumber
=
{
true
}
/
>
<
/View
>
<
TouchableOpacity
style
=
{
styles
.
btn
}
>
<
TouchableOpacity
onPress
=
{
onLick
}
style
=
{
styles
.
btn
}
>
<
Text
style
=
{
styles
.
txtAdd
}
>
Th
ê
m
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
...
...
@@ -93,4 +148,12 @@ const styles = StyleSheet.create({
},
});
export
default
AddMethodPay
;
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
,
})(
AddMethodPay
);
src/Screens/MethodPay/Item.js
View file @
36a653ff
...
...
@@ -4,26 +4,29 @@ import {getFontXD, HEIGHTXD, WIDTHXD, toPriceVnd} from '../../Config/Functions';
import
R
from
'../../assets/R'
;
import
Block
from
'../../components/Block'
;
import
Icon
from
'react-native-vector-icons/MaterialCommunityIcons'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
METHODPAYDETAIL
}
from
'../../routers/ScreenNames'
;
const
Item
=
(
props
)
=>
{
const
navigate
=
useNavigation
();
const
{
item
}
=
props
;
return
(
<
TouchableOpacity
onPress
=
{()
=>
console
.
log
(
'HEllo'
)}
>
<
TouchableOpacity
onPress
=
{()
=>
navigate
.
navigate
(
METHODPAYDETAIL
,
item
)}
>
<
View
style
=
{
styles
.
container
}
>
<
Block
flex
=
{
1
}
row
center
padding
=
{[
10
,
20
]}
>
<
Image
source
=
{
item
.
image
}
style
=
{
styles
.
imgIcon
}
/
>
<
Image
source
=
{
{
uri
:
item
.
bank
.
logo
}
}
style
=
{
styles
.
imgIcon
}
/
>
<
Block
padding
=
{[
0
,
10
]}
>
<
Text
style
=
{
styles
.
txtBig
}
>
{
item
.
title
}
<
/Text
>
<
Block
space
=
{
'between'
}
margin
=
{[
10
,
0
,
0
,
0
]}
row
flex
=
{
1
}
>
<
Block
space
=
{
'between'
}
row
flex
=
{
1
}
>
<
Block
>
<
Text
style
=
{
styles
.
txtLeft
}
>
Ti
ề
n
n
ạ
p
t
ố
i
thi
ể
u
<
/Text
>
<
Text
style
=
{
styles
.
txtLeft
}
>
Hoa
h
ồ
ng
<
/Text
>
<
Text
style
=
{
styles
.
txtLeft
}
>
Th
ờ
i
gian
<
/Text
>
<
Text
style
=
{
styles
.
txtLeft
}
>
Ch
ủ
TK
<
/Text
>
<
Text
style
=
{
styles
.
txtLeft
}
>
STK
<
/Text
>
<
Text
style
=
{
styles
.
txtLeft
}
>
Chi
nh
á
nh
<
/Text
>
<
/Block
>
<
Block
>
<
Text
style
=
{
styles
.
txtRight
}
>
{
item
.
minPay
}
USD
<
/Text
>
<
Text
style
=
{
styles
.
txtRight
}
>
{
item
.
rose
}
USD
<
/Text
>
<
Text
style
=
{
styles
.
txtRight
}
>
{
item
.
ti
me
}
<
/Text
>
<
Text
style
=
{
styles
.
txtRight
}
>
{
item
.
account_name
}
<
/Text
>
<
Text
style
=
{
styles
.
txtRight
}
>
{
item
.
account_no
}
<
/Text
>
<
Text
style
=
{
styles
.
txtRight
}
>
{
item
.
branch_na
me
}
<
/Text
>
<
/Block
>
<
/Block
>
<
/Block
>
...
...
@@ -97,7 +100,6 @@ const styles = StyleSheet.create({
},
txtRight
:
{
fontSize
:
getFontXD
(
36
),
fontWeight
:
'bold'
,
marginBottom
:
5
,
},
});
src/Screens/MethodPay/MethodPay.js
View file @
36a653ff
import
React
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
MethodPayView
from
'./MethodPayView'
;
import
{
getListWidthDraw
}
from
'../../apis/Functions/Widthdraw'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
MethodPay
=
(
props
)
=>
{
return
<
MethodPayView
/>
;
const
[
data
,
setData
]
=
useState
([]);
const
[
isRefresh
,
setRefresh
]
=
useState
(
true
);
const
navigation
=
useNavigation
();
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
'focus'
,
()
=>
{
getData
();
});
return
unsubscribe
;
},
[
navigation
]);
const
getData
=
async
()
=>
{
const
res
=
await
getListWidthDraw
({
platform
:
Platform
.
OS
,
});
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
)
{
setData
(
res
.
data
.
data
);
}
else
{
alert
(
'Không lấy được danh sách phương thức thanh toán!'
);
}
};
return
<
MethodPayView
listMethod
=
{
data
}
/>
;
};
export
default
MethodPay
;
src/Screens/MethodPay/MethodPayDetail.js
0 → 100644
View file @
36a653ff
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
FlatList
,
Dimensions
,
TouchableOpacity
,
Alert
,
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
R
from
'../../assets/R'
;
import
HeaderBack
from
'../../components/Header/HeaderBack'
;
import
Item
from
'./Item'
;
import
{
getFontXD
,
WIDTHXD
,
checkFormatArray
}
from
'../../Config/Functions'
;
import
TextField
from
'../../components/Input/TextField'
;
import
PickerItem
from
'../../components/Picker/PickerItem'
;
import
{
deleteMethodBank
,
addMethodBank
,
updateMethodBank
,
}
from
'../../apis/Functions/Widthdraw'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
BankInfor
from
'../../components/BankInfor'
;
const
{
width
}
=
Dimensions
.
get
(
'window'
);
const
MethodPayDetail
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
([]);
const
{
params
}
=
props
.
route
;
const
[
disable
,
setDisable
]
=
useState
(
true
);
const
navigate
=
useNavigation
();
const
[
branch_name
,
setBankName
]
=
useState
(
params
.
branch_name
);
const
[
account_name
,
setAccountName
]
=
useState
(
params
.
account_name
);
const
[
account_no
,
setAccountNo
]
=
useState
(
params
.
account_no
);
const
onUpdate
=
async
()
=>
{
const
titles
=
[
'chi nhánh'
,
'chủ tài khoản'
,
'số tài khoản ngân hàng'
];
const
index
=
checkFormatArray
([
branch_name
,
account_name
,
account_no
]);
console
.
log
(
'Index'
,
index
);
if
(
index
===
true
)
{
if
(
branch_name
!=
params
.
branch_name
||
account_name
!=
params
.
account_name
||
account_no
!=
params
.
account_no
)
{
props
.
showLoading
();
const
res
=
await
updateMethodBank
({
platform
:
Platform
.
OS
,
id
:
params
.
id
,
branch_name
,
account_name
,
account_no
,
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
navigate
.
goBack
();
},
500
);
}
else
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
},
500
);
}
}
else
{
Alert
.
alert
(
'Thông báo!'
,
'Không có gì thay đổi'
);
}
}
else
Alert
.
alert
(
'Thông báo!'
,
'Vui lòng điền '
+
titles
[
index
]);
};
const
onRemove
=
async
()
=>
{
props
.
showLoading
();
const
res
=
await
deleteMethodBank
({
platform
:
Platform
.
OS
,
id
:
params
.
id
,
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
navigate
.
goBack
();
},
500
);
}
else
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
},
500
);
}
};
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'Chi tiết phương thức'
}
/
>
<
View
style
=
{
styles
.
container
}
>
<
BankInfor
linkImg
=
{
params
.
bank
.
logo
}
title
=
{
'Chọn ngân hàng'
}
value
=
{
params
.
bank
.
name
}
/
>
<
TextField
onChangeText
=
{(
val
)
=>
setBankName
(
val
)}
title
=
{
'Chi nhánh'
}
value
=
{
branch_name
}
/
>
<
TextField
onChangeText
=
{(
val
)
=>
setAccountName
(
val
)}
title
=
{
'Tên chủ tài khoản'
}
value
=
{
account_name
}
/
>
<
TextField
onChangeText
=
{(
val
)
=>
setAccountNo
(
val
)}
title
=
{
'Số tài khoản ngân hàng'
}
isNumber
=
{
true
}
value
=
{
account_no
}
/
>
<
/View
>
<
TouchableOpacity
onPress
=
{
onUpdate
}
style
=
{
styles
.
btnLeft
}
>
<
Text
style
=
{
styles
.
txtAdd
}
>
C
ậ
p
nh
ậ
t
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
Alert
.
alert
(
'Thông báo!'
,
'Bạn có chắc chắn muốn xoá phương thức thanh toán'
,
[
{
text
:
'Từ chối'
,
style
:
'cancel'
,
},
{
text
:
'Đồng ý'
,
onPress
:
()
=>
onRemove
()},
],
);
}}
style
=
{
styles
.
btnRight
}
>
<
Text
style
=
{
styles
.
txtAdd
}
>
Xo
á
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
);
};
const
styles
=
StyleSheet
.
create
({
container
:
{
paddingHorizontal
:
20
,
paddingTop
:
10
,
},
btnLeft
:
{
width
:
150
,
height
:
40
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
backgroundColor
:
R
.
colors
.
main
,
borderRadius
:
5
,
position
:
'absolute'
,
bottom
:
30
,
left
:
20
,
},
btnRight
:
{
width
:
150
,
height
:
40
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
backgroundColor
:
R
.
colors
.
main
,
borderRadius
:
5
,
position
:
'absolute'
,
bottom
:
30
,
right
:
20
,
},
txtAdd
:
{
color
:
R
.
colors
.
white
,
fontSize
:
getFontXD
(
46
),
textTransform
:
'uppercase'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
color777
,
marginBottom
:
5
,
},
});
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
,
})(
MethodPayDetail
);
src/Screens/MethodPay/MethodPayView.js
View file @
36a653ff
...
...
@@ -7,59 +7,10 @@ import {WIDTHXD} from '../../Config/Functions';
import
Icon
from
'react-native-vector-icons/Entypo'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
ADDMETHODPAY
}
from
'../../routers/ScreenNames'
;
const
data
=
[
{
image
:
R
.
images
.
iconNganLuong
,
title
:
'Ngân lượng'
,
rose
:
0
,
time
:
'Tức thời'
,
minPay
:
5
,
id
:
'1'
,
},
{
image
:
R
.
images
.
iconVisa
,
title
:
'Visa bank'
,
rose
:
0
,
time
:
'Tức thời'
,
minPay
:
1
,
id
:
'2'
,
},
{
image
:
R
.
images
.
iconInternet
,
title
:
'Internet banking'
,
rose
:
0
,
time
:
'Tức thời'
,
minPay
:
5
,
id
:
'3'
,
},
{
image
:
R
.
images
.
iconBitcoin
,
title
:
'Bitcoin'
,
rose
:
0
,
time
:
'Tức thời'
,
minPay
:
2
,
id
:
'4'
,
},
{
image
:
R
.
images
.
iconSticpay
,
title
:
'Sticpay'
,
rose
:
0
,
time
:
'Tức thời'
,
minPay
:
1
,
id
:
'5'
,
},
{
image
:
R
.
images
.
iconTether
,
title
:
'Tether'
,
rose
:
0
,
time
:
'Tức thời'
,
minPay
:
10
,
id
:
'6'
,
},
];
const
MethodPayView
=
(
props
)
=>
{
const
navigate
=
useNavigation
();
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'Cài đặt phương thức thanh toán'
}
/
>
...
...
@@ -67,7 +18,8 @@ const MethodPayView = (props) => {
<
FlatList
keyExtractor
=
{(
item
)
=>
item
.
id
}
showsVerticalScrollIndicator
=
{
false
}
data
=
{
data
}
onEndReachedThreshold
=
{
0.01
}
data
=
{
props
.
listMethod
}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
/>
}
/>
...
...
src/apis/Functions/Widthdraw.js
View file @
36a653ff
...
...
@@ -11,3 +11,21 @@ export const widthDraw = async (body) =>
PostData
(
url
.
urlWithdraw
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
getListBank
=
async
(
body
)
=>
GetData
(
url
.
urlListBank
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
addMethodBank
=
async
(
body
)
=>
PostData
(
url
.
urlAddMethodBank
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
deleteMethodBank
=
async
(
body
)
=>
PostData
(
url
.
urlDeleteMethodBank
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
updateMethodBank
=
async
(
body
)
=>
PostData
(
url
.
urlUpdateMethodBank
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/Functions/users.js
View file @
36a653ff
import
{
PostLogin
,
PostData
,
PostFormData
}
from
'../helpers'
;
import
{
PostLogin
,
PostData
,
GetData
,
PostFormData
}
from
'../helpers'
;
import
url
from
'../url'
;
...
...
@@ -36,3 +36,8 @@ export const verifyAccountApi = async (body) =>
PostFormData
(
url
.
urlVerifyAccount
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
getTransaction
=
async
(
body
)
=>
GetData
(
url
.
urlGetTransaction
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
36a653ff
...
...
@@ -14,7 +14,14 @@ export default {
urlMediaDetail
:
root
+
'api/v1/videos/detail'
,
urlGetListCalendar
:
root
+
'api/v1/news/calendar'
,
//
Withdraw
//
Methodpay
urlGetListWithDraw
:
root
+
'api/v1/payments/get-list-withdraw-method'
,
urlWithdraw
:
root
+
'api/v1/customers/request-withdraw'
,
urlListBank
:
root
+
'api/v1/payments/get-list-bank'
,
urlAddMethodBank
:
root
+
'api/v1/customers/store-payment-method'
,
urlDeleteMethodBank
:
root
+
'api/v1/customers/delete-payment-method'
,
urlUpdateMethodBank
:
root
+
'api/v1/customers/update-payment-method'
,
//Home
urlGetTransaction
:
root
+
'api/v1/customers/statistic-transaction'
,
};
src/components/Aleart.tsx
View file @
36a653ff
...
...
@@ -7,12 +7,9 @@ const AlertMessage = (message: string, title?: string, onPressOk?: any, cancel?:
message
,
cancel
?
[
{
text
:
"Hien thi btn khong"
,
style
:
'default'
,
},
{
text
:
'Title btn co'
,
text
:
'Đồng ý'
,
onPress
:
()
=>
{
if
(
typeof
onPressOk
===
'function'
)
{
onPressOk
();
...
...
@@ -23,7 +20,7 @@ const AlertMessage = (message: string, title?: string, onPressOk?: any, cancel?:
]
:
[
{
text
:
"
Hien thi thong bao khong co cancel
"
,
text
:
"
Từ chối
"
,
onPress
:
()
=>
{
if
(
typeof
onPressOk
===
'function'
)
{
onPressOk
();
...
...
src/components/BankInfor.js
0 → 100644
View file @
36a653ff
import
React
from
'react'
;
import
{
View
,
Text
,
TextInput
,
Image
}
from
'react-native'
;
import
{
HEIGHTXD
,
WIDTHXD
,
getFontXD
}
from
'../Config/Functions'
;
import
R
from
'../assets/R'
;
const
TextField
=
(
props
)
=>
{
const
{
title
,
value
,
linkImg
}
=
props
;
return
(
<
View
style
=
{{
marginVertical
:
5
}}
>
<
Text
style
=
{{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
color777
,
marginBottom
:
5
,
}}
>
{
title
?
title
:
''
}
<
/Text
>
<
View
style
=
{{
height
:
HEIGHTXD
(
109
),
borderRadius
:
7
,
borderWidth
:
0.7
,
flexDirection
:
'row'
,
borderColor
:
'#DBDBDB'
,
fontSize
:
getFontXD
(
42
),
paddingVertical
:
5
,
paddingHorizontal
:
10
,
backgroundColor
:
'#E9E9E9'
,
shadowColor
:
'#AFA9A9'
,
shadowOffset
:
{
width
:
0
,
height
:
1
,
},
shadowOpacity
:
0.25
,
shadowRadius
:
1.84
,
elevation
:
1
,
alignItems
:
'center'
,
}}
>
<
Image
resizeMode
=
{
'contain'
}
source
=
{{
uri
:
linkImg
}}
style
=
{{
width
:
50
,
height
:
HEIGHTXD
(
109
),
marginRight
:
10
}}
/
>
<
Text
numberOfLines
=
{
1
}
>
{
value
}
<
/Text
>
<
/View
>
<
/View
>
);
};
export
default
React
.
memo
(
TextField
);
src/components/Header/HeaderHome.js
View file @
36a653ff
...
...
@@ -30,7 +30,7 @@ import {
WALLETWITHDRAW
,
}
from
'../../routers/ScreenNames'
;
const
renderWallet
=
(
status
)
=>
{
const
renderWallet
=
(
status
,
current_money
,
current_cqg_money
)
=>
{
const
navigate
=
useNavigation
();
if
(
status
==
3
)
return
(
...
...
@@ -38,16 +38,19 @@ const renderWallet = (status) => {
<
View
style
=
{
styles
.
containerWallet
}
>
<
Text
style
=
{
styles
.
txtWallet
}
>
T
à
i
kho
ả
n
v
í
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
toPriceVnd
(
1000000
)}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
current_money
==
0
?
0
:
toPriceVnd
(
current_money
)}
<
/Text
>
<
Text
style
=
{
styles
.
txtUnit
}
>
Đ
<
/Text
>
<
/View
>
<
/View
>
<
View
style
=
{{
width
:
1
,
backgroundColor
:
'#EDEDF1'
,
height
:
'100%'
}}
/
>
<
View
style
=
{
styles
.
containerWallet
}
>
<
Text
style
=
{
styles
.
txtWallet
}
>
T
à
i
kho
ả
n
CQG
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
toPriceVnd
(
1000000
)}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
current_cqg_money
==
0
?
0
:
toPriceVnd
(
current_cqg_money
)}
<
/Text
>
<
Text
style
=
{
styles
.
txtUnit
}
>
Đ
<
/Text
>
<
/View
>
<
/View
>
...
...
@@ -105,6 +108,7 @@ const renderLabel = (status) => {
const
HeaderHome
=
(
props
)
=>
{
const
navigate
=
useNavigation
();
console
.
log
(
props
.
user
);
const
copyToClipboard
=
()
=>
{
Alert
.
alert
(
'Đã sao chép link giới thiệu!'
);
...
...
@@ -151,7 +155,11 @@ const HeaderHome = (props) => {
<
/View
>
<
View
style
=
{
styles
.
wrapWallet
}
>
{
renderWallet
(
props
.
user
.
status
)}
{
renderWallet
(
props
.
user
.
status
,
props
.
user
.
current_money
,
props
.
user
.
current_cqg_money
,
)}
<
/View
>
<
View
style
=
{
styles
.
containerMenu
}
>
<
TouchableOpacity
...
...
src/routers/ScreenNames.js
View file @
36a653ff
...
...
@@ -57,3 +57,4 @@ export const WALLETDEPOSIT = 'WALLETDEPOSIT';
export
const
WALLETWITHDRAW
=
'WALLETWITHDRAW'
;
export
const
PACKETCQG
=
'PACKETCQG'
;
export
const
MEDIADETAIL
=
'MEDIADETAIL'
;
export
const
METHODPAYDETAIL
=
'METHODPAYDETAIL'
;
src/routers/StackNavigation.js
View file @
36a653ff
...
...
@@ -38,6 +38,7 @@ import WalletDeposit from '../Screens/Action/Wallet/WalletDeposit';
import
WalletWithdraw
from
'../Screens/Action/Wallet/WalletWithdraw'
;
import
PacketCQG
from
'../Screens/Account/PacrtCQG/PacketCQG'
;
import
MediaDetail
from
'../Screens/NewFeed/Media/MediaDetail'
;
import
MethodPayDetail
from
'../Screens/MethodPay/MethodPayDetail'
;
import
*
as
ScreenName
from
'./ScreenNames'
;
...
...
@@ -59,6 +60,10 @@ function MyStack(props) {
<
Stack
.
Screen
name
=
{
ScreenName
.
WALLET
}
component
=
{
Wallet
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
WALLETDEPOSIT
}
component
=
{
WalletDeposit
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
METHODPAYDETAIL
}
component
=
{
MethodPayDetail
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
WALLETWITHDRAW
}
component
=
{
WalletWithdraw
}
/
>
...
...
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