RQYDTQuestionModule.m 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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 code:(NSInteger)code {
  338. switch (self.carType) {
  339. case RQHomePageCarType_Car:
  340. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType code:code];
  341. default:
  342. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  343. }
  344. return @[];
  345. }
  346. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType {
  347. switch (self.carType) {
  348. case RQHomePageCarType_Car:
  349. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  350. case RQHomePageCarType_Truck:
  351. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  352. case RQHomePageCarType_Bus:
  353. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  354. case RQHomePageCarType_Motorcycle:
  355. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  356. case RQHomePageCarType_ZGZ_JLY:
  357. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  358. case RQHomePageCarType_ZGZ_KY:
  359. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  360. case RQHomePageCarType_ZGZ_HY:
  361. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  362. case RQHomePageCarType_ZGZ_WXP:
  363. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  364. case RQHomePageCarType_ZGZ_CZC:
  365. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  366. case RQHomePageCarType_ZGZ_WYC:
  367. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  368. default:
  369. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  370. }
  371. }
  372. - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
  373. switch (self.carType) {
  374. case RQHomePageCarType_Car:
  375. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  376. case RQHomePageCarType_Truck:
  377. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  378. case RQHomePageCarType_Bus:
  379. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  380. case RQHomePageCarType_Motorcycle:
  381. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  382. case RQHomePageCarType_ZGZ_JLY:
  383. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  384. case RQHomePageCarType_ZGZ_KY:
  385. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  386. case RQHomePageCarType_ZGZ_HY:
  387. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  388. case RQHomePageCarType_ZGZ_WXP:
  389. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  390. case RQHomePageCarType_ZGZ_CZC:
  391. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  392. case RQHomePageCarType_ZGZ_WYC:
  393. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  394. default:
  395. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  396. }
  397. }
  398. - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType isNeedMediaData:(BOOL)isNeedMediaData {
  399. switch (self.carType) {
  400. case RQHomePageCarType_Car:
  401. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  402. case RQHomePageCarType_Truck:
  403. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  404. case RQHomePageCarType_Bus:
  405. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  406. case RQHomePageCarType_Motorcycle:
  407. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  408. case RQHomePageCarType_ZGZ_JLY:
  409. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  410. case RQHomePageCarType_ZGZ_KY:
  411. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  412. case RQHomePageCarType_ZGZ_HY:
  413. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  414. case RQHomePageCarType_ZGZ_WXP:
  415. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  416. case RQHomePageCarType_ZGZ_CZC:
  417. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  418. case RQHomePageCarType_ZGZ_WYC:
  419. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  420. default:
  421. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  422. }
  423. }
  424. - (NSInteger)getQuestionNumWithWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
  425. switch (self.carType) {
  426. case RQHomePageCarType_Car:
  427. return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  428. case RQHomePageCarType_Truck:
  429. return [RQ_YDT_HC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  430. case RQHomePageCarType_Bus:
  431. return [RQ_YDT_KC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  432. case RQHomePageCarType_Motorcycle:
  433. return [RQ_YDT_MTC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  434. case RQHomePageCarType_ZGZ_JLY:
  435. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  436. case RQHomePageCarType_ZGZ_KY:
  437. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  438. case RQHomePageCarType_ZGZ_HY:
  439. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  440. case RQHomePageCarType_ZGZ_WXP:
  441. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionNumWithExerciseType:exerciseType];
  442. case RQHomePageCarType_ZGZ_CZC:
  443. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionNumWithExerciseType:exerciseType];
  444. case RQHomePageCarType_ZGZ_WYC:
  445. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionNumWithExerciseType:exerciseType];
  446. default:
  447. return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  448. }
  449. }
  450. - (NSArray *)getChapterArr {
  451. switch (self.carType) {
  452. case RQHomePageCarType_Car:
  453. return [RQ_YDT_XC_Question_Module getChapter];
  454. case RQHomePageCarType_Truck:
  455. return [RQ_YDT_HC_Question_Module getChapter];
  456. case RQHomePageCarType_Bus:
  457. return [RQ_YDT_KC_Question_Module getChapter];
  458. case RQHomePageCarType_Motorcycle:
  459. return [RQ_YDT_MTC_Question_Module getChapter];
  460. case RQHomePageCarType_ZGZ_JLY:
  461. return [RQ_YDT_ZGZ_JLY_Question_Module getChapter];
  462. case RQHomePageCarType_ZGZ_KY:
  463. return [RQ_YDT_ZGZ_KY_Question_Module getChapter];
  464. case RQHomePageCarType_ZGZ_HY:
  465. return [RQ_YDT_ZGZ_HY_Question_Module getChapter];
  466. case RQHomePageCarType_ZGZ_WXP:
  467. return [RQ_YDT_ZGZ_WXP_Question_Module getChapter];
  468. case RQHomePageCarType_ZGZ_CZC:
  469. return [RQ_YDT_ZGZ_CZC_Question_Module getChapter];
  470. case RQHomePageCarType_ZGZ_WYC:
  471. return [RQ_YDT_ZGZ_WYC_Question_Module getChapter];
  472. default:
  473. return [RQ_YDT_XC_Question_Module getChapter];
  474. }
  475. }
  476. - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName {
  477. switch (self.carType) {
  478. case RQHomePageCarType_Car:
  479. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
  480. case RQHomePageCarType_Truck:
  481. return [RQ_YDT_HC_Question_Module getChapterQuestionWithChapterName:chapterName];
  482. case RQHomePageCarType_Bus:
  483. return [RQ_YDT_KC_Question_Module getChapterQuestionWithChapterName:chapterName];
  484. case RQHomePageCarType_Motorcycle:
  485. return [RQ_YDT_MTC_Question_Module getChapterQuestionWithChapterName:chapterName];
  486. case RQHomePageCarType_ZGZ_JLY:
  487. return [RQ_YDT_ZGZ_JLY_Question_Module getChapterQuestionWithChapterName:chapterName];
  488. case RQHomePageCarType_ZGZ_KY:
  489. return [RQ_YDT_ZGZ_KY_Question_Module getChapterQuestionWithChapterName:chapterName];
  490. case RQHomePageCarType_ZGZ_HY:
  491. return [RQ_YDT_ZGZ_HY_Question_Module getChapterQuestionWithChapterName:chapterName];
  492. case RQHomePageCarType_ZGZ_WXP:
  493. return [RQ_YDT_ZGZ_WXP_Question_Module getChapterQuestionWithChapterName:chapterName];
  494. case RQHomePageCarType_ZGZ_CZC:
  495. return [RQ_YDT_ZGZ_CZC_Question_Module getChapterQuestionWithChapterName:chapterName];
  496. case RQHomePageCarType_ZGZ_WYC:
  497. return [RQ_YDT_ZGZ_WYC_Question_Module getChapterQuestionWithChapterName:chapterName];
  498. default:
  499. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
  500. }
  501. }
  502. - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName exerciseType:(RQExerciseType)exerciseType {
  503. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName exerciseType:exerciseType];
  504. }
  505. - (NSArray *)getPoint {
  506. switch (self.carType) {
  507. case RQHomePageCarType_Car:
  508. return [RQ_YDT_XC_Question_Module getPoint];
  509. case RQHomePageCarType_Truck:
  510. return [RQ_YDT_HC_Question_Module getPoint];
  511. case RQHomePageCarType_Bus:
  512. return [RQ_YDT_KC_Question_Module getPoint];
  513. case RQHomePageCarType_Motorcycle:
  514. return [RQ_YDT_MTC_Question_Module getPoint];
  515. case RQHomePageCarType_ZGZ_JLY:
  516. return [RQ_YDT_ZGZ_JLY_Question_Module getPoint];
  517. case RQHomePageCarType_ZGZ_KY:
  518. return [RQ_YDT_ZGZ_KY_Question_Module getPoint];
  519. case RQHomePageCarType_ZGZ_HY:
  520. return [RQ_YDT_ZGZ_HY_Question_Module getPoint];
  521. case RQHomePageCarType_ZGZ_WXP:
  522. return [RQ_YDT_ZGZ_WXP_Question_Module getPoint];
  523. case RQHomePageCarType_ZGZ_CZC:
  524. return [RQ_YDT_ZGZ_CZC_Question_Module getPoint];
  525. case RQHomePageCarType_ZGZ_WYC:
  526. return [RQ_YDT_ZGZ_WYC_Question_Module getPoint];
  527. default:
  528. return [RQ_YDT_XC_Question_Module getPoint];
  529. }
  530. }
  531. - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId {
  532. switch (self.carType) {
  533. case RQHomePageCarType_Car:
  534. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
  535. case RQHomePageCarType_Truck:
  536. return [RQ_YDT_HC_Question_Module getPointQuestionWithPointId:pointId];
  537. case RQHomePageCarType_Bus:
  538. return [RQ_YDT_KC_Question_Module getPointQuestionWithPointId:pointId];
  539. case RQHomePageCarType_Motorcycle:
  540. return [RQ_YDT_MTC_Question_Module getPointQuestionWithPointId:pointId];
  541. case RQHomePageCarType_ZGZ_JLY:
  542. return [RQ_YDT_ZGZ_JLY_Question_Module getPointQuestionWithPointId:pointId];
  543. case RQHomePageCarType_ZGZ_KY:
  544. return [RQ_YDT_ZGZ_KY_Question_Module getPointQuestionWithPointId:pointId];
  545. case RQHomePageCarType_ZGZ_HY:
  546. return [RQ_YDT_ZGZ_HY_Question_Module getPointQuestionWithPointId:pointId];
  547. case RQHomePageCarType_ZGZ_WXP:
  548. return [RQ_YDT_ZGZ_WXP_Question_Module getPointQuestionWithPointId:pointId];
  549. case RQHomePageCarType_ZGZ_CZC:
  550. return [RQ_YDT_ZGZ_CZC_Question_Module getPointQuestionWithPointId:pointId];
  551. case RQHomePageCarType_ZGZ_WYC:
  552. return [RQ_YDT_ZGZ_WYC_Question_Module getPointQuestionWithPointId:pointId];
  553. default:
  554. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
  555. }
  556. }
  557. - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId exerciseType:(RQExerciseType)exerciseType {
  558. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId exerciseType:exerciseType];
  559. }
  560. - (BOOL)isNewRuleQuestionWithQuestionId:(NSInteger)questionId {
  561. switch (self.carType) {
  562. case RQHomePageCarType_Car:
  563. return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  564. case RQHomePageCarType_Truck:
  565. return [RQ_YDT_HC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  566. case RQHomePageCarType_Bus:
  567. return [RQ_YDT_KC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  568. case RQHomePageCarType_Motorcycle:
  569. return [RQ_YDT_MTC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  570. case RQHomePageCarType_ZGZ_JLY:
  571. return [RQ_YDT_ZGZ_JLY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  572. case RQHomePageCarType_ZGZ_KY:
  573. return [RQ_YDT_ZGZ_KY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  574. case RQHomePageCarType_ZGZ_HY:
  575. return [RQ_YDT_ZGZ_HY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  576. case RQHomePageCarType_ZGZ_WXP:
  577. return [RQ_YDT_ZGZ_WXP_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  578. case RQHomePageCarType_ZGZ_CZC:
  579. return [RQ_YDT_ZGZ_CZC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  580. case RQHomePageCarType_ZGZ_WYC:
  581. return [RQ_YDT_ZGZ_WYC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  582. default:
  583. return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  584. }
  585. }
  586. - (NSData *)getMediaDataWithMediaName:(NSString *)mediaName {
  587. switch (self.carType) {
  588. case RQHomePageCarType_Car:
  589. return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
  590. case RQHomePageCarType_Truck:
  591. return [RQ_YDT_HC_Question_Module getMediaDataWithMediaName:mediaName];
  592. case RQHomePageCarType_Bus:
  593. return [RQ_YDT_KC_Question_Module getMediaDataWithMediaName:mediaName];
  594. case RQHomePageCarType_Motorcycle:
  595. return [RQ_YDT_MTC_Question_Module getMediaDataWithMediaName:mediaName];
  596. case RQHomePageCarType_ZGZ_JLY:
  597. return [RQ_YDT_ZGZ_JLY_Question_Module getMediaDataWithMediaName:mediaName];
  598. case RQHomePageCarType_ZGZ_KY:
  599. return [RQ_YDT_ZGZ_KY_Question_Module getMediaDataWithMediaName:mediaName];
  600. case RQHomePageCarType_ZGZ_HY:
  601. return [RQ_YDT_ZGZ_HY_Question_Module getMediaDataWithMediaName:mediaName];
  602. case RQHomePageCarType_ZGZ_WXP:
  603. return [RQ_YDT_ZGZ_WXP_Question_Module getMediaDataWithMediaName:mediaName];
  604. case RQHomePageCarType_ZGZ_CZC:
  605. return [RQ_YDT_ZGZ_CZC_Question_Module getMediaDataWithMediaName:mediaName];
  606. case RQHomePageCarType_ZGZ_WYC:
  607. return [RQ_YDT_ZGZ_WYC_Question_Module getMediaDataWithMediaName:mediaName];
  608. default:
  609. return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
  610. }
  611. }
  612. /// 做到哪一题
  613. - (NSInteger)getHistoryQuestionNum {
  614. 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"];
  615. if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
  616. 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];
  617. }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
  618. 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];
  619. }
  620. id object = [RQ_COMMON_MANAGER getObjectWithKey:key];
  621. if (RQObjectIsNil(object)) {
  622. return 0;
  623. } else {
  624. NSInteger historyQuestionNum = [object integerValue];
  625. return historyQuestionNum;
  626. }
  627. }
  628. - (void)saveHistoryQuestionNumWithQuestionId:(NSInteger)questionId {
  629. 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"];
  630. if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
  631. 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];
  632. }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
  633. 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];
  634. }
  635. [RQ_SHARE_FUNCTION saveObjectWithObject:@(questionId) ForKey:key];
  636. }
  637. - (NSString *)isWelcomed {
  638. id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isWelcomed"];
  639. if (RQObjectIsNil(object)) {
  640. return @"";
  641. } else {
  642. NSString *isWelcomed = (NSString *)object;
  643. return isWelcomed;
  644. }
  645. }
  646. - (void)setIsWelcomed:(NSString *)isWelcomed {
  647. [RQ_SHARE_FUNCTION saveObjectWithObject:isWelcomed ForKey:@"isWelcomed"];
  648. }
  649. - (NSString *)car_type {
  650. return [self getCar_TypeNameWithCarType:self.carType];
  651. }
  652. - (NSString *)userSubj1Index {
  653. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj1Index"];
  654. if (RQObjectIsNil(object)) {
  655. return @"";
  656. } else {
  657. NSString *userSubj1Index = (NSString *)object;
  658. return userSubj1Index;
  659. }
  660. }
  661. - (void)setUserSubj1Index:(NSString *)userSubj1Index {
  662. [RQ_COMMON_MANAGER saveObjectWithObject:userSubj1Index ForKey:@"userSubj1Index"];
  663. }
  664. - (NSString *)userSubj4Index {
  665. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj4Index"];
  666. if (RQObjectIsNil(object)) {
  667. return @"";
  668. } else {
  669. NSString *userSubj4Index = (NSString *)object;
  670. return userSubj4Index;
  671. }
  672. }
  673. - (void)setUserSubj4Index:(NSString *)userSubj4Index {
  674. [RQ_COMMON_MANAGER saveObjectWithObject:userSubj4Index ForKey:@"userSubj4Index"];
  675. }
  676. - (NSString *)user1Index {
  677. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user1Index"];
  678. if (RQObjectIsNil(object)) {
  679. return @"";
  680. } else {
  681. NSString *user1Index = (NSString *)object;
  682. return user1Index;
  683. }
  684. }
  685. - (void)setUser1Index:(NSString *)user1Index {
  686. [RQ_COMMON_MANAGER saveObjectWithObject:user1Index ForKey:@"user1Index"];
  687. }
  688. - (NSString *)user4Index {
  689. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user4Index"];
  690. if (RQObjectIsNil(object)) {
  691. return @"";
  692. } else {
  693. NSString *user4Index = (NSString *)object;
  694. return user4Index;
  695. }
  696. }
  697. - (void)setUser4Index:(NSString *)user4Index {
  698. [RQ_COMMON_MANAGER saveObjectWithObject:user4Index ForKey:@"user4Index"];
  699. }
  700. - (NSString *)A2Subj1Index {
  701. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj1Index"];
  702. if (RQObjectIsNil(object)) {
  703. return @"";
  704. } else {
  705. NSString *A2Subj1Index = (NSString *)object;
  706. return A2Subj1Index;
  707. }
  708. }
  709. - (void)setA2Subj1Index:(NSString *)A2Subj1Index{
  710. [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj1Index ForKey:@"A2Subj1Index"];
  711. }
  712. - (NSString *)A2Subj4Index {
  713. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj4Index"];
  714. if (RQObjectIsNil(object)) {
  715. return @"";
  716. } else {
  717. NSString *A2Subj4Index = (NSString *)object;
  718. return A2Subj4Index;
  719. }
  720. }
  721. - (void)setA2Subj4Index:(NSString *)A2Subj4Index {
  722. [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj4Index ForKey:@"A2Subj4Index"];
  723. }
  724. - (NSString *)A1Subj1Index {
  725. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj1Index"];
  726. if (RQObjectIsNil(object)) {
  727. return @"";
  728. } else {
  729. NSString *A1Subj1Index = (NSString *)object;
  730. return A1Subj1Index;
  731. }
  732. }
  733. - (void)setA1Subj1Index:(NSString *)A1Subj1Index {
  734. [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj1Index ForKey:@"A1Subj1Index"];
  735. }
  736. - (NSString *)A1Subj4Index {
  737. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj4Index"];
  738. if (RQObjectIsNil(object)) {
  739. return @"";
  740. } else {
  741. NSString *A1Subj4Index = (NSString *)object;
  742. return A1Subj4Index;
  743. }
  744. }
  745. - (void)setA1Subj4Index:(NSString *)A1Subj4Index {
  746. [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj4Index ForKey:@"A1Subj4Index"];
  747. }
  748. - (NSString *)DSubj1Index {
  749. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj1Index"];
  750. if (RQObjectIsNil(object)) {
  751. return @"";
  752. } else {
  753. NSString *DSubj1Index = (NSString *)object;
  754. return DSubj1Index;
  755. }
  756. }
  757. - (void)setDSubj1Index:(NSString *)DSubj1Index {
  758. [RQ_COMMON_MANAGER saveObjectWithObject:DSubj1Index ForKey:@"DSubj1Index"];
  759. }
  760. - (NSString *)DSubj4Index {
  761. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj4Index"];
  762. if (RQObjectIsNil(object)) {
  763. return @"";
  764. } else {
  765. NSString *DSubj4Index = (NSString *)object;
  766. return DSubj4Index;
  767. }
  768. }
  769. - (void)setDSubj4Index:(NSString *)DSubj4Index {
  770. [RQ_COMMON_MANAGER saveObjectWithObject:DSubj4Index ForKey:@"DSubj4Index"];
  771. }
  772. - (NSString *)coachIndex {
  773. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"coachIndex"];
  774. if (RQObjectIsNil(object)) {
  775. return @"";
  776. } else {
  777. NSString *coachIndex = (NSString *)object;
  778. return coachIndex;
  779. }
  780. }
  781. - (void)setCoachIndex:(NSString *)coachIndex {
  782. [RQ_COMMON_MANAGER saveObjectWithObject:coachIndex ForKey:@"coachIndex"];
  783. }
  784. - (NSString *)A1Index {
  785. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Index"];
  786. if (RQObjectIsNil(object)) {
  787. return @"";
  788. } else {
  789. NSString *A1Index = (NSString *)object;
  790. return A1Index;
  791. }
  792. }
  793. - (void)setA1Index:(NSString *)A1Index {
  794. [RQ_COMMON_MANAGER saveObjectWithObject:A1Index ForKey:@"A1Index"];
  795. }
  796. - (NSString *)A2Index {
  797. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Index"];
  798. if (RQObjectIsNil(object)) {
  799. return @"";
  800. } else {
  801. NSString *A2Index = (NSString *)object;
  802. return A2Index;
  803. }
  804. }
  805. - (void)setA2Index:(NSString *)A2Index {
  806. [RQ_COMMON_MANAGER saveObjectWithObject:A2Index ForKey:@"A2Index"];
  807. }
  808. - (NSString *)dangerIndex {
  809. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"dangerIndex"];
  810. if (RQObjectIsNil(object)) {
  811. return @"";
  812. } else {
  813. NSString *dangerIndex = (NSString *)object;
  814. return dangerIndex;
  815. }
  816. }
  817. - (void)setDangerIndex:(NSString *)dangerIndex {
  818. [RQ_COMMON_MANAGER saveObjectWithObject:dangerIndex ForKey:@"dangerIndex"];
  819. }
  820. - (NSString *)texiIndex {
  821. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"texiIndex"];
  822. if (RQObjectIsNil(object)) {
  823. return @"";
  824. } else {
  825. NSString *texiIndex = (NSString *)object;
  826. return texiIndex;
  827. }
  828. }
  829. - (void)setTexiIndex:(NSString *)texiIndex {
  830. [RQ_COMMON_MANAGER saveObjectWithObject:texiIndex ForKey:@"texiIndex"];
  831. }
  832. - (NSString *)wycIndex {
  833. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"wycIndex"];
  834. if (RQObjectIsNil(object)) {
  835. return @"";
  836. } else {
  837. NSString *wycIndex = (NSString *)object;
  838. return wycIndex;
  839. }
  840. }
  841. - (void)setWycIndex:(NSString *)wycIndex {
  842. [RQ_COMMON_MANAGER saveObjectWithObject:wycIndex ForKey:@"wycIndex"];
  843. }
  844. - (NSString *)isZhiGeZheng {
  845. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"isZhiGeZheng"];
  846. if (RQObjectIsNil(object)) {
  847. return @"NO";
  848. } else {
  849. NSString *isZhiGeZheng = (NSString *)object;
  850. return isZhiGeZheng;
  851. }
  852. }
  853. - (void)setIsZhiGeZheng:(NSString *)isZhiGeZheng {
  854. [RQ_COMMON_MANAGER saveObjectWithObject:isZhiGeZheng ForKey:@"isZhiGeZheng"];
  855. }
  856. #pragma mark - PrivateMethods
  857. - (NSString *)getCarTypeNameWithCarType:(RQHomePageCarType)carType {
  858. switch (carType) {
  859. case RQHomePageCarType_Car:
  860. return @"xc";
  861. case RQHomePageCarType_Bus:
  862. return @"kc";
  863. case RQHomePageCarType_Truck:
  864. return @"hc";
  865. case RQHomePageCarType_Motorcycle:
  866. return @"mtc";
  867. case RQHomePageCarType_ZGZ_JLY:
  868. return @"zgzjl";
  869. case RQHomePageCarType_ZGZ_KY:
  870. return @"zgzky";
  871. case RQHomePageCarType_ZGZ_HY:
  872. return @"zgzhy";
  873. case RQHomePageCarType_ZGZ_WXP:
  874. return @"zgzwxp";
  875. case RQHomePageCarType_ZGZ_CZC:
  876. return @"zgzcz";
  877. case RQHomePageCarType_ZGZ_WYC:
  878. return @"zgzwyc";
  879. default:
  880. return @"xc";
  881. }
  882. }
  883. - (void)rq_showDBUpdateView {
  884. @weakify(self)
  885. dispatch_async(dispatch_get_main_queue(), ^{
  886. @strongify(self)
  887. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  888. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_LibDownload;
  889. dbUpdateView.downloadUrl = self.downloadUrl;
  890. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  891. dbModalViewController.contentView = dbUpdateView;
  892. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  893. dbModalViewController.modal = YES;
  894. dbUpdateView.modalViewController = dbModalViewController;
  895. [dbModalViewController showWithAnimated:YES completion:nil];
  896. });
  897. }
  898. - (void)rq_showJSUpdateView {
  899. @weakify(self)
  900. dispatch_async(dispatch_get_main_queue(), ^{
  901. @strongify(self)
  902. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  903. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
  904. dbUpdateView.jsDownloadUrl = self.jsDownloadUrl;
  905. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  906. dbModalViewController.contentView = dbUpdateView;
  907. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  908. dbModalViewController.modal = YES;
  909. dbUpdateView.modalViewController = dbModalViewController;
  910. [dbModalViewController showWithAnimated:YES completion:nil];
  911. });
  912. }
  913. - (void)rq_showJQUpdateView {
  914. @weakify(self)
  915. dispatch_async(dispatch_get_main_queue(), ^{
  916. @strongify(self)
  917. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  918. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
  919. dbUpdateView.jsDownloadUrl = self.jqDownloadUrl;
  920. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  921. dbModalViewController.contentView = dbUpdateView;
  922. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  923. dbModalViewController.modal = YES;
  924. dbUpdateView.modalViewController = dbModalViewController;
  925. [dbModalViewController showWithAnimated:YES completion:nil];
  926. });
  927. }
  928. @end