@@ -10,6 +10,7 @@ import {bindActionCreators} from 'redux';
1010import * as Actions from '../../actions/requestRandomData' ;
1111import Icon from 'react-native-vector-icons/Ionicons' ;
1212import TextListPage from './TextListPage' ;
13+ import GirlsPage from './GirlsPage' ;
1314import theme from '../../constants/theme' ;
1415import NavigationBar from '../../components/NavigationBar' ;
1516import px2dp from '../../utils/px2dp' ;
@@ -20,22 +21,18 @@ import WebViewPage from '../../containers/WebViewPage';
2021class DiscoveryFragment extends Component {
2122 constructor ( props ) {
2223 super ( props ) ;
23- this . tabNames = [ [ 'Android' , 'iOS' , '前端' ] , [ 'App' , '休息视频' , '拓展资源' ] ] ;
24- this . tabIcon = [ [ 'logo-android' , 'logo-apple' , 'logo-chrome' ] , [ 'ios-apps' , 'ios-film' , 'ios-book' ] ] ;
25- this . tabColor = [ [ 'rgb(141,192,89)' , '#000' , 'rgb(51,154,237)' ] , [ 'rgb(249,89,58)' , 'rgb(154,53,172)' , 'rgb(65,87,175) '] ] ;
24+ this . tabNames = [ [ 'Android' , 'iOS' , '前端' , 'App' ] , [ '休息视频' , '拓展资源' , '瞎推荐' , '福利 '] ] ;
25+ this . tabIcon = [ [ 'logo-android' , 'logo-apple' , 'logo-chrome' , 'ios-apps' ] , [ 'ios-film' , 'ios-book' , 'ios-radio' , 'ios-images '] ] ;
26+ this . tabColor = [ [ 'rgb(141,192,89)' , '#000' , 'rgb(51,154,237)' , 'rgb(249,89,58)' ] , [ '#9370db' , '#00ced1' , '#ffa500' , 'lightpink '] ] ;
2627 this . ds = new ListView . DataSource ( { rowHasChanged : ( r1 , r2 ) => r1 !== r2 } ) ;
2728 }
2829
29- _fetchData ( ) {
30- this . props . actions . fetchRandomData ( ) ;
31- }
32-
3330 componentDidMount ( ) {
34- this . _fetchData ( ) ;
31+ this . props . actions . fetchLocalRandomData ( ) ;
3532 }
3633
3734 _onRefresh ( ) {
38- this . _fetchData ( ) ;
35+ this . props . actions . fetchRandomData ( ) ;
3936 }
4037
4138 _onEndReached ( ) {
@@ -110,6 +107,14 @@ class DiscoveryFragment extends Component{
110107 )
111108 }
112109
110+ _renderBtnContent ( i , index ) {
111+ return (
112+ < View style = { { width :px2dp ( 50 ) , height :px2dp ( 50 ) , alignItems :'center' , justifyContent :'center' } } >
113+ < Avatar icon = { this . tabIcon [ i ] [ index ] } width = { px2dp ( 50 ) } backgroundColor = { this . tabColor [ i ] [ index ] } />
114+ </ View >
115+ ) ;
116+ }
117+
113118 _renderFooter ( ) {
114119 if ( this . props . isRenderFooter ) {
115120 return (
@@ -187,16 +192,11 @@ class DiscoveryFragment extends Component{
187192 return time . substring ( 0 , 10 ) ;
188193 }
189194
190- _renderBtnContent ( i , index ) {
191- return (
192- < View style = { { width :px2dp ( 60 ) , height :px2dp ( 60 ) , alignItems :'center' , justifyContent :'center' } } >
193- < Avatar icon = { this . tabIcon [ i ] [ index ] } width = { px2dp ( 60 ) } backgroundColor = { this . tabColor [ i ] [ index ] } />
194- </ View >
195- ) ;
196- }
197-
198195 _itemPressCallback ( title ) {
199- this . _pushScene ( TextListPage , title ) ;
196+ if ( title === '福利' )
197+ this . _pushScene ( GirlsPage , title ) ;
198+ else
199+ this . _pushScene ( TextListPage , title ) ;
200200 }
201201
202202 _pushScene ( component , title ) {
0 commit comments