RQYDTQuestionModule.m 39 KB

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