public override Widget build(BuildContext context) { return(new StoreConnector <AppState, ArticlesScreenViewModel>( converter: state => new ArticlesScreenViewModel { isLoggedIn = state.loginState.isLoggedIn, feedHasNew = state.articleState.feedHasNew, currentTabBarIndex = state.tabBarState.currentTabIndex, nationalDayEnabled = state.serviceConfigState.nationalDayEnabled }, builder: (context1, viewModel, dispatcher) => { var actionModel = new ArticlesScreenActionModel { pushToSearch = () => { dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Search }); AnalyticsManager.ClickEnterSearch("Home_Article"); }, pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Login }), pushToReality = () => { dispatcher.dispatch(new EnterRealityAction()); AnalyticsManager.AnalyticsClickEgg(1); } }; return new ArticlesScreen(viewModel: viewModel, actionModel: actionModel); } )); }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, ArticlesScreenViewModel>( converter: state => new ArticlesScreenViewModel { isLoggedIn = state.loginState.isLoggedIn, showFirstEgg = state.eggState.showFirst }, builder: (context1, viewModel, dispatcher) => { var actionModel = new ArticlesScreenActionModel { pushToSearch = () => { dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Search }); AnalyticsManager.ClickEnterSearch("Home_Article"); }, fetchReviewUrl = () => dispatcher.dispatch <IPromise>(Actions.fetchReviewUrl()), pushToReality = () => { dispatcher.dispatch(new EnterRealityAction()); AnalyticsManager.AnalyticsClickEgg(1); } }; return new ArticlesScreen(viewModel, actionModel); } )); }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, ArticlesScreenViewModel>( converter: state => new ArticlesScreenViewModel { articlesLoading = state.articleState.articlesLoading, recommendArticleIds = state.articleState.recommendArticleIds, articleDict = state.articleState.articleDict, blockArticleList = state.articleState.blockArticleList, hottestHasMore = state.articleState.hottestHasMore, userDict = state.userState.userDict, teamDict = state.teamState.teamDict, isLoggedIn = state.loginState.isLoggedIn, hosttestOffset = state.articleState.recommendArticleIds.Count, showFirstEgg = state.eggState.showFirst }, builder: (context1, viewModel, dispatcher) => { var actionModel = new ArticlesScreenActionModel { pushToSearch = () => { dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Search }); AnalyticsManager.ClickEnterSearch("Home_Article"); }, pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Login }), pushToArticleDetail = id => dispatcher.dispatch( new MainNavigatorPushToArticleDetailAction { articleId = id } ), pushToReport = (reportId, reportType) => dispatcher.dispatch( new MainNavigatorPushToReportAction { reportId = reportId, reportType = reportType } ), pushToBlock = articleId => { dispatcher.dispatch(new BlockArticleAction { articleId = articleId }); dispatcher.dispatch(new DeleteArticleHistoryAction { articleId = articleId }); }, startFetchArticles = () => dispatcher.dispatch(new StartFetchArticlesAction()), fetchArticles = offset => dispatcher.dispatch <IPromise>(Actions.fetchArticles(offset: offset)), shareToWechat = (type, title, description, linkUrl, imageUrl) => dispatcher.dispatch <IPromise>( Actions.shareToWechat(type, title, description, linkUrl, imageUrl)), pushToReality = () => { dispatcher.dispatch(new EnterRealityAction()); AnalyticsManager.AnalyticsClickEgg(1); } }; return new RecommendArticleScreen(viewModel: viewModel, actionModel: actionModel); } )); }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, ArticlesScreenViewModel>( converter: state => new ArticlesScreenViewModel { isLoggedIn = state.loginState.isLoggedIn, feedHasNew = state.articleState.feedHasNew, searchSuggest = state.articleState.searchSuggest, currentTabBarIndex = state.tabBarState.currentTabIndex, nationalDayEnabled = state.serviceConfigState.nationalDayEnabled }, builder: (context1, viewModel, dispatcher) => { var actionModel = new ArticlesScreenActionModel { pushToSearch = () => { dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Search }); AnalyticsManager.ClickEnterSearch("Home_Article"); }, pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Login }), pushToReality = () => { dispatcher.dispatch(new EnterRealityAction()); AnalyticsManager.AnalyticsClickEgg(1); }, pushToGame = () => { if (CCommonUtils.isIPhone) { dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Game }); } else { var url = LocalDataManager.getTinyGameUrl(); if (url.isEmpty() || url.Equals("no_game")) { CustomToast.show(new CustomToastItem( context: context, "暂无游戏", TimeSpan.FromMilliseconds(2000) )); return; } dispatcher.dispatch(new MainNavigatorPushToWebViewAction { url = url, landscape = true, fullscreen = true, showOpenInBrowser = false }); } } }; return new ArticlesScreen(viewModel: viewModel, actionModel: actionModel); } )); }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, ArticlesScreenViewModel>( converter: state => new ArticlesScreenViewModel { articlesLoading = state.articleState.articlesLoading, articleList = state.articleState.articleList, articleDict = state.articleState.articleDict, blockArticleList = state.articleState.blockArticleList, hottestHasMore = state.articleState.hottestHasMore, userDict = state.userState.userDict, teamDict = state.teamState.teamDict, isLoggedIn = state.loginState.isLoggedIn, hosttestOffset = state.articleState.articleList.Count }, builder: (context1, viewModel, dispatcher) => { var actionModel = new ArticlesScreenActionModel { pushToSearch = () => { dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Search }); AnalyticsManager.ClickEnterSearch("Home_Article"); }, pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.Login }), pushToArticleDetail = id => dispatcher.dispatch( new MainNavigatorPushToArticleDetailAction { articleId = id } ), pushToReport = (reportId, reportType) => dispatcher.dispatch( new MainNavigatorPushToReportAction { reportId = reportId, reportType = reportType } ), pushToBlock = articleId => { dispatcher.dispatch(new BlockArticleAction { articleId = articleId }); dispatcher.dispatch(new DeleteArticleHistoryAction { articleId = articleId }); }, startFetchArticles = () => dispatcher.dispatch(new StartFetchArticlesAction()), fetchArticles = offset => dispatcher.dispatch <IPromise>(Actions.fetchArticles(offset)), fetchReviewUrl = () => dispatcher.dispatch <IPromise>(Actions.fetchReviewUrl()) }; return new ArticlesScreen(viewModel, actionModel); } )); }