NYKaoMockExaminationModel.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. //
  2. // NYKaoMockExaminationModel.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2024/8/20.
  6. // Copyright © 2024 JCZ. All rights reserved.
  7. //
  8. #import "NYKaoMockExaminationModel.h"
  9. @interface NYKaoMockExaminationModel ()
  10. @property (strong, readwrite, nonatomic) NSTimer *timer;
  11. @property (strong, readwrite, nonatomic) NSDateFormatter *formatter;
  12. @property (assign, readwrite, nonatomic) NSInteger seconds;
  13. @property (strong, readwrite, nonatomic) NSString *classIdStr;
  14. @property (assign, readwrite, nonatomic) NSInteger score;
  15. @property (strong, nonatomic) NSString *begin_Time;//训练开始时间
  16. @property (nonatomic, assign) BOOL isProcessing; // 添加一个标志位,用于标记方法是否在执行中
  17. @end
  18. @implementation NYKaoMockExaminationModel
  19. // 初始化方法或在其他地方初始化
  20. - (instancetype)init {
  21. self = [super init];
  22. if (self) {
  23. _isProcessing = NO;
  24. }
  25. return self;
  26. }
  27. /**
  28. *1.先拍照-人脸比对
  29. *2.1分钟后-拍照
  30. *3.做完-提卷子后-签退
  31. **/
  32. - (void)studentKaoMockExaminationdo {
  33. // 检查是否正在处理,避免重复点击
  34. if (self.isProcessing) {
  35. ShowMsg(@"操作正在进行中,请稍候...");
  36. return;
  37. }
  38. // 设置为正在处理状态
  39. self.isProcessing = YES;
  40. @weakify(self)
  41. [self getCurrentPXKWithComplete:^(BOOL isSuccess, NSString *pxkm) {
  42. @strongify(self)
  43. if(pxkm.intValue==1){
  44. NSString *pxkm = @"1";
  45. NSArray* array = [DB_Helper quearyTrain:RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"" Subject:pxkm];
  46. __block NSInteger trainTime = 0;
  47. if (RQ_USER_MANAGER.isycbd == 1) {//是否活体
  48. [array.rac_sequence.signal subscribeNext:^(TrainRecord *record) {
  49. trainTime = trainTime + record.trainTime.integerValue;
  50. } completed:^{
  51. dispatch_async(dispatch_get_main_queue(), ^{
  52. if (trainTime >= 30) {//大于30分钟
  53. //删除-本地记录
  54. for (TrainRecord *record in array) {
  55. [DB_Helper deleteTrainRecord:record];
  56. }
  57. /// 1.本地活体检测
  58. [self signInHandledo:NULL];
  59. }else{
  60. /// 1.本地活体检测
  61. [self signInHandledo:NULL];
  62. }
  63. });
  64. }];
  65. }else{
  66. //不需要活体-直接到签到
  67. [array.rac_sequence.signal subscribeNext:^(TrainRecord *record) {
  68. trainTime = trainTime + record.trainTime.integerValue;
  69. } completed:^{
  70. dispatch_async(dispatch_get_main_queue(), ^{
  71. if (trainTime >= 30) {//大于30分钟
  72. TrainRecord *lastRecord = [array lastObject];
  73. [self noFaceSignInHandledo:lastRecord];
  74. }else{
  75. [self noFaceSignInHandledo:NULL];
  76. }
  77. });
  78. }];
  79. }
  80. }else{
  81. self.isProcessing = NO;
  82. ShowMsg(@"学员状态不是科一");
  83. }
  84. }];
  85. }
  86. //获取学员状态
  87. - (void)getCurrentPXKWithComplete:(void(^)(BOOL isSuccess,NSString *pxkm))complete {
  88. if (![Util connectedToNetWork]) {
  89. ShowMsg(@"请检查网络连接。");
  90. RemoveHUD();
  91. !complete? : complete(NO, nil);
  92. return;
  93. }
  94. NSMutableArray *arr = [NSMutableArray array];
  95. [arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"stuOutId"];
  96. [arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
  97. NSString* method = @"getStudentStatusByStuOutId";
  98. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary *dict) {
  99. if (!dict) {
  100. ShowMsgFailed();
  101. !complete? : complete(NO, nil);
  102. return;
  103. }
  104. if ([dict[@"code"] isEqualToString:@"0"]) {
  105. !complete? : complete(YES, dict[@"body"]);
  106. } else {
  107. ShowMsg(dict[@"body"]);
  108. !complete? : complete(NO, nil);
  109. }
  110. }];
  111. }
  112. //签到-业务
  113. - (void)signInHandledo:(TrainRecord *)lastRecord{
  114. @weakify(self)
  115. //1.人脸
  116. [RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
  117. if (success) {
  118. @strongify(self)
  119. /// 2.线上活体检测
  120. [RQ_RemoteTheory_MANAGER edufaceTofaceWithPhotoStr:dic[@"normalImg"] loginFlagType:LoginFlagType_SignIn resultBlock:^(BOOL isSuccess) {
  121. @strongify(self)
  122. if (isSuccess) {
  123. /// 3.获取线上时间
  124. [RQ_RemoteTheory_MANAGER getCurrentTimeWithResultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull timeDict) {
  125. @strongify(self)
  126. if (isSuccess) {
  127. NSDate *date = [NSDate rq_dateWithTimestamp:timeDict[@"body"]];
  128. NSInteger timeStamp = [RQ_SHARE_FUNCTION getTimeStampWithDate:date];
  129. NSString *timeStampStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:timeStamp]];
  130. self.classIdStr = timeStampStr;
  131. if (self.classIdStr.length < 10) {
  132. /// 如果生成时间戳错误 用一个随机十位数代替
  133. self.classIdStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:[NSString rq_randomNumberWithFrom:1647311377 to:9999999999]]];
  134. }
  135. /// 4.签到
  136. [RQ_RemoteTheory_MANAGER uploadEduSignInKHWithClassidStr:self.classIdStr resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull signInDict) {
  137. if (isSuccess) {
  138. @strongify(self)
  139. NSString *timeStr = signInDict[@"body"];
  140. if([signInDict[@"code"] isEqualToString:@"0"]){
  141. /// 5.上传照片
  142. [RQ_RemoteTheory_MANAGER uploadEduPicWithClassidStr:self.classIdStr timeStr:timeStr actionPhotoStr:dic[@"actionImg"] loginFlagType:LoginFlagType_SignIn resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull uploadEduPicDict) {
  143. @strongify(self)
  144. [self signInSuccessWithBeginTime:timeStr];
  145. }];
  146. }else if([signInDict[@"code"] isEqualToString:@"2"]){
  147. [self signInSuccessWithBeginTime:timeStr];
  148. }else{
  149. self.isProcessing = NO;
  150. ShowMsg(@"签到失败");
  151. }
  152. }else{
  153. self.isProcessing = NO;
  154. ShowMsg(@"签到失败");
  155. }
  156. }];
  157. }
  158. }];
  159. }else{
  160. self.isProcessing = NO;
  161. ShowMsg(@"人脸比对失败");
  162. }
  163. }];
  164. }else{
  165. self.isProcessing = NO;
  166. }
  167. }];
  168. }
  169. //无活体
  170. - (void)noFaceSignInHandledo:(TrainRecord *)lastRecord{
  171. @weakify(self)
  172. /// 3.获取线上时间
  173. [RQ_RemoteTheory_MANAGER getCurrentTimeWithResultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull timeDict) {
  174. @strongify(self)
  175. if (isSuccess) {
  176. NSDate *date = [NSDate rq_dateWithTimestamp:timeDict[@"body"]];
  177. // NSDate *date = [NSDate rq_dateWithTimestamp:timeStr];
  178. NSInteger timeStamp = [RQ_SHARE_FUNCTION getTimeStampWithDate:date];
  179. NSString *timeStampStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:timeStamp]];
  180. self.classIdStr = timeStampStr;
  181. if (self.classIdStr.length < 10) {
  182. /// 如果生成时间戳错误 用一个随机十位数代替
  183. self.classIdStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:[NSString rq_randomNumberWithFrom:1647311377 to:9999999999]]];
  184. }
  185. NSInteger todayEndTimestamp = [RQ_SHARE_FUNCTION getTimeStampWithHour:23 andMinute:59 andDate:[NSDate rq_dateWithTimestamp:timeDict[@"body"]]];
  186. BOOL isShow = (todayEndTimestamp - timeStamp) < 3 * RQ_D_HOUR;
  187. /// 4.签到
  188. [RQ_RemoteTheory_MANAGER uploadEduSignInKHWithClassidStr:self.classIdStr resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull signInDict) {
  189. if (isSuccess) {
  190. @strongify(self)
  191. NSString *timeStr = signInDict[@"body"];
  192. [self signInSuccessWithBeginTime:timeStr];
  193. }
  194. }];
  195. }
  196. }];
  197. }
  198. //签退-业务
  199. - (void)signOutHandledo:(NSInteger)score {
  200. // 检查是否正在处理,避免重复点击
  201. if (self.isProcessing) {
  202. ShowMsg(@"操作正在进行中,请稍候...");
  203. return;
  204. }
  205. // 设置为正在处理状态
  206. self.isProcessing = YES;
  207. self.score = score;
  208. @weakify(self)
  209. [self stopTimingWithResultBlock:^(BOOL isSuccessed) {
  210. @strongify(self)
  211. self.isProcessing = NO;
  212. NSLog(@"isSuccessed=%zd",isSuccessed);
  213. }];
  214. }
  215. //过程拍照-业务
  216. - (void)coursePhotoHandledo{
  217. @weakify(self)
  218. [self.timer setFireDate:[NSDate distantFuture]];
  219. SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
  220. alert.backgroundViewColor = backGroundColor;
  221. alert.customViewColor = RQ_MAIN_COLOR;
  222. [alert addButton:@"立即开始 " actionBlock:^(void) {
  223. dispatch_async(dispatch_get_main_queue(), ^{
  224. @strongify(self)
  225. /// 1.本地活体检测
  226. [RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
  227. @strongify(self)
  228. if (success) {
  229. /// 2.线上活体检测
  230. [RQ_RemoteTheory_MANAGER edufaceTofaceWithPhotoStr:dic[@"normalImg"] loginFlagType:LoginFlagType_Process resultBlock:^(BOOL isSuccess) {
  231. @strongify(self)
  232. if (isSuccess) {
  233. [RQ_RemoteTheory_MANAGER getCurrentTimeWithResultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull timeDict) {
  234. @strongify(self)
  235. if (isSuccess) {
  236. /// 3.1上传过程照片
  237. NSString *timeStr = timeDict[@"body"];
  238. [RQ_RemoteTheory_MANAGER uploadEduPicWithClassidStr:self.classIdStr timeStr:timeStr actionPhotoStr:dic[@"actionImg"] loginFlagType:LoginFlagType_Process resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull uploadEduPicDict) {
  239. @strongify(self)
  240. if (isSuccess) {
  241. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"过程验证成功" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"确定" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
  242. [MBProgressHUD rq_hideHUD];
  243. @strongify(self)
  244. [self.timer setFireDate:[NSDate distantPast]];
  245. }];
  246. } else {
  247. self.seconds--;
  248. [self.timer setFireDate:[NSDate distantPast]];
  249. }
  250. }];
  251. } else {
  252. self.seconds--;
  253. [self.timer setFireDate:[NSDate distantPast]];
  254. }
  255. }];
  256. } else {
  257. self.seconds--;
  258. [self.timer setFireDate:[NSDate distantPast]];
  259. }
  260. }];
  261. } else {
  262. self.seconds--;
  263. [self.timer setFireDate:[NSDate distantPast]];
  264. }
  265. }];
  266. });
  267. }];
  268. [alert addTimerToButtonIndex:0 reverse:YES];
  269. [alert showNotice:@"温馨提示" subTitle:@"即将开始活体检测,请做好准备" closeButtonTitle:nil duration:5.0f];
  270. }
  271. //远程理论签退成功
  272. - (void)signOutSuccessWithTrainArray:(NSArray *)trainArray signOutSuccess:(BOOL)signOutSuccess uploadImageSuccess:(BOOL)uploadImageSuccess completion:(void (^)(void))completion {
  273. self.isProcessing = NO;
  274. for (TrainRecord *record in trainArray) {
  275. [DB_Helper updateTrainState:record];
  276. }
  277. if (trainArray.count > 0) {
  278. if (signOutSuccess) {
  279. if (self.timer.isValid) {
  280. [self.timer invalidate];
  281. }
  282. if (self.timer) {
  283. self.timer = nil;
  284. }
  285. }
  286. //通知-刷新分数结果
  287. [[NSNotificationCenter defaultCenter] postNotificationName:@"updateScoreView" object:nil];
  288. if (signOutSuccess && uploadImageSuccess) {
  289. [MBProgressHUD rq_hideHUD];
  290. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"签退成功!" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"确定" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:nil];
  291. } else if (signOutSuccess && !uploadImageSuccess && completion) {
  292. [MBProgressHUD rq_hideHUD];
  293. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"上传照片失败!" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"重新上传" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
  294. completion();
  295. }];
  296. }
  297. }
  298. [RQ_COMMON_MANAGER keepIdleTimerDisabledisOpen:NO];
  299. }
  300. //远程理论签到成功
  301. - (void)signInSuccessWithBeginTime:(NSString *)beginTime {
  302. self.isProcessing = NO;
  303. self.begin_Time = beginTime;
  304. self.seconds = 0;
  305. self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
  306. ShowMsgSuc();
  307. [RQ_COMMON_MANAGER keepIdleTimerDisabledisOpen:YES];
  308. [MBProgressHUD hideHUDForView:[RQ_SHARE_FUNCTION topViewController].view animated:YES];
  309. [MBProgressHUD rq_hideHUD];
  310. //跳转-考试
  311. [self beginExamBtnAction];
  312. }
  313. //时间-秒处理
  314. - (void)timeFireMethod {
  315. self.seconds++;
  316. if (self.seconds==60) { //过程拍照-1分钟
  317. [self coursePhotoHandledo];
  318. }
  319. int remainder = (int)self.seconds%300;
  320. if (remainder == 0) {
  321. //每5分钟保存一次,温州每30分钟保存一次
  322. [self saveTrain];
  323. }
  324. }
  325. - (void)beginExamBtnAction {
  326. NSArray *arr = [RQ_YDTQuestion_Module getQuestionWithExerciseType:RQExerciseType_Exam];
  327. __block NSInteger num = 0;
  328. arr = [arr.rac_sequence.signal map:^id _Nullable(RQYDTQuestionModel *ydtQuestionModel) {
  329. ydtQuestionModel.num = num;
  330. num ++;
  331. return [RQExerciseModel exerciseModelWithRQYDTQuestionModel:ydtQuestionModel];
  332. }].toArray;
  333. [[RACScheduler mainThreadScheduler] schedule:^{
  334. // RQ_Exercise_Module.currentExerciseType = RQExerciseType_Exam;
  335. RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
  336. RQHomePageCarTypeKey : @(RQ_YDTQuestion_Module.carType),
  337. RQHomePageSubjectTypeKey : @(RQHomePageSubjectType_SubjectOne),
  338. RQHomeSubPageTypeKey : @(RQHomeSubPageType_MockExamination),
  339. RQViewModelIDKey : @"模拟考试",
  340. RQExerciseTypeKey : @(RQExerciseType_Exam),
  341. RQViewModelUtilKey : arr,
  342. RQHomeSubPageTypeKHModeKey : @(1)
  343. }];
  344. [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES];
  345. }];
  346. }
  347. -(void)saveTrain {
  348. if (!self.formatter) {
  349. self.formatter = [NSDateFormatter rq_defaultDateFormatter];
  350. }
  351. TrainRecord *train = [[TrainRecord alloc]init];
  352. train.studentId = RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"";
  353. train.beginTime = self.begin_Time;
  354. NSDate *date = [self.formatter dateFromString:self.begin_Time];
  355. date = [date dateByAddingTimeInterval:self.seconds];
  356. train.state = @"0";
  357. train.endTime=[self.formatter stringFromDate:date];
  358. NSInteger mins = self.seconds / 60;
  359. train.trainTime = [NSString stringWithFormat:@"%d",(int)mins];
  360. train.classid = (self.classIdStr && ![self.classIdStr isEqualToString:@""])? self.classIdStr : @"0";
  361. [DB_Helper saveTrain:train];
  362. }
  363. - (NSString *)getTimes:(int)second {
  364. if (!self.formatter) {
  365. self.formatter=[[NSDateFormatter alloc]init];
  366. [self.formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  367. }
  368. NSString *beginTimeStr = self.begin_Time;
  369. [self.formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]];
  370. NSDate *beginDate = [self.formatter dateFromString:beginTimeStr];
  371. NSDate *newDate = [NSDate dateWithTimeInterval:second sinceDate:beginDate];
  372. NSString *nowString = [self.formatter stringFromDate:newDate];
  373. return nowString;
  374. }
  375. - (void)stopTimingWithResultBlock:(void (^)(BOOL isSuccessed))resultBlock {
  376. @weakify(self)
  377. [self.timer setFireDate:[NSDate distantFuture]];
  378. [self saveTrain];
  379. if (RQ_USER_MANAGER.isycbd == 1) {
  380. /// 1.本地活体检测
  381. [RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
  382. @strongify(self)
  383. if (success) {
  384. /// 2.线上活体检测
  385. [RQ_RemoteTheory_MANAGER edufaceTofaceWithPhotoStr:dic[@"normalImg"] loginFlagType:LoginFlagType_SignOut resultBlock:^(BOOL isSuccess) {
  386. @strongify(self)
  387. if (isSuccess) {
  388. [RQ_RemoteTheory_MANAGER getCurrentTimeWithResultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull timeDict) {
  389. @strongify(self)
  390. if (isSuccess) {
  391. /// 4.签退
  392. NSString *pxkm = @"1";
  393. NSArray* array = [DB_Helper quearyTrain:RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"" Subject:pxkm];
  394. if (array.count < 1) {
  395. !resultBlock? : resultBlock(YES);
  396. ShowMsg(@"本地无学时明细!");
  397. return;
  398. }
  399. [RQ_RemoteTheory_MANAGER uploadEduSignOutKHWithArray:array score:self.score resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull signOutDict) {
  400. @strongify(self)
  401. if (isSuccess) {
  402. !resultBlock? : resultBlock(YES);
  403. [self signOutSuccessWithTrainArray:array signOutSuccess:YES uploadImageSuccess:NO completion:nil];
  404. /// 4.1上传签退照片
  405. NSString *timeStr = timeDict[@"body"];
  406. [RQ_RemoteTheory_MANAGER uploadEduPicWithClassidStr:self.classIdStr timeStr:timeStr actionPhotoStr:dic[@"actionImg"] loginFlagType:LoginFlagType_SignOut resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull uploadEduPicDict) {
  407. @strongify(self)
  408. [MBProgressHUD rq_hideHUD];
  409. if (isSuccess) {
  410. NSLog(@"上传签退照片成功!");
  411. [self signOutSuccessWithTrainArray:array signOutSuccess:YES uploadImageSuccess:YES completion:nil];
  412. } else {
  413. NSLog(@"上传签退照片失败!");
  414. [self signOutSuccessWithTrainArray:array signOutSuccess:YES uploadImageSuccess:NO completion:nil];
  415. }
  416. }];
  417. } else {
  418. !resultBlock? : resultBlock(NO);
  419. [self.timer setFireDate:[NSDate distantPast]];
  420. }
  421. }];
  422. } else {
  423. !resultBlock? : resultBlock(NO);
  424. [self.timer setFireDate:[NSDate distantPast]];
  425. }
  426. }];
  427. }
  428. }];
  429. } else {
  430. !resultBlock? : resultBlock(NO);
  431. [self.timer setFireDate:[NSDate distantPast]];
  432. }
  433. }];
  434. } else {
  435. !resultBlock? : resultBlock(YES);
  436. [self.timer setFireDate:[NSDate distantFuture]];
  437. [self.timer invalidate];
  438. self.timer = nil;
  439. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"结束计时,是否上传学时?" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"暂不上传" otherButtonTitles:@[@"确定"] otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
  440. // @strongify(self)
  441. // if (selectedOtherButtonIndex == 0) {
  442. // [self upLoadTrainRecord];
  443. // }else if (selectedOtherButtonIndex == NSNotFound){
  444. // ShowMsg(@"学时已保存在本地");
  445. // }
  446. }];
  447. }
  448. }
  449. @end