Commit b20a248d by Giang Tran

update screen legaldocument

parent 3cd06fce
......@@ -903,7 +903,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 16;
CURRENT_PROJECT_VERSION = 17;
DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -936,7 +936,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 16;
CURRENT_PROJECT_VERSION = 17;
DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
......@@ -42,7 +42,7 @@
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string>To upload images</string>
<key>UIAppFonts</key>
......
......@@ -98,7 +98,20 @@ export const Gender = {
male: 0,
female: 1,
};
export const converType = (type) => {
if (type == 'DEPOSIT') return 'Nạp tiền';
return 'Rút tiền';
};
export const converStatus = (status) => {
switch (status) {
case 0:
return 'Chờ xử lý';
case 1:
return 'Thành công';
case 2:
return 'Huỷ';
}
};
export const toPriceVnd = (str) => {
if (str) {
let stringPrice = str.toString().split('.');
......
import React from 'react';
import {View, Text} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack';
import {connect} from 'react-redux';
import {WebView} from 'react-native-webview';
const Contract = (props) => {
console.log(props.user);
return (
<View style={{flex: 1}}>
<HeaderBack title={'Hợp đồng'} />
<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 trin, vui lòng quay li sau!
</Text>
</View>
<HeaderBack isWhite={true} title={'Hợp đồng'} />
<WebView
androidHardwareAccelerationDisabled={true}
source={{
uri:
'http://api.dcvinvest.com/webview/contracts/show/' + props.user.uid,
}}
/>
</View>
);
};
export default Contract;
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {})(Contract);
......@@ -4,27 +4,26 @@ import HistoryView from './HistoryView';
import {getListTransaction} from '../../../apis/Functions/Widthdraw';
const History = (props) => {
const [selected, setSelected] = useState('');
const [selected, setSelected] = useState('ALL');
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]);
useEffect(() => {
getData();
}, [selected]);
const getData = async () => {
setisRefresh(true);
setPage(1);
const res = await getListTransaction({
keyword: '',
type: 'ALL',
type: selected,
platform: Platform.OS,
page_size: 10,
status: -1,
......@@ -32,11 +31,12 @@ const History = (props) => {
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);
console.log(res.data.data);
} else {
Alert.alert('Thông báo!', res.data.message);
}
......@@ -47,8 +47,7 @@ const History = (props) => {
};
const onLoadMore = () => {
console.log(tottalPage);
// if (page < tottalPage) getDataLoadMore();
if (page < tottalPage) getDataLoadMore();
};
const getDataLoadMore = async () => {
......@@ -77,6 +76,8 @@ const History = (props) => {
isRefresh={isRefresh}
onRefresh={onRefresh}
data={data}
selected={selected}
setSelected={setSelected}
/>
);
};
......
import React, {useState} from 'react';
import {View, Text, FlatList, TouchableOpacity, StyleSheet} from 'react-native';
import {
View,
Text,
FlatList,
TouchableOpacity,
StyleSheet,
ScrollView,
} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack';
import Item from './Item';
import {getFontXD} from '../../../Config/Functions';
const Fillters = [
{
id: '1',
name: 'Tất cả',
value: 'all',
value: 'ALL',
},
{
id: '4',
name: 'Rút tiền',
value: 'withdraw',
id: '2',
name: 'Nạp tiền',
value: 'DEPOSIT',
},
{
id: '5',
name: 'Nạp tiền',
value: 'deposit',
id: '3',
name: 'Rút tiền',
value: 'WITHDRAW',
},
{
id: '6',
id: '4',
name: 'Chuyển khoản',
value: 'exchange',
value: 'TRANSFER',
},
];
// const data = [
// {
// id: '1',
// money: 10000000,
// content: 'Hoạt động: Nạp tiền',
// status: 1,
// date: '20/02/2021',
// },
// {
// id: '2',
// money: 2000000,
// content: 'Hoạt động: Nạp tiền',
// status: 1,
// date: '20/02/2021',
// },
// {
// id: '3',
// day: '20',
// money: 3000000,
// content: 'Hoạt động: Nạp tiền',
// status: 1,
// date: '20/02/2021',
// },
// {
// id: '4',
// money: 4000000,
// content: 'Hoạt động: Rút tiền',
// status: 2,
// date: '20/02/2021',
// },
// {
// id: '5',
// money: 9000000,
// content: 'Hoạt động: Nạp tiền',
// status: 1,
// 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 {isRefresh, onRefresh, onLoadMore, data} = props;
const [selected, setSelected] = useState('1');
const {isRefresh, onRefresh, onLoadMore, data, selected, setSelected} = props;
return (
<View style={{flex: 1}}>
<HeaderBack isWhite={true} title={'LỊCH SỬ'} />
<View style={{flex: 1}}>
<View style={styles.headerContainer}>
<FlatList
showsHorizontalScrollIndicator={false}
horizontal
data={Fillters}
keyExtractor={(item) => item.id}
renderItem={({item}) => (
{Fillters.map((e) => (
<TouchableOpacity
onPress={() => setSelected(item.id)}
key={e.value}
onPress={() => setSelected(e.value)}
style={[
styles.itemFillter,
selected == item.id ? {borderColor: '#1473E6'} : null,
selected == e.value ? {borderColor: '#1473E6'} : null,
]}>
<Text
style={[
styles.txtFillter,
selected == item.id ? {color: '#1473E6'} : {},
selected == e.value ? {color: '#1473E6'} : {},
]}>
{item.name}
{e.name}
</Text>
</TouchableOpacity>
)}
/>
))}
</View>
{data.length == 0 ? (
<View
style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Text
style={{
fontSize: getFontXD(46),
fontWeight: 'bold',
}}>
Không có giao dch nào!
</Text>
</View>
) : (
<FlatList
style={{flex: 1}}
refreshing={isRefresh}
......@@ -123,6 +84,7 @@ const HistoryView = (props) => {
data={data}
renderItem={({item}) => <Item item={item} />}
/>
)}
</View>
</View>
);
......@@ -132,6 +94,10 @@ const styles = StyleSheet.create({
headerContainer: {
paddingVertical: 10,
backgroundColor: 'white',
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
paddingHorizontal: 10,
},
itemFillter: {
borderRadius: 10,
......@@ -139,7 +105,6 @@ const styles = StyleSheet.create({
paddingHorizontal: 10,
borderWidth: 1,
borderColor: '#929292',
marginLeft: 15,
minWidth: 70,
},
txtFillter: {
......
......@@ -5,6 +5,8 @@ import {
HEIGHTXD,
WIDTHXD,
toPriceVnd,
converType,
converStatus,
} from '../../../Config/Functions';
import R from '../../../assets/R';
import Block from '../../../components/Block';
......@@ -16,16 +18,11 @@ const Item = (props) => {
// console.log('item---', item.status);
const navigate = useNavigation();
return (
<TouchableOpacity onPress={() => console.log('HEllo')}>
<View style={styles.container}>
<Block flex={1} row>
<View style={styles.wrapLeft} />
<View style={styles.wrapDate}>
{item.status == 1 ? (
<Image source={R.images.iconRecharge} style={styles.imgIcon} />
) : (
<Image source={R.images.iconWithdrawal} style={styles.imgIcon} />
)}
<Image source={{uri: item.icon}} style={styles.imgIcon} />
</View>
<Block
style={{justifyContent: 'center'}}
......@@ -41,37 +38,26 @@ const Item = (props) => {
style={{
alignItems: 'flex-start',
}}>
<Text style={styles.txtBlack}>{item.content}</Text>
<Text style={styles.txt}>{item.date}</Text>
<Text style={styles.txtBlack}>
{converType(item.transection_category)}
</Text>
<Text style={styles.txt}>{item.transection_date_timestamp}</Text>
</View>
<View style={{alignItems: 'flex-end'}}>
{item.status == 1 ? (
<Text
style={{
fontSize: getFontXD(42),
fontWeight: 'bold',
color: '#F99D1D',
}}>
{toPriceVnd(item.money)} Đ
</Text>
) : (
<Text
style={{
fontSize: getFontXD(42),
fontWeight: 'bold',
color: '#1473E6',
}}>
{toPriceVnd(item.money)} Đ
style={[
styles.txtMoney,
item.status == 1 ? {color: '#1473E6'} : null,
]}>
{toPriceVnd(item.amount)} Đ
</Text>
)}
<Text style={styles.txt}>Hoàn tt</Text>
<Text style={styles.txt}>{converStatus(item.status)}</Text>
</View>
</View>
</Block>
</Block>
</View>
</TouchableOpacity>
);
};
......@@ -109,10 +95,20 @@ const styles = StyleSheet.create({
txt: {
fontSize: getFontXD(36),
color: '#C4C4C4',
marginTop: 10,
fontStyle: 'italic',
},
imgIcon: {
width: WIDTHXD(178),
height: HEIGHTXD(178),
resizeMode: 'contain',
},
txtMoney: {
fontSize: getFontXD(42),
fontWeight: 'bold',
color: '#F99D1D',
},
txtBlack: {
fontSize: getFontXD(42),
},
});
......@@ -5,17 +5,13 @@ import {
HEIGHTXD,
WIDTHXD,
toPriceVnd,
converType,
} from '../../../../Config/Functions';
import R from '../../../../assets/R';
import Block from '../../../../components/Block';
import {useNavigation} from '@react-navigation/native';
import {DETAIL_REQUIRE_MONEY} from '../../../../routers/ScreenNames';
const converType = (type) => {
if ((type = 'DEPOSIT')) return 'Nạp tiền';
return 'Rút tiền';
};
const Item = (props) => {
const {item} = props;
const navigate = useNavigation();
......
import React from 'react';
import {View, Text} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack';
const LegalDocument = (props) => {
return (
<View style={{flex: 1}}>
<HeaderBack title={'Giấy tờ pháp lý'} />
</View>
);
};
export default LegalDocument;
......@@ -27,11 +27,6 @@ const NewFeed = (props) => {
style: {backgroundColor: 'white'},
}}>
<Tab.Screen
name="CALENDAR"
component={Calendar}
options={{tabBarLabel: 'Lịch thị trường'}}
/>
<Tab.Screen
name="Tab1"
component={Tab1}
options={{tabBarLabel: 'Tin tức'}}
......@@ -51,6 +46,11 @@ const NewFeed = (props) => {
component={Trading}
options={{tabBarLabel: 'Biểu đồ'}}
/>
<Tab.Screen
name="CALENDAR"
component={Calendar}
options={{tabBarLabel: 'Lịch thị trường'}}
/>
</Tab.Navigator>
</View>
</View>
......
......@@ -21,6 +21,11 @@ const Fillters = [
name: 'Rút tiền',
value: 'WITHDRAW',
},
{
id: '4',
name: 'Chuyển khoản',
value: 'TRANSFER',
},
];
const NotificaitonView = (props) => {
......@@ -48,6 +53,17 @@ const NotificaitonView = (props) => {
</TouchableOpacity>
))}
</View>
{data.length == 0 ? (
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Text
style={{
fontSize: getFontXD(46),
fontWeight: 'bold',
}}>
Không có thông báo nào!
</Text>
</View>
) : (
<FlatList
keyExtractor={(item) => item.id}
data={data}
......@@ -59,6 +75,7 @@ const NotificaitonView = (props) => {
}}
renderItem={({item}) => <Item item={item} />}
/>
)}
</View>
);
};
......@@ -70,6 +87,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
paddingHorizontal: 10,
},
itemFillter: {
borderRadius: 10,
......@@ -77,7 +95,6 @@ const styles = StyleSheet.create({
paddingHorizontal: 10,
borderWidth: 1,
borderColor: '#929292',
marginLeft: 15,
minWidth: 80,
justifyContent: 'center',
alignItems: 'center',
......@@ -87,6 +104,10 @@ const styles = StyleSheet.create({
color: '#929292',
fontWeight: 'bold',
},
txtTitle: {
fontSize: getFontXD(46),
fontWeight: 'bold',
},
});
export default NotificaitonView;
......@@ -24,7 +24,6 @@ const Notifcation = (props) => {
page_index: 1,
type: fillter,
});
console.log(res.data);
setisRefresh(false);
if ((res.data.code = 200 && res.data.data)) {
setData(res.data.data);
......
......@@ -63,6 +63,7 @@ const images = {
iconCheck: require('./images/iconCheck.png'),
bgmedia: require('./images/bgmedia.jpeg'),
bgLogin: require('./images/bgLogin.png'),
iconPaper: require('./images/iconPaper.png'),
};
export default images;
......@@ -14,6 +14,7 @@ import {
AUTHEN,
PROFILE,
CONTRACT,
LEGALDOCUMENT,
} from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native';
import {connect} from 'react-redux';
......@@ -51,6 +52,12 @@ const menus = [
screen: FEEDBACK,
},
{
id: '7',
title: 'Giấy tờ pháp lý',
icon: R.images.iconPaper,
screen: LEGALDOCUMENT,
},
{
id: '5',
title: 'Cài đặt',
icon: R.images.iconSetting,
......
......@@ -58,3 +58,5 @@ export const WALLETWITHDRAW = 'WALLETWITHDRAW';
export const PACKETCQG = 'PACKETCQG';
export const MEDIADETAIL = 'MEDIADETAIL';
export const METHODPAYDETAIL = 'METHODPAYDETAIL';
export const LEGALDOCUMENT = 'LEGALDOCUMENT';
......@@ -39,6 +39,7 @@ 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 LegaDocument from '../Screens/LegalDocument/LegalDocument';
import * as ScreenName from './ScreenNames';
......@@ -57,6 +58,7 @@ function MyStack(props) {
headerMode={'none'}
initialRouteName={ScreenName.AUTHEN}>
<Stack.Screen name={ScreenName.LOGINSCREEN} component={Login} />
<Stack.Screen name={ScreenName.LEGALDOCUMENT} component={LegaDocument} />
<Stack.Screen name={ScreenName.NOTIFICATION} component={Notification} />
<Stack.Screen name={ScreenName.MEDIADETAIL} component={MediaDetail} />
<Stack.Screen name={ScreenName.TABNAVIGATOR} component={TabNavigator} />
......
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