更换说明书
This commit is contained in:
+149
-5
@@ -7,9 +7,51 @@
|
||||
//
|
||||
|
||||
#import "InfoByImageViewController.h"
|
||||
@interface InstructionCell : UITableViewCell
|
||||
@property (nonatomic, strong) NSDictionary *model;
|
||||
@property (nonatomic, strong) UIImageView *icon;
|
||||
@end
|
||||
|
||||
@interface InfoByImageViewController ()
|
||||
@implementation InstructionCell
|
||||
|
||||
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self)
|
||||
{
|
||||
UIImageView*imageView=[[UIImageView alloc]initWithFrame:CGRectZero];
|
||||
[self.contentView addSubview:imageView];
|
||||
imageView.contentMode=UIViewContentModeScaleToFill;
|
||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(0);
|
||||
make.top.mas_equalTo(0);
|
||||
make.bottom.mas_equalTo(0);
|
||||
make.right.mas_equalTo(0); }];
|
||||
self.icon=imageView;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setModel:(NSDictionary *)model
|
||||
{
|
||||
_model=model;
|
||||
UIImage*image=[UIImage imageNamed:model[@"image"]];
|
||||
if (image)
|
||||
{
|
||||
self.icon.image=image;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.icon.image=nil;
|
||||
}
|
||||
}
|
||||
@end
|
||||
@interface InfoByImageViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic, strong) UITableView *tableView;
|
||||
@property (nonatomic, strong) NSArray *dataArray;
|
||||
@property (nonatomic, assign) CGFloat rowHeight;
|
||||
@end
|
||||
|
||||
@implementation InfoByImageViewController
|
||||
@@ -116,6 +158,28 @@
|
||||
}
|
||||
else if ([self.type isEqualToString:@"instruction"])//详细说明书
|
||||
{
|
||||
// [self getTableData];
|
||||
// [self creatTab];
|
||||
// return;
|
||||
NSInteger count =9;
|
||||
CGFloat itemHeight=imageHeight/count;
|
||||
for (int i=0; i<count; i++)
|
||||
{
|
||||
UIButton*camera=[UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[self.imageView addSubview:camera];
|
||||
[camera mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
||||
make.left.mas_equalTo(0);
|
||||
make.top.mas_equalTo(i*itemHeight);
|
||||
make.height.mas_equalTo(itemHeight);
|
||||
make.right.mas_equalTo(0);
|
||||
|
||||
}];
|
||||
camera.tag=i+1;
|
||||
camera.backgroundColor=[UIColor clearColor];
|
||||
[camera addTarget:self action:@selector(instruction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return;
|
||||
UIButton*camera=[UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[self.imageView addSubview:camera];
|
||||
[camera mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -222,6 +286,47 @@
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)getTableData{
|
||||
NSArray*array=@[@{@"image":@"roleCa",@"title":@"常见失败原因",@"instructionImage":@"failreason"}];
|
||||
self.dataArray=array;
|
||||
}
|
||||
-(void)creatTab{
|
||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
|
||||
if (self.tableView==nil) {
|
||||
|
||||
UITableView*table=[[UITableView alloc]initWithFrame:CGRectMake(0,0, kScreenSize.width, kScreenSize.height) style:UITableViewStylePlain];
|
||||
|
||||
table.dataSource=self;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
table.sectionHeaderTopPadding=0;
|
||||
}
|
||||
|
||||
table.delegate=self;
|
||||
table.separatorStyle=UITableViewCellSeparatorStyleNone;
|
||||
|
||||
self.tableView=table;
|
||||
|
||||
self.tableView.showsVerticalScrollIndicator=NO;
|
||||
|
||||
self.tableView.backgroundColor = TABLE_HEADER_COLOR;
|
||||
|
||||
[self.view addSubview:self.tableView];
|
||||
|
||||
|
||||
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
|
||||
|
||||
[self.tableView setSeparatorInset:UIEdgeInsetsMake(0,50, 0,0)];
|
||||
|
||||
[self.tableView setSeparatorColor:TABLE_SEPRETLINE_COLOR];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)instruction:(UIButton*)button
|
||||
{
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
@@ -237,25 +342,33 @@
|
||||
info.image=[UIImage imageNamed:@"cameraInfo"];
|
||||
}
|
||||
else if (button.tag==3) {
|
||||
info.title=@"摇头摄像机";
|
||||
info.image=[UIImage imageNamed:@"摇头机说明书"];
|
||||
}
|
||||
else if (button.tag==4) {
|
||||
info.title=@"绚多SW7";
|
||||
info.image=[UIImage imageNamed:@"SW7"];
|
||||
}
|
||||
else if (button.tag==4) {
|
||||
else if (button.tag==5) {
|
||||
info.title=@"绚多SW10";
|
||||
info.image=[UIImage imageNamed:@"SW10"];
|
||||
}
|
||||
else if (button.tag==5) {
|
||||
else if (button.tag==6) {
|
||||
info.title=@"绚多CW2";
|
||||
info.image=[UIImage imageNamed:@"CW2"];
|
||||
}
|
||||
else if (button.tag==6) {
|
||||
else if (button.tag==7) {
|
||||
info.title=@"绚多SW1/SW6/W6";
|
||||
info.image=[UIImage imageNamed:@"sw1"];
|
||||
}
|
||||
else if (button.tag==7) {
|
||||
else if (button.tag==8) {
|
||||
info.title=@"睿芯HX-WY01";
|
||||
info.image=[UIImage imageNamed:@"HX-WY01"];
|
||||
}
|
||||
else if (button.tag==9) {
|
||||
info.title=@"松诺";
|
||||
info.image=[UIImage imageNamed:@"songnuo"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -287,6 +400,37 @@
|
||||
}
|
||||
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return 124;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSString*identiy=@"InstructionCell";
|
||||
InstructionCell*cell=[tableView dequeueReusableCellWithIdentifier:identiy];
|
||||
if (!cell)
|
||||
{
|
||||
cell=[[InstructionCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identiy];
|
||||
}
|
||||
[cell setModel:self.dataArray[indexPath.row]];
|
||||
return cell;
|
||||
}
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
InfoByImageViewController*info=[[InfoByImageViewController alloc]init];
|
||||
NSDictionary*model=self.dataArray[indexPath.row];
|
||||
info.title=model[@"title"];
|
||||
info.image=[UIImage imageNamed:model[@"instructionImage"]];
|
||||
[self.navigationController pushViewController:info animated:YES];
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
// CFShow((__bridge CFTypeRef)(infoDic));
|
||||
NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"];
|
||||
NSLog(@"app_Version%@",app_Version);
|
||||
app_Version=@"4.7.18";
|
||||
app_Version=@"4.7.19";
|
||||
NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version];
|
||||
NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"];
|
||||
if (buildVersion.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user