Commit b404a8ba by Giang Tran

fix bug goback

parents 7fad8041 06bb0724
...@@ -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 15 versionCode 16
versionName "1.9" versionName "2.0"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
splits { splits {
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"properties": [], "properties": [],
"versionCode": 15, "versionCode": 16,
"versionName": "1.9", "versionName": "2.0",
"enabled": true, "enabled": true,
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
......
...@@ -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 = 6; CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -912,7 +912,11 @@ ...@@ -912,7 +912,11 @@
); );
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";
<<<<<<< HEAD
MARKETING_VERSION = 2.0; MARKETING_VERSION = 2.0;
=======
MARKETING_VERSION = 2.2;
>>>>>>> 06bb0724d2837eaa03af27e1282b35e17a1d04cc
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
...@@ -937,11 +941,15 @@ ...@@ -937,11 +941,15 @@
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 = 6; CURRENT_PROJECT_VERSION = 7;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
<<<<<<< HEAD
MARKETING_VERSION = 2.0; MARKETING_VERSION = 2.0;
=======
MARKETING_VERSION = 2.2;
>>>>>>> 06bb0724d2837eaa03af27e1282b35e17a1d04cc
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
......
import React, {useState} from 'react'; import React, {useState} from 'react';
import { import {
View, DeviceEventEmitter,
Text,
StyleSheet,
Dimensions, Dimensions,
TouchableOpacity,
Alert,
TouchableWithoutFeedback,
Keyboard, Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
Platform, Platform,
ScrollView, ScrollView,
StyleSheet,
Text,
TouchableOpacity,
TouchableWithoutFeedback,
View,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import TextDisable from '../../../components/Input/TextDisable';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import { import {checkFormatArray, getFontXD, HEIGHTXD, toPriceVnd, WIDTHXD} from '../../../Config/Functions';
getFontXD,
toPriceVnd,
checkFormatArray,
WIDTHXD,
HEIGHTXD,
} from '../../../Config/Functions';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../../actions/loadingAction'; import {hideLoading, showLoading} from '../../../actions/loadingAction';
import {walletDeposit} from '../../../apis/Functions/Deposit';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import {ENTER_PASSWORD_SMART_OTP, OTPWALLET, SMARTOTP} from '../../../routers/ScreenNames'; import {ENTER_PASSWORD_SMART_OTP, SETTINGOTP, SMARTOTP} from '../../../routers/ScreenNames';
import {getOTPApi} from '../../../apis/Functions/users';
import {showAlert, TYPE} from '../../../components/DropdownAlert'; import {showAlert, TYPE} from '../../../components/DropdownAlert';
import EnterPasswordSmartOTP from '../../SmartOTP/EnterPasswordSmartOTP'; import {confirmAlert} from '../../../components/Aleart';
const {width} = Dimensions.get('window');
const WalletDeposit = (props) => { const WalletDeposit = (props) => {
const [amount, setAmount] = useState(); const [amount, setAmount] = useState();
...@@ -49,15 +36,41 @@ const WalletDeposit = (props) => { ...@@ -49,15 +36,41 @@ const WalletDeposit = (props) => {
I18n.t('Note').toLowerCase(), I18n.t('Note').toLowerCase(),
]; ];
const index = checkFormatArray([amount, notes]); const index = checkFormatArray([amount]);
if (index === true) { if (index === true) {
if (!props.user.smart_otp_status) {
confirmAlert(
`${I18n.t('YouHaveNotSettingSmartOTP')}`,
() => {
navigate.navigate(SETTINGOTP, {
isFromTransaction: true,
setupSmartOTPSuccess: () => {
navigate.goBack()
navigate.goBack()
navigate.navigate(ENTER_PASSWORD_SMART_OTP, { navigate.navigate(ENTER_PASSWORD_SMART_OTP, {
onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp) onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp),
});
DeviceEventEmitter.emit('reloadUserInfo');
},
}); });
},
`${I18n.t('setting')}`,
);
} else {
navigate.navigate(ENTER_PASSWORD_SMART_OTP, {
onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp),
});
}
} else {
showAlert(
TYPE.WARN,
I18n.t('Notification'),
I18n.t('Please_fill_in') + titles[index],
);
} }
}; };
const onGoToSmartOTP = (pinCode, otp) => { const onGoToSmartOTP = (pinCode, otp) => {
navigate.goBack() navigate.goBack();
navigate.navigate(SMARTOTP, { navigate.navigate(SMARTOTP, {
type: 'DEPOSIT', type: 'DEPOSIT',
amount, amount,
...@@ -65,7 +78,7 @@ const WalletDeposit = (props) => { ...@@ -65,7 +78,7 @@ const WalletDeposit = (props) => {
pinCode, pinCode,
otp, otp,
}); });
} };
return ( return (
<KeyboardAvoidingView <KeyboardAvoidingView
behavior={Platform.Os === 'ios' ? 'padding' : 'height'} behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
...@@ -73,7 +86,7 @@ const WalletDeposit = (props) => { ...@@ -73,7 +86,7 @@ const WalletDeposit = (props) => {
keyboardVerticalOffset={-50}> keyboardVerticalOffset={-50}>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}> <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'InvestmentDeposit'} /> <HeaderBack title={'InvestmentDeposit'}/>
<ScrollView showsVerticalScrollIndicator={false}> <ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.wrapTop}> <View style={styles.wrapTop}>
...@@ -86,7 +99,7 @@ const WalletDeposit = (props) => { ...@@ -86,7 +99,7 @@ const WalletDeposit = (props) => {
: 0}{' '} : 0}{' '}
</Text> </Text>
</View> </View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} /> <View style={{width: 1, backgroundColor: '#DBDBDB'}}/>
<View style={styles.itemTop}> <View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text> <Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}>
......
...@@ -6,17 +6,14 @@ import { ...@@ -6,17 +6,14 @@ import {
Dimensions, Dimensions,
TouchableOpacity, TouchableOpacity,
Platform, Platform,
Alert,
TouchableWithoutFeedback, TouchableWithoutFeedback,
Keyboard, Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
ScrollView, ScrollView, DeviceEventEmitter,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import TextField from '../../../components/Input/TextField';
import TextMulti from '../../../components/Input/TextMulti'; import TextMulti from '../../../components/Input/TextMulti';
import TextDisable from '../../../components/Input/TextDisable';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import { import {
getFontXD, getFontXD,
...@@ -27,17 +24,17 @@ import { ...@@ -27,17 +24,17 @@ import {
} 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';
import {widthDraw, getListWidthDraw} from '../../../apis/Functions/Widthdraw'; import {getListWidthDraw} from '../../../apis/Functions/Widthdraw';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {showLoading, hideLoading} from '../../../actions/loadingAction'; import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {saveUserToRedux} from '../../../actions/users';
import {confirmAlert} from '../../../components/Aleart'; import {confirmAlert} from '../../../components/Aleart';
import { import {
ADDMETHODPAY, ADDMETHODPAY,
ENTER_PASSWORD_SMART_OTP, ENTER_PASSWORD_SMART_OTP, SETTINGOTP,
} from '../../../routers/ScreenNames'; } from '../../../routers/ScreenNames';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import {getOTPApi} from '../../../apis/Functions/users';
import {SMARTOTP} from '../../../routers/ScreenNames'; import {SMARTOTP} from '../../../routers/ScreenNames';
import {showAlert, TYPE} from '../../../components/DropdownAlert'; import {showAlert, TYPE} from '../../../components/DropdownAlert';
var radio_props = [ var radio_props = [
...@@ -117,9 +114,29 @@ const WalletWithdraw = (props) => { ...@@ -117,9 +114,29 @@ const WalletWithdraw = (props) => {
I18n.t('WarnMaxReqestWithdraw'), I18n.t('WarnMaxReqestWithdraw'),
); );
} else { } else {
if (!props.user.smart_otp_status) {
confirmAlert(
`${I18n.t('YouHaveNotSettingSmartOTP')}`,
() => {
navigate.navigate(SETTINGOTP, {
isFromTransaction: true,
setupSmartOTPSuccess: () => {
navigate.goBack()
navigate.goBack()
navigate.navigate(ENTER_PASSWORD_SMART_OTP, { navigate.navigate(ENTER_PASSWORD_SMART_OTP, {
onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp), onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp),
}); });
DeviceEventEmitter.emit('reloadUserInfo');
},
});
},
`${I18n.t('setting')}`,
);
} else {
navigate.navigate(ENTER_PASSWORD_SMART_OTP, {
onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp),
});
}
} }
} else { } else {
showAlert( showAlert(
...@@ -317,4 +334,5 @@ const mapStateToProps = (state) => { ...@@ -317,4 +334,5 @@ const mapStateToProps = (state) => {
export default connect(mapStateToProps, { export default connect(mapStateToProps, {
showLoading, showLoading,
hideLoading, hideLoading,
saveUserToRedux
})(WalletWithdraw); })(WalletWithdraw);
import React, {useEffect, useState} from 'react'; import React, {useEffect, useState} from 'react';
import {Alert, Platform, View} from 'react-native'; import {DeviceEventEmitter, Platform} from 'react-native';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {getTransaction} from '../../apis/Functions/users'; import {getTransaction} from '../../apis/Functions/users';
import {getImagesHome} from '../../apis/Functions/General'; import {getImagesHome} from '../../apis/Functions/General';
...@@ -11,7 +11,6 @@ import {getListCategoryProduct} from '../../apis/Functions/Transaction'; ...@@ -11,7 +11,6 @@ import {getListCategoryProduct} from '../../apis/Functions/Transaction';
import {hideLoading, showLoading} from '../../actions/loadingAction'; import {hideLoading, showLoading} from '../../actions/loadingAction';
import _ from 'lodash'; import _ from 'lodash';
import {showAlert, TYPE} from '../../components/DropdownAlert/index'; import {showAlert, TYPE} from '../../components/DropdownAlert/index';
import VersionChecker from '../VersionChecker';
import {saveUserToRedux} from '../../actions/users'; import {saveUserToRedux} from '../../actions/users';
import {getDetailUser} from '../../apis/Functions/users'; import {getDetailUser} from '../../apis/Functions/users';
...@@ -52,6 +51,13 @@ const Home = (props) => { ...@@ -52,6 +51,13 @@ const Home = (props) => {
useEffect(() => { useEffect(() => {
getData(); getData();
initSocket(); initSocket();
let reloadUserInfoListener = DeviceEventEmitter.addListener('reloadUserInfo', (e) => {
console.log('run in to reloadUserInfo');
onRefresh();
});
return () => {
reloadUserInfoListener.remove();
};
}, []); }, []);
useEffect(() => { useEffect(() => {
...@@ -218,7 +224,6 @@ const Home = (props) => { ...@@ -218,7 +224,6 @@ const Home = (props) => {
/> />
); );
}; };
<VersionChecker />;
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
user: state.userReducer, user: state.userReducer,
......
...@@ -40,7 +40,7 @@ const PriceListView = (props) => { ...@@ -40,7 +40,7 @@ const PriceListView = (props) => {
</View> </View>
<FlatList <FlatList
style={{paddingBottom: HEIGHTXD(15), backgroundColor: R.colors.white}} style={{paddingBottom: HEIGHTXD(15), backgroundColor: R.colors.white}}
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id.toString()}
data={dataPrice} data={dataPrice}
ListHeaderComponent={() => ListHeaderComponent={() =>
<View style={[styles.container]}> <View style={[styles.container]}>
......
import React, {Component, useEffect, useState} from 'react'; import React, {useState} from 'react';
import { import {
View, View,
Text, Text,
TextInput,
StyleSheet, StyleSheet,
TouchableOpacity, TouchableOpacity,
Platform, Platform,
Alert,
} from 'react-native'; } from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
...@@ -19,7 +17,6 @@ import { ...@@ -19,7 +17,6 @@ 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 {TABNAVIGATOR} from '../../routers/ScreenNames'; import {TABNAVIGATOR} from '../../routers/ScreenNames';
import {verifyOTPApi} 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';
...@@ -29,12 +26,11 @@ import {connect} from 'react-redux'; ...@@ -29,12 +26,11 @@ import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert'; import {showAlert, TYPE} from '../../components/DropdownAlert';
import CountDown from '../../components/CountDown'; import CountDown from '../../components/CountDown';
import { import {
verifyOTPApiSmart,
getOTPApi,
verifyStoreOTPApiSmart, verifyStoreOTPApiSmart,
getOTPApiSmartOTP, getOTPApiSmartOTP,
} from '../../apis/Functions/users'; } from '../../apis/Functions/users';
const CELL_COUNT = 4; const CELL_COUNT = 4;
const ConfirmOTPSmart = (propsa) => { const ConfirmOTPSmart = (propsa) => {
...@@ -82,7 +78,11 @@ const ConfirmOTPSmart = (propsa) => { ...@@ -82,7 +78,11 @@ const ConfirmOTPSmart = (propsa) => {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message); showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
propsa.hideLoading(); propsa.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
if (propsa.route.params.isFromTransaction) {
propsa.route.params.setupSmartOTPSuccess();
} else {
navigate.navigate(TABNAVIGATOR); navigate.navigate(TABNAVIGATOR);
}
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
} }
......
...@@ -47,6 +47,8 @@ const SettingOTP = (props) => { ...@@ -47,6 +47,8 @@ const SettingOTP = (props) => {
navigatiton.navigate(CONFIRMOTPSMART, { navigatiton.navigate(CONFIRMOTPSMART, {
password, password,
password_confirmation, password_confirmation,
isFromTransaction: props.route.params.isFromTransaction,
setupSmartOTPSuccess: props.route.params.setupSmartOTPSuccess
}); });
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
......
...@@ -5,7 +5,7 @@ export const NotificationAlert = (string) => { ...@@ -5,7 +5,7 @@ export const NotificationAlert = (string) => {
Alert.alert(I18n.t('Notification'), string); Alert.alert(I18n.t('Notification'), string);
}; };
export const confirmAlert = (content, callback) => { export const confirmAlert = (content, callback, positiveTitle) => {
Alert.alert( Alert.alert(
I18n.t('Notification'), I18n.t('Notification'),
content, content,
...@@ -15,7 +15,7 @@ export const confirmAlert = (content, callback) => { ...@@ -15,7 +15,7 @@ export const confirmAlert = (content, callback) => {
style: 'cancel', style: 'cancel',
}, },
{ {
text: I18n.t('Ok'), text: positiveTitle ? positiveTitle : I18n.t('Ok'),
onPress: () => { onPress: () => {
callback(); callback();
}, },
......
...@@ -326,4 +326,5 @@ export default { ...@@ -326,4 +326,5 @@ export default {
ResetSmartOTP2: ' press 3 to meet technical support staff.', ResetSmartOTP2: ' press 3 to meet technical support staff.',
ForgotSmartOTP: 'Forgot Smart OTP', ForgotSmartOTP: 'Forgot Smart OTP',
WarnMaxReqestWithdraw: 'Invalid withdrawal amount', WarnMaxReqestWithdraw: 'Invalid withdrawal amount',
YouHaveNotSettingSmartOTP: 'You have not installed Smart OTP',
}; };
...@@ -323,4 +323,5 @@ export default { ...@@ -323,4 +323,5 @@ export default {
'Để đảm bảo an toàn trong quá trình sử dụng ứng dụng, bạn vui lòng liên hệ đến tổng đài: ', 'Để đảm bảo an toàn trong quá trình sử dụng ứng dụng, bạn vui lòng liên hệ đến tổng đài: ',
ResetSmartOTP2: ' bấm phím 3 để gặp nhân viên hỗ trợ kỹ thuật.', ResetSmartOTP2: ' bấm phím 3 để gặp nhân viên hỗ trợ kỹ thuật.',
ForgotSmartOTP: 'Quên Smart OTP', ForgotSmartOTP: 'Quên Smart OTP',
YouHaveNotSettingSmartOTP: 'Bạn chưa cài đặt Smart OTP',
}; };
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