123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- //
- // YOUPAIHRGuildDetailVC.m
- // VQU
- //
- // Created by xiaohaoran on 2021/11/5.
- // Copyright © 2021 MS. All rights reserved.
- //
- #import "YOUPAIHRGuildDetailVC.h"
- #import "JXCategoryView.h"
- #import "JXPagerView.h"
- #import "YOUPAIHRSubGuildDetailVC.h"
- #import "PGDatePickManager.h"
- #import "BRPickerView.h"
- #import "UIViewController+TFPresent.h"
- #import "YOUPAIHRDatePickerView.h"
- #define LZCategoryViewHeight 44.0f
- #define LZCategoryViewItemWidth 12.0f
- @interface YOUPAIHRGuildDetailVC ()<JXCategoryViewDelegate,JXPagerViewDelegate,JXCategoryListContainerViewDelegate>
- @property (nonatomic, weak) JXCategoryListContainerView *youpaippagerView;
- @property (nonatomic, strong) JXCategoryTitleView *youpaipcategoryView;
- @property (strong, nonatomic) NSArray *youpaiptitlesArr;
- @property (nonatomic, strong) NSMutableArray *youpaipdotStates;
- @property(nonatomic,strong)NSString *youpaipdate;
- @property(nonatomic,copy)NSString *youpaipstarDate;
- @property(nonatomic,copy)NSString *youpaipendDate;
- @end
- @implementation YOUPAIHRGuildDetailVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.title = @"公会明细";
- self.youpaiptitlesArr = @[@"全部",LCStr(word32),LCStr(word33)];//房间分成 公会分成
- [self youpaifsetupUI];
- }
- - (void)datePicker:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents{
- NSLog(@"dateComponents = %@", dateComponents);
- NSInteger year=[dateComponents year];
- NSInteger month=[dateComponents month];
- self.youpaipdate = [NSString stringWithFormat:@"%ld-%ld",year,month];
- [[NSNotificationCenter defaultCenter]postNotificationName:@"changSelectDate" object:nil userInfo:@{@"date":self.youpaipdate}];
- }
- -(void)youpaiffilterAction{
-
- YOUPAIHRDatePickerView *vc = [YOUPAIHRDatePickerView new];
- vc.isTouchDismiss = YES;
- [self TFPresentVC:vc completion:^{
-
-
- }];
- @weakify(self);
- [vc setYoupaipselectDayDate:^(NSString * _Nonnull starTime, NSString * _Nonnull endTime) {
- @strongify(self);
- self.youpaipstarDate = [NSString stringWithFormat:@"%@ 00:00:00",starTime];
- self.youpaipendDate = [NSString stringWithFormat:@"%@ 23:59:59",endTime];
- NSLog(@"%@%@",self.youpaipstarDate,self.youpaipendDate);
- [[NSNotificationCenter defaultCenter]postNotificationName:@"changSelectDate" object:nil userInfo:@{@"starDate":self.youpaipstarDate,@"endDate":self.youpaipendDate,@"timeType":@"1"}];
- }];
- [vc setYoupaipselectMonthDate:^(NSString * _Nonnull date) {
- @strongify(self);
- self.youpaipstarDate = [LCTools getMonthFirstDayWithDate:[LCTools stringToDate:date :NO] format:@"YYYY-MM-dd HH:mm:ss"];
- self.youpaipendDate = [LCTools getMonthLastDayWithDate:[LCTools stringToDate:date :NO] format:@"YYYY-MM-dd HH:mm:ss"];
- NSLog(@"%@%@",self.youpaipstarDate,self.youpaipendDate);
- [[NSNotificationCenter defaultCenter]postNotificationName:@"changSelectDate" object:nil userInfo:@{@"starDate":self.youpaipstarDate,@"endDate":self.youpaipendDate,@"timeType":@"2"}];
- }];
- }
- -(void)youpaifsetupUI{
- self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(youpaiffilterAction) title:@"筛选" font:LCFont14 titleColor:HexColorFromRGB(0xffffff) highlightedColor:HexColorFromRGB(0xffffff) titleEdgeInsets:UIEdgeInsetsZero];
- JXCategoryTitleView *youpaipcategoryView = [[JXCategoryTitleView alloc] init];
- [self.view addSubview:youpaipcategoryView];
- [youpaipcategoryView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(NavBarHeight);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(LZCategoryViewHeight);
- }];
- youpaipcategoryView.backgroundColor = LCBkgColor;
- youpaipcategoryView.titles = self.youpaiptitlesArr;
- youpaipcategoryView.delegate = self;
- youpaipcategoryView.titleSelectedColor = HexColorFromRGB(0xffffff);
- youpaipcategoryView.titleColor = HexColorFromRGB(0x9F9DA5);
- youpaipcategoryView.titleColorGradientEnabled = YES;
- youpaipcategoryView.titleFont = LCFont(14.0f);
- youpaipcategoryView.titleSelectedFont = LCBoldFont(14.0f);
- // youpaipcategoryView.cellWidth = 60;
- youpaipcategoryView.cellSpacing = 28.0f;
- youpaipcategoryView.contentEdgeInsetLeft = 105;
- youpaipcategoryView.contentEdgeInsetRight = 75;
- youpaipcategoryView.averageCellSpacingEnabled = YES;
- self.youpaipcategoryView = youpaipcategoryView;
- JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
- lineView.verticalMargin = 4.0f;
- lineView.indicatorHeight = 2.5f;
- lineView.indicatorWidth = 8;
- lineView.layer.cornerRadius = 1.25;
- lineView.layer.masksToBounds = YES;
- [lineView.layer addSublayer:[LCTools getGradientLayerWithSize:CGSizeMake(lineView.indicatorWidth, lineView.indicatorHeight) twoColors:@[HexColorFromRGB(0xFF0084),HexColorFromRGB(0xFF3A00)] gradientType:GradientLeftToRight]];
- youpaipcategoryView.indicators = @[lineView];
-
- JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
- pagerView.listCellBackgroundColor = LCBkgColor;
-
- [self.view addSubview:pagerView];
- [pagerView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(youpaipcategoryView.mas_bottom).offset(0);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(-SafeHeight);
- }];
- self.youpaippagerView = pagerView;
-
- self.youpaipcategoryView.listContainer = self.youpaippagerView;
-
- }
- // 返回列表的数量
- - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
- return self.youpaiptitlesArr.count;
- }
- // 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例
- - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
- // 0:全部 1:收益 2:支出 3:其他
- //收支:1=收入,2=支出,默认全部
- NSArray *typeArr = @[@"0",@"1",@"2"];
- YOUPAIHRSubGuildDetailVC *vc = [YOUPAIHRSubGuildDetailVC new];
- vc.youpaiptype = [typeArr[index] integerValue];
-
- return vc;
-
-
- }
- @end
|