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

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

parent cfe62063
......@@ -294,49 +294,48 @@
#pragma mark -拍照
- (IBAction)TakingPhotoButtonClickAction:(UIButton *)sender {
// 判断应用是否有使用相机的权限
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{
if([BaseViewController determineCameraPermissions]){
sender.selected = YES;
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleAlert];
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self;
[DeviceDirectionManager instance].isHorizontal=YES;
[alertView addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil];
}
else
{
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
sender.selected = NO;
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil];
}
else
{
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
sender.selected = NO;
WS(weakSelf);
ShowAlertView(@"请选择", nil, @[@"拍照",@"从相册选择",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
//拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
sender.selected = NO;
[DeviceDirectionManager instance].isHorizontal=NO;
}
}else if (index == ONE) {
//从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
sender.selected = NO;
[DeviceDirectionManager instance].isHorizontal=NO;
}
}else {
weakSelf.takingPicturesButton.selected = NO;
[DeviceDirectionManager instance].isHorizontal=NO;
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
self.takingPicturesButton.selected = NO;
[alertView dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alertView animated:YES completion:nil];
});
}
}
......
......@@ -25,21 +25,34 @@
}
#pragma mark -分享
- (IBAction)ShareWeiChatAntWeiboAction:(UIButton *)sender {
- (IBAction)shareWeiChatAntWeiboAction:(UIButton *)sender {
WS(weakSelf);
switch (self.type) {
case SHARE_GOODS:
{
NSData *imageData = UIImageJPEGRepresentation(self.shareImage, 0.5);
NSString *goodsID = [self.shareID substringToIndex:[self.shareID length]-1];
NSDictionary *parameterDict = [NSDictionary dictionaryWithObjectsAndKeys:[goodsID substringToIndex:self.shareID.length-1],@"goodsIds",@"",@"title",@"",@"remark",nil];
XBLoadingView *progressView = [XBLoadingView showHUDViewProgressLabel:@"上传图片中"];
[HTTP uploadImageWithURL:SERVERREQUESTURL(SHARE) withRequestType:ZERO withImageDatas:imageData withParameter:parameterDict withReturnValueBlock:^(id returnValue) {
if (RESULT(returnValue)) {
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
{
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
......@@ -50,7 +63,6 @@
progressView.labelText = @"上传成功";
[progressView hide:YES];
});
}else{
progressView.progress = progress;
}
......@@ -69,7 +81,7 @@
[XBLoadingView hideHUDViewWithDefault];
if (RESULT(returnValue)) {
[weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender];
[weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender customTitle:nil];
}else
{
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
......@@ -89,7 +101,7 @@
[XBLoadingView hideHUDViewWithDefault];
if (RESULT(returnValue)) {
[weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender];
[weakSelf callSharePlatform:RESPONSE(returnValue)[@"url"] withPlatformTag:sender customTitle:nil];
}else
{
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
......@@ -107,7 +119,7 @@
}
#pragma mark - 调用分享
- (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender
- (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender customTitle:(NSString *)title
{
[UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;
//创建分享消息对象
......@@ -117,7 +129,7 @@
switch (self.type) {
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;
messageObject.shareObject = shareObject;
}
......
<?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">
<adaptation id="fullscreen"/>
</device>
......@@ -27,7 +27,7 @@
<color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="ShareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="oQJ-kM-Ca6"/>
<action selector="shareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="96z-s7-I7F"/>
</connections>
</button>
<button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nwv-gn-bLJ">
......@@ -39,7 +39,7 @@
<color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="ShareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="uFH-1Q-GMU"/>
<action selector="shareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="4Uk-ea-BcA"/>
</connections>
</button>
<button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="z9x-vh-bIz">
......@@ -51,7 +51,7 @@
<color key="titleColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="ShareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="IEt-es-A3G"/>
<action selector="shareWeiChatAntWeiboAction:" destination="-1" eventType="touchUpInside" id="VMD-n5-vzJ"/>
</connections>
</button>
</subviews>
......
......@@ -436,7 +436,10 @@
#pragma mark - 删除帖子
- (void)delecteClickPostAction
{
ShowDefaultAlertView(nil, @"确认删除此贴吗?", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"确认删除此贴吗?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
[HTTP networkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(DELETEPOST),self.topicDetail.fid] withRequestType:NetworkRequestWithDELETE withParameter:nil withReturnValueBlock:^(id returnValue) {
......@@ -456,7 +459,7 @@
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}, nil);
});
}
#pragma mark -分享帖子
......
......@@ -113,11 +113,13 @@
- (void)longPressClickAction:(UILongPressGestureRecognizer *)sender
{
WS(weakSelf);
ShowDefaultAlertView(nil, @"是否删除此项?", UIAlertControllerStyleAlert, ^{
NSInteger index = sender.view.tag;
[weakSelf.imageArray removeObjectAtIndex:index];
ShowAlertView(@"提示", @"是否删除此项?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[weakSelf.imageArray removeObjectAtIndex:sender.view.tag];
[weakSelf.photoManagerCollectionView reloadData];
}, nil);
});
}
@end
......@@ -233,8 +233,6 @@
}else {
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
}else {
ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", nil, @"知道了", UIAlertControllerStyleAlert, nil, nil);
}
}
......@@ -358,7 +356,10 @@
[self.view endEditing:YES];
WS(weakSelf);
ShowDefaultAlertView(nil, @"确认发表吗?", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"确认发表吗?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
HeadlineTableViewCell *titleCell = [weakSelf.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
ContentTableViewCell *contentCell = [weakSelf.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
if ([[weakSelf class] isBlankString:titleCell.titleTextField.text]) {
......@@ -375,7 +376,7 @@
}else {
[weakSelf submitPost:titleCell.titleTextField.text withContent:contentCell.contentTextView.text withAttachments:nil];
}
}, nil);
});
}
#pragma mark - 上传图片附件
......
......@@ -45,11 +45,12 @@
cell.imageView.image = image;
WS(weakSelf);
cell.blockDelete = ^{
ShowAlertView(nil, @"确认删除", @"取消", @"确认", UIAlertControllerStyleAlert, ^{
NSLog(@"删除");
ShowAlertView(@"提示", @"确认删除", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[weakSelf.toolView deletePhotoWithIndex:indexPath.row];
},
nil);
});
};
return cell;
}
......
......@@ -85,7 +85,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
#pragma mark - 拍照选择照片
- (void)showCameraAction {
if ([BaseViewController determineCameraPermissions]) {
UIImagePickerController *camera = [[UIImagePickerController alloc] init];
camera.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
......@@ -95,10 +94,6 @@ typedef NS_ENUM(NSInteger, ItemIndex) {
} else {
[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 @@
self.playItemTotalTimeLabel.text = [NSString stringWithFormat:@"/ %@",[self convertTime:CMTimeGetSeconds(self.playerItem.duration)]];
NSInteger second = [self.learningItem.attachment.playTime integerValue];
NSString *timeString = [self timeFormatted:second];
if (![[self class] isBlankString:timeString] && second < (NSInteger)CMTimeGetSeconds(self.playerItem.duration)) {
[self stopPlay];
ShowDefaultAlertView(nil, [NSString stringWithFormat:@"上次播放时间:%@,是否继续播放",timeString], UIAlertControllerStyleAlert, ^{
[weakSelf.customPlayer seekToTime:CMTimeMake([weakSelf.learningItem.attachment.playTime integerValue], ONE) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
[weakSelf startPlay];
}, ^{
[weakSelf startPlay];
if (![[weakSelf class] isBlankString:timeString] && second < (NSInteger)CMTimeGetSeconds(weakSelf.playerItem.duration)) {
[weakSelf stopPlay];
ShowAlertView(nil, [NSString stringWithFormat:@"上次播放时间:%@,是否继续播放",timeString], @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
[weakSelf startPlay];
}else {
[weakSelf.customPlayer seekToTime:CMTimeMake([weakSelf.learningItem.attachment.playTime integerValue], ONE) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
[weakSelf startPlay];
}
});
}
break;
......
......@@ -327,11 +327,14 @@
- (IBAction)exitButtonClickAction:(UIButton *)sender {
WS(weakSelf);
ShowDefaultAlertView(nil, @"是否退出闯关?", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"是否退出闯关?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
if ([weakSelf.delegate respondsToSelector:@selector(dismissController:)]) {
[weakSelf.delegate dismissController:YES];
}
}, nil);
});
}
#pragma mark - 弹出框
......
......@@ -41,7 +41,10 @@
[XBLoadingView showHUDViewWithText:@"请选择所在区域"];return;
}
WS(weakSelf);
ShowDefaultAlertView(@"提示", @"确认后不可更改,请检查是否正确", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"确认后不可更改,请检查是否正确", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault];
ToStoreAddress *address = [[ToStoreAddress alloc] init];
address.resellerid = [Shoppersmanager manager].shoppers.employee.currentDepart.fid;
......@@ -57,7 +60,7 @@
[XBLoadingView showHUDViewWithSuccessText:@"保存成功" completeBlock:^{
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}];
}else {
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
}
......@@ -65,7 +68,7 @@
} withFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}, nil);
});
}
......
......@@ -157,10 +157,13 @@
WS(weakSelf);
TONoticeEntity *entity = self.messageArray[indexPath.row];
if (!entity.readed) {
ShowDefaultAlertView(nil, @"是否设置为已读", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"是否设置为已读", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
TONoticeEntity *entity = weakSelf.messageArray[indexPath.row];
[weakSelf readedMessage:entity.fid withIndexPath:indexPath];
}, nil);
});
}
}
......
......@@ -365,51 +365,43 @@
[XBLoadingView showHUDViewWithText:@"请先设置当前客户"];
return;
}
// 判断应用是否有使用相机的权限
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];
if([BaseViewController determineCameraPermissions]){
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self;
[DeviceDirectionManager instance].isHorizontal=YES;
__weak typeof(self) weakSelf = self;
[alertView addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
WS(weakSelf);
ShowAlertView(@"请选择", nil, @[@"拍照",@"从相册选择",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
//拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
}else if (index == ONE) {
//从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
}
}else {
[DeviceDirectionManager instance].isHorizontal=NO;
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[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 = @"促销信息";
NSString *message = returnValue[@"msg"];
if ([[self class] isBlankString: message]) {
NSString *string = [NSString stringWithFormat:@"微信卡劵(%f元)使用成功",weakSelf.weChatModel.wxcardDenomation];
ShowDefaultAlertView(nil, string, UIAlertControllerStyleAlert,nil,nil);
ShowAlertView(@"提示", string, @[@"我知道了"], UIAlertControllerStyleAlert, nil);
}else {
ShowAlertView(@"提示", message, @"我知道了", nil, UIAlertControllerStyleAlert, nil, nil);
ShowAlertView(@"提示", message, @[@"我知道了"], UIAlertControllerStyleAlert, nil);
}
[weakSelf promotionInformationExecutionOrder];
}else{
ShowDefaultAlertView(nil, [NSString stringWithFormat:@"微信卡劵使用失败:(%@),是否重试?",returnValue[@"msg"]], UIAlertControllerStyleAlert, ^{
[weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel];
}, ^{
[weakSelf promotionInformationExecutionOrder];
ShowAlertView(@"提示", [NSString stringWithFormat:@"微信卡劵使用失败:(%@),是否重试?",returnValue[@"msg"]], @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
[weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel];
}else {
[weakSelf promotionInformationExecutionOrder];
}
});
}
......@@ -684,11 +687,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
WS(weakSelf);
//判断是否有已抽奖未使用情况
if (![[self class] isBlankString:self.customerDrawModel.drawId]) {
ShowAlertView(nil, @"您有一个抽奖结果未使用,本次支付会默认使用", nil, @"我知道了", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"您有一个抽奖结果未使用,本次支付会默认使用", @[@"我知道了"], UIAlertControllerStyleAlert, ^(NSInteger index) {
[weakSelf promotionInformationExecutionOrder];
}, nil);
});
}else {
ShowAlertView(nil, @"恭喜您获得一次大转盘抽奖机会!", nil, @"马上参与", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"恭喜您获得一次大转盘抽奖机会!", @[@"马上参与"], UIAlertControllerStyleAlert, ^(NSInteger index) {
[weakSelf showLuckyDrawControl:model.lottery.uuid andOrderNumber:weakSelf.orderCode luckyDrawFinish:^(NSDictionary *dict) {
weakSelf.customerDrawModel = [[PromotionLuckDrawResultModel alloc]initWithDictionary:dict error:nil];
if ([BaseViewController isBlankString:weakSelf.customerDrawModel.awardId]) {
......@@ -697,7 +700,7 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
[XBLoadingView showHUDViewWithText:[NSString stringWithFormat:@"恭喜你获得了 %@",weakSelf.customerDrawModel.descriptionString]];
}
}];
}, nil);
});
}
}
......
......@@ -116,9 +116,12 @@
- (IBAction)dismissPromotionChooseNavigation:(UIBarButtonItem *)sender {
WS(weakSelf);
ShowDefaultAlertView(nil, @"退出后此单将不在享受促销", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"退出后此单将不在享受促销", @[@"我知道了"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}, nil);
});
}
#pragma mark - 确认促销条件选择
......
......@@ -314,7 +314,10 @@
- (void)undoOrderButtonClick:(NSInteger)cellindex
{
WS(weakSelf);
ShowDefaultAlertView(@"提示", @"请确认是否撤销订单", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"请确认是否撤销订单", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
[XBLoadingView showHUDViewWithDefault];
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) {
......@@ -332,7 +335,7 @@
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}, nil);
});
}
......
......@@ -262,9 +262,7 @@
- (void)qrcodeButtonClick {
WS(weakSelf);
// 判断应用是否有使用相机的权限
if (![BaseViewController determineCameraPermissions]) {
ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", nil, @"知道了", UIAlertControllerStyleAlert, nil, nil);
} else {
if ([BaseViewController determineCameraPermissions]) {
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[weakSelf dismissViewControllerAnimated:YES
completion:^{
......@@ -330,7 +328,7 @@
{
MyclientEntityModel *user = [Customermanager manager].model;
if (user == nil) {
ShowAlertView(nil, @"请先指定当前客户", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil);
ShowAlertView(@"提示", @"请先指定当前客户", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return;
}
LoginResult *shopper = [Shoppersmanager manager].shoppers;
......
......@@ -138,10 +138,10 @@
WS(weakSelf);
TOJingdongEcardEntity *model = self.datasArray[indexPath.row];
if ([[self class] isBlankString:model.orderReceiptUrl]) {
ShowAlertView(nil, @"不能查看未激活卡劵,请先上传小票激活卡劵", nil, @"我知道了", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"不能查看未激活卡劵,请先上传小票激活卡劵", @[@"我知道了"], UIAlertControllerStyleAlert, ^(NSInteger index) {
CardDetailsViewController *cardDetails = [[[weakSelf class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"CardDetailsViewController"];
[weakSelf.navigationController pushViewController:cardDetails animated:YES];
}, nil);
});
}else if ([model.state isEqualToString:CHECK]){
[XBLoadingView showHUDViewWithText:@"审核中"];
......
......@@ -84,47 +84,44 @@
- (void)userHeaderClickAction:(UITapGestureRecognizer *)tap
{
// 判断应用是否有使用相机的权限
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];
if([BaseViewController determineCameraPermissions]){
UIImagePickerController *PcCamera = [[UIImagePickerController alloc]init];
PcCamera.delegate = self;
[DeviceDirectionManager instance].isHorizontal=YES;
[alertView addAction:[UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil];
}
else
{
WS(weakSelf);
ShowAlertView(@"请选择", nil, @[@"拍照",@"从相册选择",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ZERO) {
//拍照
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypeCamera];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
[DeviceDirectionManager instance].isHorizontal=NO;
}
}else if (index == ONE) {
//从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf presentViewController:PcCamera animated:YES completion:nil];
});
}
else
{
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
[DeviceDirectionManager instance].isHorizontal=NO;
}
}else {
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相机无法使用"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"从相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//从相册中选择
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[PcCamera setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
PcCamera.allowsEditing = YES;
[self presentViewController:PcCamera animated:YES completion:nil];
}
else
{
[DeviceDirectionManager instance].isHorizontal=NO;
[XBLoadingView showHUDViewWithText:@"相册无法打开"];
}
}]];
[alertView addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[DeviceDirectionManager instance].isHorizontal=NO;
[alertView dismissViewControllerAnimated:YES completion:nil];
}]];
[self presentViewController:alertView animated:YES completion:nil];
});
}
}
......@@ -210,7 +207,10 @@
- (IBAction)cancellationButtonClick:(UIButton *)sender {
WS(weakSelf);
ShowDefaultAlertView(@"提示", @"切换用户将清空用户数据,是否继续?", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"切换用户将清空用户数据,是否继续?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
//清除极光别名
[JPUSHService setTags:nil alias:@"" callbackSelector:nil object:nil];
[XBLoadingView showHUDViewWithDefault];
......@@ -227,13 +227,12 @@
}else
{
ShowAlertView(nil, @"切换用户失败", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil);
ShowAlertView(@"提示", @"切换用户失败", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
}
} withFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault];
}];
}, nil);
});
}
......
......@@ -49,7 +49,10 @@
if ([self includeChinese:self.inputRebateTextField.text]) {
[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];
ApplyRequest *withdrawal = [[ApplyRequest alloc] init];
withdrawal.amount = [NSNumber numberWithFloat:[weakSelf.inputRebateTextField.text floatValue]];
......@@ -69,7 +72,7 @@
[XBLoadingView hideHUDViewWithDefault];
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}, nil);
});
}
#pragma mark - 提现申请成功
......
......@@ -221,7 +221,7 @@
- (IBAction)withdrawalButtonClickAction:(UIButton *)sender {
if (!self.resultEntity.isUsable && sender.tag == 101) {
ShowAlertView(@"提示", self.resultEntity.showApplyMessage, nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil);
ShowAlertView(@"提示", self.resultEntity.showApplyMessage, @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return;
}
if (!self.resultEntity.bankCards.count && sender.tag == 101) {
......
......@@ -7,6 +7,9 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
babosa (1.0.2)
claide (1.0.2)
cocoapods (1.2.1)
activesupport (>= 4.0.2, < 5)
......@@ -41,32 +44,147 @@ GEM
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (1.1.0)
colored (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)
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)
fuzzy_match (2.0.4)
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)
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)
molinillo (0.5.7)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.3)
nap (1.1.0)
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)
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)
tty-screen (0.5.0)
tzinfo (1.2.3)
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)
CFPropertyList (~> 2.3.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
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
ruby
DEPENDENCIES
cocoapods
fastlane
fastlane-plugin-pgyer
BUNDLED WITH
1.15.1
......@@ -50,7 +50,7 @@ PODS:
- SDWebImage/Core (= 3.8.2)
- SDWebImage/Core (3.8.2)
- UICountingLabel (1.2.0)
- UITableView+FDTemplateLayoutCell (1.5.beta)
- UITableView+FDTemplateLayoutCell (1.6)
- UMengAnalytics (4.2.4)
- UMengUShare/Core (6.4.1):
- UMengUShare/Network
......@@ -61,7 +61,7 @@ PODS:
- UMengUShare/Core
- WYPopoverController (0.3.9)
- WZLBadge (1.2.5)
- YXAlertController (1.0.2)
- YXAlertController (1.0.7)
DEPENDENCIES:
- AFNetworking (~> 3.1.0)
......@@ -80,17 +80,17 @@ DEPENDENCIES:
- MWPhotoBrowser (~> 2.1.2)
- PNChart (~> 0.8.9)
- SDWebImage
- UITableView+FDTemplateLayoutCell (~> 1.5.beta)
- UITableView+FDTemplateLayoutCell (~> 1.6)
- UMengAnalytics
- UMengUShare/Social/ReducedSina
- UMengUShare/Social/ReducedWeChat
- WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.2)
- YXAlertController (~> 1.0.7)
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AliyunOSSiOS: 058b038cc82000dadb8f8e3893a97243124f2898
AliyunOSSiOS: '058b038cc82000dadb8f8e3893a97243124f2898'
Bugly: 2c256069145f550171907c5cb1c0f84ad291f6c1
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
......@@ -106,15 +106,15 @@ SPEC CHECKSUMS:
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5
PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2
SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c
SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c'
UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa
UITableView+FDTemplateLayoutCell: 02b508ab1cb4cea16a8c17ac83d2cd1fd72124f9
UITableView+FDTemplateLayoutCell: 5c949b4a5059c404b442926c0e80f81d10a2d66f
UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2
UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac
YXAlertController: 8ca2722656d975858263b62c8ae0328c09005535
YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
PODFILE CHECKSUM: 91aa6880ad838660fc2adc77a00cb4d4cbd40356
PODFILE CHECKSUM: 4b56e3ba89ba6d8693f5d5775770671ed0c82ac3
COCOAPODS: 1.2.1
......@@ -50,7 +50,7 @@ PODS:
- SDWebImage/Core (= 3.8.2)
- SDWebImage/Core (3.8.2)
- UICountingLabel (1.2.0)
- UITableView+FDTemplateLayoutCell (1.5.beta)
- UITableView+FDTemplateLayoutCell (1.6)
- UMengAnalytics (4.2.4)
- UMengUShare/Core (6.4.1):
- UMengUShare/Network
......@@ -61,7 +61,7 @@ PODS:
- UMengUShare/Core
- WYPopoverController (0.3.9)
- WZLBadge (1.2.5)
- YXAlertController (1.0.2)
- YXAlertController (1.0.7)
DEPENDENCIES:
- AFNetworking (~> 3.1.0)
......@@ -80,17 +80,17 @@ DEPENDENCIES:
- MWPhotoBrowser (~> 2.1.2)
- PNChart (~> 0.8.9)
- SDWebImage
- UITableView+FDTemplateLayoutCell (~> 1.5.beta)
- UITableView+FDTemplateLayoutCell (~> 1.6)
- UMengAnalytics
- UMengUShare/Social/ReducedSina
- UMengUShare/Social/ReducedWeChat
- WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.2)
- YXAlertController (~> 1.0.7)
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AliyunOSSiOS: 058b038cc82000dadb8f8e3893a97243124f2898
AliyunOSSiOS: '058b038cc82000dadb8f8e3893a97243124f2898'
Bugly: 2c256069145f550171907c5cb1c0f84ad291f6c1
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
......@@ -106,15 +106,15 @@ SPEC CHECKSUMS:
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
MWPhotoBrowser: 5836d7aa041dc05a13de380c246826578adc5ea5
PNChart: 84774d225c2126ded6c93d4dbe6ae98c3a73c2d2
SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c
SDWebImage: '098e97e6176540799c27e804c96653ee0833d13c'
UICountingLabel: 1db4e7d023e1762171eb226d6dff47a7a84f27aa
UITableView+FDTemplateLayoutCell: 02b508ab1cb4cea16a8c17ac83d2cd1fd72124f9
UITableView+FDTemplateLayoutCell: 5c949b4a5059c404b442926c0e80f81d10a2d66f
UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2
UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac
YXAlertController: 8ca2722656d975858263b62c8ae0328c09005535
YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
PODFILE CHECKSUM: 91aa6880ad838660fc2adc77a00cb4d4cbd40356
PODFILE CHECKSUM: 4b56e3ba89ba6d8693f5d5775770671ed0c82ac3
COCOAPODS: 1.2.1
......@@ -121,7 +121,6 @@ typedef NSMutableArray<NSMutableArray<NSNumber *> *> FDIndexPathHeightsBySection
- (FDIndexPathHeightCache *)fd_indexPathHeightCache {
FDIndexPathHeightCache *cache = objc_getAssociatedObject(self, _cmd);
if (!cache) {
[self methodSignatureForSelector:nil];
cache = [FDIndexPathHeightCache new];
objc_setAssociatedObject(self, _cmd, cache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
......
......@@ -57,11 +57,38 @@
// Add a hard width constraint to make dynamic content views (like labels) expand vertically instead
// 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];
[cell.contentView addConstraint:widthFenceConstraint];
// [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];
// Auto layout engine does its math
fittingHeight = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
// Clean-ups
[cell.contentView removeConstraint:widthFenceConstraint];
if (isSystemVersionEqualOrGreaterThen10_2) {
[cell removeConstraints:edgeConstraints];
}
[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
## Installation
Latest version: **1.4.beta**
Latest version: **1.6**
```
pod search UITableView+FDTemplateLayoutCell
......@@ -130,6 +130,9 @@ pod setup
We recommend to use the latest release in cocoapods.
- 1.6
fix bug in iOS 10
- 1.4
Refactor, add "cacheByKey" mode, bug fixed
......@@ -147,3 +150,5 @@ Basic automatically height calculation
## License
MIT
# YXAlertController
\ No newline at end of file
# 欢迎使用 YXAlertController
------
> * pod 'YXAlertController', '~> 1.0.2’
ShowAlertView(@"提示", @"你好,欢迎使用YXAlertController", @"取消", @"确认", UIAlertControllerStyleAlert, ^{
}, ^{
});
ShowDefaultAlertView(@"提示", @"你好,欢迎使用YXAlertController", UIAlertControllerStyleAlert, nil, nil);
......@@ -16,28 +16,26 @@
@interface YXAlertController : UIAlertController
/**
默认提示选择框
提示选择框
@param title 提示标题
@param message 提示说明
@param menuArray 菜单title Array
@param style 风格
@param completed 确定回调
@param canceled 取消回调
@param completed 完成回调
*/
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 message 提示说明
@param cancelTitle 取消按钮
@param DefaultTitle 确认按钮
@param style 风格
@param completed 确定回调
@param canceled 取消回调
@param title 提示标题
@param message 提示说明
@param menuArray 菜单title Array
@param placeholderArray 输入框占位符 Array
@param completed 完成回调
*/
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
......@@ -14,7 +14,7 @@
/**
初始化base
@param title 提示标题
@param message 提示说明
@param style 风格
......@@ -22,66 +22,77 @@
*/
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;
}
/**
默认提示选择框
提示选择框
@param title 提示标题
@param message 提示说明
@param menuArray 菜单title Array
@param style 风格
@param completed 确定回调
@param canceled 取消回调
@param completed 完成回调
*/
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);
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
if (canceled) {
canceled();
}
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed();
for (int i=0; i<menuArray.count; i++) {
NSString *menuTitle = menuArray[i];
if (i == menuArray.count - 1) {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed([menuArray indexOfObject:action.title]);
}
}]];
}else {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed([menuArray indexOfObject:action.title]);
}
}]];
}
}]];
}
[AppRootViewController() presentViewController:alert animated:YES completion:nil];
}
/**
提示选择框
@param title 提示标题
@param message 提示说明
@param cancelTitle 取消按钮
@param DefaultTitle 确认按钮
@param style 风格
@param completed 确定回调
@param canceled 取消回调
输入框
@param title 提示标题
@param message 提示说明
@param menuArray 菜单title Array
@param placeholderArray 输入框占位符 Array
@param completed 完成回调
*/
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);
if (cancelTitle) {
[alert addAction:[UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
if (canceled) {
canceled();
}
}]];
UIAlertController *alert = BaseAlert(title, message, UIAlertControllerStyleAlert);
for (int i=0; i<placeholderArray.count; i++) {
NSString *placeholder = placeholderArray[i];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = placeholder;
}];
}
if (DefaultTitle) {
[alert addAction:[UIAlertAction actionWithTitle:DefaultTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed();
}
}]];
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);
}
}]];
}else {
[alert addAction:[UIAlertAction actionWithTitle:menuTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
if (completed) {
completed([menuArray indexOfObject:action.title],alert.textFields);
}
}]];
}
}
[AppRootViewController() presentViewController:alert animated:YES completion:nil];
}
......@@ -89,7 +100,7 @@ void ShowAlertView(NSString *title,NSString *message,NSString *cancelTitle,NSStr
/**
自动获取app最顶层控制器
@return UIViewController
*/
UIViewController *AppRootViewController() {
......
......@@ -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 @@
loadingView.color = kMainBlueColor;
loadingView.hidesWhenStopped = YES;
[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 @@
*/
+ (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];
loadingView.frame = view.bounds;
[view addSubview:loadingView];
......
......@@ -145,8 +145,7 @@
[UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;
[[UMSocialManager defaultManager] shareToPlatform:UMSocialPlatformType_WechatTimeLine messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
if (error) {
NSLog(@"************Share fail with error %@*********",error);
ShowDefaultAlertView(nil, @"分享失败", UIAlertControllerStyleAlert, nil, nil);
ShowAlertView(@"提示", @"分享失败", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
}else{
[XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功" completeBlock:nil];
}
......@@ -197,11 +196,14 @@
CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset;
WS(weakSelf);
if (distanceFromBottom <= height && self.type == Study) {
ShowDefaultAlertView(nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{
ShowAlertView(@"提示", @"学习完成,是否开始考核?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) {
return;
}
if (weakSelf.scrollViewEndBottomBlock) {
weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath);
}
}, nil);
});
}
}
......
......@@ -201,7 +201,9 @@
NSString *mediaType = AVMediaTypeVideo;//读取媒体类型
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){
ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", @[@"我知道了"], UIAlertControllerStyleAlert, nil);
return NO;
}else {
return YES;
}
......
......@@ -21,8 +21,8 @@ target 'Lighting' do
pod 'PNChart', '~> 0.8.9'
pod 'JPush', '~> 3.0.1'
pod 'WZLBadge', '~> 1.2.5'
pod 'UITableView+FDTemplateLayoutCell', '~> 1.5.beta'
pod 'YXAlertController', '~> 1.0.2'
pod 'UITableView+FDTemplateLayoutCell', '~> 1.6'
pod 'YXAlertController', '~> 1.0.7'
pod 'iCarousel', '~> 1.8.3'
pod 'UMengAnalytics'
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