Commit 1a31e058 by Giang Tran

update code

parent 23060292
...@@ -117,6 +117,7 @@ const PacketCQG = (props) => { ...@@ -117,6 +117,7 @@ const PacketCQG = (props) => {
}; };
const getData = async () => { const getData = async () => {
const res = await getListPacketCQG({}); const res = await getListPacketCQG({});
console.log(res.data.data.fee.data);
if ((res.data.code = 200 && res.data.data)) { if ((res.data.code = 200 && res.data.data)) {
setListData(res.data.data.fee.data); setListData(res.data.data.fee.data);
......
...@@ -14,6 +14,7 @@ import AppText from '../../components/AppText'; ...@@ -14,6 +14,7 @@ import AppText from '../../components/AppText';
import TextField from '../../components/Input/TextField'; import TextField from '../../components/Input/TextField';
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 Icon from 'react-native-vector-icons/FontAwesome';
const dataType = [ const dataType = [
{ {
...@@ -31,6 +32,7 @@ const ConvertUnit = (props) => { ...@@ -31,6 +32,7 @@ const ConvertUnit = (props) => {
const [typeTwo, setTypeTwo] = useState(); const [typeTwo, setTypeTwo] = useState();
const [valueOne, setValueOne] = useState(); const [valueOne, setValueOne] = useState();
const [valueTwo, setValueTwo] = useState(); const [valueTwo, setValueTwo] = useState();
const [result, setResult] = useState();
const onClick = () => { const onClick = () => {
console.log('Heloo', typeOne, typeTwo, valueOne, valueTwo); console.log('Heloo', typeOne, typeTwo, valueOne, valueTwo);
...@@ -40,43 +42,43 @@ const ConvertUnit = (props) => { ...@@ -40,43 +42,43 @@ const ConvertUnit = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'ConvertUnit'} /> <HeaderBack title={'ConvertUnit'} />
<View style={{flex: 1, paddingTop: 20, paddingHorizontal: 20}}> <View style={{flex: 1, paddingTop: 20, paddingHorizontal: 20}}>
<AppText style={styles.txtTitle} i18nKey={'ConversionUnit'} /> <AppText style={styles.txtTitle} i18nKey={'Count'} />
<View style={styles.Item}> <View style={styles.Item}>
<View style={styles.wrap}> <View style={styles.wrap}>
<PickerItem
width={WIDTHXD(431)}
data={dataType}
onValueChange={(value, items) => {
setTypeOne(items);
}}
/>
<TextInput <TextInput
onChangeText={(val) => setValueOne(val)} onChangeText={(val) => setValueOne(val)}
keyboardType={'number-pad'} keyboardType={'number-pad'}
style={styles.wrapInput} style={styles.wrapInput}
maxLength={12}
/> />
</View> </View>
<Text style={styles.txtNote}>1KG = 2 Pount</Text>
</View> </View>
<View style={styles.Item}> <View style={styles.Item}>
<View style={styles.wrap}> <View style={styles.wrap}>
<PickerItem <PickerItem
width={WIDTHXD(431)} width={WIDTHXD(400)}
data={dataType} data={dataType}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setTypeTwo(items); setTypeTwo(items);
}} }}
/> />
<TextInput <TouchableOpacity>
onChangeText={(val) => setValueTwo(val)} <Icon name={'exchange'} size={30} color={R.colors.black} />
keyboardType={'number-pad'} </TouchableOpacity>
style={styles.wrapInput}
<PickerItem
width={WIDTHXD(400)}
data={dataType}
onValueChange={(value, items) => {
setTypeOne(items);
}}
/> />
</View> </View>
<Text style={styles.txtNote}>1 Pount = 0.5 KG</Text>
</View> </View>
<Text style={styles.txtResult}>Kết qu: {result}</Text>
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity onPress={onClick} style={styles.btnContainer}> <TouchableOpacity onPress={onClick} style={styles.btnContainer}>
<AppText style={styles.txtBtn} i18nKey={'Caculate'} /> <AppText style={styles.txtBtn} i18nKey={'Caculate'} />
...@@ -91,7 +93,7 @@ const styles = StyleSheet.create({ ...@@ -91,7 +93,7 @@ const styles = StyleSheet.create({
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: R.colors.color777, color: R.colors.color777,
marginBottom: 15, marginBottom: 5,
}, },
note: { note: {
fontSize: getFontXD(36), fontSize: getFontXD(36),
...@@ -108,7 +110,7 @@ const styles = StyleSheet.create({ ...@@ -108,7 +110,7 @@ const styles = StyleSheet.create({
footer: { footer: {
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
marginTop: 20, marginTop: 40,
}, },
btnContainer: { btnContainer: {
width: WIDTHXD(428), width: WIDTHXD(428),
...@@ -124,7 +126,7 @@ const styles = StyleSheet.create({ ...@@ -124,7 +126,7 @@ const styles = StyleSheet.create({
fontWeight: '600', fontWeight: '600',
}, },
wrapInput: { wrapInput: {
width: WIDTHXD(431), width: '100%',
backgroundColor: R.colors.white, backgroundColor: R.colors.white,
height: HEIGHTXD(109), height: HEIGHTXD(109),
fontSize: getFontXD(42), fontSize: getFontXD(42),
...@@ -152,5 +154,12 @@ const styles = StyleSheet.create({ ...@@ -152,5 +154,12 @@ const styles = StyleSheet.create({
textAlign: 'right', textAlign: 'right',
marginTop: 10, marginTop: 10,
}, },
txtResult: {
fontSize: getFontXD(52),
color: R.colors.black,
fontWeight: '600',
textAlign: 'center',
marginTop: 20,
},
}); });
export default ConvertUnit; export default ConvertUnit;
...@@ -276,4 +276,5 @@ export default { ...@@ -276,4 +276,5 @@ export default {
SELL_OUT: 'Sell out', SELL_OUT: 'Sell out',
CloseAccount: 'Close account', CloseAccount: 'Close account',
UpdatePacket: 'Update packet', UpdatePacket: 'Update packet',
Count: 'Count',
}; };
...@@ -271,4 +271,5 @@ export default { ...@@ -271,4 +271,5 @@ export default {
FirstEscrowTotal: 'Ký quỹ khả dụng', FirstEscrowTotal: 'Ký quỹ khả dụng',
CloseAccount: 'Đóng tài khoản', CloseAccount: 'Đóng tài khoản',
UpdatePacket: 'Cập nhật gói cước', UpdatePacket: 'Cập nhật gói cước',
Count: 'Số lượng',
}; };
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