YOUPAIHRGuildDetailVC.m 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // YOUPAIHRGuildDetailVC.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/11/5.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRGuildDetailVC.h"
  9. #import "JXCategoryView.h"
  10. #import "JXPagerView.h"
  11. #import "YOUPAIHRSubGuildDetailVC.h"
  12. #import "PGDatePickManager.h"
  13. #import "BRPickerView.h"
  14. #import "UIViewController+TFPresent.h"
  15. #import "YOUPAIHRDatePickerView.h"
  16. #define LZCategoryViewHeight 44.0f
  17. #define LZCategoryViewItemWidth 12.0f
  18. @interface YOUPAIHRGuildDetailVC ()<JXCategoryViewDelegate,JXPagerViewDelegate,JXCategoryListContainerViewDelegate>
  19. @property (nonatomic, weak) JXCategoryListContainerView *youpaippagerView;
  20. @property (nonatomic, strong) JXCategoryTitleView *youpaipcategoryView;
  21. @property (strong, nonatomic) NSArray *youpaiptitlesArr;
  22. @property (nonatomic, strong) NSMutableArray *youpaipdotStates;
  23. @property(nonatomic,strong)NSString *youpaipdate;
  24. @property(nonatomic,copy)NSString *youpaipstarDate;
  25. @property(nonatomic,copy)NSString *youpaipendDate;
  26. @end
  27. @implementation YOUPAIHRGuildDetailVC
  28. - (void)viewDidLoad {
  29. [super viewDidLoad];
  30. self.title = @"公会明细";
  31. self.youpaiptitlesArr = @[@"全部",LCStr(word32),LCStr(word33)];//房间分成 公会分成
  32. [self youpaifsetupUI];
  33. }
  34. - (void)datePicker:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents{
  35. NSLog(@"dateComponents = %@", dateComponents);
  36. NSInteger year=[dateComponents year];
  37. NSInteger month=[dateComponents month];
  38. self.youpaipdate = [NSString stringWithFormat:@"%ld-%ld",year,month];
  39. [[NSNotificationCenter defaultCenter]postNotificationName:@"changSelectDate" object:nil userInfo:@{@"date":self.youpaipdate}];
  40. }
  41. -(void)youpaiffilterAction{
  42. YOUPAIHRDatePickerView *vc = [YOUPAIHRDatePickerView new];
  43. vc.isTouchDismiss = YES;
  44. [self TFPresentVC:vc completion:^{
  45. }];
  46. @weakify(self);
  47. [vc setYoupaipselectDayDate:^(NSString * _Nonnull starTime, NSString * _Nonnull endTime) {
  48. @strongify(self);
  49. self.youpaipstarDate = [NSString stringWithFormat:@"%@ 00:00:00",starTime];
  50. self.youpaipendDate = [NSString stringWithFormat:@"%@ 23:59:59",endTime];
  51. NSLog(@"%@%@",self.youpaipstarDate,self.youpaipendDate);
  52. [[NSNotificationCenter defaultCenter]postNotificationName:@"changSelectDate" object:nil userInfo:@{@"starDate":self.youpaipstarDate,@"endDate":self.youpaipendDate,@"timeType":@"1"}];
  53. }];
  54. [vc setYoupaipselectMonthDate:^(NSString * _Nonnull date) {
  55. @strongify(self);
  56. self.youpaipstarDate = [LCTools getMonthFirstDayWithDate:[LCTools stringToDate:date :NO] format:@"YYYY-MM-dd HH:mm:ss"];
  57. self.youpaipendDate = [LCTools getMonthLastDayWithDate:[LCTools stringToDate:date :NO] format:@"YYYY-MM-dd HH:mm:ss"];
  58. NSLog(@"%@%@",self.youpaipstarDate,self.youpaipendDate);
  59. [[NSNotificationCenter defaultCenter]postNotificationName:@"changSelectDate" object:nil userInfo:@{@"starDate":self.youpaipstarDate,@"endDate":self.youpaipendDate,@"timeType":@"2"}];
  60. }];
  61. }
  62. -(void)youpaifsetupUI{
  63. self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(youpaiffilterAction) title:@"筛选" font:LCFont14 titleColor:HexColorFromRGB(0xffffff) highlightedColor:HexColorFromRGB(0xffffff) titleEdgeInsets:UIEdgeInsetsZero];
  64. JXCategoryTitleView *youpaipcategoryView = [[JXCategoryTitleView alloc] init];
  65. [self.view addSubview:youpaipcategoryView];
  66. [youpaipcategoryView mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.top.mas_equalTo(NavBarHeight);
  68. make.left.mas_equalTo(0);
  69. make.right.mas_equalTo(0);
  70. make.height.mas_equalTo(LZCategoryViewHeight);
  71. }];
  72. youpaipcategoryView.backgroundColor = LCBkgColor;
  73. youpaipcategoryView.titles = self.youpaiptitlesArr;
  74. youpaipcategoryView.delegate = self;
  75. youpaipcategoryView.titleSelectedColor = HexColorFromRGB(0xffffff);
  76. youpaipcategoryView.titleColor = HexColorFromRGB(0x9F9DA5);
  77. youpaipcategoryView.titleColorGradientEnabled = YES;
  78. youpaipcategoryView.titleFont = LCFont(14.0f);
  79. youpaipcategoryView.titleSelectedFont = LCBoldFont(14.0f);
  80. // youpaipcategoryView.cellWidth = 60;
  81. youpaipcategoryView.cellSpacing = 28.0f;
  82. youpaipcategoryView.contentEdgeInsetLeft = 105;
  83. youpaipcategoryView.contentEdgeInsetRight = 75;
  84. youpaipcategoryView.averageCellSpacingEnabled = YES;
  85. self.youpaipcategoryView = youpaipcategoryView;
  86. JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
  87. lineView.verticalMargin = 4.0f;
  88. lineView.indicatorHeight = 2.5f;
  89. lineView.indicatorWidth = 8;
  90. lineView.layer.cornerRadius = 1.25;
  91. lineView.layer.masksToBounds = YES;
  92. [lineView.layer addSublayer:[LCTools getGradientLayerWithSize:CGSizeMake(lineView.indicatorWidth, lineView.indicatorHeight) twoColors:@[HexColorFromRGB(0xFF0084),HexColorFromRGB(0xFF3A00)] gradientType:GradientLeftToRight]];
  93. youpaipcategoryView.indicators = @[lineView];
  94. JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
  95. pagerView.listCellBackgroundColor = LCBkgColor;
  96. [self.view addSubview:pagerView];
  97. [pagerView mas_makeConstraints:^(MASConstraintMaker *make) {
  98. make.top.mas_equalTo(youpaipcategoryView.mas_bottom).offset(0);
  99. make.left.mas_equalTo(0);
  100. make.right.mas_equalTo(0);
  101. make.bottom.mas_equalTo(-SafeHeight);
  102. }];
  103. self.youpaippagerView = pagerView;
  104. self.youpaipcategoryView.listContainer = self.youpaippagerView;
  105. }
  106. // 返回列表的数量
  107. - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
  108. return self.youpaiptitlesArr.count;
  109. }
  110. // 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例
  111. - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
  112. // 0:全部 1:收益 2:支出 3:其他
  113. //收支:1=收入,2=支出,默认全部
  114. NSArray *typeArr = @[@"0",@"1",@"2"];
  115. YOUPAIHRSubGuildDetailVC *vc = [YOUPAIHRSubGuildDetailVC new];
  116. vc.youpaiptype = [typeArr[index] integerValue];
  117. return vc;
  118. }
  119. @end