Authored by 张文文

内容消息tab调整

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