diff --git a/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme b/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme index e019739..abbd434 100644 --- a/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme +++ b/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme @@ -60,7 +60,7 @@ - - - - - - - - - - diff --git a/tongxin/Helpers/myHelper.h b/tongxin/Helpers/myHelper.h index 21f9f33..81a6032 100644 --- a/tongxin/Helpers/myHelper.h +++ b/tongxin/Helpers/myHelper.h @@ -56,10 +56,10 @@ // 39.108.227.227 api.ecellsz.com //#ifdef DEBUG //测试环境 -#define xBaseUrl @"http://api.test.ecellsz.com" +//#define xBaseUrl @"http://api.test.ecellsz.com" //#else //正式环境 -//#define xBaseUrl @"http://39.108.227.227" +#define xBaseUrl @"http://39.108.227.227" //#endif //#define xBaseUrl @"http://39.108.227.227" //#define xBaseUrl @"http://api.test.ecellsz.com" diff --git a/tongxin/Helpers/myHelper.m b/tongxin/Helpers/myHelper.m index cd0da75..6cdc479 100644 --- a/tongxin/Helpers/myHelper.m +++ b/tongxin/Helpers/myHelper.m @@ -29,7 +29,12 @@ } + (NSString *)getDateFormatWithStr:(NSString *)dateFormat date:(NSDate *)date{ + NSDateFormatter*dateFormatter = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + dateFormatter.locale = zh_CNLocale; + dateFormatter.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; + [dateFormatter setDateFormat:dateFormat]; return [dateFormatter stringFromDate:date]; } diff --git a/tongxin/VC/WatchHome/DeviceInfo/CallVideo/Agora/CallViewController.m b/tongxin/VC/WatchHome/DeviceInfo/CallVideo/Agora/CallViewController.m index 73b562f..fc973e9 100755 --- a/tongxin/VC/WatchHome/DeviceInfo/CallVideo/Agora/CallViewController.m +++ b/tongxin/VC/WatchHome/DeviceInfo/CallVideo/Agora/CallViewController.m @@ -18,6 +18,7 @@ #import #import "MJExtension.h" #import "AppDelegate.h" +#import "GCDTimerManager.h" //CXCallObserverDelegate @interface CallViewController () @@ -79,7 +80,7 @@ @property (nonatomic) int timeLength; @property (strong, nonatomic) NSTimer *timeTimer; - +@property (nonatomic ,assign) NSInteger timeNumber; /** 是否是接通状态 @@ -300,6 +301,8 @@ //[callObserver setDelegate:self queue:dispatch_get_main_queue()]; } + if (self.isReceiveCall) + [self zhudong]; } @@ -469,6 +472,7 @@ self.isCall = YES; [self joinChannel]; [self stopRing]; + [self quxiao]; } /** @@ -479,6 +483,7 @@ { [self stopRing]; [self leaveChannel]; + [self quxiao]; if(!hangUping) { WEAKSELF @@ -517,6 +522,7 @@ - (void)hangUpButton:(UIButton *)sender { [self stopRing]; [self leaveChannel]; + [self quxiao]; if(!hangUping){ hangUping = YES; WEAKSELF @@ -945,5 +951,26 @@ // Dispose of any resources that can be recreated. } +- (void)zhudong +{ + WEAKSELF + NSLog(@"开启计时"); + weakSelf.timeNumber = 0; + [GCDTimerManager.sharedInstance cancelTimerWithName:@"VIDEO"]; + [GCDTimerManager.sharedInstance scheduleGCDTimerWithName:@"VIDEO" interval:1 queue:dispatch_get_main_queue() repeats:YES option:CancelPreviousTimerAction action:^{ + weakSelf.timeNumber++; + if (weakSelf.timeNumber >= 30) + { + [weakSelf hangUpButton:nil]; + NSLog(@"主动挂断,取消计时"); + } + }]; +} + +- (void)quxiao +{ + [GCDTimerManager.sharedInstance cancelTimerWithName:@"VIDEO"]; +} + @end diff --git a/tongxin/VC/WatchHome/DeviceInfo/Course/AddCourseViewController.m b/tongxin/VC/WatchHome/DeviceInfo/Course/AddCourseViewController.m index 3bcdc08..461a04d 100644 --- a/tongxin/VC/WatchHome/DeviceInfo/Course/AddCourseViewController.m +++ b/tongxin/VC/WatchHome/DeviceInfo/Course/AddCourseViewController.m @@ -60,8 +60,10 @@ } //比较2个时间段 结束时间需大于开始时间 - self.zx_navRightBtn.enabled = NO; NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; double startTime = [df dateFromString:self.tfStartTime.text].timeIntervalSince1970; double endTime =[df dateFromString:self.tfEndTime.text].timeIntervalSince1970; @@ -73,6 +75,7 @@ return; } + self.zx_navRightBtn.enabled = NO; CourseModel *model = [CourseModel courseWithName:_tfCourseName.text dayIndex:_curWeek startCourseIndex:_curLession endCourseIndex:_curLession]; NSString *time = [NSString stringWithFormat:@"%@%@",_tfStartTime.text, _tfEndTime.text]; @@ -157,6 +160,8 @@ label.layer.masksToBounds = YES; UIDatePicker *datePicker = [[UIDatePicker alloc] init]; + NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"NL"]; + [datePicker setLocale:locale]; datePicker.datePickerMode = UIDatePickerModeTime; datePicker.date = [NSDate new]; @@ -178,6 +183,8 @@ label.layer.masksToBounds = YES; UIDatePicker *datePicker = [[UIDatePicker alloc] init]; + NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"NL"]; + [datePicker setLocale:locale]; datePicker.datePickerMode = UIDatePickerModeTime; datePicker.date = [NSDate new]; diff --git a/tongxin/VC/WatchHome/DeviceInfo/TimingSwitchVC/TimingSwitchVC.m b/tongxin/VC/WatchHome/DeviceInfo/TimingSwitchVC/TimingSwitchVC.m index 881350f..8e2d951 100644 --- a/tongxin/VC/WatchHome/DeviceInfo/TimingSwitchVC/TimingSwitchVC.m +++ b/tongxin/VC/WatchHome/DeviceInfo/TimingSwitchVC/TimingSwitchVC.m @@ -99,9 +99,11 @@ [view addSubview:lable]; return view; } + -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 49; } + -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ NSString *title = self.myDataSource[indexPath.row]; WEAKSELF @@ -139,6 +141,9 @@ } cell.textLabel.text = title; NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; cell.textField.tintColor = [UIColor clearColor]; //使光标不可见 cell.textField.font = DefineFontSize; @@ -174,6 +179,9 @@ -(BOOL)checkTimeRuleStartTime:(NSString*)aStartTime endTime:(NSString*)aEndTime{ //比较2个时间段 开始时间需小于结束时间 NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; double startTime =[df dateFromString:aStartTime].timeIntervalSince1970; double endTime =[df dateFromString:aEndTime].timeIntervalSince1970; diff --git a/tongxin/VC/WatchHome/DisturbBan/AddDBViewController.m b/tongxin/VC/WatchHome/DisturbBan/AddDBViewController.m index bd57c19..b0e9cc0 100644 --- a/tongxin/VC/WatchHome/DisturbBan/AddDBViewController.m +++ b/tongxin/VC/WatchHome/DisturbBan/AddDBViewController.m @@ -69,6 +69,9 @@ //比较2个时间段 结束时间需大于开始时间 NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; double startTime =[df dateFromString:self.infoDisturBan.starttime].timeIntervalSince1970; double endTime =[df dateFromString:self.infoDisturBan.endedtime].timeIntervalSince1970; @@ -122,6 +125,9 @@ weakSelf.infoDisturBan.starttime = textStr; //比较2个时间段 开始时间需小于结束时间 NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; double startTime =[df dateFromString:weakSelf.infoDisturBan.starttime].timeIntervalSince1970; double endTime =[df dateFromString:weakSelf.infoDisturBan.endedtime].timeIntervalSince1970; @@ -142,6 +148,9 @@ //比较2个时间段 结束时间需大于开始时间 NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; double startTime =[df dateFromString:weakSelf.infoDisturBan.starttime].timeIntervalSince1970; double endTime =[df dateFromString:weakSelf.infoDisturBan.endedtime].timeIntervalSince1970; diff --git a/tongxin/VC/WatchHome/DisturbBan/DurationTimeTableViewCell.m b/tongxin/VC/WatchHome/DisturbBan/DurationTimeTableViewCell.m index ccd755f..280ae3b 100644 --- a/tongxin/VC/WatchHome/DisturbBan/DurationTimeTableViewCell.m +++ b/tongxin/VC/WatchHome/DisturbBan/DurationTimeTableViewCell.m @@ -33,6 +33,8 @@ textField.layer.borderWidth = 1; textField.textAlignment = 1; UIDatePicker *datePicker = [[UIDatePicker alloc] init]; + NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"NL"]; + [datePicker setLocale:locale]; if([textField isEqual:self.startTextField]){ datePicker.tag = StartTAG; }else{ diff --git a/tongxin/VC/WatchHome/VoiceAlarm/AddVAViewController.m b/tongxin/VC/WatchHome/VoiceAlarm/AddVAViewController.m index 15e4fdd..6e3ca92 100644 --- a/tongxin/VC/WatchHome/VoiceAlarm/AddVAViewController.m +++ b/tongxin/VC/WatchHome/VoiceAlarm/AddVAViewController.m @@ -124,6 +124,9 @@ cell.textLabel.text = title; if ([title isEqualToString:@"时间"]) { NSDateFormatter * df = [[NSDateFormatter alloc]init]; + NSLocale *zh_CNLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + df.locale = zh_CNLocale; + df.calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierISO8601]; [df setDateFormat:@"HH:mm"]; [cell timeInputViewWithModel:UIDatePickerModeTime WithData:[df dateFromString:self.infoVoiceAlarm.time]]; cell.textField.text = self.infoVoiceAlarm.time; diff --git a/tongxin/xBase/View/cell/TableCell.m b/tongxin/xBase/View/cell/TableCell.m index d38e49a..aa0a64f 100644 --- a/tongxin/xBase/View/cell/TableCell.m +++ b/tongxin/xBase/View/cell/TableCell.m @@ -149,6 +149,8 @@ self.textField.layer.borderWidth = 1; self.textField.textAlignment = 1; UIDatePicker *datePicker = [[UIDatePicker alloc] init]; + NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"NL"]; + [datePicker setLocale:locale]; datePicker.datePickerMode = mode; // datePicker.datePickerMode = UIDatePickerModeTime; datePicker.date = nowDate;