
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
{ |
||||
"images" : [ |
||||
{ |
||||
"idiom" : "universal", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"filename" : "comm_selectBtn_Normal@2x.png", |
||||
"idiom" : "universal", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "universal", |
||||
"scale" : "3x" |
||||
} |
||||
], |
||||
"info" : { |
||||
"author" : "xcode", |
||||
"version" : 1 |
||||
} |
||||
} |
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
{ |
||||
"images" : [ |
||||
{ |
||||
"idiom" : "universal", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"filename" : "comm_selectBtn_Select@2x.png", |
||||
"idiom" : "universal", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "universal", |
||||
"scale" : "3x" |
||||
} |
||||
], |
||||
"info" : { |
||||
"author" : "xcode", |
||||
"version" : 1 |
||||
} |
||||
} |
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
{ |
||||
"images" : [ |
||||
{ |
||||
"idiom" : "universal", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"filename" : "map_weilan_select@2x.png", |
||||
"idiom" : "universal", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "universal", |
||||
"scale" : "3x" |
||||
} |
||||
], |
||||
"info" : { |
||||
"author" : "xcode", |
||||
"version" : 1 |
||||
} |
||||
} |
After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 749 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 786 KiB |
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 782 KiB |
Before Width: | Height: | Size: 212 KiB After Width: | Height: | Size: 840 KiB |
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 834 KiB |
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 910 KiB |
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 741 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 776 KiB |
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 756 KiB |
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 814 KiB |
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 816 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 894 KiB |
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 262 KiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 650 KiB |
Before Width: | Height: | Size: 346 KiB After Width: | Height: | Size: 648 KiB |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// MoreRailAddressViewController.h
|
||||
// LekangGuard
|
||||
//
|
||||
// Created by ecell on 2023/8/30.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@interface MoreRailAddressViewController : BaseViewController |
||||
|
||||
@property (nonatomic ,strong) SafetyRailModel *railModel; |
||||
|
||||
/// 是否编辑 1:添加,2:编辑
|
||||
@property (nonatomic ,assign) NSInteger isRedact; |
||||
|
||||
@property (nonatomic ,strong) void(^isAddressModel)(SafetyRailModel *model); |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,454 @@
@@ -0,0 +1,454 @@
|
||||
// |
||||
// MoreRailAddressViewController.m |
||||
// LekangGuard |
||||
// |
||||
// Created by ecell on 2023/8/30. |
||||
// |
||||
|
||||
#import "MoreRailAddressViewController.h" |
||||
#import "AppDelegate.h" |
||||
#import "RailSearchAddressVC.h" |
||||
#import "SLMarqueeControl.h" |
||||
|
||||
@interface MoreRailAddressViewController ()<MAMapViewDelegate,AMapGeoFenceManagerDelegate> |
||||
|
||||
@property (nonatomic,strong) MAMapView * mapView; |
||||
|
||||
@property (nonatomic, strong) MACircle * circleView; |
||||
|
||||
@property (nonatomic, strong) MAPolygon *polygon; |
||||
|
||||
@property (nonatomic, strong) NSMutableArray *annotations; |
||||
|
||||
@property (nonatomic ,assign) CLLocationCoordinate2D points; |
||||
|
||||
@property (nonatomic ,strong) UIView *topView; |
||||
@property (nonatomic ,weak) SLMarqueeControl *marqueeControl; |
||||
|
||||
@property (nonatomic ,strong) MAAnnotationView *UserannotationView; |
||||
|
||||
/// 底部View |
||||
@property (nonatomic ,strong) UIView *bottomView; |
||||
|
||||
@property (nonatomic ,assign) NSInteger tags; |
||||
|
||||
|
||||
|
||||
@end |
||||
|
||||
@implementation MoreRailAddressViewController |
||||
|
||||
- (void)viewDidLoad { |
||||
[super viewDidLoad]; |
||||
// Do any additional setup after loading the view. |
||||
self.zx_navTitle = @"地址"; |
||||
[self zx_setRightBtnWithText:GJText(@"保存") clickedBlock:^(ZXNavItemBtn * _Nonnull btn) { |
||||
if (self.annotations.count <= 0) |
||||
{ |
||||
[UICommon MessageErrorText:@"电子围栏不能为空"]; |
||||
return; |
||||
} |
||||
[self setbao]; |
||||
}]; |
||||
[MAMapView updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain]; |
||||
[MAMapView updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree]; |
||||
[AMapSearchAPI updatePrivacyShow:(AMapPrivacyShowStatusDidShow) privacyInfo:(AMapPrivacyInfoStatusDidContain)]; |
||||
|
||||
|
||||
|
||||
[self.view addSubview:self.bottomView]; |
||||
[self.view addSubview:self.mapView]; |
||||
[self.view addSubview:self.topView]; |
||||
[self.mapView mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.top.equalTo(self.view).offset(iPhoneX_NavHeight); |
||||
make.left.right.equalTo(self.view); |
||||
make.bottom.equalTo(self.bottomView.mas_top); |
||||
}]; |
||||
|
||||
//初始化 MAUserLocationRepresentation 对象 |
||||
MAUserLocationRepresentation *r = [[MAUserLocationRepresentation alloc] init]; |
||||
|
||||
r.showsAccuracyRing = NO;///精度圈是否显示,默认YES |
||||
[self.mapView updateUserLocationRepresentation:r]; |
||||
|
||||
if (self.isRedact == 2) |
||||
[UICommon MessageUpload:@"地图加载中"]; |
||||
kWeakSelf(self) |
||||
AfterDispatch(1, ^{ |
||||
if (self.isRedact == 2) |
||||
{ |
||||
[UICommon HidenLoading]; |
||||
if (self.railModel) |
||||
{ |
||||
self.marqueeControl.marqueeLabel.text = self.railModel.address; |
||||
|
||||
for (NSDictionary *dic in self.railModel.boundaryCoordinates) |
||||
{ |
||||
MAPointAnnotation *a1 = [[MAPointAnnotation alloc] init]; |
||||
a1.coordinate = (CLLocationCoordinate2D){[dic[@"latitude"] doubleValue],[dic[@"longitude"] doubleValue]}; |
||||
[self.annotations addObject:a1]; |
||||
} |
||||
|
||||
CLLocationCoordinate2D points[self.annotations.count]; |
||||
for (int i = 0; i < self.annotations.count; i++) |
||||
{ |
||||
self.tags = i; |
||||
MAPointAnnotation *point = self.annotations[i]; |
||||
// [self.mapView removeAnnotation:point]; |
||||
points[i] = CLLocationCoordinate2DMake(point.coordinate.latitude, point.coordinate.longitude); |
||||
[self.mapView addAnnotation:point]; |
||||
} |
||||
|
||||
self.polygon = [MAPolygon polygonWithCoordinates:points count:self.annotations.count]; |
||||
[self.mapView addOverlay:self.polygon]; |
||||
|
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
//自定义标记点位置发生改变 |
||||
- (void)mapView:(MAMapView *)mapView annotationView:(MAAnnotationView *)view didChangeDragState:(MAAnnotationViewDragState)newState fromOldState:(MAAnnotationViewDragState)oldState |
||||
{ |
||||
|
||||
if ([view.reuseIdentifier isEqualToString:@"annotationReuseIndetifier"]) |
||||
{ |
||||
NSLog(@"x=%f,y=%f,tag=%ld",view.annotation.coordinate.latitude,view.annotation.coordinate.longitude,view.tag); |
||||
|
||||
// MAMetersBetweenMapPoints(<#MAMapPoint a#>, <#MAMapPoint b#>) |
||||
|
||||
// 定位点拖拽结束 |
||||
if(newState == MAAnnotationViewDragStateEnding) |
||||
{ |
||||
[self.mapView removeOverlay:self.polygon]; |
||||
|
||||
MAPointAnnotation *a1 = [[MAPointAnnotation alloc] init]; |
||||
a1.coordinate = (CLLocationCoordinate2D){view.annotation.coordinate.latitude,view.annotation.coordinate.longitude}; |
||||
[self.annotations replaceObjectAtIndex:view.tag withObject:a1]; |
||||
|
||||
CLLocationCoordinate2D points[self.annotations.count]; |
||||
for (int i = 0; i < self.annotations.count; i++) |
||||
{ |
||||
MAPointAnnotation *p = self.annotations[i]; |
||||
points[i] = CLLocationCoordinate2DMake(p.coordinate.latitude, p.coordinate.longitude); |
||||
} |
||||
|
||||
self.polygon = [MAPolygon polygonWithCoordinates:points count:self.annotations.count]; |
||||
[self.mapView addOverlay:self.polygon]; |
||||
} |
||||
} |
||||
} |
||||
|
||||
#pragma mark - MAMapViewDelegate |
||||
//绘制区域图形的相关属性配置 可以是矩形 多边形 圆形 |
||||
- (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id<MAOverlay>)overlay |
||||
{ |
||||
if ([overlay isKindOfClass:[MAPolygon class]]) |
||||
{ |
||||
MAPolygonRenderer *pol = [[MAPolygonRenderer alloc] initWithPolygon:overlay]; |
||||
pol.lineWidth = 2.f; |
||||
pol.lineJoinType = kMALineJoinRound; |
||||
pol.strokeColor = KKMainColor; |
||||
pol.fillColor = RGBA(59, 161, 245, .2); |
||||
pol.lineDashType = kMALineDashTypeNone; |
||||
pol.miterLimit = 5; |
||||
return pol; |
||||
|
||||
} |
||||
|
||||
return nil; |
||||
} |
||||
|
||||
/*! |
||||
@brief 根据anntation生成对应的View |
||||
@param mapView 地图View |
||||
@param annotation 指定的标注 |
||||
@return 生成的标注View |
||||
*/ |
||||
- (MAAnnotationView*)mapView:(MAMapView *)mapView viewForAnnotation:(id <MAAnnotation>)annotation |
||||
{ |
||||
//定位蓝点 如果不在此判断 自身的定位点样式会被其他自定义的样式修改 |
||||
if ([annotation isKindOfClass:[MAUserLocation class]]) |
||||
{ |
||||
static NSString *customReuseIndetifier = @"customReuseIndetifier"; |
||||
self.UserannotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:customReuseIndetifier]; |
||||
|
||||
if (self.UserannotationView == nil) |
||||
{ |
||||
self.UserannotationView = [[MAAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:customReuseIndetifier]; |
||||
} |
||||
self.UserannotationView.canShowCallout = NO;//允许交互点击 |
||||
self.UserannotationView.draggable = NO; |
||||
self.UserannotationView.image = ImageName_(@"icon_home_page_orientation");//设置大头针视图的图片 |
||||
return self.UserannotationView; |
||||
} |
||||
|
||||
if ([annotation isKindOfClass:[MAPointAnnotation class]]) |
||||
{ |
||||
static NSString *reuseIndetifier = @"annotationReuseIndetifier"; |
||||
MAAnnotationView *annotationView = (MAAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:reuseIndetifier]; |
||||
if (annotationView == nil) |
||||
{ |
||||
annotationView = [[MAAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:reuseIndetifier]; |
||||
} |
||||
annotationView.tag = self.tags; |
||||
annotationView.image = [UIImage imageNamed:@"map_weilan_select"]; |
||||
annotationView.canShowCallout = NO; |
||||
annotationView.draggable = YES; |
||||
//设置中心点偏移,使得标注底部中间点成为经纬度对应点 |
||||
annotationView.centerOffset = CGPointMake(0, 0); |
||||
return annotationView; |
||||
|
||||
} |
||||
|
||||
return nil; |
||||
} |
||||
|
||||
//点击屏幕获取经纬度 (手动获取模拟数据使用) |
||||
- (void)mapView:(MAMapView *)mapView didSingleTappedAtCoordinate:(CLLocationCoordinate2D)coordinate |
||||
{ |
||||
NSLog(@"%f ---- %f",coordinate.latitude,coordinate.longitude); |
||||
|
||||
MAPointAnnotation *point = [[MAPointAnnotation alloc] init]; |
||||
if (self.annotations.count > 2) |
||||
return; |
||||
|
||||
point.coordinate = (CLLocationCoordinate2D){coordinate.latitude,coordinate.longitude}; |
||||
[self.annotations addObject:point]; |
||||
|
||||
if(self.annotations.count == 3) |
||||
[self addInteractionPoint]; |
||||
|
||||
CLLocationCoordinate2D points[self.annotations.count]; |
||||
for (int i = 0; i < self.annotations.count; i++) |
||||
{ |
||||
self.tags = i; |
||||
point = self.annotations[i]; |
||||
[self.mapView removeAnnotation:point]; |
||||
points[i] = CLLocationCoordinate2DMake(point.coordinate.latitude, point.coordinate.longitude); |
||||
[_mapView addAnnotation:point]; |
||||
} |
||||
|
||||
self.polygon = [MAPolygon polygonWithCoordinates:points count:self.annotations.count]; |
||||
[self.mapView addOverlay:self.polygon]; |
||||
} |
||||
|
||||
/// 点击地图形成三个点,强制在两点之间添加单个标记 |
||||
- (void)addInteractionPoint |
||||
{ |
||||
MAPointAnnotation *p = self.annotations[0]; |
||||
MAPointAnnotation *p1 = self.annotations[1]; |
||||
MAPointAnnotation *p2 = self.annotations[2]; |
||||
|
||||
double aa = (p.coordinate.latitude+p1.coordinate.latitude)/2; |
||||
double bb = (p.coordinate.longitude+p1.coordinate.longitude)/2; |
||||
MAPointAnnotation *a = [[MAPointAnnotation alloc] init]; |
||||
a.coordinate = (CLLocationCoordinate2D){aa,bb}; |
||||
|
||||
|
||||
double aaa = (p1.coordinate.latitude+p2.coordinate.latitude)/2; |
||||
double bbb = (p1.coordinate.longitude+p2.coordinate.longitude)/2; |
||||
MAPointAnnotation *as = [[MAPointAnnotation alloc] init]; |
||||
as.coordinate = (CLLocationCoordinate2D){aaa,bbb}; |
||||
|
||||
double aaaa = (p2.coordinate.latitude+p.coordinate.latitude)/2; |
||||
double bbbb = (p2.coordinate.longitude+p.coordinate.longitude)/2; |
||||
MAPointAnnotation *ass = [[MAPointAnnotation alloc] init]; |
||||
ass.coordinate = (CLLocationCoordinate2D){aaaa,bbbb}; |
||||
|
||||
|
||||
[self.annotations insertObject:a atIndex:1]; |
||||
[self.annotations insertObject:as atIndex:3]; |
||||
[self.annotations addObject:ass]; |
||||
} |
||||
/** |
||||
* @brief 长按地图,返回经纬度 |
||||
* @param mapView 地图View |
||||
* @param coordinate 经纬度 |
||||
*/ |
||||
- (void)mapView:(MAMapView *)mapView didLongPressedAtCoordinate:(CLLocationCoordinate2D)coordinate; |
||||
{ |
||||
CLLocation *curLocation = [[CLLocation alloc] initWithLatitude:coordinate.latitude |
||||
longitude:coordinate.longitude]; |
||||
[self getAddressWithLocation:curLocation]; |
||||
} |
||||
|
||||
- (void)mapInitComplete:(MAMapView *)mapView |
||||
{ |
||||
if (self.isRedact == 1) |
||||
[self getAddressWithLocation:mapView.userLocation.location]; |
||||
} |
||||
|
||||
#pragma mark 根据坐标取得地名 |
||||
-(void)getAddressWithLocation:(CLLocation *)location |
||||
{ |
||||
//反地理编码 |
||||
CLGeocoder *geocoder = [[CLGeocoder alloc]init]; |
||||
|
||||
kWeakSelf(self) |
||||
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { |
||||
CLPlacemark *placemark = [placemarks firstObject]; |
||||
NSLog(@"详细信息:%@",placemark.addressDictionary); |
||||
NSString *name; |
||||
if (placemark.addressDictionary) |
||||
{ |
||||
name = placemark.addressDictionary[@"FormattedAddressLines"][0]; |
||||
} |
||||
else if(placemark.subLocality) |
||||
{ |
||||
name = [NSString stringWithFormat:@"%@%@", |
||||
placemark.subLocality,placemark.name]; |
||||
}else{ |
||||
name = [NSString stringWithFormat:@"%@ %@", |
||||
placemark.locality,placemark.name]; |
||||
} |
||||
|
||||
weakself.railModel.address = name; |
||||
//在导航栏上赋值地址 |
||||
weakself.marqueeControl.marqueeLabel.text = name; |
||||
// weakself.railModel.lon = F(@"%f", location.coordinate.longitude); |
||||
// weakself.railModel.lat = F(@"%f", location.coordinate.latitude); |
||||
//[weakself.myTableView reloadData]; |
||||
}]; |
||||
} |
||||
|
||||
|
||||
- (UIView *)bottomView |
||||
{ |
||||
if (!_bottomView) |
||||
{ |
||||
_bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - (iPhoneX_TabbarHeight+20), SCREEN_WIDTH, iPhoneX_TabbarHeight+20)]; |
||||
_bottomView.backgroundColor = KKWhiteColorColor; |
||||
|
||||
UIButton *deleteBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(0) normalColor:KKMainColor normalText:@"" click:^(id x) { |
||||
|
||||
if (self.annotations.count <= 0) return; |
||||
|
||||
[self.mapView removeAnnotations:self.mapView.annotations]; |
||||
[self.mapView removeOverlays:self.mapView.overlays]; |
||||
[self.annotations removeAllObjects]; |
||||
|
||||
}]; |
||||
deleteBtn.backgroundColor = KKMainColor; |
||||
[deleteBtn setImage:ImageName_(@"icon_delect_1") forState:0]; |
||||
[_bottomView addSubview:deleteBtn]; |
||||
[deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.right.equalTo(_bottomView.mas_right); |
||||
make.top.equalTo(_bottomView.mas_top); |
||||
make.bottom.equalTo(_bottomView.mas_bottom); |
||||
make.width.mas_equalTo(Adapted(65)); |
||||
}]; |
||||
|
||||
|
||||
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentLeft font:FontADA_(12) textColor:UIColor.redColor text:@"" Radius:0]; |
||||
titleLabel.text = @"1.绘制方法:请顺时针或逆时针依次标记电子围栏,标记点不可交叉,否则电子围栏将会产生错误;\n2.长按电子围栏标记点2秒可对电子围栏范围进行编辑."; |
||||
[_bottomView addSubview:titleLabel]; |
||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(_bottomView).offset(15); |
||||
make.right.equalTo(deleteBtn.mas_left).inset(5); |
||||
make.top.equalTo(_bottomView).offset(10); |
||||
}]; |
||||
|
||||
|
||||
} |
||||
return _bottomView; |
||||
} |
||||
|
||||
- (UIView *)topView |
||||
{ |
||||
if (!_topView) |
||||
{ |
||||
kWeakSelf(self) |
||||
|
||||
_topView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:Adapted(12.5) borderWidth:0 borderColor:KKWhiteColorColor]; |
||||
_topView.frame = CGRectMake(10, iPhoneX_NavHeight+6, SCREEN_WIDTH-20, Adapted(25)); |
||||
|
||||
UIImageView *locationTypeImageView = [UICommon ui_imageView:CGRectZero fileName:@"home_icon_gps"]; |
||||
[_topView addSubview:locationTypeImageView]; |
||||
[locationTypeImageView mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(_topView).offset(13); |
||||
make.centerY.equalTo(_topView); |
||||
make.size.mas_equalTo(CGSizeMake(15, 15)); |
||||
}]; |
||||
|
||||
/// 位置跑马灯 |
||||
SLMarqueeControl *control = [[SLMarqueeControl alloc] initWithFrame:CGRectMake(38, Adapted(5), SCREEN_WIDTH-20-38-15, 15)]; |
||||
control.backgroundColor = KKClearColor; |
||||
control.marqueeLabel.text = @"长按地图选择位置"; |
||||
self.marqueeControl = control; |
||||
[_topView addSubview:control]; |
||||
|
||||
|
||||
UIButton *pusBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(0) normalColor:KKMainColor normalText:@"" click:^(id x) { |
||||
RailSearchAddressVC *vc = [RailSearchAddressVC new]; |
||||
vc.selectAddressCallBack = ^(NSString *searchResult, AMapGeoPoint *point) { |
||||
// weakself.curLocation = [[CLLocation alloc] initWithLatitude:point.latitude |
||||
// longitude:point.longitude]; |
||||
// |
||||
// [weakself updateRegionWithAddress:YES]; |
||||
weakself.marqueeControl.marqueeLabel.text = searchResult; |
||||
weakself.railModel.address = searchResult; |
||||
}; |
||||
[[UICommon currentVC].navigationController pushViewController:vc animated:YES]; |
||||
}]; |
||||
[_topView addSubview:pusBtn]; |
||||
[pusBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.right.left.equalTo(_topView); |
||||
make.top.equalTo(_topView); |
||||
make.bottom.equalTo(_topView.mas_bottom); |
||||
}]; |
||||
} |
||||
return _topView; |
||||
} |
||||
|
||||
- (MAMapView *)mapView |
||||
{ |
||||
if (!_mapView) |
||||
{ |
||||
_mapView = [[MAMapView alloc] initWithFrame:CGRectZero]; |
||||
_mapView.userTrackingMode = MAUserTrackingModeFollow; |
||||
///如果您需要进入地图就显示定位小蓝点,则需要下面两行代码 |
||||
_mapView.showsUserLocation = YES; |
||||
_mapView.showsScale = NO; |
||||
_mapView.zoomLevel = 18; |
||||
_mapView.showTraffic = YES; |
||||
_mapView.showsCompass = NO; |
||||
_mapView.delegate = self; |
||||
} |
||||
return _mapView; |
||||
} |
||||
|
||||
- (NSMutableArray *)annotations |
||||
{ |
||||
if (!_annotations) _annotations = [NSMutableArray new]; |
||||
return _annotations; |
||||
} |
||||
|
||||
|
||||
- (void)setbao |
||||
{ |
||||
NSMutableArray *arr = [NSMutableArray new]; |
||||
for (MAPointAnnotation *p in self.annotations) |
||||
{ |
||||
NSMutableDictionary *dic = [NSMutableDictionary dictionary]; |
||||
[dic setValue:@(p.coordinate.latitude) forKey:@"latitude"]; |
||||
[dic setValue:@(p.coordinate.longitude) forKey:@"longitude"]; |
||||
[arr addObject:dic]; |
||||
} |
||||
self.railModel.boundaryCoordinates = arr; |
||||
self.railModel.type = 2; |
||||
self.isAddressModel(self.railModel); |
||||
[self.navigationController popViewControllerAnimated:YES]; |
||||
} |
||||
|
||||
/* |
||||
#pragma mark - Navigation |
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation |
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { |
||||
// Get the new view controller using [segue destinationViewController]. |
||||
// Pass the selected object to the new view controller. |
||||
} |
||||
*/ |
||||
|
||||
@end |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MemberListViewController.h
|
||||
// LekangGuard
|
||||
//
|
||||
// Created by ecell on 2023/8/29.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@interface MemberListViewController : BaseViewController |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,234 @@
@@ -0,0 +1,234 @@
|
||||
// |
||||
// MemberListViewController.m |
||||
// LekangGuard |
||||
// |
||||
// Created by ecell on 2023/8/29. |
||||
// |
||||
|
||||
#import "MemberListViewController.h" |
||||
#import "MemberListTableViewCell.h" |
||||
#import "AmendContactsViewController.h" |
||||
|
||||
@interface MemberListViewController ()<DZNEmptyDataSetSource,DZNEmptyDataSetDelegate> |
||||
|
||||
@property (nonatomic ,strong) CommonTableView *listTable; |
||||
|
||||
|
||||
/// 用户身份(0:游客,1:普通用户(关注的人),2:管理员) |
||||
@property (nonatomic ,assign) NSInteger identity; |
||||
|
||||
@end |
||||
|
||||
@implementation MemberListViewController |
||||
|
||||
- (void)viewDidLoad { |
||||
[super viewDidLoad]; |
||||
// Do any additional setup after loading the view. |
||||
self.view.backgroundColor = KKBackgroundGrey; |
||||
[self.view addSubview:self.listTable]; |
||||
[self.listTable mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.edges.equalTo(self.view); |
||||
}]; |
||||
[self GetQueryAddressList]; |
||||
} |
||||
|
||||
- (CommonTableView *)listTable |
||||
{ |
||||
if (!_listTable) |
||||
{ |
||||
_listTable = [[CommonTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain cellHeight:88 cellRow:0 isAdaptive:NO isLine:NO commonCell:MemberListTableViewCell.class createCell:^(ZZTableViewCell * _Nonnull cells, NSIndexPath * _Nonnull indexPath) { |
||||
MemberListTableViewCell *cell = (MemberListTableViewCell *)cells; |
||||
cell.contactsModel = self.modelListArr[indexPath.row]; |
||||
|
||||
} selectedCell:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath) { |
||||
|
||||
ContactsModel *contacts = self.modelListArr[indexPath.row]; |
||||
if(self.identity == 2)/// 如果自己是管理员可操作其他联系人 |
||||
{ |
||||
//如果自己是管理员 |
||||
kWeakSelf(self) |
||||
//是自己---直接跳 |
||||
if([contacts.openId isEqualToString:APIManager.sharedManager.loginModel.openid]){ |
||||
[self jumpContactVCWith:contacts]; |
||||
return; |
||||
} |
||||
|
||||
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:nil subtitle:F(@"%@ %@",GJText(@"联系人"),contacts.name) AlertViewType:AlertViewTypeSystemActionSheet config:nil]; |
||||
[alertV addAlertItem:^EasyAlertItem *{ |
||||
return [EasyAlertItem itemWithTitle:GJText(@"取消") type:AlertItemTypeSystemCancel callback:nil]; |
||||
}]; |
||||
[alertV addAlertItemWithTitle:GJText(@"删除") type:AlertItemTypeSystemDestructive callback:^(EasyAlertView *showview, long index) { |
||||
[weakself deleteContactFuntionWith:@[contacts.Id]]; |
||||
}]; |
||||
if(contacts.identity != 2 && contacts.openId) |
||||
{ |
||||
[alertV addAlertItemWithTitle:GJText(@"设置为管理员") type:AlertItemTypeSystemDefault callback:^(EasyAlertView *showview, long index) { |
||||
|
||||
NSString *msg = [NSString stringWithFormat:@"%@ %@ ?",GJText(@"确认将管理员转给"),contacts.relation]; |
||||
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:GJText(@"提示") subtitle:msg AlertViewType:AlertViewTypeSystemAlert config:nil]; |
||||
[alertV addAlertItem:^EasyAlertItem *{ |
||||
return [EasyAlertItem itemWithTitle:GJText(@"取消") type:AlertItemTypeSystemCancel callback:nil]; |
||||
}]; |
||||
[alertV addAlertItem:^EasyAlertItem *{ |
||||
return [EasyAlertItem itemWithTitle:GJText(@"确定") type:AlertItemTypeSystemDefault callback:^(EasyAlertView *showview, long index) { |
||||
[weakself SetAdmin:contacts.Id identity:2]; |
||||
}]; |
||||
}]; |
||||
[alertV showAlertView]; |
||||
}]; |
||||
} |
||||
if(contacts.setBind == 0) |
||||
{ |
||||
[alertV addAlertItemWithTitle:GJText(@"编辑联系人") type:AlertItemTypeSystemDefault callback:^(EasyAlertView *showview, long index) { |
||||
[weakself jumpContactVCWith:contacts]; |
||||
}]; |
||||
} |
||||
[alertV showAlertView]; |
||||
} |
||||
else |
||||
{ |
||||
//成员 |
||||
//是自己---直接跳 |
||||
if([contacts.openId isEqualToString:APIManager.sharedManager.loginModel.openid]) |
||||
{ |
||||
[self jumpContactVCWith:contacts]; |
||||
return; |
||||
} |
||||
else if(contacts.openId) |
||||
{ |
||||
// 非自己的成员(也包括管理员) |
||||
return; |
||||
} |
||||
else |
||||
{ |
||||
//普通联系人 |
||||
kWeakSelf(self) |
||||
EasyAlertView *alertV = [EasyAlertView alertViewWithTitle:nil subtitle:[NSString stringWithFormat:@"%@ %@",GJText(@"联系人"),contacts.name] AlertViewType:AlertViewTypeSystemActionSheet config:nil]; |
||||
[alertV addAlertItem:^EasyAlertItem *{ |
||||
return [EasyAlertItem itemWithTitle:GJText(@"取消") type:AlertItemTypeSystemCancel callback:nil]; |
||||
}]; |
||||
[alertV addAlertItem:^EasyAlertItem *{ |
||||
return [EasyAlertItem itemWithTitle:GJText(@"删除") type:AlertItemTypeSystemDestructive callback:^(EasyAlertView *showview, long index) { |
||||
[weakself deleteContactFuntionWith:@[contacts.Id]]; |
||||
}]; |
||||
}]; |
||||
|
||||
[alertV addAlertItemWithTitleArray:@[GJText(@"编辑联系人")] callback:^(EasyAlertView *showview, long index) { |
||||
NSLog(@"%ld",index); |
||||
[weakself jumpContactVCWith:contacts]; |
||||
}]; |
||||
[alertV showAlertView]; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
} DidscrollView:^(UIScrollView * _Nonnull scrollView) { |
||||
|
||||
}]; |
||||
_listTable.backgroundColor = KKClearColor; |
||||
} |
||||
return _listTable; |
||||
} |
||||
|
||||
|
||||
#pragma mark 查询通讯录成员 |
||||
/// 查询通讯录成员 |
||||
- (void)GetQueryAddressList |
||||
{ |
||||
[UICommon MessageUpload:@"加载中"]; |
||||
NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
||||
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"]; |
||||
[[[APIManager sharedManager] APGET:QueryAddressList_URL parameters:parameters resultClass:nil] subscribeNext:^(NSArray *arr) { |
||||
[UICommon HidenLoading]; |
||||
if (ARRAYHASVALUE(arr)) |
||||
{ |
||||
[self.modelListArr removeAllObjects]; |
||||
for (NSDictionary *dic in arr) |
||||
{ |
||||
ContactsModel *model = [ContactsModel yy_modelWithJSON:dic]; |
||||
if ([model.openId isEqualToString:APIManager.sharedManager.loginModel.openid]) |
||||
self.identity = model.identity; |
||||
model.isSelect = NO; |
||||
if (model.setBind == 1) |
||||
[self.modelListArr addObject:model]; |
||||
} |
||||
} |
||||
self.listTable.cellRow = self.modelListArr.count; |
||||
[self.listTable reloadData]; |
||||
|
||||
} error:^(NSError * _Nullable error) { |
||||
NSDictionary *dic = error.userInfo; |
||||
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]]; |
||||
}]; |
||||
} |
||||
|
||||
|
||||
#pragma mark 跳转到 修改/添加 联系人 页面 |
||||
- (void)jumpContactVCWith:(ContactsModel*)contacts |
||||
{ |
||||
AmendContactsViewController *vc = [AmendContactsViewController new]; |
||||
vc.conModel = contacts; |
||||
vc.isUpdateSucceed = ^{ |
||||
[self GetQueryAddressList]; |
||||
}; |
||||
[[UICommon currentVC].navigationController pushViewController:vc animated:YES]; |
||||
vc.zx_navTitle = @"修改家庭成员"; |
||||
} |
||||
|
||||
#pragma mark 删除 |
||||
/// 删除 |
||||
- (void)deleteContactFuntionWith:(NSArray *)IdArr |
||||
{ |
||||
if(IdArr.count == 0) |
||||
{ |
||||
LGAlertView *alertView = [[LGAlertView alloc] initWithTitle:GJText(@"注意") message:GJText(@"请选择要删除的联系人") style:LGAlertViewStyleAlert buttonTitles:@[GJText(@"确定")] cancelButtonTitle:nil destructiveButtonTitle:nil actionHandler:^(LGAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) {} cancelHandler:^(LGAlertView * _Nonnull alertView) {} destructiveHandler:^(LGAlertView * _Nonnull alertView) {}]; |
||||
[alertView showAnimated:YES completionHandler:nil]; |
||||
return; |
||||
} |
||||
|
||||
LGAlertView *alertView = [[LGAlertView alloc] initWithTitle:GJText(@"注意") message:F(GJText(@"确认要删除%ld个联系人?"),IdArr.count) style:LGAlertViewStyleAlert buttonTitles:@[GJText(@"确定")] cancelButtonTitle:GJText(@"取消") destructiveButtonTitle:nil actionHandler:^(LGAlertView * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) { |
||||
|
||||
[UICommon MessageUpload:@"加载中"]; |
||||
[[[APIManager sharedManager] PostBodyWithApi:F(@"%@?imei=%@", DelBatchAddress_URL,APIManager.sharedManager.deviceModel.imei) json:[IdArr yy_modelToJSONString]] subscribeNext:^(id _Nullable x) { |
||||
[UICommon MessageSuccessText:@"删除成功"]; |
||||
[self GetQueryAddressList]; |
||||
} completed:^{ |
||||
|
||||
}]; |
||||
|
||||
} cancelHandler:^(LGAlertView * _Nonnull alertView) {} destructiveHandler:^(LGAlertView * _Nonnull alertView) {}]; |
||||
[alertView showAnimated:YES completionHandler:nil]; |
||||
|
||||
} |
||||
|
||||
#pragma mark 转让管理员 |
||||
/// 转让管理员 |
||||
- (void)SetAdmin:(NSString *)Id identity:(NSInteger)identity |
||||
{ |
||||
[UICommon MessageUpload:@"加载中"]; |
||||
NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
||||
[parameters setValue:Id forKey:@"id"]; |
||||
[parameters setValue:@(identity) forKey:@"identity"]; |
||||
[parameters setValue:APIManager.sharedManager.deviceModel.imei forKey:@"imei"]; |
||||
[[[APIManager sharedManager] APPOST:SetAdmin_URL parameters:parameters isJson:YES resultClass:nil] subscribeNext:^(id _Nullable x) { |
||||
[UICommon HidenLoading]; |
||||
[UICommon MessageSuccessText:@"管理员转让成功"]; |
||||
[self GetQueryAddressList]; |
||||
} error:^(NSError * _Nullable error) { |
||||
NSDictionary *dic = error.userInfo; |
||||
[UICommon MessageErrorText:dic[NSLocalizedDescriptionKey]]; |
||||
}]; |
||||
} |
||||
|
||||
/* |
||||
#pragma mark - Navigation |
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation |
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { |
||||
// Get the new view controller using [segue destinationViewController]. |
||||
// Pass the selected object to the new view controller. |
||||
} |
||||
*/ |
||||
|
||||
@end |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// MemberManagementViewController.h
|
||||
// LekangGuard
|
||||
//
|
||||
// Created by ecell on 2023/8/29.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@interface MemberManagementViewController : BaseViewController |
||||
|
||||
/**
|
||||
选择移动到哪个页面 |
||||
*/ |
||||
@property (assign , nonatomic)NSInteger selectedIndex; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
// |
||||
// MemberManagementViewController.m |
||||
// LekangGuard |
||||
// |
||||
// Created by ecell on 2023/8/29. |
||||
// |
||||
|
||||
#import "MemberManagementViewController.h" |
||||
#import "MCPageView.h" |
||||
#import "MemberListViewController.h" |
||||
#import "AttentionMessageViewController.h" |
||||
|
||||
@interface MemberManagementViewController ()<MCPageViewDelegate> |
||||
@property (nonatomic , strong) MCPageView * PageView; |
||||
@property (nonatomic ,strong) NSMutableArray *controllers; |
||||
|
||||
@end |
||||
|
||||
@implementation MemberManagementViewController |
||||
|
||||
- (void)viewDidLoad { |
||||
[super viewDidLoad]; |
||||
// Do any additional setup after loading the view. |
||||
self.zx_navTitle = @"成员管理"; |
||||
self.view.backgroundColor = KKBackgroundGrey; |
||||
|
||||
NSMutableArray *titles = [NSMutableArray array]; |
||||
[titles addObject:GJText(@"成员管理")]; |
||||
[titles addObject:GJText(@"绑定审批/申请")]; |
||||
|
||||
self.controllers = [NSMutableArray array]; |
||||
MemberListViewController *vc = [MemberListViewController new]; |
||||
AttentionMessageViewController *vc1 = [AttentionMessageViewController new]; |
||||
[self.controllers addObject:vc]; |
||||
[self.controllers addObject:vc1]; |
||||
|
||||
|
||||
self.PageView = [[MCPageView alloc]initWithFrame:CGRectMake(0, iPhoneX_NavHeight, SCREEN_WIDTH,SCREEN_HEIGHT-iPhoneX_NavHeight) titles:titles controllers:self.controllers]; |
||||
self.PageView.delegate = self; |
||||
//self.PageView.titleButtonWidth = Adapted(94); |
||||
self.PageView.backgroundColor = KKWhiteColorColor; |
||||
self.PageView.lineWitdhScale = 0.65; |
||||
self.PageView.lineColor = KKMainColor; |
||||
self.PageView.selectTitleFont = FontBoldADA_(16); |
||||
self.PageView.defaultTitleFont = FontADA_(14); |
||||
self.PageView.defaultTitleColor = KKTextBlackColor; |
||||
self.PageView.selectTitleColor = KKMainColor; |
||||
self.PageView.lastItemBackgroundColor = KKClearColor; |
||||
[self.view addSubview:self.PageView]; |
||||
|
||||
[self zx_setPopGestureCompatibleScrollViews:@[self.PageView.titleScroll,self.PageView.contentCollection]]; |
||||
[self.PageView selectIndex:self.selectedIndex]; |
||||
|
||||
} |
||||
|
||||
- (void)MCPageView:(MCPageView *)MCPageView didSelectIndex:(NSInteger)Index |
||||
{ |
||||
NSLog(@"%ld",Index); |
||||
self.selectedIndex = Index; |
||||
} |
||||
|
||||
|
||||
/* |
||||
#pragma mark - Navigation |
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation |
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { |
||||
// Get the new view controller using [segue destinationViewController]. |
||||
// Pass the selected object to the new view controller. |
||||
} |
||||
*/ |
||||
|
||||
@end |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// MemberListTableViewCell.h
|
||||
// LekangGuard
|
||||
//
|
||||
// Created by ecell on 2023/8/29.
|
||||
//
|
||||
|
||||
#import "ZZTableViewCell.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@interface MemberListTableViewCell : ZZTableViewCell |
||||
|
||||
@property (nonatomic ,strong) ContactsModel *contactsModel; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -0,0 +1,119 @@
@@ -0,0 +1,119 @@
|
||||
// |
||||
// MemberListTableViewCell.m |
||||
// LekangGuard |
||||
// |
||||
// Created by ecell on 2023/8/29. |
||||
// |
||||
|
||||
#import "MemberListTableViewCell.h" |
||||
|
||||
@interface MemberListTableViewCell () |
||||
|
||||
/// 头像 |
||||
@property (nonatomic ,weak) UIImageView *iconImg; |
||||
|
||||
/// 姓名 |
||||
@property (nonatomic ,weak) UILabel *nameLabel; |
||||
|
||||
/// 手机号 |
||||
@property (nonatomic ,weak) UILabel *phoneLabel; |
||||
|
||||
|
||||
@property (nonatomic ,weak) UILabel *typeLabel; |
||||
|
||||
@end |
||||
|
||||
@implementation MemberListTableViewCell |
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier |
||||
{ |
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
||||
if (self) |
||||
{ |
||||
self.selectionStyle = UITableViewCellSelectionStyleNone; |
||||
self.backgroundColor = KKClearColor; |
||||
[self subCellView]; |
||||
} |
||||
|
||||
return self; |
||||
} |
||||
|
||||
- (void)setContactsModel:(ContactsModel *)contactsModel |
||||
{ |
||||
//NSLog(@"-->%@",contactsModel); |
||||
_contactsModel = contactsModel; |
||||
self.iconImg.image = [UICommon getClickRelationshipImageWithCodeID:contactsModel.image deviceType:APIManager.sharedManager.deviceModel.deviceType]; |
||||
self.nameLabel.text = contactsModel.relation; |
||||
self.phoneLabel.text = contactsModel.phone; |
||||
self.typeLabel.text = contactsModel.identity == 2 ? @"管理员" : @"家庭成员"; |
||||
self.typeLabel.backgroundColor = contactsModel.identity == 2 ? RGB(255, 185, 79) : RGB(255, 216, 154); |
||||
if ([contactsModel.openId isEqualToString:APIManager.sharedManager.loginModel.openid]) |
||||
self.nameLabel.text = @"家庭成员(我)"; |
||||
else |
||||
self.nameLabel.text = F(@"家庭成员(%@)",contactsModel.relation); |
||||
} |
||||
|
||||
|
||||
- (void)subCellView |
||||
{ |
||||
UIView *bgView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:10 borderWidth:0 borderColor:KKWhiteColorColor]; |
||||
[self.contentView addSubview:bgView]; |
||||
[bgView mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(self.contentView.mas_left).offset(10); |
||||
make.right.equalTo(self.contentView.mas_right).inset(10); |
||||
make.top.equalTo(self.contentView.mas_top).offset(12); |
||||
make.bottom.equalTo(self.contentView.mas_bottom); |
||||
}]; |
||||
|
||||
|
||||
UIImageView *iconImg = [UICommon ui_imageView:CGRectZero fileName:@""]; |
||||
iconImg.layer.cornerRadius = 25; |
||||
iconImg.layer.masksToBounds = YES; |
||||
self.iconImg = iconImg; |
||||
[bgView addSubview:iconImg]; |
||||
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(bgView).offset(11); |
||||
make.centerY.equalTo(bgView); |
||||
make.size.mas_equalTo(CGSizeMake(50, 50)); |
||||
}]; |
||||
|
||||
|
||||
UILabel *nameLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(14) textColor:KKTextBlackColor text:@"" Radius:0]; |
||||
self.nameLabel = nameLabel; |
||||
[bgView addSubview:nameLabel]; |
||||
[nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(iconImg.mas_right).offset(10); |
||||
make.top.equalTo(iconImg).offset(5); |
||||
}]; |
||||
|
||||
UILabel *phoneLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(12) textColor:KKGrey133 text:@"" Radius:0]; |
||||
self.phoneLabel = phoneLabel; |
||||
[bgView addSubview:phoneLabel]; |
||||
[phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(nameLabel); |
||||
make.bottom.equalTo(iconImg.mas_bottom).inset(5); |
||||
}]; |
||||
|
||||
UILabel *typeLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:Font_(12) textColor:KKWhiteColorColor text:@"" Radius:8]; |
||||
self.typeLabel = typeLabel; |
||||
[bgView addSubview:typeLabel]; |
||||
[typeLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.right.equalTo(bgView.mas_right).inset(11); |
||||
make.centerY.equalTo(bgView); |
||||
make.size.mas_equalTo(CGSizeMake(68, 25)); |
||||
}]; |
||||
|
||||
} |
||||
|
||||
- (void)awakeFromNib { |
||||
[super awakeFromNib]; |
||||
// Initialization code |
||||
} |
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
||||
[super setSelected:selected animated:animated]; |
||||
|
||||
// Configure the view for the selected state |
||||
} |
||||
|
||||
@end |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 24 KiB |
@ -0,0 +1,112 @@
@@ -0,0 +1,112 @@
|
||||
<Xml> |
||||
<XmlVerSion>v1.0</XmlVerSion> |
||||
<NavigationParam> |
||||
<!--横屏:1--> |
||||
<ScreenDirection>1</ScreenDirection> |
||||
<!--相机角度多少帧会跟随道路朝向,单位“帧”,10帧/秒--> |
||||
<InterpolationFrame>30</InterpolationFrame> |
||||
<!--相机默认仰角(20-80)--> |
||||
<DefaultTitle>70</DefaultTitle> |
||||
<!--相机推近后的到地面的默认初始距离(米)--> |
||||
<DefaultCamerah>40</DefaultCamerah> |
||||
<!--相机角度前置车标多少米--> |
||||
<ForwardDis0>50</ForwardDis0> |
||||
<!--相机角度前置车标多少米(针对掉头)--> |
||||
<ForwardDis1>10</ForwardDis1> |
||||
<!--相机角度不可超出阈值--> |
||||
<ForwardDegreeMax>45</ForwardDegreeMax> |
||||
|
||||
<!--距离语音点多少米开始下压,0不检测语音点--> |
||||
<DisBeforeSound>100</DisBeforeSound> |
||||
<!--走过语音点多少米后开始抬起--> |
||||
<DisAfterSound>100</DisAfterSound> |
||||
<!--路口三维推近仰角(20-80)--> |
||||
<SoundTitle>70</SoundTitle> |
||||
<!--相机推近后的到地面的最小距离(米)--> |
||||
<SoundCamerah>40</SoundCamerah> |
||||
|
||||
<!--距离Pick点多少米开始下压,0不检测Pick点--> |
||||
<DisBeforePick>100</DisBeforePick> |
||||
<!--走过Pick点多少米后开始抬起--> |
||||
<DisAfterPick>100</DisAfterPick> |
||||
<!--Pick推近最小仰角(20-80)--> |
||||
<PickTitle>75</PickTitle> |
||||
<!--相机推近后的到地面的最小距离(米)--> |
||||
<PickCamerah>3.0</PickCamerah> |
||||
<!--距离DisBeforePick前的Pick采样间隔(米/帧),实际采样间隔再加上车速--> |
||||
<PickInterval>4</PickInterval> |
||||
|
||||
<!--完成下压的限制距离(米)--> |
||||
<LimitDis>10</LimitDis> |
||||
<!--低速行驶时相机视角是否往回摆--> |
||||
<LowSpeedTurnBack>0</LowSpeedTurnBack> |
||||
|
||||
<!--车道切换、主辅路切换角度阀值(度)--> |
||||
<LaneSwitchAngle>15</LaneSwitchAngle> |
||||
<!--车道切换、主辅路切换中间转弯的方向线长度阀值(米)--> |
||||
<LaneSwitchDis>150</LaneSwitchDis> |
||||
<!--车道切换、主辅路切换忽略普通线也转弯的长度阀值(米)--> |
||||
<LaneSwitchIgnorDis>80</LaneSwitchIgnorDis> |
||||
|
||||
<!--转弯箭头距离车位置多远开始显示--> |
||||
<TrunPicMaxDis>250</TrunPicMaxDis> |
||||
<!--转弯提示文字距离车位置多远开始不显示--> |
||||
<TrunPicMinDis>25</TrunPicMinDis> |
||||
<!--转弯提示文字的大小,单位"像素"--> |
||||
<TrunPicSize>50</TrunPicSize> |
||||
|
||||
<!--10米比例尺车标宽度,单位"米"--> |
||||
<CarWidth>6.5</CarWidth> |
||||
|
||||
<!--车道线宽,单位"米"--> |
||||
<RoadLineWidth>7.0</RoadLineWidth> |
||||
<!--车道线颜色--> |
||||
<LineColorRed>0</LineColorRed> |
||||
<LineColorGreen>174</LineColorGreen> |
||||
<LineColorBlue>255</LineColorBlue> |
||||
<LineColorAlpha>204</LineColorAlpha> |
||||
|
||||
<!--方向线向前长度,单位"米"--> |
||||
<LineforwardLength>30</LineforwardLength> |
||||
<!--方向线向后长度,单位"米"--> |
||||
<LinebackLength>30</LinebackLength> |
||||
<!--方向线宽度,单位"米"--> |
||||
<LineWidth>7.0</LineWidth> |
||||
<!--车道线融合(0-255,0全透,暂无效)--> |
||||
<LineAlpha>100</LineAlpha> |
||||
|
||||
</NavigationParam> |
||||
<AnimateParam> |
||||
<!--二维进入三维,蒙板颜色红色分量[0,255]--> |
||||
<ColorInRed>29</ColorInRed> |
||||
<!--二维进入三维,蒙板颜色绿色分量[0,255]--> |
||||
<ColorInGreed>30</ColorInGreed> |
||||
<!--二维进入三维,蒙板颜色蓝色分量[0,255]--> |
||||
<ColorInBlue>26</ColorInBlue> |
||||
<!--二维动画帧数--> |
||||
<FrameIn2d>4</FrameIn2d> |
||||
<!--三维动画帧数--> |
||||
<FrameIn3d>6</FrameIn3d> |
||||
|
||||
<!--三维退出二维,蒙板颜色红色分量[0,255]--> |
||||
<ColorOutRed>29</ColorOutRed> |
||||
<!--三维退出二维,蒙板颜色绿色分量[0,255]--> |
||||
<ColorOutGreed>30</ColorOutGreed> |
||||
<!--三维退出二维,蒙板颜色蓝色分量[0,255]--> |
||||
<ColorOutBlue>26</ColorOutBlue> |
||||
<!--二维动画帧数--> |
||||
<FrameOut2d>2</FrameOut2d> |
||||
<!--三维动画帧数--> |
||||
<FrameOut3d>3</FrameOut3d> |
||||
|
||||
<!--2d透明度变化范围起始值[0,255]--> |
||||
<AlphaBegin2d>60</AlphaBegin2d> |
||||
<!--2d透明度变化范围结束值[0,255]--> |
||||
<AlphaEnd2d>120</AlphaEnd2d> |
||||
<!--透明度变化范围起始值[0,255]--> |
||||
<AlphaBegin3d>180</AlphaBegin3d> |
||||
<!--透明度变化范围结束值[0,255]--> |
||||
<AlphaEnd3d>100</AlphaEnd3d> |
||||
|
||||
</AnimateParam> |
||||
</Xml> |
@ -0,0 +1,112 @@
@@ -0,0 +1,112 @@
|
||||
<Xml> |
||||
<XmlVerSion>v1.0</XmlVerSion> |
||||
<NavigationParam> |
||||
<!--竖屏:0--> |
||||
<ScreenDirection>0</ScreenDirection> |
||||
<!--相机角度多少帧会跟随道路朝向,单位“帧”,10帧/秒--> |
||||
<InterpolationFrame>30</InterpolationFrame> |
||||
<!--相机默认仰角(20-80)--> |
||||
<DefaultTitle>65</DefaultTitle> |
||||
<!--相机推近后的到地面的默认初始距离(米)--> |
||||
<DefaultCamerah>50</DefaultCamerah> |
||||
<!--相机角度前置车标多少米--> |
||||
<ForwardDis0>50</ForwardDis0> |
||||
<!--相机角度前置车标多少米(针对掉头)--> |
||||
<ForwardDis1>10</ForwardDis1> |
||||
<!--相机角度不可超出阈值--> |
||||
<ForwardDegreeMax>45</ForwardDegreeMax> |
||||
|
||||
<!--距离语音点多少米开始下压,0不检测语音点--> |
||||
<DisBeforeSound>100</DisBeforeSound> |
||||
<!--走过语音点多少米后开始抬起--> |
||||
<DisAfterSound>100</DisAfterSound> |
||||
<!--路口三维推近仰角(20-80)--> |
||||
<SoundTitle>65</SoundTitle> |
||||
<!--相机推近后的到地面的最小距离(米)--> |
||||
<SoundCamerah>50</SoundCamerah> |
||||
|
||||
<!--距离Pick点多少米开始下压,0不检测Pick点--> |
||||
<DisBeforePick>100</DisBeforePick> |
||||
<!--走过Pick点多少米后开始抬起--> |
||||
<DisAfterPick>100</DisAfterPick> |
||||
<!--Pick推近最小仰角(20-80)--> |
||||
<PickTitle>70</PickTitle> |
||||
<!--相机推近后的到地面的最小距离(米)--> |
||||
<PickCamerah>3.0</PickCamerah> |
||||
<!--距离DisBeforePick前的Pick采样间隔(米/帧),实际采样间隔再加上车速--> |
||||
<PickInterval>4</PickInterval> |
||||
|
||||
<!--完成下压的限制距离(米)--> |
||||
<LimitDis>10</LimitDis> |
||||
<!--低速行驶时相机视角是否往回摆--> |
||||
<LowSpeedTurnBack>0</LowSpeedTurnBack> |
||||
|
||||
<!--车道切换、主辅路切换角度阀值(度)--> |
||||
<LaneSwitchAngle>15</LaneSwitchAngle> |
||||
<!--车道切换、主辅路切换中间转弯的方向线长度阀值(米)--> |
||||
<LaneSwitchDis>150</LaneSwitchDis> |
||||
<!--车道切换、主辅路切换忽略普通线也转弯的长度阀值(米)--> |
||||
<LaneSwitchIgnorDis>80</LaneSwitchIgnorDis> |
||||
|
||||
<!--转弯箭头距离车位置多远开始显示--> |
||||
<TrunPicMaxDis>250</TrunPicMaxDis> |
||||
<!--转弯提示文字距离车位置多远开始不显示--> |
||||
<TrunPicMinDis>25</TrunPicMinDis> |
||||
<!--转弯提示文字的大小,单位"像素"--> |
||||
<TrunPicSize>50</TrunPicSize> |
||||
|
||||
<!--10米比例尺车标宽度,单位"米"--> |
||||
<CarWidth>6.5</CarWidth> |
||||
|
||||
<!--车道线宽,单位"米"--> |
||||
<RoadLineWidth>7.0</RoadLineWidth> |
||||
<!--车道线颜色--> |
||||
<LineColorRed>0</LineColorRed> |
||||
<LineColorGreen>174</LineColorGreen> |
||||
<LineColorBlue>255</LineColorBlue> |
||||
<LineColorAlpha>204</LineColorAlpha> |
||||
|
||||
<!--方向线向前长度,单位"米"--> |
||||
<LineforwardLength>30</LineforwardLength> |
||||
<!--方向线向后长度,单位"米"--> |
||||
<LinebackLength>30</LinebackLength> |
||||
<!--方向线宽度,单位"米"--> |
||||
<LineWidth>7.0</LineWidth> |
||||
<!--车道线融合(0-255,0全透,暂无效)--> |
||||
<LineAlpha>100</LineAlpha> |
||||
|
||||
</NavigationParam> |
||||
<AnimateParam> |
||||
<!--二维进入三维,蒙板颜色红色分量[0,255]--> |
||||
<ColorInRed>29</ColorInRed> |
||||
<!--二维进入三维,蒙板颜色绿色分量[0,255]--> |
||||
<ColorInGreed>30</ColorInGreed> |
||||
<!--二维进入三维,蒙板颜色蓝色分量[0,255]--> |
||||
<ColorInBlue>26</ColorInBlue> |
||||
<!--二维动画帧数--> |
||||
<FrameIn2d>4</FrameIn2d> |
||||
<!--三维动画帧数--> |
||||
<FrameIn3d>6</FrameIn3d> |
||||
|
||||
<!--三维退出二维,蒙板颜色红色分量[0,255]--> |
||||
<ColorOutRed>29</ColorOutRed> |
||||
<!--三维退出二维,蒙板颜色绿色分量[0,255]--> |
||||
<ColorOutGreed>30</ColorOutGreed> |
||||
<!--三维退出二维,蒙板颜色蓝色分量[0,255]--> |
||||
<ColorOutBlue>26</ColorOutBlue> |
||||
<!--二维动画帧数--> |
||||
<FrameOut2d>2</FrameOut2d> |
||||
<!--三维动画帧数--> |
||||
<FrameOut3d>3</FrameOut3d> |
||||
|
||||
<!--2d透明度变化范围起始值[0,255]--> |
||||
<AlphaBegin2d>60</AlphaBegin2d> |
||||
<!--2d透明度变化范围结束值[0,255]--> |
||||
<AlphaEnd2d>120</AlphaEnd2d> |
||||
<!--透明度变化范围起始值[0,255]--> |
||||
<AlphaBegin3d>180</AlphaBegin3d> |
||||
<!--透明度变化范围结束值[0,255]--> |
||||
<AlphaEnd3d>100</AlphaEnd3d> |
||||
|
||||
</AnimateParam> |
||||
</Xml> |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 108 B |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 175 B |