NYKaoMockExaminationModel.m 23 KB

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