Commit 0c4623191791cec1a58ecd963704ee2f4d6b36d4

Authored by liushiyu
1 parent 429d3f5f

0.0.4

CNLiveCMineModule.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveCMineModule'
11   - s.version = '0.0.3'
  11 + s.version = '0.0.4'
12 12 s.summary = '网家家C端个人中心'
13 13  
14 14 # This description is used to generate tags and improve search results.
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteAnnouListViewController.m
... ... @@ -87,9 +87,11 @@
87 87 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
88 88 {
89 89 CNLiveCMineInteListSubModel * annouModel = self.annouModel.list[indexPath.row];
90   - BOOL isCont = [annouModel.shareUrl cn_containsString:@"?"];
91   - NSString * shreUrl = [NSString stringWithFormat:@"%@%@contentId=%@",annouModel.shareUrl,isCont?@"&":@"?",annouModel.contentId];
92   - [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:shreUrl statue:CNLiveCMineIntePushWebViewStatueAnnotationDetail];
  90 + if ([annouModel.model isEqualToString:@"3"] || [annouModel.model isEqualToString:@"3_roof"]) {
  91 + BOOL isCont = [annouModel.shareUrl cn_containsString:@"?"];
  92 + NSString * shreUrl = [NSString stringWithFormat:@"%@%@contentId=%@",annouModel.shareUrl,isCont?@"&":@"?",annouModel.contentId];
  93 + [[CNLiveCMineService shareMineProtocol] pushCMineInteContentForCMainWebViewWithURL:shreUrl statue:CNLiveCMineIntePushWebViewStatueAnnotationDetail];
  94 + }
93 95 }
94 96 #pragma mark = getter
95 97 - (CNLiveNavigationBar *)navigationBar {
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetaiListlViewController.m
... ... @@ -37,8 +37,6 @@
37 37 // Do any additional setup after loading the view.
38 38 self.view.backgroundColor = kWhiteColor;
39 39  
40   - [self addMainRefreshView];
41   -
42 40 [self requestDataSourceWithPageNo:1 CurrentMonth:self.currentMonth CurrentType:self.currentType];
43 41 }
44 42  
... ... @@ -48,15 +46,23 @@
48 46 self.pageNo = pageNo;
49 47 self.currentType = currentType;
50 48 self.currentMonth = currentMonth;
51   - [CNLiveCMineInteViewModel requestWithIntegraDetailWithCurrentMonth:currentMonth currentType:currentType pageNo:pageNo CompleterBlock:^(CNLiveCMineInteDetailModel * _Nonnull listModel) {
52   - listModel.currentInte = weakSelf.currentInte;
53   - weakSelf.listModel = listModel;
54   - weakSelf.detailVC.headerView.detailModel = listModel;
55   - [weakSelf.tableView reloadData];
56   - [weakSelf.tableView.mj_footer endRefreshing];
57   - [weakSelf.detailVC.pagingView.mainTableView.mj_header endRefreshing];
58   - if (!listModel.hasNext) [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
59   - weakSelf.tableView.mj_footer = listModel.integralList.count == 0 ? nil : weakSelf.footerView;
  49 + [CNLiveCMineInteViewModel requestWithIntegraDetailWithCurrentMonth:currentMonth currentType:currentType pageNo:pageNo CompleterBlock:^(CNLiveCMineInteDetailModel * _Nonnull listModel, NSError * _Nonnull error) {
  50 + [self addMainRefreshView];
  51 + if (!error && listModel) {
  52 + listModel.currentInte = weakSelf.currentInte;
  53 + weakSelf.listModel = listModel;
  54 + weakSelf.detailVC.headerView.detailModel = listModel;
  55 + [weakSelf.tableView reloadData];
  56 + [weakSelf.tableView.mj_footer endRefreshing];
  57 + [weakSelf.detailVC.pagingView.mainTableView.mj_header endRefreshing];
  58 + if (!listModel.hasNext) [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
  59 + weakSelf.tableView.mj_footer = listModel.integralList.count == 0 ? nil : weakSelf.footerView;
  60 + }else{
  61 + [weakSelf.detailVC.pagingView.mainTableView.mj_header endRefreshing];
  62 + [weakSelf.tableView.mj_footer endRefreshing];
  63 + weakSelf.tableView.mj_footer = nil;
  64 + [weakSelf.tableView reloadData];
  65 + }
60 66 }];
61 67 }
62 68  
... ... @@ -88,6 +94,7 @@
88 94 self.tableView.emptyDataSetDelegate = self;
89 95 self.tableView.showsVerticalScrollIndicator = NO;
90 96 self.tableView.showsHorizontalScrollIndicator = NO;
  97 + self.tableView.backgroundColor = [UIColor whiteColor];
91 98 self.tableView.tableFooterView = [[UIView alloc] init];
92 99 self.tableView.separatorInset = UIEdgeInsetsMake(0, 10, 0, 10);
93 100 }
... ... @@ -112,7 +119,7 @@
112 119  
113 120 - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView
114 121 {
115   - return 0;
  122 + return -65;
116 123 }
117 124  
118 125 - (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
... ... @@ -122,12 +129,12 @@
122 129  
123 130 - (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView
124 131 {
125   - return NO;
  132 + return YES;
126 133 }
127 134  
128 135 - (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
129 136 {
130   - return YES;
  137 + return NO;
131 138 }
132 139  
133 140 #pragma mark =
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskListViewController.m
... ... @@ -8,7 +8,7 @@
8 8 #import "CNLiveCMineInteTaskListViewController.h"
9 9 #import "CNLiveCMineInteCollectionViewCell.h"
10 10  
11   -@interface CNLiveCMineInteTaskListViewController ()
  11 +@interface CNLiveCMineInteTaskListViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
12 12 @property (nonatomic, weak) CNLiveCMineInteTaskViewController * taskVC;
13 13 @property (nonatomic, strong) NSArray * taskArray;//数据源
14 14  
... ... @@ -58,6 +58,8 @@
58 58 [super initTableView];
59 59 self.tableView.dataSource = self;
60 60 self.tableView.delegate = self;
  61 + self.tableView.emptyDataSetSource = self;
  62 + self.tableView.emptyDataSetDelegate = self;
61 63 self.tableView.backgroundColor = UIColorHex(0xf5f5f5);
62 64 self.tableView.showsVerticalScrollIndicator = NO;
63 65 self.tableView.showsHorizontalScrollIndicator = NO;
... ... @@ -69,6 +71,39 @@
69 71 [super layoutTableView];
70 72 self.tableView.height = kScreenHeight - kNavigationBarHeight - 184;
71 73 }
  74 +#pragma mark - DZNEmptyDataSetSource Methods
  75 +- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
  76 +{
  77 + return [[NSAttributedString alloc] initWithString:@"现在没有相关任务哦" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]}];
  78 +}
  79 +-(UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
  80 +{
  81 + return [CNLiveCMineService imageWithMineName:@"c_mine_content_empty"];
  82 +}
  83 +- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
  84 +{
  85 + return [UIColor whiteColor];
  86 +}
  87 +
  88 +- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView
  89 +{
  90 + return 0;
  91 +}
  92 +
  93 +- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
  94 +{
  95 + return YES;
  96 +}
  97 +
  98 +- (BOOL)emptyDataSetShouldAllowTouch:(UIScrollView *)scrollView
  99 +{
  100 + return YES;
  101 +}
  102 +
  103 +- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
  104 +{
  105 + return NO;
  106 +}
72 107 #pragma mark =
73 108  
74 109 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskViewController.m
... ... @@ -90,7 +90,11 @@ static NSInteger const kCNLiveSectionHeaderHeight = 140;//头视图高度
90 90  
91 91 -(UIStatusBarStyle)preferredStatusBarStyle
92 92 {
93   - return UIStatusBarStyleDefault;
  93 + if (@available(iOS 13.0, *)) {
  94 + return UIStatusBarStyleDarkContent;
  95 + } else {
  96 + return UIStatusBarStyleDefault;
  97 + }
94 98 }
95 99 #pragma mark =
96 100 -(NSMutableArray<CNLiveCMineInteTaskListViewController *> *)viewControllers
... ...
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteViewController.m
... ... @@ -74,7 +74,15 @@
74 74 NSInteger addScore = [note.userInfo[@"score"] integerValue];
75 75 NSInteger scored = [self.taskModel.integral integerValue];
76 76 self.taskModel.integral = [NSString stringWithFormat:@"%ld",scored + addScore];
77   - [self.headerView setupWithScoreModel:self.scoreModel taskModel:self.taskModel announModel:self.announModel];
  77 + [self.headerView setupWithScoreModel:self.scoreModel taskModel:self.taskModel announModel:self.announModel activModel:self.activModel];
  78 +}
  79 +-(UIStatusBarStyle)preferredStatusBarStyle
  80 +{
  81 + if (@available(iOS 13.0, *)) {
  82 + return UIStatusBarStyleDarkContent;
  83 + } else {
  84 + return UIStatusBarStyleDefault;
  85 + }
78 86 }
79 87 #pragma mark - UICollectionViewDelegate,UICollectionViewDataSource
80 88 - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
... ... @@ -98,18 +106,18 @@
98 106 }
99 107 -(CGSize)collectionView:(UICollectionView*)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
100 108 {
101   - return CGSizeMake(kScreenWidth, 270);
  109 + return CGSizeMake(kScreenWidth, self.announModel ? 310 : 260);
102 110 }
103 111 - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString*)kind atIndexPath:(NSIndexPath*)indexPath {
104 112 // 判断返回表头类型 还是表尾类型
105 113 if([kind isEqualToString:UICollectionElementKindSectionHeader]) {
106 114 CNLiveCMineInteHeaderView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass(CNLiveCMineInteHeaderView.class) forIndexPath:indexPath];
107 115 headerView.backgroundColor= [UIColor clearColor];
108   - [headerView setupWithScoreModel:self.scoreModel taskModel:self.taskModel announModel:self.announModel];
  116 + [headerView setupWithScoreModel:self.scoreModel taskModel:self.taskModel announModel:self.announModel activModel:self.activModel];
109 117 __weak typeof(self) weakSelf = self;
110 118 [headerView setClickActionBlock:^(CNLiveCMineInteScoreModel * _Nonnull scoreModel, CNLiveCMineInteTaskListModel * _Nonnull taskModel, CNLiveCMineInteListModel * _Nonnull announModel, CNLiveCMineInteHeaderClick headerClick) {
111 119 if (headerClick == CNLiveCMineInteHeaderClickDetail) {
112   - CNLiveCMineInteDetailViewController * inteView = [[CNLiveCMineInteDetailViewController alloc] initWithInte:taskModel.integral];
  120 + CNLiveCMineInteDetailViewController * inteView = [[CNLiveCMineInteDetailViewController alloc] initWithInte:!CNLiveStringIsEmpty(taskModel.integral)?taskModel.integral:@"0"];
113 121 [weakSelf.navigationController pushViewController:inteView animated:YES];
114 122 } else if (headerClick == CNLiveCMineInteHeaderClickAnnotation) {
115 123 CNLiveCMineInteAnnouListViewController * annouView = [[CNLiveCMineInteAnnouListViewController alloc] initWithAnnouModel:announModel];
... ... @@ -151,7 +159,7 @@
151 159 _mainCollectionView.delegate = self;
152 160 _mainCollectionView.dataSource = self;
153 161 _mainCollectionView.backgroundColor = [UIColor clearColor];
154   - _mainCollectionView.showsVerticalScrollIndicator = NO;
  162 + _mainCollectionView.showsVerticalScrollIndicator = YES;
155 163 _mainCollectionView.showsHorizontalScrollIndicator = NO;
156 164 [_mainCollectionView registerClass:[CNLiveCMineInteCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass(CNLiveCMineInteCollectionViewCell.class)];
157 165 [_mainCollectionView registerClass:[CNLiveCMineInteHeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass(CNLiveCMineInteHeaderView.class)];
... ...
CNLiveCMineModule/Classes/inte/Model/CNLiveCMineInteModel.h
... ... @@ -171,10 +171,11 @@ NS_ASSUME_NONNULL_BEGIN
171 171 /**是否有下一页*/
172 172 @property (nonatomic, assign) BOOL hasNext;
173 173 /**获取积分*/
174   -@property (nonatomic, assign) NSInteger obtainIntegral;
  174 +@property (nonatomic, copy) NSString *obtainIntegral;
  175 +
175 176 @property (nonatomic, strong) NSArray<CNLiveCMineInteDetailListModel *> *integralList;
176 177 /**支出积分*/
177   -@property (nonatomic, assign) NSInteger payIntegral;
  178 +@property (nonatomic, copy) NSString *payIntegral;
178 179 /**当前展示的日期 自定义的*/
179 180 @property (nonatomic, copy) NSString *date_string;
180 181 /**当前的总积分 自定义的*/
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteCollectionViewCell.m
... ... @@ -428,6 +428,7 @@
428 428 _completeBtn.titleLabel.font = [UIFont systemFontOfSize:12];
429 429 _completeBtn.titleLabel.font = [UIFont boldSystemFontOfSize:12];
430 430 _completeBtn.spacingBetweenImageAndTitle = 0;
  431 + _completeBtn.userInteractionEnabled = NO;
431 432 _completeBtn.backgroundColor = UIColorMakeWithRGBA(245, 166, 35, 0.1);
432 433 _completeBtn.imagePosition = QMUIButtonImagePositionRight;
433 434 [_completeBtn addTarget:self action:@selector(clickCompleteBtn:) forControlEvents:UIControlEventTouchUpInside];
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteDetailHeaderView.m
... ... @@ -31,23 +31,19 @@
31 31 {
32 32 _detailModel = detailModel;
33 33  
34   - NSMutableAttributedString * coin_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@积分",detailModel.currentInte]];
  34 + NSMutableAttributedString * coin_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@积分",[detailModel.currentInte isNotBlank]?detailModel.currentInte:@"0"]];
35 35 [coin_string addAttribute:NSFontAttributeName value:UIFontCNMake(12) range:[coin_string.string rangeOfString:@"积分"]];
36 36 [coin_string addAttribute:NSFontAttributeName value:UIFontBoldCNMake(35) range:NSMakeRange(0, [coin_string.string rangeOfString:@"积分"].location)];
37 37 self.inteLabel.attributedText = coin_string;
38 38  
39   - NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"获取 %ld",(long)detailModel.payIntegral]];
40   - [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取"]];
41   - [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取"].location)];
42   - [spend_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:[spend_string.string rangeOfString:@"获取"]];
43   - [spend_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取"].location)];
  39 + NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"获取:%@",[detailModel.payIntegral isNotBlank]?detailModel.payIntegral:@"0"]];
  40 + [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取:"]];
  41 + [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取:"].location)];
44 42 self.spendLabel.attributedText = spend_string;
45 43  
46   - NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"支出%ld",(long)detailModel.obtainIntegral]];
47   - [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出"]];
48   - [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出"].location)];
49   - [obta_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:[obta_string.string rangeOfString:@"支出"]];
50   - [obta_string addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出"].location)];
  44 + NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"支出:%@",[detailModel.obtainIntegral isNotBlank]?detailModel.obtainIntegral:@"0"]];
  45 + [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出:"]];
  46 + [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出:"].location)];
51 47 self.obtaLabel.attributedText = obta_string;
52 48  
53 49 NSArray * array = [detailModel.date_string componentsSeparatedByString:@"-"];
... ... @@ -84,6 +80,11 @@
84 80 _inteLabel = [[UILabel alloc] init];
85 81 _inteLabel.backgroundColor = [UIColor clearColor];
86 82 _inteLabel.textColor = UIColorHex(#FFFFFF);
  83 +
  84 + NSMutableAttributedString * coin_string = [[NSMutableAttributedString alloc] initWithString:@"0积分"];
  85 + [coin_string addAttribute:NSFontAttributeName value:UIFontCNMake(12) range:[coin_string.string rangeOfString:@"积分"]];
  86 + [coin_string addAttribute:NSFontAttributeName value:UIFontBoldCNMake(35) range:NSMakeRange(0, [coin_string.string rangeOfString:@"积分"].location)];
  87 + _inteLabel.attributedText = coin_string;
87 88 }
88 89 return _inteLabel;
89 90 }
... ... @@ -93,6 +94,11 @@
93 94 _spendLabel = [[UILabel alloc] init];
94 95 _spendLabel.backgroundColor = [UIColor clearColor];
95 96 _spendLabel.textColor = UIColorHex(#FFFFFF);
  97 +
  98 + NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:@"获取:0"];
  99 + [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取:"]];
  100 + [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取:"].location)];
  101 + _spendLabel.attributedText = spend_string;
96 102 }
97 103 return _spendLabel;
98 104 }
... ... @@ -102,6 +108,11 @@
102 108 _obtaLabel = [[UILabel alloc] init];
103 109 _obtaLabel.backgroundColor = [UIColor clearColor];
104 110 _obtaLabel.textColor = UIColorHex(#FFFFFF);
  111 +
  112 + NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:@"支出:0"];
  113 + [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出:"]];
  114 + [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出:"].location)];
  115 + _obtaLabel.attributedText = obta_string;
105 116 }
106 117 return _obtaLabel;
107 118 }
... ... @@ -118,6 +129,12 @@
118 129 _dateButton.imageEdgeInsets = UIEdgeInsetsMake(0, 2.5, 0, 2.5);
119 130 _dateButton.imagePosition = QMUIButtonImagePositionLeft;
120 131 [_dateButton addTarget:self action:@selector(pushDateSelectAction:) forControlEvents:UIControlEventTouchUpInside];
  132 +
  133 + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  134 + [dateFormatter setDateFormat:@"yyyy-MM"];
  135 + NSArray * dateArray = [[dateFormatter stringFromDate:[NSDate date]] componentsSeparatedByString:@"-"];
  136 + NSString * s = [NSString stringWithFormat:@"%@年%@月",dateArray.firstObject,dateArray.lastObject];
  137 + [_dateButton setTitle:s forState:UIControlStateNormal];
121 138 }
122 139 return _dateButton;
123 140 }
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderCustomView.m
... ... @@ -105,14 +105,13 @@
105 105 make.size.mas_equalTo(20);
106 106 make.right.mas_equalTo(titleButton02.mas_left).offset(-5);
107 107 }];
  108 +
108 109  
109   - [UIView animateWithDuration:.5 animations:^{
  110 + [UIView animateWithDuration:.25 animations:^{
110 111 headerView.height = 50;
111 112 } completion:^(BOOL finished) {
112   - if (finished) {
113   - [headerView addSubview:tapView01];
114   - [headerView addSubview:tapView02];
115   - }
  113 + [headerView addSubview:tapView01];
  114 + [headerView addSubview:tapView02];
116 115 }];
117 116 }
118 117  
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderSignView.h
... ... @@ -16,9 +16,11 @@ NS_ASSUME_NONNULL_BEGIN
16 16 /// @param scoreModel 签到数据
17 17 /// @param taskModel 任务数据
18 18 /// @param announModel 公告数据
  19 +/// @param announModel 任务数据
19 20 -(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel
20 21 taskModel:(CNLiveCMineInteTaskListModel *)taskModel
21   - announModel:(CNLiveCMineInteListModel *)announModel;
  22 + announModel:(CNLiveCMineInteListModel *)announModel
  23 + activModel:(CNLiveCMineInteListModel *)activModel;
22 24  
23 25 /// 对点击结果进行响应
24 26 @property (nonatomic, copy) ClickActionBlock clickActionBlock;
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderSignView.m
... ... @@ -51,37 +51,39 @@
51 51 }
52 52 -(void)setupWithCoinsVeiw
53 53 {
54   - UIView * coinsView = [[UIView alloc] initWithFrame:CGRectMake(5, 40, SCREEN_WIDTH - 30, 70)];
  54 + UIView * coinsView = [[UIView alloc] initWithFrame:CGRectMake(5, 40, SCREEN_WIDTH - 30, 90)];
55 55 coinsView.backgroundColor = [UIColor clearColor];
56 56 [self.topView addSubview:coinsView];
57 57  
58 58 CGFloat item_w = (SCREEN_WIDTH - 60)/7;
  59 + CGFloat item_h = item_w * 1.33;
59 60 for (int i = 0; i < 7; i++) {
60   - UIView * temp_v = [[UIView alloc] initWithFrame:CGRectMake(i * (item_w + 5), 0, item_w, 70)];
  61 + UIView * temp_v = [[UIView alloc] initWithFrame:CGRectMake(i * (item_w + 5), 0, item_w, 90)];
61 62 temp_v.backgroundColor = [UIColor clearColor];
62 63 [coinsView addSubview:temp_v];
63 64  
64   - UIImageView * coinsV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, item_w, 50)];
  65 + UIImageView * coinsV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, item_w, item_h)];
65 66 coinsV.image = [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.3]];
66 67 coinsV.layer.masksToBounds = YES;
67 68 coinsV.layer.cornerRadius = 5;
68 69 [temp_v addSubview:coinsV];
69 70 [self.coinsViews addObject:coinsV];
70 71  
71   - UIImageView * coins = [[UIImageView alloc] initWithFrame:CGRectMake((item_w - 30)/2, 5, 30, 30)];
  72 + UIImageView * coins = [[UIImageView alloc] initWithFrame:CGRectMake((item_w - 30)/2, 10, 30, 30)];
72 73 coins.image = [CNLiveCMineService imageWithMineName:@"c_mine_content_gold_coins"];
73 74 coins.backgroundColor = [UIColor clearColor];
74 75 [coinsV addSubview:coins];
75 76  
76   - UILabel * numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 30, item_w, 20)];
  77 + UILabel * numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, item_w, 20)];
77 78 numberLabel.backgroundColor = [UIColor clearColor];
78 79 numberLabel.textColor = [UIColor whiteColor];
79 80 numberLabel.textAlignment = NSTextAlignmentCenter;
80 81 numberLabel.font = [UIFont systemFontOfSize:10];
  82 + numberLabel.text = [NSString stringWithFormat:@"+%d",(i + 1) * 1000];
81 83 [coinsV addSubview:numberLabel];
82 84 [self.numberViews addObject:numberLabel];
83 85  
84   - UILabel * dayLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, item_w, 20)];
  86 + UILabel * dayLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, item_h + 5, item_w, 20)];
85 87 dayLabel.backgroundColor = [UIColor clearColor];
86 88 dayLabel.textColor = [UIColor whiteColor];
87 89 dayLabel.textAlignment = NSTextAlignmentCenter;
... ... @@ -137,21 +139,28 @@
137 139 -(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel
138 140 taskModel:(CNLiveCMineInteTaskListModel *)taskModel
139 141 announModel:(CNLiveCMineInteListModel *)announModel
  142 + activModel:(CNLiveCMineInteListModel *)activModel
140 143 {
141 144 _scoreModel = scoreModel;
142 145 _taskModel = taskModel;
143 146 _announModel = announModel;
  147 + _activModel = activModel;
144 148 NSArray * array = [scoreModel.scores.firstObject componentsSeparatedByString:@","];
  149 + if (array.count == 0) array = @[@"1000",@"2000",@"3000",@"4000",@"5000",@"6000",@"7000"];
145 150 NSInteger index = [array indexOfObject:scoreModel.score];
146   - for (int i = 0; i < self.numberViews.count; i++) {
147   - UILabel * numberLabel = self.numberViews[i];
148   - UIImageView * coinsV = self.coinsViews[i];
149   - numberLabel.text = [NSString stringWithFormat:@"+%@",array.count >= self.numberViews.count ? array[i] : @""];
150   - numberLabel.textColor = index >= i ? [UIColor blackColor] : [UIColor whiteColor];
151   - coinsV.image = index >= i ? [CNLiveCMineService imageWithMineName:@"c_mine_content_gold_select"] : [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.3]];
  151 + if (scoreModel) {
  152 + for (int i = 0; i < self.numberViews.count; i++) {
  153 + UILabel * numberLabel = self.numberViews[i];
  154 + UIImageView * coinsV = self.coinsViews[i];
  155 + numberLabel.text = [NSString stringWithFormat:@"+%@",array.count >= self.numberViews.count ? array[i] : @""];
  156 + numberLabel.textColor = index >= i ? [UIColor blackColor] : [UIColor whiteColor];
  157 + coinsV.image = index >= i ? [CNLiveCMineService imageWithMineName:@"c_mine_content_gold_select"] : [UIImage imageWithColor:[UIColor colorWithWhite:0 alpha:0.3]];
  158 + }
  159 + self.nameLabel.text = [NSString stringWithFormat:@"已连续签到 %ld天",index + 1];
  160 + }else{
  161 + self.nameLabel.text = @"已连续签到 0天";
152 162 }
153   - self.nameLabel.text = [NSString stringWithFormat:@"已连续签到 %ld天",index + 1];
154   -
  163 + self.titleLabel.hidden = activModel == nil;
155 164 self.bottemView.hidden = announModel.list.count == 0;
156 165 self.iconView.hidden = announModel.list.count == 0;
157 166 self.moreView.hidden = announModel.list.count == 0;
... ... @@ -165,6 +174,9 @@
165 174 }
166 175 self.annouLabel.text = tempString;
167 176 }
  177 +
  178 + if (announModel == nil) self.titleLabel.top = CGRectGetMaxY(self.topView.frame) + 10;
  179 +
168 180 }
169 181 -(void)pushAnnouMedthod:(UIButton *)button
170 182 {
... ... @@ -179,6 +191,7 @@
179 191 _titleLabel.font = UIFontCNMake(15);
180 192 _titleLabel.font = UIFontBoldCNMake(15);
181 193 _titleLabel.text = @"积分乐园";
  194 + _titleLabel.hidden = YES;
182 195 }
183 196 return _titleLabel;
184 197 }
... ... @@ -250,7 +263,7 @@
250 263 [_topView.layer addSublayer:topGradientLayer];
251 264 _topGradientLayer = topGradientLayer;
252 265  
253   - UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 110) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)];
  266 + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 20, 130) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)];
254 267 CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
255 268 maskLayer.path = maskPath.CGPath;
256 269 _topView.layer.mask = maskLayer;
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderView.h
... ... @@ -16,9 +16,11 @@ NS_ASSUME_NONNULL_BEGIN
16 16 /// @param scoreModel 签到数据
17 17 /// @param taskModel 任务数据
18 18 /// @param announModel 公告数据
  19 +/// @param activModel 任务数据
19 20 -(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel
20 21 taskModel:(CNLiveCMineInteTaskListModel *)taskModel
21   - announModel:(CNLiveCMineInteListModel *)announModel;
  22 + announModel:(CNLiveCMineInteListModel *)announModel
  23 + activModel:(CNLiveCMineInteListModel *)activModel;
22 24  
23 25 /// 对点击结果进行响应
24 26 @property (nonatomic, copy) ClickActionBlock clickActionBlock;
... ...
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderView.m
... ... @@ -55,7 +55,7 @@
55 55 make.left.mas_equalTo(weakSelf).offset(10);
56 56 make.right.mas_equalTo(weakSelf).offset(-10);
57 57 make.top.mas_equalTo(weakSelf.inteLabel.mas_bottom).offset(15);
58   - make.height.mas_equalTo(150);
  58 + make.height.mas_equalTo(180);
59 59 }];
60 60 }
61 61 -(void)pushMallAction:(UIButton *)btn
... ... @@ -74,11 +74,13 @@
74 74 -(void)setupWithScoreModel:(CNLiveCMineInteScoreModel *)scoreModel
75 75 taskModel:(CNLiveCMineInteTaskListModel *)taskModel
76 76 announModel:(CNLiveCMineInteListModel *)announModel
  77 + activModel:(CNLiveCMineInteListModel *)activModel
77 78 {
78 79 _scoreModel = scoreModel;
79 80 _taskModel = taskModel;
80 81 _announModel = announModel;
81   - [self.signView setupWithScoreModel:scoreModel taskModel:taskModel announModel:announModel];
  82 + _activModel = activModel;
  83 + [self.signView setupWithScoreModel:scoreModel taskModel:taskModel announModel:announModel activModel:activModel];
82 84 NSMutableAttributedString * coin_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@积分",[taskModel.integral isNotBlank]?taskModel.integral:@"0"]];
83 85 [coin_string addAttribute:NSFontAttributeName value:UIFontCNMake(12) range:[coin_string.string rangeOfString:@"积分"]];
84 86 [coin_string addAttribute:NSFontAttributeName value:UIFontBoldCNMake(30) range:NSMakeRange(0, [coin_string.string rangeOfString:@"积分"].location)];
... ...
CNLiveCMineModule/Classes/inte/ViewModel/CNLiveCMineInteViewModel.h
... ... @@ -45,7 +45,7 @@ typedef void(^ClickActionBlock)(CNLiveCMineInteScoreModel * scoreModel,
45 45 /// @param currentType 1-全部 2-获取 3-支出
46 46 /// @param pageNo 页码(默认1)
47 47 /// @param completerBlock 结果返回
48   -+(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel * listModel))completerBlock;
  48 ++(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel * listModel,NSError *error))completerBlock;
49 49  
50 50 @end
51 51  
... ...
CNLiveCMineModule/Classes/inte/ViewModel/CNLiveCMineInteViewModel.m
... ... @@ -117,7 +117,7 @@
117 117 }else{
118 118 CNLiveCMineInteListModel * spListModel = (CNLiveCMineInteListModel *)[CNLiveRespCacheManager objectCacheWithFileName:NSStringFromClass(CNLiveCMineInteListModel.class)];
119 119 if (!spListModel) {
120   - CNLiveCMineInteListModel * spListModel = [[CNLiveCMineInteListModel alloc] init];
  120 + spListModel = [[CNLiveCMineInteListModel alloc] init];
121 121 NSMutableArray * tempArray = [[NSMutableArray alloc] init];
122 122 CNLiveCMineInteListSubModel * subModel = [[CNLiveCMineInteListSubModel alloc] init];
123 123 subModel.contentId = @"21";
... ... @@ -125,6 +125,7 @@
125 125 subModel.title = @"做任务";
126 126 subModel.subTitle = @"赚取更多积分";
127 127 subModel.isEmpty = @"1";
  128 + [tempArray addObject:subModel];
128 129 spListModel.list = tempArray;
129 130 }
130 131 if (spListModel) {
... ... @@ -133,8 +134,8 @@
133 134 }
134 135 }
135 136 }
136   - if (completerBlock) completerBlock(tempArray01,nil);
137 137  
  138 + if (completerBlock) completerBlock(tempArray01,nil);
138 139 } @catch (NSException *exception) {
139 140 NSLog(@"异常了");
140 141 if (completerBlock) completerBlock(nil,@"获取失败");
... ... @@ -147,7 +148,7 @@
147 148 /// @param currentType 1-全部 2-获取 3-支出
148 149 /// @param pageNo 页码(默认1)
149 150 /// @param completerBlock 结果返回
150   -+(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel *))completerBlock
  151 ++(void)requestWithIntegraDetailWithCurrentMonth:(NSString *)currentMonth currentType:(NSInteger)currentType pageNo:(NSInteger)pageNo CompleterBlock:(void(^)(CNLiveCMineInteDetailModel *, NSError *))completerBlock
151 152 {
152 153 NSDictionary * paramDict = @{
153 154 @"sid":[CNUserInfoManager manager].userInfoModel.uid,
... ... @@ -161,7 +162,7 @@
161 162 [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:cn_API_Host(@"/Daren/integral/integralRecordNew.action") Param:paramDict CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
162 163 CNLiveCMineInteDetailModel * listModel = [CNLiveCMineInteDetailModel mj_objectWithKeyValues:responseObject];
163 164 listModel.date_string = currentMonth;
164   - if (!error && listModel && completerBlock) completerBlock(listModel);
  165 + if (completerBlock) completerBlock(listModel,error);
165 166 }];
166 167 }
167 168  
... ...
Example/CNLiveCMineModule/CNLIVEViewController.m
... ... @@ -17,7 +17,7 @@
17 17 -(void)viewDidAppear:(BOOL)animated
18 18 {
19 19 [super viewDidAppear:animated];
20   - [CNLiveCMineModule pushVCWithInteView];
  20 + [CNLiveCMineModule pushVCWithInteViewToFrom:@"" Feedback:NO];
21 21 }
22 22  
23 23 - (void)viewDidLoad
... ...
Example/CNLiveCMineModule/CNLiveCMineViewModuleImpl.m
... ... @@ -28,6 +28,11 @@
28 28  
29 29 }
30 30  
  31 +- (void)pushCMineInteContentForCMainCustomFunctionVCParam:(nonnull NSDictionary *)param CurrentVC:(nonnull UIViewController *)currentVC {
  32 +
  33 +}
  34 +
  35 +
31 36 /// 积分任务跳转到不同界面去完成
32 37 /// @param param 参数
33 38 -(void)pushCMineInteContentForCMainCustomFunctionVCParam:(NSDictionary *)param
... ...