Commit 65a00329 by Giang Tran

update api language

parent 92293725
...@@ -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 1 versionCode 3
versionName "1.0" versionName "1.3"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
splits { splits {
......
{
"version": 1,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.dcv.invest",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"properties": [],
"versionCode": 1,
"versionName": "1.0",
"enabled": true,
"outputFile": "app-release.apk"
}
]
}
\ No newline at end of file
...@@ -40,7 +40,17 @@ ...@@ -40,7 +40,17 @@
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="dcvinvest" />
</intent-filter>
</activity> </activity>
......
...@@ -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 = 2; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
...@@ -936,7 +936,7 @@ ...@@ -936,7 +936,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 = 2; CURRENT_PROJECT_VERSION = 3;
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";
......
...@@ -24,6 +24,19 @@ ...@@ -24,6 +24,19 @@
<string>$(MARKETING_VERSION)</string> <string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>dcv.investcustomer.vn. linking</string>
<key>CFBundleURLSchemes</key>
<array>
<string>dcvinvest</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
......
...@@ -30,7 +30,7 @@ const Fillters = [ ...@@ -30,7 +30,7 @@ const Fillters = [
}, },
{ {
id: '4', id: '4',
name: 'Withdraw', name: 'Transfer',
value: 'TRANSFER', value: 'TRANSFER',
}, },
]; ];
......
...@@ -42,9 +42,7 @@ const Item = (props) => { ...@@ -42,9 +42,7 @@ const Item = (props) => {
style={{ style={{
alignItems: 'flex-start', alignItems: 'flex-start',
}}> }}>
<Text style={styles.txtBlack}> <Text style={styles.txtBlack}>{item.name}</Text>
{converType(item.transection_category)}
</Text>
<Text style={styles.txt}>{item.transection_date_timestamp}</Text> <Text style={styles.txt}>{item.transection_date_timestamp}</Text>
</View> </View>
...@@ -100,7 +98,6 @@ const styles = StyleSheet.create({ ...@@ -100,7 +98,6 @@ const styles = StyleSheet.create({
fontSize: getFontXD(36), fontSize: getFontXD(36),
color: '#C4C4C4', color: '#C4C4C4',
marginTop: 10, marginTop: 10,
fontStyle: 'italic',
}, },
imgIcon: { imgIcon: {
width: WIDTHXD(178), width: WIDTHXD(178),
......
...@@ -5,31 +5,58 @@ import { ...@@ -5,31 +5,58 @@ import {
HEIGHTXD, HEIGHTXD,
WIDTHXD, WIDTHXD,
toPriceVnd, toPriceVnd,
converType,
converStatus,
} 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'; import {useNavigation} from '@react-navigation/native';
import {HISTORYDETAIL} from '../../../routers/ScreenNames';
const Item = (props) => { const Item = (props) => {
const {item} = props; const {item} = props;
const navigate = useNavigation();
return ( return (
<TouchableOpacity onPress={() => console.log('HEllo')}> <TouchableOpacity
<View style={styles.container}> onPress={() =>
<Block flex={1} row> navigate.navigate(HISTORYDETAIL, {id: item.transection_id})
<Block padding={[5, 10]} space={'between'} flex={1}> }
<View style={{justifyContent: 'center', flex: 1}}> style={styles.container}>
<Text style={styles.txt1}> <Block flex={1} row>
`${I18n.t('BonusMoney')}:{' '}` <View style={styles.wrapLeft} />
<Text style={styles.money}>{toPriceVnd(item.money)}</Text> vnđ <View style={styles.wrapDate}>
</Text> <Image source={{uri: item.icon}} style={styles.imgIcon} />
<Text numberOfLines={1} style={styles.txt2}> </View>
`{I18n.t('Content')}: {item.content}` <Block
style={{justifyContent: 'center'}}
padding={[5, 10]}
space={'between'}
flex={1}>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-between',
}}>
<View
style={{
alignItems: 'flex-start',
}}>
<Text style={styles.txtBlack}>{item.name}</Text>
<Text style={styles.txt}>{item.transection_date_timestamp}</Text>
</View>
<View style={{alignItems: 'flex-end'}}>
<Text
style={[
styles.txtMoney,
item.status == 1 ? {color: '#1473E6'} : null,
]}>
{toPriceVnd(item.amount)} Đ
</Text> </Text>
<Text style={styles.txt}> {item.status_name}</Text>
</View> </View>
<Text style={styles.txt}>{item.time}</Text> </View>
</Block>
</Block> </Block>
</View> </Block>
</TouchableOpacity> </TouchableOpacity>
); );
}; };
...@@ -38,7 +65,6 @@ export default Item; ...@@ -38,7 +65,6 @@ export default Item;
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
marginTop: 10,
height: HEIGHTXD(250), height: HEIGHTXD(250),
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { shadowOffset: {
...@@ -50,10 +76,13 @@ const styles = StyleSheet.create({ ...@@ -50,10 +76,13 @@ const styles = StyleSheet.create({
elevation: 5, elevation: 5,
marginHorizontal: 10, marginHorizontal: 10,
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
marginBottom: 10, marginVertical: 5,
borderRadius: HEIGHTXD(30), borderRadius: HEIGHTXD(30),
}, },
wrapRight: {
borderLeftColor: R.colors.borderGray,
borderLeftWidth: 0.7,
},
wrapLeft: { wrapLeft: {
width: WIDTHXD(16), width: WIDTHXD(16),
borderTopLeftRadius: HEIGHTXD(30), borderTopLeftRadius: HEIGHTXD(30),
...@@ -63,36 +92,22 @@ const styles = StyleSheet.create({ ...@@ -63,36 +92,22 @@ const styles = StyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingHorizontal: 10,
}, },
txtTitle: {
fontSize: getFontXD(42),
color: R.colors.black,
fontWeight: 'bold',
},
txt: { txt: {
fontSize: getFontXD(39), fontSize: getFontXD(36),
color: '#C4C4C4', color: '#C4C4C4',
fontStyle: 'italic', marginTop: 10,
},
rowBet: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
txt1: {
fontSize: getFontXD(42),
color: '#0B2031',
},
txt2: {
fontSize: getFontXD(42),
color: '#0B2031',
marginVertical: 2,
}, },
imgIcon: { imgIcon: {
width: WIDTHXD(178), width: WIDTHXD(178),
height: HEIGHTXD(178), height: HEIGHTXD(178),
resizeMode: 'contain', resizeMode: 'contain',
}, },
money: { txtMoney: {
color: '#E3434F', fontSize: getFontXD(42),
fontWeight: 'bold',
color: '#F99D1D',
},
txtBlack: {
fontSize: getFontXD(42),
}, },
}); });
import React from 'react'; import React, {useState, useEffect} from 'react';
import {View, FlatList, Text} from 'react-native'; import {View, FlatList, Text, Alert} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
import Item from './Item'; import Item from './Item';
import AppText from '../../../components/AppText'; import AppText from '../../../components/AppText';
import {getListTransaction} from '../../../apis/Functions/Widthdraw';
import I18n from '../../../helper/i18/i18n';
const Payments = (props) => { const Payments = (props) => {
const [page, setPage] = useState(1);
const [data, setData] = useState([]);
const [tottalPage, setTotalPage] = useState(1);
const [isRefresh, setisRefresh] = useState(false);
useEffect(() => {
getData();
}, []);
const getData = async () => {
setisRefresh(true);
setPage(1);
const res = await getListTransaction({
keyword: '',
type: 'PAYMENT',
platform: Platform.OS,
page_size: 10,
status: -1,
page_index: 1,
start_date: '',
end_date: '',
});
setisRefresh(false);
if ((res.data.code = 200 && res.data.data)) {
setData(res.data.data);
setTotalPage(res.data.meta.pages);
console.log(res.data.data);
} else {
Alert.alert(I18n.t('Notification'), res.data.message);
}
};
const onRefresh = () => {
getData();
};
const onLoadMore = () => {
if (page < tottalPage) getDataLoadMore();
};
const getDataLoadMore = async () => {
setisRefresh(true);
const res = await getListTransaction({
keyword: '',
type: 'PAYMENT',
platform: Platform.OS,
page_size: 10,
status: -1,
page_index: page + 1,
start_date: '',
end_date: '',
});
setPage(page + 1);
if (res.data.code == 200) {
setData(data.concat(res.data.data));
}
setisRefresh(false);
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack isWhite={false} title={'Payments'} /> <HeaderBack isWhite={false} title={'Payments'} />
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}> <FlatList
<AppText
i18nKey={'Features_develop'}
style={{
fontSize: 18,
fontWeight: 'bold',
textAlign: 'center',
}}
/>
</View>
{/* <FlatList
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}
data={data} data={data}
refreshing={isRefresh}
showsVerticalScrollIndicator={false}
onRefresh={onRefresh}
onEndReachedThreshold={0.01}
onEndReached={(info) => {
onLoadMore();
}}
keyExtractor={(item) => item.transection_id + 'a'}
renderItem={({item}) => <Item item={item} />} renderItem={({item}) => <Item item={item} />}
/> */} />
</View> </View>
); );
}; };
......
...@@ -8,10 +8,15 @@ import I18n from '../../helper/i18/i18n'; ...@@ -8,10 +8,15 @@ import I18n from '../../helper/i18/i18n';
const MethodPay = (props) => { const MethodPay = (props) => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
const [isRefresh, setRefresh] = useState(false); const [isRefresh, setRefresh] = useState(false);
const navigation = useNavigation();
useEffect(() => { useEffect(() => {
getData(); const unsubscribe = navigation.addListener('focus', () => {
}, []); getData();
});
return unsubscribe;
}, [navigation]);
const onRefresh = () => { const onRefresh = () => {
getData(); getData();
......
...@@ -13,7 +13,6 @@ const MethodPayView = (props) => { ...@@ -13,7 +13,6 @@ const MethodPayView = (props) => {
const {isRefresh, listMethod, onRefresh} = props; const {isRefresh, listMethod, onRefresh} = props;
console.log('List', listMethod);
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'PaymentSetting'} /> <HeaderBack title={'PaymentSetting'} />
......
import React from 'react'; import React from 'react';
import {Alert} from 'react-native';
import SettingView from './SettingView'; import SettingView from './SettingView';
import {updateLangugeApi} from '../../apis/Functions/users';
import I18n from '../../helper/i18/i18n';
import {connect} from 'react-redux';
import {showLoading, hideLoading} from '../../actions/loadingAction';
const Setting = (props) => { const Setting = (props) => {
return <SettingView />; const convertKeyLanguage = (key) => {
if (key == 'en') return 'ENGLISH';
return 'VIETNAMESE';
};
const updateLangue = async (key) => {
props.showLoading();
const res = await updateLangugeApi({
platform: Platform.OS,
language: convertKeyLanguage(key),
});
props.hideLoading();
if (res.data.code == 200) {
setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
} else {
setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
}
};
return <SettingView updateLangue={updateLangue} />;
}; };
export default Setting; const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {
showLoading,
hideLoading,
})(Setting);
...@@ -23,7 +23,9 @@ const dataLanguage = [ ...@@ -23,7 +23,9 @@ const dataLanguage = [
const SettingView = (props) => { const SettingView = (props) => {
const [isEnabled, setIsEnabled] = useState(true); const [isEnabled, setIsEnabled] = useState(true);
const toggleSwitch = () => setIsEnabled((previousState) => !previousState); const toggleSwitch = () => setIsEnabled((previousState) => !previousState);
const [language, setLanguage] = useState(); const [language, setLanguage] = useState();
useEffect(() => { useEffect(() => {
convertLanguage(); convertLanguage();
}, []); }, []);
...@@ -59,7 +61,8 @@ const SettingView = (props) => { ...@@ -59,7 +61,8 @@ const SettingView = (props) => {
setLanguage(items.name); setLanguage(items.name);
props.changeLanguage(items.value); props.changeLanguage(items.value);
AsyncStorage.setItem(KEY.LANGUAGE, items.value); AsyncStorage.setItem(KEY.LANGUAGE, items.value);
setLocation(I18n, items.value) setLocation(I18n, items.value);
props.updateLangue(items.value);
}} }}
/> />
</View> </View>
......
...@@ -51,3 +51,8 @@ export const updateInforUser = async (body) => ...@@ -51,3 +51,8 @@ export const updateInforUser = async (body) =>
PostData(url.urlUpdateInforUser, body) PostData(url.urlUpdateInforUser, body)
.then((res) => res) .then((res) => res)
.catch((err) => err); .catch((err) => err);
export const updateLangugeApi = async (body) =>
PostData(url.urlUpdateLanguage, body)
.then((res) => res)
.catch((err) => err);
...@@ -35,4 +35,6 @@ export default { ...@@ -35,4 +35,6 @@ export default {
urlOpenCQG: root + 'api/v1/customers/register-open-cqg', urlOpenCQG: root + 'api/v1/customers/register-open-cqg',
urlUpdateInforUser: root + 'api/v1/customers/update-general-info', urlUpdateInforUser: root + 'api/v1/customers/update-general-info',
urlUpdateLanguage: root + 'api/v1/customers/update-language',
}; };
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
Provisional: 'Provisional', Provisional: 'Provisional',
Here: 'Here', Here: 'Here',
Open_account_demo: 'You can open a demo account', Open_account_demo: 'You can open a demo account',
Features_develop: 'Features are under development, please come back later!', Features_develop: 'No data!',
Language: 'Language', Language: 'Language',
Email: 'Email', Email: 'Email',
Password: 'Password', Password: 'Password',
...@@ -139,7 +139,8 @@ export default { ...@@ -139,7 +139,8 @@ export default {
BeneficiaryAccount: 'the beneficiary account', BeneficiaryAccount: 'the beneficiary account',
FromWallet: 'From wallet', FromWallet: 'From wallet',
FromCQGAccount: 'From CQG account', FromCQGAccount: 'From CQG account',
SettingPaymentMethodConfirm: 'You have not the payment method. Go to payment method setting?', SettingPaymentMethodConfirm:
'You have not the payment method. Go to payment method setting?',
EnterEmailRequest: 'Please enter email', EnterEmailRequest: 'Please enter email',
EnterEmail: 'Enter email', EnterEmail: 'Enter email',
GetVerificationCode: 'Get the verification code', GetVerificationCode: 'Get the verification code',
......
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
Provisional: 'Tạm tính', Provisional: 'Tạm tính',
Here: 'Tại đây', Here: 'Tại đây',
Open_account_demo: 'Bạn có thể mở tài khoản thử', Open_account_demo: 'Bạn có thể mở tài khoản thử',
Features_develop: 'Tính năng đang được phát triển, vui lòng quay lại sau!', Features_develop: 'Không có dữ liệu!',
Email: 'Email', Email: 'Email',
Password: 'Mật khẩu', Password: 'Mật khẩu',
Login: 'Đăng nhập', Login: 'Đăng nhập',
...@@ -128,7 +128,8 @@ export default { ...@@ -128,7 +128,8 @@ export default {
Branch: 'Chi nhánh', Branch: 'Chi nhánh',
OwnerAccountName: 'Tên chủ tài khoản', OwnerAccountName: 'Tên chủ tài khoản',
AccountNumber: 'Số tài khoản ngân hàng', AccountNumber: 'Số tài khoản ngân hàng',
DeletePaymentMethodConfirm: 'Bạn có chắc chắn muốn xoá phương thức thanh toán', DeletePaymentMethodConfirm:
'Bạn có chắc chắn muốn xoá phương thức thanh toán',
Forbidden: 'Từ chối', Forbidden: 'Từ chối',
OwnerAccount: 'Chủ TK', OwnerAccount: 'Chủ TK',
Add: 'Thêm', Add: 'Thêm',
...@@ -143,7 +144,8 @@ export default { ...@@ -143,7 +144,8 @@ export default {
BeneficiaryAccount: 'tài khoản hưởng thụ', BeneficiaryAccount: 'tài khoản hưởng thụ',
FromWallet: 'Từ ví', FromWallet: 'Từ ví',
FromCQGAccount: 'Từ tài khoản CQG', FromCQGAccount: 'Từ tài khoản CQG',
SettingPaymentMethodConfirm: 'Bạn chưa có phương thức thanh toán.Đi đến cài đặt phương thức thanh toán?', SettingPaymentMethodConfirm:
'Bạn chưa có phương thức thanh toán.Đi đến cài đặt phương thức thanh toán?',
EnterEmailRequest: 'Vui lòng nhập email', EnterEmailRequest: 'Vui lòng nhập email',
EnterEmail: 'Nhập email', EnterEmail: 'Nhập email',
GetVerificationCode: 'Lấy mã xác thực', GetVerificationCode: 'Lấy mã xác thực',
......
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