NYKaoMockExaminationModel.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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. self.isProcessing = NO;
  210. NSLog(@"isSuccessed=%zd",isSuccessed);
  211. }];
  212. }
  213. //过程拍照-业务
  214. - (void)coursePhotoHandledo{
  215. @weakify(self)
  216. [self.timer setFireDate:[NSDate distantFuture]];
  217. SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
  218. alert.backgroundViewColor = backGroundColor;
  219. alert.customViewColor = RQ_MAIN_COLOR;
  220. [alert addButton:@"立即开始 " actionBlock:^(void) {
  221. dispatch_async(dispatch_get_main_queue(), ^{
  222. @strongify(self)
  223. /// 1.本地活体检测
  224. [RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
  225. @strongify(self)
  226. if (success) {
  227. /// 2.线上活体检测
  228. [RQ_RemoteTheory_MANAGER edufaceTofaceWithPhotoStr:dic[@"normalImg"] loginFlagType:LoginFlagType_Process resultBlock:^(BOOL isSuccess) {
  229. @strongify(self)
  230. if (isSuccess) {
  231. [RQ_RemoteTheory_MANAGER getCurrentTimeWithResultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull timeDict) {
  232. @strongify(self)
  233. if (isSuccess) {
  234. /// 3.1上传过程照片
  235. NSString *timeStr = timeDict[@"body"];
  236. [RQ_RemoteTheory_MANAGER uploadEduPicWithClassidStr:self.classIdStr timeStr:timeStr actionPhotoStr:dic[@"actionImg"] loginFlagType:LoginFlagType_Process resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull uploadEduPicDict) {
  237. @strongify(self)
  238. if (isSuccess) {
  239. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"过程验证成功" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"确定" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
  240. [MBProgressHUD rq_hideHUD];
  241. @strongify(self)
  242. [self.timer setFireDate:[NSDate distantPast]];
  243. }];
  244. } else {
  245. self.seconds--;
  246. [self.timer setFireDate:[NSDate distantPast]];
  247. }
  248. }];
  249. } else {
  250. self.seconds--;
  251. [self.timer setFireDate:[NSDate distantPast]];
  252. }
  253. }];
  254. } else {
  255. self.seconds--;
  256. [self.timer setFireDate:[NSDate distantPast]];
  257. }
  258. }];
  259. } else {
  260. self.seconds--;
  261. [self.timer setFireDate:[NSDate distantPast]];
  262. }
  263. }];
  264. });
  265. }];
  266. [alert addTimerToButtonIndex:0 reverse:YES];
  267. [alert showNotice:@"温馨提示" subTitle:@"即将开始活体检测,请做好准备" closeButtonTitle:nil duration:5.0f];
  268. }
  269. //远程理论签退成功
  270. - (void)signOutSuccessWithTrainArray:(NSArray *)trainArray signOutSuccess:(BOOL)signOutSuccess uploadImageSuccess:(BOOL)uploadImageSuccess completion:(void (^)(void))completion {
  271. self.isProcessing = NO;
  272. for (TrainRecord *record in trainArray) {
  273. [DB_Helper updateTrainState:record];
  274. }
  275. if (trainArray.count > 0) {
  276. if (signOutSuccess) {
  277. if (self.timer.isValid) {
  278. [self.timer invalidate];
  279. }
  280. if (self.timer) {
  281. self.timer = nil;
  282. }
  283. }
  284. //通知-刷新分数结果
  285. [[NSNotificationCenter defaultCenter] postNotificationName:@"updateScoreView" object:nil];
  286. if (signOutSuccess && uploadImageSuccess) {
  287. [MBProgressHUD rq_hideHUD];
  288. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"签退成功!" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"确定" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:nil];
  289. } else if (signOutSuccess && !uploadImageSuccess && completion) {
  290. [MBProgressHUD rq_hideHUD];
  291. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"上传照片失败!" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"重新上传" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
  292. completion();
  293. }];
  294. }
  295. }
  296. [RQ_COMMON_MANAGER keepIdleTimerDisabledisOpen:NO];
  297. }
  298. //远程理论签到成功
  299. - (void)signInSuccessWithBeginTime:(NSString *)beginTime {
  300. self.isProcessing = NO;
  301. self.begin_Time = beginTime;
  302. self.seconds = 0;
  303. self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
  304. ShowMsgSuc();
  305. [RQ_COMMON_MANAGER keepIdleTimerDisabledisOpen:YES];
  306. [MBProgressHUD hideHUDForView:[RQ_SHARE_FUNCTION topViewController].view animated:YES];
  307. [MBProgressHUD rq_hideHUD];
  308. //跳转-考试
  309. [self beginExamBtnAction];
  310. }
  311. //时间-秒处理
  312. - (void)timeFireMethod {
  313. self.seconds++;
  314. if (self.seconds==60) { //过程拍照-1分钟
  315. [self coursePhotoHandledo];
  316. }
  317. int remainder = (int)self.seconds%300;
  318. if (remainder == 0) {
  319. //每5分钟保存一次,温州每30分钟保存一次
  320. [self saveTrain];
  321. }
  322. }
  323. - (void)beginExamBtnAction {
  324. NSArray *arr = [RQ_YDTQuestion_Module getQuestionWithExerciseType:RQExerciseType_Exam];
  325. __block NSInteger num = 0;
  326. arr = [arr.rac_sequence.signal map:^id _Nullable(RQYDTQuestionModel *ydtQuestionModel) {
  327. ydtQuestionModel.num = num;
  328. num ++;
  329. return [RQExerciseModel exerciseModelWithRQYDTQuestionModel:ydtQuestionModel];
  330. }].toArray;
  331. [[RACScheduler mainThreadScheduler] schedule:^{
  332. // RQ_Exercise_Module.currentExerciseType = RQExerciseType_Exam;
  333. RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
  334. RQHomePageCarTypeKey : @(RQ_YDTQuestion_Module.carType),
  335. RQHomePageSubjectTypeKey : @(RQHomePageSubjectType_SubjectOne),
  336. RQHomeSubPageTypeKey : @(RQHomeSubPageType_MockExamination),
  337. RQViewModelIDKey : @"模拟考试",
  338. RQExerciseTypeKey : @(RQExerciseType_Exam),
  339. RQViewModelUtilKey : arr,
  340. RQHomeSubPageTypeKHModeKey : @(1)
  341. }];
  342. [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES];
  343. }];
  344. }
  345. -(void)saveTrain {
  346. if (!self.formatter) {
  347. self.formatter = [NSDateFormatter rq_defaultDateFormatter];
  348. }
  349. TrainRecord *train = [[TrainRecord alloc]init];
  350. train.studentId = RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"";
  351. train.beginTime = self.begin_Time;
  352. NSDate *date = [self.formatter dateFromString:self.begin_Time];
  353. date = [date dateByAddingTimeInterval:self.seconds];
  354. train.state = @"0";
  355. train.endTime=[self.formatter stringFromDate:date];
  356. NSInteger mins = self.seconds / 60;
  357. train.trainTime = [NSString stringWithFormat:@"%d",(int)mins];
  358. train.classid = (self.classIdStr && ![self.classIdStr isEqualToString:@""])? self.classIdStr : @"0";
  359. [DB_Helper saveTrain:train];
  360. }
  361. - (NSString *)getTimes:(int)second {
  362. if (!self.formatter) {
  363. self.formatter=[[NSDateFormatter alloc]init];
  364. [self.formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  365. }
  366. NSString *beginTimeStr = self.begin_Time;
  367. [self.formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]];
  368. NSDate *beginDate = [self.formatter dateFromString:beginTimeStr];
  369. NSDate *newDate = [NSDate dateWithTimeInterval:second sinceDate:beginDate];
  370. NSString *nowString = [self.formatter stringFromDate:newDate];
  371. return nowString;
  372. }
  373. - (void)stopTimingWithResultBlock:(void (^)(BOOL isSuccessed))resultBlock {
  374. @weakify(self)
  375. [self.timer setFireDate:[NSDate distantFuture]];
  376. [self saveTrain];
  377. if (RQ_USER_MANAGER.isycbd == 1) {
  378. /// 1.本地活体检测
  379. [RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
  380. @strongify(self)
  381. if (success) {
  382. /// 2.线上活体检测
  383. [RQ_RemoteTheory_MANAGER edufaceTofaceWithPhotoStr:dic[@"normalImg"] loginFlagType:LoginFlagType_SignOut resultBlock:^(BOOL isSuccess) {
  384. @strongify(self)
  385. if (isSuccess) {
  386. [RQ_RemoteTheory_MANAGER getCurrentTimeWithResultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull timeDict) {
  387. @strongify(self)
  388. if (isSuccess) {
  389. /// 4.签退
  390. NSString *pxkm = @"1";
  391. NSArray* array = [DB_Helper quearyTrain:RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.outId)? RQ_USER_MANAGER.currentUser.outId : @"" Subject:pxkm];
  392. if (array.count < 1) {
  393. !resultBlock? : resultBlock(YES);
  394. ShowMsg(@"本地无学时明细!");
  395. return;
  396. }
  397. [RQ_RemoteTheory_MANAGER uploadEduSignOutKHWithArray:array score:self.score resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull signOutDict) {
  398. @strongify(self)
  399. if (isSuccess) {
  400. !resultBlock? : resultBlock(YES);
  401. [self signOutSuccessWithTrainArray:array signOutSuccess:YES uploadImageSuccess:NO completion:nil];
  402. /// 4.1上传签退照片
  403. NSString *timeStr = timeDict[@"body"];
  404. [RQ_RemoteTheory_MANAGER uploadEduPicWithClassidStr:self.classIdStr timeStr:timeStr actionPhotoStr:dic[@"actionImg"] loginFlagType:LoginFlagType_SignOut resultBlock:^(BOOL isSuccess, NSDictionary * _Nonnull uploadEduPicDict) {
  405. @strongify(self)
  406. [MBProgressHUD rq_hideHUD];
  407. if (isSuccess) {
  408. NSLog(@"上传签退照片成功!");
  409. [self signOutSuccessWithTrainArray:array signOutSuccess:YES uploadImageSuccess:YES completion:nil];
  410. } else {
  411. NSLog(@"上传签退照片失败!");
  412. [self signOutSuccessWithTrainArray:array signOutSuccess:YES uploadImageSuccess:NO completion:nil];
  413. }
  414. }];
  415. } else {
  416. !resultBlock? : resultBlock(NO);
  417. [self.timer setFireDate:[NSDate distantPast]];
  418. }
  419. }];
  420. } else {
  421. !resultBlock? : resultBlock(NO);
  422. [self.timer setFireDate:[NSDate distantPast]];
  423. }
  424. }];
  425. }
  426. }];
  427. } else {
  428. !resultBlock? : resultBlock(NO);
  429. [self.timer setFireDate:[NSDate distantPast]];
  430. }
  431. }];
  432. } else {
  433. !resultBlock? : resultBlock(YES);
  434. [self.timer setFireDate:[NSDate distantFuture]];
  435. [self.timer invalidate];
  436. self.timer = nil;
  437. [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"结束计时,是否上传学时?" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"暂不上传" otherButtonTitles:@[@"确定"] otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
  438. // @strongify(self)
  439. // if (selectedOtherButtonIndex == 0) {
  440. // [self upLoadTrainRecord];
  441. // }else if (selectedOtherButtonIndex == NSNotFound){
  442. // ShowMsg(@"学时已保存在本地");
  443. // }
  444. }];
  445. }
  446. }
  447. @end