Commit d29b6433 by Giang Tran

verify account

parent 1c89bb15
...@@ -902,7 +902,7 @@ ...@@ -902,7 +902,7 @@
); );
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3; MARKETING_VERSION = 1.4;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
...@@ -930,7 +930,7 @@ ...@@ -930,7 +930,7 @@
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.3; MARKETING_VERSION = 1.4;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>dcv.investcustomer.vn</string>
</array>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
...@@ -38,7 +42,7 @@ ...@@ -38,7 +42,7 @@
</dict> </dict>
</dict> </dict>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string/> <string></string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>To upload images</string> <string>To upload images</string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
...@@ -71,10 +75,6 @@ ...@@ -71,10 +75,6 @@
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
</array> </array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>dcv.investcustomer.vn</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
</dict> </dict>
......
...@@ -388,6 +388,8 @@ PODS: ...@@ -388,6 +388,8 @@ PODS:
- ReactCommon/callinvoker (= 0.62.2) - ReactCommon/callinvoker (= 0.62.2)
- RNCAsyncStorage (1.12.1): - RNCAsyncStorage (1.12.1):
- React-Core - React-Core
- RNCClipboard (1.7.0):
- React-Core
- RNCMaskedView (0.1.10): - RNCMaskedView (0.1.10):
- React - React
- RNFirebase (5.6.0): - RNFirebase (5.6.0):
...@@ -475,6 +477,7 @@ DEPENDENCIES: ...@@ -475,6 +477,7 @@ DEPENDENCIES:
- ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`) - ReactCommon/callinvoker (from `../node_modules/react-native/ReactCommon`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)" - "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
- "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)" - "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
- RNFirebase (from `../node_modules/react-native-firebase/ios`) - RNFirebase (from `../node_modules/react-native-firebase/ios`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
...@@ -574,6 +577,8 @@ EXTERNAL SOURCES: ...@@ -574,6 +577,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon" :path: "../node_modules/react-native/ReactCommon"
RNCAsyncStorage: RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage" :path: "../node_modules/@react-native-community/async-storage"
RNCClipboard:
:path: "../node_modules/@react-native-clipboard/clipboard"
RNCMaskedView: RNCMaskedView:
:path: "../node_modules/@react-native-community/masked-view" :path: "../node_modules/@react-native-community/masked-view"
RNFirebase: RNFirebase:
...@@ -648,6 +653,7 @@ SPEC CHECKSUMS: ...@@ -648,6 +653,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256 React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3 ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
RNCAsyncStorage: b03032fdbdb725bea0bd9e5ec5a7272865ae7398 RNCAsyncStorage: b03032fdbdb725bea0bd9e5ec5a7272865ae7398
RNCClipboard: 245417a78ab585e0d4d83926c28907e7b2bc24bd
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
RNFirebase: 37daa9a346d070f9f6ee1f3b4aaf4c8e3b1d5d1c RNFirebase: 37daa9a346d070f9f6ee1f3b4aaf4c8e3b1d5d1c
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
...@@ -659,6 +665,6 @@ SPEC CHECKSUMS: ...@@ -659,6 +665,6 @@ SPEC CHECKSUMS:
Yoga: 3ebccbdd559724312790e7742142d062476b698e Yoga: 3ebccbdd559724312790e7742142d062476b698e
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: 2aa97f909c94cc3768d9dc69401b7c62cac7d757 PODFILE CHECKSUM: 6c1aab2c5d54fffaeb8b43c847c486a421cbfebc
COCOAPODS: 1.10.1 COCOAPODS: 1.10.1
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
"lint": "eslint ." "lint": "eslint ."
}, },
"dependencies": { "dependencies": {
"@react-native-clipboard/clipboard": "^1.7.0",
"@react-native-community/async-storage": "^1.12.1", "@react-native-community/async-storage": "^1.12.1",
"@react-native-community/masked-view": "^0.1.10", "@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.11.7", "@react-navigation/bottom-tabs": "^5.11.7",
......
...@@ -234,8 +234,8 @@ export const convertDate = (date) => { ...@@ -234,8 +234,8 @@ export const convertDate = (date) => {
}; };
export const convertTime = (date) => { export const convertTime = (date) => {
const time = moment(date).format('DD/MM/YYYY HH:mm'); const time = moment(date).format('YYYY-MM-DD');
return time.substring(11, 16); return time;
}; };
export const getTimeDDMM = (time) => { export const getTimeDDMM = (time) => {
......
...@@ -16,41 +16,34 @@ const Tab = createMaterialTopTabNavigator(); ...@@ -16,41 +16,34 @@ const Tab = createMaterialTopTabNavigator();
const AccountVerificationView = (props) => { const AccountVerificationView = (props) => {
return ( return (
<KeyboardAvoidingView <View style={{flex: 1}}>
behavior={Platform.Os === 'ios' ? 'padding' : 'height'} <HeaderBack isWhite={true} title={'Xác minh tài khoản'} />
style={{flex: 1}} <Tab.Navigator
keyboardVerticalOffset={-50}> initialRouteName="GeneralInfor"
<ScrollView showsVerticalScrollIndicator={false}> tabBarOptions={{
<View style={{flex: 1}}> inactiveTintColor: '#929292',
<HeaderBack isWhite={true} title={'Xác minh tài khoản'} /> activeTintColor: '#1473E6',
<Tab.Navigator labelStyle: {fontSize: getFontXD(36)},
initialRouteName="GeneralInfor" style: {backgroundColor: 'white'},
tabBarOptions={{ scrollEnabled: true,
inactiveTintColor: '#929292', }}>
activeTintColor: '#1473E6', <Tab.Screen
labelStyle: {fontSize: getFontXD(36)}, name="GeneralInfor"
style: {backgroundColor: 'white'}, component={GeneralInfor}
scrollEnabled: true, options={{tabBarLabel: 'Thông tin chung'}}
}}> />
<Tab.Screen <Tab.Screen
name="GeneralInfor" name="Profile"
component={GeneralInfor} component={Profile}
options={{tabBarLabel: 'Thông tin chung'}} options={{tabBarLabel: 'Hồ sơ'}}
/> />
<Tab.Screen <Tab.Screen
name="Profile" name="BankInfor"
component={Profile} component={BankInfor}
options={{tabBarLabel: 'Hồ sơ'}} options={{tabBarLabel: 'Ngân hàng'}}
/> />
<Tab.Screen </Tab.Navigator>
name="BankInfor" </View>
component={BankInfor}
options={{tabBarLabel: 'Ngân hàng'}}
/>
</Tab.Navigator>
</View>
</ScrollView>
</KeyboardAvoidingView>
); );
}; };
......
import React from 'react'; import React, {useState} from 'react';
import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native'; import {
View,
Text,
TouchableOpacity,
Image,
StyleSheet,
KeyboardAvoidingView,
ScrollView,
Platform,
Dimensions,
Alert,
} from 'react-native';
import TextField from '../../../components/Input/TextField'; import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import {checkFormatArray, getFontXD} from '../../../Config/Functions';
import PickerDate from '../../../components/Picker/PickerDate'; import PickerDate from '../../../components/Picker/PickerDate';
import R from '../../../assets/R'; import R from '../../../assets/R';
import Button from '../../../components/Button'; import Button from '../../../components/Button';
import PickerItem from '../../../components/Picker/PickerItem';
import {verifyAccountApi} from '../../../apis/Functions/users';
const {width} = Dimensions.get('window');
const dataType = [
{
value: '0',
name: 'Tài khoản ngân hàng',
},
{
value: '1',
name: 'Tài khoản thẻ',
},
];
const BankInfor = (props) => { const BankInfor = (props) => {
console.log(props.route.params); const [type, setType] = useState();
const [acc_type, setAccType] = useState('');
const [account_no, setAccountNo] = useState('');
const createFormData = (identity_after, identity_before, sign_img, body) => {
const data = new FormData();
console.log(identity_after);
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 = ['loại thẻ', 'mã ngân hàng', 'số thẻ/tài khoản'];
const index = checkFormatArray([type, acc_type, account_no]);
console.log(props.route.params.body);
if (index === true) {
const data = createFormData(
props.route.params.img.urlBack,
props.route.params.img.urlFont,
props.route.params.img.urlSign,
{
uid: 17,
acc_type: 0,
account_no: '123465789',
bank_no: '970423',
...props.route.params.body,
},
);
const res = await verifyAccountApi(data);
console.log('Response', res.data);
} else {
Alert.alert('Vui lòng điền ' + titles[index]);
}
};
return ( return (
<View <KeyboardAvoidingView
style={{ behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
flex: 1, style={{flex: 1}}
paddingHorizontal: 10, keyboardVerticalOffset={-50}>
paddingTop: 10, <ScrollView showsVerticalScrollIndicator={false}>
}}> <View
<TextField title={'Loại thẻ'} onChangeText={(val) => console.log(val)} /> style={{
<TextField title={'Số thẻ'} onChangeText={(val) => console.log(val)} /> flex: 1,
<PickerDate title={'Ngày cấp'} /> paddingHorizontal: 10,
paddingTop: 10,
<View style={styles.btnSend}> }}>
<Button title={'Xác minh'} /> <Text
</View> style={{
</View> fontSize: getFontXD(42),
color: R.colors.color777,
}}>
Loi th
</Text>
<PickerItem
width={width - 20}
data={dataType}
onValueChange={(value, items) => {
setType(items);
}}
/>
<TextField
isNumber={true}
title={'Mã ngân hàng'}
onChangeText={(val) => setAccType(val)}
/>
<TextField
title={'Số thẻ/tài khoản'}
isNumber={true}
onChangeText={(val) => setAccountNo(val)}
/>
<View style={styles.btnSend}>
<Button title={'Xác minh'} onClick={onPress} />
</View>
</View>
</ScrollView>
</KeyboardAvoidingView>
); );
}; };
......
...@@ -6,6 +6,9 @@ import { ...@@ -6,6 +6,9 @@ import {
TouchableOpacity, TouchableOpacity,
StyleSheet, StyleSheet,
Alert, Alert,
KeyboardAvoidingView,
ScrollView,
Platform,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
...@@ -14,30 +17,29 @@ import TextMulti from '../../../components/Input/TextMulti'; ...@@ -14,30 +17,29 @@ import TextMulti from '../../../components/Input/TextMulti';
import PickerDate from '../../../components/Picker/PickerDate'; import PickerDate from '../../../components/Picker/PickerDate';
import PickerImg from '../../../components/Picker/PickerImg'; import PickerImg from '../../../components/Picker/PickerImg';
import {checkFormatArray} from '../../../Config/Functions'; import {checkFormatArray, convertTime} from '../../../Config/Functions';
const GeneralInfor = (props) => { const GeneralInfor = (props) => {
const [email, setEmail] = useState('');
const [sponsorID, setSponsorID] = useState('');
const [lastName, setLastName] = useState(''); const [lastName, setLastName] = useState('');
const [firstName, setFirstName] = useState(''); const [firstName, setFirstName] = useState('');
const [email, setEmail] = useState('');
const [phone, setPhone] = useState(''); const [phone, setPhone] = useState('');
const [adress, setAdress] = useState(''); const [address, setAdress] = useState('');
const [birth, setBirth] = useState(new Date()); const [birth, setBirth] = useState(new Date());
const onNextPress = () => { const onNextPress = () => {
const titles = ['email', 'tên', 'họ', 'số điện thoại', 'địa chỉ']; const titles = ['tên', 'họ', 'số điện thoại', 'địa chỉ'];
const index = checkFormatArray([email, lastName, firstName, phone, adress]); const index = checkFormatArray([lastName, firstName, phone, address]);
console.log(props);
if (index === true) { if (index === true) {
props.navigation.navigate('Profile', { props.navigation.navigate('Profile', {
l_name: lastName,
f_name: firstName,
mobile: phone,
birthday: convertTime(birth),
address,
email, email,
lastName,
firstName,
phone,
adress,
sponsorID,
birth,
}); });
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert('Vui lòng điền ' + titles[index]);
...@@ -45,37 +47,50 @@ const GeneralInfor = (props) => { ...@@ -45,37 +47,50 @@ const GeneralInfor = (props) => {
}; };
return ( return (
<View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}> <KeyboardAvoidingView
<TextField title={'Email'} onChangeText={(val) => setEmail(val)} /> behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
<TextField style={{flex: 1}}
title={'Sponsor ID'} keyboardVerticalOffset={-50}>
onChangeText={(val) => setSponsorID(val)} <ScrollView showsVerticalScrollIndicator={false}>
/> <View style={{flex: 1, paddingHorizontal: 10, paddingTop: 10}}>
<View style={{flexDirection: 'row'}}> <TextField title={'Email'} onChangeText={(val) => setEmail(val)} />
<View style={{flex: 1}}> <View style={{flexDirection: 'row'}}>
<TextField title={'Tên'} onChangeText={(val) => setLastName(val)} /> <View style={{flex: 1}}>
</View> <TextField
<View style={{width: 20}} /> title={'Tên'}
<View style={{flex: 1}}> onChangeText={(val) => setLastName(val)}
<TextField title={'Họ'} onChangeText={(val) => setFirstName(val)} /> />
</View> </View>
</View> <View style={{width: 20}} />
<TextField <View style={{flex: 1}}>
title={'Số điện thoại'} <TextField
onChangeText={(val) => setPhone(val)} title={'Họ'}
/> onChangeText={(val) => setFirstName(val)}
<PickerDate />
value={birth} </View>
onValueChange={(val) => setBirth(val)} </View>
title={'Ngày sinh'} <TextField
/> isNumber={true}
title={'Số điện thoại'}
onChangeText={(val) => setPhone(val)}
/>
<PickerDate
value={birth}
onValueChange={(val) => setBirth(val)}
title={'Ngày sinh'}
/>
<TextMulti title={'Địa chỉ'} onChangeText={(val) => setAdress(val)} /> <TextMulti title={'Địa chỉ'} onChangeText={(val) => setAdress(val)} />
<TouchableOpacity onPress={onNextPress} style={styles.btnNext}> <TouchableOpacity onPress={onNextPress} style={styles.btnNext}>
<Image style={{width: 30, height: 30}} source={R.images.iconRight1} /> <Image
</TouchableOpacity> style={{width: 30, height: 30}}
<View style={{height: 100}} /> source={R.images.iconRight1}
</View> />
</TouchableOpacity>
<View style={{height: 100}} />
</View>
</ScrollView>
</KeyboardAvoidingView>
); );
}; };
......
...@@ -6,63 +6,140 @@ import { ...@@ -6,63 +6,140 @@ import {
Image, Image,
StyleSheet, StyleSheet,
Alert, Alert,
KeyboardAvoidingView,
ScrollView,
Platform,
Dimensions,
} from 'react-native'; } from 'react-native';
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 {
checkFormatArray,
getFontXD,
convertTime,
} from '../../../Config/Functions';
import PickerDate from '../../../components/Picker/PickerDate';
import PickerItem from '../../../components/Picker/PickerItem';
const {width} = Dimensions.get('window');
import {checkFormatArray} from '../../../Config/Functions'; const dataType = [
{
value: '1',
name: 'Chứng minh nhân dân',
},
{
value: '2',
name: 'Hộ chiếu',
},
{
value: '3',
name: 'Căn cước công dân',
},
];
const Profile = (props) => { 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 [date_range, setDate_range] = useState(new Date());
const [type, setType] = useState();
const onNextPress = () => { const onNextPress = () => {
const titles = ['CNND mặt trước', 'CMND mặt sau', 'chữ ký']; const titles = [
const index = checkFormatArray([urlFont, urlBack, urlSign]); 'loại thẻ',
'số thẻ',
'ảnh CNND mặt trước',
'ảnh CMND mặt sau',
'ảnh chữ ký',
];
const index = checkFormatArray([type, cmnd, urlFont, urlBack, urlSign]);
if (index === true) { if (index === true) {
props.navigation.navigate('BankInfor', { props.navigation.navigate('BankInfor', {
urlFont, body: {
urlBack, cmnd,
urlSign, card_type: type.value,
...props.route.params, date_range: convertTime(date_range),
...props.route.params,
},
img: {
urlFont,
urlBack,
urlSign,
},
}); });
} else { } else {
Alert.alert('Vui lòng thêm ảnh ' + titles[index]); Alert.alert('Vui lòng thêm ' + titles[index]);
} }
}; };
return ( return (
<View <KeyboardAvoidingView
style={{ behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
flex: 1, style={{flex: 1}}
paddingHorizontal: 10, keyboardVerticalOffset={-50}>
paddingTop: 10, <ScrollView showsVerticalScrollIndicator={false}>
}}> <View
<View style={{
style={{ flex: 1,
flexDirection: 'row', paddingHorizontal: 10,
justifyContent: 'space-between', paddingTop: 10,
flexWrap: 'wrap', }}>
}}> <Text
<PickerImgUni style={{
onSelectImg={(path) => setUrlFont(path)} fontSize: getFontXD(42),
title={'Ảnh mặt trước CMND'} color: R.colors.color777,
/> }}>
<PickerImgUni Loi th
onSelectImg={(path) => setUrlBack(path)} </Text>
title={'Ảnh mặt sau CMND'} <PickerItem
/> width={width - 20}
<PickerImgUni data={dataType}
onSelectImg={(path) => setUrlSign(path)} onValueChange={(value, items) => {
title={'Ảnh chữ ký'} setType(items);
/> }}
</View> />
<TouchableOpacity onPress={onNextPress} style={styles.btnNext}>
<Image style={{width: 30, height: 30}} source={R.images.iconRight1} /> <TextField
</TouchableOpacity> isNumber={true}
</View> title={'Số thẻ'}
onChangeText={(val) => setCMND(val)}
/>
<PickerDate
value={date_range}
onValueChange={(val) => setDate_range(val)}
title={'Ngày cấp'}
/>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
flexWrap: 'wrap',
}}>
<PickerImgUni
onSelectImg={(path) => setUrlFont(path)}
title={'Ảnh mặt trước CMND'}
/>
<PickerImgUni
onSelectImg={(path) => setUrlBack(path)}
title={'Ảnh mặt sau CMND'}
/>
<PickerImgUni
onSelectImg={(path) => setUrlSign(path)}
title={'Ảnh chữ ký'}
/>
</View>
<TouchableOpacity onPress={onNextPress} style={styles.btnNext}>
<Image
style={{width: 30, height: 30}}
source={R.images.iconRight1}
/>
</TouchableOpacity>
</View>
</ScrollView>
</KeyboardAvoidingView>
); );
}; };
......
...@@ -4,6 +4,7 @@ import R from '../../../assets/R'; ...@@ -4,6 +4,7 @@ import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import Item from './Item'; import Item from './Item';
import {getListMethod} from '../../../apis/Functions/Deposit'; import {getListMethod} from '../../../apis/Functions/Deposit';
import {connect} from 'react-redux';
const MethodPayView = (props) => { const MethodPayView = (props) => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
...@@ -36,13 +37,16 @@ const MethodPayView = (props) => { ...@@ -36,13 +37,16 @@ const MethodPayView = (props) => {
justifyContent: 'space-between', justifyContent: 'space-between',
}} }}
data={data} data={data}
renderItem={({item}) => <Item item={item} />} renderItem={({item}) => <Item userId={props.user.uid} item={item} />}
/> />
</View> </View>
</View> </View>
); );
}; };
const styles = StyleSheet.create({}); const mapStateToProps = (state) => {
return {
export default MethodPayView; user: state.userReducer,
};
};
export default connect(mapStateToProps, {})(MethodPayView);
...@@ -4,9 +4,9 @@ import {Alert, NativeEventEmitter} from 'react-native'; ...@@ -4,9 +4,9 @@ import {Alert, NativeEventEmitter} from 'react-native';
import DepositView from './DepositView'; import DepositView from './DepositView';
const Deposit = (props) => { const Deposit = (props) => {
const {method} = props.route.params; const {method, userId} = props.route.params;
return <DepositView urlCheckout={method.checkout_url} />; return <DepositView urlCheckout={method.checkout_url + '/' + userId} />;
}; };
export default Deposit; export default Deposit;
...@@ -13,13 +13,13 @@ import {DEPOSIT} from '../../../routers/ScreenNames'; ...@@ -13,13 +13,13 @@ import {DEPOSIT} from '../../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
const Item = (props) => { const Item = (props) => {
const {item} = props; const {item, userId} = props;
const navigate = useNavigation(); const navigate = useNavigation();
return ( return (
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(DEPOSIT, {method: item})} onPress={() => navigate.navigate(DEPOSIT, {method: item, userId})}
style={styles.containerItem}> style={styles.containerItem}>
<Image source={{uri: item.logo_url}} style={styles.imgIcon} /> <Image source={{uri: item.logo_url}} style={styles.imgIcon} />
<Text>{item.agent}</Text> <Text>{item.agent}</Text>
......
import React from 'react'; import React, {useState} from 'react';
import {View, Text, FlatList} from 'react-native'; import {View, Text, FlatList, TouchableOpacity, StyleSheet} from 'react-native';
import HeaderSB from '../../../components/Header/HeaderSB'; import HeaderSB from '../../../components/Header/HeaderSB';
import Item from './Item'; import Item from './Item';
import {getFontXD} from '../../../Config/Functions';
const Fillters = [
{
id: '1',
name: 'Tất cả',
value: 'all',
},
{
id: '4',
name: 'Rút tiền',
value: 'withdraw',
},
{
id: '5',
name: 'Nạp tiền',
value: 'deposit',
},
{
id: '6',
name: 'Chuyển khoản',
value: 'exchange',
},
];
const data = [ const data = [
{ {
...@@ -43,10 +67,35 @@ const data = [ ...@@ -43,10 +67,35 @@ const data = [
]; ];
const HistoryView = (props) => { const HistoryView = (props) => {
const [selected, setSelected] = useState('1');
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderSB title={'LỊCH SỬ'} /> <HeaderSB title={'LỊCH SỬ'} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<View style={styles.headerContainer}>
<FlatList
showsHorizontalScrollIndicator={false}
horizontal
data={Fillters}
keyExtractor={(item) => item.id}
renderItem={({item}) => (
<TouchableOpacity
onPress={() => setSelected(item.id)}
style={[
styles.itemFillter,
selected == item.id ? {borderColor: '#1473E6'} : null,
]}>
<Text
style={[
styles.txtFillter,
selected == item.id ? {color: '#1473E6'} : {},
]}>
{item.name}
</Text>
</TouchableOpacity>
)}
/>
</View>
<FlatList <FlatList
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
data={data} data={data}
...@@ -57,4 +106,24 @@ const HistoryView = (props) => { ...@@ -57,4 +106,24 @@ const HistoryView = (props) => {
); );
}; };
const styles = StyleSheet.create({
headerContainer: {
paddingVertical: 10,
backgroundColor: 'white',
},
itemFillter: {
borderRadius: 10,
paddingVertical: 5,
paddingHorizontal: 10,
borderWidth: 1,
borderColor: '#929292',
marginLeft: 15,
minWidth: 70,
},
txtFillter: {
fontSize: getFontXD(36),
color: '#929292',
},
});
export default HistoryView; export default HistoryView;
...@@ -53,7 +53,7 @@ const Item = (props) => { ...@@ -53,7 +53,7 @@ const Item = (props) => {
fontWeight: 'bold', fontWeight: 'bold',
color: '#F99D1D', color: '#F99D1D',
}}> }}>
{toPriceVnd(item.money)} {toPriceVnd(item.money)} Đ
</Text> </Text>
) : ( ) : (
<Text <Text
...@@ -62,7 +62,7 @@ const Item = (props) => { ...@@ -62,7 +62,7 @@ const Item = (props) => {
fontWeight: 'bold', fontWeight: 'bold',
color: '#1473E6', color: '#1473E6',
}}> }}>
{toPriceVnd(item.money)} {toPriceVnd(item.money)} Đ
</Text> </Text>
)} )}
<Text style={styles.txt}>Hoàn tt</Text> <Text style={styles.txt}>Hoàn tt</Text>
......
...@@ -29,14 +29,17 @@ const ConfirmEmail = (props) => { ...@@ -29,14 +29,17 @@ const ConfirmEmail = (props) => {
platform: Platform.OS, platform: Platform.OS,
otp_by: value, otp_by: value,
}); });
console.log(res.data);
props.hideLoading(); props.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
navigate.navigate(CONFIRMOTP, {email: value}); navigate.navigate(CONFIRMOTP, {email: value});
} else { } else {
Alert.alert(res.data.message); setTimeout(() => {
Alert.alert('Thông báo', res.data.message);
}, 500);
} }
} else { } else {
Alert.alert('Vui lòng nhập email!'); Alert.alert('Thông báo', 'Vui lòng nhập email!');
} }
}; };
...@@ -50,6 +53,7 @@ const ConfirmEmail = (props) => { ...@@ -50,6 +53,7 @@ const ConfirmEmail = (props) => {
<TextInput <TextInput
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
style={styles.txtInput} style={styles.txtInput}
autoCapitalize="none"
placeholder="Nhập email" placeholder="Nhập email"
value={value} value={value}
onChangeText={(val) => setValue(val)} onChangeText={(val) => setValue(val)}
......
...@@ -41,9 +41,9 @@ const ConfirmOTP = (propsa) => { ...@@ -41,9 +41,9 @@ const ConfirmOTP = (propsa) => {
const confirm = async () => { const confirm = async () => {
if (!value) { if (!value) {
Alert.alert('Vui long nhập mã OTP'); Alert.alert('Thông báo', 'Vui long nhập mã OTP');
} else if (value.length != 4) { } else if (value.length != 4) {
Alert.alert('Mã OTP không đúng định dạng'); Alert.alert('Thông báo', 'Mã OTP không đúng định dạng');
} else { } else {
propsa.showLoading(); propsa.showLoading();
const res = await verifyOTPApi({ const res = await verifyOTPApi({
...@@ -60,14 +60,14 @@ const ConfirmOTP = (propsa) => { ...@@ -60,14 +60,14 @@ const ConfirmOTP = (propsa) => {
email: propsa.route.params.email, email: propsa.route.params.email,
}); });
} else { } else {
Alert(res.data.message); Alert.alert('Thông báo', res.data.message);
} }
} }
}; };
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Xác thưc OTP'} /> <HeaderBack title={'Xác thc OTP'} />
<View style={styles.container}> <View style={styles.container}>
<View style={{height: 20}} /> <View style={{height: 20}} />
...@@ -102,7 +102,10 @@ const ConfirmOTP = (propsa) => { ...@@ -102,7 +102,10 @@ const ConfirmOTP = (propsa) => {
<TouchableOpacity onPress={confirm} style={styles.btn}> <TouchableOpacity onPress={confirm} style={styles.btn}>
<Text style={styles.txtBtn}>Tiếp tc</Text> <Text style={styles.txtBtn}>Tiếp tc</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity onPress={() => console.log('Hello')}> <TouchableOpacity
style={styles.wrapFooter}
onPress={() => console.log('Hello')}>
<Text style={styles.txtNote}>Mã OTP có hiu lc trong 5 phút.</Text>
<Text style={styles.txtSend}>Gi li</Text> <Text style={styles.txtSend}>Gi li</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -178,10 +181,19 @@ const styles = StyleSheet.create({ ...@@ -178,10 +181,19 @@ const styles = StyleSheet.create({
textTransform: 'uppercase', textTransform: 'uppercase',
}, },
txtSend: { txtSend: {
marginTop: 30,
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: '#1C6AF6', color: '#1C6AF6',
}, },
wrapFooter: {
marginTop: 30,
flexDirection: 'row',
alignItems: 'center',
},
txtNote: {
color: '#A2A2A2',
fontSize: getFontXD(42),
fontStyle: 'italic',
},
}); });
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
......
...@@ -35,14 +35,12 @@ const Login = (props) => { ...@@ -35,14 +35,12 @@ const Login = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const onSubmitLogin = async () => { const onSubmitLogin = async () => {
props.showLoading();
const titles = ['tên đăng nhập', 'mật khẩu']; const titles = ['tên đăng nhập', 'mật khẩu'];
const index = checkFormatArray([email, pass]); const index = checkFormatArray([email, pass]);
if (index === true) { if (index === true) {
console.log('OK'); props.showLoading();
const firebase = await AsyncStorage.getItem(KEY.FIREBASE); const firebase = await AsyncStorage.getItem(KEY.FIREBASE);
const res = await loginApi({ const res = await loginApi({
email, email,
password: pass, password: pass,
...@@ -51,7 +49,6 @@ const Login = (props) => { ...@@ -51,7 +49,6 @@ const Login = (props) => {
account_type: 'CUSTOMER', account_type: 'CUSTOMER',
}); });
console.log(res.data);
props.hideLoading(); props.hideLoading();
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
AsyncStorage.setItem(KEY.TOKEN, res.data.data.token); AsyncStorage.setItem(KEY.TOKEN, res.data.data.token);
...@@ -61,10 +58,12 @@ const Login = (props) => { ...@@ -61,10 +58,12 @@ const Login = (props) => {
routes: [{name: TABNAVIGATOR}], routes: [{name: TABNAVIGATOR}],
}); });
} else { } else {
Alert.alert(res.data.message); setTimeout(() => {
Alert.alert('Thông báo', res.data.message);
}, 500);
} }
} else { } else {
Alert.alert('Vui lòng điền ' + titles[index]); Alert.alert('Thông báo', 'Vui lòng điền ' + titles[index]);
} }
}; };
...@@ -94,7 +93,7 @@ const Login = (props) => { ...@@ -94,7 +93,7 @@ const Login = (props) => {
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(CONFIRMEMAIL)} onPress={() => navigate.navigate(CONFIRMEMAIL)}
style={styles.forgotView}> style={styles.forgotView}>
<Text style={styles.txtTitle}>Quên mt khu ?</Text> <Text style={styles.txtTitle}>Quên mt khu?</Text>
</TouchableOpacity> </TouchableOpacity>
<View <View
......
...@@ -40,15 +40,18 @@ const NewPassword = (props) => { ...@@ -40,15 +40,18 @@ const NewPassword = (props) => {
}); });
props.hideLoading(); props.hideLoading();
console.log(res.data);
if (res.data.code == 200) { if (res.data.code == 200) {
navigate.reset({ await setTimeout(() => {
index: 1, Alert.alert('Thông báo!', 'Đổi mật khẩu thành công');
routes: [{name: AUTHEN}], navigate.reset({
}); index: 1,
routes: [{name: AUTHEN}],
});
}, 500);
} else { } else {
Alert.alert(res.data.message); setTimeout(() => {
Alert.alert('Thông báo!', res.data.message);
}, 500);
} }
} }
}; };
...@@ -63,8 +66,9 @@ const NewPassword = (props) => { ...@@ -63,8 +66,9 @@ const NewPassword = (props) => {
<Text style={styles.txtTitle}>Vui lòng nhp mt khu mi</Text> <Text style={styles.txtTitle}>Vui lòng nhp mt khu mi</Text>
<TextInput <TextInput
style={styles.txtInput} style={styles.txtInput}
placeholder="Nhập Email hoặc số điện thoại" placeholder="Nhập mật khẩu mới"
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
autoCapitalize="none"
value={password} value={password}
secureTextEntry={true} secureTextEntry={true}
onChangeText={(val) => setPassword(val)} onChangeText={(val) => setPassword(val)}
...@@ -74,7 +78,8 @@ const NewPassword = (props) => { ...@@ -74,7 +78,8 @@ const NewPassword = (props) => {
<Text style={styles.txtTitle}>Nhp li mt khu</Text> <Text style={styles.txtTitle}>Nhp li mt khu</Text>
<TextInput <TextInput
style={styles.txtInput} style={styles.txtInput}
placeholder="Nhập Email hoặc số điện thoại" autoCapitalize="none"
placeholder="Xác nhận lại mật khẩu mới"
value={cfPassword} value={cfPassword}
secureTextEntry={true} secureTextEntry={true}
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
......
...@@ -23,27 +23,31 @@ const Registor = (props) => { ...@@ -23,27 +23,31 @@ const Registor = (props) => {
const [password_confirmation, setPasswordConfirm] = useState(''); const [password_confirmation, setPasswordConfirm] = useState('');
const registorClick = async () => { const registorClick = async () => {
props.showLoading();
const titles = ['email', 'mật khẩu', 'xác nhận mật khẩu']; const titles = ['email', 'mật khẩu', 'xác nhận mật khẩu'];
const index = checkFormatArray([email, password, password_confirmation]); const index = checkFormatArray([email, password, password_confirmation]);
if (index === true) { if (index === true) {
props.showLoading();
const res = await registorApi({ const res = await registorApi({
email, email,
password, password,
platform: Platform.OS, platform: Platform.OS,
password_confirmation, password_confirmation,
}); });
props.hideLoading();
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
Alert.alert('Đăng ký tài khoản thành công!'); setTimeout(() => {
navigation.navigate('LOGIN'); Alert.alert('Thông báo', 'Đăng ký tài khoản thành công!');
navigation.navigate('LOGIN');
}, 500);
} else { } else {
Alert.alert('Thông báo!', res.data.message); setTimeout(() => {
Alert.alert('Thông báo!', res.data.message);
}, 500);
} }
} else { } else {
Alert.alert('Thông báo!', 'Vui lòng điền ' + titles[index]); Alert.alert('Thông báo!', 'Vui lòng điền ' + titles[index]);
} }
props.hideLoading();
}; };
return ( return (
......
...@@ -13,7 +13,7 @@ const Footer = (props) => { ...@@ -13,7 +13,7 @@ const Footer = (props) => {
</View> </View>
<View style={{flex: 1, paddingHorizontal: 15}}> <View style={{flex: 1, paddingHorizontal: 15}}>
<Text style={styles.txt}>Doanh thu ca đội</Text> <Text style={styles.txt}>Doanh thu ca đội</Text>
<Text style={styles.txtMoney}>$ {toPriceVnd(1500000)} VNĐ</Text> <Text style={styles.txtMoney}>$ {toPriceVnd(1500000)} Đ</Text>
</View> </View>
<View style={{justifyContent: 'center', alignItems: 'center'}}> <View style={{justifyContent: 'center', alignItems: 'center'}}>
<Icon name={'right'} size={20} color={'#707070'} /> <Icon name={'right'} size={20} color={'#707070'} />
...@@ -26,7 +26,7 @@ const Footer = (props) => { ...@@ -26,7 +26,7 @@ const Footer = (props) => {
</View> </View>
<View style={{flex: 1, paddingHorizontal: 15}}> <View style={{flex: 1, paddingHorizontal: 15}}>
<Text style={styles.txt}>Doanh thu nhà tài tr</Text> <Text style={styles.txt}>Doanh thu nhà tài tr</Text>
<Text style={styles.txtMoney}>$ {toPriceVnd(1500000)} VNĐ</Text> <Text style={styles.txtMoney}>$ {toPriceVnd(1500000)} Đ</Text>
</View> </View>
<View style={{justifyContent: 'center', alignItems: 'center'}}> <View style={{justifyContent: 'center', alignItems: 'center'}}>
<Icon name={'right'} size={20} color={'#707070'} /> <Icon name={'right'} size={20} color={'#707070'} />
...@@ -38,8 +38,8 @@ const Footer = (props) => { ...@@ -38,8 +38,8 @@ const Footer = (props) => {
<Image source={R.images.moneyinvest} style={styles.imgIcon} /> <Image source={R.images.moneyinvest} style={styles.imgIcon} />
</View> </View>
<View style={{flex: 1, paddingHorizontal: 15}}> <View style={{flex: 1, paddingHorizontal: 15}}>
<Text style={styles.txt}>Đầu t</Text> <Text style={styles.txt}>Đầu tư</Text>
<Text style={styles.txtMoney}>$ {toPriceVnd(1500000)} VNĐ</Text> <Text style={styles.txtMoney}>$ {toPriceVnd(1500000)} Đ</Text>
</View> </View>
<View style={{justifyContent: 'center', alignItems: 'center'}}> <View style={{justifyContent: 'center', alignItems: 'center'}}>
<Icon name={'right'} size={20} color={'#707070'} /> <Icon name={'right'} size={20} color={'#707070'} />
......
...@@ -23,21 +23,15 @@ const HomeView = (props) => { ...@@ -23,21 +23,15 @@ const HomeView = (props) => {
<View style={styles.row}> <View style={styles.row}>
<View style={styles.row}> <View style={styles.row}>
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<Text style={styles.txtTitle}>Rút tin</Text> <Text style={styles.txtTitle}>Np tin</Text>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}> {toPriceVnd(1000000)} Đ </Text>
{' '}
{toPriceVnd(1000000)} VNĐ{' '}
</Text>
</View> </View>
<View <View
style={{width: 0.5, backgroundColor: R.colors.borderGray}} style={{width: 0.5, backgroundColor: R.colors.borderGray}}
/> />
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<Text style={styles.txtTitle}>My Payout</Text> <Text style={styles.txtTitle}>Rút tin</Text>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}> {toPriceVnd(1000000)} Đ </Text>
{' '}
{toPriceVnd(1000000)} VNĐ{' '}
</Text>
</View> </View>
</View> </View>
</View> </View>
...@@ -45,18 +39,16 @@ const HomeView = (props) => { ...@@ -45,18 +39,16 @@ const HomeView = (props) => {
<View style={styles.row}> <View style={styles.row}>
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<Text style={styles.txtTitle}>Hoa hng</Text> <Text style={styles.txtTitle}>Hoa hng</Text>
<Text style={styles.txtMoney1}> <Text style={styles.txtMoney1}>+ {toPriceVnd(1000000)} Đ </Text>
+ {toPriceVnd(1000000)} VNĐ{' '}
</Text>
</View> </View>
<View <View
style={{width: 0.5, backgroundColor: R.colors.borderGray}} style={{width: 0.5, backgroundColor: R.colors.borderGray}}
/> />
<View style={styles.itemMenu}> <View style={styles.itemMenu}>
<Text style={styles.txtTitle}>Thưởng</Text> <Text style={styles.txtTitle}>Li nhun</Text>
<Text style={styles.txtMoney1}> <Text style={styles.txtMoney1}>
{' '} {' '}
+ {toPriceVnd(1000000)} VNĐ{' '} + {toPriceVnd(1000000)} Đ{' '}
</Text> </Text>
</View> </View>
</View> </View>
...@@ -111,13 +103,13 @@ const styles = StyleSheet.create({ ...@@ -111,13 +103,13 @@ const styles = StyleSheet.create({
textTransform: 'uppercase', textTransform: 'uppercase',
}, },
txtMoney: { txtMoney: {
fontSize: getFontXD(46), fontSize: getFontXD(42),
color: R.colors.black, color: R.colors.black,
marginTop: 5, marginTop: 5,
}, },
txtMoney1: { txtMoney1: {
fontSize: getFontXD(46), fontSize: getFontXD(42),
color: '#FF6A7C', color: '#2fbd04',
marginTop: 5, marginTop: 5,
}, },
}); });
...@@ -15,37 +15,29 @@ const Tab = createMaterialTopTabNavigator(); ...@@ -15,37 +15,29 @@ const Tab = createMaterialTopTabNavigator();
const ProfileView = (props) => { const ProfileView = (props) => {
return ( return (
<KeyboardAvoidingView <View style={{flex: 1}}>
behavior={Platform.Os === 'ios' ? 'padding' : 'height'} <HeaderBack isWhite={true} title={'Thông tin cá nhân'} />
style={{flex: 1}}
keyboardVerticalOffset={-50}> <Tab.Navigator
<ScrollView style={{flex: 1}} showsVerticalScrollIndicator={false}> initialRouteName="GeneralInfor"
<View style={{flex: 1}}> tabBarOptions={{
<HeaderBack isWhite={true} title={'Thông tin cá nhân'} /> inactiveTintColor: '#929292',
<View> activeTintColor: '#1473E6',
<Tab.Navigator labelStyle: {fontSize: getFontXD(36)},
initialRouteName="GeneralInfor" style: {backgroundColor: 'white'},
tabBarOptions={{ }}>
inactiveTintColor: '#929292', <Tab.Screen
activeTintColor: '#1473E6', name="GeneralInfor"
labelStyle: {fontSize: getFontXD(36)}, component={GeneralInfor}
style: {backgroundColor: 'white'}, options={{tabBarLabel: 'Thông tin chung'}}
}}> />
<Tab.Screen <Tab.Screen
name="GeneralInfor" name="CQG"
component={GeneralInfor} component={CQG}
options={{tabBarLabel: 'Thông tin chung'}} options={{tabBarLabel: 'Tài khoản CQG'}}
/> />
<Tab.Screen </Tab.Navigator>
name="CQG" </View>
component={CQG}
options={{tabBarLabel: 'Tài khoản CQG'}}
/>
</Tab.Navigator>
</View>
</View>
</ScrollView>
</KeyboardAvoidingView>
); );
}; };
......
...@@ -8,6 +8,9 @@ import { ...@@ -8,6 +8,9 @@ import {
Touchable, Touchable,
TouchableOpacityBase, TouchableOpacityBase,
Dimensions, Dimensions,
KeyboardAvoidingView,
ScrollView,
Platform,
} from 'react-native'; } from 'react-native';
import R from '../../../../assets/R'; import R from '../../../../assets/R';
...@@ -34,70 +37,82 @@ const GeneralInfor = (props) => { ...@@ -34,70 +37,82 @@ const GeneralInfor = (props) => {
const [bank, setBank] = useState(); const [bank, setBank] = useState();
return ( return (
<View style={styles.container}> <KeyboardAvoidingView
<TextField title={'Họ và tên'} onChangeText={(val) => console.log(val)} /> behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
<TextField style={{flex: 1}}
title={'Điện thoại'} keyboardVerticalOffset={-50}>
onChangeText={(val) => console.log(val)} <ScrollView style={{flex: 1}} showsVerticalScrollIndicator={false}>
/> <View style={styles.container}>
<TextField
title={'Họ và tên'}
onChangeText={(val) => console.log(val)}
/>
<TextField
title={'Điện thoại'}
onChangeText={(val) => console.log(val)}
/>
<TextField title={'Email'} onChangeText={(val) => console.log(val)} /> <TextField title={'Email'} onChangeText={(val) => console.log(val)} />
{/* {/*
<TextInput <TextInput
style={styles.customTxt} style={styles.customTxt}
onChangeText={(val) => console.log(val)} onChangeText={(val) => console.log(val)}
placeholder="0000" placeholder="0000"
/> */} /> */}
<View style={styles.status}> <View style={styles.status}>
<View <View
style={{ style={{
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
}}> }}>
<View style={styles.customAdd}> <View style={styles.customAdd}>
<Text style={{fontSize: getFontXD(42), color: '#929292'}}>+</Text> <Text style={{fontSize: getFontXD(42), color: '#929292'}}>
</View> +
<Text style={styles.txtTitle}>Trng thái</Text> </Text>
</View> </View>
<Text style={styles.txtTitle}>Trng 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 <View
style={{ style={{
borderTopWidth: 1, borderTopWidth: 1,
borderTopColor: '#DBDBDB', borderTopColor: '#DBDBDB',
marginTop: 20, marginTop: 20,
paddingTop: 10, paddingTop: 10,
}}> }}>
<TextField <TextField
title={'Số tài khoản ngân hàng'} title={'Số tài khoản ngân hàng'}
onChangeText={(val) => console.log(val)} onChangeText={(val) => console.log(val)}
placeHolder="Nhập số tài khoản ngân hàng" placeHolder="Nhập số tài khoản ngân hàng"
/> />
<Text style={styles.txtTitle}>Tên ngân hàng</Text> <Text style={styles.txtTitle}>Tên ngân hàng</Text>
<PickerItem <PickerItem
width={width - 20} width={width - 20}
data={dataTest} data={dataTest}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setBank(items); setBank(items);
}} }}
/> />
</View> </View>
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity <TouchableOpacity
onPress={() => console.log('Hello')} onPress={() => console.log('Hello')}
style={styles.btn}> style={styles.btn}>
<Text style={styles.txtBtn}>Cp nht</Text> <Text style={styles.txtBtn}>Cp nht</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
</ScrollView>
</KeyboardAvoidingView>
); );
}; };
......
...@@ -10,7 +10,7 @@ const Item = (props) => { ...@@ -10,7 +10,7 @@ const Item = (props) => {
return ( return (
<TouchableOpacity onPress={() => console.log('HEllo')}> <TouchableOpacity onPress={() => console.log('HEllo')}>
<View style={styles.container}> <View style={styles.container}>
<Block flex={1} row center padding={[10, 10]}> <Block flex={1} row center padding={[10, 20]}>
<Image source={item.image} style={styles.imgIcon} /> <Image source={item.image} style={styles.imgIcon} />
<Block padding={[0, 10]}> <Block padding={[0, 10]}>
<Text style={styles.txtBig}>{item.title}</Text> <Text style={styles.txtBig}>{item.title}</Text>
......
import React from 'react'; import React from 'react';
import {View, Text, StyleSheet, TouchableOpacity, Image} from 'react-native'; import {
View,
Text,
StyleSheet,
TouchableOpacity,
Image,
Alert,
} from 'react-native';
import {getFontXD, HEIGHTXD, WIDTHXD, toPriceVnd} from '../../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD, toPriceVnd} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import Block from '../../components/Block'; import Block from '../../components/Block';
...@@ -8,7 +15,7 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; ...@@ -8,7 +15,7 @@ import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
const Item = (props) => { const Item = (props) => {
const {item} = props; const {item} = props;
return ( return (
<TouchableOpacity onPress={() => console.log('HEllo')}> <TouchableOpacity onPress={() => Alert.alert('Hello')}>
<View style={styles.container}> <View style={styles.container}>
<Block flex={1} row> <Block flex={1} row>
<View style={styles.wrapLeft} /> <View style={styles.wrapLeft} />
......
import React from 'react'; import React, {useState} from 'react';
import {View, Text, FlatList} from 'react-native'; import {View, Text, FlatList, StyleSheet, TouchableOpacity} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderDrawer from '../../components/Header/HeaderDrawer';
import Item from './Item'; import Item from './Item';
import {getFontXD} from '../../Config/Functions';
const Fillters = [
{
id: '1',
name: 'Tất cả',
value: 'all',
},
{
id: '2',
name: 'Chưa đọc',
value: 'disable',
},
{
id: '3',
name: 'Đã đọc',
value: 'enable',
},
{
id: '4',
name: 'Rút tiền',
value: 'withdraw',
},
{
id: '5',
name: 'Nạp tiền',
value: 'deposit',
},
{
id: '6',
name: 'Chuyển khoản',
value: 'exchange',
},
];
const data = [ const data = [
{ {
...@@ -28,10 +62,35 @@ const data = [ ...@@ -28,10 +62,35 @@ const data = [
]; ];
const NotificaitonView = (props) => { const NotificaitonView = (props) => {
const [selected, setSelected] = useState('1');
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack isWhite={false} title={'Thông báo'} /> <HeaderDrawer isWhite={false} title={'Thông báo'} />
<View style={styles.headerContainer}>
<FlatList
showsHorizontalScrollIndicator={false}
horizontal
data={Fillters}
keyExtractor={(item) => item.id}
renderItem={({item}) => (
<TouchableOpacity
onPress={() => setSelected(item.id)}
style={[
styles.itemFillter,
selected == item.id ? {borderColor: '#1473E6'} : null,
]}>
<Text
style={[
styles.txtFillter,
selected == item.id ? {color: '#1473E6'} : {},
]}>
{item.name}
</Text>
</TouchableOpacity>
)}
/>
</View>
<FlatList <FlatList
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
data={data} data={data}
...@@ -41,4 +100,24 @@ const NotificaitonView = (props) => { ...@@ -41,4 +100,24 @@ const NotificaitonView = (props) => {
); );
}; };
const styles = StyleSheet.create({
headerContainer: {
paddingVertical: 10,
backgroundColor: 'white',
},
itemFillter: {
borderRadius: 10,
paddingVertical: 5,
paddingHorizontal: 10,
borderWidth: 1,
borderColor: '#929292',
marginLeft: 15,
minWidth: 70,
},
txtFillter: {
fontSize: getFontXD(36),
color: '#929292',
},
});
export default NotificaitonView; export default NotificaitonView;
import {PostLogin, PostData} from '../helpers'; import {PostLogin, PostData, PostFormData} from '../helpers';
import url from '../url'; import url from '../url';
...@@ -31,3 +31,8 @@ export const forgotPasswordApi = async (body) => ...@@ -31,3 +31,8 @@ export const forgotPasswordApi = async (body) =>
PostLogin(url.urlForgotPassword, body) PostLogin(url.urlForgotPassword, body)
.then((res) => res) .then((res) => res)
.catch((err) => err); .catch((err) => err);
export const verifyAccountApi = async (body) =>
PostFormData(url.urlVerifyAccount, body)
.then((res) => res)
.catch((err) => err);
...@@ -84,6 +84,34 @@ export async function PostData(url, json, isAuth = true) { ...@@ -84,6 +84,34 @@ export async function PostData(url, json, isAuth = true) {
}); });
} }
export async function PostFormData(url, data) {
const token = await AsyncStorage.getItem(KEY.TOKEN);
console.log(token);
let myRequest = {
method: 'post',
url,
headers: {
Accept: 'application/json',
'Content-Type': 'multipart/form-data',
Authorization: 'Bearer ' + token,
},
timeout: 30 * 1000,
data: data,
};
console.log('post data mobile', myRequest.data);
return await axios(myRequest)
.then((response) => response)
.then((response) => response)
.catch((error) => {
console.log(error.request);
const err = {
message: 'error',
status: error.request.status,
};
return err;
});
}
/** /**
* *
* @param {*} url is link api * @param {*} url is link api
......
...@@ -7,4 +7,5 @@ export default { ...@@ -7,4 +7,5 @@ export default {
urlVerifyOTP: root + 'api/auth/customer-verify-otp', urlVerifyOTP: root + 'api/auth/customer-verify-otp',
urlForgotPassword: root + 'api/auth/customer-forgot-password', urlForgotPassword: root + 'api/auth/customer-forgot-password',
urlGetListWithDraw: root + 'api/v1/payments/get-list-withdraw-method', urlGetListWithDraw: root + 'api/v1/payments/get-list-withdraw-method',
urlVerifyAccount: root + 'api/v1/customers/verify-account',
}; };
...@@ -13,7 +13,7 @@ import {getFontXD, HEIGHTXD, WIDTHXD} from '../Config/Functions'; ...@@ -13,7 +13,7 @@ import {getFontXD, HEIGHTXD, WIDTHXD} from '../Config/Functions';
const Button = (props) => { const Button = (props) => {
const {title, onClick} = props; const {title, onClick} = props;
return ( return (
<TouchableOpacity style={styles.container} onPress={() => onClick()}> <TouchableOpacity style={styles.container} onPress={onClick}>
<ImageBackground <ImageBackground
imageStyle={{ imageStyle={{
borderRadius: 20, borderRadius: 20,
......
...@@ -3,6 +3,7 @@ import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native'; ...@@ -3,6 +3,7 @@ import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native';
import R from '../../assets/R'; import R from '../../assets/R';
import {HEIGHTXD, getFontXD, WIDTHXD} from '../../Config/Functions'; import {HEIGHTXD, getFontXD, WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/MaterialIcons'; import Icon from 'react-native-vector-icons/MaterialIcons';
import AsyncStorage from '@react-native-community/async-storage';
import { import {
AccountVerification, AccountVerification,
METHODPAY, METHODPAY,
...@@ -10,6 +11,7 @@ import { ...@@ -10,6 +11,7 @@ import {
FEEDBACK, FEEDBACK,
SETTING, SETTING,
NOTIFICATION, NOTIFICATION,
AUTHEN,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
...@@ -20,32 +22,27 @@ const menus = [ ...@@ -20,32 +22,27 @@ const menus = [
icon: R.images.iconUserCheck, icon: R.images.iconUserCheck,
screen: AccountVerification, screen: AccountVerification,
}, },
{ {
id: '2', id: '2',
title: 'Thông báo',
icon: R.images.noti,
screen: NOTIFICATION,
},
{
id: '3',
title: 'Cài đặt phương thức thanh toán', title: 'Cài đặt phương thức thanh toán',
icon: R.images.iconMethodPay, icon: R.images.iconMethodPay,
screen: METHODPAY, screen: METHODPAY,
}, },
{ {
id: '4', id: '3',
title: 'Liên hệ với dịch vụ khách hàng', title: 'Liên hệ với dịch vụ khách hàng',
icon: R.images.iconPhone, icon: R.images.iconPhone,
screen: SERVICECUSTOMER, screen: SERVICECUSTOMER,
}, },
{ {
id: '5', id: '4',
title: 'Phản hồi', title: 'Phản hồi',
icon: R.images.iconMess, icon: R.images.iconMess,
screen: FEEDBACK, screen: FEEDBACK,
}, },
{ {
id: '6', id: '5',
title: 'Cài đặt', title: 'Cài đặt',
icon: R.images.iconSetting, icon: R.images.iconSetting,
screen: SETTING, screen: SETTING,
...@@ -77,7 +74,14 @@ const Drawer = (props) => { ...@@ -77,7 +74,14 @@ const Drawer = (props) => {
</View> </View>
<TouchableOpacity <TouchableOpacity
onPress={() => console.log('Hello')} onPress={() => {
AsyncStorage.clear();
props.toggleModal();
navigate.reset({
index: 1,
routes: [{name: AUTHEN}],
});
}}
style={styles.footer}> style={styles.footer}>
<Icon name={'logout'} size={25} color={'#F81515'} /> <Icon name={'logout'} size={25} color={'#F81515'} />
<Text style={styles.txtTitle}>Đăng xut</Text> <Text style={styles.txtTitle}>Đăng xut</Text>
......
import React, {useEffect} from 'react'; import React, {useEffect, useState} from 'react';
import { import {
View, View,
Text, Text,
...@@ -9,12 +9,14 @@ import { ...@@ -9,12 +9,14 @@ import {
ImageBackground, ImageBackground,
TouchableOpacity, TouchableOpacity,
Platform, Platform,
Alert,
} 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 LinearGradient from 'react-native-linear-gradient';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {HEIGHTXD, toPriceVnd} from '../../Config/Functions'; import {HEIGHTXD, toPriceVnd} from '../../Config/Functions';
import Clipboard from '@react-native-clipboard/clipboard';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import { import {
...@@ -23,10 +25,18 @@ import { ...@@ -23,10 +25,18 @@ import {
CHOOSEMETHOD, CHOOSEMETHOD,
TRANSFER, TRANSFER,
HISTORY, HISTORY,
PROFILE,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
const HeaderHome = (props) => { const HeaderHome = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const [sponsorID, setSponsorID] = useState('sponsorIDlink');
const copyToClipboard = () => {
Alert.alert('Đã sao chép!');
Clipboard.setString(sponsorID);
};
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ImageBackground style={styles.img} source={R.images.headerHome}> <ImageBackground style={styles.img} source={R.images.headerHome}>
...@@ -37,10 +47,13 @@ const HeaderHome = (props) => { ...@@ -37,10 +47,13 @@ const HeaderHome = (props) => {
<View style={styles.containerInfor}> <View style={styles.containerInfor}>
<Image source={R.images.avartar} style={styles.imgAvatar} /> <Image source={R.images.avartar} style={styles.imgAvatar} />
<View style={styles.wrapRight}> <View style={styles.wrapRight}>
<Text style={styles.txtName}>Vu Khac Minh</Text> <TouchableOpacity onPress={() => navigate.navigate(PROFILE)}>
<Text style={styles.txtName}>Vu Khac Minh</Text>
</TouchableOpacity>
<View style={styles.row1}> <View style={styles.row1}>
<Text style={styles.txtlink}>sponsorIDlink</Text> <Text style={styles.txtlink}>{sponsorID}</Text>
<TouchableOpacity onPress={() => console.log('Hello')}> <TouchableOpacity onPress={copyToClipboard}>
<Image <Image
source={R.images.iconCopy} source={R.images.iconCopy}
style={styles.imgIconCopy} style={styles.imgIconCopy}
...@@ -50,7 +63,7 @@ const HeaderHome = (props) => { ...@@ -50,7 +63,7 @@ const HeaderHome = (props) => {
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtMoney}> {toPriceVnd(1000000)}</Text> <Text style={styles.txtMoney}> {toPriceVnd(1000000)}</Text>
<Text style={styles.txtTitle}> VNĐ</Text> <Text style={styles.txtTitle}> Đ</Text>
</View> </View>
</View> </View>
</View> </View>
...@@ -160,7 +173,7 @@ const styles = StyleSheet.create({ ...@@ -160,7 +173,7 @@ const styles = StyleSheet.create({
borderRadius: WIDTHXD(120), borderRadius: WIDTHXD(120),
}, },
txtMoney: { txtMoney: {
fontSize: getFontXD(72), fontSize: getFontXD(62),
color: '#FFB721', color: '#FFB721',
marginVertical: 5, marginVertical: 5,
fontWeight: 'bold', fontWeight: 'bold',
......
...@@ -19,6 +19,7 @@ const InputComponent = (props) => { ...@@ -19,6 +19,7 @@ const InputComponent = (props) => {
<TextInput <TextInput
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
maxLength={maxLength} maxLength={maxLength}
autoCapitalize="none"
onChangeText={(val) => onChangeText(val)} onChangeText={(val) => onChangeText(val)}
style={{ style={{
height: HEIGHTXD(89), height: HEIGHTXD(89),
......
...@@ -21,6 +21,7 @@ const InputIcon = (props) => { ...@@ -21,6 +21,7 @@ const InputIcon = (props) => {
<Text>{title}</Text> <Text>{title}</Text>
<TextInput <TextInput
maxLength={maxLength} maxLength={maxLength}
autoCapitalize="none"
onChangeText={(val) => onChangeText(val)} onChangeText={(val) => onChangeText(val)}
style={txtInput} style={txtInput}
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
......
...@@ -19,6 +19,7 @@ const TextField = (props) => { ...@@ -19,6 +19,7 @@ const TextField = (props) => {
<TextInput <TextInput
maxLength={maxLength ? maxLength : 256} maxLength={maxLength ? maxLength : 256}
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
autoCapitalize="none"
value={value} value={value}
keyboardType={isNumber ? 'number-pad' : 'default'} keyboardType={isNumber ? 'number-pad' : 'default'}
onChangeText={(val) => onChangeText(val)} onChangeText={(val) => onChangeText(val)}
......
...@@ -22,6 +22,7 @@ const TextField = (props) => { ...@@ -22,6 +22,7 @@ const TextField = (props) => {
multiline={true} multiline={true}
numberOfLines={3} numberOfLines={3}
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
autoCapitalize="none"
style={{ style={{
color: 'black', color: 'black',
maxHeight: HEIGHTXD(259), maxHeight: HEIGHTXD(259),
......
...@@ -36,6 +36,7 @@ const PickerImgUni = (props) => { ...@@ -36,6 +36,7 @@ const PickerImgUni = (props) => {
}).then((image) => { }).then((image) => {
setModalVisible(false); setModalVisible(false);
setUrlImg(image.path); setUrlImg(image.path);
console.log(image);
onSelectImg(image.path); onSelectImg(image.path);
}); });
}; };
...@@ -46,6 +47,7 @@ const PickerImgUni = (props) => { ...@@ -46,6 +47,7 @@ const PickerImgUni = (props) => {
width: 300, width: 300,
height: 400, height: 400,
}).then((image) => { }).then((image) => {
console.log(image);
setModalVisible(false); setModalVisible(false);
setUrlImg(image.path); setUrlImg(image.path);
onSelectImg(image.path); onSelectImg(image.path);
......
...@@ -12,7 +12,7 @@ import PlussModal from './PlussModal'; ...@@ -12,7 +12,7 @@ import PlussModal from './PlussModal';
import Account from '../Screens/Account/Account'; import Account from '../Screens/Account/Account';
import Exchange from '../Screens/Exchange/Exchange'; import Exchange from '../Screens/Exchange/Exchange';
import NewFeed from '../Screens/NewFeed/NewFeed'; import NewFeed from '../Screens/NewFeed/NewFeed';
import Notification from '../Screens/Notification/Notification';
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const PayScreenComponent = () => { const PayScreenComponent = () => {
...@@ -57,11 +57,15 @@ const TabNavigator = (props) => { ...@@ -57,11 +57,15 @@ const TabNavigator = (props) => {
<Tab.Screen <Tab.Screen
name="Screen3" name="Screen3"
component={Exchange} component={Notification}
options={{ options={{
tabBarLabel: 'Giao dịch', tabBarLabel: 'Thông báo',
tabBarIcon: ({color, size}) => ( tabBarIcon: ({color, size}) => (
<Icon name="chart-line" size={size} color={color} /> <Ionicons
name="ios-notifications-outline"
size={size}
color={color}
/>
), ),
}} }}
/> />
......
...@@ -1033,6 +1033,11 @@ ...@@ -1033,6 +1033,11 @@
"@types/yargs" "^15.0.0" "@types/yargs" "^15.0.0"
chalk "^4.0.0" chalk "^4.0.0"
"@react-native-clipboard/clipboard@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@react-native-clipboard/clipboard/-/clipboard-1.7.0.tgz#43320841870b82b2f311f375dd5f178da46e244e"
integrity sha512-i5dJgR+wM8Om+hFEB/PqNb65/x5WxpaZG+UjEBX2/gmmIrmAWI72tI9rVL1gjPA9RWNpdpzvp+ioGjpdl7MyWQ==
"@react-native-community/async-storage@^1.12.1": "@react-native-community/async-storage@^1.12.1":
version "1.12.1" version "1.12.1"
resolved "https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.12.1.tgz" resolved "https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.12.1.tgz"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment