RQYDTQuestionModule.m 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. //
  2. // RQYDTQuestionModule.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/3/28.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQYDTQuestionModule.h"
  9. #import "RQYDTXCQuestionModule.h"
  10. #import "RQYDTHCQuestionModule.h"
  11. #import "RQYDTKCQuestionModule.h"
  12. #import "RQYDTMTCQuestionModule.h"
  13. #import "RQYDTZGZJLYQuestionModule.h"
  14. #import "RQYDTZGZKYQuestionModule.h"
  15. #import "RQYDTZGZHYQuestionModule.h"
  16. #import "RQYDTZGZWXPQuestionModule.h"
  17. #import "RQYDTZGZCZCQuestionModule.h"
  18. #import "RQYDTZGZWYCQuestionModule.h"
  19. NSString * const RQCarTypeChangeNotification = @"RQCarTypeChangeNotification";
  20. /// 正式环境key
  21. static NSString * const RQYDTQuestionCarTypeKey = @"RQYDTQuestionCarTypeKey";
  22. @interface RQYDTQuestionModule ()
  23. /// 科目一顺序练习
  24. @property (nonatomic, readwrite, copy) NSArray *subjectOneArr;
  25. /// 科目四顺序练习
  26. @property (nonatomic, readwrite, copy) NSArray *subjectFourArr;
  27. @property (nonatomic, readwrite, strong) NSString *downloadUrl;
  28. @property (nonatomic, readwrite, strong) NSString *jsDownloadUrl;
  29. @property (nonatomic, readwrite, strong) NSString *jqDownloadUrl;
  30. @end
  31. @implementation RQYDTQuestionModule
  32. static id rq_ydtQuestionModule = nil;
  33. #pragma mark - init
  34. + (instancetype)sharedInstance {
  35. static dispatch_once_t onceToken;
  36. dispatch_once(&onceToken, ^{
  37. rq_ydtQuestionModule = [[self alloc] init];
  38. });
  39. return rq_ydtQuestionModule;
  40. }
  41. - (instancetype)init {
  42. if (self = [super init]) {
  43. NSInteger userVersion = [RQ_YDT_USER_Question_Module getQuestionVersion];
  44. NSLog(@"用户题库版本号:%ld",userVersion);
  45. NSInteger xcVersion = [RQ_YDT_XC_Question_Module getQuestionVersion];
  46. NSLog(@"小车题库版本号:%ld",xcVersion);
  47. NSInteger hcVersion = [RQ_YDT_HC_Question_Module getQuestionVersion];
  48. NSLog(@"货车题库版本号:%ld",hcVersion);
  49. NSInteger kcVersion = [RQ_YDT_KC_Question_Module getQuestionVersion];
  50. NSLog(@"客车题库版本号:%ld",kcVersion);
  51. NSInteger mtcVersion = [RQ_YDT_MTC_Question_Module getQuestionVersion];
  52. NSLog(@"摩托车题库版本号:%ld",mtcVersion);
  53. NSInteger zgzJlyVersion = [RQ_YDT_ZGZ_JLY_Question_Module getQuestionVersion];
  54. NSLog(@"资格证教练员题库版本号:%ld",zgzJlyVersion);
  55. }
  56. return self;
  57. }
  58. - (void)saveQuestionsWithSubjectOneArr:(NSArray *)subjectOneArr {
  59. self.subjectOneArr = subjectOneArr;
  60. }
  61. - (void)saveQuestionsWithSubjectFourArr:(NSArray *)subjectFourArr {
  62. self.subjectFourArr = subjectFourArr;
  63. }
  64. - (void)setCarType:(RQHomePageCarType)carType {
  65. NSString *carTypeStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:carType]];
  66. [[NSUserDefaults standardUserDefaults] setObject:carTypeStr forKey:RQYDTQuestionCarTypeKey];
  67. [[NSUserDefaults standardUserDefaults] synchronize];
  68. }
  69. - (RQHomePageCarType)carType {
  70. NSString *carTypeStr = [[NSUserDefaults standardUserDefaults] objectForKey:RQYDTQuestionCarTypeKey];
  71. carTypeStr = [carTypeStr rq_stringValueExtension];
  72. return carTypeStr.integerValue;
  73. }
  74. - (NSString *)carTypeStr {
  75. return [self getCarTypeNameWithCarType:self.carType];
  76. }
  77. - (NSString *)carTypeStrNew {
  78. switch (self.carType) {
  79. case RQHomePageCarType_Car:
  80. return @"cart";
  81. case RQHomePageCarType_Bus:
  82. return @"bus";
  83. case RQHomePageCarType_Truck:
  84. return @"truck";
  85. case RQHomePageCarType_Motorcycle:
  86. return @"mtc";
  87. case RQHomePageCarType_ZGZ_JLY:
  88. return @"zgzjl";
  89. case RQHomePageCarType_ZGZ_KY:
  90. return @"zgzky";
  91. case RQHomePageCarType_ZGZ_HY:
  92. return @"zgzhy";
  93. case RQHomePageCarType_ZGZ_WXP:
  94. return @"zgzwxp";
  95. case RQHomePageCarType_ZGZ_CZC:
  96. return @"zgzcz";
  97. case RQHomePageCarType_ZGZ_WYC:
  98. return @"zgzwyc";
  99. default:
  100. return @"cart";
  101. }
  102. }
  103. - (NSString *)subjectStr {
  104. return [self getSubjectNameWithSubject:self.subject];
  105. }
  106. #pragma mark - PublicMethods
  107. /// 更新题库
  108. - (void)rq_updateQuestion {
  109. @weakify(self)
  110. [[[RQ_HTTP_Service getUpdateQuestion] deliverOnMainThread] subscribeNext:^(NSArray *arr) {
  111. [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
  112. return [dictInfoModel.dictLabel isEqualToString:[RQ_YDTQuestion_Module getCarTypeCNTiKuUpdateNameWithCarType:RQ_YDTQuestion_Module.carType]];
  113. }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
  114. @strongify(self)
  115. NSInteger netVersion = dictInfoModel.remark.integerValue;
  116. NSInteger localVersion = [RQ_YDTQuestion_Module getQuestionVersion];
  117. self.downloadUrl = dictInfoModel.dictValue;
  118. if (netVersion > localVersion) {
  119. NSLog(@"题库需要更新!");
  120. [self rq_showDBUpdateView];
  121. } else {
  122. NSLog(@"题库不需要更新!");
  123. }
  124. }];
  125. [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
  126. return [dictInfoModel.dictLabel isEqualToString:@"题库解释"];
  127. }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
  128. @strongify(self)
  129. NSInteger netVersion = dictInfoModel.remark.integerValue;
  130. NSInteger localVersion = [RQ_YDT_JS_Question_Module getQuestionVersion];
  131. self.jsDownloadUrl = dictInfoModel.dictValue;
  132. if (netVersion > localVersion) {
  133. NSLog(@"解释题库需要更新!");
  134. [self rq_showJSUpdateView];
  135. } else {
  136. NSLog(@"解释题库不需要更新!");
  137. }
  138. }];
  139. [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
  140. return [dictInfoModel.dictLabel isEqualToString:@"快通解释"];
  141. }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
  142. @strongify(self)
  143. NSInteger netVersion = dictInfoModel.remark.integerValue;
  144. NSInteger localVersion = [YN_YDT_JQ_Question_Module getQuestionVersion];
  145. self.jqDownloadUrl = dictInfoModel.dictValue;
  146. if (netVersion > localVersion) {
  147. NSLog(@"快通解释题库需要更新!");
  148. [self rq_showJQUpdateView];
  149. } else {
  150. NSLog(@"快通解释题库不需要更新!");
  151. }
  152. }];
  153. }];
  154. }
  155. - (NSInteger)getQuestionVersion {
  156. switch (self.carType) {
  157. case RQHomePageCarType_Car:
  158. return [RQ_YDT_XC_Question_Module getQuestionVersion];
  159. case RQHomePageCarType_Truck:
  160. return [RQ_YDT_HC_Question_Module getQuestionVersion];
  161. case RQHomePageCarType_Bus:
  162. return [RQ_YDT_KC_Question_Module getQuestionVersion];
  163. case RQHomePageCarType_Motorcycle:
  164. return [RQ_YDT_MTC_Question_Module getQuestionVersion];
  165. case RQHomePageCarType_ZGZ_JLY:
  166. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionVersion];
  167. case RQHomePageCarType_ZGZ_KY:
  168. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionVersion];
  169. case RQHomePageCarType_ZGZ_HY:
  170. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionVersion];
  171. case RQHomePageCarType_ZGZ_WXP:
  172. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionVersion];
  173. case RQHomePageCarType_ZGZ_CZC:
  174. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionVersion];
  175. case RQHomePageCarType_ZGZ_WYC:
  176. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionVersion];
  177. default:
  178. return [RQ_YDT_XC_Question_Module getQuestionVersion];
  179. }
  180. }
  181. - (NSString *)getSubjectNameWithSubject:(RQHomePageSubjectType)subject {
  182. switch (subject) {
  183. case RQHomePageSubjectType_SubjectOne:
  184. return @"1";
  185. case RQHomePageSubjectType_SubjectTwo:
  186. return @"2";
  187. case RQHomePageSubjectType_SubjectThree:
  188. return @"3";
  189. case RQHomePageSubjectType_SubjectFour:
  190. return @"4";
  191. default:
  192. return @"1";
  193. }
  194. }
  195. - (RQHomePageSubjectType)getSubjectWithSubjectName:(NSString *)subjectName {
  196. if ([subjectName isEqualToString:@"1"]) {
  197. return RQHomePageSubjectType_SubjectOne;
  198. } else if ([subjectName isEqualToString:@"2"]) {
  199. return RQHomePageSubjectType_SubjectTwo;
  200. } else if ([subjectName isEqualToString:@"3"]) {
  201. return RQHomePageSubjectType_SubjectThree;
  202. } else if ([subjectName isEqualToString:@"4"]) {
  203. return RQHomePageSubjectType_SubjectFour;
  204. } else {
  205. return RQHomePageSubjectType_SubjectOne;
  206. }
  207. }
  208. - (RQHomePageCarType)getCarTypeWithCarTypeName:(NSString *)carTypeName {
  209. if ([carTypeName isEqualToString:@"C1"]) {
  210. return RQHomePageCarType_Car;
  211. } else if ([carTypeName isEqualToString:@"A2"]) {
  212. return RQHomePageCarType_Truck;
  213. } else if ([carTypeName isEqualToString:@"A1"]) {
  214. return RQHomePageCarType_Bus;
  215. } else if ([carTypeName isEqualToString:@"D"]) {
  216. return RQHomePageCarType_Motorcycle;
  217. } else if ([carTypeName isEqualToString:@"4"]) {
  218. return RQHomePageCarType_ZGZ_JLY;
  219. } else if ([carTypeName isEqualToString:@"1"]) {
  220. return RQHomePageCarType_ZGZ_KY;
  221. } else if ([carTypeName isEqualToString:@"2"]) {
  222. return RQHomePageCarType_ZGZ_HY;
  223. } else if ([carTypeName isEqualToString:@"3"]) {
  224. return RQHomePageCarType_ZGZ_WXP;
  225. } else if ([carTypeName isEqualToString:@"5"]) {
  226. return RQHomePageCarType_ZGZ_CZC;
  227. } else if ([carTypeName isEqualToString:@"6"]) {
  228. return RQHomePageCarType_ZGZ_WYC;
  229. } else {
  230. return RQHomePageCarType_Car;
  231. }
  232. }
  233. - (NSString *)getCarTypeCNNameWithCarType:(RQHomePageCarType)carType {
  234. switch (carType) {
  235. case RQHomePageCarType_Car:
  236. return @"小车";
  237. case RQHomePageCarType_Truck:
  238. return @"货车";
  239. case RQHomePageCarType_Bus:
  240. return @"客车";
  241. case RQHomePageCarType_Motorcycle:
  242. return @"摩托车";
  243. case RQHomePageCarType_ZGZ_JLY:
  244. return @"教练员";
  245. case RQHomePageCarType_ZGZ_HY:
  246. return @"货运";
  247. case RQHomePageCarType_ZGZ_WXP:
  248. return @"危险品";
  249. case RQHomePageCarType_ZGZ_KY:
  250. return @"客运";
  251. case RQHomePageCarType_ZGZ_CZC:
  252. return @"出租车";
  253. case RQHomePageCarType_ZGZ_WYC:
  254. return @"网约车";
  255. default:
  256. return @"小车";
  257. }
  258. }
  259. - (NSString *)getCarTypeCNTiKuUpdateNameWithCarType:(RQHomePageCarType)carType {
  260. switch (carType) {
  261. case RQHomePageCarType_Car:
  262. return @"小车";
  263. case RQHomePageCarType_Truck:
  264. return @"货车";
  265. case RQHomePageCarType_Bus:
  266. return @"客车";
  267. case RQHomePageCarType_Motorcycle:
  268. return @"摩托车";
  269. case RQHomePageCarType_ZGZ_JLY:
  270. return @"教练员资格证";
  271. case RQHomePageCarType_ZGZ_HY:
  272. return @"货运资格证";
  273. case RQHomePageCarType_ZGZ_WXP:
  274. return @"危险品资格证";
  275. case RQHomePageCarType_ZGZ_KY:
  276. return @"客运资格证";
  277. case RQHomePageCarType_ZGZ_CZC:
  278. return @"出租车资格证";
  279. case RQHomePageCarType_ZGZ_WYC:
  280. return @"网约车资格证";
  281. default:
  282. return @"小车";
  283. }
  284. }
  285. - (NSString *)getCarTypeExamNameWithCarType:(RQHomePageCarType)carType {
  286. switch (carType) {
  287. case RQHomePageCarType_Car:
  288. return @"小车C1/C2/C3";
  289. case RQHomePageCarType_Bus:
  290. return @"客车A1/A3/B1";
  291. case RQHomePageCarType_Truck:
  292. return @"货车A2/B2";
  293. case RQHomePageCarType_Motorcycle:
  294. return @"摩托车D/E/F";
  295. case RQHomePageCarType_ZGZ_JLY:
  296. return @"教练员";
  297. case RQHomePageCarType_ZGZ_KY:
  298. return @"客运";
  299. case RQHomePageCarType_ZGZ_HY:
  300. return @"货运";
  301. case RQHomePageCarType_ZGZ_WXP:
  302. return @"危险品";
  303. case RQHomePageCarType_ZGZ_CZC:
  304. return @"出租车";
  305. case RQHomePageCarType_ZGZ_WYC:
  306. return @"网约车";
  307. default:
  308. return @"小车";
  309. }
  310. }
  311. - (NSString *)getCar_TypeNameWithCarType:(RQHomePageCarType)carType {
  312. switch (carType) {
  313. case RQHomePageCarType_Car:
  314. return @"C1";
  315. case RQHomePageCarType_Truck:
  316. return @"A2";
  317. case RQHomePageCarType_Bus:
  318. return @"A1";
  319. case RQHomePageCarType_Motorcycle:
  320. return @"D";
  321. case RQHomePageCarType_ZGZ_JLY:
  322. return @"4";
  323. case RQHomePageCarType_ZGZ_HY:
  324. return @"2";
  325. case RQHomePageCarType_ZGZ_WXP:
  326. return @"3";
  327. case RQHomePageCarType_ZGZ_KY:
  328. return @"1";
  329. case RQHomePageCarType_ZGZ_CZC:
  330. return @"5";
  331. case RQHomePageCarType_ZGZ_WYC:
  332. return @"6";
  333. default:
  334. return @"C1";
  335. }
  336. }
  337. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType questionIds:(NSString*)questionIds {
  338. switch (self.carType) {
  339. case RQHomePageCarType_Car:
  340. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType questionIds:questionIds];
  341. default:
  342. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  343. }
  344. return @[];
  345. }
  346. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType code:(NSInteger)code {
  347. switch (self.carType) {
  348. case RQHomePageCarType_Car:
  349. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType code:code];
  350. default:
  351. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  352. }
  353. return @[];
  354. }
  355. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType {
  356. switch (self.carType) {
  357. case RQHomePageCarType_Car:
  358. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  359. case RQHomePageCarType_Truck:
  360. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  361. case RQHomePageCarType_Bus:
  362. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  363. case RQHomePageCarType_Motorcycle:
  364. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  365. case RQHomePageCarType_ZGZ_JLY:
  366. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  367. case RQHomePageCarType_ZGZ_KY:
  368. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  369. case RQHomePageCarType_ZGZ_HY:
  370. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  371. case RQHomePageCarType_ZGZ_WXP:
  372. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  373. case RQHomePageCarType_ZGZ_CZC:
  374. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  375. case RQHomePageCarType_ZGZ_WYC:
  376. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  377. default:
  378. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  379. }
  380. }
  381. - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
  382. switch (self.carType) {
  383. case RQHomePageCarType_Car:
  384. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  385. case RQHomePageCarType_Truck:
  386. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  387. case RQHomePageCarType_Bus:
  388. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  389. case RQHomePageCarType_Motorcycle:
  390. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  391. case RQHomePageCarType_ZGZ_JLY:
  392. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  393. case RQHomePageCarType_ZGZ_KY:
  394. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  395. case RQHomePageCarType_ZGZ_HY:
  396. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  397. case RQHomePageCarType_ZGZ_WXP:
  398. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  399. case RQHomePageCarType_ZGZ_CZC:
  400. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  401. case RQHomePageCarType_ZGZ_WYC:
  402. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  403. default:
  404. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  405. }
  406. }
  407. - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType isNeedMediaData:(BOOL)isNeedMediaData {
  408. switch (self.carType) {
  409. case RQHomePageCarType_Car:
  410. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  411. case RQHomePageCarType_Truck:
  412. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  413. case RQHomePageCarType_Bus:
  414. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  415. case RQHomePageCarType_Motorcycle:
  416. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  417. case RQHomePageCarType_ZGZ_JLY:
  418. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  419. case RQHomePageCarType_ZGZ_KY:
  420. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  421. case RQHomePageCarType_ZGZ_HY:
  422. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  423. case RQHomePageCarType_ZGZ_WXP:
  424. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  425. case RQHomePageCarType_ZGZ_CZC:
  426. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  427. case RQHomePageCarType_ZGZ_WYC:
  428. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  429. default:
  430. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  431. }
  432. }
  433. - (NSInteger)getQuestionNumWithWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
  434. switch (self.carType) {
  435. case RQHomePageCarType_Car:
  436. return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  437. case RQHomePageCarType_Truck:
  438. return [RQ_YDT_HC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  439. case RQHomePageCarType_Bus:
  440. return [RQ_YDT_KC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  441. case RQHomePageCarType_Motorcycle:
  442. return [RQ_YDT_MTC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  443. case RQHomePageCarType_ZGZ_JLY:
  444. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  445. case RQHomePageCarType_ZGZ_KY:
  446. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  447. case RQHomePageCarType_ZGZ_HY:
  448. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  449. case RQHomePageCarType_ZGZ_WXP:
  450. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionNumWithExerciseType:exerciseType];
  451. case RQHomePageCarType_ZGZ_CZC:
  452. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionNumWithExerciseType:exerciseType];
  453. case RQHomePageCarType_ZGZ_WYC:
  454. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionNumWithExerciseType:exerciseType];
  455. default:
  456. return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  457. }
  458. }
  459. - (NSArray *)getChapterArr {
  460. switch (self.carType) {
  461. case RQHomePageCarType_Car:
  462. return [RQ_YDT_XC_Question_Module getChapter];
  463. case RQHomePageCarType_Truck:
  464. return [RQ_YDT_HC_Question_Module getChapter];
  465. case RQHomePageCarType_Bus:
  466. return [RQ_YDT_KC_Question_Module getChapter];
  467. case RQHomePageCarType_Motorcycle:
  468. return [RQ_YDT_MTC_Question_Module getChapter];
  469. case RQHomePageCarType_ZGZ_JLY:
  470. return [RQ_YDT_ZGZ_JLY_Question_Module getChapter];
  471. case RQHomePageCarType_ZGZ_KY:
  472. return [RQ_YDT_ZGZ_KY_Question_Module getChapter];
  473. case RQHomePageCarType_ZGZ_HY:
  474. return [RQ_YDT_ZGZ_HY_Question_Module getChapter];
  475. case RQHomePageCarType_ZGZ_WXP:
  476. return [RQ_YDT_ZGZ_WXP_Question_Module getChapter];
  477. case RQHomePageCarType_ZGZ_CZC:
  478. return [RQ_YDT_ZGZ_CZC_Question_Module getChapter];
  479. case RQHomePageCarType_ZGZ_WYC:
  480. return [RQ_YDT_ZGZ_WYC_Question_Module getChapter];
  481. default:
  482. return [RQ_YDT_XC_Question_Module getChapter];
  483. }
  484. }
  485. - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName {
  486. switch (self.carType) {
  487. case RQHomePageCarType_Car:
  488. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
  489. case RQHomePageCarType_Truck:
  490. return [RQ_YDT_HC_Question_Module getChapterQuestionWithChapterName:chapterName];
  491. case RQHomePageCarType_Bus:
  492. return [RQ_YDT_KC_Question_Module getChapterQuestionWithChapterName:chapterName];
  493. case RQHomePageCarType_Motorcycle:
  494. return [RQ_YDT_MTC_Question_Module getChapterQuestionWithChapterName:chapterName];
  495. case RQHomePageCarType_ZGZ_JLY:
  496. return [RQ_YDT_ZGZ_JLY_Question_Module getChapterQuestionWithChapterName:chapterName];
  497. case RQHomePageCarType_ZGZ_KY:
  498. return [RQ_YDT_ZGZ_KY_Question_Module getChapterQuestionWithChapterName:chapterName];
  499. case RQHomePageCarType_ZGZ_HY:
  500. return [RQ_YDT_ZGZ_HY_Question_Module getChapterQuestionWithChapterName:chapterName];
  501. case RQHomePageCarType_ZGZ_WXP:
  502. return [RQ_YDT_ZGZ_WXP_Question_Module getChapterQuestionWithChapterName:chapterName];
  503. case RQHomePageCarType_ZGZ_CZC:
  504. return [RQ_YDT_ZGZ_CZC_Question_Module getChapterQuestionWithChapterName:chapterName];
  505. case RQHomePageCarType_ZGZ_WYC:
  506. return [RQ_YDT_ZGZ_WYC_Question_Module getChapterQuestionWithChapterName:chapterName];
  507. default:
  508. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
  509. }
  510. }
  511. - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName exerciseType:(RQExerciseType)exerciseType {
  512. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName exerciseType:exerciseType];
  513. }
  514. - (NSArray *)getPoint {
  515. switch (self.carType) {
  516. case RQHomePageCarType_Car:
  517. return [RQ_YDT_XC_Question_Module getPoint];
  518. case RQHomePageCarType_Truck:
  519. return [RQ_YDT_HC_Question_Module getPoint];
  520. case RQHomePageCarType_Bus:
  521. return [RQ_YDT_KC_Question_Module getPoint];
  522. case RQHomePageCarType_Motorcycle:
  523. return [RQ_YDT_MTC_Question_Module getPoint];
  524. case RQHomePageCarType_ZGZ_JLY:
  525. return [RQ_YDT_ZGZ_JLY_Question_Module getPoint];
  526. case RQHomePageCarType_ZGZ_KY:
  527. return [RQ_YDT_ZGZ_KY_Question_Module getPoint];
  528. case RQHomePageCarType_ZGZ_HY:
  529. return [RQ_YDT_ZGZ_HY_Question_Module getPoint];
  530. case RQHomePageCarType_ZGZ_WXP:
  531. return [RQ_YDT_ZGZ_WXP_Question_Module getPoint];
  532. case RQHomePageCarType_ZGZ_CZC:
  533. return [RQ_YDT_ZGZ_CZC_Question_Module getPoint];
  534. case RQHomePageCarType_ZGZ_WYC:
  535. return [RQ_YDT_ZGZ_WYC_Question_Module getPoint];
  536. default:
  537. return [RQ_YDT_XC_Question_Module getPoint];
  538. }
  539. }
  540. - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId {
  541. switch (self.carType) {
  542. case RQHomePageCarType_Car:
  543. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
  544. case RQHomePageCarType_Truck:
  545. return [RQ_YDT_HC_Question_Module getPointQuestionWithPointId:pointId];
  546. case RQHomePageCarType_Bus:
  547. return [RQ_YDT_KC_Question_Module getPointQuestionWithPointId:pointId];
  548. case RQHomePageCarType_Motorcycle:
  549. return [RQ_YDT_MTC_Question_Module getPointQuestionWithPointId:pointId];
  550. case RQHomePageCarType_ZGZ_JLY:
  551. return [RQ_YDT_ZGZ_JLY_Question_Module getPointQuestionWithPointId:pointId];
  552. case RQHomePageCarType_ZGZ_KY:
  553. return [RQ_YDT_ZGZ_KY_Question_Module getPointQuestionWithPointId:pointId];
  554. case RQHomePageCarType_ZGZ_HY:
  555. return [RQ_YDT_ZGZ_HY_Question_Module getPointQuestionWithPointId:pointId];
  556. case RQHomePageCarType_ZGZ_WXP:
  557. return [RQ_YDT_ZGZ_WXP_Question_Module getPointQuestionWithPointId:pointId];
  558. case RQHomePageCarType_ZGZ_CZC:
  559. return [RQ_YDT_ZGZ_CZC_Question_Module getPointQuestionWithPointId:pointId];
  560. case RQHomePageCarType_ZGZ_WYC:
  561. return [RQ_YDT_ZGZ_WYC_Question_Module getPointQuestionWithPointId:pointId];
  562. default:
  563. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
  564. }
  565. }
  566. - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId exerciseType:(RQExerciseType)exerciseType {
  567. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId exerciseType:exerciseType];
  568. }
  569. - (BOOL)isNewRuleQuestionWithQuestionId:(NSInteger)questionId {
  570. switch (self.carType) {
  571. case RQHomePageCarType_Car:
  572. return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  573. case RQHomePageCarType_Truck:
  574. return [RQ_YDT_HC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  575. case RQHomePageCarType_Bus:
  576. return [RQ_YDT_KC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  577. case RQHomePageCarType_Motorcycle:
  578. return [RQ_YDT_MTC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  579. case RQHomePageCarType_ZGZ_JLY:
  580. return [RQ_YDT_ZGZ_JLY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  581. case RQHomePageCarType_ZGZ_KY:
  582. return [RQ_YDT_ZGZ_KY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  583. case RQHomePageCarType_ZGZ_HY:
  584. return [RQ_YDT_ZGZ_HY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  585. case RQHomePageCarType_ZGZ_WXP:
  586. return [RQ_YDT_ZGZ_WXP_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  587. case RQHomePageCarType_ZGZ_CZC:
  588. return [RQ_YDT_ZGZ_CZC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  589. case RQHomePageCarType_ZGZ_WYC:
  590. return [RQ_YDT_ZGZ_WYC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  591. default:
  592. return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  593. }
  594. }
  595. - (NSData *)getMediaDataWithMediaName:(NSString *)mediaName {
  596. switch (self.carType) {
  597. case RQHomePageCarType_Car:
  598. return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
  599. case RQHomePageCarType_Truck:
  600. return [RQ_YDT_HC_Question_Module getMediaDataWithMediaName:mediaName];
  601. case RQHomePageCarType_Bus:
  602. return [RQ_YDT_KC_Question_Module getMediaDataWithMediaName:mediaName];
  603. case RQHomePageCarType_Motorcycle:
  604. return [RQ_YDT_MTC_Question_Module getMediaDataWithMediaName:mediaName];
  605. case RQHomePageCarType_ZGZ_JLY:
  606. return [RQ_YDT_ZGZ_JLY_Question_Module getMediaDataWithMediaName:mediaName];
  607. case RQHomePageCarType_ZGZ_KY:
  608. return [RQ_YDT_ZGZ_KY_Question_Module getMediaDataWithMediaName:mediaName];
  609. case RQHomePageCarType_ZGZ_HY:
  610. return [RQ_YDT_ZGZ_HY_Question_Module getMediaDataWithMediaName:mediaName];
  611. case RQHomePageCarType_ZGZ_WXP:
  612. return [RQ_YDT_ZGZ_WXP_Question_Module getMediaDataWithMediaName:mediaName];
  613. case RQHomePageCarType_ZGZ_CZC:
  614. return [RQ_YDT_ZGZ_CZC_Question_Module getMediaDataWithMediaName:mediaName];
  615. case RQHomePageCarType_ZGZ_WYC:
  616. return [RQ_YDT_ZGZ_WYC_Question_Module getMediaDataWithMediaName:mediaName];
  617. default:
  618. return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
  619. }
  620. }
  621. /// 做到哪一题
  622. - (NSInteger)getHistoryQuestionNum {
  623. NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0"];
  624. if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
  625. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr];
  626. }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
  627. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr,RQ_Exercise_Module.codeStr];
  628. }
  629. id object = [RQ_COMMON_MANAGER getObjectWithKey:key];
  630. if (RQObjectIsNil(object)) {
  631. return 0;
  632. } else {
  633. NSInteger historyQuestionNum = [object integerValue];
  634. return historyQuestionNum;
  635. }
  636. }
  637. - (void)saveHistoryQuestionNumWithQuestionId:(NSInteger)questionId {
  638. NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0"];
  639. if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
  640. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr];
  641. }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
  642. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr,RQ_Exercise_Module.codeStr];
  643. }
  644. [RQ_SHARE_FUNCTION saveObjectWithObject:@(questionId) ForKey:key];
  645. }
  646. - (NSString *)isWelcomed {
  647. id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isWelcomed"];
  648. if (RQObjectIsNil(object)) {
  649. return @"";
  650. } else {
  651. NSString *isWelcomed = (NSString *)object;
  652. return isWelcomed;
  653. }
  654. }
  655. - (void)setIsWelcomed:(NSString *)isWelcomed {
  656. [RQ_SHARE_FUNCTION saveObjectWithObject:isWelcomed ForKey:@"isWelcomed"];
  657. }
  658. - (NSString *)car_type {
  659. return [self getCar_TypeNameWithCarType:self.carType];
  660. }
  661. - (NSString *)userSubj1Index {
  662. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj1Index"];
  663. if (RQObjectIsNil(object)) {
  664. return @"";
  665. } else {
  666. NSString *userSubj1Index = (NSString *)object;
  667. return userSubj1Index;
  668. }
  669. }
  670. - (void)setUserSubj1Index:(NSString *)userSubj1Index {
  671. [RQ_COMMON_MANAGER saveObjectWithObject:userSubj1Index ForKey:@"userSubj1Index"];
  672. }
  673. - (NSString *)userSubj4Index {
  674. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj4Index"];
  675. if (RQObjectIsNil(object)) {
  676. return @"";
  677. } else {
  678. NSString *userSubj4Index = (NSString *)object;
  679. return userSubj4Index;
  680. }
  681. }
  682. - (void)setUserSubj4Index:(NSString *)userSubj4Index {
  683. [RQ_COMMON_MANAGER saveObjectWithObject:userSubj4Index ForKey:@"userSubj4Index"];
  684. }
  685. - (NSString *)user1Index {
  686. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user1Index"];
  687. if (RQObjectIsNil(object)) {
  688. return @"";
  689. } else {
  690. NSString *user1Index = (NSString *)object;
  691. return user1Index;
  692. }
  693. }
  694. - (void)setUser1Index:(NSString *)user1Index {
  695. [RQ_COMMON_MANAGER saveObjectWithObject:user1Index ForKey:@"user1Index"];
  696. }
  697. - (NSString *)user4Index {
  698. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user4Index"];
  699. if (RQObjectIsNil(object)) {
  700. return @"";
  701. } else {
  702. NSString *user4Index = (NSString *)object;
  703. return user4Index;
  704. }
  705. }
  706. - (void)setUser4Index:(NSString *)user4Index {
  707. [RQ_COMMON_MANAGER saveObjectWithObject:user4Index ForKey:@"user4Index"];
  708. }
  709. - (NSString *)A2Subj1Index {
  710. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj1Index"];
  711. if (RQObjectIsNil(object)) {
  712. return @"";
  713. } else {
  714. NSString *A2Subj1Index = (NSString *)object;
  715. return A2Subj1Index;
  716. }
  717. }
  718. - (void)setA2Subj1Index:(NSString *)A2Subj1Index{
  719. [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj1Index ForKey:@"A2Subj1Index"];
  720. }
  721. - (NSString *)A2Subj4Index {
  722. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj4Index"];
  723. if (RQObjectIsNil(object)) {
  724. return @"";
  725. } else {
  726. NSString *A2Subj4Index = (NSString *)object;
  727. return A2Subj4Index;
  728. }
  729. }
  730. - (void)setA2Subj4Index:(NSString *)A2Subj4Index {
  731. [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj4Index ForKey:@"A2Subj4Index"];
  732. }
  733. - (NSString *)A1Subj1Index {
  734. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj1Index"];
  735. if (RQObjectIsNil(object)) {
  736. return @"";
  737. } else {
  738. NSString *A1Subj1Index = (NSString *)object;
  739. return A1Subj1Index;
  740. }
  741. }
  742. - (void)setA1Subj1Index:(NSString *)A1Subj1Index {
  743. [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj1Index ForKey:@"A1Subj1Index"];
  744. }
  745. - (NSString *)A1Subj4Index {
  746. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj4Index"];
  747. if (RQObjectIsNil(object)) {
  748. return @"";
  749. } else {
  750. NSString *A1Subj4Index = (NSString *)object;
  751. return A1Subj4Index;
  752. }
  753. }
  754. - (void)setA1Subj4Index:(NSString *)A1Subj4Index {
  755. [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj4Index ForKey:@"A1Subj4Index"];
  756. }
  757. - (NSString *)DSubj1Index {
  758. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj1Index"];
  759. if (RQObjectIsNil(object)) {
  760. return @"";
  761. } else {
  762. NSString *DSubj1Index = (NSString *)object;
  763. return DSubj1Index;
  764. }
  765. }
  766. - (void)setDSubj1Index:(NSString *)DSubj1Index {
  767. [RQ_COMMON_MANAGER saveObjectWithObject:DSubj1Index ForKey:@"DSubj1Index"];
  768. }
  769. - (NSString *)DSubj4Index {
  770. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj4Index"];
  771. if (RQObjectIsNil(object)) {
  772. return @"";
  773. } else {
  774. NSString *DSubj4Index = (NSString *)object;
  775. return DSubj4Index;
  776. }
  777. }
  778. - (void)setDSubj4Index:(NSString *)DSubj4Index {
  779. [RQ_COMMON_MANAGER saveObjectWithObject:DSubj4Index ForKey:@"DSubj4Index"];
  780. }
  781. - (NSString *)coachIndex {
  782. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"coachIndex"];
  783. if (RQObjectIsNil(object)) {
  784. return @"";
  785. } else {
  786. NSString *coachIndex = (NSString *)object;
  787. return coachIndex;
  788. }
  789. }
  790. - (void)setCoachIndex:(NSString *)coachIndex {
  791. [RQ_COMMON_MANAGER saveObjectWithObject:coachIndex ForKey:@"coachIndex"];
  792. }
  793. - (NSString *)A1Index {
  794. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Index"];
  795. if (RQObjectIsNil(object)) {
  796. return @"";
  797. } else {
  798. NSString *A1Index = (NSString *)object;
  799. return A1Index;
  800. }
  801. }
  802. - (void)setA1Index:(NSString *)A1Index {
  803. [RQ_COMMON_MANAGER saveObjectWithObject:A1Index ForKey:@"A1Index"];
  804. }
  805. - (NSString *)A2Index {
  806. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Index"];
  807. if (RQObjectIsNil(object)) {
  808. return @"";
  809. } else {
  810. NSString *A2Index = (NSString *)object;
  811. return A2Index;
  812. }
  813. }
  814. - (void)setA2Index:(NSString *)A2Index {
  815. [RQ_COMMON_MANAGER saveObjectWithObject:A2Index ForKey:@"A2Index"];
  816. }
  817. - (NSString *)dangerIndex {
  818. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"dangerIndex"];
  819. if (RQObjectIsNil(object)) {
  820. return @"";
  821. } else {
  822. NSString *dangerIndex = (NSString *)object;
  823. return dangerIndex;
  824. }
  825. }
  826. - (void)setDangerIndex:(NSString *)dangerIndex {
  827. [RQ_COMMON_MANAGER saveObjectWithObject:dangerIndex ForKey:@"dangerIndex"];
  828. }
  829. - (NSString *)texiIndex {
  830. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"texiIndex"];
  831. if (RQObjectIsNil(object)) {
  832. return @"";
  833. } else {
  834. NSString *texiIndex = (NSString *)object;
  835. return texiIndex;
  836. }
  837. }
  838. - (void)setTexiIndex:(NSString *)texiIndex {
  839. [RQ_COMMON_MANAGER saveObjectWithObject:texiIndex ForKey:@"texiIndex"];
  840. }
  841. - (NSString *)wycIndex {
  842. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"wycIndex"];
  843. if (RQObjectIsNil(object)) {
  844. return @"";
  845. } else {
  846. NSString *wycIndex = (NSString *)object;
  847. return wycIndex;
  848. }
  849. }
  850. - (void)setWycIndex:(NSString *)wycIndex {
  851. [RQ_COMMON_MANAGER saveObjectWithObject:wycIndex ForKey:@"wycIndex"];
  852. }
  853. - (NSString *)isZhiGeZheng {
  854. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"isZhiGeZheng"];
  855. if (RQObjectIsNil(object)) {
  856. return @"NO";
  857. } else {
  858. NSString *isZhiGeZheng = (NSString *)object;
  859. return isZhiGeZheng;
  860. }
  861. }
  862. - (void)setIsZhiGeZheng:(NSString *)isZhiGeZheng {
  863. [RQ_COMMON_MANAGER saveObjectWithObject:isZhiGeZheng ForKey:@"isZhiGeZheng"];
  864. }
  865. #pragma mark - PrivateMethods
  866. - (NSString *)getCarTypeNameWithCarType:(RQHomePageCarType)carType {
  867. switch (carType) {
  868. case RQHomePageCarType_Car:
  869. return @"xc";
  870. case RQHomePageCarType_Bus:
  871. return @"kc";
  872. case RQHomePageCarType_Truck:
  873. return @"hc";
  874. case RQHomePageCarType_Motorcycle:
  875. return @"mtc";
  876. case RQHomePageCarType_ZGZ_JLY:
  877. return @"zgzjl";
  878. case RQHomePageCarType_ZGZ_KY:
  879. return @"zgzky";
  880. case RQHomePageCarType_ZGZ_HY:
  881. return @"zgzhy";
  882. case RQHomePageCarType_ZGZ_WXP:
  883. return @"zgzwxp";
  884. case RQHomePageCarType_ZGZ_CZC:
  885. return @"zgzcz";
  886. case RQHomePageCarType_ZGZ_WYC:
  887. return @"zgzwyc";
  888. default:
  889. return @"xc";
  890. }
  891. }
  892. - (void)rq_showDBUpdateView {
  893. @weakify(self)
  894. dispatch_async(dispatch_get_main_queue(), ^{
  895. @strongify(self)
  896. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  897. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_LibDownload;
  898. dbUpdateView.downloadUrl = self.downloadUrl;
  899. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  900. dbModalViewController.contentView = dbUpdateView;
  901. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  902. dbModalViewController.modal = YES;
  903. dbUpdateView.modalViewController = dbModalViewController;
  904. [dbModalViewController showWithAnimated:YES completion:nil];
  905. });
  906. }
  907. - (void)rq_showJSUpdateView {
  908. @weakify(self)
  909. dispatch_async(dispatch_get_main_queue(), ^{
  910. @strongify(self)
  911. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  912. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
  913. dbUpdateView.jsDownloadUrl = self.jsDownloadUrl;
  914. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  915. dbModalViewController.contentView = dbUpdateView;
  916. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  917. dbModalViewController.modal = YES;
  918. dbUpdateView.modalViewController = dbModalViewController;
  919. [dbModalViewController showWithAnimated:YES completion:nil];
  920. });
  921. }
  922. - (void)rq_showJQUpdateView {
  923. @weakify(self)
  924. dispatch_async(dispatch_get_main_queue(), ^{
  925. @strongify(self)
  926. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  927. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
  928. dbUpdateView.jsDownloadUrl = self.jqDownloadUrl;
  929. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  930. dbModalViewController.contentView = dbUpdateView;
  931. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  932. dbModalViewController.modal = YES;
  933. dbUpdateView.modalViewController = dbModalViewController;
  934. [dbModalViewController showWithAnimated:YES completion:nil];
  935. });
  936. }
  937. @end