重庆迈尖科技有限公司
2018-08-17 01f3d22ea41c77007ecbee09a4a52283636557a8
Merge branch 'master' of ssh://193.112.35.168:29418/fanliquan

# Conflicts:
# MIduo.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate
4个文件已添加
10个文件已修改
1533 ■■■■ 已修改文件
MIduo.xcodeproj/project.pbxproj 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/InviteViewCell/InviteOneCell.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/InviteViewCell/InviteOneCell.m 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/InviteViewCell/InviteThreeCell.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/InviteViewCell/InviteThreeCell.m 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/InviteViewCell/InvitewFourCell.h 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/InviteViewCell/InvitewFourCell.m 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/MainInviteViewController.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/MainInviteViewController.m 973 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/Model/MainInviteModel.h 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/Model/MainInviteModel.m 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/ViewModel/MainInviteViewModel.h 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo/界面/邀请/ViewModel/MainInviteViewModel.m 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MIduo.xcodeproj/project.pbxproj
@@ -606,6 +606,8 @@
        2DF1FA4921252614007043AF /* InviteThreeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DF1FA4821252614007043AF /* InviteThreeCell.m */; };
        2DF1FA4C21255043007043AF /* InviteHederFourView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DF1FA4B21255043007043AF /* InviteHederFourView.m */; };
        2DF1FA4F212553E7007043AF /* InvitewFourCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DF1FA4E212553E7007043AF /* InvitewFourCell.m */; };
        2DF1FA5321255C7A007043AF /* MainInviteViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DF1FA5221255C7A007043AF /* MainInviteViewModel.m */; };
        2DF1FA5621256036007043AF /* MainInviteModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DF1FA5521256036007043AF /* MainInviteModel.m */; };
        2DF9C28F2123E40200BA5882 /* ALNetWorking.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DF9C28E2123E40200BA5882 /* ALNetWorking.m */; };
        AD52310E1F1B6A24007FCFA1 /* OrderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AD52310D1F1B6A24007FCFA1 /* OrderViewController.m */; };
/* End PBXBuildFile section */
@@ -1728,6 +1730,10 @@
        2DF1FA4B21255043007043AF /* InviteHederFourView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InviteHederFourView.m; sourceTree = "<group>"; };
        2DF1FA4D212553E7007043AF /* InvitewFourCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InvitewFourCell.h; sourceTree = "<group>"; };
        2DF1FA4E212553E7007043AF /* InvitewFourCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InvitewFourCell.m; sourceTree = "<group>"; };
        2DF1FA5121255C7A007043AF /* MainInviteViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainInviteViewModel.h; sourceTree = "<group>"; };
        2DF1FA5221255C7A007043AF /* MainInviteViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainInviteViewModel.m; sourceTree = "<group>"; };
        2DF1FA5421256036007043AF /* MainInviteModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainInviteModel.h; sourceTree = "<group>"; };
        2DF1FA5521256036007043AF /* MainInviteModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainInviteModel.m; sourceTree = "<group>"; };
        2DF9C28D2123E40200BA5882 /* ALNetWorking.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALNetWorking.h; sourceTree = "<group>"; };
        2DF9C28E2123E40200BA5882 /* ALNetWorking.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALNetWorking.m; sourceTree = "<group>"; };
        A10E40577F379E83D85926C6 /* Pods_MIduo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MIduo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2956,6 +2962,8 @@
        1845E052207A019C00EB1571 /* é‚€è¯· */ = {
            isa = PBXGroup;
            children = (
                2DF1FA5721256156007043AF /* Model */,
                2DF1FA5021255C4A007043AF /* ViewModel */,
                2DB8DA9E21241C660034CD7C /* InviteViewCell */,
                1845E053207A01D100EB1571 /* MainInviteViewController.h */,
                1845E054207A01D100EB1571 /* MainInviteViewController.m */,
@@ -4023,6 +4031,24 @@
            path = SGEasyButton;
            sourceTree = "<group>";
        };
        2DF1FA5021255C4A007043AF /* ViewModel */ = {
            isa = PBXGroup;
            children = (
                2DF1FA5121255C7A007043AF /* MainInviteViewModel.h */,
                2DF1FA5221255C7A007043AF /* MainInviteViewModel.m */,
            );
            path = ViewModel;
            sourceTree = "<group>";
        };
        2DF1FA5721256156007043AF /* Model */ = {
            isa = PBXGroup;
            children = (
                2DF1FA5421256036007043AF /* MainInviteModel.h */,
                2DF1FA5521256036007043AF /* MainInviteModel.m */,
            );
            path = Model;
            sourceTree = "<group>";
        };
        3EB2FCBC06FCFF59022C5ECD /* Frameworks */ = {
            isa = PBXGroup;
            children = (
@@ -4460,6 +4486,7 @@
                2D1E1F6420D248A800CEA8C6 /* SJNComponet.m in Sources */,
                1892034620BE51C6008C1045 /* LBXScanWrapper.m in Sources */,
                18F8C5271FCE6B8F005471A3 /* recommendViewController.m in Sources */,
                2DF1FA5621256036007043AF /* MainInviteModel.m in Sources */,
                18AC53741E5A959B006D1FDF /* MineViewController.m in Sources */,
                1810FBF61E7FBDBB005B42B3 /* ZYSideSlipFilterConfig.m in Sources */,
                188E95461E5C42BE00F0F895 /* MineHeaderTableViewCell.m in Sources */,
@@ -4690,6 +4717,7 @@
                2DF9C28F2123E40200BA5882 /* ALNetWorking.m in Sources */,
                2D37FC4920C0F75000E11051 /* ModifyAccountViewController.m in Sources */,
                181ECE241EF369BF00472224 /* ZJContentView.m in Sources */,
                2DF1FA5321255C7A007043AF /* MainInviteViewModel.m in Sources */,
                18AC53AB1E5ACE45006D1FDF /* HeaderCollectionReusableView.m in Sources */,
                1836507F206E19AA001D6651 /* IncarnateViewController.m in Sources */,
                18826A9D1F3C4C9C00A8E7B5 /* XWFilterAnimator.m in Sources */,
MIduo.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ
MIduo/½çÃæ/ÑûÇë/InviteViewCell/InviteOneCell.h
@@ -7,8 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "MainInviteModel.h"
@interface InviteOneCell : UITableViewCell
/// ç«‹å³é‚€è¯·æŒ‰é’®
@property (nonatomic, strong, nullable) UIButton *inviteButton;
@@ -21,4 +23,8 @@
/// æœ¬æœˆé¢„估按钮
@property (nonatomic, strong, nullable) UIButton *lastMothButton;
@property (nonatomic, copy, nullable) NSString *uid;
@property (nonatomic, strong) MainInviteModel *model;
@end
MIduo/½çÃæ/ÑûÇë/InviteViewCell/InviteOneCell.m
@@ -60,7 +60,7 @@
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
@@ -140,16 +140,26 @@
    .rightSpaceToView(self.estimateButton, 0)
    .heightIs(30);
    
    CGFloat descWidth = self.estimateButton.bounds.size.width - 29;
    CGFloat margain = -4;
    if (IS_IPHONE_5) {
        descWidth = self.estimateButton.bounds.size.width - 20;
        margain = -6;
    }
    [self.estimateButton addSubview:self.estimateDescLabel];
    self.estimateDescLabel.sd_layout
    .leftSpaceToView(self.estimateButton, 0)
    .topSpaceToView(self.estimateLabel, 5)
    .widthIs(self.estimateButton.bounds.size.width - 29)
    .widthIs(descWidth)
    .heightIs(20);
    [self.estimateButton addSubview:self.estimateImageView];
    self.estimateImageView.sd_layout
    .leftSpaceToView(self.estimateDescLabel, -4)
    .leftSpaceToView(self.estimateDescLabel, margain)
    .topSpaceToView(self.estimateLabel, 3.5)
    .widthIs(30)
    .heightIs(22);
@@ -180,12 +190,12 @@
    self.mothDescLabel.sd_layout
    .leftSpaceToView(self.mothButton, 0)
    .topSpaceToView(self.mothLabel, 5)
    .widthIs(self.mothButton.bounds.size.width - 29)
    .widthIs(descWidth)
    .heightIs(20);
    
    [self.mothButton addSubview:self.mothImageView];
    self.mothImageView.sd_layout
    .leftSpaceToView(self.mothDescLabel, -4)
    .leftSpaceToView(self.mothDescLabel, margain)
    .topSpaceToView(self.mothLabel, 3.5)
    .widthIs(30)
    .heightIs(22);
@@ -216,12 +226,12 @@
    self.lastMothDescLabel.sd_layout
    .leftSpaceToView(self.lastMothButton, 0)
    .topSpaceToView(self.lastMothLabel, 5)
    .widthIs(self.lastMothButton.bounds.size.width - 29)
    .widthIs(descWidth)
    .heightIs(20);
    
    [self.lastMothButton addSubview:self.lastMothImageView];
    self.lastMothImageView.sd_layout
    .leftSpaceToView(self.lastMothDescLabel, -4)
    .leftSpaceToView(self.lastMothDescLabel, margain)
    .topSpaceToView(self.lastMothLabel, 3.5)
    .widthIs(30)
    .heightIs(22);
@@ -233,6 +243,28 @@
    .rightSpaceToView(self.contentView, 60)
    .bottomSpaceToView(self.teamView, 15)
    .heightIs(buttonHeight);
}
#pragma mark --- setter ---
- (void)setModel:(MainInviteModel *)model {
    if (model) {
        if (self.uid) {
            self.teamNumberLabel.text = model.myTeam;
            self.estimateLabel.text = model.moneyToday;
            self.mothLabel.text = model.moneyMonth;
            self.lastMothLabel.text = model.moneyLastMonth;
        } else {
            self.teamNumberLabel.text = @"---";
            self.estimateLabel.text = @"---";
            self.mothLabel.text = @"---";
            self.lastMothLabel.text = @"---";
        }
    }
}
#pragma mark --- getter ---
@@ -260,12 +292,12 @@
}
- (UIView *)teamView {
    if (!_teamView) {
    _teamView = [[UIView alloc] init];
    _teamView.backgroundColor = [UIColor whiteColor];
    _teamView.layer.cornerRadius = 8;
    _teamView.layer.masksToBounds = YES;
        _teamView = [[UIView alloc] init];
        _teamView.backgroundColor = [UIColor whiteColor];
        _teamView.layer.cornerRadius = 8;
        _teamView.layer.masksToBounds = YES;
    }
    return _teamView;
}
@@ -318,6 +350,7 @@
    
    if (!_estimateButton) {
        _estimateButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _estimateButton.tag = 35;
    }
    return _estimateButton;
}
@@ -369,6 +402,7 @@
    
    if (!_mothButton) {
        _mothButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _mothButton.tag = 36;
    }
    return _mothButton;
}
@@ -420,6 +454,7 @@
    
    if (!_lastMothButton) {
        _lastMothButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _lastMothButton.tag = 37;
    }
    return _lastMothButton;
}
MIduo/½çÃæ/ÑûÇë/InviteViewCell/InviteThreeCell.h
@@ -7,7 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "MainInviteModel.h"
@interface InviteThreeCell : UITableViewCell
@property (nonatomic, strong) MainInviteModel *model;
@end
MIduo/½çÃæ/ÑûÇë/InviteViewCell/InviteThreeCell.m
@@ -8,6 +8,7 @@
#import "InviteThreeCell.h"
@interface InviteThreeCell ()
@property (nonatomic, strong, nullable) NSArray *gradArr;
@@ -82,74 +83,90 @@
    .rightSpaceToView(self.bgImgView, 20)
    .topSpaceToView(self.bonusListLabel, 20)
    .heightIs(320 - 90);
}
#pragma mark --- setter --
- (void)setModel:(MainInviteModel *)model {
    
    NSLog(@"self.bgView:%f",self.bgView.bounds.size.height);
    for (int i = 0; i < 5; i++) {
    if (model) {
        
        self.articleView = [[UIView alloc] init];
        self.articleView.layer.masksToBounds = YES;
        self.articleView.layer.cornerRadius = 5;
        self.articleView.backgroundColor = i % 2 ? SJColor(255, 211, 221, 1) : SJColor(255, 251, 207, 1);
        [self.bgView addSubview:self.articleView];
        for (UIView *view in [self.bgView subviews]) {
            [view removeFromSuperview];
        }
        
        self.articleView.sd_layout
        .leftSpaceToView(self.bgView, 0)
        .rightSpaceToView(self.bgView, 0)
        .topSpaceToView(self.bgView, i * ((self.bgView.size.height - 32) / 5) + i * 8)
        .heightIs((self.bgView.size.height - 32) / 5);
        NSInteger indexCount = model.inviteGetMoneyList.count;
        
        self.logoImageView = [[UIImageView alloc] init];
        self.logoImageView.image = [UIImage imageNamed:self.gradArr[i]];
        [self.articleView addSubview:self.logoImageView];
        if (indexCount > 5) {
            indexCount = 5;
        }
        
        self.logoImageView.sd_layout
        .leftSpaceToView(self.articleView, 15)
        .centerYEqualToView(self.articleView)
        .widthIs(23)
        .heightIs(20);
        self.headerImageView = [[UIImageView alloc] init];
        self.headerImageView.backgroundColor = [UIColor redColor];
        self.headerImageView.layer.masksToBounds = YES;
        self.headerImageView.layer.cornerRadius = ((self.bgView.size.height - 32) / 5 - 10) / 2;
        [self.articleView addSubview:self.headerImageView];
        self.headerImageView.sd_layout
        .leftSpaceToView(self.logoImageView, 15)
        .centerYEqualToView(self.articleView)
        .widthIs((self.bgView.size.height - 32) / 5 - 10)
        .heightIs((self.bgView.size.height - 32) / 5 - 10);
        self.nickNamelabel = [[UILabel alloc] init];
        self.nickNamelabel.text = @"测试";
        self.nickNamelabel.textColor = [UIColor blackColor];
        self.nickNamelabel.font = [UIFont systemFontOfSize:15];
        self.nickNamelabel.textAlignment = NSTextAlignmentLeft;
         [self.articleView addSubview:self.nickNamelabel];
        self.nickNamelabel.sd_layout
        .leftSpaceToView(self.headerImageView, 10)
        .centerYEqualToView(self.articleView)
        .heightIs(20)
        .autoWidthRatio(0);
        [self.nickNamelabel setSingleLineAutoResizeWithMaxWidth:120];
        self.bonusPricelabel = [[UILabel alloc] init];
        self.bonusPricelabel.text = @"Â¥9993.90";
        self.bonusPricelabel.textColor = SJColor(229, 0, 92, 1.0);
        self.bonusPricelabel.font = [UIFont systemFontOfSize:16];
        self.bonusPricelabel.textAlignment = NSTextAlignmentRight;
        [self.articleView addSubview:self.bonusPricelabel];
        self.bonusPricelabel.sd_layout
        .rightSpaceToView(self.articleView, 10)
        .centerYEqualToView(self.articleView)
        .heightIs(20)
        .autoWidthRatio(0);
        [self.bonusPricelabel setSingleLineAutoResizeWithMaxWidth:120];
        for (int i = 0; i < indexCount; i++) {
            self.articleView = [[UIView alloc] init];
            self.articleView.layer.masksToBounds = YES;
            self.articleView.layer.cornerRadius = 5;
            self.articleView.backgroundColor = i % 2 ? SJColor(255, 211, 221, 1) : SJColor(255, 251, 207, 1);
            [self.bgView addSubview:self.articleView];
            self.articleView.sd_layout
            .leftSpaceToView(self.bgView, 0)
            .rightSpaceToView(self.bgView, 0)
            .topSpaceToView(self.bgView, i * ((self.bgView.size.height - 32) / 5) + i * 8)
            .heightIs((self.bgView.size.height - 32) / 5);
            self.logoImageView = [[UIImageView alloc] init];
            self.logoImageView.image = [UIImage imageNamed:self.gradArr[i]];
            [self.articleView addSubview:self.logoImageView];
            self.logoImageView.sd_layout
            .leftSpaceToView(self.articleView, 15)
            .centerYEqualToView(self.articleView)
            .widthIs(23)
            .heightIs(20);
            self.headerImageView = [[UIImageView alloc] init];
            [self.headerImageView setYthImageWithURL:((InviteGetMoneyListModel *)(model.inviteGetMoneyList[i])).portrait placeholderImage:[UIImage imageNamed:@"默认头像"]];
            self.headerImageView.layer.masksToBounds = YES;
            self.headerImageView.layer.cornerRadius = ((self.bgView.size.height - 32) / 5 - 10) / 2;
            [self.articleView addSubview:self.headerImageView];
            self.headerImageView.sd_layout
            .leftSpaceToView(self.logoImageView, 15)
            .centerYEqualToView(self.articleView)
            .widthIs((self.bgView.size.height - 32) / 5 - 10)
            .heightIs((self.bgView.size.height - 32) / 5 - 10);
            self.nickNamelabel = [[UILabel alloc] init];
            self.nickNamelabel.text = ((InviteGetMoneyListModel *)(model.inviteGetMoneyList[i])).name;
            self.nickNamelabel.textColor = [UIColor blackColor];
            self.nickNamelabel.font = [UIFont systemFontOfSize:15];
            self.nickNamelabel.textAlignment = NSTextAlignmentLeft;
            [self.articleView addSubview:self.nickNamelabel];
            self.nickNamelabel.sd_layout
            .leftSpaceToView(self.headerImageView, 10)
            .centerYEqualToView(self.articleView)
            .heightIs(20)
            .autoWidthRatio(0);
            [self.nickNamelabel setSingleLineAutoResizeWithMaxWidth:120];
            self.bonusPricelabel = [[UILabel alloc] init];
            self.bonusPricelabel.text = [NSString stringWithFormat:@"Â¥%@",((InviteGetMoneyListModel *)(model.inviteGetMoneyList[i])).money];
            self.bonusPricelabel.textColor = SJColor(229, 0, 92, 1.0);
            self.bonusPricelabel.font = [UIFont systemFontOfSize:16];
            self.bonusPricelabel.textAlignment = NSTextAlignmentRight;
            [self.articleView addSubview:self.bonusPricelabel];
            self.bonusPricelabel.sd_layout
            .rightSpaceToView(self.articleView, 10)
            .centerYEqualToView(self.articleView)
            .heightIs(20)
            .autoWidthRatio(0);
            [self.bonusPricelabel setSingleLineAutoResizeWithMaxWidth:120];
        }
    }
}
MIduo/½çÃæ/ÑûÇë/InviteViewCell/InvitewFourCell.h
@@ -7,7 +7,13 @@
//
#import <UIKit/UIKit.h>
#import "MainInviteModel.h"
@interface InvitewFourCell : UITableViewCell
@property (nonatomic, strong) MainInviteModel *model;
@property (nonatomic, copy) NSAttributedString *remainNumStr;
@end
MIduo/½çÃæ/ÑûÇë/InviteViewCell/InvitewFourCell.m
@@ -23,7 +23,7 @@
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
@@ -34,7 +34,7 @@
    
    if ( self ) {
        
        self.backgroundColor = [UIColor redColor];
        self.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self cellConfig];
@@ -56,12 +56,21 @@
    
    if (!_titlesLabel) {
        _titlesLabel = [[UILabel alloc] init];
        _titlesLabel.text = @"测试测试";
        _titlesLabel.textAlignment = NSTextAlignmentLeft;
        _titlesLabel.font = [UIFont boldSystemFontOfSize:13];
        _titlesLabel.font = [UIFont boldSystemFontOfSize:14];
        _titlesLabel.textColor = SJColor(136, 136, 136, 1.0);
    }
    return _titlesLabel;
}
- (void)setModel:(MainInviteModel *)model {
    if (model) {
        self.titlesLabel.attributedText = model.activityRulesAttributed;
        [self setupAutoHeightWithBottomView:self.titlesLabel bottomMargin:0];
    }
}
@end
MIduo/½çÃæ/ÑûÇë/MainInviteViewController.h
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
@interface MainInviteViewController : UIViewController
@interface MainInviteViewController : SJBaseViewController
@property (nonatomic)BOOL isMine;
MIduo/½çÃæ/ÑûÇë/MainInviteViewController.m
@@ -7,8 +7,6 @@
//
#import "MainInviteViewController.h"
#import "MainInviteTableViewCell.h"
#import "InvateListTableViewCell.h"
#import "UIImageView+YTH.h"
#import "ShonpingShareViewController.h"
#import "XYRWebViewController.h"
@@ -20,37 +18,30 @@
#import "InviteThreeCell.h"
#import "InvitewFourCell.h"
#import "InviteHederFourView.h"
// viewModel
#import "MainInviteViewModel.h"
#define LfteLength 10
@interface MainInviteViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
//@property (nonatomic, strong) UIScrollView *scrollview;
//@property (nonatomic, strong) UIImageView *headImageView;
//@property (nonatomic, strong) UIView *teamView;
//@property (nonatomic, strong) UILabel *teamNumber;
//@property (nonatomic, strong) UILabel *estimateLabel;
//@property (nonatomic, strong) UILabel *mothLabel;
//@property (nonatomic, strong) UILabel *lastMonLabel;
//@property (nonatomic, strong) UIView *taskView;
//@property (nonatomic, strong) UITableView *taskTableview;
//@property (nonatomic, strong) UIView *percentageView;
//@property (nonatomic, strong) UIView *listView;
//@property (nonatomic, strong) UITableView *listTableview;
//@property (nonatomic, strong) UIView *ruleView;
//@property (nonatomic, strong) UILabel *ruleLabel;
//@property (nonatomic, strong) NSArray *inviteGetMoneyList;
//@property (nonatomic, strong) NSArray *everyDayTaskList;
//@property (nonatomic, strong) NSArray *gradeArr;
//@property (nonatomic, strong) UIView *loginView;
//
//@property (nonatomic, strong) UIView *primtView;
//@property (nonatomic, strong) UILabel *primtTitle;
//@property (nonatomic, strong) UILabel *primtContent;
//@property (nonatomic, strong) UIWindow *primtWindow;
//@property (nonatomic, strong) NSString *inviteListString;
//@property (nonatomic, strong) NSString *number;
@property (nonatomic, strong, nullable) UITableView *tableView;
/// viewModel
@property (nonatomic, strong, nullable) MainInviteViewModel *viewModel;
/// uid
@property (nonatomic, copy, nullable) NSString *uid;
/// é¡µæ•°
@property (nonatomic, assign) NSInteger pageIndex;
@property (nonatomic, strong) MainInviteModel *model;
@property (nonatomic, strong) NSAttributedString *attributedString;
@property (nonatomic, strong) UIView *primtView;
@property (nonatomic, strong) UILabel *primtTitle;
@property (nonatomic, strong) UILabel *primtContent;
@property (nonatomic, strong) UIWindow *primtWindow;
@end
@@ -59,287 +50,145 @@
- (void)viewDidLoad {
    [super viewDidLoad];
    
    //    self.gradeArr = @[@"g1",@"g2",@"g3",@"g4",@"g5"];
    //    [self.view addSubview:self.scrollview];
    //    [self.view addSubview:self.loginView];
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationController.title = @"邀请有奖";
    self.view.backgroundColor = XYRBackgroundColor;
    self.pageIndex = 1;
    [self bindViewModel];
    [self.view addSubview:self.tableView];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"邀请有奖"];
    self.uid = [[NSUserDefaults standardUserDefaults] objectForKey:@"userId"];
    
    if (!self.isMine) {
        
        [self.navigationController setNavigationBarHidden:YES animated:animated];
        
    } else {
        self.title = @"邀请有奖";
        //self.title = @"邀请有奖";
        [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
    }
    
    //[self getdatasource];
    [self.viewModel.requestRemotetCommand execute:nil];
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"邀请有奖"];
    
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}
//// headImage点击事件
//- (void)headImageTaped:(UITapGestureRecognizer *)tap {
//
//    if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) {
//
//        LoginViewController *loginVc = [[LoginViewController alloc] init];
//
//        loginVc.hidesBottomBarWhenPushed = YES;
//        loginVc.rootVc = self;
//
//        [self.navigationController pushViewController:loginVc animated:YES];
//
//    } else {
//
//        InvitationFriendsViewController *invitaVC = [[InvitationFriendsViewController alloc]init];
//        invitaVC.hidesBottomBarWhenPushed=YES;
//        [self.navigationController pushViewController:invitaVC animated:YES];
//    }
//}
//
//- (void)loginTaped:(UIButton *)sender {
//    //登录界面
//    LoginViewController *loginVc = [[LoginViewController alloc] init];
//
//    loginVc.hidesBottomBarWhenPushed=YES;
//    loginVc.rootVc = self;
//
//    [self.navigationController pushViewController:loginVc animated:YES];
//}
//
//- (void)shareShopTaped:(UIButton *)sender {
//
//    if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) {
//
//        LoginViewController *loginVc=[[LoginViewController alloc] init];
//
//        loginVc.hidesBottomBarWhenPushed = YES;
//        loginVc.rootVc = self;
//
//        [self.navigationController pushViewController:loginVc animated:YES];
//
//    } else {
//
//        NSInteger tag = sender.tag - 722;
//        [self geturlwithID:self.everyDayTaskList[tag][@"etGoods"][@"auctionId"]];
//    }
//}
//
//- (void)numTaped:(UIButton *)sender {
//
//    ShonpingShareViewController *SureWebVC=[[ShonpingShareViewController alloc] init];
//    SureWebVC.urlString=self.inviteListString;
//
//    SureWebVC.hidesBottomBarWhenPushed=YES;
//    [self.navigationController pushViewController:SureWebVC animated:YES];
//}
//
//- (void)geturlwithID:(NSString *)shopid {
//
//    NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
//
//    [dic setObject:shopid forKey:@"id"];
//
//    NSLog(@"%@",[NSString stringWithFormat:@"%@/%@",domainHTTP,@"share/getGoodsShareUrl"]);
//
//    [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"share/getGoodsShareUrl"]
//                 param:dic
//               success:^(NSDictionary *object) {
//
//        ShonpingShareViewController *shopVC = [[ShonpingShareViewController alloc]init];
//        shopVC.urlString = object[@"data"];
//        shopVC.hidesBottomBarWhenPushed=YES;
//        [self.navigationController pushViewController:shopVC animated:YES];
//
//    } fail:^(id object) {
//        NSLog(@"%@",object);
//    }];
//}
//- (void)getdatasource {
//
//    NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
//
//    [dic setObject:@"1" forKey:@"pageIndex"];
//
//    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] != nil) {
//        [dic setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] forKey:@"uid"];
//
//    } else {
//
//        [dic setObject:@"" forKey:@"uid"];
//    }
//
//    [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"invite/inviteGetMoney"] param:dic success:^(NSDictionary *object) {
//
//        [self->_scrollview.mj_header endRefreshing];
//
//        NSDictionary *dic = object[@"data"];
//
//        self.inviteListString = dic[@"inviteList"];
//        self.everyDayTaskList = dic[@"everyDayTaskList"];
//        self.inviteGetMoneyList = dic[@"inviteGetMoneyList"];
//
//        self.taskView.frame = CGRectMake(0, CGRectGetMaxY(self.percentageView.frame) + 10, KScreenW, self.everyDayTaskList.count * 120 + 60);
//        self.taskTableview.frame = CGRectMake(0, 0, KScreenW,self->_taskView.frame.size.height  );
//        self.listView.frame = CGRectMake(0, CGRectGetMaxY(self.taskView.frame) + 10, KScreenW, self.inviteGetMoneyList.count * 50 + 60);
//        self.listTableview.frame = CGRectMake(0, 0, self->_listView.frame.size.width, self->_listView.frame.size.height );
//
//        NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[dic[@"activityRules"] dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
//
//        NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithAttributedString:attrStr];
//
//        [str addAttribute:NSForegroundColorAttributeName value:SJColor(136, 136, 136, 1) range:NSMakeRange(0,str.length)];
//        [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize :14] range:NSMakeRange(0, str.length)];
//
//        self.ruleLabel.attributedText = str;
//
//        if ([[NSString stringWithFormat:@"%@",dic[@"myTeam"]] isKindOfClass:[NSNull class]]) {
//            self.teamNumber.text = @"0";
//        }else{
//            self.teamNumber.text = [NSString stringWithFormat:@"%@",dic[@"myTeam"]];
//            self.number = self.teamNumber.text;
//        }
//
//        if (!dic[@"moneyToday"]) {
//            self.estimateLabel.text = @"0";
//        }else{
//            self.estimateLabel.text = [NSString stringWithFormat:@"%@",dic[@"moneyToday"]];
//        }
//
//        if (!dic[@"moneyMonth"]) {
//            self.mothLabel.text = @"0";
//        }else{
//            self.mothLabel.text = [NSString stringWithFormat:@"%@",dic[@"moneyMonth"]];
//        }
//        if (!dic[@"moneyLastMonth"]) {
//            self.lastMonLabel.text = @"0";
//        }else{
//            self.lastMonLabel.text = [NSString stringWithFormat:@"%@",dic[@"moneyLastMonth"]];
//        }
//        [self.ruleLabel sizeToFit];
//
//        CGSize size = [self sizeWithFont:[UIFont systemFontOfSize:14] maxSize:CGSizeMake(KScreenW - 40, 2000) string:self.ruleLabel.text];
//
//        self.ruleView.frame = CGRectMake(0, CGRectGetMaxY(self.listView.frame) + 10, KScreenW, size.height + 80);
//
//        self->_scrollview.contentSize = CGSizeMake(KScreenW, self.headImageView.frame.size.height +  self.teamView.frame.size.height + self.taskView.frame.size.height + self.percentageView.frame.size.height + self.listView.frame.size.height + self.ruleView.frame.size.height + 100);
//
//        [self.taskTableview reloadData];
//        [self.listTableview reloadData];
//
//        if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) {
//            self.teamNumber.text = @"---";
//            self.estimateLabel.text = @"---";
//            self.mothLabel.text = @"---";
//            self.lastMonLabel.text = @"---";
//        }
//
//    } fail:^(id object) {
//
//        [self->_scrollview.mj_header endRefreshing];
//    }];
//}
//- (void)priTaped:(UIButton *)sender{
//
//    if (![[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]) {
//
//        return;
//    }
//
//    _primtWindow = [[UIWindow alloc]init];
//
//    _primtWindow.backgroundColor = [UIColor colorWithWhite:0.2 alpha:0.7];
//    _primtWindow.windowLevel = UIWindowLevelAlert - 1;
//    _primtWindow.hidden = NO;
//
//    [_primtWindow addSubview:self.primtView];
//
//    if (sender.tag == 35) {
//
//        self.primtTitle.text = @"今日预估收益";
//        self.primtContent.text = @"今日新增的所有订单预估收益";
//
//    } else if(sender.tag == 36) {
//
//        self.primtTitle.text = @"本月预估收益";
//        self.primtContent.text = @"本月内产生的所有订单预估收益,会在订单确认收货后的次月25日后转入你的余额,以实际转入余额为准";
//
//    } else {
//
//        self.primtTitle.text = @"上月预估收入";
//        self.primtContent.text = @"上个月内确认收货的订单收入,每月25日结算后,将自动转入你的余额";
//    }
//}
//
//- (void)primtTaped:(UIButton *)sender {
//
//    _primtWindow.hidden = YES;
//    _primtWindow = nil;
//}
////计算文字高度
//- (CGFloat)getHeightLineWithString:(NSString *)string withWidth:(CGFloat)width withFont:(UIFont *)font {
//
//    //1.1最大允许绘制的文本范围
//    CGSize size = CGSizeMake(width, 2000);
//    //1.2配置计算时的行截取方法,和contentLabel对应
//    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
//    [style setLineSpacing:10];
//    //1.3配置计算时的字体的大小
//    //1.4配置属性字典
//    NSDictionary *dic = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:style};
//    //2.计算
//    //如果想保留多个枚举值,则枚举值中间加按位或|即可,并不是所有的枚举类型都可以按位或,只有枚举值的赋值中有左移运算符时才可以
//    CGFloat height = [string boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dic context:nil].size.height;
//
//    return height;
//}
//
//-(CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize string:(NSString *)string {
//
//    NSDictionary *attrs = @{NSFontAttributeName:font};
//
//    return [string boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
//}
//
////设置view某一遍的边框
//- (void)setBorderWithView:(UIView *)view top:(BOOL)top left:(BOOL)left bottom:(BOOL)bottom right:(BOOL)right borderColor:(UIColor *)color borderWidth:(CGFloat)width {
//
//    if (top) {
//        CALayer *layer = [CALayer layer];
//        layer.frame = CGRectMake(0, 0, view.frame.size.width, width);
//        layer.backgroundColor = color.CGColor;
//        [view.layer addSublayer:layer];
//    }
//    if (left) {
//        CALayer *layer = [CALayer layer];
//        layer.frame = CGRectMake(0, 0, width, view.frame.size.height);
//        layer.backgroundColor = color.CGColor;
//        [view.layer addSublayer:layer];
//    }
//    if (bottom) {
//        CALayer *layer = [CALayer layer];
//        layer.frame = CGRectMake(0, view.frame.size.height - width, view.frame.size.width, width);
//        layer.backgroundColor = color.CGColor;
//        [view.layer addSublayer:layer];
//    }
//    if (right) {
//        CALayer *layer = [CALayer layer];
//        layer.frame = CGRectMake(view.frame.size.width - width, 0, width, view.frame.size.height);
//        layer.backgroundColor = color.CGColor;
//        [view.layer addSublayer:layer];
//    }
//}
//
- (void)bindViewModel {
    RAC(self.viewModel, uid) = RACObserve(self, uid);
    RAC(self.viewModel, pageIndex) = RACObserve(self, pageIndex);
    @weakify(self)
    [self.viewModel.requestRemotetCommand.executionSignals.switchToLatest
     subscribeNext:^(RACSignal *signal) {
         @strongify(self)
         [signal subscribeNext:^(MainInviteModel *mainInviteModel) {
             dispatch_async(dispatch_get_main_queue(), ^{
                 [self.tableView.mj_header endRefreshing];
                 self.model = mainInviteModel;
                 self.model.activityRulesAttributed = [self stringWithAttributedString:mainInviteModel.activityRules];
                 [self.tableView reloadData];
             });
         } error:^(NSError *error) {
         }];
     }];
}
- (NSAttributedString *)stringWithAttributedString:(NSString *)str {
    NSMutableAttributedString * attrString = [[NSMutableAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
    //设置基线偏移值,取值为 NSNumber ï¼ˆfloat),正值上偏,负值下偏,可使UILabel文本垂直居中
    [attrString addAttributes:@{NSBaselineOffsetAttributeName:@(5), NSFontAttributeName:[UIFont systemFontOfSize:14]} range:NSMakeRange(0, attrString.length)];
    return attrString;
}
- (void)onInviteEvent:(UIButton *)button {
    if (!([[NSUserDefaults standardUserDefaults] objectForKey:@"userId"])) {
        LoginViewController *loginVc = [[LoginViewController alloc] init];
        loginVc.hidesBottomBarWhenPushed = YES;
        loginVc.rootVc = self;
        [self.navigationController pushViewController:loginVc animated:YES];
    } else {
        InvitationFriendsViewController *invitaVC = [[InvitationFriendsViewController alloc]init];
        invitaVC.hidesBottomBarWhenPushed=YES;
        [self.navigationController pushViewController:invitaVC animated:YES];
    }
}
- (void)priTaped:(UIButton *)sender{
    if (![[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]) {
        return;
    }
    _primtWindow = [[UIWindow alloc] init];
    _primtWindow.backgroundColor = [UIColor colorWithWhite:0.2 alpha:0.7];
    _primtWindow.windowLevel = UIWindowLevelAlert - 1;
    _primtWindow.hidden = NO;
    [_primtWindow addSubview:self.primtView];
    if (sender.tag == 35) {
        self.primtTitle.text = @"今日预估收益";
        self.primtContent.text = @"今日新增的所有订单预估收益";
    } else if(sender.tag == 36) {
        self.primtTitle.text = @"本月预估收益";
        self.primtContent.text = @"本月内产生的所有订单预估收益,会在订单确认收货后的次月25日后转入你的余额,以实际转入余额为准";
    } else {
        self.primtTitle.text = @"上月预估收入";
        self.primtContent.text = @"上个月内确认收货的订单收入,每月25日结算后,将自动转入你的余额";
    }
}
- (void)primtTaped:(UIButton *)sender {
    _primtWindow.hidden = YES;
    _primtWindow = nil;
}
- (void)onRefreshData {
    NSIndexSet *reloadSet = [NSIndexSet indexSetWithIndex:3];
    [self.tableView reloadSections:reloadSet withRowAnimation:UITableViewRowAnimationNone];
}
#pragma mark - UITableViewDataSource,UITableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
@@ -363,6 +212,36 @@
            cell = [[InviteOneCell alloc] initWithStyle:UITableViewCellStyleDefault
                                        reuseIdentifier:cellIden];
        }
        cell.uid = [[NSUserDefaults standardUserDefaults] objectForKey:@"userId"];
        cell.model = self.model;
        // æˆ‘的队员
        @weakify(self)
        [[cell.teamButton rac_signalForControlEvents:UIControlEventTouchUpInside]
         subscribeNext:^(UIButton *button) {
             @strongify(self)
             ShonpingShareViewController *sureWebVC = [[ShonpingShareViewController alloc] init];
             sureWebVC.urlString = self.model.inviteList;
             sureWebVC.hidesBottomBarWhenPushed = YES;
             [self.navigationController pushViewController:sureWebVC animated:YES];
         }];
        [cell.estimateButton addTarget:self
                                action:@selector(priTaped:)
                      forControlEvents:UIControlEventTouchUpInside];
        [cell.mothButton addTarget:self
                            action:@selector(priTaped:)
                  forControlEvents:UIControlEventTouchUpInside];
        [cell.lastMothButton addTarget:self
                                action:@selector(priTaped:)
                      forControlEvents:UIControlEventTouchUpInside];
        [cell.inviteButton addTarget:self
                              action:@selector(onInviteEvent:)
                    forControlEvents:UIControlEventTouchUpInside];
        
        return cell;
        
@@ -389,6 +268,7 @@
            cell = [[InviteThreeCell alloc] initWithStyle:UITableViewCellStyleDefault
                                          reuseIdentifier:cellIden];
        }
        cell.model = self.model;
        
        return cell;
        
@@ -402,6 +282,9 @@
            cell = [[InvitewFourCell alloc] initWithStyle:UITableViewCellStyleDefault
                                          reuseIdentifier:cellIden];
        }
        cell.model = self.model;
        cell.remainNumStr = self.attributedString;
        
        return cell;
    }
@@ -409,12 +292,6 @@
// è¡¨æ ¼é«˜åº¦
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    //    return [self.tableView cellHeightForIndexPath:indexPath
    //                                            model:self.listArrs[indexPath.section]
    //                                          keyPath:@"model"
    //                                        cellClass:[AddrssMangeCell class]
    //                                 contentViewWidth:SCREEN_WIDTH];
    
    if (indexPath.section == 0) {
        
@@ -430,7 +307,11 @@
        
    } else {
        
        return 50;
        return [self.tableView cellHeightForIndexPath:indexPath
                                                model:self.model
                                              keyPath:@"model"
                                            cellClass:[InvitewFourCell class]
                                     contentViewWidth:SCREEN_WIDTH];
    }
    
}
@@ -472,332 +353,6 @@
    }
}
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//    if (tableView == self.taskTableview) {
//
//        NSString *identifier = @"MainInviteTableViewCell";
//        MainInviteTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
//
//        if (!cell) {
//            cell = [[MainInviteTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
//        }
//        cell.selectionStyle = UITableViewCellSelectionStyleNone;
//        cell.buttonView.layer.cornerRadius = cell.buttonView.frame.size.height / 2;
//        cell.buttonView.layer.masksToBounds = YES;
//        NSDictionary *dic = self.everyDayTaskList[indexPath.row];
//        [cell.imageview setYthImageWithURL:dic[@"etGoods"][@"pictUrl"] placeholderImage:[UIImage imageNamed:@"商品默认图片"]];
//
//        cell.nameLabel.text = [NSString stringWithFormat:@"%@",dic[@"etGoods"][@"title"]];
//        cell.saleNumberLabel.text = [NSString stringWithFormat:@"月销量:%@",dic[@"etGoods"][@"salesCount"]];
//        cell.makeMoneyLabel.text = [NSString stringWithFormat:@"%@",dic[@"getMoney"]];
//        cell.shareButton.tag = 722 + indexPath.row;
//        [cell.shareButton addTarget:self action:@selector(shareShopTaped:) forControlEvents:UIControlEventTouchUpInside];
//        cell.priceLabel.text = [NSString stringWithFormat:@"券后价:%@",dic[@"quanhoujia"]];
//        NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:cell.priceLabel.text];
//        [str addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(4,cell.priceLabel.text.length - 4)];
//
//        if (KScreenW <375) {
//            cell.makeMoneyLabel.font = [UIFont systemFontOfSize:12];
//            cell.saleNumberLabel.font = [UIFont systemFontOfSize:12];
//            [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0,cell.priceLabel.text.length )];
//        }
//        cell.priceLabel.attributedText = str;
//
//        return cell;
//
//    } else {
//
//        NSString *identifier = @"InvateListTableViewCell";
//
//        InvateListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
//
//        if (!cell) {
//            cell = [[InvateListTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
//        }
//
//        cell.selectionStyle = UITableViewCellSelectionStyleNone;
//        cell.backView.layer.cornerRadius = 5;
//        cell.backView.layer.masksToBounds = YES;
//        cell.backView.backgroundColor = indexPath.row % 2 ? SJColor(255, 225, 238, 1) : SJColor(255, 254, 227, 1);
//        cell.headImage.layer.cornerRadius = cell.headImage.frame.size.height / 2;
//        cell.headImage.layer.masksToBounds = YES;
//
//        NSDictionary *dic = self.inviteGetMoneyList[indexPath.row];
//        cell.nameLabel.text = dic[@"name"];
//        cell.gradeImage.image = [UIImage imageNamed:@"g1"];
//        [cell.gradeImage setYthImageWithURL:dic[@"icon"] placeholderImage:[UIImage imageNamed:self.gradeArr[indexPath.row % 5]]];
//        [cell.headImage setYthImageWithURL:dic[@"portrait"] placeholderImage:[UIImage imageNamed:@"默认头像"]];
//        cell.moneyLabel.text = [NSString stringWithFormat:@"Â¥%.2f",[dic[@"money"]doubleValue]];
//        cell.userInteractionEnabled = NO;
//        return cell;
//    }
//}
//
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
//
//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 40)];
//    label.text = @"每日任务";
//    if (tableView == self.listTableview) {
//        label.text = @"邀请奖金榜";
//    }
//    label.textAlignment = NSTextAlignmentCenter;
//    label.font = [UIFont boldSystemFontOfSize:20];
//    label.textColor = XYRMainColor;
//    [self setBorderWithView:label top:NO left:NO bottom:YES right:NO borderColor:XYRBackgroundColor borderWidth:1];
//
//    return label;
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
//    return 40;
//}
//
//- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//
//    NSDictionary *tempItem = [self.everyDayTaskList[indexPath.row] objectForKey:@"etGoods"];
//
//    if ([YTHsharedManger startManger].isDetailWebValue) {
//        SureWebViewController *webView=[[SureWebViewController alloc] init];
//        [webView backClicked:^(NSString *string) {
//
//        }];
//        webView.goodsId=[tempItem objectForKey:@"auctionId"];
//        webView.canDownRefresh=YES;
//        webView.isGoodsDetail = YES;
//        webView.hidesBottomBarWhenPushed = YES;
//        [self.navigationController pushViewController:webView animated:YES];
//        return;
//    }
//
//    GoodDeTrViewController *goodsDetailVC = [[GoodDeTrViewController alloc]init];
//    goodsDetailVC.hidesBottomBarWhenPushed = YES;
//    goodsDetailVC.goodsID = [tempItem objectForKey:@"auctionId"];
//    [self .navigationController pushViewController:goodsDetailVC animated:YES];
//}
//
//
//#pragma mark - getter
//- (UIScrollView *)scrollview{
//
//    if (_scrollview) {
//
//        return _scrollview ;
//    }
//    NSInteger height = -20;
//
//    if (IsiPhoneX) {
//
//        height = -44;
//    }
//    _scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, height, KScreenW, KScreenH)];
//    _scrollview.pagingEnabled = NO;
//    _scrollview.showsHorizontalScrollIndicator = NO;
//    _scrollview.backgroundColor = XYRBackgroundColor;
//    [_scrollview addSubview:self.headImageView];
//    [_scrollview addSubview:self.teamView];
//    [_scrollview addSubview:self.percentageView];
//    [_scrollview addSubview:self.taskView];
//    [_scrollview addSubview:self.listView];
//    [_scrollview addSubview:self.ruleView];
//    _scrollview.contentSize = CGSizeMake(KScreenW, self.headImageView.frame.size.height +  self.teamView.frame.size.height + self.taskView.frame.size.height + self.percentageView.frame.size.height + self.listView.frame.size.height + self.ruleView.frame.size.height + 120);
//    _scrollview.mj_header =[MJRefreshNormalHeader headerWithRefreshingBlock:^{
//        [self getdatasource];
//    }];
//    return _scrollview;
//}
//
//- (UIImageView *)headImageView {
//
//    if (_headImageView) {
//        return _headImageView;
//    }
//    _headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 220)];
//
//    _headImageView.image = [UIImage imageNamed: @"banner"];
//    _headImageView.userInteractionEnabled = YES;
//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(headImageTaped:)];
//    [_headImageView addGestureRecognizer:tap];
//
//    return _headImageView;
//}
//- (UIView *)teamView {
//
//    if (_teamView) {
//        return _teamView;
//    }
//
//    UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_headImageView.frame), KScreenW , 90)];
//    backView.backgroundColor = SJColor(250, 222, 50, 1);
//    [_scrollview addSubview:backView];
//
//    _teamView = [[UIView alloc]initWithFrame:CGRectMake(LfteLength, CGRectGetMaxY(_headImageView.frame) + 10, KScreenW - LfteLength * 2, 80)];
//    _teamView.backgroundColor = [UIColor whiteColor];
//    _teamView.layer.cornerRadius = 8;
//    _teamView.layer.masksToBounds = YES;
//    [_teamView addSubview:self.teamNumber];
//    [_teamView addSubview:self.estimateLabel];
//    [_teamView addSubview:self.mothLabel];
//    [_teamView addSubview:self.lastMonLabel];
//    return _teamView;
//}
//- (UILabel *)teamNumber {
//    if (_teamNumber) {
//        return _teamNumber;
//    }
//    _teamNumber = [[UILabel alloc]initWithFrame:CGRectMake(0, 10,( KScreenW - LfteLength) / 4 - 1, 30)];
//    _teamNumber.textColor = XYRMainColor;
//    _teamNumber.font = [UIFont boldSystemFontOfSize:30];
//    _teamNumber .font = [UIFont fontWithName:@"Arial-BoldMT" size:30];
//
//    _teamNumber.textAlignment = NSTextAlignmentCenter;
//    _teamNumber.text = @"---";
//
//    NSInteger height = 15;
//    if (KScreenW > 375) {
//        height = 15;
//    }
//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_teamNumber.frame), CGRectGetMaxY(_teamNumber.frame) + 10, _teamNumber.frame.size.width, height)];
//    label.font = [UIFont systemFontOfSize:12];
//    if (KScreenW > 375) {
//        label.font = [UIFont systemFontOfSize:15];
//    }
//    label.textAlignment = NSTextAlignmentCenter;
//    label.text = @"我的队员";
//    label.textColor = SJColor(98, 98, 98,1);
//
//    [_teamView addSubview:label];
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(CGRectGetMinX(_teamNumber.frame), CGRectGetMinY(_teamNumber.frame), _teamNumber.frame.size.width, _teamNumber.frame.size.height + label.frame.size.height + 10);
//    [button addTarget:self action:@selector(numTaped:) forControlEvents:UIControlEventTouchUpInside];
//    button.tag = 35;
//    [_teamView addSubview:button];
//    return _teamNumber;
//}
//
//-(UILabel *)estimateLabel{
//    if (_estimateLabel) {
//        return _estimateLabel;
//    }
//    UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.teamNumber.frame), 15, 1, _teamView.frame.size.height - 30)];
//    lineview.backgroundColor = XYRBackgroundColor;
//    [_teamView addSubview:lineview];
//
//    _estimateLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.teamNumber.frame) + 1, 10, self.teamNumber.frame.size.width, 30)];
//    _estimateLabel.textColor = XYRMainColor;
//    _estimateLabel.font = [UIFont boldSystemFontOfSize:30];
//    _estimateLabel .font = [UIFont fontWithName:@"Arial-BoldMT" size:30];
//
//    _estimateLabel.textAlignment = NSTextAlignmentCenter;
//    _estimateLabel.text = @"---";
//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_estimateLabel.frame), CGRectGetMaxY(_estimateLabel.frame) + 10, _estimateLabel.frame.size.width-20, 25)];
//    label.font = [UIFont systemFontOfSize:12];
//    if (KScreenW > 375) {
//        label.font = [UIFont systemFontOfSize:15];
//    }
//    label.text = @" ä»Šæ—¥é¢„ä¼°";
//    label.textAlignment = NSTextAlignmentRight;
//    [label sizeToFit];
//
//    label.textColor = SJColor(98, 98, 98,1);
//    [_teamView addSubview:label];
//    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)-5, CGRectGetMinY(label.frame) - 4 , 30, 22)];
//    image.image = [UIImage imageNamed:@"形状问"];
//    [_teamView addSubview:image];
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(CGRectGetMinX(_estimateLabel.frame), CGRectGetMinY(_estimateLabel.frame), _estimateLabel.frame.size.width, _estimateLabel.frame.size.height + label.frame.size.height + 10);
//    [button addTarget:self action:@selector(priTaped:) forControlEvents:UIControlEventTouchUpInside];
//    button.tag = 35;
//    [_teamView addSubview:button];
//    return _estimateLabel;
//}
//- (UILabel *)mothLabel {
//    if (_mothLabel) {
//        return _mothLabel;
//    }
//    UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.estimateLabel.frame), 15, 1, _teamView.frame.size.height - 30)];
//    lineview.backgroundColor = XYRBackgroundColor;
//    [_teamView addSubview:lineview];
//
//    _mothLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.estimateLabel.frame) + 1, 10, _estimateLabel.frame.size.width, 30)];
//    _mothLabel.textColor = XYRMainColor;
//    _mothLabel.font = [UIFont boldSystemFontOfSize:30];
//    _mothLabel .font = [UIFont fontWithName:@"Arial-BoldMT" size:30];
//
//    _mothLabel.textAlignment = NSTextAlignmentCenter;
//    _mothLabel.text = @"---";
//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_mothLabel.frame), CGRectGetMaxY(_mothLabel.frame) + 10, _mothLabel.frame.size.width-20, 25)];
//    label.font = [UIFont systemFontOfSize:12];
//    if (KScreenW > 375) {
//        label.font = [UIFont systemFontOfSize:15];
//    }
//    label.textAlignment = NSTextAlignmentRight;
//    label.text = @" æœ¬æœˆé¢„ä¼°";
//    label.textColor = SJColor(98, 98, 98,1);
//    [label sizeToFit];
//    [_teamView addSubview:label];
//
//    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)- 4, CGRectGetMinY(label.frame) - 5, 30, 22)];
//    image.image = [UIImage imageNamed:@"形状问"];
//    [_teamView addSubview:image];
//
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(CGRectGetMinX(_mothLabel.frame), CGRectGetMinY(_mothLabel.frame), _mothLabel.frame.size.width, _mothLabel.frame.size.height + label.frame.size.height + 10);
//    [button addTarget:self action:@selector(priTaped:) forControlEvents:UIControlEventTouchUpInside];
//    button.tag = 36;
//    [_teamView addSubview:button];
//    return _mothLabel;
//}
//- (UIView *)taskView{
//    if (_taskView) {
//        return _taskView;
//    }
//    _taskView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.percentageView.frame) + 10, KScreenW, 400)];
//    _taskView.backgroundColor = [UIColor whiteColor];
//    [_taskView addSubview:self.taskTableview];
//    return _taskView;
//}
//- (UITableView *)taskTableview{
//    if (_taskTableview) {
//        return _taskTableview;
//    }
//    _taskTableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, _taskView.frame.size.width, _taskView.frame.size.height) style:UITableViewStylePlain];
//    _taskTableview.delegate = self;
//    _taskTableview.dataSource = self;
//    _taskTableview.rowHeight = 120;
//    _taskTableview.scrollEnabled = NO;
//    [_taskTableview registerNib:[UINib nibWithNibName:@"MainInviteTableViewCell" bundle:nil] forCellReuseIdentifier:@"MainInviteTableViewCell"];
//    return _taskTableview;
//}
//- (UIView *)percentageView{
//    if (_percentageView) {
//        return _percentageView;
//    }
//    UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.teamView.frame) , KScreenW , KScreenW / 0.89)];
//    backView.backgroundColor = SJColor(250, 222, 50, 1);
//    [_scrollview addSubview:backView];
//    _percentageView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.teamView.frame) + 10, KScreenW , backView .frame.size.height - 20)];
//    _teamView.layer.cornerRadius = 8;
//    _teamView.layer.masksToBounds = YES;
//    _percentageView.backgroundColor = [UIColor whiteColor];
//    UIImageView *imageview = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _percentageView.frame.size.width, _percentageView.frame.size.height)];
//    imageview.image = [UIImage imageNamed:@"会员提成"];
//    [_percentageView addSubview:imageview];
//
//    return _percentageView;
//}
//
//- (UIView *)listView {
//
//    if (_listView) {
//        return _listView;
//    }
//    _listView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.percentageView.frame) + 10, KScreenW, 400)];
//    _listView.backgroundColor = [UIColor whiteColor];
//    [_listView addSubview:self.listTableview];
//    return _listView;
//}
//
- (UITableView *)tableView {
    if (!_tableView) {
        
@@ -806,6 +361,10 @@
        if (IsiPhoneX) {
            
            height = -44;
        } else if (IS_IPHONE_5) {
            height = 0;
        }
        
        CGRect rect;
@@ -819,134 +378,64 @@
                                                  style:UITableViewStyleGrouped];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.estimatedRowHeight = 0;
        _tableView.estimatedSectionFooterHeight = 0;
        _tableView.estimatedRowHeight = 40;
        _tableView.estimatedSectionHeaderHeight = 0;
        _tableView.estimatedSectionFooterHeight = 0;
        _tableView.backgroundColor = XYRBackgroundColor;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.rowHeight = UITableViewAutomaticDimension;
        _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
            self.pageIndex = 1;
            [self.viewModel.requestRemotetCommand execute:nil];
        }];
    }
    
    return _tableView;
}
//
//- (UIView *)ruleView {
//
//    if (_ruleView) {
//        return _ruleView;
//    }
//
//    _ruleView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.listView.frame) + 10, KScreenW, 400)];
//    _ruleView.backgroundColor = [UIColor whiteColor];
//    UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(10, 10, 5, 35)];
//    lineView.backgroundColor = SJColor(220, 0, 90, 1);
//    [_ruleView addSubview:lineView];
//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(lineView.frame) + 10, CGRectGetMinY(lineView.frame), KScreenW / 2, 35)];
//    label.font = [UIFont boldSystemFontOfSize:20];
//    label.textColor = SJColor(53, 53, 53, 1);
//    label.text = @"活动规则";
//    [_ruleView addSubview:label];
//
//    _ruleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, CGRectGetMaxY(lineView.frame) + 20, KScreenW - 40, 330)];
//
//    _ruleLabel.font = [UIFont systemFontOfSize:14];
//    _ruleLabel.textColor = SJColor(136, 136, 136, 1);
//    _ruleLabel.numberOfLines = 0;
//    [_ruleView addSubview:_ruleLabel];
//
//    return _ruleView;
//}
//- (UIView *)loginView {
//
//    if (_loginView) {
//        return _loginView;
//    }
//    _loginView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH)];
//    _loginView.backgroundColor = [UIColor whiteColor];
//    _loginView.hidden = YES;
//    UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
//    loginButton.frame = CGRectMake(KScreenW / 2 - 40, KScreenH / 2 - 20, 80, 40);
//    [loginButton setTitle:@"登录" forState:UIControlStateNormal];
//    loginButton.layer.cornerRadius = loginButton.frame.size.height / 2;
//    loginButton.layer.masksToBounds = YES;
//    loginButton.backgroundColor = XYRMainColor;
//    [loginButton addTarget:self action:@selector(loginTaped:) forControlEvents:UIControlEventTouchUpInside];
//    [_loginView addSubview:loginButton];
//    return _loginView;
//}
//
//- (UIView *)primtView {
//
//    if (_primtView) {
//        return _primtView;
//    }
//    _primtView = [[UIView alloc]initWithFrame:CGRectMake(30, KScreenH / 2 - 80, KScreenW - 60, 180)];
//    _primtView.backgroundColor = [UIColor whiteColor];
//    _primtView.layer.cornerRadius = 6;
//    _primtView.layer.masksToBounds = YES;
//
//    _primtTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, 25, _primtView.frame.size.width, 20)];
//    _primtTitle.text = @"今日预估收益";
//    _primtTitle.textAlignment = NSTextAlignmentCenter;
//    _primtTitle.font = [UIFont systemFontOfSize:18];
//
//    _primtContent = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.primtTitle.frame) + 10, _primtView.frame.size.width - 30, 80)];
//    _primtContent.text = @"";
//    _primtContent.numberOfLines = 0;
//    _primtContent.textAlignment = NSTextAlignmentCenter;
//    _primtContent.font = [UIFont systemFontOfSize:16];
//    _primtContent.textColor = SJColor(98, 98, 98, 1);
//
//    [_primtView addSubview:self.primtTitle];
//    [_primtView addSubview:self.primtContent];
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(15, CGRectGetMaxY(_primtContent.frame), _primtView.frame.size.width - 30, 40);
//    [button setTitle:@"知道啦" forState:UIControlStateNormal];
//    [button setTitleColor:XYRMainColor forState:UIControlStateNormal];
//    [self setBorderWithView:button top:YES left:NO bottom:NO right:NO borderColor:XYRBackgroundColor borderWidth:1];
//    [button addTarget:self action:@selector(primtTaped:) forControlEvents:UIControlEventTouchUpInside];
//    [_primtView addSubview:button];
//    return _primtView;
//}
//- (UILabel *)lastMonLabel {
//
//    if (_lastMonLabel) {
//        return _lastMonLabel;
//    }
//    UIView *lineview = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.mothLabel.frame), 15, 1, _teamView.frame.size.height - 30)];
//    lineview.backgroundColor = XYRBackgroundColor;
//    [_teamView addSubview:lineview];
//
//    _lastMonLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.mothLabel.frame) + 1, 10, self.mothLabel.frame.size.width, 30)];
//    _lastMonLabel.textColor = XYRMainColor;
//    _lastMonLabel.font = [UIFont boldSystemFontOfSize:30];
//    _lastMonLabel .font = [UIFont fontWithName:@"Arial-BoldMT" size:30];
//    _lastMonLabel.textAlignment = NSTextAlignmentCenter;
//    _lastMonLabel.text = @"---";
//    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(_lastMonLabel.frame), CGRectGetMaxY(_lastMonLabel.frame) + 10, _lastMonLabel.frame.size.width-20, 25)];
//    label.font = [UIFont systemFontOfSize:12];
//    if (KScreenW > 375) {
//        label.font = [UIFont systemFontOfSize:15];
//    }
//    label.textAlignment = NSTextAlignmentRight;
//    label.text = @" ä¸Šæœˆæ”¶å…¥";
//    label.textColor = SJColor(98, 98, 98,1);
//    [label sizeToFit];
//    [_teamView addSubview:label];
//
//    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(label.frame)- 4, CGRectGetMinY(label.frame) - 5, 30, 22)];
//    if (KScreenW < 375) {
//        image.frame = CGRectMake(CGRectGetMaxX(label.frame) - 8, CGRectGetMinY(label.frame) - 5, 30, 22);
//    }
//    image.image = [UIImage imageNamed:@"形状问"];
//    [_teamView addSubview:image];
//
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(CGRectGetMinX(_lastMonLabel.frame), CGRectGetMinY(_lastMonLabel.frame), _lastMonLabel.frame.size.width, _lastMonLabel.frame.size.height + label.frame.size.height + 10);
//    [button addTarget:self action:@selector(priTaped:) forControlEvents:UIControlEventTouchUpInside];
//    button.tag = 37;
//    [_teamView addSubview:button];
//    return _lastMonLabel;
//}
- (UIView *)primtView {
    if (_primtView) {
        return _primtView;
    }
    _primtView = [[UIView alloc]initWithFrame:CGRectMake(30, KScreenH / 2 - 80, KScreenW - 60, 180)];
    _primtView.backgroundColor = [UIColor whiteColor];
    _primtView.layer.cornerRadius = 6;
    _primtView.layer.masksToBounds = YES;
    _primtTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, 25, _primtView.frame.size.width, 20)];
    _primtTitle.text = @"今日预估收益";
    _primtTitle.textAlignment = NSTextAlignmentCenter;
    _primtTitle.font = [UIFont systemFontOfSize:18];
    _primtContent = [[UILabel alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(self.primtTitle.frame) + 10, _primtView.frame.size.width - 30, 80)];
    _primtContent.text = @"";
    _primtContent.numberOfLines = 0;
    _primtContent.textAlignment = NSTextAlignmentCenter;
    _primtContent.font = [UIFont systemFontOfSize:16];
    _primtContent.textColor = SJColor(98, 98, 98, 1);
    [_primtView addSubview:self.primtTitle];
    [_primtView addSubview:self.primtContent];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(15, CGRectGetMaxY(_primtContent.frame), _primtView.frame.size.width - 30, 40);
    [button setTitle:@"知道啦" forState:UIControlStateNormal];
    [button setTitleColor:XYRMainColor forState:UIControlStateNormal];
    [self setBorderWithView:button top:YES left:NO bottom:NO right:NO borderColor:XYRBackgroundColor borderWidth:1];
    [button addTarget:self action:@selector(primtTaped:) forControlEvents:UIControlEventTouchUpInside];
    [_primtView addSubview:button];
    return _primtView;
}
- (MainInviteViewModel *)viewModel {
    if (!_viewModel) {
        _viewModel = [[MainInviteViewModel alloc] init];
    }
    return _viewModel;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
MIduo/½çÃæ/ÑûÇë/Model/MainInviteModel.h
New file
@@ -0,0 +1,145 @@
//
//  MainInviteModel.h
//  MIduo
//
//  Created by é‡åº†è¿ˆå°–科技有限公司 on 2018/8/16.
//  Copyright Â© 2018å¹´ yeshi. All rights reserved.
//
#import <Foundation/Foundation.h>
@class PageEntityModel;
@class EveryDayTaskListModel;
@class InviteGetMoneyListModel;
@class EtGoodsModel;
@interface MainInviteModel : NSObject
/// æˆ‘的队员
@property (nonatomic, copy, nullable) NSString *myTeam;
/// æ´»åŠ¨è§„åˆ™
@property (nonatomic, copy, nullable) NSString *activityRules;
/// æ´»åŠ¨è§„åˆ™å¯Œæ–‡æœ¬
@property (nonatomic, copy, nullable) NSAttributedString *activityRulesAttributed;
/// ä»Šæ—¥é¢„估收益
@property (nonatomic, copy, nullable) NSString *moneyToday;
/// æœ¬æœˆé¢„估收益
@property (nonatomic, copy, nullable) NSString *moneyMonth;
/// ä¸Šæœˆé¢„估收益
@property (nonatomic, copy, nullable) NSString *moneyLastMonth;
@property (nonatomic, copy, nullable) NSString *inviteList;
@property (nonatomic, strong , nullable) PageEntityModel *pageEntity;
@property (strong, nonatomic) NSArray<EveryDayTaskListModel *> *everyDayTaskList;
@property (strong, nonatomic) NSArray<InviteGetMoneyListModel *> *inviteGetMoneyList;
@end
@interface PageEntityModel : NSObject
@property (nonatomic, copy, nullable) NSString *pageIndex;
@property (nonatomic, copy, nullable) NSString *pageSize;
@property (nonatomic, copy, nullable) NSString *totalCount;
@property (nonatomic, copy, nullable) NSString *totalPage;
@end
@interface EveryDayTaskListModel : NSObject
@property (nonatomic, copy, nullable) NSString *id;
@property (nonatomic, copy, nullable) NSString *quanhoujia;
@property (nonatomic, copy, nullable) NSString *etOrderBy;
@property (nonatomic, copy, nullable) NSString *getMoney;
@property (nonatomic, strong, nullable) EtGoodsModel *etGoods;
@end
@interface EtGoodsModel : NSObject
@property (nonatomic, copy, nullable) NSString *id;
@property (nonatomic, copy, nullable) NSString *pictUrl;
@property (nonatomic, copy, nullable) NSString *title;
@property (nonatomic, copy, nullable) NSString *auctionId;
@property (nonatomic, copy, nullable) NSString *couponActivityId;
@property (nonatomic, copy, nullable) NSString *biz30day;
@property (nonatomic, copy, nullable) NSString *salesCount;
@property (nonatomic, copy, nullable) NSString *tkRate;
@property (nonatomic, copy, nullable) NSString *nick;
@property (nonatomic, copy, nullable) NSString *includeDxjh;
@property (nonatomic, copy, nullable) NSString *reservePrice;
@property (nonatomic, copy, nullable) NSString *tkCommFee;
@property (nonatomic, copy, nullable) NSString *totalFee;
@property (nonatomic, copy, nullable) NSString *totalNum;
@property (nonatomic, copy, nullable) NSString *zkPrice;
@property (nonatomic, copy, nullable) NSString *dayLeft;
@property (nonatomic, copy, nullable) NSString *auctionUrl;
@property (nonatomic, copy, nullable) NSString *rlRate;
@property (nonatomic, copy, nullable) NSString *hasRecommended;
@property (nonatomic, copy, nullable) NSString *hasSame;
@property (nonatomic, copy, nullable) NSString *sameItemPid;
@property (nonatomic, copy, nullable) NSString *couponTotalCount;
@property (nonatomic, copy, nullable) NSString *couponLeftCount;
@property (nonatomic, copy, nullable) NSString *couponAmount;
@property (nonatomic, copy, nullable) NSString *couponInfo;
@property (nonatomic, copy, nullable) NSString *couponStartFee;
@property (nonatomic, copy, nullable) NSString *couponEffectiveStartTime;
@property (nonatomic, copy, nullable) NSString *couponEffectiveEndTime;
@property (nonatomic, copy, nullable) NSString *createtime;
@property (nonatomic, copy, nullable) NSString *tkMktStatus;
@end
@interface InviteGetMoneyListModel : NSObject
@property (nonatomic, copy, nullable) NSString *id;
@property (nonatomic, copy, nullable) NSString *icon;
@property (nonatomic, copy, nullable) NSString *name;
@property (nonatomic, copy, nullable) NSString *portrait;
@property (nonatomic, copy, nullable) NSString *money;
@property (nonatomic, copy, nullable) NSString *createTime;
@end
MIduo/½çÃæ/ÑûÇë/Model/MainInviteModel.m
New file
@@ -0,0 +1,37 @@
//
//  MainInviteModel.m
//  MIduo
//
//  Created by é‡åº†è¿ˆå°–科技有限公司 on 2018/8/16.
//  Copyright Â© 2018å¹´ yeshi. All rights reserved.
//
#import "MainInviteModel.h"
@implementation MainInviteModel
+ (nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass {
    return @{
             @"everyDayTaskList" : [EveryDayTaskListModel class],
             @"inviteGetMoneyList" : [InviteGetMoneyListModel class]
             };
}
@end
@implementation PageEntityModel
@end
@implementation EveryDayTaskListModel
@end
@implementation InviteGetMoneyListModel
@end
@implementation EtGoodsModel
@end
MIduo/½çÃæ/ÑûÇë/ViewModel/MainInviteViewModel.h
New file
@@ -0,0 +1,20 @@
//
//  MainInviteViewModel.h
//  MIduo
//
//  Created by é‡åº†è¿ˆå°–科技有限公司 on 2018/8/16.
//  Copyright Â© 2018å¹´ yeshi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MainInviteViewModel : NSObject
/// ç”¨æˆ·ID
@property (nonatomic, copy) NSString *uid;
/// é¡µæ•°
@property (nonatomic, assign) NSInteger pageIndex;
/// è¯·æ±‚远程数据
@property (strong, nonatomic, readonly) RACCommand *requestRemotetCommand;
@end
MIduo/½çÃæ/ÑûÇë/ViewModel/MainInviteViewModel.m
New file
@@ -0,0 +1,92 @@
//
//  MainInviteViewModel.m
//  MIduo
//
//  Created by é‡åº†è¿ˆå°–科技有限公司 on 2018/8/16.
//  Copyright Â© 2018å¹´ yeshi. All rights reserved.
//
#import "MainInviteViewModel.h"
#import "MainInviteModel.h"
@interface MainInviteViewModel ()
/// é€€å‡ºä¿¡å·æº
@property (strong, nonatomic, readwrite) RACCommand *requestRemotetCommand;
@end
@implementation MainInviteViewModel
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initialization];
    }
    return self;
}
- (void)initialization {
    [[RACSignal combineLatest:@[RACObserve(self, pageIndex)]] distinctUntilChanged];
    [[RACSignal combineLatest:@[RACObserve(self, uid)]] distinctUntilChanged];
    @weakify(self)
    self.requestRemotetCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) {
        @strongify(self)
        return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
            [subscriber sendNext:[self requestRemoteData]];
            [subscriber sendCompleted];
            // é”€æ¯ä¿¡å·
            return [RACDisposable disposableWithBlock:^{
            }];
        }];
    }];
}
#pragma mark --- è¯·æ±‚邀请数据 ---
- (RACSignal *)requestRemoteData {
    @weakify(self)
    RACSignal *logoutSignal = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
        @strongify(self)
        if (!self.uid) {
            self.uid = @"";
        }
        NSDictionary *param = @{@"uid" : self.uid,
                                @"pageIndex" : [NSString stringWithFormat:@"%ld",self.pageIndex]
                                };
        [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"invite/inviteGetMoney"]
                     param:param
                   success:^(NSDictionary *object) {
                       if ([object[@"code"] integerValue] == 0) {
                           MainInviteModel *model = [MainInviteModel yy_modelWithJSON:object[@"data"]];
                           [subscriber sendNext:model];
                           [subscriber sendCompleted];
                       }
                   } fail:^(id object) {
                       [subscriber sendError:object];
                   }];
        return [RACDisposable disposableWithBlock:^{
        }];
    }];
    return logoutSignal;
}
@end