Commit 1a31e058 by Giang Tran

update code

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