Commit decc9f27 authored by 曹云霄's avatar 曹云霄

更新pod部分框架、增加体验中心分享自定义标题

parent cfe62063
...@@ -294,49 +294,48 @@ ...@@ -294,49 +294,48 @@
#pragma mark -拍照 #pragma mark -拍照
- (IBAction)TakingPhotoButtonClickAction:(UIButton *)sender { - (IBAction)TakingPhotoButtonClickAction:(UIButton *)sender {
// 判断应用是否有使用相机的权限 // 判断应用是否有使用相机的权限
if(![BaseViewController determineCameraPermissions]){ if([BaseViewController determineCameraPermissions]){
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:nil]];
[self presentViewController:alertVC animated:YES completion:nil];
}else{
sender.selected = YES; sender.selected = YES;
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert];
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init]; UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self; PcCamera.delegate = self;
[DeviceDirectionManager instance].isHorizontal=YES; [DeviceDirectionManager instance].isHorizontal=YES;
[alertView addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { WS(weakSelf);
ShowAlertView(@"请选择", nil, @[@"拍照",@"从相册选择",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
//拍照 //拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera]; [PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES; PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil]; dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
} }
else else
{ {
[XBLoadingView showHUDViewWithText:@"相机无法使用"]; [XBLoadingView showHUDViewWithText:@"相机无法使用"];
sender.selected = NO; sender.selected = NO;
[DeviceDirectionManager instance].isHorizontal=NO;
} }
}]]; }else if (index == ONE) {
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//从相册中选择 //从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; [PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES; PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil]; dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
} }
else else
{ {
[XBLoadingView showHUDViewWithText:@"相册无法打开"]; [XBLoadingView showHUDViewWithText:@"相册无法打开"];
sender.selected = NO; sender.selected = NO;
[DeviceDirectionManager instance].isHorizontal=NO;
} }
}]]; }else {
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { weakSelf.takingPicturesButton.selected = NO;
self.takingPicturesButton.selected = NO; [DeviceDirectionManager instance].isHorizontal=NO;
[alertView dismissViewControllerAnimated:YES completion:nil]; }
}]]; });
[self presentViewController:alertView animated:YES completion:nil];
} }
} }
......
...@@ -25,21 +25,34 @@ ...@@ -25,21 +25,34 @@
} }
#pragma mark -分享 #pragma mark -分享
- (IBAction)ShareWeiChatAntWeiboAction:(UIButton *)sender { - (IBAction)shareWeiChatAntWeiboAction:(UIButton *)sender {
WS(weakSelf); WS(weakSelf);
switch (self.type) { switch (self.type) {
case SHARE_GOODS: case SHARE_GOODS:
{ {
NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5); NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5);
NSString *goodsID = [self.shareID substringToIndex:[self.shareID length]-1]; NSString *goodsID = [self.shareID substringToIndex:[self.shareID length]-1];
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[goodsID substringToIndex:self.shareID.length-1],@"goodsIds",@"",@"title",@"",@"remark",nil]; NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[goodsID substringToIndex:self.shareID.length-1],@"goodsIds",@"",@"title",@"",@"remark",nil];
XBLoadingView *progressView = [XBLoadingView showHUDViewProgressLabel:@"上传图片中"]; XBLoadingView *progressView = [XBLoadingView showHUDViewProgressLabel:@"上传图片中"];
[HTTP uploadImageWithURL:SERVERREQUESTURL(SHARE) withRequestType:ZERO withImageDatas:imageData withParameter:parameterDict withReturnValueBlock:^(id returnValue) { [HTTP uploadImageWithURL:SERVERREQUESTURL(SHARE) withRequestType:ZERO withImageDatas:imageData withParameter:parameterDict withReturnValueBlock:^(id returnValue) {
if (RESULT(returnValue)) { if (RESULT(returnValue)) {
NSString *shareWeb = RESPONSE(returnValue)[@"url"]; NSString *shareWeb = RESPONSE(returnValue)[@"url"];
[self callSharePlatform:shareWeb withPlatformTag:sender]; UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"提示" message:@"请输入分享标题" preferredStyle:UIAlertControllerStyleAlert];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[weakSelf callSharePlatform:shareWeb withPlatformTag:sender customTitle:nil];
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UITextField *textField = [alertView.textFields firstObject];
[weakSelf callSharePlatform:shareWeb withPlatformTag:sender customTitle:textField.text];
}]];
[alertView addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"请输入";
}];
[self presentViewController:alertView animated:YES completion:nil];
}else }else
{ {
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)]; [XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
...@@ -50,7 +63,6 @@ ...@@ -50,7 +63,6 @@
progressView.labelText = @"上传成功"; progressView.labelText = @"上传成功";
[progressView hide:YES]; [progressView hide:YES];
}); });
}else{ }else{
progressView.progress = progress; progressView.progress = progress;
} }
...@@ -69,7 +81,7 @@ ...@@ -69,7 +81,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if (RESULT(returnValue)) { if (RESULT(returnValue)) {
[weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender]; [weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender customTitle:nil];
}else }else
{ {
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)]; [XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
...@@ -89,7 +101,7 @@ ...@@ -89,7 +101,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
if (RESULT(returnValue)) { if (RESULT(returnValue)) {
[weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender]; [weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender customTitle:nil];
}else }else
{ {
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)]; [XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
...@@ -107,7 +119,7 @@ ...@@ -107,7 +119,7 @@
} }
#pragma mark - 调用分享 #pragma mark - 调用分享
- (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender - (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender customTitle:(NSString *)title
{ {
[UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO; [UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;
//创建分享消息对象 //创建分享消息对象
...@@ -117,7 +129,7 @@ ...@@ -117,7 +129,7 @@
switch (self.type) { switch (self.type) {
case SHARE_GOODS: case SHARE_GOODS:
{ {
UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:@"欧立方体验中心一键分享" descr:@"欧立方体验中心一键分享" thumImage:self.shareImage]; UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:[BaseViewController isBlankString:title]?@"欧立方体验中心一键分享":title descr:nil thumImage:self.shareImage];
shareObject.webpageUrl = shareWeb; shareObject.webpageUrl = shareWeb;
messageObject.shareObject = shareObject; messageObject.shareObject = shareObject;
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait"> <device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/> <adaptation id="fullscreen"/>
</device> </device>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state> </state>
<connections> <connections>
<action selector="ShareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="oQJ-kM-Ca6"/> <action selector="shareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="96z-s7-I7F"/>
</connections> </connections>
</button> </button>
<button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nwv-gn-bLJ"> <button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nwv-gn-bLJ">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state> </state>
<connections> <connections>
<action selector="ShareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="uFH-1Q-GMU"/> <action selector="shareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="4Uk-ea-BcA"/>
</connections> </connections>
</button> </button>
<button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="z9x-vh-bIz"> <button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="z9x-vh-bIz">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state> </state>
<connections> <connections>
<action selector="ShareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="IEt-es-A3G"/> <action selector="shareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="VMD-n5-vzJ"/>
</connections> </connections>
</button> </button>
</subviews> </subviews>
......
...@@ -436,7 +436,10 @@ ...@@ -436,7 +436,10 @@
#pragma mark - 删除帖子 #pragma mark - 删除帖子
- (void)delecteClickPostAction - (void)delecteClickPostAction
{ {
ShowDefaultAlertView(nil, @"确认删除此贴吗?", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"确认删除此贴吗?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
WS(weakSelf); WS(weakSelf);
[HTTP networkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(DELETEPOST),self.topicDetail.fid] withRequestType:NetworkRequestWithDELETE withParameter:nil withReturnValueBlock:^(id returnValue) { [HTTP networkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(DELETEPOST),self.topicDetail.fid] withRequestType:NetworkRequestWithDELETE withParameter:nil withReturnValueBlock:^(id returnValue) {
...@@ -456,7 +459,7 @@ ...@@ -456,7 +459,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
}, nil); });
} }
#pragma mark -分享帖子 #pragma mark -分享帖子
......
...@@ -113,11 +113,13 @@ ...@@ -113,11 +113,13 @@
- (void)longPressClickAction:(UILongPressGestureRecognizer *)sender - (void)longPressClickAction:(UILongPressGestureRecognizer *)sender
{ {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(nil, @"是否删除此项?", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"是否删除此项?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
NSInteger index = sender.view.tag; if (index == ONE) {
[weakSelf.imageArray removeObjectAtIndex:index]; return;
}
[weakSelf.imageArray removeObjectAtIndex:sender.view.tag];
[weakSelf.photoManagerCollectionView reloadData]; [weakSelf.photoManagerCollectionView reloadData];
}, nil); });
} }
@end @end
...@@ -233,8 +233,6 @@ ...@@ -233,8 +233,6 @@
}else { }else {
[XBLoadingView showHUDViewWithText:@"相机无法使用"]; [XBLoadingView showHUDViewWithText:@"相机无法使用"];
} }
}else {
ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", nil, @"知道了", UIAlertControllerStyleAlert, nil, nil);
} }
} }
...@@ -358,7 +356,10 @@ ...@@ -358,7 +356,10 @@
[self.view endEditing:YES]; [self.view endEditing:YES];
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(nil, @"确认发表吗?", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"确认发表吗?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
HeadlineTableViewCell *titleCell = [weakSelf.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; HeadlineTableViewCell *titleCell = [weakSelf.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
ContentTableViewCell *contentCell = [weakSelf.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]]; ContentTableViewCell *contentCell = [weakSelf.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
if ([[weakSelf class] isBlankString:titleCell.titleTextField.text]) { if ([[weakSelf class] isBlankString:titleCell.titleTextField.text]) {
...@@ -375,7 +376,7 @@ ...@@ -375,7 +376,7 @@
}else { }else {
[weakSelf submitPost:titleCell.titleTextField.text withContent:contentCell.contentTextView.text withAttachments:nil]; [weakSelf submitPost:titleCell.titleTextField.text withContent:contentCell.contentTextView.text withAttachments:nil];
} }
}, nil); });
} }
#pragma mark - 上传图片附件 #pragma mark - 上传图片附件
......
...@@ -45,11 +45,12 @@ ...@@ -45,11 +45,12 @@
cell.imageView.image = image; cell.imageView.image = image;
WS(weakSelf); WS(weakSelf);
cell.blockDelete = ^{ cell.blockDelete = ^{
ShowAlertView(nil, @"确认删除", @"取消", @"确认", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"确认删除", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
NSLog(@"删除"); if (index == ONE) {
return;
}
[weakSelf.toolView deletePhotoWithIndex:indexPath.row]; [weakSelf.toolView deletePhotoWithIndex:indexPath.row];
}, });
nil);
}; };
return cell; return cell;
} }
......
...@@ -85,7 +85,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) { ...@@ -85,7 +85,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
#pragma mark - 拍照选择照片 #pragma mark - 拍照选择照片
- (void)showCameraAction { - (void)showCameraAction {
if ([BaseViewController determineCameraPermissions]) { if ([BaseViewController determineCameraPermissions]) {
UIImagePickerController *camera = [[UIImagePickerController alloc] init]; UIImagePickerController *camera = [[UIImagePickerController alloc] init];
camera.delegate = self; camera.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
...@@ -95,10 +94,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) { ...@@ -95,10 +94,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
} else { } else {
[XBLoadingView showHUDViewWithText:@"相机无法使用"]; [XBLoadingView showHUDViewWithText:@"相机无法使用"];
} }
} else {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:nil]];
[self.viewController presentViewController:alertVC animated:YES completion:nil];
} }
} }
......
...@@ -112,13 +112,15 @@ ...@@ -112,13 +112,15 @@
self.playItemTotalTimeLabel.text = [NSString stringWithFormat:@"/ %@",[self convertTime:CMTimeGetSeconds(self.playerItem.duration)]]; self.playItemTotalTimeLabel.text = [NSString stringWithFormat:@"/ %@",[self convertTime:CMTimeGetSeconds(self.playerItem.duration)]];
NSInteger second = [self.learningItem.attachment.playTime integerValue]; NSInteger second = [self.learningItem.attachment.playTime integerValue];
NSString *timeString = [self timeFormatted:second]; NSString *timeString = [self timeFormatted:second];
if (![[self class] isBlankString:timeString] && second < (NSInteger)CMTimeGetSeconds(self.playerItem.duration)) { if (![[weakSelf class] isBlankString:timeString] && second < (NSInteger)CMTimeGetSeconds(weakSelf.playerItem.duration)) {
[self stopPlay]; [weakSelf stopPlay];
ShowDefaultAlertView(nil, [NSString stringWithFormat:@"上次播放时间:%@,是否继续播放",timeString], UIAlertControllerStyleAlert, ^{ ShowAlertView(nil, [NSString stringWithFormat:@"上次播放时间:%@,是否继续播放",timeString], @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
[weakSelf.customPlayer seekToTime:CMTimeMake([weakSelf.learningItem.attachment.playTime integerValue], ONE) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero]; if (index == ONE) {
[weakSelf startPlay]; [weakSelf startPlay];
}, ^{ }else {
[weakSelf.customPlayer seekToTime:CMTimeMake([weakSelf.learningItem.attachment.playTime integerValue], ONE) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
[weakSelf startPlay]; [weakSelf startPlay];
}
}); });
} }
break; break;
......
...@@ -327,11 +327,14 @@ ...@@ -327,11 +327,14 @@
- (IBAction)exitButtonClickAction:(UIButton *)sender { - (IBAction)exitButtonClickAction:(UIButton *)sender {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(nil, @"是否退出闯关?", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"是否退出闯关?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
if ([weakSelf.delegate respondsToSelector:@selector(dismissController:)]) { if ([weakSelf.delegate respondsToSelector:@selector(dismissController:)]) {
[weakSelf.delegate dismissController:YES]; [weakSelf.delegate dismissController:YES];
} }
}, nil); });
} }
#pragma mark - 弹出框 #pragma mark - 弹出框
......
...@@ -41,7 +41,10 @@ ...@@ -41,7 +41,10 @@
[XBLoadingView showHUDViewWithText:@"请选择所在区域"];return; [XBLoadingView showHUDViewWithText:@"请选择所在区域"];return;
} }
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(@"提示", @"确认后不可更改,请检查是否正确", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"确认后不可更改,请检查是否正确", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
ToStoreAddress *address = [[ToStoreAddress alloc] init]; ToStoreAddress *address = [[ToStoreAddress alloc] init];
address.resellerid = [Shoppersmanager manager].shoppers.employee.currentDepart.fid; address.resellerid = [Shoppersmanager manager].shoppers.employee.currentDepart.fid;
...@@ -65,7 +68,7 @@ ...@@ -65,7 +68,7 @@
} withFailureBlock:^(NSError *error) { } withFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
}, nil); });
} }
......
...@@ -157,10 +157,13 @@ ...@@ -157,10 +157,13 @@
WS(weakSelf); WS(weakSelf);
TONoticeEntity *entity = self.messageArray[indexPath.row]; TONoticeEntity *entity = self.messageArray[indexPath.row];
if (!entity.readed) { if (!entity.readed) {
ShowDefaultAlertView(nil, @"是否设置为已读", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"是否设置为已读", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
TONoticeEntity *entity = weakSelf.messageArray[indexPath.row]; TONoticeEntity *entity = weakSelf.messageArray[indexPath.row];
[weakSelf readedMessage:entity.fid withIndexPath:indexPath]; [weakSelf readedMessage:entity.fid withIndexPath:indexPath];
}, nil); });
} }
} }
......
...@@ -365,19 +365,13 @@ ...@@ -365,19 +365,13 @@
[XBLoadingView showHUDViewWithText:@"请先设置当前客户"]; [XBLoadingView showHUDViewWithText:@"请先设置当前客户"];
return; return;
} }
// 判断应用是否有使用相机的权限 if([BaseViewController determineCameraPermissions]){
if(![BaseViewController determineCameraPermissions]){
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:nil]];
[self presentViewController:alertVC animated:YES completion:nil];
}else {
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert];
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init]; UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self; PcCamera.delegate = self;
[DeviceDirectionManager instance].isHorizontal=YES; [DeviceDirectionManager instance].isHorizontal=YES;
__weak typeof(self) weakSelf = self; WS(weakSelf);
[alertView addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { ShowAlertView(@"请选择", nil, @[@"拍照",@"从相册选择",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
//拍照 //拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera]; [PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
...@@ -388,10 +382,10 @@ ...@@ -388,10 +382,10 @@
} }
else else
{ {
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相机无法使用"]; [XBLoadingView showHUDViewWithText:@"相机无法使用"];
} }
}]]; }else if (index == ONE) {
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//从相册中选择 //从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; [PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
...@@ -402,14 +396,12 @@ ...@@ -402,14 +396,12 @@
} }
else else
{ {
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相册无法打开"]; [XBLoadingView showHUDViewWithText:@"相册无法打开"];
} }
}]]; }else {
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { [DeviceDirectionManager instance].isHorizontal=NO;
[alertView dismissViewControllerAnimated:YES completion:nil]; }
}]];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:alertView animated:YES completion:nil];
}); });
} }
} }
......
...@@ -540,16 +540,19 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -540,16 +540,19 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
NSString *message = returnValue[@"msg"]; NSString *message = returnValue[@"msg"];
if ([[self class] isBlankString: message]) { if ([[self class] isBlankString: message]) {
NSString *string = [NSString stringWithFormat:@"微信卡劵(%f元)使用成功",weakSelf.weChatModel.wxcardDenomation]; NSString *string = [NSString stringWithFormat:@"微信卡劵(%f元)使用成功",weakSelf.weChatModel.wxcardDenomation];
ShowDefaultAlertView(nil, string, UIAlertControllerStyleAlert,nil,nil); ShowAlertView(@"提示", string, @[@"我知道了"], UIAlertControllerStyleAlert, nil);
}else { }else {
ShowAlertView(@"提示", message, @"我知道了", nil, UIAlertControllerStyleAlert, nil, nil); ShowAlertView(@"提示", message, @[@"我知道了"], UIAlertControllerStyleAlert, nil);
} }
[weakSelf promotionInformationExecutionOrder]; [weakSelf promotionInformationExecutionOrder];
}else{ }else{
ShowDefaultAlertView(nil, [NSString stringWithFormat:@"微信卡劵使用失败:(%@),是否重试?",returnValue[@"msg"]], UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", [NSString stringWithFormat:@"微信卡劵使用失败:(%@),是否重试?",returnValue[@"msg"]], @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
[weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel]; [weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel];
}, ^{ }else {
[weakSelf promotionInformationExecutionOrder]; [weakSelf promotionInformationExecutionOrder];
}
}); });
} }
...@@ -684,11 +687,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -684,11 +687,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
WS(weakSelf); WS(weakSelf);
//判断是否有已抽奖未使用情况 //判断是否有已抽奖未使用情况
if (![[self class] isBlankString:self.customerDrawModel.drawId]) { if (![[self class] isBlankString:self.customerDrawModel.drawId]) {
ShowAlertView(nil, @"您有一个抽奖结果未使用,本次支付会默认使用", nil, @"我知道了", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"您有一个抽奖结果未使用,本次支付会默认使用", @[@"我知道了"], UIAlertControllerStyleAlert, ^(NSInteger index) {
[weakSelf promotionInformationExecutionOrder]; [weakSelf promotionInformationExecutionOrder];
}, nil); });
}else { }else {
ShowAlertView(nil, @"恭喜您获得一次大转盘抽奖机会!", nil, @"马上参与", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"恭喜您获得一次大转盘抽奖机会!", @[@"马上参与"], UIAlertControllerStyleAlert, ^(NSInteger index) {
[weakSelf showLuckyDrawControl:model.lottery.uuid andOrderNumber:weakSelf.orderCode luckyDrawFinish:^(NSDictionary *dict) { [weakSelf showLuckyDrawControl:model.lottery.uuid andOrderNumber:weakSelf.orderCode luckyDrawFinish:^(NSDictionary *dict) {
weakSelf.customerDrawModel = [[PromotionLuckDrawResultModel alloc]initWithDictionary:dict error:nil]; weakSelf.customerDrawModel = [[PromotionLuckDrawResultModel alloc]initWithDictionary:dict error:nil];
if ([BaseViewController isBlankString:weakSelf.customerDrawModel.awardId]) { if ([BaseViewController isBlankString:weakSelf.customerDrawModel.awardId]) {
...@@ -697,7 +700,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -697,7 +700,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[XBLoadingView showHUDViewWithText:[NSString stringWithFormat:@"恭喜你获得了 %@",weakSelf.customerDrawModel.descriptionString]]; [XBLoadingView showHUDViewWithText:[NSString stringWithFormat:@"恭喜你获得了 %@",weakSelf.customerDrawModel.descriptionString]];
} }
}]; }];
}, nil); });
} }
} }
......
...@@ -116,9 +116,12 @@ ...@@ -116,9 +116,12 @@
- (IBAction)dismissPromotionChooseNavigation:(UIBarButtonItem *)sender { - (IBAction)dismissPromotionChooseNavigation:(UIBarButtonItem *)sender {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(nil, @"退出后此单将不在享受促销", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"退出后此单将不在享受促销", @[@"我知道了"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[weakSelf dismissViewControllerAnimated:YES completion:nil]; [weakSelf dismissViewControllerAnimated:YES completion:nil];
}, nil); });
} }
#pragma mark - 确认促销条件选择 #pragma mark - 确认促销条件选择
......
...@@ -314,7 +314,10 @@ ...@@ -314,7 +314,10 @@
- (void)undoOrderButtonClick:(NSInteger)cellindex - (void)undoOrderButtonClick:(NSInteger)cellindex
{ {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(@"提示", @"请确认是否撤销订单", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"请确认是否撤销订单", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
OrderBill *model = [weakSelf.datasArray objectAtIndex_opple:cellindex]; OrderBill *model = [weakSelf.datasArray objectAtIndex_opple:cellindex];
[HTTP networkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),model.order.orderNumber,model.order.orderState,@"005"] withRequestType:ONE withParameter:nil withReturnValueBlock:^(id returnValue) { [HTTP networkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@/%@/%@",SERVERREQUESTURL(RESETORDER),model.order.orderNumber,model.order.orderState,@"005"] withRequestType:ONE withParameter:nil withReturnValueBlock:^(id returnValue) {
...@@ -332,7 +335,7 @@ ...@@ -332,7 +335,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
}, nil); });
} }
......
...@@ -262,9 +262,7 @@ ...@@ -262,9 +262,7 @@
- (void)qrcodeButtonClick { - (void)qrcodeButtonClick {
WS(weakSelf); WS(weakSelf);
// 判断应用是否有使用相机的权限 // 判断应用是否有使用相机的权限
if (![BaseViewController determineCameraPermissions]) { if ([BaseViewController determineCameraPermissions]) {
ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", nil, @"知道了", UIAlertControllerStyleAlert, nil, nil);
} else {
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) { QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[weakSelf dismissViewControllerAnimated:YES [weakSelf dismissViewControllerAnimated:YES
completion:^{ completion:^{
...@@ -330,7 +328,7 @@ ...@@ -330,7 +328,7 @@
{ {
MyclientEntityModel *user = [Customermanager manager].model; MyclientEntityModel *user = [Customermanager manager].model;
if (user == nil) { if (user == nil) {
ShowAlertView(nil, @"请先指定当前客户", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil); ShowAlertView(@"提示", @"请先指定当前客户", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return; return;
} }
LoginResult *shopper = [Shoppersmanager manager].shoppers; LoginResult *shopper = [Shoppersmanager manager].shoppers;
......
...@@ -138,10 +138,10 @@ ...@@ -138,10 +138,10 @@
WS(weakSelf); WS(weakSelf);
TOJingdongEcardEntity *model = self.datasArray[indexPath.row]; TOJingdongEcardEntity *model = self.datasArray[indexPath.row];
if ([[self class] isBlankString:model.orderReceiptUrl]) { if ([[self class] isBlankString:model.orderReceiptUrl]) {
ShowAlertView(nil, @"不能查看未激活卡劵,请先上传小票激活卡劵", nil, @"我知道了", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"不能查看未激活卡劵,请先上传小票激活卡劵", @[@"我知道了"], UIAlertControllerStyleAlert, ^(NSInteger index) {
CardDetailsViewController *cardDetails = [[[weakSelf class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"CardDetailsViewController"]; CardDetailsViewController *cardDetails = [[[weakSelf class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"CardDetailsViewController"];
[weakSelf.navigationController pushViewController:cardDetails animated:YES]; [weakSelf.navigationController pushViewController:cardDetails animated:YES];
}, nil); });
}else if ([model.state isEqualToString:CHECK]){ }else if ([model.state isEqualToString:CHECK]){
[XBLoadingView showHUDViewWithText:@"审核中"]; [XBLoadingView showHUDViewWithText:@"审核中"];
......
...@@ -84,47 +84,44 @@ ...@@ -84,47 +84,44 @@
- (void)userHeaderClickAction:(UITapGestureRecognizer *)tap - (void)userHeaderClickAction:(UITapGestureRecognizer *)tap
{ {
// 判断应用是否有使用相机的权限 // 判断应用是否有使用相机的权限
if(![BaseViewController determineCameraPermissions]){ if([BaseViewController determineCameraPermissions]){
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:@"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机" preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:nil]];
[self presentViewController:alertVC animated:YES completion:nil];
}else{
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert];
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init]; UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self; PcCamera.delegate = self;
[DeviceDirectionManager instance].isHorizontal=YES; [DeviceDirectionManager instance].isHorizontal=YES;
[alertView addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { WS(weakSelf);
ShowAlertView(@"请选择", nil, @[@"拍照",@"从相册选择",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
//拍照 //拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera]; [PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES; PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil]; dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
} }
else else
{ {
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相机无法使用"]; [XBLoadingView showHUDViewWithText:@"相机无法使用"];
[DeviceDirectionManager instance].isHorizontal=NO;
} }
}]]; }else if (index == ONE) {
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//从相册中选择 //从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; [PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES; PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil]; dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
} }
else else
{ {
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相册无法打开"]; [XBLoadingView showHUDViewWithText:@"相册无法打开"];
[DeviceDirectionManager instance].isHorizontal=NO;
} }
}]]; }else {
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[DeviceDirectionManager instance].isHorizontal=NO; [DeviceDirectionManager instance].isHorizontal=NO;
[alertView dismissViewControllerAnimated:YES completion:nil]; }
}]]; });
[self presentViewController:alertView animated:YES completion:nil];
} }
} }
...@@ -210,7 +207,10 @@ ...@@ -210,7 +207,10 @@
- (IBAction)cancellationButtonClick:(UIButton *)sender { - (IBAction)cancellationButtonClick:(UIButton *)sender {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(@"提示", @"切换用户将清空用户数据,是否继续?", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"切换用户将清空用户数据,是否继续?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
//清除极光别名 //清除极光别名
[JPUSHService setTags:nil alias:@"" callbackSelector:nil object:nil]; [JPUSHService setTags:nil alias:@"" callbackSelector:nil object:nil];
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
...@@ -227,13 +227,12 @@ ...@@ -227,13 +227,12 @@
}else }else
{ {
ShowAlertView(nil, @"切换用户失败", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil); ShowAlertView(@"提示", @"切换用户失败", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
} }
} withFailureBlock:^(id error) { } withFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
}]; }];
});
}, nil);
} }
......
...@@ -49,7 +49,10 @@ ...@@ -49,7 +49,10 @@
if ([self includeChinese:self.inputRebateTextField.text]) { if ([self includeChinese:self.inputRebateTextField.text]) {
[XBLoadingView showHUDViewWithText:@"格式不正确"];return; [XBLoadingView showHUDViewWithText:@"格式不正确"];return;
} }
ShowDefaultAlertView(nil, [NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text], UIAlertControllerStyleAlert, ^{ ShowAlertView(nil, [NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text], @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
ApplyRequest *withdrawal = [[ApplyRequest alloc] init]; ApplyRequest *withdrawal = [[ApplyRequest alloc] init];
withdrawal.amount = [NSNumber numberWithFloat:[weakSelf.inputRebateTextField.text floatValue]]; withdrawal.amount = [NSNumber numberWithFloat:[weakSelf.inputRebateTextField.text floatValue]];
...@@ -69,7 +72,7 @@ ...@@ -69,7 +72,7 @@
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription]; [XBLoadingView showHUDViewWithText:error.localizedDescription];
}]; }];
}, nil); });
} }
#pragma mark - 提现申请成功 #pragma mark - 提现申请成功
......
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
- (IBAction)withdrawalButtonClickAction:(UIButton *)sender { - (IBAction)withdrawalButtonClickAction:(UIButton *)sender {
if (!self.resultEntity.isUsable && sender.tag == 101) { if (!self.resultEntity.isUsable && sender.tag == 101) {
ShowAlertView(@"提示", self.resultEntity.showApplyMessage, nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil); ShowAlertView(@"提示", self.resultEntity.showApplyMessage, @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return; return;
} }
if (!self.resultEntity.bankCards.count && sender.tag == 101) { if (!self.resultEntity.bankCards.count && sender.tag == 101) {
......
...@@ -7,6 +7,9 @@ GEM ...@@ -7,6 +7,9 @@ GEM
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
babosa (1.0.2)
claide (1.0.2) claide (1.0.2)
cocoapods (1.2.1) cocoapods (1.2.1)
activesupport (>= 4.0.2, < 5) activesupport (>= 4.0.2, < 5)
...@@ -41,32 +44,147 @@ GEM ...@@ -41,32 +44,147 @@ GEM
nap (>= 0.8, < 2.0) nap (>= 0.8, < 2.0)
netrc (= 0.7.8) netrc (= 0.7.8)
cocoapods-try (1.1.0) cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2) colored2 (3.1.2)
commander-fastlane (4.4.4)
highline (~> 1.7.2)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
escape (0.0.4) escape (0.0.4)
excon (0.56.0)
faraday (0.12.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.11.0.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.0)
fastlane (2.37.0)
CFPropertyList (>= 2.3, < 3.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0)
colored
commander-fastlane (>= 4.4.0, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
fastimage (>= 1.6)
gh_inspector (>= 1.0.1, < 2.0.0)
google-api-client (~> 0.9.2)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
mini_magick (~> 4.5.1)
multi_json
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 1.1.0, < 2.0.0)
security (= 0.1.3)
slack-notifier (>= 1.3, < 2.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (~> 0.5.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.4.4, < 2.0.0)
xcpretty (>= 0.2.4, < 1.0.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-pgyer (0.2.1)
fourflusher (2.0.1) fourflusher (2.0.1)
fuzzy_match (2.0.4) fuzzy_match (2.0.4)
gh_inspector (1.0.3) gh_inspector (1.0.3)
google-api-client (0.9.28)
addressable (~> 2.3)
googleauth (~> 0.5)
httpclient (~> 2.7)
hurley (~> 0.1)
memoist (~> 0.11)
mime-types (>= 1.6)
representable (~> 2.3.0)
retriable (~> 2.0)
googleauth (0.5.1)
faraday (~> 0.9)
jwt (~> 1.4)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
os (~> 0.9)
signet (~> 0.7)
highline (1.7.8)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
hurley (0.2)
i18n (0.8.4) i18n (0.8.4)
json (2.1.0)
jwt (1.5.6)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
memoist (0.15.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
minitest (5.10.2) minitest (5.10.2)
molinillo (0.5.7) molinillo (0.5.7)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.3) nanaimo (0.2.3)
nap (1.1.0) nap (1.1.0)
netrc (0.7.8) netrc (0.7.8)
os (0.9.6)
plist (3.3.0)
public_suffix (2.0.5)
representable (2.3.0)
uber (~> 0.0.7)
retriable (2.1.0)
rouge (2.0.7)
ruby-macho (1.1.0) ruby-macho (1.1.0)
rubyzip (1.2.1)
security (0.1.3)
signet (0.7.3)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (~> 1.5)
multi_json (~> 1.10)
slack-notifier (1.5.1)
terminal-notifier (1.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6) thread_safe (0.3.6)
tty-screen (0.5.0)
tzinfo (1.2.3) tzinfo (1.2.3)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uber (0.0.15)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unicode-display_width (1.2.1)
word_wrap (1.0.0)
xcodeproj (1.5.0) xcodeproj (1.5.0)
CFPropertyList (~> 2.3.3) CFPropertyList (~> 2.3.3)
claide (>= 1.0.2, < 2.0) claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1) colored2 (~> 3.1)
nanaimo (~> 0.2.3) nanaimo (~> 0.2.3)
xcpretty (0.2.8)
rouge (~> 2.0.7)
xcpretty-travis-formatter (0.0.4)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
cocoapods cocoapods
fastlane
fastlane-plugin-pgyer
BUNDLED WITH BUNDLED WITH
1.15.1 1.15.1
...@@ -50,7 +50,7 @@ PODS: ...@@ -50,7 +50,7 @@ PODS:
- SDWebImage/Core (= 3.8.2) - SDWebImage/Core (= 3.8.2)
- SDWebImage/Core (3.8.2) - SDWebImage/Core (3.8.2)
- UICountingLabel (1.2.0) - UICountingLabel (1.2.0)
- UITableView+FDTemplateLayoutCell (1.5.beta) - UITableView+FDTemplateLayoutCell (1.6)
- UMengAnalytics (4.2.4) - UMengAnalytics (4.2.4)
- UMengUShare/Core (6.4.1): - UMengUShare/Core (6.4.1):
- UMengUShare/Network - UMengUShare/Network
...@@ -61,7 +61,7 @@ PODS: ...@@ -61,7 +61,7 @@ PODS:
- UMengUShare/Core - UMengUShare/Core
- WYPopoverController (0.3.9) - WYPopoverController (0.3.9)
- WZLBadge (1.2.5) - WZLBadge (1.2.5)
- YXAlertController (1.0.2) - YXAlertController (1.0.7)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
...@@ -80,17 +80,17 @@ DEPENDENCIES: ...@@ -80,17 +80,17 @@ DEPENDENCIES:
- MWPhotoBrowser (~> 2.1.2) - MWPhotoBrowser (~> 2.1.2)
- PNChart (~> 0.8.9) - PNChart (~> 0.8.9)
- SDWebImage - SDWebImage
- UITableView+FDTemplateLayoutCell (~> 1.5.beta) - UITableView+FDTemplateLayoutCell (~> 1.6)
- UMengAnalytics - UMengAnalytics
- UMengUShare/Social/ReducedSina - UMengUShare/Social/ReducedSina
- UMengUShare/Social/ReducedWeChat - UMengUShare/Social/ReducedWeChat
- WYPopoverController (~> 0.3.9) - WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5) - WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.2) - YXAlertController (~> 1.0.7)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AliyunOSSiOS: 058b038cc82000dadb8f8e3893a97243124f2898 AliyunOSSiOS: '058b038cc82000dadb8f8e3893a97243124f2898'
Bugly: 2c256069145f550171907c5cb1c0f84ad291f6c1 Bugly: 2c256069145f550171907c5cb1c0f84ad291f6c1
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71 DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
...@@ -106,15 +106,15 @@ SPEC CHECKSUMS: ...@@ -106,15 +106,15 @@ SPEC CHECKSUMS:
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0 MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5 MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5
PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2 PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2
SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c'
UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa
UITableView+FDTemplateLayoutCell: 02b508ab1cb4cea16a8c17ac83d2cd1fd72124f9 UITableView+FDTemplateLayoutCell: 5c949b4a5059c404b442926c0e80f81d10a2d66f
UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2 UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2
UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4 WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac
YXAlertController: 8ca2722656d975858263b62c8ae0328c09005535 YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
PODFILE CHECKSUM: 91aa6880ad838660fc2adc77a00cb4d4cbd40356 PODFILE CHECKSUM: 4b56e3ba89ba6d8693f5d5775770671ed0c82ac3
COCOAPODS: 1.2.1 COCOAPODS: 1.2.1
...@@ -50,7 +50,7 @@ PODS: ...@@ -50,7 +50,7 @@ PODS:
- SDWebImage/Core (= 3.8.2) - SDWebImage/Core (= 3.8.2)
- SDWebImage/Core (3.8.2) - SDWebImage/Core (3.8.2)
- UICountingLabel (1.2.0) - UICountingLabel (1.2.0)
- UITableView+FDTemplateLayoutCell (1.5.beta) - UITableView+FDTemplateLayoutCell (1.6)
- UMengAnalytics (4.2.4) - UMengAnalytics (4.2.4)
- UMengUShare/Core (6.4.1): - UMengUShare/Core (6.4.1):
- UMengUShare/Network - UMengUShare/Network
...@@ -61,7 +61,7 @@ PODS: ...@@ -61,7 +61,7 @@ PODS:
- UMengUShare/Core - UMengUShare/Core
- WYPopoverController (0.3.9) - WYPopoverController (0.3.9)
- WZLBadge (1.2.5) - WZLBadge (1.2.5)
- YXAlertController (1.0.2) - YXAlertController (1.0.7)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
...@@ -80,17 +80,17 @@ DEPENDENCIES: ...@@ -80,17 +80,17 @@ DEPENDENCIES:
- MWPhotoBrowser (~> 2.1.2) - MWPhotoBrowser (~> 2.1.2)
- PNChart (~> 0.8.9) - PNChart (~> 0.8.9)
- SDWebImage - SDWebImage
- UITableView+FDTemplateLayoutCell (~> 1.5.beta) - UITableView+FDTemplateLayoutCell (~> 1.6)
- UMengAnalytics - UMengAnalytics
- UMengUShare/Social/ReducedSina - UMengUShare/Social/ReducedSina
- UMengUShare/Social/ReducedWeChat - UMengUShare/Social/ReducedWeChat
- WYPopoverController (~> 0.3.9) - WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5) - WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.2) - YXAlertController (~> 1.0.7)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AliyunOSSiOS: 058b038cc82000dadb8f8e3893a97243124f2898 AliyunOSSiOS: '058b038cc82000dadb8f8e3893a97243124f2898'
Bugly: 2c256069145f550171907c5cb1c0f84ad291f6c1 Bugly: 2c256069145f550171907c5cb1c0f84ad291f6c1
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71 DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
...@@ -106,15 +106,15 @@ SPEC CHECKSUMS: ...@@ -106,15 +106,15 @@ SPEC CHECKSUMS:
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0 MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5 MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5
PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2 PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2
SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c'
UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa
UITableView+FDTemplateLayoutCell: 02b508ab1cb4cea16a8c17ac83d2cd1fd72124f9 UITableView+FDTemplateLayoutCell: 5c949b4a5059c404b442926c0e80f81d10a2d66f
UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2 UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2
UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4 WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac
YXAlertController: 8ca2722656d975858263b62c8ae0328c09005535 YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
PODFILE CHECKSUM: 91aa6880ad838660fc2adc77a00cb4d4cbd40356 PODFILE CHECKSUM: 4b56e3ba89ba6d8693f5d5775770671ed0c82ac3
COCOAPODS: 1.2.1 COCOAPODS: 1.2.1
...@@ -121,7 +121,6 @@ typedef NSMutableArray<NSMutableArray<NSNumber *> *> FDIndexPathHeightsBySection ...@@ -121,7 +121,6 @@ typedef NSMutableArray<NSMutableArray<NSNumber *> *> FDIndexPathHeightsBySection
- (FDIndexPathHeightCache *)fd_indexPathHeightCache { - (FDIndexPathHeightCache *)fd_indexPathHeightCache {
FDIndexPathHeightCache *cache = objc_getAssociatedObject(self, _cmd); FDIndexPathHeightCache *cache = objc_getAssociatedObject(self, _cmd);
if (!cache) { if (!cache) {
[self methodSignatureForSelector:nil];
cache = [FDIndexPathHeightCache new]; cache = [FDIndexPathHeightCache new];
objc_setAssociatedObject(self, _cmd, cache, OBJC_ASSOCIATION_RETAIN_NONATOMIC); objc_setAssociatedObject(self, _cmd, cache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
} }
......
...@@ -57,11 +57,38 @@ ...@@ -57,11 +57,38 @@
// Add a hard width constraint to make dynamic content views (like labels) expand vertically instead // Add a hard width constraint to make dynamic content views (like labels) expand vertically instead
// of growing horizontally, in a flow-layout manner. // of growing horizontally, in a flow-layout manner.
NSLayoutConstraint *widthFenceConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:contentViewWidth]; NSLayoutConstraint *widthFenceConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:contentViewWidth];
// [bug fix] after iOS 10.3, Auto Layout engine will add an additional 0 width constraint onto cell's content view, to avoid that, we add constraints to content view's left, right, top and bottom.
static BOOL isSystemVersionEqualOrGreaterThen10_2 = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
isSystemVersionEqualOrGreaterThen10_2 = [UIDevice.currentDevice.systemVersion compare:@"10.2" options:NSNumericSearch] != NSOrderedAscending;
});
NSArray<NSLayoutConstraint *> *edgeConstraints;
if (isSystemVersionEqualOrGreaterThen10_2) {
// To avoid confilicts, make width constraint softer than required (1000)
widthFenceConstraint.priority = UILayoutPriorityRequired - 1;
// Build edge constraints
NSLayoutConstraint *leftConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
NSLayoutConstraint *rightConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
edgeConstraints = @[leftConstraint, rightConstraint, topConstraint, bottomConstraint];
[cell addConstraints:edgeConstraints];
}
[cell.contentView addConstraint:widthFenceConstraint]; [cell.contentView addConstraint:widthFenceConstraint];
// Auto layout engine does its math // Auto layout engine does its math
fittingHeight = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height; fittingHeight = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
// Clean-ups
[cell.contentView removeConstraint:widthFenceConstraint]; [cell.contentView removeConstraint:widthFenceConstraint];
if (isSystemVersionEqualOrGreaterThen10_2) {
[cell removeConstraints:edgeConstraints];
}
[self fd_debugLog:[NSString stringWithFormat:@"calculate using system fitting size (AutoLayout) - %@", @(fittingHeight)]]; [self fd_debugLog:[NSString stringWithFormat:@"calculate using system fitting size (AutoLayout) - %@", @(fittingHeight)]];
} }
......
...@@ -115,7 +115,7 @@ A template layout cell is created by `-dequeueReusableCellWithIdentifier:` metho ...@@ -115,7 +115,7 @@ A template layout cell is created by `-dequeueReusableCellWithIdentifier:` metho
## Installation ## Installation
Latest version: **1.4.beta** Latest version: **1.6**
``` ```
pod search UITableView+FDTemplateLayoutCell pod search UITableView+FDTemplateLayoutCell
...@@ -130,6 +130,9 @@ pod setup ...@@ -130,6 +130,9 @@ pod setup
We recommend to use the latest release in cocoapods. We recommend to use the latest release in cocoapods.
- 1.6
fix bug in iOS 10
- 1.4 - 1.4
Refactor, add "cacheByKey" mode, bug fixed Refactor, add "cacheByKey" mode, bug fixed
...@@ -147,3 +150,5 @@ Basic automatically height calculation ...@@ -147,3 +150,5 @@ Basic automatically height calculation
## License ## License
MIT MIT
# YXAlertController # 欢迎使用 YXAlertController
\ No newline at end of file
------
> * pod 'YXAlertController', '~> 1.0.2’
ShowAlertView(@"提示", @"你好,欢迎使用YXAlertController", @"取消", @"确认", UIAlertControllerStyleAlert, ^{
}, ^{
});
ShowDefaultAlertView(@"提示", @"你好,欢迎使用YXAlertController", UIAlertControllerStyleAlert, nil, nil);
...@@ -16,28 +16,26 @@ ...@@ -16,28 +16,26 @@
@interface YXAlertController : UIAlertController @interface YXAlertController : UIAlertController
/** /**
默认提示选择框 提示选择框
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param menuArray 菜单title Array
@param style 风格 @param style 风格
@param completed 确定回调 @param completed 完成回调
@param canceled 取消回调
*/ */
extern void ShowDefaultAlertView(NSString *title,NSString *message,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()); extern void ShowAlertView(NSString *title,NSString *message,NSArray *menuArray,UIAlertControllerStyle style,void(^completed)(NSInteger index));
/** /**
提示选择 输入
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param cancelTitle 取消按钮 @param menuArray 菜单title Array
@param DefaultTitle 确认按钮 @param placeholderArray 输入框占位符 Array
@param style 风格 @param completed 完成回调
@param completed 确定回调
@param canceled 取消回调
*/ */
extern void ShowAlertView(NSString *title,NSString *message,NSString *cancelTitle,NSString *DefaultTitle,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()); extern void ShowTextFieldAlertView(NSString *title,NSString *message,NSArray *menuArray,NSArray *placeholderArray,void(^completed)(NSInteger index,NSArray <UITextField *>*inputArray));
@end @end
...@@ -22,66 +22,77 @@ ...@@ -22,66 +22,77 @@
*/ */
UIAlertController *BaseAlert(NSString *title,NSString *message,UIAlertControllerStyle style) { UIAlertController *BaseAlert(NSString *title,NSString *message,UIAlertControllerStyle style) {
UIAlertController *alertContr = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alertContr = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:style];
return alertContr; return alertContr;
} }
/** /**
默认提示选择框 提示选择框
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param menuArray 菜单title Array
@param style 风格 @param style 风格
@param completed 确定回调 @param completed 完成回调
@param canceled 取消回调
*/ */
void ShowDefaultAlertView(NSString *title,NSString *message,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()) { void ShowAlertView(NSString *title,NSString *message,NSArray *menuArray,UIAlertControllerStyle style,void(^completed)(NSInteger index)) {
UIAlertController *alert = BaseAlert(title, message, style); UIAlertController *alert = BaseAlert(title, message, style);
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { for (int i=0; i<menuArray.count; i++) {
if (canceled) { NSString *menuTitle = menuArray[i];
canceled(); if (i == menuArray.count - 1) {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed([menuArray indexOfObject:action.title]);
} }
}]]; }]];
[alert addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }else {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (completed) { if (completed) {
completed(); completed([menuArray indexOfObject:action.title]);
} }
}]]; }]];
}
}
[AppRootViewController() presentViewController:alert animated:YES completion:nil]; [AppRootViewController() presentViewController:alert animated:YES completion:nil];
} }
/** /**
提示选择 输入
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param cancelTitle 取消按钮 @param menuArray 菜单title Array
@param DefaultTitle 确认按钮 @param placeholderArray 输入框占位符 Array
@param style 风格 @param completed 完成回调
@param completed 确定回调
@param canceled 取消回调
*/ */
void ShowAlertView(NSString *title,NSString *message,NSString *cancelTitle,NSString *DefaultTitle,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()) { void ShowTextFieldAlertView(NSString *title,NSString *message,NSArray *menuArray,NSArray *placeholderArray,void(^completed)(NSInteger index,NSArray <UITextField *>*inputArray)) {
UIAlertController *alert = BaseAlert(title, message, style); UIAlertController *alert = BaseAlert(title, message, UIAlertControllerStyleAlert);
if (cancelTitle) { for (int i=0; i<placeholderArray.count; i++) {
[alert addAction:[UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { NSString *placeholder = placeholderArray[i];
if (canceled) { [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
canceled(); textField.placeholder = placeholder;
}];
} }
}]]; for (int i=0; i<menuArray.count; i++) {
NSString *menuTitle = menuArray[i];
if (i == placeholderArray.count - 1) {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed([menuArray indexOfObject:action.title],alert.textFields);
} }
if (DefaultTitle) { }]];
[alert addAction:[UIAlertAction actionWithTitle:DefaultTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }else {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (completed) { if (completed) {
completed(); completed([menuArray indexOfObject:action.title],alert.textFields);
} }
}]]; }]];
} }
}
[AppRootViewController() presentViewController:alert animated:YES completion:nil]; [AppRootViewController() presentViewController:alert animated:YES completion:nil];
} }
......
...@@ -108,12 +108,12 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) { ...@@ -108,12 +108,12 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
/** /**
* 服务器测试地址 * 服务器测试地址
*/ */
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL] //#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//** //**
// * 服务器正式地址 // * 服务器正式地址
// */ // */
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL] #define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
// //
/*****************************************接口地址*****************************************/ /*****************************************接口地址*****************************************/
......
...@@ -22,13 +22,6 @@ ...@@ -22,13 +22,6 @@
loadingView.color = kMainBlueColor; loadingView.color = kMainBlueColor;
loadingView.hidesWhenStopped = YES; loadingView.hidesWhenStopped = YES;
[loadingView startAnimating]; [loadingView startAnimating];
// XBLoadingView *hud = [XBLoadingView showHUDAddedTo:[self hudShowWindow] animated:YES];
// hud.animationType = MBProgressHUDAnimationZoom;
// hud.mode = MBProgressHUDModeIndeterminate;
// hud.color = [UIColor clearColor];
// hud.activityIndicatorColor = kMainBlueColor;
// hud.removeFromSuperViewOnHide = YES;
} }
/** /**
...@@ -36,13 +29,6 @@ ...@@ -36,13 +29,6 @@
*/ */
+ (void)showHUDViewWithDefaultWithView:(UIView *)view + (void)showHUDViewWithDefaultWithView:(UIView *)view
{ {
// XBLoadingView *hud = [XBLoadingView showHUDAddedTo:view animated:YES];
// hud.animationType = MBProgressHUDAnimationZoom;
// hud.mode = MBProgressHUDModeIndeterminate;
// hud.color = [UIColor clearColor];
// hud.activityIndicatorColor = kMainBlueColor;
// hud.removeFromSuperViewOnHide = YES;
UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
loadingView.frame = view.bounds; loadingView.frame = view.bounds;
[view addSubview:loadingView]; [view addSubview:loadingView];
......
...@@ -145,8 +145,7 @@ ...@@ -145,8 +145,7 @@
[UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO; [UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;
[[UMSocialManager defaultManager] shareToPlatform:UMSocialPlatformType_WechatTimeLine messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) { [[UMSocialManager defaultManager] shareToPlatform:UMSocialPlatformType_WechatTimeLine messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
if (error) { if (error) {
NSLog(@"************Share fail with error %@*********",error); ShowAlertView(@"提示", @"分享失败", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
ShowDefaultAlertView(nil, @"分享失败", UIAlertControllerStyleAlert, nil, nil);
}else{ }else{
[XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功" completeBlock:nil]; [XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功" completeBlock:nil];
} }
...@@ -197,11 +196,14 @@ ...@@ -197,11 +196,14 @@
CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset; CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset;
WS(weakSelf); WS(weakSelf);
if (distanceFromBottom <= height && self.type == Study) { if (distanceFromBottom <= height && self.type == Study) {
ShowDefaultAlertView(nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{ ShowAlertView(@"提示", @"学习完成,是否开始考核?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
if (weakSelf.scrollViewEndBottomBlock) { if (weakSelf.scrollViewEndBottomBlock) {
weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath); weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath);
} }
}, nil); });
} }
} }
......
...@@ -201,7 +201,9 @@ ...@@ -201,7 +201,9 @@
NSString *mediaType = AVMediaTypeVideo;//读取媒体类型 NSString *mediaType = AVMediaTypeVideo;//读取媒体类型
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态 AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){ if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return NO; return NO;
}else { }else {
return YES; return YES;
} }
......
...@@ -21,8 +21,8 @@ target 'Lighting' do ...@@ -21,8 +21,8 @@ target 'Lighting' do
pod 'PNChart', '~> 0.8.9' pod 'PNChart', '~> 0.8.9'
pod 'JPush', '~> 3.0.1' pod 'JPush', '~> 3.0.1'
pod 'WZLBadge', '~> 1.2.5' pod 'WZLBadge', '~> 1.2.5'
pod 'UITableView+FDTemplateLayoutCell', '~> 1.5.beta' pod 'UITableView+FDTemplateLayoutCell', '~> 1.6'
pod 'YXAlertController', '~> 1.0.2' pod 'YXAlertController', '~> 1.0.7'
pod 'iCarousel', '~> 1.8.3' pod 'iCarousel', '~> 1.8.3'
pod 'UMengAnalytics' pod 'UMengAnalytics'
pod 'Bugly', '~> 2.4.7' pod 'Bugly', '~> 2.4.7'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment