123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- //
- // GuideVC.m
- // jiaPei
- //
- // Created by apple on 15/11/20.
- // Copyright (c) 2015年 JCZ. All rights reserved.
- //
- #import "GuideVC.h"
- #import "AdvertisingColumn.h"
- #import "STButton.h"
- #import "GDButton.h"
- #import "TRDetailVC.h"
- #import "PicSymbol.h"
- #import "GuideHtmlVC.h"
- #define redTint [UIColor colorWithRed:255/255.0 green:100/255.0 blue:20/255.0 alpha:1]
- @interface GuideVC ()
- {
- UIScrollView* scroll;
- }
- @end
- @implementation GuideVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self myInit];
-
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- #pragma mark -
- -(void)myInit
- {
- scroll = [[UIScrollView alloc] initWithFrame:kFrame];
- scroll.height -= kNavOffSet + kSafeAreaBottomHeight;
- [scroll setContentSize:SGSizeMake(0, 550)];
- [self.view addSubview:scroll];
- [self.view setBackgroundColor:[UIColor whiteColor]];
- [self configNavigationBar];
- [self setTitle:@"学车指南"];
-
- CGFloat bd = 10;
- AdvertisingColumn *adView = [[AdvertisingColumn alloc]initWithFrame:CGRectMake(0, 0, kSize.width, kSize.width*9/32.0)];
- //广告
- NSMutableArray *newAD = [NSMutableArray array];
- for (NSDictionary *dic in myDelegate.adArray) {
-
- if ([dic[@"LOCATION"] isEqualToString:@"2"]) {
- [newAD addObject:dic];
- }
- }
- [adView setImgArray:newAD];
- adView.supVC = self;
- [scroll addSubview:adView];
-
- STButton* btn;
- CGFloat btnH ,btnW;
- CGFloat labH;
- NSInteger tag =0;
- CGFloat currentTop;
- UIView* vi;
- UILabel* label;
- NSArray* titles;
- NSArray* subTitles;
- NSArray* images;
- /**因为不需要修改btn,所以不用保存起来
- 其实可以用{}把每个section给包括起来的。
- */
-
- //SECTION
- {
- currentTop = kSize.width*9/32.0;
- labH = 30;
- label = [[UILabel alloc] initWithFrame:CGRectMake(bd*2, currentTop, kSize.width, labH)];
- [label setText:@"考前准备"];
- [scroll addSubview:label];
- [label addViewWithRect:CGRectMake(0, currentTop + labH, kSize.width, 1)];
-
- CGFloat lee = [label sizeThatFits:CGSizeMake(kSize.width, MAXFLOAT)].height;
- vi = [[UIView alloc] initWithFrame:CGRectMake(bd, currentTop+(labH-lee)/2, 3, lee)];
- [vi setBackgroundColor:defGreen];
- [scroll addSubview:vi];
-
- titles = @[@"图标",@"法规"];//@"须知",
- subTitles = @[@"交通标志大全",@"交通法律法规"];//@"报名须知事项",
- images = @[@"subject2_standart_icon.png",@"subject3_secret_guide_icon.png"];//@"subject3_exam_onload_icon.png",
- btnW = kSize.width / titles.count;
- btnH = btnW*.7;
- currentTop += labH;
- tag += 1;//@"须知"
- for (int i =0; i<titles.count; i++)
- {
- btn = [[STButton alloc] initWithFrame:CGRectMake(btnW*i, currentTop, btnW, btnH)];
- [btn setImage:[UIImage imageNamed:images[i]] withTitle:titles[i] Font:13 forState:UIControlStateNormal];
- [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
- [btn setTitleColor:contentTextColor forState:UIControlStateNormal];
- [btn setSubTitle:subTitles[i]];
- [scroll addSubview:btn];
- [btn setTag:tag++];
- [btn addViewWithRect:CGRectMake(btnW*i-1, currentTop, 1, btnH)];
- }
-
- }
-
- // //SECTION
- // {
- // currentTop += btnH + bd;
- // label = [[UILabel alloc] initWithFrame:CGRectMake(bd*2, currentTop, kSize.width, labH)];
- // [label setText:@"学车技巧"];
- // [scroll addSubview:label];
- // [label addViewWithRect:CGRectMake(0, currentTop-bd, kSize.width, bd) Color:KlineColor];
- // [label addViewWithRect:CGRectMake(0, currentTop + labH, kSize.width, 1)];
- //
- // CGFloat lee = [label sizeThatFits:CGSizeMake(kSize.width, MAXFLOAT)].height;
- // vi = [[UIView alloc] initWithFrame:CGRectMake(bd, currentTop+(labH-lee)/2, 3, lee)];
- // [vi setBackgroundColor:[UIColor redColor]];
- // [scroll addSubview:vi];
- //
- // images = @[@"guide_icon1.png",@"guide_icon2.png",@"guide_icon3.png",@"guide_icon4.png"];
- // titles = @[@"科目一",@"科目二",@"科目三",@"科目四"];
- // subTitles = @[@"备战理论考试",@"科目二小路考",@"科目三大路考",@"备考安全文明"];
- // btnW = kSize.width/2;
- // btnH = btnW*.3;
- // currentTop += labH;
- // for (int i =0; i< 4; i++)
- // {
- // GDButton* btn = [[GDButton alloc] initWithFrame:CGRectMake(btnW*(i%2), currentTop + btnH*(int)(i/2), btnW-2, btnH-2)];
- // [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
- // [btn setDetailText:subTitles[i]];
- // [btn setImage:[UIImage imageNamed:images[i]] withTitle:titles[i] Font:NormalFont forState:UIControlStateNormal];
- // [btn setDetailText:subTitles[i]];
- // [scroll addSubview:btn];
- // [btn setTag:tag++];
- // }
- // [btn addViewWithRect:CGRectMake(btnW, currentTop, 1, btnH*2)];
- // [btn addViewWithRect:CGRectMake(0, currentTop + btnH, kSize.width, 1)];
- // }
- tag += 4;
-
- //SECTION
- {
- images = @[@"guide_icon5.png",@"guide_icon6.png",@"guide_icon7.png",@"guide_icon8.png"];
- currentTop += btnH + bd;
- label = [[UILabel alloc] initWithFrame:CGRectMake(bd*2, currentTop, kSize.width, labH)];
- [label setText:@"新手上路"];
- [scroll addSubview:label];
- [label addViewWithRect:CGRectMake(0, currentTop-bd, kSize.width, bd) Color:KlineColor];
- [label addViewWithRect:CGRectMake(0, currentTop + labH, kSize.width, 1)];
-
- CGFloat lee = [label sizeThatFits:CGSizeMake(kSize.width, MAXFLOAT)].height;
- vi = [[UIView alloc] initWithFrame:CGRectMake(bd, currentTop+(labH-lee)/2, 3, lee)];
- [vi setBackgroundColor:[UIColor blueColor]];
- [scroll addSubview:vi];
-
- titles = @[@"指南",@"新手",@"处理",@"易错"];
- subTitles = @[@"驾照使用指南",@"新手上路指导",@"故障和事故处理",@"新手易犯错误"];
- btnW = kSize.width/2;
- btnH = btnW*.3;
- currentTop += labH;
- for (int i =0; i< 4; i++)
- {
- GDButton* btn = [[GDButton alloc] initWithFrame:CGRectMake(btnW*(i%2), currentTop + btnH*(int)(i/2), btnW-2, btnH-2)];
- [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
- [btn setImage:[UIImage imageNamed:images[i]] withTitle:titles[i] Font:NormalFont forState:UIControlStateNormal];
- [scroll addSubview:btn];
- [btn setDetailText:subTitles[i]];
- [btn setTag:tag++];
- }
- [btn addViewWithRect:CGRectMake(btnW, currentTop, 1, btnH*2)];
- [btn addViewWithRect:CGRectMake(0, currentTop + btnH, kSize.width, 1)];
- }
-
- //SECTION
- {
- images = @[@"guide_icon10.png",@"guide_icon11.png",@"guide_icon12.png",@"guide_icon13.png"];//@"guide_icon9.png",
- currentTop += btnH*2 + bd;
-
- label = [[UILabel alloc] initWithFrame:CGRectMake(bd*2, currentTop, kSize.width, labH)];
- [label setText:@"资格证技巧"];
- [scroll addSubview:label];
- [label addViewWithRect:CGRectMake(0, currentTop-bd, kSize.width, bd) Color:KlineColor];
- [label addViewWithRect:CGRectMake(0, currentTop + labH, kSize.width, .5)];
-
- CGFloat lee = [label sizeThatFits:CGSizeMake(kSize.width, MAXFLOAT)].height;
- vi = [[UIView alloc] initWithFrame:CGRectMake(bd, currentTop+(labH-lee)/2, 3, lee)];
- [vi setBackgroundColor:[UIColor redColor]];
- [scroll addSubview:vi];
-
- titles = @[@"货运",@"客运",@"危险品",@"出租车"];//@"教练员",
- subTitles = @[@"货物顺利送达",@"安全旅行服务",@"确保安全",@"全心服务乘客"];//@"培养合格驾驶员",
- btnW = kSize.width/2;
- btnH = btnW*.3;
- currentTop += labH;
- tag += 1;
- for (int i =0; i< titles.count; i++)
- {
- GDButton* btn = [[GDButton alloc] initWithFrame:CGRectMake(btnW*(i%2), currentTop + btnH*(int)(i/2), btnW-2, btnH-2)];
- [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
- [btn setImage:[UIImage imageNamed:images[i]] withTitle:titles[i] Font:NormalFont forState:UIControlStateNormal];
- [scroll addSubview:btn];
- [btn setDetailText:subTitles[i]];
- [btn setTag:tag++];
- }
- [btn addViewWithRect:CGRectMake(btnW, currentTop, 1, btnH*2)];
- [btn addViewWithRect:CGRectMake(0, currentTop + btnH, kSize.width, 1)];
- [btn addViewWithRect:CGRectMake(0, currentTop + btnH*2, kSize.width, 1)];
- // [btn addViewWithRect:CGRectMake(0, currentTop + btnH*3, kSize.width, 1)];
- }
-
- vi = [scroll.subviews lastObject];
-
- [scroll setContentSize:CGSizeMake(0, CGRectGetMaxY(vi.frame)+60)];
- }
- -(void)btnClick:(UIButton*)sender
- {
- int tag = (int)sender.tag;
- //NSLog(@"btn%d click",(int)sender.tag);
-
- if (1 == tag) {
-
- PicSymbol *symbol = [[PicSymbol alloc] init];
- [self navPushHideTabbarToVC:symbol];
- return;
- }
-
- //从服务器获取
- if (tag > 2 ) {
- GuideHtmlVC *htmlVC = [[GuideHtmlVC alloc] init];
- htmlVC.searchID = [NSString stringWithFormat:@"%d",tag + 6];
- [htmlVC setTitle:sender.titleLabel.text];
- [self navPushHideTabbarToVC:htmlVC];
- return;
- }
-
-
- //从本地获取
- TRListVC* vc = [TRListVC new];
- NSArray* arr;
- if (0 == tag) {
- arr = @[@"2015最新版学车择校指南(新手必看)",
- @"选择驾校的七个关键词",
- @"(2015版)学车流程:学车体检考试相关规定",
- @"学车指南 - 学车体检项目流程和须知",
- @"考驾照有四关,学交规是关键",
- @"机动车驾驶员申领、办理、增驾、换证指南",
- @"学车指南 - 色盲色弱如何考驾照?"];
-
- [vc setTitle:@"须知"];
- }
- if (2 == tag) {
-
- arr = @[@"2016《机动车驾驶证申领和使用规定》",
- @"中华人民共和国道路交通安全法",
- @"道路交通安全违法行为处理程序规定",
- @"道路交通事故处理程序规定",
- @"酒驾新规"];
-
- [vc setTitle:@"交通法规"];
- }
- //下面的弃用 先放着吧 不是很影响
- if (3 == tag) {
- arr = @[@"科目一考试技巧记忆口诀",
- @"科目一考试应试必备技巧",
- @"科目一到科目四,超牛的驾考经验技巧,科科必过!",
- @"理论考试知识汇总",
- @"【科目一】交规巧记十三条!",
- @"3分钟,快速掌握考试车内提示灯如何操作",
- @"日期类题目最头痛,来看看我们总结的快速学习方法!",
- @"帮您快速巧记交规秘诀,看完想不过都难!",
- @"交规理论考试十大“给力”攻略"];
-
- [vc setTitle:@"科目一"];
- }
- if (4 == tag) {
- arr = @[@"科目二小错误千万别大意",
- @"科目二到底考什么?全部都在这",
- @"科目二考试不过的原因大解析",
- @"侧方停车只是倒车速度慢一点,为什么判不过?",
- @"考官说扣分:“驾考科目二场考五项讲解全攻略”",
- @"科目二考试技巧口诀,小伙伴要记牢哦",
- @"科目二考试详细流程",
- @"科目二之直角拐弯",
- @"科目二考场温馨提示要点图",
- @"侧方停车技巧,超详细!",
- @"四张图让你秒变倒车界的独孤求败!",
- @"倒车入库再也不发愁,蜀黍教你各种倒车技巧!",
- @"科目二五项过关神技巧,超级详细!",
- @"因为这些挂掉,冤枉死!",
- @"科目二坡道,这些不良动作是你考试不过关的根源!",
- @"倒车入位用这三招,想怎么钻就怎么钻!",
- @"科目二失分点都在这,想过来看!",
- @"倒车入库究竟有多难?",
- @"学车入门级知识问题",
- @"科二全程解剖,让“菜鸟级”的你轻松通过考试",
- @"直角转弯操作技巧,一看秒懂",
- @"六张图,教会你“侧方停车”神技能",
- @"全程考试技巧汇总",
- @"坡道定点停车技巧(图解)",
- @"坡道定点找三十公分线的技巧方法",
- @"考驾照14条关键经验,学员含泪总结",
- @"科目二考前准备",
- @"科目二合格标准",
- @"科目二必过考试经验分享",
- @"坡道起步怎么预防倒溜和熄火?",
- @"科目二全程“难点”独家解析!",
- @"科二最难的:倒车入口+坡道起步独家秘笈",
- @"你必须注意的科目二考试须知!"];
-
- [vc setTitle:@"科目二"];
- }
- if (5 == tag) {
- arr = @[@"科目三考试评判标准,提前了解不失分",
- @"科目三原来是这样丢分的",
- @"三招提高科目三考试成功率",
- @"科目三考试详细流程",
- @"科三再升级“人考”改“机考”车内多名安全员",
- @"科目三--加减档位操作",
- @"夜考,用这几招轻轻松松过",
- @"科目三大路考之靠边停车小技巧",
- @"科目三:模拟夜间行驶场景灯光使用技巧",
- @"超详细科目三考试口令速记口诀!",
- @"控制科目三方向的几个生死关键点",
- @"2015年科目三考试新规则和扣分标准",
- @"科目三:路考超车须知",
- @"科目三:电子路考需要注意什么",
- @"科目三:老手教你靠边停车技术",
- @"科目三:路考变更车道须知",
- @"科目三:路考通过人行横道线须知",
- @"科目三:路考中14项细节必需注意",
- @"考试指南 - 科目三路考评判标准",
- @"考试指南 - 科目三路考秘诀",
- @"考试指南 - 科目三必过的考场经验分享",
- @"考试指南 - 科目三抽到夜间考试怎么办?",
- @"考试指南 - 夜考灯光使用攻略,看完就过了!",
- @"考试指南 - 科目三路考会车攻略"];
-
- [vc setTitle:@"科目三"];
- }
- if (6 == tag) {
- arr = @[@"科目四考试须知与技巧",
- @"科目三都过了,还怕败在科目四?",
- @"科目四有几次补考机会?",
- @"科目四考什么?",
- @"考试指南 - 最全的科目四考试技巧口诀"];
-
- [vc setTitle:@"科目四"];
- }
-
- if (7 == tag) {
- arr = @[@"驾考路上26条倾心经验,每条都是真理!",
- @"什么是科目一?科目二?科目三?科目四?全都在这",
- @"科目一别尽顾着做题,直接看这里就够啦!",
- @"学车八计:学会你就是考神",
- @"我敢说,这些交通标志,你肯定分不清楚!",
- @"10年资深教练员的各科目必过经验",
- @"想要顺利通过驾考,请牢记这些!",
- @"如何调后视镜减少盲区最安全?",
- @"非常实用转弯技巧,从此不再紧张!",
- @"顺利拿驾照,须做这5点",
- @"记住这个,再也不怕被扣分了!",
- @"12条在驾校绝对学不到的驾驶技巧,看完胜开十年车!",
- @"美女教练员亲自上阵为大家奉上起步不熄火的绝招!",
- @"考官总结驾考中最易失误的几大问题",
- @"你能开什么车?驾驶证对应准驾车型一览!",
- @"支招女学员愉快轻松学车指南",
- @"驾照使用指南 - 驾照年审、年检",
- @"驾照使用指南 - 驾照换证流程",
- @"驾照使用指南 - 驾照遗失怎么办?",
- @"驾照使用指南 - 驾照如何挂失"];
-
- [vc setTitle:@"指南"];
- }
- if (8 == tag) {
- arr = @[@"十大技巧让新手不挨欺,这样的换挡最有效率。",
- @"新手上路指导 - 驾校不教的知识 车上奇怪的“故障”",
- @"“右侧超车”,你,真的了解么?",
- @"学会这些驾驶经验,你也可以风骚开路",
- @"这些招数都学会了,开车不再是难题",
- @"新手上路指南 - 特殊天气驾驶技巧",
- @"新手上路指南 - 车辆操作",
- @"夜间行驶必备技巧",
- @"新手上路需知,如何正确安全跟车?",
- @"必备停车技巧——基本停车",
- @"刹车技巧",
- @"驾驶员必须掌握-最危险的五大驾车错觉",
- @"遇大陡坡莫手足无措 新手需掌握7点注意",
- @"慌乱刹车就熄火 新手开车刹车攻略"];
-
- [vc setTitle:@"新手"];
- }
- if (9 == tag) {
- arr = @[@"交通事故的处理流程是怎么样的?你知道么?",
- @"新手上路指导 - 驾校不教的知识 车上奇怪的“故障”",
- @"新手上路指导 - 刹车失灵的五种解决办法",
- @"别给自己找麻烦!易被警察拿下的小物件"];
-
- [vc setTitle:@"处理"];
- }
- if (10 == tag) {
- arr = @[@"告诉你一些“边缘交规” 省得违规了还不知道",
- @"有种绿灯不能闯!绿灯也会罚",
- @"新手易犯的5个错误 改掉坏习惯最重要",
- @"新手上路指导 - 雨中行车注意,发动机进水不要启动车辆",
- @"新手上路指导 -汽车小修不求人"];
-
- [vc setTitle:@"易错"];
- }
- if (11 == tag) {//教练资格证已取消,已被屏蔽
- arr = @[@"教练员实际操作要领考核要求",
- @"教练员资格证考试流程",
- @"教练员上岗前应具备的知识和技能",
- @"教练员“红线”知多少?"];
-
- [vc setTitle:@"教练员"];
- }
- if (12 == tag) {
- arr = @[@"B2大货车倒桩操作指南详解",
- @"大货车坡道定点停车和起步技巧详解",
- @"大货车直角转弯驾驶技巧",
- @"货车驾驶证申请",
- @"货车从业资格管理",
- @"货车从业资格证人员管理规定"];
-
- [vc setTitle:@"货运"];
- }
- if (13 == tag) {
- arr = @[@"客运职业道德与安全行车知识",
- @"客运汽车使用技术",
- @"客运汽车常见故障处理",
- @"客运道路旅客运输知识",
- @"客运道路运输法规",
- @"客运驾驶证"];
-
- [vc setTitle:@"客运"];
- }
- if (14 == tag) {
- arr = @[@"危险化学品常识"];
-
- [vc setTitle:@"危险品"];
- }
- if (15 == tag) {
- arr = @[@"出租车安全运营与治安防范",
- @"出租车职业道德与服务规范",
- @"出租车节能驾驶",
- @"出租车使用与常见故障处理",
- @"出租车运价知识与计价器使用",
- @"出租车道路交通事故处理与应急救护",
- @"出租车汽车政策、法规、标准",
- @"出租车服务质量信誉考核"];
- [vc setTitle:@"出租车"];
- }
-
- [vc setModels:arr];
- [self navPushHideTabbarToVC:vc];
- }
- @end
|