15555599100 5 лет назад
Родитель
Сommit
5ae7b3c559

+ 10 - 11
HappyJob/HappyJob/API/FBNetworking/FBBaseAPIManager.m

@@ -225,15 +225,15 @@
         if (errorType == FBAPIManagerErrorTypeNoError)
         {
             self.errorType = errorType;
-            
-            if ([self.APIManagerInterceptor respondsToSelector:@selector(managerShouldFinishCallAPI:)])
+        
+            if ([self.APIManagerDelegate respondsToSelector:@selector(managerCallAPIDidSuccess:)])
             {
-                [self.APIManagerInterceptor managerShouldFinishCallAPI:self];//结束指示器
+                [self.APIManagerDelegate managerCallAPIDidSuccess:self];//成功回调
             }
             
-            if ([self.APIManagerDelegate respondsToSelector:@selector(managerCallAPIDidSuccess:)])
+            if ([self.APIManagerInterceptor respondsToSelector:@selector(managerShouldFinishCallAPI:)])
             {
-                [self.APIManagerDelegate managerCallAPIDidSuccess:self];//成功回调
+                [self.APIManagerInterceptor managerShouldFinishCallAPI:self];//结束指示器
             }
         }
         else
@@ -259,16 +259,15 @@
     {
         self.errorMessage = @"参数有误";
     }
-    
-    if ([self.APIManagerInterceptor respondsToSelector:@selector(managerShouldFinishCallAPI:)])
-    {
-        [self.APIManagerInterceptor managerShouldFinishCallAPI:self];//结束指示器
-    }
-    
+
     if ([self.APIManagerDelegate respondsToSelector:@selector(managerCallAPIDidFailed:)])
     {
         [self.APIManagerDelegate managerCallAPIDidFailed:self];//失败回调
     }
+    if ([self.APIManagerInterceptor respondsToSelector:@selector(managerShouldFinishCallAPI:)])
+    {
+        [self.APIManagerInterceptor managerShouldFinishCallAPI:self];//结束指示器
+    }
 }
 
 @end

+ 2 - 2
HappyJob/HappyJob/CClass/ClockIn_打卡/View/HJClockInStateView.m

@@ -115,7 +115,7 @@
             case HJClockInStateTypeGoWork:
             {//上班
                 [self.clockInButton setImage:[UIImage imageNamed:@"clockIn_can"] forState:UIControlStateNormal];
-                self.promptView.icon.image = [UIImage imageNamed:@"clockIn_state_complete"];
+                self.promptView.icon.image = [UIImage imageNamed:@"clockIn_state_can"];
                 self.promptView.textLabel.text = @"已进入考勤打卡范围";
                 [self goWork];
             }
@@ -132,7 +132,7 @@
             case HJClockInStateTypeAfterWork:
             {//下班
                 [self.clockInButton setImage:[UIImage imageNamed:@"clockOut_can"] forState:UIControlStateNormal];
-                self.promptView.icon.image = [UIImage imageNamed:@"clockIn_state_complete"];
+                self.promptView.icon.image = [UIImage imageNamed:@"clockIn_state_can"];
                 self.promptView.textLabel.text = @"已进入考勤打卡范围";
                 [self afterWork];
             }

+ 1 - 1
HappyJob/HappyJob/CClass/ClockIn_打卡/View/HJClockInSuccessView.m

@@ -109,7 +109,7 @@
     {
         _bgView = [[UIView alloc] init];
         _bgView.backgroundColor = [UIColor whiteColor];
-        _bgView.layer.cornerRadius = 16;
+        _bgView.layer.cornerRadius = 8;
     }
     return _bgView;
 }

+ 4 - 4
HappyJob/HappyJob/CClass/ClockIn_打卡/ViewController/HJClockInSuccessViewController.m

@@ -63,22 +63,22 @@
             
             case HJClockInSuccessTypeGoWork:
             {
-                self.successView.clockInTimeLabel.text = [HJAppService time_timestampToString:model.startPunchClock withType:kTimeStampDateOnlyHMS];
                 self.successView.titleLabel.text = @"上班打卡成功";
+                self.successView.clockInTimeLabel.text = [HJAppService time_timestampToString:model.startPunchClock withType:kTimeStampDateOnlyHMS];
                 self.successView.promptLabel.text = @"新的一天开始啦! \n今天的你也要光芒万丈!记得下班也要打卡哦!";
-//                self.successView.promptLabel.attributedText = [self.successView attributedText:self.successView.promptLabel.text DINCondensedBlod:@"" DINCondensedBlod:@"" sizeFont:21];
+                self.successView.promptLabel.attributedText = [self.successView attributedText:self.successView.promptLabel.text DINCondensedBlod:@"" DINCondensedBlod:@"" sizeFont:21];
             }
             break;
             
             case HJClockInSuccessTypeAfterWork:
             {
+                self.successView.titleLabel.text = @"下班打卡成功";
+                
                 self.successView.advanceLabel.text = [NSString stringWithFormat:@"累计预支%@元",model.sumMoney];
                 self.successView.advanceLabel.attributedText = [self.successView attributedText:self.successView.advanceLabel.text DINCondensedBlod:model.sumMoney DINCondensedBlod:@"" sizeFont:29];
                 
                 self.successView.clockInTimeLabel.text = [HJAppService time_timestampToString:model.endPunchClock withType:kTimeStampDateOnlyHMS];
                 
-                self.successView.titleLabel.text = @"下班打卡成功";
-                
                 self.successView.promptLabel.text = [NSString stringWithFormat:@"今日打卡已完成,打卡时长%@小时, \n可预支工资%@元。明天也要努力哦!",model.duration,model.todayMoney];
                 self.successView.promptLabel.attributedText = [self.successView attributedText:self.successView.promptLabel.text DINCondensedBlod:model.duration ? model.duration:@"0" DINCondensedBlod:model.todayMoney ? model.todayMoney:@"0" sizeFont:21];
             }

+ 4 - 4
HappyJob/HappyJob/CClass/ClockIn_打卡/ViewController/HJClockInViewController.m

@@ -22,7 +22,6 @@
 #import "HJClockInAPI.h"//打卡
 #import "HJClockInInfoModel.h"
 #import "HJClockInDataBox.h"
-#import <CoreLocation/CLLocationManager.h>
 
 @interface HJClockInViewController ()
 <
@@ -385,6 +384,7 @@ UIScrollViewDelegate
 
 #pragma mark - event
 
+/* 打开系统设置 */
 - (void)confirmButtonAction:(UIButton *)btn {
     
     [self dismissViewControllerAnimated:YES completion:nil];
@@ -443,14 +443,14 @@ UIScrollViewDelegate
 - (void)clockInClick:(UIButton *)btn {
     
     if (self.stateView.stateType == HJClockInStateTypeGoWork)
-    {
+    {//上班打卡
         self.stateView.clockInButton.userInteractionEnabled = NO;
         self.clockInAPI.clockType = @"1";
         self.clockInAPI.wsPunchClockId = @"";
         [self locationShowLoading:YES clockInAPI:YES];
     }
     if (self.stateView.stateType == HJClockInStateTypeAfterWork)
-    {
+    {//下班打卡
         self.stateView.clockInButton.userInteractionEnabled = NO;
         self.clockInAPI.clockType = @"2";
         self.clockInAPI.wsPunchClockId = self.infoModel.wsPunchClockId;
@@ -460,7 +460,7 @@ UIScrollViewDelegate
 
 /* 重新定位 */
 - (void)retryButtonAction:(UIButton *)tap {
-    
+     
     [self locationShowLoading:YES clockInAPI:NO];
 }
 

+ 1 - 1
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/View/StatisticView/HJClockInStatisticCalendarView.m

@@ -72,7 +72,7 @@
         rows =  self.calendarView.viewModel.numberCellArray.count / 7 ;
     }
     
-    CGFloat height = rows * (SCREEN_WIDTH - 20)/7 + 40 + 5;
+    CGFloat height = rows * (SCREEN_WIDTH - 20)/7 + 40 + 5;//40是头部视图的高度,5是留的距离
     return height;
 }
 

+ 4 - 2
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/View/StatisticView/HJClockInStatisticDayView.m

@@ -52,7 +52,10 @@
     }
     [self initSubViews];
     NSArray *clockListArray = [NSArray arrayWithArray:dataDict[@"punckClockList"]];
-    _ruleLabel.text = [NSString stringWithFormat:@"规则:自由上下班打卡 00:00-24:00 \n当日打卡%lu次,工时%@小时",(unsigned long)clockListArray.count,dataDict[@"currentDuration"]];
+    
+
+    _ruleLabel.text = [NSString stringWithFormat:@"规则:自由上下班打卡 00:00-24:00 \n当日打卡%@次,工时%@小时",dataDict[@"clockCount"],dataDict[@"currentDuration"]];
+    
     _wageView.moneyLabel.text = [NSString stringWithFormat:@"%.2f",[dataDict[@"nextMoney"] floatValue]];
     
     if (clockListArray.count == 0)
@@ -154,7 +157,6 @@
         _ruleLabel.font = [UIFont systemFontOfSize:13];
         _ruleLabel.textColor = COLOR_666666;
         _ruleLabel.numberOfLines = 0;
-        _ruleLabel.text = @"规则:自由上下班打卡 00:00-24:00 \n当日打卡2次,工时10小时";
     }
     return _ruleLabel;
 }

+ 3 - 3
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/View/日历模块/ClockInCalendarView.m

@@ -72,8 +72,8 @@
             cell.dateLable.textColor = COLOR_000000;
         }
         
-        ClockInCalendarCCell *cell = (ClockInCalendarCCell*)[self.collectionView
-        cellForItemAtIndexPath:indexPath];
+        ClockInCalendarCCell *cell = (ClockInCalendarCCell*)[self.collectionView cellForItemAtIndexPath:indexPath];
+        
         if (model.startPunchClock.length > 0 && model.endPunchClock.length <=0 )
         {//缺卡
             cell.dateLable.backgroundColor = [UIColor colorFromHexString:@"FD7235"];
@@ -85,7 +85,7 @@
         cell.dateLable.textColor = [UIColor whiteColor];
         self.lastInexPath = indexPath;
         self.selectDayBlock(model.date);
-        self.viewModel.today = @"";
+        self.viewModel.today = model.date;
     }
 }
 

+ 1 - 1
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/View/日历模块/ClockInCalendarViewModel.h

@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) NSInteger        year;//年
 @property (nonatomic, assign) NSInteger        month;//月
 @property (nonatomic, assign) NSInteger        day;//日
-@property (nonatomic, copy)   NSString         *today;//今天
+@property (nonatomic, copy)   NSString         *today;//选择的天(默认是当天的)
 @property (nonatomic, strong) void(^todayIndexPathBlock)(NSIndexPath *indexPath);
 
 - (instancetype)initWithServicerDate:(NSString *)date;

+ 20 - 5
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/View/日历模块/ClockInCalendarViewModel.m

@@ -68,10 +68,20 @@
     }
     ClockInCalendarDayModel *model = self.numberCellArray[indexPath.row];
     cell.dateLable.text = model.day;
+    
     if ([self.today isEqualToString:model.date])
     {
-        cell.dateLable.backgroundColor = COLOR_0177FF;
+        if (model.startPunchClock.length > 0 && model.endPunchClock.length <=0 )
+        {//缺卡
+            cell.dateLable.backgroundColor = [UIColor colorFromHexString:@"FD7235"];
+        }
+        else
+        {//不是缺卡的
+            cell.dateLable.backgroundColor = COLOR_0177FF;
+        }
         cell.dateLable.textColor = [UIColor whiteColor];
+        cell.dotView.hidden = NO;
+        
         self.todayIndexPathBlock(indexPath);
     }
     else
@@ -92,7 +102,7 @@
     {
         if (model.endPunchClock.length > 0)
         {
-            cell.dotView.backgroundColor = [UIColor colorFromHexString:@"BCBCBC"];
+            cell.dotView.backgroundColor = COLOR_0177FF;
             cell.borderLayer.strokeColor = [UIColor whiteColor].CGColor;
             cell.borderLayer.fillColor = [UIColor clearColor].CGColor;
         }
@@ -133,7 +143,10 @@
         _month = 12;
         _year = _year - 1;
     }
-    self.createDate = [self.servicerDate dateByAddingTimeInterval:_day*kDay * [self totaldaysInMonth:[NSDate date]]];
+
+//    self.createDate = [self.servicerDate dateByAddingTimeInterval:_day*kDay * [self totaldaysInMonth:[NSDate date]]];
+    self.createDate = [self.servicerDate dateByAddingTimeInterval:_day*kDay * [self totaldaysInMonth:self.servicerDate]];
+
     [self createCellNumber:self.createDate];
 }
 
@@ -148,7 +161,8 @@
         _month = 1;
         _year = _year + 1;
     }
-    self.createDate = [self.servicerDate dateByAddingTimeInterval:_day*kDay * [self totaldaysInMonth:[NSDate date]]];
+//    self.createDate = [self.servicerDate dateByAddingTimeInterval:_day*kDay * [self totaldaysInMonth:[NSDate date]]];
+    self.createDate = [self.servicerDate dateByAddingTimeInterval:_day*kDay * [self totaldaysInMonth:self.servicerDate]];
     [self createCellNumber:self.createDate];
 }
 
@@ -260,7 +274,8 @@
         tempYear = _year - 1;
     }
     
-    NSDate *lastDate = [[NSDate date] dateByAddingTimeInterval:tempDay*kDay * [self totaldaysInMonth:[NSDate date]]];
+//    NSDate *lastDate = [[NSDate date] dateByAddingTimeInterval:tempDay*kDay * [self totaldaysInMonth:[NSDate date]]];
+    NSDate *lastDate = [self.servicerDate dateByAddingTimeInterval:tempDay*kDay * [self totaldaysInMonth:self.servicerDate]];
     NSRange daysInLastMonth = [[NSCalendar currentCalendar] rangeOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitMonth forDate:lastDate];
     return daysInLastMonth.length;
 }

+ 1 - 1
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/ViewController/HJClockInStatisticDetailViewController.m

@@ -63,7 +63,6 @@ FBAPIManagerDelegate
     
     self.weekAPI.week_type = @"1";
     [self.weekAPI start];
-
 }
 
 - (void)makeConstraintsViews {
@@ -282,6 +281,7 @@ FBAPIManagerDelegate
         _scrollLayoutView.delegate = self;
         _scrollLayoutView.backgroundColor = COLOR_F5F5F5;
         _scrollLayoutView.contentView.backgroundColor = COLOR_F5F5F5;
+        _scrollLayoutView.scrollView.showsVerticalScrollIndicator = NO;
     }
     return _scrollLayoutView;
 }

+ 1 - 0
HappyJob/HappyJob/CClass/ClockIn_打卡/统计/ViewController/HJClockInStatisticViewController.m

@@ -287,6 +287,7 @@ UIGestureRecognizerDelegate
         _scrollLayoutView.delegate = self;
         _scrollLayoutView.backgroundColor = COLOR_F5F5F5;
         _scrollLayoutView.contentView.backgroundColor = COLOR_F5F5F5;
+        _scrollLayoutView.scrollView.showsVerticalScrollIndicator = NO;
     }
     return _scrollLayoutView;
 }

+ 14 - 1
HappyJob/HappyJob/CClass/ClockIn_打卡/规则/ViewController/HJClockInRuleViewController.m

@@ -10,7 +10,8 @@
 
 @interface HJClockInRuleViewController ()
 <FBScrollLayoutViewDelegate,
-UIGestureRecognizerDelegate
+UIGestureRecognizerDelegate,
+UIScrollViewDelegate
 >
 
 @property (nonatomic, strong) FBScrollLayoutView   *scrollLayoutView;
@@ -66,6 +67,17 @@ UIGestureRecognizerDelegate
     
     [self.navigationController popViewControllerAnimated:YES];
 }
+#pragma mark - UIScrollViewDelegate
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
+    
+    CGFloat alpha = scrollView.contentOffset.y / 300;
+    [self shadeBackgroundColorWithAlpha:alpha];
+}
+- (void)shadeBackgroundColorWithAlpha:(CGFloat)alpha {
+   
+    [_backBtn setImage:[[[UIImage imageNamed:@"navbar_back_black"] imageChangeColor:[UIColor whiteColor]] imageChangeColor:[UIColor colorWithR:255.0 - alpha*255.0 G:255.0 - alpha*255.0 B:255.0 - alpha*255.0 A:1.0]] forState:UIControlStateNormal];
+}
 
 #pragma mark - FBScrollLayoutViewDelegate
 
@@ -102,6 +114,7 @@ UIGestureRecognizerDelegate
         _scrollLayoutView.delegate = self;
         _scrollLayoutView.scrollView.backgroundColor = [UIColor colorFromHexString:@"007AFF"];
         _scrollLayoutView.contentView.backgroundColor = [UIColor colorFromHexString:@"007AFF"];
+        _scrollLayoutView.scrollView.delegate = self;
         // 去除顶部空白
         if (@available(iOS 11.0, *))
         {