Commit af02f104 by Nguyễn Thị Thúy

Merge remote-tracking branch 'origin/dev_phase2' into dev_phase2

parents ca7b3efd 9c0c620f
...@@ -132,8 +132,8 @@ android { ...@@ -132,8 +132,8 @@ android {
applicationId "com.dcv.invest" applicationId "com.dcv.invest"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 8 versionCode 11
versionName "1.3" versionName "1.5"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
splits { splits {
......
...@@ -4,6 +4,7 @@ import android.app.Application; ...@@ -4,6 +4,7 @@ import android.app.Application;
import android.content.Context; import android.content.Context;
import com.facebook.react.PackageList; import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication; import com.facebook.react.ReactApplication;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.reactnativecommunity.netinfo.NetInfoPackage; import com.reactnativecommunity.netinfo.NetInfoPackage;
import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactNativeHost;
......
rootProject.name = 'Invest' rootProject.name = 'Invest'
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':@react-native-community_netinfo' include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android') project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')
include ':react-native-bootsplash' include ':react-native-bootsplash'
......
...@@ -903,7 +903,7 @@ ...@@ -903,7 +903,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -912,7 +912,7 @@ ...@@ -912,7 +912,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.9; MARKETING_VERSION = 2.1;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
...@@ -937,11 +937,11 @@ ...@@ -937,11 +937,11 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements; CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
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.9; MARKETING_VERSION = 2.1;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
......
...@@ -89,6 +89,8 @@ target 'Invest' do ...@@ -89,6 +89,8 @@ target 'Invest' do
pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo' pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
target 'InvestTests' do target 'InvestTests' do
inherit! :complete inherit! :complete
# Pods for testing # Pods for testing
......
...@@ -14,6 +14,7 @@ import AppText from '../components/AppText'; ...@@ -14,6 +14,7 @@ import AppText from '../components/AppText';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW, TABNAVIGATOR, AUTHEN} from '../routers/ScreenNames'; import {DETAILNEW, TABNAVIGATOR, AUTHEN} from '../routers/ScreenNames';
import R from '../assets/R'; import R from '../assets/R';
import {isTablet} from 'react-native-device-info';
export const logout = (navigation) => { export const logout = (navigation) => {
AsyncStorage.clear(); AsyncStorage.clear();
...@@ -186,7 +187,11 @@ export const WIDTH = (w) => width * (w / 360); ...@@ -186,7 +187,11 @@ export const WIDTH = (w) => width * (w / 360);
export const HEIGHT = (h) => height * (h / 640); export const HEIGHT = (h) => height * (h / 640);
export const getLineHeight = (f) => f; export const getLineHeight = (f) => f;
export const getFont = (f) => f - 1; export const getFont = (f) => f - 1;
export const WIDTHXDICON = (w) => width * (w / 1125);
export const WIDTHXDICON = (w) =>
isTablet() ? (width * (w / 1125)) / 1.5 : width * (w / 1125);
export const HEIGHTXDICON = (h) =>
isTablet() ? (height * (h / 2436)) / 1.5 : height * (h / 2436);
export const validatePhone = (str) => { export const validatePhone = (str) => {
let re = /^[0-9+]{9,11}$/; let re = /^[0-9+]{9,11}$/;
...@@ -236,14 +241,18 @@ export const toPriceVnd = (str) => { ...@@ -236,14 +241,18 @@ export const toPriceVnd = (str) => {
export const floatToPriceVnd = (str) => { export const floatToPriceVnd = (str) => {
if (str) { if (str) {
let stringPrice = str.toString().split('.') let stringPrice = str.toString().split('.');
let headStringPrice = `${stringPrice[0].replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')}` let headStringPrice = `${stringPrice[0].replace(
return stringPrice.length === 1 ? headStringPrice : headStringPrice.concat(`.${stringPrice[1]}`) /(\d)(?=(\d{3})+(?!\d))/g,
'$1,',
)}`;
return stringPrice.length === 1
? headStringPrice
: headStringPrice.concat(`.${stringPrice[1]}`);
} else { } else {
return '' return '';
} }
} };
// cắt chuỗi dạng something... // cắt chuỗi dạng something...
export const ellipsis = (str = '', max = 30) => export const ellipsis = (str = '', max = 30) =>
...@@ -408,6 +417,10 @@ export const convertDate = (date) => { ...@@ -408,6 +417,10 @@ export const convertDate = (date) => {
return time; return time;
}; };
export const getDate = (date) => {
return moment(date).get('date');
};
export const convertTime = (date) => { export const convertTime = (date) => {
const temp = new Date(moment(date, 'DD/MM/YYYY')); const temp = new Date(moment(date, 'DD/MM/YYYY'));
const time = moment(temp).format('YYYY-MM-DD'); const time = moment(temp).format('YYYY-MM-DD');
......
import I18n from '../helper/i18/i18n';
export const RadioBuySale = [ export const RadioBuySale = [
{label: I18n.t('Buy'), value: 'BUY_IN'}, {label: 'Mua', value: 'BUY_IN'},
{label: I18n.t('Sale'), value: 'SELL_OUT'}, {label: 'Bán', value: 'SELL_OUT'},
];
export const RadioBuySaleEN = [
{label: 'Buy', value: 'BUY_IN'},
{label: 'Sell', value: 'SELL_OUT'},
]; ];
import React, {Component} from 'react'; import React, {Component} from 'react';
import {View, Text, StyleSheet, TouchableOpacity, Linking} from 'react-native'; import {View, Text, StyleSheet, TouchableOpacity, Linking} from 'react-native';
import {getFontXD, toPriceVnd} from '../../../Config/Functions'; import {
getFontXD,
toPriceVnd,
WIDTHXD,
HEIGHTXD,
} from '../../../Config/Functions';
import R from '../../../assets/R'; import R from '../../../assets/R';
import AppText from '../../../components/AppText'; import AppText from '../../../components/AppText';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
...@@ -44,8 +49,8 @@ const styles = StyleSheet.create({ ...@@ -44,8 +49,8 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
width: 140, width: WIDTHXD(400),
height: 40, height: HEIGHTXD(120),
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
borderRadius: 10, borderRadius: 10,
justifyContent: 'center', justifyContent: 'center',
......
...@@ -26,6 +26,7 @@ const PacketCQG = (props) => { ...@@ -26,6 +26,7 @@ const PacketCQG = (props) => {
const [feeConnect, setFeeConnect] = useState({data: [], title: ''}); const [feeConnect, setFeeConnect] = useState({data: [], title: ''});
const [feeNonPro, setFeeNonPro] = useState({data: [], title: ''}); const [feeNonPro, setFeeNonPro] = useState({data: [], title: ''});
const [feePro, setFeePro] = useState({data: [], title: ''}); const [feePro, setFeePro] = useState({data: [], title: ''});
const [feeOperating, setOperrating] = useState({data: [], title: ''});
const [totalMD, setTotalMD] = useState(0); const [totalMD, setTotalMD] = useState(0);
const [totalTB, setTotalTB] = useState(0); const [totalTB, setTotalTB] = useState(0);
const [isUpdate, setIsUpdate] = useState(false); const [isUpdate, setIsUpdate] = useState(false);
...@@ -133,6 +134,7 @@ const PacketCQG = (props) => { ...@@ -133,6 +134,7 @@ const PacketCQG = (props) => {
setFeeConnect(res.data.data.fee_connect); setFeeConnect(res.data.data.fee_connect);
setFeeNonPro(res.data.data.fee_pro); setFeeNonPro(res.data.data.fee_pro);
setFeePro(res.data.data.fee_non_pro); setFeePro(res.data.data.fee_non_pro);
setOperrating(res.data.data.fee_operating);
if (res.data.package_register.length > 0) { if (res.data.package_register.length > 0) {
setListData(res.data.package_register); setListData(res.data.package_register);
...@@ -161,6 +163,13 @@ const PacketCQG = (props) => { ...@@ -161,6 +163,13 @@ const PacketCQG = (props) => {
<WrapNomarl <WrapNomarl
onRemovePacket={onRemovePacket} onRemovePacket={onRemovePacket}
onChoosePacket={onChoosePacket} onChoosePacket={onChoosePacket}
data={feeOperating}
listRegister={listRegister}
/>
<WrapNomarl
onRemovePacket={onRemovePacket}
onChoosePacket={onChoosePacket}
data={feeConnect} data={feeConnect}
listRegister={listRegister} listRegister={listRegister}
/> />
......
...@@ -21,12 +21,9 @@ const ContainerTop = (props) => { ...@@ -21,12 +21,9 @@ const ContainerTop = (props) => {
useEffect(() => { useEffect(() => {
const newList = data.map((e) => { const newList = data.map((e) => {
console.log(props.listRegister);
if (props.listRegister.includes(e.id)) { if (props.listRegister.includes(e.id)) {
console.log('Chay vao day', e.id);
return {...e, selected: true}; return {...e, selected: true};
} else { } else {
console.log('Chay xuong duoi', e.id);
return {...e, selected: false}; return {...e, selected: false};
} }
}); });
......
...@@ -18,7 +18,11 @@ import { ...@@ -18,7 +18,11 @@ import {
} from 'react-native-confirmation-code-field'; } from 'react-native-confirmation-code-field';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions';
import R from '.././../../assets/R'; import R from '.././../../assets/R';
import {verifyOTPApi, registorApi} from '../../../apis/Functions/users'; import {
verifyOTPApi,
registorApi,
getOTPApi,
} from '../../../apis/Functions/users';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import AppText from '../../../components/AppText'; import AppText from '../../../components/AppText';
...@@ -27,12 +31,15 @@ import {showLoading, hideLoading} from '../../../actions/loadingAction'; ...@@ -27,12 +31,15 @@ import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {TABNAVIGATOR} from '../../../routers/ScreenNames'; import {TABNAVIGATOR} from '../../../routers/ScreenNames';
import {showAlert, TYPE} from '../../../components/DropdownAlert'; import {showAlert, TYPE} from '../../../components/DropdownAlert';
import CountDown from '../../../components/CountDown';
const CELL_COUNT = 4; const CELL_COUNT = 4;
const ConfirmOTP = (propsa) => { const ConfirmOTP = (propsa) => {
const [value, setValue] = useState(''); const [value, setValue] = useState('');
const [isReset, setReset] = useState(false);
const navigate = useNavigation(); const navigate = useNavigation();
const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT}); const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT});
...@@ -70,6 +77,7 @@ const ConfirmOTP = (propsa) => { ...@@ -70,6 +77,7 @@ const ConfirmOTP = (propsa) => {
if (propsa.route.params.type == 'DEPOSIT') { if (propsa.route.params.type == 'DEPOSIT') {
const {amount, notes} = propsa.route.params; const {amount, notes} = propsa.route.params;
res = await walletDeposit({ res = await walletDeposit({
amount, amount,
platform: Platform.OS, platform: Platform.OS,
...@@ -96,15 +104,41 @@ const ConfirmOTP = (propsa) => { ...@@ -96,15 +104,41 @@ const ConfirmOTP = (propsa) => {
navigate.navigate(TABNAVIGATOR); navigate.navigate(TABNAVIGATOR);
}, 500); }, 500);
} else { } else {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
} }
} else { } else {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res1.data.message);
} }
propsa.hideLoading(); propsa.hideLoading();
} }
}; };
const getOTP = async () => {
let res;
propsa.showLoading();
if (propsa.route.params.type == 'DEPOSIT') {
res = await getOTPApi({
platform: Platform.OS,
otp_by: propsa.user.email,
type: 'CUSTOMER_REQUEST_DEPOSIT',
});
} else {
res = await getOTPApi({
platform: Platform.OS,
otp_by: propsa.user.email,
type: 'REQUEST_WITHDRAW',
});
}
propsa.hideLoading();
if (res.data.code == 200) {
setReset(!isReset);
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'VerifyOTP'} /> <HeaderBack title={'VerifyOTP'} />
...@@ -140,12 +174,12 @@ const ConfirmOTP = (propsa) => { ...@@ -140,12 +174,12 @@ const ConfirmOTP = (propsa) => {
<TouchableOpacity onPress={confirm} style={styles.btn}> <TouchableOpacity onPress={confirm} style={styles.btn}>
<AppText i18nKey={'Continue'} style={styles.txtBtn} /> <AppText i18nKey={'Continue'} style={styles.txtBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity style={styles.wrapFooter} onPress={getOTP}>
style={styles.wrapFooter}
onPress={() => navigate.goBack()}>
<Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text> <Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text>
<AppText i18nKey={'Re_send'} style={styles.txtSend} /> <AppText i18nKey={'Re_send'} style={styles.txtSend} />
</TouchableOpacity> </TouchableOpacity>
<CountDown isReset={isReset} />
</View> </View>
</View> </View>
); );
......
...@@ -3,7 +3,7 @@ import {View, Text, StyleSheet, TouchableOpacity} from 'react-native'; ...@@ -3,7 +3,7 @@ import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import Success from './Tab/Success'; import Success from './Tab/Success';
import Watting from './Tab/Watting'; import Watting from './Tab/Watting';
import {getFontXD} from '../../../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions';
import {WALLETDEPOSIT, WALLETWITHDRAW} from '../../../routers/ScreenNames'; import {WALLETDEPOSIT, WALLETWITHDRAW} from '../../../routers/ScreenNames';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import AppText from '../../../components/AppText'; import AppText from '../../../components/AppText';
...@@ -61,8 +61,8 @@ const styles = StyleSheet.create({ ...@@ -61,8 +61,8 @@ const styles = StyleSheet.create({
justifyContent: 'space-around', justifyContent: 'space-around',
}, },
btnRight: { btnRight: {
width: 140, width: WIDTHXD(400),
height: 40, height: HEIGHTXD(100),
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
borderRadius: 10, borderRadius: 10,
justifyContent: 'center', justifyContent: 'center',
...@@ -80,8 +80,8 @@ const styles = StyleSheet.create({ ...@@ -80,8 +80,8 @@ const styles = StyleSheet.create({
elevation: 1, elevation: 1,
}, },
btnLeft: { btnLeft: {
width: 140, width: WIDTHXD(400),
height: 40, height: HEIGHTXD(100),
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
borderRadius: 10, borderRadius: 10,
justifyContent: 'center', justifyContent: 'center',
......
...@@ -22,6 +22,8 @@ import { ...@@ -22,6 +22,8 @@ import {
getFontXD, getFontXD,
toPriceVnd, toPriceVnd,
checkFormatArray, checkFormatArray,
WIDTHXD,
HEIGHTXD,
} from '../../../Config/Functions'; } from '../../../Config/Functions';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction'; import {showLoading, hideLoading} from '../../../actions/loadingAction';
...@@ -172,8 +174,8 @@ const styles = StyleSheet.create({ ...@@ -172,8 +174,8 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
width: 140, width: WIDTHXD(400),
height: 40, height: HEIGHTXD(100),
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
borderRadius: 10, borderRadius: 10,
justifyContent: 'center', justifyContent: 'center',
......
...@@ -23,6 +23,7 @@ import { ...@@ -23,6 +23,7 @@ import {
HEIGHTXD, HEIGHTXD,
toPriceVnd, toPriceVnd,
checkFormatArray, checkFormatArray,
WIDTHXD,
} from '../../../Config/Functions'; } from '../../../Config/Functions';
import PickerItem from '../../../components/Picker/PickerItem'; import PickerItem from '../../../components/Picker/PickerItem';
import RadioForm from 'react-native-simple-radio-button'; import RadioForm from 'react-native-simple-radio-button';
...@@ -37,8 +38,13 @@ import {getOTPApi} from '../../../apis/Functions/users'; ...@@ -37,8 +38,13 @@ import {getOTPApi} from '../../../apis/Functions/users';
import {OTPWALLET} from '../../../routers/ScreenNames'; import {OTPWALLET} from '../../../routers/ScreenNames';
import {showAlert, TYPE} from '../../../components/DropdownAlert'; import {showAlert, TYPE} from '../../../components/DropdownAlert';
var radio_props = [ var radio_props = [
{label: I18n.t('FromWallet'), value: 'WALLET'}, {label: 'Từ ví', value: 'WALLET'},
{label: I18n.t('FromCQGAccount'), value: 'INVESTMENT'}, {label: 'Từ tài khoản CQG', value: 'INVESTMENT'},
];
var radio_propsEN = [
{label: 'From wallet', value: 'WALLET'},
{label: 'From CQG Account', value: 'INVESTMENT'},
]; ];
const {width} = Dimensions.get('window'); const {width} = Dimensions.get('window');
...@@ -88,26 +94,33 @@ const WalletWithdraw = (props) => { ...@@ -88,26 +94,33 @@ const WalletWithdraw = (props) => {
const index = checkFormatArray([type, amount]); const index = checkFormatArray([type, amount]);
if (index === true) { if (index === true) {
props.showLoading(); if (amount >= props.user.configs.request_withdraw_amount_min) {
const res = await getOTPApi({ props.showLoading();
platform: Platform.OS, const res = await getOTPApi({
otp_by: props.user.email, platform: Platform.OS,
type: 'REQUEST_WITHDRAW', otp_by: props.user.email,
}); type: 'REQUEST_WITHDRAW',
props.hideLoading();
if (res.data.code == 200) {
navigate.navigate(OTPWALLET, {
type: 'WITHDRAW',
src,
receiving_account: type.id,
amount,
notes,
}); });
props.hideLoading();
if (res.data.code == 200) {
navigate.navigate(OTPWALLET, {
type: 'WITHDRAW',
src,
receiving_account: type.id,
amount,
notes,
});
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
props.hideLoading();
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(
TYPE.WARN,
I18n.t('Notification'),
I18n.t('WarnMinReqestWithdraw'),
);
} }
props.hideLoading();
} else { } else {
showAlert( showAlert(
TYPE.WARN, TYPE.WARN,
...@@ -160,7 +173,11 @@ const WalletWithdraw = (props) => { ...@@ -160,7 +173,11 @@ const WalletWithdraw = (props) => {
</Text> </Text>
{/* <View style={styles.row}> */} {/* <View style={styles.row}> */}
<RadioForm <RadioForm
radio_props={radio_props} radio_props={
props.language.language == 'vi'
? radio_props
: radio_propsEN
}
labelStyle={{fontSize: getFontXD(42)}} labelStyle={{fontSize: getFontXD(42)}}
formHorizontal={true} formHorizontal={true}
style={styles.row} style={styles.row}
...@@ -196,6 +213,7 @@ const WalletWithdraw = (props) => { ...@@ -196,6 +213,7 @@ const WalletWithdraw = (props) => {
</View> </View>
</View> </View>
</ScrollView> </ScrollView>
<View <View
style={{ style={{
paddingVertical: 10, paddingVertical: 10,
...@@ -254,8 +272,8 @@ const styles = StyleSheet.create({ ...@@ -254,8 +272,8 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
width: 140, width: WIDTHXD(400),
height: 40, height: HEIGHTXD(120),
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
borderRadius: 10, borderRadius: 10,
justifyContent: 'center', justifyContent: 'center',
...@@ -272,6 +290,7 @@ const styles = StyleSheet.create({ ...@@ -272,6 +290,7 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
user: state.userReducer, user: state.userReducer,
language: state.languageReducer,
}; };
}; };
export default connect(mapStateToProps, { export default connect(mapStateToProps, {
......
...@@ -18,6 +18,7 @@ import Registor from './Registor'; ...@@ -18,6 +18,7 @@ import Registor from './Registor';
import {ScrollView} from 'react-native-gesture-handler'; import {ScrollView} from 'react-native-gesture-handler';
import R from '../../assets/R'; import R from '../../assets/R';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import {connect} from 'react-redux';
const {width, height} = Dimensions.get('window'); const {width, height} = Dimensions.get('window');
...@@ -51,12 +52,18 @@ const Authen = (props) => { ...@@ -51,12 +52,18 @@ const Authen = (props) => {
<Tab.Screen <Tab.Screen
name="LOGIN" name="LOGIN"
component={Login} component={Login}
options={{tabBarLabel: I18n.t('Login')}} options={{
tabBarLabel:
props.language.language == 'vi' ? 'Đăng nhập' : 'Login',
}}
/> />
<Tab.Screen <Tab.Screen
name="REGISTOR" name="REGISTOR"
component={Registor} component={Registor}
options={{tabBarLabel: I18n.t('Register')}} options={{
tabBarLabel:
props.language.language == 'vi' ? 'Đăng ký' : 'Register',
}}
/> />
</Tab.Navigator> </Tab.Navigator>
</ImageBackground> </ImageBackground>
...@@ -66,4 +73,10 @@ const Authen = (props) => { ...@@ -66,4 +73,10 @@ const Authen = (props) => {
); );
}; };
export default Authen; const mapStateToProps = (state) => {
return {
language: state.languageReducer,
};
};
export default connect(mapStateToProps, {})(Authen);
...@@ -27,11 +27,14 @@ import AppText from '../../components/AppText'; ...@@ -27,11 +27,14 @@ import AppText from '../../components/AppText';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert'; import {showAlert, TYPE} from '../../components/DropdownAlert';
import CountDown from '../../components/CountDown';
import {getOTPApi} from '../../apis/Functions/users';
const CELL_COUNT = 4; const CELL_COUNT = 4;
const ConfirmOTP = (propsa) => { const ConfirmOTP = (propsa) => {
const [value, setValue] = useState(''); const [value, setValue] = useState('');
const [isReset, setReset] = useState(false);
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -41,6 +44,22 @@ const ConfirmOTP = (propsa) => { ...@@ -41,6 +44,22 @@ const ConfirmOTP = (propsa) => {
setValue, setValue,
}); });
const getOTP = async () => {
propsa.showLoading();
const res = await getOTPApi({
platform: Platform.OS,
otp_by: propsa.route.params.email,
type: 'FORGOT_PASSWORD',
});
propsa.hideLoading();
if (res.data.code == 200) {
setReset(!isReset);
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
};
const confirm = async () => { const confirm = async () => {
if (!value) { if (!value) {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('EnterOTPRequest')); showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('EnterOTPRequest'));
...@@ -105,12 +124,11 @@ const ConfirmOTP = (propsa) => { ...@@ -105,12 +124,11 @@ const ConfirmOTP = (propsa) => {
<TouchableOpacity onPress={confirm} style={styles.btn}> <TouchableOpacity onPress={confirm} style={styles.btn}>
<AppText i18nKey={'Continue'} style={styles.txtBtn} /> <AppText i18nKey={'Continue'} style={styles.txtBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity style={styles.wrapFooter} onPress={getOTP}>
style={styles.wrapFooter}
onPress={() => navigate.goBack()}>
<Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text> <Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text>
<AppText i18nKey={'Re_send'} style={styles.txtSend} /> <AppText i18nKey={'Re_send'} style={styles.txtSend} />
</TouchableOpacity> </TouchableOpacity>
<CountDown isReset={isReset} />
</View> </View>
</View> </View>
); );
......
...@@ -19,7 +19,7 @@ import { ...@@ -19,7 +19,7 @@ import {
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import {NEWPASSWORD} from '../../routers/ScreenNames'; import {NEWPASSWORD} from '../../routers/ScreenNames';
import {verifyOTPApi, registorApi} from '../../apis/Functions/users'; import {verifyOTPApi, registorApi, getOTPApi} from '../../apis/Functions/users';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import AppText from '../../components/AppText'; import AppText from '../../components/AppText';
...@@ -27,12 +27,13 @@ import AppText from '../../components/AppText'; ...@@ -27,12 +27,13 @@ import AppText from '../../components/AppText';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert'; import {showAlert, TYPE} from '../../components/DropdownAlert';
import CountDown from '../../components/CountDown';
const CELL_COUNT = 4; const CELL_COUNT = 4;
const ConfirmOTP = (propsa) => { const ConfirmOTP = (propsa) => {
const [value, setValue] = useState(''); const [value, setValue] = useState('');
const [isReset, setReset] = useState(false);
const navigate = useNavigation(); const navigate = useNavigation();
const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT}); const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT});
...@@ -102,6 +103,22 @@ const ConfirmOTP = (propsa) => { ...@@ -102,6 +103,22 @@ const ConfirmOTP = (propsa) => {
} }
}; };
const getOTP = async () => {
propsa.showLoading();
const res = await getOTPApi({
platform: Platform.OS,
otp_by: propsa.route.params.email,
type: 'CUSTOMER_VERIFY',
});
propsa.hideLoading();
if (res.data.code == 200) {
setReset(!isReset);
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'VerifyOTP'} /> <HeaderBack title={'VerifyOTP'} />
...@@ -137,12 +154,11 @@ const ConfirmOTP = (propsa) => { ...@@ -137,12 +154,11 @@ const ConfirmOTP = (propsa) => {
<TouchableOpacity onPress={confirm} style={styles.btn}> <TouchableOpacity onPress={confirm} style={styles.btn}>
<AppText i18nKey={'Continue'} style={styles.txtBtn} /> <AppText i18nKey={'Continue'} style={styles.txtBtn} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity style={styles.wrapFooter} onPress={getOTP}>
style={styles.wrapFooter}
onPress={() => navigate.goBack()}>
<Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text> <Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text>
<AppText i18nKey={'Re_send'} style={styles.txtSend} /> <AppText i18nKey={'Re_send'} style={styles.txtSend} />
</TouchableOpacity> </TouchableOpacity>
<CountDown isReset={isReset} />
</View> </View>
</View> </View>
); );
......
...@@ -12,7 +12,7 @@ const styles = StyleSheet.create({ ...@@ -12,7 +12,7 @@ const styles = StyleSheet.create({
borderRadius: 5, borderRadius: 5,
height: HEIGHTXD(400), height: HEIGHTXD(400),
marginTop: 25, marginTop: HEIGHTXD(70),
borderBottomColor: R.colors.borderGray, borderBottomColor: R.colors.borderGray,
borderTopColor: R.colors.borderGray, borderTopColor: R.colors.borderGray,
shadowColor: '#000', shadowColor: '#000',
......
...@@ -193,8 +193,8 @@ const styles = StyleSheet.create({ ...@@ -193,8 +193,8 @@ const styles = StyleSheet.create({
marginBottom: 30, marginBottom: 30,
}, },
btn: { btn: {
width: 180, width: WIDTHXD(400),
height: HEIGHTXD(120), height: HEIGHTXD(100),
borderRadius: 10, borderRadius: 10,
backgroundColor: '#1C6AF6', backgroundColor: '#1C6AF6',
justifyContent: 'center', justifyContent: 'center',
......
...@@ -18,7 +18,12 @@ import R from '../../assets/R'; ...@@ -18,7 +18,12 @@ 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 {getFontXD, WIDTHXD, checkFormatArray} from '../../Config/Functions'; import {
getFontXD,
WIDTHXD,
checkFormatArray,
HEIGHTXD,
} from '../../Config/Functions';
import TextField from '../../components/Input/TextField'; import TextField from '../../components/Input/TextField';
import PickerItem from '../../components/Picker/PickerItem'; import PickerItem from '../../components/Picker/PickerItem';
import {getListBank, addMethodBank} from '../../apis/Functions/Widthdraw'; import {getListBank, addMethodBank} from '../../apis/Functions/Widthdraw';
...@@ -152,8 +157,8 @@ const styles = StyleSheet.create({ ...@@ -152,8 +157,8 @@ const styles = StyleSheet.create({
}, },
btn: { btn: {
width: 150, width: WIDTHXD(400),
height: 40, height: HEIGHTXD(100),
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
......
...@@ -69,8 +69,6 @@ const NewFeed = (props) => { ...@@ -69,8 +69,6 @@ const NewFeed = (props) => {
style={{ style={{
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
paddingLeft: 10,
paddingRight: 20,
paddingTop: 10, paddingTop: 10,
}}> }}>
<FlatList <FlatList
......
...@@ -2,19 +2,50 @@ import React, {Component} from 'react'; ...@@ -2,19 +2,50 @@ import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native'; import {View, Text, StyleSheet} from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import Block from '../../../components/Block'; import Block from '../../../components/Block';
import {getFontXD} from '../../../Config/Functions'; import {getFontXD, convertDate} from '../../../Config/Functions';
import {convertDate} from '../../../Config/Functions';
const Item = (props) => { const Item = (props) => {
const {title, date, time, start_date} = props.item; const {title, date, time, start_date} = props.item;
const d = new Date();
return ( return (
<View style={styles.container}> <View
style={[
styles.container,
d.getDate() == convertDate(start_date).slice(0, 2)
? {backgroundColor: '#B4D5FF'}
: {},
]}>
<View style={styles.left}> <View style={styles.left}>
<View style={styles.dot} /> <View
style={[
styles.dot,
d.getDate() == convertDate(start_date).slice(0, 2)
? {backgroundColor: 'red'}
: {},
]}
/>
</View> </View>
<View style={[styles.right, props.index == 0 ? {borderTopWidth: 0} : {}]}> <View style={[styles.right, props.index == 0 ? {borderTopWidth: 0} : {}]}>
<View style={styles.row}> <View style={styles.row}>
<Text style={styles.txtTime}> {convertDate(start_date)}</Text> <Text
<Text style={styles.txtDate}>{start_date.substring(10, 16)}</Text> style={[
styles.txtTime,
d.getDate() == convertDate(start_date).slice(0, 2)
? {color: 'red', fontWeight: '500'}
: {},
]}>
{' '}
{convertDate(start_date)}
</Text>
<Text
style={[
styles.txtDate,
d.getDate() == convertDate(start_date).slice(0, 2)
? {color: 'red', fontWeight: '500'}
: {},
]}>
{start_date.substring(10, 16)}
</Text>
</View> </View>
<Text style={styles.txtTitle}>{title}</Text> <Text style={styles.txtTitle}>{title}</Text>
</View> </View>
...@@ -27,11 +58,12 @@ export default Item; ...@@ -27,11 +58,12 @@ export default Item;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flexDirection: 'row', flexDirection: 'row',
marginLeft: 10, paddingLeft: 20,
paddingRight: 20,
}, },
left: { left: {
width: 0.6, width: 1,
backgroundColor: '#CECECE', backgroundColor: '#A7A7A7',
}, },
right: { right: {
marginLeft: 20, marginLeft: 20,
...@@ -62,6 +94,6 @@ const styles = StyleSheet.create({ ...@@ -62,6 +94,6 @@ const styles = StyleSheet.create({
color: R.colors.main, color: R.colors.main,
}, },
txtDate: { txtDate: {
color: '#929292', color: '#A7A7A7',
}, },
}); });
...@@ -52,7 +52,7 @@ const styles = StyleSheet.create({ ...@@ -52,7 +52,7 @@ const styles = StyleSheet.create({
marginRight: 15, marginRight: 15,
}, },
img: { img: {
width: 250, width: 250,
height: 200, height: 200,
borderRadius: 5, borderRadius: 5,
justifyContent: 'center', justifyContent: 'center',
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import {getFontXD} from '../../../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions';
import Block from '../../../components/Block'; import Block from '../../../components/Block';
import Icon from 'react-native-vector-icons/AntDesign'; import Icon from 'react-native-vector-icons/AntDesign';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
...@@ -83,7 +83,7 @@ const MediaView = (props) => { ...@@ -83,7 +83,7 @@ const MediaView = (props) => {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
containerTop: { containerTop: {
height: 300, height: HEIGHTXD(850),
width: '100%', width: '100%',
}, },
contentTop: { contentTop: {
...@@ -97,10 +97,10 @@ const styles = StyleSheet.create({ ...@@ -97,10 +97,10 @@ const styles = StyleSheet.create({
textDecorationLine: 'underline', textDecorationLine: 'underline',
}, },
containerBtn: { containerBtn: {
paddingHorizontal: 15, width: WIDTHXD(380),
paddingVertical: 5,
backgroundColor: '#1C6AF6', backgroundColor: '#1C6AF6',
borderRadius: 5, height: HEIGHTXD(120),
borderRadius: HEIGHTXD(30),
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
flexDirection: 'row', flexDirection: 'row',
......
...@@ -3,7 +3,7 @@ import React, {Component} from 'react'; ...@@ -3,7 +3,7 @@ import React, {Component} from 'react';
import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native'; import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native';
import Block from '../../../components/Block'; import Block from '../../../components/Block';
import Icon from 'react-native-vector-icons/AntDesign'; import Icon from 'react-native-vector-icons/AntDesign';
import {getFontXD} from '../../../Config/Functions'; import {getFontXD, HEIGHTXD} from '../../../Config/Functions';
import R from '../../../assets/R'; import R from '../../../assets/R';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {DETAILNEW} from '../../../routers/ScreenNames'; import {DETAILNEW} from '../../../routers/ScreenNames';
...@@ -49,7 +49,7 @@ const styles = StyleSheet.create({ ...@@ -49,7 +49,7 @@ const styles = StyleSheet.create({
color: '#A2A2A2', color: '#A2A2A2',
}, },
img: { img: {
height: 180, height: HEIGHTXD(500),
borderRadius: 10, borderRadius: 10,
marginTop: 5, marginTop: 5,
}, },
......
...@@ -13,7 +13,6 @@ import Block from '../../components/Block'; ...@@ -13,7 +13,6 @@ import Block from '../../components/Block';
const Item = (props) => { const Item = (props) => {
const {item} = props; const {item} = props;
console.log('noti', item);
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Block flex={1} row> <Block flex={1} row>
...@@ -35,7 +34,7 @@ export default Item; ...@@ -35,7 +34,7 @@ export default Item;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
marginTop: 10, marginTop: 8,
paddingVertical: 10, paddingVertical: 10,
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { shadowOffset: {
...@@ -47,7 +46,7 @@ const styles = StyleSheet.create({ ...@@ -47,7 +46,7 @@ const styles = StyleSheet.create({
elevation: 5, elevation: 5,
marginHorizontal: 10, marginHorizontal: 10,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
marginBottom: 10, marginBottom: 2,
borderRadius: HEIGHTXD(30), borderRadius: HEIGHTXD(30),
}, },
......
...@@ -81,7 +81,9 @@ const ServiceCustomerView = (props) => { ...@@ -81,7 +81,9 @@ const ServiceCustomerView = (props) => {
<AppText i18nKey={'HotLine'} style={styles.title} /> <AppText i18nKey={'HotLine'} style={styles.title} />
<TouchableOpacity onPress={() => callNumber(hotline_call)}> <TouchableOpacity onPress={() => callNumber(hotline_call)}>
<Text style={styles.txtContent}>{hotline}</Text> <Text style={[styles.txtContent, {textDecorationLine: 'underline'}]}>
{hotline}
</Text>
</TouchableOpacity> </TouchableOpacity>
<AppText i18nKey={'WorkingTime'} style={styles.title} /> <AppText i18nKey={'WorkingTime'} style={styles.title} />
......
...@@ -18,12 +18,14 @@ import I18n from '../../../helper/i18/i18n'; ...@@ -18,12 +18,14 @@ import I18n from '../../../helper/i18/i18n';
import PickerItem from '../../../components/Picker/PickerItem'; import PickerItem from '../../../components/Picker/PickerItem';
import R from '../../../assets/R'; import R from '../../../assets/R';
import RadioForm from 'react-native-simple-radio-button'; import RadioForm from 'react-native-simple-radio-button';
import {RadioBuySale} from '../../../Config/constants'; import {RadioBuySale, RadioBuySaleEN} from '../../../Config/constants';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import ItemCalculator from './ItemCalculator'; import ItemCalculator from './ItemCalculator';
import AppText from '../../../components/AppText'; import AppText from '../../../components/AppText';
import {connect} from 'react-redux';
const CalculatorProfitLossView = (props) => { const CalculatorProfitLossView = (props) => {
console.log(props.language.language);
return ( return (
<View style={{flex: 1, flexDirection: 'column', backgroundColor: 'white'}}> <View style={{flex: 1, flexDirection: 'column', backgroundColor: 'white'}}>
<HeaderBack title={'CalculatorProfitLoss'} isWhite={true} /> <HeaderBack title={'CalculatorProfitLoss'} isWhite={true} />
...@@ -48,7 +50,9 @@ const CalculatorProfitLossView = (props) => { ...@@ -48,7 +50,9 @@ const CalculatorProfitLossView = (props) => {
</AppText> </AppText>
<View style={{width: WIDTHXD(600), height: HEIGHTXD(85)}}> <View style={{width: WIDTHXD(600), height: HEIGHTXD(85)}}>
<RadioForm <RadioForm
radio_props={RadioBuySale} radio_props={
props.language.language == 'vi' ? RadioBuySale : RadioBuySaleEN
}
labelStyle={{fontSize: getFontXD(42)}} labelStyle={{fontSize: getFontXD(42)}}
formHorizontal={true} formHorizontal={true}
style={styles.row} style={styles.row}
...@@ -158,4 +162,11 @@ const styles = StyleSheet.create({ ...@@ -158,4 +162,11 @@ const styles = StyleSheet.create({
fontSize: getFontXD(48), fontSize: getFontXD(48),
}, },
}); });
export default CalculatorProfitLossView;
const mapStateToProps = (state) => {
return {
language: state.languageReducer,
};
};
export default connect(mapStateToProps, {})(CalculatorProfitLossView);
...@@ -35,12 +35,15 @@ const EscrowCalculatorView = (props) => { ...@@ -35,12 +35,15 @@ const EscrowCalculatorView = (props) => {
dataProduct={props.dataProduct} dataProduct={props.dataProduct}
setProduct={(product) => { setProduct={(product) => {
item.product = product; item.product = product;
item.firstEscrow = parseFloat(item.lotNumber) * product.escrow; item.firstEscrow =
parseFloat(item.lotNumber) * product.escrow;
props.setItemInput(item, index); props.setItemInput(item, index);
}} }}
setLotNumber={(lotNumber) => { setLotNumber={(lotNumber) => {
item.lotNumber = lotNumber.split('.').join(''); item.lotNumber = lotNumber.split('.').join('');
item.firstEscrow = item.product ? parseFloat(item.lotNumber) * item.product.escrow : 0; item.firstEscrow = item.product
? parseFloat(item.lotNumber) * item.product.escrow
: 0;
props.setItemInput(item, index); props.setItemInput(item, index);
}} }}
/> />
...@@ -57,23 +60,26 @@ const EscrowCalculatorView = (props) => { ...@@ -57,23 +60,26 @@ const EscrowCalculatorView = (props) => {
</View> </View>
<View style={{paddingHorizontal: WIDTHXD(60)}}> <View style={{paddingHorizontal: WIDTHXD(60)}}>
<TextMoney <TextMoney
editable={false}
title={I18n.t('FirstEscrowTotal')}
value={props.firstEscrowTotal}
titleStyle={{
marginTop: HEIGHTXD(160),
fontSize: getFontXD(39),
}}
inputStyle={{backgroundColor: R.colors.gray7}}
/>
<TextMoney
onChangeText={(val) => { onChangeText={(val) => {
props.setFirstEscrow(val.split('.').join('')); props.setFirstEscrow(val.split('.').join(''));
}} }}
title={I18n.t('FirstEscrow')} title={I18n.t('AvailableMargin')}
value={props.firstEscrow} value={props.firstEscrow}
titleStyle={{ titleStyle={{
marginTop: HEIGHTXD(180),
fontSize: getFontXD(39), fontSize: getFontXD(39),
}} }}
/> />
<TextMoney
editable={false}
title={I18n.t('FirstEscrowTotal')}
value={props.firstEscrowTotal}
titleStyle={{marginTop: HEIGHTXD(20), fontSize: getFontXD(39)}}
inputStyle={{backgroundColor: R.colors.gray7}}
/>
<Text style={styles.textMessage}>{props.message}</Text> <Text style={styles.textMessage}>{props.message}</Text>
</View> </View>
...@@ -144,7 +150,7 @@ const styles = StyleSheet.create({ ...@@ -144,7 +150,7 @@ const styles = StyleSheet.create({
shadowOpacity: 0.25, shadowOpacity: 0.25,
shadowRadius: 3.84, shadowRadius: 3.84,
elevation: 3, elevation: 3,
borderRadius: 30, borderRadius: WIDTHXD(144),
}, },
btn: { btn: {
width: WIDTHXD(428), width: WIDTHXD(428),
......
import React from 'react'; import React from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'; import {
StyleSheet,
Text,
TouchableOpacity,
View,
Dimensions,
} from 'react-native';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import PickerItem from '../../../components/Picker/PickerItem'; import PickerItem from '../../../components/Picker/PickerItem';
import { import {
...@@ -12,28 +18,38 @@ import R from '../../../assets/R'; ...@@ -12,28 +18,38 @@ import R from '../../../assets/R';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import Icon from 'react-native-vector-icons/Entypo'; import Icon from 'react-native-vector-icons/Entypo';
const {width} = Dimensions.get('window');
const ItemEscrowCalculator = (props) => { const ItemEscrowCalculator = (props) => {
return ( return (
<View style={styles.viewInput}> <View style={styles.viewInput}>
<Text style={styles.textTitle}>{I18n.t('Product')}</Text> <View style={{flexDirection: 'row', flex: 1}}>
<PickerItem <View style={{flex: 1, marginVertical: 5}}>
data={props.dataProduct} <Text style={styles.textTitle}>{I18n.t('Product')}</Text>
onValueChange={(value, item) => { <PickerItem
props.setProduct(item); data={props.dataProduct}
}} onValueChange={(value, item) => {
iconSize={WIDTHXD(40)} props.setProduct(item);
iconColor={R.colors.black} }}
/> width={width / 2 - 30}
iconSize={WIDTHXD(40)}
iconColor={R.colors.black}
/>
</View>
<View style={{width: 20}} />
<View style={{flex: 1}}>
<TextMoney
onChangeText={(val) => {
props.setLotNumber(val);
}}
title={I18n.t('LotTransactionNumber')}
value={toPriceVnd(props.item.lotNumber)}
titleStyle={{fontSize: getFontXD(39)}}
/>
</View>
</View>
<TextMoney <TextMoney
onChangeText={(val) => {
props.setLotNumber(val);
}}
title={I18n.t('LotTransactionNumber')}
value={toPriceVnd(props.item.lotNumber)}
titleStyle={{marginTop: HEIGHTXD(20), fontSize: getFontXD(39)}}
/>
<TextMoney
onChangeText={(val) => {}} onChangeText={(val) => {}}
title={I18n.t('FirstEscrow')} title={I18n.t('FirstEscrow')}
value={props.item.firstEscrow} value={props.item.firstEscrow}
...@@ -52,6 +68,7 @@ const styles = StyleSheet.create({ ...@@ -52,6 +68,7 @@ const styles = StyleSheet.create({
borderColor: '#707070', borderColor: '#707070',
paddingHorizontal: WIDTHXD(24), paddingHorizontal: WIDTHXD(24),
paddingVertical: WIDTHXD(24), paddingVertical: WIDTHXD(24),
}, },
textTitle: { textTitle: {
fontSize: getFontXD(39), fontSize: getFontXD(39),
......
...@@ -56,6 +56,11 @@ const ExchangeRate = (props) => { ...@@ -56,6 +56,11 @@ const ExchangeRate = (props) => {
} else if (!priceExchange) setUsdTan(''); } else if (!priceExchange) setUsdTan('');
}; };
const onClick = () => {
setPriceExchange('');
setUsdTan('');
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'ExchangeRate'} /> <HeaderBack title={'ExchangeRate'} />
...@@ -76,6 +81,7 @@ const ExchangeRate = (props) => { ...@@ -76,6 +81,7 @@ const ExchangeRate = (props) => {
<TextField <TextField
isNumber={true} isNumber={true}
maxLength={12} maxLength={12}
value={priceExchange}
onChangeText={(val) => setPriceExchange(val)} onChangeText={(val) => setPriceExchange(val)}
title={I18n.t('ConversionPrice')} title={I18n.t('ConversionPrice')}
/> />
...@@ -85,7 +91,7 @@ const ExchangeRate = (props) => { ...@@ -85,7 +91,7 @@ const ExchangeRate = (props) => {
title={I18n.t('ConvertUSD')} title={I18n.t('ConvertUSD')}
/> />
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity style={styles.btnContainer}> <TouchableOpacity onPress={onClick} style={styles.btnContainer}>
<AppText style={styles.txtBtn} i18nKey={'Delete'} /> <AppText style={styles.txtBtn} i18nKey={'Delete'} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
......
...@@ -19,27 +19,37 @@ import I18n from '../../../helper/i18/i18n'; ...@@ -19,27 +19,37 @@ import I18n from '../../../helper/i18/i18n';
const Item = (props) => { const Item = (props) => {
const {item, isEndItem} = props; const {item, isEndItem} = props;
console.log(item) console.log(item);
return ( return (
<View style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}> <View
style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}>
<TouchableOpacity onPress={() => props.onPress(item)}> <TouchableOpacity onPress={() => props.onPress(item)}>
<Block flex={1} row> <Block flex={1} row>
<View style={styles.wrapDate}> <View style={styles.wrapDate}>
<Image source={{uri: item.commoditiy.image_path}} style={styles.imgIcon} /> <Image
source={{uri: item.commoditiy.image_path}}
style={styles.imgIcon}
/>
</View> </View>
<Block padding={[5, 10]} space={'between'} flex={1}> <Block padding={[0, 10]} space={'between'} flex={1}>
<View <View
style={{ style={{
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
}}> }}>
<Text numberOfLines={2} style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]} numberOfLines={1} ellipsizeMode='tail'> <Text
numberOfLines={2}
style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]}
numberOfLines={1}
ellipsizeMode="tail">
{item.contract_name} {item.contract_name}
</Text> </Text>
<Text style={styles.txtMoney}>{item.term}</Text> <Text style={styles.txtMoney}>{item.term}</Text>
</View> </View>
<Text style={styles.txtCode}>{`${I18n.t('ContactCode')}: ${item.contract_code}`}</Text> <Text style={styles.txtCode}>{`${I18n.t('ContactCode')}: ${
item.contract_code
}`}</Text>
<Text style={styles.txt}>{item.open_interest_range}</Text> <Text style={styles.txt}>{item.open_interest_range}</Text>
</Block> </Block>
</Block> </Block>
...@@ -64,7 +74,7 @@ const styles = StyleSheet.create({ ...@@ -64,7 +74,7 @@ const styles = StyleSheet.create({
marginHorizontal: 10, marginHorizontal: 10,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
borderRadius: HEIGHTXD(30), borderRadius: HEIGHTXD(30),
marginVertical: HEIGHTXD(15) marginVertical: HEIGHTXD(15),
}, },
wrapLeft: { wrapLeft: {
...@@ -95,12 +105,12 @@ const styles = StyleSheet.create({ ...@@ -95,12 +105,12 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
}, },
txtBlack: { txtBlack: {
fontSize: getFontXD(50), fontSize: getFontXD(46),
color: 'black', color: 'black',
}, },
imgIcon: { imgIcon: {
width: WIDTHXD(150), width: WIDTHXD(178),
height: WIDTHXD(150), height: WIDTHXD(178),
resizeMode: 'cover', resizeMode: 'cover',
}, },
txtMoney: { txtMoney: {
......
...@@ -15,29 +15,40 @@ import { ...@@ -15,29 +15,40 @@ import {
} from '../../../Config/Functions'; } from '../../../Config/Functions';
import R from '../../../assets/R'; import R from '../../../assets/R';
import Block from '../../../components/Block'; import Block from '../../../components/Block';
import I18n from '../../../helper/i18/i18n';
const Item = (props) => { const Item = (props) => {
const {item, isEndItem} = props; const {item, isEndItem} = props;
return ( return (
<View style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}> <View
style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}>
<TouchableOpacity onPress={() => props.onPress(item)}> <TouchableOpacity onPress={() => props.onPress(item)}>
<Block flex={1} row> <Block flex={1} row>
<View style={styles.wrapDate}> <View style={styles.wrapDate}>
<Image source={{uri: item.image_path}} style={styles.imgIcon} /> <Image source={{uri: item.image_path}} style={styles.imgIcon} />
</View> </View>
<Block padding={[5, 10]} space={'between'} flex={1}> <Block padding={[0, 10]} flex={1}>
<View <View
style={{ style={{
flex: 1,
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
marginBottom: 5,
}}> }}>
<Text numberOfLines={2} style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]} numberOfLines={1} ellipsizeMode='tail'> <Text
numberOfLines={2}
style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]}
numberOfLines={1}
ellipsizeMode="tail">
{item.name} {item.name}
</Text> </Text>
<Text style={styles.txtMoney}>{item.escrow > 0 ? toPriceVnd(item.escrow) : 0}</Text> <Text style={styles.txtMoney}>
{item.escrow > 0 ? toPriceVnd(item.escrow) : 0}
</Text>
</View> </View>
<Text style={styles.txt}>{item.code}</Text> <Text style={styles.txt}>
{' '}
{I18n.t('code')}: {item.code}
</Text>
</Block> </Block>
</Block> </Block>
</TouchableOpacity> </TouchableOpacity>
...@@ -61,7 +72,7 @@ const styles = StyleSheet.create({ ...@@ -61,7 +72,7 @@ const styles = StyleSheet.create({
marginHorizontal: 10, marginHorizontal: 10,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
borderRadius: HEIGHTXD(30), borderRadius: HEIGHTXD(30),
marginVertical: HEIGHTXD(15) marginVertical: HEIGHTXD(15),
}, },
wrapLeft: { wrapLeft: {
...@@ -87,7 +98,7 @@ const styles = StyleSheet.create({ ...@@ -87,7 +98,7 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
}, },
txtBlack: { txtBlack: {
fontSize: getFontXD(50), fontSize: getFontXD(46),
color: 'black', color: 'black',
}, },
imgIcon: { imgIcon: {
......
...@@ -15,27 +15,35 @@ import { ...@@ -15,27 +15,35 @@ import {
} from '../../../Config/Functions'; } from '../../../Config/Functions';
import R from '../../../assets/R'; import R from '../../../assets/R';
import Block from '../../../components/Block'; import Block from '../../../components/Block';
import I18n from '../../../helper/i18/i18n';
const Item = (props) => { const Item = (props) => {
const {item, isEndItem} = props; const {item, isEndItem} = props;
console.log('sss', item);
return ( return (
<View style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}> <View
style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}>
<TouchableOpacity onPress={() => props.onPress(item)}> <TouchableOpacity onPress={() => props.onPress(item)}>
<Block flex={1} row> <Block flex={1} row>
<Image source={{uri: item.image_path}} style={styles.imgIcon} /> <Image source={{uri: item.image_path}} style={styles.imgIcon} />
<Block padding={[0, WIDTHXD(40)]} space={'between'} flex={1}> <Block padding={[0, WIDTHXD(40)]} space={'between'} flex={1}>
<View <View
style={{ style={{
flex: 1,
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between',
}}> }}>
<Text numberOfLines={2} style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]} numberOfLines={1} ellipsizeMode='tail'> <Text
numberOfLines={2}
style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]}
numberOfLines={1}
ellipsizeMode="tail">
{item.name} {item.name}
</Text> </Text>
<Text style={styles.txtMoney}>{toPriceVnd(item.fee)}</Text> <Text style={styles.txtMoney}>{toPriceVnd(item.fee)}</Text>
</View> </View>
<Text style={styles.txt}>{item.code}</Text> <Text style={styles.txt}>
{I18n.t('code')}: {item.code}
</Text>
<Text style={styles.txt}>{item.category.name}</Text>
</Block> </Block>
</Block> </Block>
</TouchableOpacity> </TouchableOpacity>
...@@ -59,7 +67,7 @@ const styles = StyleSheet.create({ ...@@ -59,7 +67,7 @@ const styles = StyleSheet.create({
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
borderRadius: HEIGHTXD(30), borderRadius: HEIGHTXD(30),
marginVertical: HEIGHTXD(15), marginVertical: HEIGHTXD(15),
marginHorizontal: WIDTHXD(30) marginHorizontal: WIDTHXD(30),
}, },
wrapLeft: { wrapLeft: {
...@@ -82,14 +90,14 @@ const styles = StyleSheet.create({ ...@@ -82,14 +90,14 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
}, },
txtBlack: { txtBlack: {
fontSize: getFontXD(50), fontSize: getFontXD(46),
color: 'black', color: 'black',
}, },
imgIcon: { imgIcon: {
width: WIDTHXD(150), width: WIDTHXD(178),
height: WIDTHXD(150), height: WIDTHXD(178),
resizeMode: 'cover', resizeMode: 'cover',
marginLeft: WIDTHXD(35) marginLeft: WIDTHXD(35),
}, },
txtMoney: { txtMoney: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -17,6 +17,7 @@ const ContractDescription = (props) => { ...@@ -17,6 +17,7 @@ const ContractDescription = (props) => {
showLoading(); showLoading();
const res = await getContractDescription(props.route.params.id); const res = await getContractDescription(props.route.params.id);
if (res.status === 200 && res.data.code === 200) { if (res.status === 200 && res.data.code === 200) {
console.log('Data', res.data.data);
setContractDescription(res.data.data); setContractDescription(res.data.data);
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
......
import React from 'react'; import React from 'react';
import { import {View, Text, StyleSheet, TouchableOpacity, Image} from 'react-native';
View, import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions';
Text,
StyleSheet,
TouchableOpacity,
Image,
} from 'react-native';
import {
getFontXD,
HEIGHTXD,
WIDTHXD,
} from '../../../Config/Functions';
import R from '../../../assets/R'; import R from '../../../assets/R';
import Block from '../../../components/Block'; import Block from '../../../components/Block';
const Item = (props) => { const Item = (props) => {
const {item, isEndItem} = props; const {item, isEndItem} = props;
return ( return (
<View style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}> <View
<TouchableOpacity onPress={() => props.onPress(item)}> style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}]}>
<Block flex={1} row> <TouchableOpacity onPress={() => props.onPress(item)}>
<View style={styles.wrapDate}> <Block flex={1} row>
<Image source={{uri: item.image_path}} style={styles.imgIcon}/> <View style={styles.wrapDate}>
</View> <Image source={{uri: item.image_path}} style={styles.imgIcon} />
<Block padding={[0, 10]} space={'between'} flex={1}> </View>
<View <Block padding={[0, 10]} flex={1}>
style={{ <View
flex: 1, style={{
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', }}>
}}> <Text
<Text numberOfLines={2} style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]} numberOfLines={2}
numberOfLines={1} ellipsizeMode='tail'> style={[styles.txtBlack, {flexWrap: 'wrap', flex: 1}]}
{item.name} numberOfLines={1}
</Text> ellipsizeMode="tail">
<Text style={styles.txtMoney}>{item.trans_time}</Text> {item.name}
</View> </Text>
{item.trans_session_list.map((sessionItem) => ( <Text style={styles.txtMoney}>{item.trans_time}</Text>
<Text style={[styles.txt, {marginTop: HEIGHTXD(20)}]}>{sessionItem}</Text> </View>
) {item.trans_session_list.map((sessionItem) => (
)} <Text style={[styles.txt, {marginTop: HEIGHTXD(20)}]}>
</Block> {sessionItem}
</Block> </Text>
</TouchableOpacity> ))}
</View> </Block>
); </Block>
</TouchableOpacity>
</View>
);
}; };
export default Item; export default Item;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
paddingVertical: HEIGHTXD(30), paddingVertical: HEIGHTXD(30),
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { shadowOffset: {
width: 0, width: 0,
height: 2, height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
marginHorizontal: 10,
backgroundColor: R.colors.white,
borderRadius: HEIGHTXD(30),
marginVertical: HEIGHTXD(15),
}, },
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
marginHorizontal: 10,
backgroundColor: R.colors.white,
borderRadius: HEIGHTXD(30),
marginVertical: HEIGHTXD(15),
},
wrapLeft: { wrapLeft: {
width: WIDTHXD(16), width: WIDTHXD(16),
borderTopLeftRadius: HEIGHTXD(30), borderTopLeftRadius: HEIGHTXD(30),
borderBottomStartRadius: HEIGHTXD(30), borderBottomStartRadius: HEIGHTXD(30),
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingLeft: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: R.colors.black, color: R.colors.black,
}, },
txt: { txt: {
fontSize: getFontXD(36), fontSize: getFontXD(36),
}, },
rowBet: { rowBet: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
}, },
txtBlack: { txtBlack: {
fontSize: getFontXD(50), fontSize: getFontXD(46),
color: 'black', color: 'black',
}, },
imgIcon: { imgIcon: {
width: WIDTHXD(150), width: WIDTHXD(178),
height: WIDTHXD(150), height: WIDTHXD(178),
resizeMode: 'cover', resizeMode: 'cover',
}, },
txtMoney: { txtMoney: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: R.colors.main, color: R.colors.main,
}, },
}); });
...@@ -6,6 +6,7 @@ import Escrow from './Escrow/Escrow'; ...@@ -6,6 +6,7 @@ import Escrow from './Escrow/Escrow';
import PriceList from './PriceList/PriceList'; import PriceList from './PriceList/PriceList';
import TimeTransaction from './TimeTransaction/TimeTransaction'; import TimeTransaction from './TimeTransaction/TimeTransaction';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import {connect} from 'react-redux';
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs'; import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
const Tab = createMaterialTopTabNavigator(); const Tab = createMaterialTopTabNavigator();
...@@ -29,22 +30,36 @@ const NewFeed = (props) => { ...@@ -29,22 +30,36 @@ const NewFeed = (props) => {
<Tab.Screen <Tab.Screen
name="PriceList" name="PriceList"
component={PriceList} component={PriceList}
options={{tabBarLabel: 'Bảng phí'}} options={{
tabBarLabel:
props.language.language == 'vi' ? 'Bảng phí' : 'PriceList',
}}
/> />
<Tab.Screen <Tab.Screen
name="TimeTransaction" name="TimeTransaction"
component={TimeTransaction} component={TimeTransaction}
options={{tabBarLabel: 'Thời gian GD'}} options={{
tabBarLabel:
props.language.language == 'vi'
? 'Thời gian GD'
: 'Time transace',
}}
/> />
<Tab.Screen <Tab.Screen
name="Escrow" name="Escrow"
component={Escrow} component={Escrow}
options={{tabBarLabel: 'Ký quỹ'}} options={{
tabBarLabel:
props.language.language == 'vi' ? 'Ký quỹ' : 'Escrow',
}}
/> />
<Tab.Screen <Tab.Screen
name="DueDate" name="DueDate"
component={DueDate} component={DueDate}
options={{tabBarLabel: 'Lịch đáo hạn'}} options={{
tabBarLabel:
props.language.language == 'vi' ? 'Lịch đáo hạn' : 'Due date',
}}
/> />
</Tab.Navigator> </Tab.Navigator>
</View> </View>
...@@ -52,4 +67,10 @@ const NewFeed = (props) => { ...@@ -52,4 +67,10 @@ const NewFeed = (props) => {
); );
}; };
export default NewFeed; const mapStateToProps = (state) => {
return {
language: state.languageReducer,
};
};
export default connect(mapStateToProps, {})(NewFeed);
import React, {Component, useEffect, useState} from 'react';
import {View, Text} from 'react-native';
import {showAlert, TYPE} from './DropdownAlert';
import I18n from '../helper/i18/i18n';
import {getFontXD} from '../Config/Functions';
const CountDown = (props) => {
const [count, setCount] = useState(300);
useEffect(() => {
setCount(300);
}, [props.isReset]);
useEffect(() => {
if (count == 0)
showAlert(TYPE.ERROR, I18n.t('Notification'), I18n.t('Overtime'));
}, [count]);
useEffect(() => {
if (count > 0) {
const timer = setTimeout(() => {
setCount(count - 1);
}, 1000);
return () => clearTimeout(timer);
}
});
const secondToString = (count) => {
const temp = count % 60;
return temp < 10 ? `0${temp}` : temp;
};
return (
<View>
<Text
style={{
color: '#A2A2A2',
fontStyle: 'italic',
fontSize: getFontXD(42),
}}>
0{parseInt(count / 60)}:{secondToString(count)}
</Text>
</View>
);
};
export default CountDown;
...@@ -36,6 +36,7 @@ import { ...@@ -36,6 +36,7 @@ import {
ROSE, ROSE,
HISTORY, HISTORY,
CHOOSEMETHOD, CHOOSEMETHOD,
WALLETWITHDRAW,
} from '../../routers/ScreenNames'; } from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
...@@ -100,7 +101,7 @@ const menus = [ ...@@ -100,7 +101,7 @@ const menus = [
id: '62', id: '62',
title: 'Withdraw', title: 'Withdraw',
icon: R.images.iconWithdrawMenu, icon: R.images.iconWithdrawMenu,
screen: WITHDRAW, screen: WALLETWITHDRAW,
}, },
{ {
id: '63', id: '63',
......
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
Alert, 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, getWidth, 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';
...@@ -195,14 +195,25 @@ const renderActions = (onClickDetail) => { ...@@ -195,14 +195,25 @@ const renderActions = (onClickDetail) => {
<AppText i18nKey={'History'} style={styles.txt} /> <AppText i18nKey={'History'} style={styles.txt} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{justifyContent: 'center', alignItems: 'center'}}> <View
<View style={{width: 30, height: 20}}> style={{
<TouchableOpacity justifyContent: 'center',
onPress={() => onClickDetail()} alignItems: 'center',
style={styles.containerBtn}> }}>
<TouchableOpacity
onPress={() => {
onClickDetail();
}}
style={{
width: HEIGHTXD(160),
height: HEIGHTXD(80),
justifyContent: 'center',
alignItems: 'center',
}}>
<View style={styles.containerBtn}>
<Icon name={'up'} size={18} color={R.colors.color777} /> <Icon name={'up'} size={18} color={R.colors.color777} />
</TouchableOpacity> </View>
</View> </TouchableOpacity>
</View> </View>
</View> </View>
); );
...@@ -280,14 +291,25 @@ const HeaderHome = (props) => { ...@@ -280,14 +291,25 @@ const HeaderHome = (props) => {
{detail ? ( {detail ? (
renderActions(onClickDetail) renderActions(onClickDetail)
) : ( ) : (
<View style={{justifyContent: 'center', alignItems: 'center'}}> <View
<View style={{width: 30, height: 20}}> style={{
<TouchableOpacity justifyContent: 'center',
onPress={onClickDetail} alignItems: 'center',
style={styles.containerBtn}> }}>
<TouchableOpacity
onPress={() => {
onClickDetail();
}}
style={{
width: HEIGHTXD(160),
height: HEIGHTXD(80),
justifyContent: 'center',
alignItems: 'center',
}}>
<View style={styles.containerBtn}>
<Icon name={'down'} size={18} color={R.colors.color777} /> <Icon name={'down'} size={18} color={R.colors.color777} />
</TouchableOpacity> </View>
</View> </TouchableOpacity>
</View> </View>
)} )}
</View> </View>
...@@ -317,22 +339,22 @@ const styles = StyleSheet.create({ ...@@ -317,22 +339,22 @@ const styles = StyleSheet.create({
borderBottomColor: '#EDEDF1', borderBottomColor: '#EDEDF1',
}, },
containerBtn: { containerBtn: {
position: 'absolute', width: HEIGHTXD(80),
width: 30, height: HEIGHTXD(80),
height: 30,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
borderRadius: 20, borderRadius: HEIGHTXD(80),
top: 5,
shadowColor: '#000', shadowColor: '#000',
marginTop: 15,
shadowOffset: { shadowOffset: {
width: 0, width: 1,
height: 1, height: 2,
}, },
shadowOpacity: 0.25, shadowOpacity: 0.55,
shadowRadius: 1.84, shadowRadius: 1.84,
elevation: 1, elevation: 3,
}, },
img: { img: {
height: Platform.OS == 'ios' ? HEIGHTXD(728) : HEIGHTXD(808), height: Platform.OS == 'ios' ? HEIGHTXD(728) : HEIGHTXD(808),
...@@ -343,7 +365,7 @@ const styles = StyleSheet.create({ ...@@ -343,7 +365,7 @@ const styles = StyleSheet.create({
}, },
containerTop: { containerTop: {
backgroundColor: 'white', backgroundColor: 'white',
width: '90%', width: getWidth() - 40,
borderRadius: 10, borderRadius: 10,
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { shadowOffset: {
......
...@@ -5,16 +5,27 @@ import R from '../../assets/R'; ...@@ -5,16 +5,27 @@ import R from '../../assets/R';
import {toPriceVnd} from '../../Config/Functions'; import {toPriceVnd} from '../../Config/Functions';
const TextMoney = (props) => { const TextMoney = (props) => {
const {title, onChangeText, maxLength, value, editable, titleStyle, inputStyle} = props; const {
title,
onChangeText,
maxLength,
value,
editable,
titleStyle,
inputStyle,
} = props;
return ( return (
<View style={{marginVertical: 5}}> <View style={{marginVertical: 5}}>
<Text <Text
style={[{ style={[
fontSize: getFontXD(42), {
color: R.colors.color777, fontSize: getFontXD(42),
marginBottom: 5, color: R.colors.color777,
}, titleStyle && titleStyle]}> marginBottom: 5,
},
titleStyle && titleStyle,
]}>
{title ? title : ''} {title ? title : ''}
</Text> </Text>
<TextInput <TextInput
...@@ -25,25 +36,28 @@ const TextMoney = (props) => { ...@@ -25,25 +36,28 @@ const TextMoney = (props) => {
value={toPriceVnd(value)} value={toPriceVnd(value)}
keyboardType={'number-pad'} keyboardType={'number-pad'}
onChangeText={(val) => onChangeText(val.split(',').join(''))} onChangeText={(val) => onChangeText(val.split(',').join(''))}
style={[{ style={[
height: HEIGHTXD(109), {
color: 'black', height: HEIGHTXD(109),
borderRadius: 7, color: 'black',
borderWidth: 0.7, borderRadius: 7,
borderColor: '#DBDBDB', borderWidth: 0.7,
fontSize: getFontXD(42), borderColor: '#DBDBDB',
paddingVertical: 5, fontSize: getFontXD(42),
paddingHorizontal: 10, paddingVertical: 5,
backgroundColor: 'white', paddingHorizontal: 10,
shadowColor: '#AFA9A9', backgroundColor: 'white',
shadowOffset: { shadowColor: '#AFA9A9',
width: 0, shadowOffset: {
height: 1, width: 0,
height: 1,
},
shadowOpacity: 0.25,
shadowRadius: 1.84,
elevation: 1,
}, },
shadowOpacity: 0.25, inputStyle && inputStyle,
shadowRadius: 1.84, ]}
elevation: 1,
}, inputStyle && inputStyle]}
/> />
</View> </View>
); );
......
...@@ -18,7 +18,6 @@ const FirebaseNotification = (props) => { ...@@ -18,7 +18,6 @@ const FirebaseNotification = (props) => {
id: props.user.uid, id: props.user.uid,
platform: Platform.OS, platform: Platform.OS,
}); });
console.log('res', res.data.data);
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
props.saveUserToRedux(res.data.data); props.saveUserToRedux(res.data.data);
} }
......
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
NothingChange: 'Nothing change', NothingChange: 'Nothing change',
Tradding: 'Tradding', Tradding: 'Tradding',
ContractDescription: 'Contract description', ContractDescription: 'Contract description',
QualityStandard: 'Quality Standard', QualityStandard: 'Standard',
CommodityTransactions: 'Commodity transactions', CommodityTransactions: 'Commodity transactions',
CommodityCode: 'Commodity code', CommodityCode: 'Commodity code',
Escrow: 'Escrow', Escrow: 'Escrow',
...@@ -238,7 +238,7 @@ export default { ...@@ -238,7 +238,7 @@ export default {
FirstEscrowTotal: 'First escrow total (VNĐ)', FirstEscrowTotal: 'First escrow total (VNĐ)',
Calculator: 'Calculator', Calculator: 'Calculator',
Tool: 'Tool', Tool: 'Tool',
_Sell: 'Sell',
CaculatedDeposit: 'Caculated deposit', CaculatedDeposit: 'Caculated deposit',
CaculatedProfitLoss: 'Caculated profit loss', CaculatedProfitLoss: 'Caculated profit loss',
CaculatedStopLoss: 'Caculated stop loss', CaculatedStopLoss: 'Caculated stop loss',
...@@ -265,15 +265,17 @@ export default { ...@@ -265,15 +265,17 @@ export default {
Sunday: 'Sunday', Sunday: 'Sunday',
CalculatorProfitLoss: 'Calculator profit and loss', CalculatorProfitLoss: 'Calculator profit and loss',
Buy: 'Buy', Buy: 'Buy',
Sale: 'Sale', Sale: 'Sell',
OpenPrice: 'Open price', OpenPrice: 'Open price',
CloseStatusPrice: 'Close stauts price', CloseStatusPrice: 'Close stauts price',
SlotNumber: 'Slot number', SlotNumber: 'Slot number',
ProfitLoss: 'Profit/Loss', ProfitLoss: 'Profit/Loss',
BUY_IN: 'Buy in', BUY_IN: 'Buy in',
SELL_OUT: 'Sell out', SELL_OUT: 'Sell out',
YouCanNotTransaction: 'You can not trade the above contracts with the current available escrow', YouCanNotTransaction:
YouCanTransaction: 'You can trade the above contracts with the current available escrow', 'You can not trade the above contracts with the current available escrow',
YouCanTransaction:
'You can trade the above contracts with the current available escrow',
EnterContractInfo: 'Enter contract information', EnterContractInfo: 'Enter contract information',
EnterFirstEscrow: 'Enter first escrow', EnterFirstEscrow: 'Enter first escrow',
...@@ -282,5 +284,9 @@ export default { ...@@ -282,5 +284,9 @@ export default {
Count: 'Count', Count: 'Count',
Systemmaintenance: 'The system is maintenance', Systemmaintenance: 'The system is maintenance',
WaitUpdateCQG: 'Waiting Update CQG', WaitUpdateCQG: 'Waiting Update CQG',
code: 'Code',
AvailableMargin: 'Available margin',
WarnMinReqestWithdraw:
'The withdrawal amount must be more than 1 million dong',
Overtime: 'Overtime OTP',
}; };
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,7 @@ export default {
NothingChange: 'Không có gì thay đổi', NothingChange: 'Không có gì thay đổi',
Tradding: 'Giao dịch', Tradding: 'Giao dịch',
ContractDescription: 'Đặc tả hợp đồng', ContractDescription: 'Đặc tả hợp đồng',
QualityStandard: 'TIêu chuẩn chất lượng', QualityStandard: 'TIêu chuẩn',
CommodityTransactions: 'Hàng hóa giao dịch', CommodityTransactions: 'Hàng hóa giao dịch',
CommodityCode: 'Mã hàng hóa', CommodityCode: 'Mã hàng hóa',
Escrow: 'Ký quỹ', Escrow: 'Ký quỹ',
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
BUY_IN: 'Mua vào', BUY_IN: 'Mua vào',
SELL_OUT: 'Bán ra', SELL_OUT: 'Bán ra',
EscrowCalculator: 'Tính ký quỹ', EscrowCalculator: 'Tính ký quỹ',
FirstEscrowTotal: 'Ký quỹ khả dụng', FirstEscrowTotal: 'Tổng ký quỹ ban đầu (VNĐ)',
YouCanNotTransaction: YouCanNotTransaction:
'Bạn không thể giao dịch các hợp đồng kể trên với mức ký quỹ khả dụng hiện tại', 'Bạn không thể giao dịch các hợp đồng kể trên với mức ký quỹ khả dụng hiện tại',
YouCanTransaction: YouCanTransaction:
...@@ -280,4 +280,13 @@ export default { ...@@ -280,4 +280,13 @@ export default {
Count: 'Số lượng', Count: 'Số lượng',
Systemmaintenance: 'Hệ thống đang bảo trì', Systemmaintenance: 'Hệ thống đang bảo trì',
WaitUpdateCQG: 'Chờ cập nhật CQG', WaitUpdateCQG: 'Chờ cập nhật CQG',
FirstPriceRange: 'Giới hạn giá ban đầu',
ExpandPriceRange: 'Giới hạn giá mở rộng',
code: 'Mã',
AvailableMargin: 'Ký quỹ khả dụng (VNĐ) ',
Calculator: 'Tính',
_Sell: 'Bán',
FirstEscrow: 'Ký quỹ ban đầu (VNĐ) ',
WarnMinReqestWithdraw: 'Số tiền rút phải lớn hơn 1 triệu đồng',
Overtime: 'Mã OTP hết hạn sử dụng',
}; };
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
} from 'react-native'; } from 'react-native';
import Icon from 'react-native-vector-icons/Entypo'; import Icon from 'react-native-vector-icons/Entypo';
import R from '../assets/R'; import R from '../assets/R';
import {HEIGHTXD, WIDTHXD, getFontXD} from '../Config/Functions'; import {HEIGHTXD, WIDTHXD, getFontXD, WIDTHXDICON} from '../Config/Functions';
import Modal from 'react-native-modal'; import Modal from 'react-native-modal';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
...@@ -37,7 +37,7 @@ const PlussModal = (props) => { ...@@ -37,7 +37,7 @@ const PlussModal = (props) => {
<View style={styles.container}> <View style={styles.container}>
<View style={styles.wraper}> <View style={styles.wraper}>
<TouchableOpacity onPress={toggleModal} style={styles.btn}> <TouchableOpacity onPress={toggleModal} style={styles.btn}>
<Icon name={'plus'} size={27} color={R.colors.white} /> <Icon name={'plus'} size={HEIGHTXD(60)} color={R.colors.white} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -95,8 +95,8 @@ export default PlussModal; ...@@ -95,8 +95,8 @@ export default PlussModal;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
btn: { btn: {
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
width: WIDTHXD(144), width: WIDTHXDICON(135),
height: WIDTHXD(144), height: WIDTHXDICON(135),
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
shadowColor: '#000', shadowColor: '#000',
...@@ -107,21 +107,21 @@ const styles = StyleSheet.create({ ...@@ -107,21 +107,21 @@ const styles = StyleSheet.create({
shadowOpacity: 0.25, shadowOpacity: 0.25,
shadowRadius: 3.84, shadowRadius: 3.84,
elevation: 3, elevation: 3,
borderRadius: 30, borderRadius: WIDTHXDICON(144),
}, },
container: { container: {
flex: 1, flex: 1,
}, },
wraper: { wraper: {
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
width: WIDTHXD(160), width: WIDTHXDICON(144),
height: WIDTHXD(160), height: WIDTHXDICON(144),
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
position: 'absolute', position: 'absolute',
top: -20, top: -HEIGHTXD(45),
left: 15, left: 15,
borderRadius: WIDTHXD(90), borderRadius: WIDTHXDICON(90),
}, },
footer: { footer: {
backgroundColor: 'white', backgroundColor: 'white',
......
...@@ -23,6 +23,7 @@ import {changeLanguage} from '../actions/language'; ...@@ -23,6 +23,7 @@ import {changeLanguage} from '../actions/language';
import KEY from '../assets/AsynStorage'; import KEY from '../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW} from '../routers/ScreenNames'; import {DETAILNEW} from '../routers/ScreenNames';
import {getHeight, getWidth} from '../Config/Functions';
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
...@@ -31,6 +32,7 @@ const PayScreenComponent = () => { ...@@ -31,6 +32,7 @@ const PayScreenComponent = () => {
}; };
const TabNavigator = (props) => { const TabNavigator = (props) => {
console.log(getHeight(), getWidth());
const navigate = useNavigation(); const navigate = useNavigation();
useEffect(() => { useEffect(() => {
setInitLanguage(); setInitLanguage();
...@@ -111,7 +113,8 @@ const TabNavigator = (props) => { ...@@ -111,7 +113,8 @@ const TabNavigator = (props) => {
name="Screen2" name="Screen2"
component={Transaction} component={Transaction}
options={{ options={{
tabBarLabel: I18n.t('Tradding'), tabBarLabel:
props.language.language == 'vi' ? 'Giao dịch' : 'Tradding',
tabBarIcon: ({color, size}) => ( tabBarIcon: ({color, size}) => (
<Image <Image
source={R.images.iconTransaction2} source={R.images.iconTransaction2}
...@@ -133,7 +136,8 @@ const TabNavigator = (props) => { ...@@ -133,7 +136,8 @@ const TabNavigator = (props) => {
name="Screen3" name="Screen3"
component={Notification} component={Notification}
options={{ options={{
tabBarLabel: I18n.t('Notification'), tabBarLabel:
props.language.language == 'vi' ? 'Thông báo' : 'Notification',
tabBarIcon: ({color, size}) => ( tabBarIcon: ({color, size}) => (
<Ionicons <Ionicons
name="ios-notifications-outline" name="ios-notifications-outline"
...@@ -147,7 +151,7 @@ const TabNavigator = (props) => { ...@@ -147,7 +151,7 @@ const TabNavigator = (props) => {
name="Screen4" name="Screen4"
component={NewFeed} component={NewFeed}
options={{ options={{
tabBarLabel: I18n.t('News'), tabBarLabel: props.language.language == 'vi' ? 'Tin tức' : 'News',
tabBarIcon: ({color, size}) => ( tabBarIcon: ({color, size}) => (
<Ionicons name="newspaper-outline" size={size} color={color} /> <Ionicons name="newspaper-outline" size={size} color={color} />
), ),
...@@ -163,6 +167,7 @@ const mapStateToProps = (state) => { ...@@ -163,6 +167,7 @@ const mapStateToProps = (state) => {
user: state.userReducer, user: state.userReducer,
notifi: state.CountNotificationReducer, notifi: state.CountNotificationReducer,
screenInit: state.ScreenInitReducer, screenInit: state.ScreenInitReducer,
language: state.languageReducer,
}; };
}; };
......
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