1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042 |
- //
- // 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];
- }
- - (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 {
-
- 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
|