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