Authored by 张文文

社区认证用户添加图标 reviewd by aozhe.zhu

@@ -20,14 +20,31 @@ export default class ContentFansListCell extends Component { @@ -20,14 +20,31 @@ export default class ContentFansListCell extends Component {
20 let sliceCount = width <= 320 ? 6 : 10; 20 let sliceCount = width <= 320 ? 6 : 10;
21 let userName = data.userName.length > sliceCount ? data.userName.slice(0,sliceCount)+'...' : data.userName; 21 let userName = data.userName.length > sliceCount ? data.userName.slice(0,sliceCount)+'...' : data.userName;
22 22
  23 + let showIcon = (data.authGroupId === 3 || data.authGroupId === 5 || data.authGroupId === 7) ? true : false;
  24 +
  25 + let source;
  26 + switch (data.authGroupId) {
  27 + case 3:
  28 + source = require('../../images/GF_big_ic.png');
  29 + break;
  30 + case 5:
  31 + source = require('../../images/PP_big_ic.png');
  32 + break;
  33 + case 7:
  34 + source = require('../../images/KING_big_ic.png');
  35 + break;
  36 + default:
  37 + }
  38 +
23 return ( 39 return (
24 <View> 40 <View>
25 <View style={styles.headerBackground}> 41 <View style={styles.headerBackground}>
26 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(data)}> 42 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(data)}>
27 <YH_Image style={styles.headIcon} url={data.headIco} circle={true}/> 43 <YH_Image style={styles.headIcon} url={data.headIco} circle={true}/>
  44 + <Image style={styles.iconImage} resizeMode="contain" source={source}/>
28 </TouchableOpacity> 45 </TouchableOpacity>
29 46
30 - <View style={styles.textView}> 47 + <View style={[styles.textView, {marginLeft:showIcon?20:15}]}>
31 <TouchableOpacity style={styles.toubleView} activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(data)}> 48 <TouchableOpacity style={styles.toubleView} activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(data)}>
32 <Text style={styles.nicknameText} numberOfLines={1}>{userName}</Text> 49 <Text style={styles.nicknameText} numberOfLines={1}>{userName}</Text>
33 <Text style={styles.defaultReplyText}>关注了你</Text> 50 <Text style={styles.defaultReplyText}>关注了你</Text>
@@ -59,10 +76,16 @@ let styles = StyleSheet.create({ @@ -59,10 +76,16 @@ let styles = StyleSheet.create({
59 height: 50, 76 height: 50,
60 marginLeft: 15, 77 marginLeft: 15,
61 marginTop: 15, 78 marginTop: 15,
62 - marginRight:15,  
63 overflow: 'hidden', 79 overflow: 'hidden',
64 borderRadius: 25, 80 borderRadius: 25,
65 }, 81 },
  82 + iconImage: {
  83 + width: 25,
  84 + height: 25,
  85 + position: 'absolute',
  86 + top: 42,
  87 + left: 52,
  88 + },
66 textView: { 89 textView: {
67 flexDirection: 'column', 90 flexDirection: 'column',
68 justifyContent: 'space-between', 91 justifyContent: 'space-between',
@@ -25,14 +25,31 @@ export default class ContentLikedListCell extends Component { @@ -25,14 +25,31 @@ export default class ContentLikedListCell extends Component {
25 25
26 let subName = rowData.businessType === 1000 ? '赞了你' : '收藏了你'; 26 let subName = rowData.businessType === 1000 ? '赞了你' : '收藏了你';
27 27
  28 + let showIcon = (rowData.authGroupId === 3 || rowData.authGroupId === 5 || rowData.authGroupId === 7) ? true : false;
  29 + let source;
  30 + switch (rowData.authGroupId) {
  31 + case 3:
  32 + source = require('../../images/GF_big_ic.png');
  33 + break;
  34 + case 5:
  35 + source = require('../../images/PP_big_ic.png');
  36 + break;
  37 + case 7:
  38 + source = require('../../images/KING_big_ic.png');
  39 + break;
  40 + default:
  41 + }
  42 +
  43 +
28 return ( 44 return (
29 <View> 45 <View>
30 <View style={styles.headerBackground}> 46 <View style={styles.headerBackground}>
31 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}> 47 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}>
32 <YH_Image style={styles.headIcon} url={rowData.headIco} circle={true}/> 48 <YH_Image style={styles.headIcon} url={rowData.headIco} circle={true}/>
  49 + <Image style={styles.iconImage} resizeMode="contain" source={source}/>
33 </TouchableOpacity> 50 </TouchableOpacity>
34 51
35 - <View style={styles.textView}> 52 + <View style={[styles.textView, {marginLeft:showIcon?15:10}]}>
36 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}> 53 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}>
37 <Text style={styles.nicknameText} numberOfLines={1}>{userName}</Text> 54 <Text style={styles.nicknameText} numberOfLines={1}>{userName}</Text>
38 </TouchableOpacity> 55 </TouchableOpacity>
@@ -94,10 +111,16 @@ let styles = StyleSheet.create({ @@ -94,10 +111,16 @@ let styles = StyleSheet.create({
94 height: 40, 111 height: 40,
95 marginLeft: 15, 112 marginLeft: 15,
96 marginTop: 15, 113 marginTop: 15,
97 - marginRight:10,  
98 overflow: 'hidden', 114 overflow: 'hidden',
99 borderRadius: 20, 115 borderRadius: 20,
100 }, 116 },
  117 + iconImage: {
  118 + width: 25,
  119 + height: 25,
  120 + position: 'absolute',
  121 + top: 35,
  122 + left: 40,
  123 + },
101 textView: { 124 textView: {
102 flexDirection: 'column', 125 flexDirection: 'column',
103 justifyContent: 'space-between', 126 justifyContent: 'space-between',
@@ -27,14 +27,31 @@ export default class ContentMessageCell extends Component { @@ -27,14 +27,31 @@ export default class ContentMessageCell extends Component {
27 27
28 let subName = rowData.businessType === 1002 ? '评论了你' : '回复了你'; 28 let subName = rowData.businessType === 1002 ? '评论了你' : '回复了你';
29 29
  30 + let showIcon = (rowData.authGroupId === 3 || rowData.authGroupId === 5 || rowData.authGroupId === 7) ? true : false;
  31 +
  32 + let source;
  33 + switch (rowData.authGroupId) {
  34 + case 3:
  35 + source = require('../../images/GF_big_ic.png');
  36 + break;
  37 + case 5:
  38 + source = require('../../images/PP_big_ic.png');
  39 + break;
  40 + case 7:
  41 + source = require('../../images/KING_big_ic.png');
  42 + break;
  43 + default:
  44 + }
  45 +
30 return ( 46 return (
31 <View> 47 <View>
32 <View style={styles.headerBackground}> 48 <View style={styles.headerBackground}>
33 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}> 49 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}>
34 <YH_Image style={styles.headIcon} url={rowData.headIco} circle={true}/> 50 <YH_Image style={styles.headIcon} url={rowData.headIco} circle={true}/>
  51 + <Image style={styles.iconImage} resizeMode="contain" source={source}/>
35 </TouchableOpacity> 52 </TouchableOpacity>
36 53
37 - <View style={styles.textView}> 54 + <View style={[styles.textView, {marginLeft:showIcon?15:10}]}>
38 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}> 55 <TouchableOpacity activeOpacity={1} onPress={()=> this.props.jumpToPersonalGrassPage && this.props.jumpToPersonalGrassPage(rowData)}>
39 <Text style={styles.nicknameText} numberOfLines={1}>{userName}</Text> 56 <Text style={styles.nicknameText} numberOfLines={1}>{userName}</Text>
40 </TouchableOpacity> 57 </TouchableOpacity>
@@ -117,10 +134,16 @@ let styles = StyleSheet.create({ @@ -117,10 +134,16 @@ let styles = StyleSheet.create({
117 height: 40, 134 height: 40,
118 marginLeft: 15, 135 marginLeft: 15,
119 marginTop: 15, 136 marginTop: 15,
120 - marginRight:10,  
121 overflow: 'hidden', 137 overflow: 'hidden',
122 borderRadius: 20, 138 borderRadius: 20,
123 }, 139 },
  140 + iconImage: {
  141 + width: 25,
  142 + height: 25,
  143 + position: 'absolute',
  144 + top: 35,
  145 + left: 40,
  146 + },
124 textView: { 147 textView: {
125 flexDirection: 'column', 148 flexDirection: 'column',
126 justifyContent: 'space-between', 149 justifyContent: 'space-between',