Commit fb0f1c10 by Giang Tran

edit moment

parent 75bb4dfc
...@@ -28,7 +28,12 @@ import {showLoading, hideLoading} from '../../actions/loadingAction'; ...@@ -28,7 +28,12 @@ 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 CountDown from '../../components/CountDown';
import {verifyOTPApiSmart} from '../../apis/Functions/users'; import {
verifyOTPApiSmart,
getOTPApi,
verifyStoreOTPApiSmart,
getOTPApiSmartOTP,
} from '../../apis/Functions/users';
const CELL_COUNT = 4; const CELL_COUNT = 4;
...@@ -45,10 +50,11 @@ const ConfirmOTPSmart = (propsa) => { ...@@ -45,10 +50,11 @@ const ConfirmOTPSmart = (propsa) => {
const getOTP = async () => { const getOTP = async () => {
propsa.showLoading(); propsa.showLoading();
const res = await getOTPApi({ const res = await getOTPApiSmartOTP({
platform: Platform.OS, platform: Platform.OS,
otp_by: propsa.route.params.email, otp_by: propsa.user.email,
type: 'FORGOT_PASSWORD', otp_password: '1234',
type: 'CREATE_OTP_PASSWORD',
}); });
propsa.hideLoading(); propsa.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
...@@ -66,13 +72,14 @@ const ConfirmOTPSmart = (propsa) => { ...@@ -66,13 +72,14 @@ const ConfirmOTPSmart = (propsa) => {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid')); showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid'));
} else { } else {
propsa.showLoading(); propsa.showLoading();
const res = await verifyOTPApiSmart({ const res = await verifyStoreOTPApiSmart({
platform: Platform.OS, platform: Platform.OS,
password: propsa.route.params.password, password: propsa.route.params.password,
password_confirmation: propsa.route.params.password_confirmation, password_confirmation: propsa.route.params.password_confirmation,
otp: value, otp: value,
type: 'FORGOT_PASSWORD', type: 'CREATE_OTP_PASSWORD',
}); });
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
propsa.hideLoading(); propsa.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
navigate.navigate(TABNAVIGATOR); navigate.navigate(TABNAVIGATOR);
...@@ -212,7 +219,9 @@ const styles = StyleSheet.create({ ...@@ -212,7 +219,9 @@ const styles = StyleSheet.create({
}); });
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return {}; return {
user: state.userReducer,
};
}; };
export default connect(mapStateToProps, {showLoading, hideLoading})( export default connect(mapStateToProps, {showLoading, hideLoading})(
......
...@@ -43,6 +43,7 @@ const SettingOTP = (props) => { ...@@ -43,6 +43,7 @@ const SettingOTP = (props) => {
}); });
props.hideLoading(); props.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
navigatiton.navigate(CONFIRMOTPSMART, { navigatiton.navigate(CONFIRMOTPSMART, {
password, password,
password_confirmation, password_confirmation,
...@@ -75,7 +76,11 @@ const SettingOTP = (props) => { ...@@ -75,7 +76,11 @@ const SettingOTP = (props) => {
onChangeText={(val) => setPassword(val)} onChangeText={(val) => setPassword(val)}
maxLength={4} maxLength={4}
isNumber={true} isNumber={true}
title={I18n.t('PassGetSmartOTP')} title={
props.language.language == 'vi'
? 'Mật khẩu lấy Smart OTP'
: I18n.t('PassGetSmartOTP')
}
isPassWord={true} isPassWord={true}
/> />
<TextField <TextField
...@@ -83,7 +88,11 @@ const SettingOTP = (props) => { ...@@ -83,7 +88,11 @@ const SettingOTP = (props) => {
isNumber={true} isNumber={true}
isPassWord={true} isPassWord={true}
onChangeText={(val) => setPassword_confirmation(val)} onChangeText={(val) => setPassword_confirmation(val)}
title={I18n.t('ConfirmPassGetSmartOTP')} title={
props.language.language == 'vi'
? 'Xác nhận mật khẩu lấy Smart OTP'
: I18n.t('ConfirmPassGetSmartOTP')
}
/> />
</View> </View>
<View> <View>
...@@ -97,6 +106,7 @@ const SettingOTP = (props) => { ...@@ -97,6 +106,7 @@ const SettingOTP = (props) => {
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
user: state.userReducer, user: state.userReducer,
language: state.languageReducer,
}; };
}; };
......
...@@ -38,17 +38,7 @@ const SmartOTPConfig = (props) => { ...@@ -38,17 +38,7 @@ const SmartOTPConfig = (props) => {
</View> </View>
<Icon name={'right'} size={20} color={R.colors.color777} /> <Icon name={'right'} size={20} color={R.colors.color777} />
</TouchableOpacity> </TouchableOpacity>
) : ( ) : null}
<TouchableOpacity
onPress={() => navigation.navigate(SETTINGOTP)}
style={styles.container}>
<Image style={styles.imgIcon} source={R.images.changeSmart} />
<View style={{flex: 1, justifyContent: 'center'}}>
<AppText i18nKey={'AddSmartOTP'} />
</View>
<Icon name={'right'} size={20} color={R.colors.color777} />
</TouchableOpacity>
)}
<TouchableOpacity <TouchableOpacity
onPress={() => navigation.navigate(RULESSMARTOTP)} onPress={() => navigation.navigate(RULESSMARTOTP)}
......
...@@ -7,7 +7,7 @@ const FAQs = (props) => { ...@@ -7,7 +7,7 @@ const FAQs = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack isWhite={true} title={'FAQs'} /> <HeaderBack isWhite={true} title={'FAQs'} />
<WebView <WebView
androidHardwareAccelerationDisabled={true} // androidHardwareAccelerationDisabled={true}
source={{ source={{
uri: 'http://api.dcvinvest.com/webview/smart-otp/faqs', uri: 'http://api.dcvinvest.com/webview/smart-otp/faqs',
}} }}
......
...@@ -8,7 +8,7 @@ const RulesSmartOTP = (props) => { ...@@ -8,7 +8,7 @@ const RulesSmartOTP = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack isWhite={true} title={'Rules'} /> <HeaderBack isWhite={true} title={'Rules'} />
<WebView <WebView
androidHardwareAccelerationDisabled={true} // androidHardwareAccelerationDisabled={true}
source={{ source={{
uri: 'http://api.dcvinvest.com/webview/smart-otp/term-and-condition', uri: 'http://api.dcvinvest.com/webview/smart-otp/term-and-condition',
}} }}
......
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