Commit 5c26a7f0 by Giang Tran

Merge branch 'dev_phase2' of http://git.dcv.vn/tdgiangdev/InvestCustomer into dev_phase2

parents c02924b5 fa86b93c
...@@ -4,6 +4,7 @@ import { ...@@ -4,6 +4,7 @@ import {
Text, Text,
StyleSheet, StyleSheet,
Image, Image,
TouchableOpacity
} from 'react-native'; } from 'react-native';
import { import {
getFontXD, getFontXD,
...@@ -12,12 +13,12 @@ import { ...@@ -12,12 +13,12 @@ import {
} 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 * as Progress from 'react-native-progress';
const ItemPrice = (props) => { const ItemPrice = (props) => {
const {item, isEndItem} = props; const {item, isEndItem, onPress} = props;
return ( return (
<View style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}, {paddingBottom: HEIGHTXD(20)}]}> <View style={[styles.container, isEndItem && {marginBottom: HEIGHTXD(100)}, {paddingBottom: HEIGHTXD(20)}]}>
<TouchableOpacity onPress={onPress}>
<Block flex={1} row> <Block flex={1} row>
<View style={{flex: 0.8, flexDirection: 'column', justifyContent: 'center'}}> <View style={{flex: 0.8, flexDirection: 'column', justifyContent: 'center'}}>
<Text style={[styles.txtBlack, {marginBottom: HEIGHTXD(5)}]}> <Text style={[styles.txtBlack, {marginBottom: HEIGHTXD(5)}]}>
...@@ -47,12 +48,17 @@ const ItemPrice = (props) => { ...@@ -47,12 +48,17 @@ const ItemPrice = (props) => {
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
}}> }}>
<Image source={item.is_up ? R.images.iconTriangleUp : R.images.iconTriangleDown} style={styles.imgIcon} /> <Image source={item.is_up ? R.images.iconTriangleUp : R.images.iconTriangleDown}
<Text style={[styles.txtBlack, {flexWrap: 'wrap', color: item.is_up ? R.colors.green : R.colors.red2}]}> style={styles.imgIcon}/>
<Text style={[styles.txtBlack, {
flexWrap: 'wrap',
color: item.is_up ? R.colors.green : R.colors.red2,
}]}>
{item.change} {item.change}
</Text> </Text>
</View> </View>
<Text style={[styles.txtMoney, {color: item.is_up ? R.colors.green : R.colors.red2}]}>{`${item.change_percent}%`}</Text> <Text
style={[styles.txtMoney, {color: item.is_up ? R.colors.green : R.colors.red2}]}>{`${item.change_percent}%`}</Text>
</View> </View>
</Block> </Block>
<Block padding={[0, 0]} space={'between'} flex={1}> <Block padding={[0, 0]} space={'between'} flex={1}>
...@@ -75,7 +81,8 @@ const ItemPrice = (props) => { ...@@ -75,7 +81,8 @@ const ItemPrice = (props) => {
ellipsizeMode='tail'> ellipsizeMode='tail'>
{item.open_price} {item.open_price}
</Text> </Text>
<Image source={item.is_up ? R.images.iconTriangleUp : R.images.iconTriangleDown} style={styles.imgIcon} /> <Image source={item.is_up ? R.images.iconTriangleUp : R.images.iconTriangleDown}
style={styles.imgIcon}/>
</View> </View>
<View <View
style={{ style={{
...@@ -85,7 +92,7 @@ const ItemPrice = (props) => { ...@@ -85,7 +92,7 @@ const ItemPrice = (props) => {
alignItems: 'center', alignItems: 'center',
}}> }}>
<Text style={[styles.txtMoney, {color: R.colors.gray6}]}>{item.close_price}</Text> <Text style={[styles.txtMoney, {color: R.colors.gray6}]}>{item.close_price}</Text>
<Image source={R.images.iconCheck2} style={styles.imgIcon} /> <Image source={R.images.iconCheck2} style={styles.imgIcon}/>
</View> </View>
</View> </View>
</Block> </Block>
...@@ -126,7 +133,13 @@ const ItemPrice = (props) => { ...@@ -126,7 +133,13 @@ const ItemPrice = (props) => {
</Block> </Block>
<Text style={[styles.txtTime]}> <Text style={[styles.txtTime]}>
{item.time}</Text> {item.time}</Text>
<View style={{height: HEIGHTXD(1), backgroundColor: R.colors.gray, marginTop: HEIGHTXD(3), marginBottom: HEIGHTXD(3)}}></View> <View style={{
height: HEIGHTXD(1),
backgroundColor: R.colors.gray,
marginTop: HEIGHTXD(3),
marginBottom: HEIGHTXD(3),
}}></View>
</TouchableOpacity>
</View> </View>
); );
}; };
...@@ -182,5 +195,5 @@ const styles = StyleSheet.create({ ...@@ -182,5 +195,5 @@ const styles = StyleSheet.create({
width: WIDTHXD(20), width: WIDTHXD(20),
height: WIDTHXD(20), height: WIDTHXD(20),
resizeMode: 'contain', resizeMode: 'contain',
} },
}); });
...@@ -11,9 +11,12 @@ import { ...@@ -11,9 +11,12 @@ 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 ItemPrice from './ItemPrice'; import ItemPrice from './ItemPrice';
import {PRODUCTDETAIL} from '../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native';
const PriceListView = (props) => { const PriceListView = (props) => {
const {setFilterId, filters, dataPrice, filterId} = props; const {setFilterId, filters, dataPrice, filterId} = props;
const navigate = useNavigation();
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<View style={styles.headerContainer}> <View style={styles.headerContainer}>
...@@ -41,24 +44,32 @@ const PriceListView = (props) => { ...@@ -41,24 +44,32 @@ const PriceListView = (props) => {
data={dataPrice} data={dataPrice}
ListHeaderComponent={() => ListHeaderComponent={() =>
<View style={[styles.container]}> <View style={[styles.container]}>
<View style={[styles.headerContent, {flex: 0.3, justifyContent: 'flex-start', alignItems: 'center',}]}> <View style={[styles.headerContent, {
flex: 0.3,
justifyContent: 'flex-start',
alignItems: 'center',
}]}>
<Text>Tên</Text> <Text>Tên</Text>
<Image source={R.images.iconSort} style={styles.imgIcon} /> <Image source={R.images.iconSort} style={styles.imgIcon}/>
</View> </View>
<View style={[styles.headerContent, {flex: 1.5}]}> <View style={[styles.headerContent, {flex: 1.5}]}>
<Text>T l thay đổi</Text> <Text>T l thay đổi</Text>
<Image source={R.images.iconSort} style={styles.imgIcon} /> <Image source={R.images.iconSort} style={styles.imgIcon}/>
</View> </View>
<View style={[styles.headerContent]}> <View style={[styles.headerContent]}>
<Text>Giá m/đóng</Text> <Text>Giá m/đóng</Text>
<Image source={R.images.iconSort} style={styles.imgIcon} /> <Image source={R.images.iconSort} style={styles.imgIcon}/>
</View> </View>
<View style={[styles.headerContent]}> <View style={[styles.headerContent]}>
<Text>Giá cao/thp</Text> <Text>Giá cao/thp</Text>
<Image source={R.images.iconSort} style={styles.imgIcon} /> <Image source={R.images.iconSort} style={styles.imgIcon}/>
</View> </View>
</View>} </View>}
renderItem={({item}) => <ItemPrice item={item}/>} renderItem={({item}) => <ItemPrice item={item}
onPress={() => navigate.navigate(PRODUCTDETAIL, {
id: item.id,
name: item.name,
})}/>}
/> />
</View> </View>
); );
...@@ -95,7 +106,7 @@ const styles = StyleSheet.create({ ...@@ -95,7 +106,7 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
marginHorizontal: WIDTHXD(30), marginHorizontal: WIDTHXD(30),
marginBottom: HEIGHTXD(10) marginBottom: HEIGHTXD(10),
}, },
headerContent: { headerContent: {
......
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