GuideIntegralViewController.m 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9
//
//  GuideIntegralViewController.m
//  Lighting
//
//  Created by 曹云霄 on 2016/11/16.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "GuideIntegralViewController.h"
10
#import "IntegralDetailsViewController.h"
11
#import "PrizeMainViewController.h"
12 13 14 15 16 17 18 19 20 21 22 23 24

@interface GuideIntegralViewController ()

@end

@implementation GuideIntegralViewController

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

曹云霄's avatar
曹云霄 committed
25 26 27 28 29 30 31 32
#pragma mark - 积分赋值
- (void)integralAssignment:(RsScoreDetails *)scoreModel
{
    self.currentIntegralLabel.text = [NSString stringWithFormat:@"%.0lf",scoreModel.currentScore];
    self.quarterIntegralLabel.text = [NSString stringWithFormat:@"%ld",scoreModel.quarterlyRanking];
    self.yearIntegralLabel.text = [NSString stringWithFormat:@"%ld",scoreModel.annualRanking];
}

曹云霄's avatar
曹云霄 committed
33
#pragma mark - 添加积分明细、导购头像
34 35
- (void)addChildViewController
{
36
    IntegralDetailsViewController *integralDetails = [[[self class] getGuideIntegralStoryboardClass] instantiateViewControllerWithIdentifier:@"IntegralDetailsViewController"];
37
    integralDetails.cellType = IntrgralTableView;
38 39 40
    [self addChildViewController:integralDetails];
    integralDetails.view.frame = CGRectMake(0, 50, self.integralDetailsView.mj_w, self.integralDetailsView.mj_h-50);
    [self.integralDetailsView addSubview:integralDetails.view];
曹云霄's avatar
曹云霄 committed
41 42
    NSString *headerurl = [Shoppersmanager manager].Shoppers.employee.picture;
    [self.guideHeaderView sd_setImageWithURL:[NSURL URLWithString:headerurl] placeholderImage:ReplaceImage];
43 44 45 46
    WS(weakSelf);
    [integralDetails setReturnIntegralDetailsBlock:^(RsScoreDetails *model) {
        [weakSelf integralAssignment:model];
    }];
47 48 49 50
}

#pragma mark - 礼品兑换
- (IBAction)exchangeButtonClick:(UIButton *)sender {
51
    
52 53
    PrizeMainViewController *prizeMainVC = [[[self class] getGuideIntegralStoryboardClass] instantiateViewControllerWithIdentifier:@"PrizeMainViewController"];
    [self.navigationController pushViewController:prizeMainVC animated:YES];
54 55 56 57 58 59 60 61 62
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end