Commit 3d5d156a by Giang Tran

merge code

parents 163af2a7 e2aef260
......@@ -903,7 +903,7 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
......@@ -912,7 +912,7 @@
);
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.8;
MARKETING_VERSION = 1.9;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -937,11 +937,11 @@
CODE_SIGN_ENTITLEMENTS = Invest/Invest.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.8;
MARKETING_VERSION = 1.9;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......
......@@ -6,8 +6,6 @@
<array>
<string>dcv.investcustomer.vn</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
......@@ -44,8 +42,8 @@
<key>LSApplicationQueriesSchemes</key>
<array>
<string>itms-apps</string>
<string>tel</string>
<string>telprompt</string>
<string>tel</string>
<string>telprompt</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
......
import React, {useEffect, useRef} from 'react';
import {
View,
} from 'react-native';
import {View} from 'react-native';
import {connect} from 'react-redux';
import StackNavigation from './routers/StackNavigation';
......@@ -19,80 +17,81 @@ import KEY from './assets/AsynStorage';
import I18n, {setLocation} from './helper/i18/i18n';
import {changeLanguage} from './actions/language';
enableScreens();
const RootView = (props) => {
useEffect(() => {
DropdownManager.register(
dropDownAlertRef.current,
dropDownAlertLongTimeRef.current,
);
setInitLanguage()
}, []);
const dropDownAlertRef = useRef(null);
const dropDownAlertLongTimeRef = useRef(null);
const setInitLanguage = async () => {
const laguage = await AsyncStorage.getItem(KEY.LANGUAGE);
if (laguage) props.changeLanguage(laguage);
setLocation(I18n, laguage);
};
return (
<>
<View style={{flex: 1}}>
<Modal isVisible={props.loadingModal.isVisible}>
<SkypeIndicator color={'white'}/>
</Modal>
<StackNavigation/>
</View>
<DropdownAlert
inactiveStatusBarBackgroundColor={R.colors.main}
activeStatusBarBackgroundColor={R.colors.main}
warnImageSrc={R.images.iconWarn}
successImageSrc={R.images.iconSuccess}
errorImageSrc={R.images.iconError}
titleStyle={{color: '#fff'}}
messageStyle={{color: '#fff'}}
closeInterval={1000}
ref={dropDownAlertRef}
warnColor={R.colors.orange400}
defaultContainer={{
borderBottomRightRadius: WIDTHXD(30),
borderBottomLeftRadius: WIDTHXD(30),
paddingTop: HEIGHTXD(30),
paddingVertical: HEIGHTXD(30),
paddingHorizontal: WIDTHXD(20),
}}
/>
<DropdownAlert
inactiveStatusBarBackgroundColor={R.colors.colorMain}
activeStatusBarBackgroundColor={R.colors.colorMain}
warnImageSrc={R.images.iconWarn}
successImageSrc={R.images.iconSuccess}
errorImageSrc={R.images.iconError}
titleStyle={{color: '#fff'}}
messageStyle={{color: '#fff'}}
closeInterval={600000}
ref={dropDownAlertLongTimeRef}
warnColor={R.colors.orange400}
defaultContainer={{
borderBottomRightRadius: WIDTHXD(30),
borderBottomLeftRadius: WIDTHXD(30),
paddingTop: HEIGHTXD(30),
paddingVertical: HEIGHTXD(30),
paddingHorizontal: WIDTHXD(20),
}}
/>
<NoInternetComponent/>
</>
useEffect(() => {
DropdownManager.register(
dropDownAlertRef.current,
dropDownAlertLongTimeRef.current,
);
setInitLanguage();
}, []);
const dropDownAlertRef = useRef(null);
const dropDownAlertLongTimeRef = useRef(null);
const setInitLanguage = async () => {
const laguage = await AsyncStorage.getItem(KEY.LANGUAGE);
if (laguage) props.changeLanguage(laguage);
setLocation(I18n, laguage);
};
return (
<>
<View style={{flex: 1}}>
<Modal isVisible={props.loadingModal.isVisible}>
<SkypeIndicator color={'white'} />
</Modal>
<StackNavigation />
</View>
<DropdownAlert
inactiveStatusBarBackgroundColor={R.colors.main}
activeStatusBarBackgroundColor={R.colors.main}
warnImageSrc={R.images.iconWarn}
successImageSrc={R.images.iconSuccess}
errorImageSrc={R.images.iconError}
titleStyle={{color: '#fff'}}
messageStyle={{color: '#fff'}}
updateStatusBar={false}
closeInterval={1000}
ref={dropDownAlertRef}
warnColor={R.colors.orange400}
defaultContainer={{
borderBottomRightRadius: WIDTHXD(30),
borderBottomLeftRadius: WIDTHXD(30),
paddingTop: HEIGHTXD(30),
paddingVertical: HEIGHTXD(30),
paddingHorizontal: WIDTHXD(20),
}}
/>
<DropdownAlert
updateStatusBar={false}
inactiveStatusBarBackgroundColor={R.colors.colorMain}
activeStatusBarBackgroundColor={R.colors.colorMain}
warnImageSrc={R.images.iconWarn}
successImageSrc={R.images.iconSuccess}
errorImageSrc={R.images.iconError}
titleStyle={{color: '#fff'}}
messageStyle={{color: '#fff'}}
closeInterval={600000}
ref={dropDownAlertLongTimeRef}
warnColor={R.colors.orange400}
defaultContainer={{
borderBottomRightRadius: WIDTHXD(30),
borderBottomLeftRadius: WIDTHXD(30),
paddingTop: HEIGHTXD(30),
paddingVertical: HEIGHTXD(30),
paddingHorizontal: WIDTHXD(20),
}}
/>
<NoInternetComponent />
</>
);
};
const mapStateToProps = (state) => {
return {
loadingModal: state.ModalLoadingReducer,
};
return {
loadingModal: state.ModalLoadingReducer,
};
};
export default connect(mapStateToProps, {changeLanguage})(RootView);
export default connect(mapStateToProps, {})(RootView);
......@@ -49,14 +49,23 @@ const ConfirmOTP = (propsa) => {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid'));
} else {
propsa.showLoading();
const res = await verifyOTPApi({
platform: Platform.OS,
receiver_name: propsa.user.email,
otp: value,
});
if (res.data.code == 200) {
let res1;
if (propsa.route.params.type == 'DEPOSIT') {
res1 = await verifyOTPApi({
platform: Platform.OS,
receiver_name: propsa.user.email,
otp: value,
type: 'CUSTOMER_REQUEST_DEPOSIT',
});
} else {
res1 = await verifyOTPApi({
platform: Platform.OS,
receiver_name: propsa.user.email,
otp: value,
type: 'CUSTOMER_REQUEST_DEPOSIT',
});
}
if (res1.data.code == 200) {
let res;
if (propsa.route.params.type == 'DEPOSIT') {
......
......@@ -52,6 +52,7 @@ const WalletDeposit = (props) => {
const res = await getOTPApi({
platform: Platform.OS,
otp_by: props.user.email,
type: 'CUSTOMER_REQUEST_DEPOSIT',
});
props.hideLoading();
if (res.data.code == 200) {
......
......@@ -92,6 +92,7 @@ const WalletWithdraw = (props) => {
const res = await getOTPApi({
platform: Platform.OS,
otp_by: props.user.email,
type: 'REQUEST_WITHDRAW',
});
props.hideLoading();
if (res.data.code == 200) {
......
......@@ -51,12 +51,12 @@ const Authen = (props) => {
<Tab.Screen
name="LOGIN"
component={Login}
options={{tabBarLabel: 'Login'}}
options={{tabBarLabel: I18n.t('Login')}}
/>
<Tab.Screen
name="REGISTOR"
component={Registor}
options={{tabBarLabel: 'Register'}}
options={{tabBarLabel: I18n.t('Register')}}
/>
</Tab.Navigator>
</ImageBackground>
......
......@@ -30,6 +30,7 @@ const ConfirmEmail = (props) => {
const res = await getOTPApi({
platform: Platform.OS,
otp_by: value,
type: 'FORGOT_PASSWORD',
});
props.hideLoading();
......
......@@ -52,6 +52,7 @@ const ConfirmOTP = (propsa) => {
platform: Platform.OS,
receiver_name: propsa.route.params.email,
otp: value,
type: 'FORGOT_PASSWORD',
});
propsa.hideLoading();
......
......@@ -52,6 +52,7 @@ const ConfirmOTP = (propsa) => {
platform: Platform.OS,
receiver_name: propsa.route.params.email,
otp: value,
type: 'CUSTOMER_VERIFY',
});
if (res.data.code == 200) {
......
......@@ -47,6 +47,7 @@ const Registor = (props) => {
const res = await getOTPApi({
platform: Platform.OS,
otp_by: email,
type: 'CUSTOMER_VERIFY',
});
props.hideLoading();
console.log(res);
......
......@@ -35,7 +35,7 @@ const Profile = (props) => {
return (
<View style={styles.container}>
{props.user.status == 6 ? (
{props.user.status == 6 || props.user.status == 7 ? (
<View>
<View style={styles.item}>
<AppText i18nKey={'ContactCode'} style={styles.txtTitle}></AppText>
......@@ -61,11 +61,21 @@ const Profile = (props) => {
justifyContent: 'space-between',
marginTop: 50,
}}>
<TouchableOpacity
onPress={() => navigation.navigate(PACKETCQG)}
style={styles.btnLeft}>
<AppText i18nKey={'UpdatePacket'} style={styles.txtBtn}></AppText>
</TouchableOpacity>
{props.user.status == 7 ? (
<View style={styles.btnLeft}>
<AppText
i18nKey={'WaitUpdateCQG'}
style={styles.txtBtn}></AppText>
</View>
) : (
<TouchableOpacity
onPress={() => navigation.navigate(PACKETCQG)}
style={styles.btnLeft}>
<AppText
i18nKey={'UpdatePacket'}
style={styles.txtBtn}></AppText>
</TouchableOpacity>
)}
<TouchableOpacity onPress={onClickCLose} style={styles.btnRight}>
<AppText i18nKey={'CloseAccount'} style={styles.txtBtn}></AppText>
</TouchableOpacity>
......
......@@ -29,22 +29,22 @@ const NewFeed = (props) => {
<Tab.Screen
name="PriceList"
component={PriceList}
options={{tabBarLabel: I18n.t('Price_List')}}
options={{tabBarLabel: 'Bảng phí'}}
/>
<Tab.Screen
name="TimeTransaction"
component={TimeTransaction}
options={{tabBarLabel: I18n.t('Time_Transaction')}}
options={{tabBarLabel: 'Thời gian GD'}}
/>
<Tab.Screen
name="Escrow"
component={Escrow}
options={{tabBarLabel: I18n.t('Escrow')}}
options={{tabBarLabel: 'Ký quỹ'}}
/>
<Tab.Screen
name="DueDate"
component={DueDate}
options={{tabBarLabel: I18n.t('Due_Date')}}
options={{tabBarLabel: 'Lịch đáo hạn'}}
/>
</Tab.Navigator>
</View>
......
......@@ -13,7 +13,7 @@ export const registorApi = async (body) =>
.catch((err) => err);
export const logoutApi = async (body) =>
PostData('http://api.dcvinvest.com/api/auth/logout', body)
PostData(urlLogout, body)
.then((res) => res)
.catch((err) => err);
......
export const root = 'http://api.dcvinvest.com/';
export const root = 'http://api.dcvinvest.com';
export default {
urllogin: root + 'api/auth/customer-login',
urlRegistor: root + 'api/auth/customer-register',
......
......@@ -51,7 +51,6 @@ const HeaderHome = (props) => {
end={{x: 0, y: 1}}
colors={['#0062E1', '#22AEFB']}>
<StatusBar barStyle="light-content" translucent={true} />
<SnackBar />
<View style={styles.container}>
<View style={{flex: 1}}>
<Block center row>
......
......@@ -29,7 +29,6 @@ const HeaderHome = (props) => {
imageStyle={{resizeMode: 'stretch'}}
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}>
<SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} />
<View style={styles.headerContainer}>
<TouchableOpacity
......
......@@ -34,7 +34,6 @@ const HeaderDrawer = (props) => {
imageStyle={{resizeMode: 'stretch'}}
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}>
<SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} />
<View style={styles.headerContainer}>
......
......@@ -228,9 +228,7 @@ const HeaderHome = (props) => {
return (
<View style={styles.container}>
<SnackBar />
<StatusBar backgroundColor="transparent" translucent={true} />
<View
style={{
justifyContent: 'center',
......
......@@ -41,7 +41,6 @@ const HeaderSearch = (props) => {
style={[styles.img, isWhite ? {backgroundColor: 'white'} : {}]}
source={R.images.bgHeader}>
<StatusBar backgroundColor="transparent" translucent={true} />
<SnackBar />
<View style={styles.headerContainer}>
<TouchableOpacity
style={{width: 35, height: 30}}
......
......@@ -25,7 +25,6 @@ const HeaderHome = (props) => {
end={{x: 0, y: 1}}
colors={['#0062E1', '#22AEFB']}>
<StatusBar barStyle="light-content" translucent={true} />
<SnackBar />
<View style={styles.container}>
{back ? (
<TouchableOpacity onPress={() => navigate.goBack()}>
......
import I18n from 'react-native-i18n';
import { I18nManager } from 'react-native';
import {I18nManager} from 'react-native';
import en from './locales/en';
import vi from './locales/vn';
I18n.translations = {
en,
vi,
en,
};
I18n.fallbacks = true;
export default I18n;
export function setLocation(i18n, location) {
I18nManager.allowRTL(false);
const defaultLanguage = { languageTag: location, isRTL: false };
const { languageTag, isRTL } = defaultLanguage;
const defaultLanguage = {languageTag: location, isRTL: false};
const {languageTag, isRTL} = defaultLanguage;
i18n.locale = languageTag;
return i18n
return i18n;
}
......@@ -282,4 +282,5 @@ export default {
Count: 'Count',
Systemmaintenance: 'The system is maintenance',
WaitUpdateCQG: 'Waiting Update CQG',
};
......@@ -268,8 +268,10 @@ export default {
SELL_OUT: 'Bán ra',
EscrowCalculator: 'Tính ký quỹ',
FirstEscrowTotal: 'Ký quỹ khả dụng',
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',
YouCanTransaction: 'Bạn có 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',
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',
YouCanTransaction:
'Bạn có 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',
EnterContractInfo: 'Nhập thông tin hợp đồng',
EnterFirstEscrow: 'Nhập ký quỹ ban đầu',
......
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