Commit 05e4ed9b54b050bb5f61001468cc9a2a1e3243ae
1 parent
d8e681e9
0.1.0
Showing
15 changed files
with
76 additions
and
23 deletions
CNLiveCMineModule.podspec
CNLiveCMineModule/Classes/CNLiveCMineModule.h
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteAnnouListViewController.m
| ... | ... | @@ -17,14 +17,17 @@ |
| 17 | 17 | -(void)viewWillAppear:(BOOL)animated |
| 18 | 18 | { |
| 19 | 19 | [super viewWillAppear:animated]; |
| 20 | - self.navigationController.navigationBarHidden = YES; | |
| 20 | +// self.navigationController.navigationBarHidden = YES; | |
| 21 | 21 | } |
| 22 | 22 | -(void)viewWillDisappear:(BOOL)animated |
| 23 | 23 | { |
| 24 | 24 | [super viewWillDisappear:animated]; |
| 25 | - self.navigationController.navigationBarHidden = NO; | |
| 25 | +// self.navigationController.navigationBarHidden = NO; | |
| 26 | +} | |
| 27 | +-(BOOL)preferredNavigationBarHidden | |
| 28 | +{ | |
| 29 | + return YES; | |
| 26 | 30 | } |
| 27 | - | |
| 28 | 31 | - (instancetype)initWithAnnouModel:(CNLiveCMineInteListModel *)annouModel |
| 29 | 32 | { |
| 30 | 33 | self = [super init]; | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetaiListlViewController.m
| ... | ... | @@ -84,7 +84,7 @@ |
| 84 | 84 | if (self.detailVC.pagingView.mainTableView.mj_header) return; |
| 85 | 85 | CNLiveRefreshHeader * headerRefresh = [CNLiveRefreshHeader headerWithRefreshingBlock:^{ |
| 86 | 86 | weakSelf.pageNo = 1; |
| 87 | - [weakSelf requestDataSourceWithPageNo:weakSelf.pageNo CurrentMonth:weakSelf.currentMonth CurrentType:weakSelf.currentType]; | |
| 87 | + [(CNLiveCMineInteDetaiListlViewController *)[weakSelf.detailVC setupWithCurrentDetailVC] requestDataSourceWithPageNo:weakSelf.pageNo CurrentMonth:weakSelf.currentMonth CurrentType:[weakSelf.detailVC setupWithCurrentDetailType]]; | |
| 88 | 88 | }]; |
| 89 | 89 | headerRefresh.isShowWhite = YES; |
| 90 | 90 | self.detailVC.pagingView.mainTableView.mj_header = headerRefresh; | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetailViewController.h
| ... | ... | @@ -19,6 +19,12 @@ NS_ASSUME_NONNULL_BEGIN |
| 19 | 19 | /// @param inte 积分 |
| 20 | 20 | - (instancetype)initWithInte:(NSString *)inte; |
| 21 | 21 | |
| 22 | +/// 获取列表界面 | |
| 23 | +-(UIViewController *)setupWithCurrentDetailVC; | |
| 24 | + | |
| 25 | +/// 获取类型 | |
| 26 | +-(NSInteger)setupWithCurrentDetailType; | |
| 27 | + | |
| 22 | 28 | @end |
| 23 | 29 | |
| 24 | 30 | NS_ASSUME_NONNULL_END | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteDetailViewController.m
| ... | ... | @@ -12,6 +12,7 @@ static NSInteger const kCNLiveSectionTitleHeight = 44;//标题显示 |
| 12 | 12 | static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 13 | 13 | |
| 14 | 14 | @interface CNLiveCMineInteDetailViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate> |
| 15 | +/// 界面集合 | |
| 15 | 16 | @property (nonatomic, strong) NSMutableArray<CNLiveCMineInteDetaiListlViewController *> *viewControllers; |
| 16 | 17 | @property (nonatomic, strong) CNLiveNavigationBar * navigationBar;//导航栏 |
| 17 | 18 | @property (nonatomic, strong) JXCategoryTitleView *categoryView; |
| ... | ... | @@ -21,6 +22,7 @@ static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 21 | 22 | @property (nonatomic, assign) NSInteger currentType;//1-全部 2-获取 3-支出 |
| 22 | 23 | @property (nonatomic, copy) NSString * inte;//总积分 |
| 23 | 24 | @property (nonatomic, copy) NSString * currentMonth;//时间 |
| 25 | +@property (nonatomic, strong) NSDate * currentDate;//时间 | |
| 24 | 26 | @end |
| 25 | 27 | |
| 26 | 28 | @implementation CNLiveCMineInteDetailViewController |
| ... | ... | @@ -28,14 +30,17 @@ static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 28 | 30 | -(void)viewWillAppear:(BOOL)animated |
| 29 | 31 | { |
| 30 | 32 | [super viewWillAppear:animated]; |
| 31 | - self.navigationController.navigationBarHidden = YES; | |
| 33 | +// self.navigationController.navigationBarHidden = YES; | |
| 32 | 34 | } |
| 33 | 35 | -(void)viewWillDisappear:(BOOL)animated |
| 34 | 36 | { |
| 35 | 37 | [super viewWillDisappear:animated]; |
| 36 | - self.navigationController.navigationBarHidden = NO; | |
| 38 | +// self.navigationController.navigationBarHidden = NO; | |
| 39 | +} | |
| 40 | +-(BOOL)preferredNavigationBarHidden | |
| 41 | +{ | |
| 42 | + return YES; | |
| 37 | 43 | } |
| 38 | - | |
| 39 | 44 | - (instancetype)initWithInte:(NSString *)inte |
| 40 | 45 | { |
| 41 | 46 | self = [super init]; |
| ... | ... | @@ -54,6 +59,7 @@ static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 54 | 59 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; |
| 55 | 60 | [dateFormatter setDateFormat:@"yyyy-MM"]; |
| 56 | 61 | self.currentMonth = [dateFormatter stringFromDate:[NSDate date]]; |
| 62 | + self.currentDate = [NSDate date]; | |
| 57 | 63 | |
| 58 | 64 | [self.view addSubview:self.backView]; |
| 59 | 65 | [self.view addSubview:self.pagingView]; |
| ... | ... | @@ -67,7 +73,7 @@ static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 67 | 73 | self.headerView = [[CNLiveCMineInteDetailHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kCNLiveSectionHeaderHeight)]; |
| 68 | 74 | self.headerView.backgroundColor = [UIColor clearColor]; |
| 69 | 75 | self.headerView.selectWithDateBlock = ^{ |
| 70 | - [CNLiveCMineInteHeaderCustomView showWithSelectMonthDateForCurrentVC:weakSelf]; | |
| 76 | + [CNLiveCMineInteHeaderCustomView showWithSelectMonthDateForCurrentTime:weakSelf.currentDate CurrentVC:weakSelf]; | |
| 71 | 77 | }; |
| 72 | 78 | return self.headerView; |
| 73 | 79 | } |
| ... | ... | @@ -112,6 +118,7 @@ static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 112 | 118 | [dateFormatter setLocale:[NSLocale currentLocale]]; |
| 113 | 119 | [dateFormatter setDateFormat:@"yyyy-MM"]; |
| 114 | 120 | self.currentMonth = [dateFormatter stringFromDate:date]; |
| 121 | + self.currentDate = date; | |
| 115 | 122 | |
| 116 | 123 | CNLiveCMineInteDetaiListlViewController * listView01 = self.viewControllers[0]; |
| 117 | 124 | [listView01 requestDataSourceWithPageNo:1 CurrentMonth:self.currentMonth CurrentType:1]; |
| ... | ... | @@ -133,6 +140,17 @@ static NSInteger const kCNLiveSectionHeaderHeight = 120;//头视图高度 |
| 133 | 140 | return _viewControllers; |
| 134 | 141 | } |
| 135 | 142 | |
| 143 | +/// 获取列表界面 | |
| 144 | +-(UIViewController *)setupWithCurrentDetailVC | |
| 145 | +{ | |
| 146 | + CNLiveCMineInteDetaiListlViewController * listView = self.viewControllers[self.categoryView.selectedIndex]; | |
| 147 | + return listView; | |
| 148 | +} | |
| 149 | +/// 获取类型 | |
| 150 | +-(NSInteger)setupWithCurrentDetailType | |
| 151 | +{ | |
| 152 | + return self.categoryView.selectedIndex + 1; | |
| 153 | +} | |
| 136 | 154 | #pragma mark = getter |
| 137 | 155 | -(JXPagerView *)pagingView |
| 138 | 156 | { | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteTaskViewController.m
| ... | ... | @@ -26,14 +26,17 @@ static NSInteger const kCNLiveSectionHeaderHeight = 140;//头视图高度 |
| 26 | 26 | -(void)viewWillAppear:(BOOL)animated |
| 27 | 27 | { |
| 28 | 28 | [super viewWillAppear:animated]; |
| 29 | - self.navigationController.navigationBarHidden = YES; | |
| 29 | +// self.navigationController.navigationBarHidden = YES; | |
| 30 | 30 | } |
| 31 | 31 | -(void)viewWillDisappear:(BOOL)animated |
| 32 | 32 | { |
| 33 | 33 | [super viewWillDisappear:animated]; |
| 34 | - self.navigationController.navigationBarHidden = NO; | |
| 34 | +// self.navigationController.navigationBarHidden = NO; | |
| 35 | +} | |
| 36 | +-(BOOL)preferredNavigationBarHidden | |
| 37 | +{ | |
| 38 | + return YES; | |
| 35 | 39 | } |
| 36 | - | |
| 37 | 40 | - (instancetype)initWithTaskModel:(CNLiveCMineInteTaskListModel *)taskModel |
| 38 | 41 | { |
| 39 | 42 | self = [super init]; | ... | ... |
CNLiveCMineModule/Classes/inte/Controller/CNLiveCMineInteViewController.m
| ... | ... | @@ -29,12 +29,17 @@ |
| 29 | 29 | -(void)viewWillAppear:(BOOL)animated |
| 30 | 30 | { |
| 31 | 31 | [super viewWillAppear:animated]; |
| 32 | - self.navigationController.navigationBarHidden = YES; | |
| 32 | +// self.navigationController.navigationBarHidden = YES; | |
| 33 | + [self reloadDataSource]; | |
| 33 | 34 | } |
| 34 | 35 | -(void)viewWillDisappear:(BOOL)animated |
| 35 | 36 | { |
| 36 | 37 | [super viewWillDisappear:animated]; |
| 37 | - self.navigationController.navigationBarHidden = NO; | |
| 38 | +// self.navigationController.navigationBarHidden = NO; | |
| 39 | +} | |
| 40 | +-(BOOL)preferredNavigationBarHidden | |
| 41 | +{ | |
| 42 | + return YES; | |
| 38 | 43 | } |
| 39 | 44 | -(void)reloadDataSource |
| 40 | 45 | { |
| ... | ... | @@ -64,7 +69,6 @@ |
| 64 | 69 | [self.view addSubview:self.navigationBar]; |
| 65 | 70 | [self.view addSubview:self.backView]; |
| 66 | 71 | [self.view addSubview:self.mainCollectionView]; |
| 67 | - [self reloadDataSource]; | |
| 68 | 72 | |
| 69 | 73 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(successAddScoreNotification:) name:kCNLiveCMineInteTaskAddScoreRequestSuccessNotification object:nil]; |
| 70 | 74 | } | ... | ... |
CNLiveCMineModule/Classes/inte/Model/CNLiveCMineInteModel.h
| ... | ... | @@ -180,6 +180,8 @@ NS_ASSUME_NONNULL_BEGIN |
| 180 | 180 | @property (nonatomic, copy) NSString *date_string; |
| 181 | 181 | /**当前的总积分 自定义的*/ |
| 182 | 182 | @property (nonatomic, copy) NSString *currentInte; |
| 183 | +/**当前时间 自定义的*/ | |
| 184 | +@property (nonatomic, copy) NSDate *currentDate; | |
| 183 | 185 | @end |
| 184 | 186 | @interface CNLiveCMineInteDetailListModel : NSObject<NSCoding> |
| 185 | 187 | /**1-跳转优惠券 2-跳订单列表 3-不跳转*/ | ... | ... |
CNLiveCMineModule/Classes/inte/Model/CNLiveCMineInteModel.m
| ... | ... | @@ -43,6 +43,18 @@ MJCodingImplementation |
| 43 | 43 | @implementation CNLiveCMineInteListSubModel |
| 44 | 44 | MJCodingImplementation |
| 45 | 45 | |
| 46 | +- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property | |
| 47 | +{ | |
| 48 | + if ([property.name isEqualToString:@"publishTime"]) { | |
| 49 | + NSString * publishTime = [NSString stringWithFormat:@"%@",oldValue]; | |
| 50 | + NSArray * array00 = [publishTime componentsSeparatedByString:@" "]; | |
| 51 | + NSArray * array01 = [array00.lastObject componentsSeparatedByString:@":"]; | |
| 52 | + NSString * newTime = [NSString stringWithFormat:@"%@ %@:%@",array00.firstObject,array01.firstObject,[array01 objectAtIndex:1]]; | |
| 53 | + return newTime; | |
| 54 | + } | |
| 55 | + return oldValue; | |
| 56 | +} | |
| 57 | + | |
| 46 | 58 | @end |
| 47 | 59 | |
| 48 | 60 | @implementation CNLiveCMineInteListProductModel | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteCollectionViewCell.m
| ... | ... | @@ -286,12 +286,12 @@ |
| 286 | 286 | make.width.offset(70); |
| 287 | 287 | }]; |
| 288 | 288 | [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 289 | - make.top.equalTo(weakSelf.mainView.mas_top).with.offset(15); | |
| 289 | + make.top.equalTo(weakSelf.mainView.mas_top).with.offset(10); | |
| 290 | 290 | make.left.equalTo(weakSelf.leftImage.mas_right).with.offset(10); |
| 291 | 291 | make.right.equalTo(weakSelf.completeBtn.mas_left).with.offset(-10); |
| 292 | 292 | }]; |
| 293 | 293 | [self.pointLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 294 | - make.bottom.equalTo(weakSelf.mainView.mas_bottom).with.offset(-15); | |
| 294 | + make.bottom.equalTo(weakSelf.mainView.mas_bottom).with.offset(-10); | |
| 295 | 295 | make.left.equalTo(weakSelf.leftImage.mas_right).with.offset(10); |
| 296 | 296 | }]; |
| 297 | 297 | [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteDetailHeaderView.m
| ... | ... | @@ -36,12 +36,13 @@ |
| 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:@"获取:%@",[detailModel.payIntegral isNotBlank]?detailModel.payIntegral:@"0"]]; | |
| 39 | + | |
| 40 | + NSMutableAttributedString * spend_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"获取:%@",[detailModel.obtainIntegral isNotBlank]?detailModel.obtainIntegral:@"0"]]; | |
| 40 | 41 | [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[spend_string.string rangeOfString:@"获取:"]]; |
| 41 | 42 | [spend_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [spend_string.string rangeOfString:@"获取:"].location)]; |
| 42 | 43 | self.spendLabel.attributedText = spend_string; |
| 43 | 44 | |
| 44 | - NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"支出:%@",[detailModel.obtainIntegral isNotBlank]?detailModel.obtainIntegral:@"0"]]; | |
| 45 | + NSMutableAttributedString * obta_string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"支出:%@",[detailModel.payIntegral isNotBlank]?detailModel.payIntegral:@"0"]]; | |
| 45 | 46 | [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:11] range:[obta_string.string rangeOfString:@"支出:"]]; |
| 46 | 47 | [obta_string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, [obta_string.string rangeOfString:@"支出:"].location)]; |
| 47 | 48 | self.obtaLabel.attributedText = obta_string; | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderCustomView.h
| ... | ... | @@ -23,8 +23,9 @@ NS_ASSUME_NONNULL_BEGIN |
| 23 | 23 | +(void)showWithScoreViewForScoreIntergal:(NSString *)scoreIntergal Statue:(BOOL)statue; |
| 24 | 24 | |
| 25 | 25 | /// 显示选择样式 |
| 26 | +/// @param currentTime 当前时间 | |
| 26 | 27 | /// @param currentVC 当前界面 |
| 27 | -+(void)showWithSelectMonthDateForCurrentVC:(CNLiveCMineInteDetailViewController *)currentVC; | |
| 28 | ++(void)showWithSelectMonthDateForCurrentTime:(NSDate *)currentTime CurrentVC:(CNLiveCMineInteDetailViewController *)currentVC; | |
| 28 | 29 | |
| 29 | 30 | |
| 30 | 31 | @end | ... | ... |
CNLiveCMineModule/Classes/inte/View/CNLiveCMineInteHeaderCustomView.m
| ... | ... | @@ -177,7 +177,7 @@ |
| 177 | 177 | |
| 178 | 178 | /// 显示选择样式 |
| 179 | 179 | /// @param currentVC 当前界面 |
| 180 | -+(void)showWithSelectMonthDateForCurrentVC:(CNLiveCMineInteDetailViewController *)currentVC | |
| 180 | ++(void)showWithSelectMonthDateForCurrentTime:(NSDate *)currentTime CurrentVC:(CNLiveCMineInteDetailViewController *)currentVC | |
| 181 | 181 | { |
| 182 | 182 | PGDatePickManager *datePickManager = [[PGDatePickManager alloc] init]; |
| 183 | 183 | datePickManager.style = PGDatePickManagerStyleSheet; |
| ... | ... | @@ -192,6 +192,9 @@ |
| 192 | 192 | datePicker.lineBackgroundColor = RGB(232, 232, 232); |
| 193 | 193 | datePicker.textColorOfSelectedRow = KBlack51Color; |
| 194 | 194 | datePicker.textColorOfOtherRow = RGB(169, 169, 169); |
| 195 | + [datePicker setDate:currentTime]; | |
| 196 | + | |
| 197 | + | |
| 195 | 198 | |
| 196 | 199 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; |
| 197 | 200 | dateFormatter.dateFormat = @"yyyy-MM"; | ... | ... |
Example/CNLiveCMineModule/CNLIVEAppDelegate.m
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | |
| 29 | 29 | [super application:application didFinishLaunchingWithOptions:launchOptions]; |
| 30 | 30 | |
| 31 | - [CNUserInfoManager manager].userInfoModel.uid = @"10510277";//@"353001"; | |
| 31 | + [CNUserInfoManager manager].userInfoModel.uid = @"353001";//@"10510277";// | |
| 32 | 32 | |
| 33 | 33 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; |
| 34 | 34 | self.window.backgroundColor = [UIColor whiteColor]; | ... | ... |