• 曹云霄's avatar
    欧普主页:增加http链接、模块入口(客户提供设计稿) · 684e3bbb
    曹云霄 authored
    讨论区:增加层次,分类页面更改。
    
    帖子看过之后变灰(本地缓存)
    帖子的分享按钮放出来
    
    闯关:
      首页延长显示区,主题两行显示,右边更多。。。点击更多,显示列表页
      未参加的显示在前面。点击进去,提示是否开始。
      过期的不要显示
      已提交的显示多少分,是否成功。没成功的增加还有几次机会。
      闯关说明改一改。(客户提供)
    684e3bbb
LearningCenterMainViewController.m 5.32 KB
//
//  LearningCenterMainViewController.m
//  Lighting
//
//  Created by 曹云霄 on 2016/11/16.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "LearningCenterMainViewController.h"
#import "OnlineLearningViewController.h"
#import "ForumViewController.h"
#import "EmigratedMainViewController.h"
#import "PerfectInformationViewController.h"
#import "ForumTypeViewController.h"

@interface LearningCenterMainViewController ()


@end

@implementation LearningCenterMainViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

#pragma mark -渲染完成
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
    [self queryIntegralDetails];
}

#pragma mark -视图即将消失
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    // 开启
    self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = YES;
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self uiConfigAction];
    [self addGestureRecognizer];
}

#pragma mark -UI
- (void)uiConfigAction
{
    self.guideNameLabel.text = [NSString stringWithFormat:@"用户名: %@",[Shoppersmanager manager].Shoppers.employee.realName];
    //是否需要完善客户信息
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (![Shoppersmanager manager].Shoppers.employee.isComplete) {
            [self perfectGuideInformation];
        }
    });
}

#pragma mark - 添加点击
- (void)addGestureRecognizer
{
    [self.comprehensiveDiscussionView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(comprehensiveDiscussionViewClickAction:)]];
    [self.onlineLearningView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onlineLearningViewClickAction:)]];
    [self.breakthroughView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(breakthroughViewClickAction:)]];
}

#pragma mark - 查询积分明细
- (void)queryIntegralDetails
{
    WS(weakSelf);
    [XBLoadingView showHUDViewWithDefault];;
    NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid];
    [HTTP networkWithDictionaryRequestWithURL:url withRequestType:ONE withParameter:nil withReturnValueBlock:^(id returnValue) {
        
        [XBLoadingView hideHUDViewWithDefault];
        if (RESULT(returnValue)) {
            RsScoreDetails *integralDatas = [[RsScoreDetails alloc]initWithDictionary:RESPONSE(returnValue) error:nil];
            [weakSelf setUpIntegral:integralDatas];

        }else {
            [XBLoadingView showHUDViewWithText:returnValue[@"message"]];
        }
        
    }withFailureBlock:^(NSError *error) {
        [XBLoadingView showHUDViewWithText:error.localizedDescription];
    }];
}

#pragma mark - 积分信息
- (void)setUpIntegral:(RsScoreDetails *)entity
{
    if (entity.currentScore == 0) {
        entity.quarterlyRanking = 0;
        entity.annualRanking = 0;
    }
    self.currentScoreLabel.text = [NSString stringWithFormat:@"%.0lf",entity.currentScore];
    self.yearRankingLabel.text = [NSString stringWithFormat:@"%ld",(long)entity.annualRanking];
    [self.guideHeadImageView sd_setImageWithURL:[NSURL URLWithString:[Shoppersmanager manager].Shoppers.employee.picture] placeholderImage:ReplaceImage];
    [self.guideHeadImageView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(guideHeaderViewClick:)]];
    self.quarterRankingLabel.text = [NSString stringWithFormat:@"%ld",(long)entity.quarterlyRanking];
}

#pragma mark -导购头像点击事件
- (void)guideHeaderViewClick:(UITapGestureRecognizer *)tap
{
    [self perfectGuideInformation];
}

#pragma mark - 综合讨论
- (void)comprehensiveDiscussionViewClickAction:(UITapGestureRecognizer *)sender
{
    ForumTypeViewController *forum = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"ForumTypeViewController"];
    [self.navigationController pushViewController:forum animated:YES];
}

#pragma mark - 在线学习
- (void)onlineLearningViewClickAction:(UITapGestureRecognizer *)sender
{
    OnlineLearningViewController *onlineLearning = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"OnlineLearningViewController"];
    [self.navigationController pushViewController:onlineLearning animated:YES];
}

#pragma mark - 闯关
- (void)breakthroughViewClickAction:(UITapGestureRecognizer *)sender
{
    EmigratedMainViewController *emigrated = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"EmigratedMainViewController"];
    [self.navigationController pushViewController:emigrated animated:YES];
}


@end