12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058 |
- //
- // RQYDTQuestionModule.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/3/28.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQYDTQuestionModule.h"
- #import "RQYDTXCQuestionModule.h"
- #import "RQYDTHCQuestionModule.h"
- #import "RQYDTKCQuestionModule.h"
- #import "RQYDTMTCQuestionModule.h"
- #import "RQYDTZGZJLYQuestionModule.h"
- #import "RQYDTZGZKYQuestionModule.h"
- #import "RQYDTZGZHYQuestionModule.h"
- #import "RQYDTZGZWXPQuestionModule.h"
- #import "RQYDTZGZCZCQuestionModule.h"
- #import "RQYDTZGZWYCQuestionModule.h"
- NSString * const RQCarTypeChangeNotification = @"RQCarTypeChangeNotification";
- /// 正式环境key
- static NSString * const RQYDTQuestionCarTypeKey = @"RQYDTQuestionCarTypeKey";
- @interface RQYDTQuestionModule ()
- /// 科目一顺序练习
- @property (nonatomic, readwrite, copy) NSArray *subjectOneArr;
- /// 科目四顺序练习
- @property (nonatomic, readwrite, copy) NSArray *subjectFourArr;
- @property (nonatomic, readwrite, strong) NSString *downloadUrl;
- @property (nonatomic, readwrite, strong) NSString *jsDownloadUrl;
- @property (nonatomic, readwrite, strong) NSString *jqDownloadUrl;
- @end
- @implementation RQYDTQuestionModule
- static id rq_ydtQuestionModule = nil;
- #pragma mark - init
- + (instancetype)sharedInstance {
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- rq_ydtQuestionModule = [[self alloc] init];
- });
- return rq_ydtQuestionModule;
- }
- - (instancetype)init {
- if (self = [super init]) {
- NSInteger userVersion = [RQ_YDT_USER_Question_Module getQuestionVersion];
- NSLog(@"用户题库版本号:%ld",userVersion);
- NSInteger xcVersion = [RQ_YDT_XC_Question_Module getQuestionVersion];
- NSLog(@"小车题库版本号:%ld",xcVersion);
- NSInteger hcVersion = [RQ_YDT_HC_Question_Module getQuestionVersion];
- NSLog(@"货车题库版本号:%ld",hcVersion);
- NSInteger kcVersion = [RQ_YDT_KC_Question_Module getQuestionVersion];
- NSLog(@"客车题库版本号:%ld",kcVersion);
- NSInteger mtcVersion = [RQ_YDT_MTC_Question_Module getQuestionVersion];
- NSLog(@"摩托车题库版本号:%ld",mtcVersion);
- NSInteger zgzJlyVersion = [RQ_YDT_ZGZ_JLY_Question_Module getQuestionVersion];
- NSLog(@"资格证教练员题库版本号:%ld",zgzJlyVersion);
-
- }
- return self;
- }
- - (void)saveQuestionsWithSubjectOneArr:(NSArray *)subjectOneArr {
- self.subjectOneArr = subjectOneArr;
- }
- - (void)saveQuestionsWithSubjectFourArr:(NSArray *)subjectFourArr {
- self.subjectFourArr = subjectFourArr;
- }
- - (void)setCarType:(RQHomePageCarType)carType {
- NSString *carTypeStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:carType]];
- [[NSUserDefaults standardUserDefaults] setObject:carTypeStr forKey:RQYDTQuestionCarTypeKey];
- [[NSUserDefaults standardUserDefaults] synchronize];
- }
- - (NSMutableArray *)errorCollectionArr{
- if(!_errorCollectionArr){
- _errorCollectionArr = [NSMutableArray array];
- }
- return _errorCollectionArr;
- }
- - (NSMutableArray *)errorRemoveArr{
- if(!_errorRemoveArr){
- _errorRemoveArr = [NSMutableArray array];
- }
- return _errorRemoveArr;
- }
- - (RQHomePageCarType)carType {
- NSString *carTypeStr = [[NSUserDefaults standardUserDefaults] objectForKey:RQYDTQuestionCarTypeKey];
- carTypeStr = [carTypeStr rq_stringValueExtension];
- return carTypeStr.integerValue;
- }
- - (NSString *)carTypeStr {
- return [self getCarTypeNameWithCarType:self.carType];
- }
- - (NSString *)carTypeStrNew {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return @"cart";
- case RQHomePageCarType_Bus:
- return @"bus";
- case RQHomePageCarType_Truck:
- return @"truck";
- case RQHomePageCarType_Motorcycle:
- return @"mtc";
- case RQHomePageCarType_ZGZ_JLY:
- return @"zgzjl";
- case RQHomePageCarType_ZGZ_KY:
- return @"zgzky";
- case RQHomePageCarType_ZGZ_HY:
- return @"zgzhy";
- case RQHomePageCarType_ZGZ_WXP:
- return @"zgzwxp";
- case RQHomePageCarType_ZGZ_CZC:
- return @"zgzcz";
- case RQHomePageCarType_ZGZ_WYC:
- return @"zgzwyc";
-
- default:
- return @"cart";
- }
- }
- - (NSString *)subjectStr {
- return [self getSubjectNameWithSubject:self.subject];
- }
- #pragma mark - PublicMethods
- /// 更新题库
- - (void)rq_updateQuestion {
- @weakify(self)
- [[[RQ_HTTP_Service getUpdateQuestion] deliverOnMainThread] subscribeNext:^(NSArray *arr) {
- [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
- return [dictInfoModel.dictLabel isEqualToString:[RQ_YDTQuestion_Module getCarTypeCNTiKuUpdateNameWithCarType:RQ_YDTQuestion_Module.carType]];
- }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
- @strongify(self)
- NSInteger netVersion = dictInfoModel.remark.integerValue;
- NSInteger localVersion = [RQ_YDTQuestion_Module getQuestionVersion];
- self.downloadUrl = dictInfoModel.dictValue;
- if (netVersion > localVersion) {
- NSLog(@"题库需要更新!");
- [self rq_showDBUpdateView];
- } else {
- NSLog(@"题库不需要更新!");
- }
- }];
-
- [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
- return [dictInfoModel.dictLabel isEqualToString:@"题库解释"];
- }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
- @strongify(self)
- NSInteger netVersion = dictInfoModel.remark.integerValue;
- NSInteger localVersion = [RQ_YDT_JS_Question_Module getQuestionVersion];
- self.jsDownloadUrl = dictInfoModel.dictValue;
- if (netVersion > localVersion) {
- NSLog(@"解释题库需要更新!");
- [self rq_showJSUpdateView];
- } else {
- NSLog(@"解释题库不需要更新!");
- }
- }];
-
- [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
- return [dictInfoModel.dictLabel isEqualToString:@"快通解释"];
- }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
- @strongify(self)
- NSInteger netVersion = dictInfoModel.remark.integerValue;
- NSInteger localVersion = [YN_YDT_JQ_Question_Module getQuestionVersion];
- self.jqDownloadUrl = dictInfoModel.dictValue;
- if (netVersion > localVersion) {
- NSLog(@"快通解释题库需要更新!");
- [self rq_showJQUpdateView];
- } else {
- NSLog(@"快通解释题库不需要更新!");
- }
- }];
- }];
- }
- - (NSInteger)getQuestionVersion {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionVersion];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getQuestionVersion];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getQuestionVersion];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getQuestionVersion];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionVersion];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getQuestionVersion];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getQuestionVersion];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionVersion];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionVersion];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionVersion];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionVersion];
- }
- }
- - (NSString *)getSubjectNameWithSubject:(RQHomePageSubjectType)subject {
- switch (subject) {
- case RQHomePageSubjectType_SubjectOne:
- return @"1";
- case RQHomePageSubjectType_SubjectTwo:
- return @"2";
- case RQHomePageSubjectType_SubjectThree:
- return @"3";
- case RQHomePageSubjectType_SubjectFour:
- return @"4";
-
- default:
- return @"1";
- }
- }
- - (RQHomePageSubjectType)getSubjectWithSubjectName:(NSString *)subjectName {
- if ([subjectName isEqualToString:@"1"]) {
- return RQHomePageSubjectType_SubjectOne;
- } else if ([subjectName isEqualToString:@"2"]) {
- return RQHomePageSubjectType_SubjectTwo;
- } else if ([subjectName isEqualToString:@"3"]) {
- return RQHomePageSubjectType_SubjectThree;
- } else if ([subjectName isEqualToString:@"4"]) {
- return RQHomePageSubjectType_SubjectFour;
- } else {
- return RQHomePageSubjectType_SubjectOne;
- }
- }
- - (RQHomePageCarType)getCarTypeWithCarTypeName:(NSString *)carTypeName {
- if ([carTypeName isEqualToString:@"C1"]) {
- return RQHomePageCarType_Car;
- } else if ([carTypeName isEqualToString:@"A2"]) {
- return RQHomePageCarType_Truck;
- } else if ([carTypeName isEqualToString:@"A1"]) {
- return RQHomePageCarType_Bus;
- } else if ([carTypeName isEqualToString:@"D"]) {
- return RQHomePageCarType_Motorcycle;
- } else if ([carTypeName isEqualToString:@"4"]) {
- return RQHomePageCarType_ZGZ_JLY;
- } else if ([carTypeName isEqualToString:@"1"]) {
- return RQHomePageCarType_ZGZ_KY;
- } else if ([carTypeName isEqualToString:@"2"]) {
- return RQHomePageCarType_ZGZ_HY;
- } else if ([carTypeName isEqualToString:@"3"]) {
- return RQHomePageCarType_ZGZ_WXP;
- } else if ([carTypeName isEqualToString:@"5"]) {
- return RQHomePageCarType_ZGZ_CZC;
- } else if ([carTypeName isEqualToString:@"6"]) {
- return RQHomePageCarType_ZGZ_WYC;
- } else {
- return RQHomePageCarType_Car;
- }
- }
- - (NSString *)getCarTypeCNNameWithCarType:(RQHomePageCarType)carType {
- switch (carType) {
- case RQHomePageCarType_Car:
- return @"小车";
- case RQHomePageCarType_Truck:
- return @"货车";
- case RQHomePageCarType_Bus:
- return @"客车";
- case RQHomePageCarType_Motorcycle:
- return @"摩托车";
- case RQHomePageCarType_ZGZ_JLY:
- return @"教练员";
- case RQHomePageCarType_ZGZ_HY:
- return @"货运";
- case RQHomePageCarType_ZGZ_WXP:
- return @"危险品";
- case RQHomePageCarType_ZGZ_KY:
- return @"客运";
- case RQHomePageCarType_ZGZ_CZC:
- return @"出租车";
- case RQHomePageCarType_ZGZ_WYC:
- return @"网约车";
-
- default:
- return @"小车";
- }
- }
- - (NSString *)getCarTypeCNTiKuUpdateNameWithCarType:(RQHomePageCarType)carType {
- switch (carType) {
- case RQHomePageCarType_Car:
- return @"小车";
- case RQHomePageCarType_Truck:
- return @"货车";
- case RQHomePageCarType_Bus:
- return @"客车";
- case RQHomePageCarType_Motorcycle:
- return @"摩托车";
- case RQHomePageCarType_ZGZ_JLY:
- return @"教练员资格证";
- case RQHomePageCarType_ZGZ_HY:
- return @"货运资格证";
- case RQHomePageCarType_ZGZ_WXP:
- return @"危险品资格证";
- case RQHomePageCarType_ZGZ_KY:
- return @"客运资格证";
- case RQHomePageCarType_ZGZ_CZC:
- return @"出租车资格证";
- case RQHomePageCarType_ZGZ_WYC:
- return @"网约车资格证";
-
- default:
- return @"小车";
- }
- }
- - (NSString *)getCarTypeExamNameWithCarType:(RQHomePageCarType)carType {
- switch (carType) {
- case RQHomePageCarType_Car:
- return @"小车C1/C2/C3";
- case RQHomePageCarType_Bus:
- return @"客车A1/A3/B1";
- case RQHomePageCarType_Truck:
- return @"货车A2/B2";
- case RQHomePageCarType_Motorcycle:
- return @"摩托车D/E/F";
- case RQHomePageCarType_ZGZ_JLY:
- return @"教练员";
- case RQHomePageCarType_ZGZ_KY:
- return @"客运";
- case RQHomePageCarType_ZGZ_HY:
- return @"货运";
- case RQHomePageCarType_ZGZ_WXP:
- return @"危险品";
- case RQHomePageCarType_ZGZ_CZC:
- return @"出租车";
- case RQHomePageCarType_ZGZ_WYC:
- return @"网约车";
-
- default:
- return @"小车";
- }
- }
- - (NSString *)getCar_TypeNameWithCarType:(RQHomePageCarType)carType {
- switch (carType) {
- case RQHomePageCarType_Car:
- return @"C1";
- case RQHomePageCarType_Truck:
- return @"A2";
- case RQHomePageCarType_Bus:
- return @"A1";
- case RQHomePageCarType_Motorcycle:
- return @"D";
- case RQHomePageCarType_ZGZ_JLY:
- return @"4";
- case RQHomePageCarType_ZGZ_HY:
- return @"2";
- case RQHomePageCarType_ZGZ_WXP:
- return @"3";
- case RQHomePageCarType_ZGZ_KY:
- return @"1";
- case RQHomePageCarType_ZGZ_CZC:
- return @"5";
- case RQHomePageCarType_ZGZ_WYC:
- return @"6";
-
- default:
- return @"C1";
- }
- }
- - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType questionIds:(NSString*)questionIds {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType questionIds:questionIds];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- }
- return @[];
- }
- - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType code:(NSInteger)code {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType code:code];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- }
- return @[];
- }
- - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
- }
- }
- - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- }
- }
- - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType isNeedMediaData:(BOOL)isNeedMediaData {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
- }
- }
- - (NSInteger)getQuestionNumWithWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionNumWithExerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getQuestionNumWithExerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getQuestionNumWithExerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionNumWithExerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionNumWithExerciseType:exerciseType];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionNumWithExerciseType:exerciseType];
- default:
- return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
- }
- }
- - (NSArray *)getChapterArr {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getChapter];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getChapter];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getChapter];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getChapter];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getChapter];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getChapter];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getChapter];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getChapter];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getChapter];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getChapter];
- default:
- return [RQ_YDT_XC_Question_Module getChapter];
- }
- }
- - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getChapterQuestionWithChapterName:chapterName];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getChapterQuestionWithChapterName:chapterName];
- default:
- return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
- }
- }
- - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName exerciseType:(RQExerciseType)exerciseType {
- return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName exerciseType:exerciseType];
- }
- - (NSArray *)getPoint {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getPoint];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getPoint];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getPoint];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getPoint];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getPoint];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getPoint];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getPoint];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getPoint];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getPoint];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getPoint];
- default:
- return [RQ_YDT_XC_Question_Module getPoint];
- }
- }
- - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getPointQuestionWithPointId:pointId];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getPointQuestionWithPointId:pointId];
- default:
- return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
- }
- }
- - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId exerciseType:(RQExerciseType)exerciseType {
- return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId exerciseType:exerciseType];
- }
- - (BOOL)isNewRuleQuestionWithQuestionId:(NSInteger)questionId {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- default:
- return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
- }
- }
- - (NSData *)getMediaDataWithMediaName:(NSString *)mediaName {
- switch (self.carType) {
- case RQHomePageCarType_Car:
- return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_Truck:
- return [RQ_YDT_HC_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_Bus:
- return [RQ_YDT_KC_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_Motorcycle:
- return [RQ_YDT_MTC_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_ZGZ_JLY:
- return [RQ_YDT_ZGZ_JLY_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_ZGZ_KY:
- return [RQ_YDT_ZGZ_KY_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_ZGZ_HY:
- return [RQ_YDT_ZGZ_HY_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_ZGZ_WXP:
- return [RQ_YDT_ZGZ_WXP_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_ZGZ_CZC:
- return [RQ_YDT_ZGZ_CZC_Question_Module getMediaDataWithMediaName:mediaName];
- case RQHomePageCarType_ZGZ_WYC:
- return [RQ_YDT_ZGZ_WYC_Question_Module getMediaDataWithMediaName:mediaName];
- default:
- return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
- }
- }
- /// 做到哪一题
- - (NSInteger)getHistoryQuestionNum {
- 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"];
- if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
- 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];
- }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
- 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];
- }
- id object = [RQ_COMMON_MANAGER getObjectWithKey:key];
- if (RQObjectIsNil(object)) {
- return 0;
- } else {
- NSInteger historyQuestionNum = [object integerValue];
- return historyQuestionNum;
- }
- }
- - (void)saveHistoryQuestionNumWithQuestionId:(NSInteger)questionId {
- if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Error_Special_List){//易错题不记录
- return;
- }
- 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"];
- if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
- 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];
- }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
- 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];
- }
- [RQ_SHARE_FUNCTION saveObjectWithObject:@(questionId) ForKey:key];
- }
- - (NSString *)isWelcomed {
- id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isWelcomed"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *isWelcomed = (NSString *)object;
- return isWelcomed;
- }
- }
- - (void)setIsWelcomed:(NSString *)isWelcomed {
- [RQ_SHARE_FUNCTION saveObjectWithObject:isWelcomed ForKey:@"isWelcomed"];
- }
- - (NSString *)car_type {
- return [self getCar_TypeNameWithCarType:self.carType];
- }
- - (NSString *)userSubj1Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj1Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *userSubj1Index = (NSString *)object;
- return userSubj1Index;
- }
- }
- - (void)setUserSubj1Index:(NSString *)userSubj1Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:userSubj1Index ForKey:@"userSubj1Index"];
- }
- - (NSString *)userSubj4Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj4Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *userSubj4Index = (NSString *)object;
- return userSubj4Index;
- }
- }
- - (void)setUserSubj4Index:(NSString *)userSubj4Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:userSubj4Index ForKey:@"userSubj4Index"];
- }
- - (NSString *)user1Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user1Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *user1Index = (NSString *)object;
- return user1Index;
- }
- }
- - (void)setUser1Index:(NSString *)user1Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:user1Index ForKey:@"user1Index"];
- }
- - (NSString *)user4Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user4Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *user4Index = (NSString *)object;
- return user4Index;
- }
- }
- - (void)setUser4Index:(NSString *)user4Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:user4Index ForKey:@"user4Index"];
- }
- - (NSString *)A2Subj1Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj1Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *A2Subj1Index = (NSString *)object;
- return A2Subj1Index;
- }
- }
- - (void)setA2Subj1Index:(NSString *)A2Subj1Index{
- [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj1Index ForKey:@"A2Subj1Index"];
- }
- - (NSString *)A2Subj4Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj4Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *A2Subj4Index = (NSString *)object;
- return A2Subj4Index;
- }
- }
- - (void)setA2Subj4Index:(NSString *)A2Subj4Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj4Index ForKey:@"A2Subj4Index"];
- }
- - (NSString *)A1Subj1Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj1Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *A1Subj1Index = (NSString *)object;
- return A1Subj1Index;
- }
- }
- - (void)setA1Subj1Index:(NSString *)A1Subj1Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj1Index ForKey:@"A1Subj1Index"];
- }
- - (NSString *)A1Subj4Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj4Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *A1Subj4Index = (NSString *)object;
- return A1Subj4Index;
- }
- }
- - (void)setA1Subj4Index:(NSString *)A1Subj4Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj4Index ForKey:@"A1Subj4Index"];
- }
- - (NSString *)DSubj1Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj1Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *DSubj1Index = (NSString *)object;
- return DSubj1Index;
- }
- }
- - (void)setDSubj1Index:(NSString *)DSubj1Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:DSubj1Index ForKey:@"DSubj1Index"];
- }
- - (NSString *)DSubj4Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj4Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *DSubj4Index = (NSString *)object;
- return DSubj4Index;
- }
- }
- - (void)setDSubj4Index:(NSString *)DSubj4Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:DSubj4Index ForKey:@"DSubj4Index"];
- }
- - (NSString *)coachIndex {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"coachIndex"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *coachIndex = (NSString *)object;
- return coachIndex;
- }
- }
- - (void)setCoachIndex:(NSString *)coachIndex {
- [RQ_COMMON_MANAGER saveObjectWithObject:coachIndex ForKey:@"coachIndex"];
- }
- - (NSString *)A1Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *A1Index = (NSString *)object;
- return A1Index;
- }
- }
- - (void)setA1Index:(NSString *)A1Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:A1Index ForKey:@"A1Index"];
- }
- - (NSString *)A2Index {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Index"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *A2Index = (NSString *)object;
- return A2Index;
- }
- }
- - (void)setA2Index:(NSString *)A2Index {
- [RQ_COMMON_MANAGER saveObjectWithObject:A2Index ForKey:@"A2Index"];
- }
- - (NSString *)dangerIndex {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"dangerIndex"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *dangerIndex = (NSString *)object;
- return dangerIndex;
- }
- }
- - (void)setDangerIndex:(NSString *)dangerIndex {
- [RQ_COMMON_MANAGER saveObjectWithObject:dangerIndex ForKey:@"dangerIndex"];
- }
- - (NSString *)texiIndex {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"texiIndex"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *texiIndex = (NSString *)object;
- return texiIndex;
- }
- }
- - (void)setTexiIndex:(NSString *)texiIndex {
- [RQ_COMMON_MANAGER saveObjectWithObject:texiIndex ForKey:@"texiIndex"];
- }
- - (NSString *)wycIndex {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"wycIndex"];
- if (RQObjectIsNil(object)) {
- return @"";
- } else {
- NSString *wycIndex = (NSString *)object;
- return wycIndex;
- }
- }
- - (void)setWycIndex:(NSString *)wycIndex {
- [RQ_COMMON_MANAGER saveObjectWithObject:wycIndex ForKey:@"wycIndex"];
- }
- - (NSString *)isZhiGeZheng {
- id object = [RQ_COMMON_MANAGER getObjectWithKey:@"isZhiGeZheng"];
- if (RQObjectIsNil(object)) {
- return @"NO";
- } else {
- NSString *isZhiGeZheng = (NSString *)object;
- return isZhiGeZheng;
- }
- }
- - (void)setIsZhiGeZheng:(NSString *)isZhiGeZheng {
- [RQ_COMMON_MANAGER saveObjectWithObject:isZhiGeZheng ForKey:@"isZhiGeZheng"];
- }
- #pragma mark - PrivateMethods
- - (NSString *)getCarTypeNameWithCarType:(RQHomePageCarType)carType {
- switch (carType) {
- case RQHomePageCarType_Car:
- return @"xc";
- case RQHomePageCarType_Bus:
- return @"kc";
- case RQHomePageCarType_Truck:
- return @"hc";
- case RQHomePageCarType_Motorcycle:
- return @"mtc";
- case RQHomePageCarType_ZGZ_JLY:
- return @"zgzjl";
- case RQHomePageCarType_ZGZ_KY:
- return @"zgzky";
- case RQHomePageCarType_ZGZ_HY:
- return @"zgzhy";
- case RQHomePageCarType_ZGZ_WXP:
- return @"zgzwxp";
- case RQHomePageCarType_ZGZ_CZC:
- return @"zgzcz";
- case RQHomePageCarType_ZGZ_WYC:
- return @"zgzwyc";
-
- default:
- return @"xc";
- }
- }
- - (void)rq_showDBUpdateView {
- @weakify(self)
- dispatch_async(dispatch_get_main_queue(), ^{
- @strongify(self)
- RQUpdateView *dbUpdateView = [RQUpdateView updateView];
- dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_LibDownload;
- dbUpdateView.downloadUrl = self.downloadUrl;
-
- QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
- dbModalViewController.contentView = dbUpdateView;
- dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
- dbModalViewController.modal = YES;
-
- dbUpdateView.modalViewController = dbModalViewController;
- [dbModalViewController showWithAnimated:YES completion:nil];
-
- });
- }
- - (void)rq_showJSUpdateView {
- @weakify(self)
- dispatch_async(dispatch_get_main_queue(), ^{
- @strongify(self)
- RQUpdateView *dbUpdateView = [RQUpdateView updateView];
- dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
- dbUpdateView.jsDownloadUrl = self.jsDownloadUrl;
-
- QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
- dbModalViewController.contentView = dbUpdateView;
- dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
- dbModalViewController.modal = YES;
-
- dbUpdateView.modalViewController = dbModalViewController;
- [dbModalViewController showWithAnimated:YES completion:nil];
-
- });
- }
- - (void)rq_showJQUpdateView {
- @weakify(self)
- dispatch_async(dispatch_get_main_queue(), ^{
- @strongify(self)
- RQUpdateView *dbUpdateView = [RQUpdateView updateView];
- dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
- dbUpdateView.jsDownloadUrl = self.jqDownloadUrl;
- QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
- dbModalViewController.contentView = dbUpdateView;
- dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
- dbModalViewController.modal = YES;
-
- dbUpdateView.modalViewController = dbModalViewController;
- [dbModalViewController showWithAnimated:YES completion:nil];
- });
- }
- @end
|