You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

139 lines
4.5 KiB

//
// MarkViewController.m
// tongxin
//
// Created by ecell on 2021/6/10.
// Copyright © 2021 xTT. All rights reserved.
//
#import "MarkViewController.h"
#import "MarkTableViewCell.h"
#import "MyUILabel.h"
#import "User.h"
#import "Device.h"
@interface MarkViewController () <UITableViewDelegate,UITableViewDataSource>
@property (strong, nonatomic) UITableView *myTableView;
@property (strong, nonatomic) NSMutableArray *dataArr;
@end
@implementation MarkViewController
- (void)viewDidLoad {
[super viewDidLoad];
_dataArr = [NSMutableArray new];
if ([cUser.cDevice.modules isEqualToString:@"L3C0V0TH"])
{
NSMutableDictionary *dict1 = [[NSMutableDictionary alloc] initWithObjects:@[@"icon_positioning_g",@"卫星定位",@"支持美国GPS、中国北斗两种卫星定位,室外空旷地,最佳定位精度10米左右,但室内定位效果不佳。"] forKeys:@[@"img",@"title",@"content"]];
[_dataArr addObject:dict1];
}
NSMutableDictionary *dict2 = [[NSMutableDictionary alloc] initWithObjects:@[@"icon_home_wifi",@"Wi-Fi定位",@"设备通过Wi-Fi模块,收集周边的Wi-Fi热点信息,来计算出自身的位置信息,定位的精准度最佳在50米以内。"] forKeys:@[@"img",@"title",@"content"]];
[_dataArr addObject:dict2];
NSMutableDictionary *dict3 = [[NSMutableDictionary alloc] initWithObjects:@[@"icon_base_station",@"模糊定位",@"设备通过电信移动运营商的网络(如GSM网),获取自身的位置信息,定位的精准度一般在500米以内。"] forKeys:@[@"img",@"title",@"content"]];
[_dataArr addObject:dict3];
[self initUI];
}
- (void)initUI{
self.title = @"定位说明";
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-getRectNavAndStatusHight) style:UITableViewStylePlain];
[_myTableView registerNib:[UINib nibWithNibName:@"MarkTableViewCell" bundle:nil] forCellReuseIdentifier:@"MarkTableViewCell"];
_myTableView.backgroundColor = tabViewBG;
_myTableView.delegate = self;
_myTableView.dataSource = self;
_myTableView.bounces = NO; //禁止弹跳
_myTableView.showsHorizontalScrollIndicator = NO;
_myTableView.showsVerticalScrollIndicator = NO;
_myTableView.userInteractionEnabled = NO;
//去线
//UIView *view = [UIView new];
//view.backgroundColor = [UIColor clearColor];
//[_myTableView setTableFooterView:view];
MyUILabel *footer = [[MyUILabel alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 60)];
footer.font =[UIFont systemFontOfSize:14];
footer.adjustsFontSizeToFitWidth = YES;
footer.numberOfLines = 0;
footer.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
[footer setTextColor:[UIColor systemGrayColor]];
[footer setText:@"温馨提示:\n定位过程中,设备会根据当时的环境,智能选择最合适的定位方式,用户无须手动选择定位方式。"];
self.myTableView.tableFooterView = footer;
[self.view addSubview:_myTableView];
}
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear: animated];
[self.myTableView reloadData];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return _dataArr.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if (section == 0) {
return 0.01;
}
return 15 * FIX_SCREEN;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 120;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
NSMutableDictionary *data = self.dataArr[indexPath.row];
MarkTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MarkTableViewCell"];
if (!cell) {
cell = [[MarkTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"MarkTableViewCell"];
}
cell.remarkImg.image = [UIImage imageNamed:data[@"img"]];
cell.remarkType.text = data[@"title"];
cell.remarkContent.text = data[@"content"];
NSLog(@"%@-%@",data[@"title"],data[@"content"]);
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}
- (void) viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
xLog(@"=== MARK viewDidDisappear====")
}
@end