@@ -14,93 +14,88 @@ interface IProps {
1414 item : ITopicDetailItem ;
1515}
1616
17- class TopicDetailItem extends React . Component < IProps > {
18- go2VideoDetail = ( item : Item ) => {
17+ function TopicDetailItem ( props : IProps ) {
18+ const go2VideoDetail = ( item : Item ) => {
1919 navigate ( 'VideoDetail' , { item : item } ) ;
2020 } ;
2121
22- tagItem = ( value : Tag ) => {
22+ const tagItem = ( value : Tag ) => {
2323 return (
2424 < View key = { value . name } style = { styles . tag } >
2525 < Text style = { styles . tagText } > { value . name } </ Text >
2626 </ View >
2727 ) ;
2828 } ;
2929
30- render ( ) {
31- const { item} = this . props ;
32- return (
33- < View style = { styles . container } >
34- < View style = { styles . headContainer } >
35- < FastImage
36- style = { styles . icon }
37- source = { {
38- uri : item . data . header . icon ,
39- } }
40- />
41- < View style = { styles . headLeftContainer } >
42- < Text style = { styles . issuerName } > { item . data . header . issuerName } </ Text >
43- < View style = { styles . headBottomContainer } >
44- < Text style = { styles . time } >
45- { formatDateMsByYMD ( item . data . header . time ) } 发布:
46- </ Text >
47- < Text numberOfLines = { 1 } style = { styles . title } >
48- { item . data . content . data . title }
49- </ Text >
50- </ View >
30+ const { item} = props ;
31+ return (
32+ < View style = { styles . container } >
33+ < View style = { styles . headContainer } >
34+ < FastImage
35+ style = { styles . icon }
36+ source = { {
37+ uri : item . data . header . icon ,
38+ } }
39+ />
40+ < View style = { styles . headLeftContainer } >
41+ < Text style = { styles . issuerName } > { item . data . header . issuerName } </ Text >
42+ < View style = { styles . headBottomContainer } >
43+ < Text style = { styles . time } >
44+ { formatDateMsByYMD ( item . data . header . time ) } 发布:
45+ </ Text >
46+ < Text numberOfLines = { 1 } style = { styles . title } >
47+ { item . data . content . data . title }
48+ </ Text >
5149 </ View >
5250 </ View >
53- < Text numberOfLines = { 2 } style = { styles . description } >
54- { item . data . content . data . description }
55- </ Text >
51+ </ View >
52+ < Text numberOfLines = { 2 } style = { styles . description } >
53+ { item . data . content . data . description }
54+ </ Text >
5655
57- < View style = { styles . tagContainer } >
58- { item . data . content . data . tags . length > 3
59- ? item . data . content . data . tags
60- . slice ( 0 , 3 )
61- . map ( ( value ) => this . tagItem ( value ) )
62- : item . data . content . data . tags . map ( ( value ) => this . tagItem ( value ) ) }
56+ < View style = { styles . tagContainer } >
57+ { item . data . content . data . tags . length > 3
58+ ? item . data . content . data . tags
59+ . slice ( 0 , 3 )
60+ . map ( ( value ) => tagItem ( value ) )
61+ : item . data . content . data . tags . map ( ( value ) => tagItem ( value ) ) }
62+ </ View >
63+ < TouchableWithoutFeedback
64+ onPress = { ( ) => go2VideoDetail ( item . data . content ) } >
65+ < FastImage
66+ style = { styles . feed }
67+ source = { {
68+ uri : item . data . content . data . cover . feed ,
69+ } }
70+ />
71+ </ TouchableWithoutFeedback >
72+ < View style = { styles . consumeContainer } >
73+ < View style = { styles . consumeItem } >
74+ < IconLove size = { 22 } color = "#9a9a9a" />
75+ < Text style = { styles . consumeText } >
76+ { item . data . content . data . consumption . collectionCount }
77+ </ Text >
6378 </ View >
64- < TouchableWithoutFeedback
65- onPress = { ( ) => this . go2VideoDetail ( item . data . content ) } >
66- < FastImage
67- style = { styles . feed }
68- source = { {
69- uri : item . data . content . data . cover . feed ,
70- } }
71- />
72- </ TouchableWithoutFeedback >
73- < View style = { styles . consumeContainer } >
74- < View style = { styles . consumeItem } >
75- < IconLove size = { 22 } color = "#9a9a9a" />
76- < Text style = { styles . consumeText } >
77- { item . data . content . data . consumption . collectionCount }
78- </ Text >
79- </ View >
80- < View style = { styles . consumeItem } >
81- < IconCommentlinesFill size = { 16 } color = "#9a9a9a" />
82- < Text style = { styles . consumeText } >
83- { item . data . content . data . consumption . replyCount }
84- </ Text >
85- </ View >
86- < View style = { styles . consumeItem } >
87- < IconStar color = "#9a9a9a" />
88- < Text style = { styles . consumeText } > 收藏</ Text >
89- </ View >
90- < IconShare1
91- color = "#9a9a9a"
92- onPress = { ( ) =>
93- share (
94- item . data . content . data . title ,
95- item . data . content . data . playUrl ,
96- )
97- }
98- />
79+ < View style = { styles . consumeItem } >
80+ < IconCommentlinesFill size = { 16 } color = "#9a9a9a" />
81+ < Text style = { styles . consumeText } >
82+ { item . data . content . data . consumption . replyCount }
83+ </ Text >
84+ </ View >
85+ < View style = { styles . consumeItem } >
86+ < IconStar color = "#9a9a9a" />
87+ < Text style = { styles . consumeText } > 收藏</ Text >
9988 </ View >
100- < View style = { styles . line } />
89+ < IconShare1
90+ color = "#9a9a9a"
91+ onPress = { ( ) =>
92+ share ( item . data . content . data . title , item . data . content . data . playUrl )
93+ }
94+ />
10195 </ View >
102- ) ;
103- }
96+ < View style = { styles . line } />
97+ </ View >
98+ ) ;
10499}
105100
106101const styles = StyleSheet . create ( {
0 commit comments