Authored by 张文文

内容消息tab调整

... ... @@ -26,8 +26,8 @@ class ContentMessageTabItemView extends Component {
onImageLayout(event) {
let imageLayout = event.nativeEvent.layout
this.setState({
badgeY: imageLayout.y + 1,
badgeX: imageLayout.x + imageLayout.width / 2 + 14,
badgeY: imageLayout.y - 4,
badgeX: imageLayout.x + imageLayout.width / 2 + 17,
})
}
... ... @@ -49,7 +49,7 @@ class ContentMessageTabItemView extends Component {
return <View style={styles.surfaceContainer}>
<Surface width={width} height={height}>
<Group>
<Shape d={path} stroke={'white'} fill={'#CE0824'} strokeWidth={strokeWidth}/>
<Shape d={path} stroke={'#FB2330'} fill={'#FB2330'} strokeWidth={strokeWidth}/>
</Group>
</Surface>
</View>
... ... @@ -59,9 +59,7 @@ class ContentMessageTabItemView extends Component {
render() {
return <View style={[styles.container, this.props.style]}>
<YH_Image style={styles.icon}
onLayout={this.onImageLayout}
url={YH_Image.getSlicedUrl(this.props.icon, IMAGE_WIDTH, IMAGE_HEIGHT, 2)}/>
<Image style={styles.icon} source={this.props.icon} onLayout={this.onImageLayout}/>
<Text style={styles.title}>{this.props.title}</Text>
{this.props.badge > 0 && this.state.badgeX != INVALID_POSITION && this.state.badgeY != INVALID_POSITION &&
<View style={[styles.badgeContainer, {left: this.state.badgeX, top: this.state.badgeY}]}
... ... @@ -108,7 +106,7 @@ let styles = StyleSheet.create({
left: 0,
top: 0,
right: 0,
bottom: 0
bottom: 0,
},
badgeTitle: {
marginLeft: 5,
... ...
... ... @@ -47,21 +47,21 @@ export default class ContentMessageView extends Component {
let buttonHeight = this.props.contentTipFlag==='0'?25:0;
let tabButtons = [{
"imgUrl": "http://img12.static.yhbimg.com/article/2018/10/11/18/027af4e8c8a34ec692fabbe07eca39d3f2.png",
"type": 1,
"description": "获赞收藏",
"unReadCount": 0
imgSource: require('../../images/content_zan.png'),
type: 1,
description: "获赞收藏",
unReadCount: 0
}, {
"imgUrl": "http://img13.static.yhbimg.com/article/2018/10/11/18/02e78e9d50b4265f09b21d248e3ca17567.png",
"type": 2,
"description": "关注",
"unReadCount": 2
imgSource: require('../../images/content_gz.png'),
type: 2,
description: "关注",
unReadCount: 2
}, {
"imgUrl": "http://img10.static.yhbimg.com/article/2018/10/11/18/013637a9a30d11387e8adfd0d642e35205.png",
"type": 3,
"description": "通知",
"unReadCount": 0
}]
imgSource: require('../../images/content_tz.png'),
type: 3,
description: "通知",
unReadCount: 0
}];
function onNotifyPress() {
... ... @@ -86,7 +86,7 @@ export default class ContentMessageView extends Component {
return <TouchableOpacity style={styles.tabItemContainer} key={index} onPress={()=> {
onPress(button.description, button.type)
}}>
<ContentMessageTabItemView icon={button.imgUrl} title={button.description} badge={button.unReadCount}/>
<ContentMessageTabItemView icon={button.imgSource} title={button.description} badge={button.unReadCount}/>
</TouchableOpacity>
})}
</View>
... ...