Authored by 孙凯

update UI review by chenling

... ... @@ -12,6 +12,7 @@ export default class RankBody extends Component {
return (
<View style={this.props.style}>
<VirtualizedList
ListHeaderComponent={this._header}
keyExtractor={(item, index) => index}
renderItem={({item, index}) => this._renderItem(item, index)}
getItemLayout={(data, index) => ({length: 70 * DEVICE_WIDTH_RATIO, offset: 70 * DEVICE_WIDTH_RATIO * index, index})}
... ... @@ -29,6 +30,9 @@ export default class RankBody extends Component {
_renderItem(item, index) {
return <RankItem key={index} monthRank={this.props.monthRank} item={item}/>
}
_header() {
return <View style={styles.view10}/>
}
}
class RankItem extends PureComponent {
... ... @@ -66,7 +70,7 @@ const styles = StyleSheet.create({
height: 70 * DEVICE_WIDTH_RATIO,
paddingVertical: 2,
borderBottomWidth: 0.5 * DEVICE_WIDTH_RATIO,
borderColor: '#E0E0E0'
borderColor: '#E0E0E0',
},
row: {
flexDirection: 'row',
... ... @@ -95,18 +99,20 @@ const styles = StyleSheet.create({
flex: 1,
alignItems: 'flex-end',
paddingRight: 15 * DEVICE_WIDTH_RATIO,
paddingTop: 15 * DEVICE_WIDTH_RATIO,
justifyContent: 'center',
},
amount: {
fontSize: 16,
lineHeight: 19,
color: '#444444',
},
amountName: {
fontFamily: 'PingFangSC-Regular',
marginTop: 4 * DEVICE_WIDTH_RATIO,
fontSize: 12,
lineHeight: 17,
color: '#B0B0B0'
}
},
view10: {
height: 10 * DEVICE_WIDTH_RATIO,
backgroundColor: '#F0F0F0',
},
})
... ...
... ... @@ -91,7 +91,7 @@ class ShareDetail extends Component {
<TouchableOpacity activeOpacity={0.8} onPress={() => this.props.addFavorite()} style={[styles.center]}>
<Image
style={styles.favorite}
resizeMode="center"
resizeMode="contain"
source={isCollect === 'Y' ? require('../../recorder/images/brand/heart_ic_h.png') : require('../../recorder/images/brand/heart_ic_n.png')} />
<Text style={styles.favText}>收藏</Text>
</TouchableOpacity>
... ... @@ -194,7 +194,7 @@ const styles = StyleSheet.create({
origpriceUnit: {
marginLeft: 7 * DEVICE_WIDTH_RATIO,
fontSize: 14,
lineHeight: 16,
lineHeight: 20,
textDecorationLine: 'line-through',
textDecorationStyle: 'solid',
textDecorationColor: '#B0B0B0',
... ... @@ -202,7 +202,7 @@ const styles = StyleSheet.create({
},
origPrice: {
fontSize: 14,
lineHeight: 16,
lineHeight: 20,
textDecorationLine: 'line-through',
textDecorationStyle: 'solid',
textDecorationColor: '#B0B0B0',
... ... @@ -237,8 +237,8 @@ const styles = StyleSheet.create({
},
recommendText: {
marginHorizontal: 6 * DEVICE_WIDTH_RATIO,
fontWeight: '500',
fontSize: 12,
fontWeight: 'bold',
fontSize: 12 * DEVICE_WIDTH_RATIO,
color: '#B0B0B0'
},
bottomBar: {
... ... @@ -251,12 +251,13 @@ const styles = StyleSheet.create({
marginHorizontal: 8 * DEVICE_WIDTH_RATIO,
},
favorite: {
width: 26 * DEVICE_WIDTH_RATIO,
height: 26 * DEVICE_WIDTH_RATIO,
width: 18 * DEVICE_WIDTH_RATIO,
height: 18 * DEVICE_WIDTH_RATIO,
},
favText: {
fontSize: 9,
color: '#B0B0B0'
fontSize: 9* DEVICE_WIDTH_RATIO,
color: '#B0B0B0',
marginTop: 5* DEVICE_WIDTH_RATIO,
},
buttonContainer: {
flex: 1,
... ... @@ -269,6 +270,8 @@ const styles = StyleSheet.create({
borderRadius: 4 * DEVICE_WIDTH_RATIO,
height: 44 * DEVICE_WIDTH_RATIO,
width: 130 * DEVICE_WIDTH_RATIO,
alignItems: 'center',
justifyContent: 'center',
},
red: {
backgroundColor: '#D0021B'
... ... @@ -276,7 +279,6 @@ const styles = StyleSheet.create({
btnText: {
color: '#FFFFFF',
fontSize: 15,
lineHeight: 21,
}
})
... ...
... ... @@ -24,7 +24,8 @@ class TalentRank extends Component {
let monthRankData = this.props.talentRank.monthRank;
let totalRankData = this.props.talentRank.totalRank;
let myRank = monthRank ? monthRankData.toJS() : totalRankData.toJS();
let { amountStr, nickname, image, rankNum } = myRank;
let { amountStr, nickname, image, rankNum ,amount} = myRank;
return (
<View style={styles.container}>
<View style={[styles.topContainer, styles.center]}>
... ... @@ -45,7 +46,8 @@ class TalentRank extends Component {
<View style={[styles.container, styles.leftContainer]}>
<Text style={styles.amountName}>{`${monthRank ? '本月' : '总'}预估收入`}</Text>
<View style={styles.amountContainer}>
<Text style={styles.amount}>{amountStr}</Text>
<Text style={[styles.amountUnit,styles.textLeft]}>¥</Text>
<Text style={[styles.amount,styles.textLeft]}>{amount}</Text>
</View>
</View>
<View style={[styles.container, styles.middleContainer]}>
... ... @@ -57,7 +59,6 @@ class TalentRank extends Component {
<Text style={[styles.amount, styles.textRight, styles.marginTop5]}>{rankNum && rankNum != 0 ? rankNum : '未上榜'}</Text>
</View>
</View>
<View style={styles.view10} />
<ScrollView ref="scrollView" style={styles.container}
contentContainerStyle={styles.contentContainerStyle}
horizontal={true}
... ... @@ -88,7 +89,7 @@ class TalentRank extends Component {
pageSize: 10,
});
}
_toggleRank(monthRank) {
// this.setState({height: 400});
this.setState({monthRank: monthRank});
... ... @@ -162,9 +163,7 @@ const styles = StyleSheet.create({
},
amountContainer: {
marginTop: 5 * DEVICE_WIDTH_RATIO,
height: 29 * DEVICE_WIDTH_RATIO,
flexDirection: 'row',
alignItems: 'flex-end',
},
amountUnit: {
fontSize: 14,
... ... @@ -180,7 +179,7 @@ const styles = StyleSheet.create({
fontWeight: '500',
textAlignVertical: 'bottom',
includeFontPadding: false,
color: '#000000'
color: '#000000',
},
middleContainer: {
paddingTop: 14 * DEVICE_WIDTH_RATIO,
... ... @@ -206,13 +205,13 @@ const styles = StyleSheet.create({
textRight: {
textAlign: 'right',
},
textLeft: {
textAlign: 'left',
},
marginTop5: {
marginTop: 5 * DEVICE_WIDTH_RATIO,
},
view10: {
height: 10 * DEVICE_WIDTH_RATIO,
backgroundColor: '#E0E0E0',
},
positionFixed: {
position: 'absolute',
right: 0,
... ... @@ -220,4 +219,4 @@ const styles = StyleSheet.create({
contentContainerStyle: {
width: 2 * width,
}
});
\ No newline at end of file
});
... ...