Commit 6b0b89b8 authored by 曹云霄's avatar 曹云霄

更新YXAlertController,优化微信卡劵提示信息不显示

parent 0c2ea9df
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
#pragma mark - 调用分享 #pragma mark - 调用分享
- (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender - (void)callSharePlatform:(NSString *)shareWeb withPlatformTag:(UIButton *)sender
{ {
[UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;
//创建分享消息对象 //创建分享消息对象
UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject]; UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
//设置文本 //设置文本
......
...@@ -438,7 +438,7 @@ ...@@ -438,7 +438,7 @@
#pragma mark - 删除帖子 #pragma mark - 删除帖子
- (void)delecteClickPostAction - (void)delecteClickPostAction
{ {
ShowDefaultAlertView(self, nil, @"确认删除此贴吗?", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, @"确认删除此贴吗?", UIAlertControllerStyleAlert, ^{
[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) {
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
- (void)longPressClickAction:(UILongPressGestureRecognizer *)sender - (void)longPressClickAction:(UILongPressGestureRecognizer *)sender
{ {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, nil, @"是否删除此项?", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, @"是否删除此项?", UIAlertControllerStyleAlert, ^{
NSInteger index = sender.view.tag; NSInteger index = sender.view.tag;
[weakSelf.imageArray removeObjectAtIndex:index]; [weakSelf.imageArray removeObjectAtIndex:index];
[weakSelf.photoManagerCollectionView reloadData]; [weakSelf.photoManagerCollectionView reloadData];
......
...@@ -361,7 +361,7 @@ ...@@ -361,7 +361,7 @@
[self.view endEditing:YES]; [self.view endEditing:YES];
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, nil, @"确认发表吗?", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, @"确认发表吗?", UIAlertControllerStyleAlert, ^{
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]) {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
cell.imageView.image = image; cell.imageView.image = image;
WS(weakSelf); WS(weakSelf);
cell.blockDelete = ^{ cell.blockDelete = ^{
ShowAlertView(weakSelf.viewController, nil, @"确认删除", @"取消", @"确认", UIAlertControllerStyleAlert, ^{ ShowAlertView(nil, @"确认删除", @"取消", @"确认", UIAlertControllerStyleAlert, ^{
NSLog(@"删除"); NSLog(@"删除");
[weakSelf.toolView deletePhotoWithIndex:indexPath.row]; [weakSelf.toolView deletePhotoWithIndex:indexPath.row];
}, },
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
NSString *timeString = [self timeFormatted:second]; NSString *timeString = [self timeFormatted:second];
if (![[self class] isBlankString:timeString] && second < (NSInteger)CMTimeGetSeconds(self.playerItem.duration)) { if (![[self class] isBlankString:timeString] && second < (NSInteger)CMTimeGetSeconds(self.playerItem.duration)) {
[self stopPlay]; [self stopPlay];
ShowDefaultAlertView(self, nil, [NSString stringWithFormat:@"上次播放时间:%@,是否继续播放",timeString], UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, [NSString stringWithFormat:@"上次播放时间:%@,是否继续播放",timeString], UIAlertControllerStyleAlert, ^{
[weakSelf.customPlayer seekToTime:CMTimeMake([weakSelf.learningItem.attachment.playTime integerValue], ONE) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero]; [weakSelf.customPlayer seekToTime:CMTimeMake([weakSelf.learningItem.attachment.playTime integerValue], ONE) toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
[weakSelf startPlay]; [weakSelf startPlay];
}, ^{ }, ^{
......
...@@ -327,7 +327,7 @@ ...@@ -327,7 +327,7 @@
- (IBAction)exitButtonClickAction:(UIButton *)sender { - (IBAction)exitButtonClickAction:(UIButton *)sender {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, nil, @"是否退出闯关?", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, @"是否退出闯关?", UIAlertControllerStyleAlert, ^{
if ([weakSelf.delegate respondsToSelector:@selector(dismissController:)]) { if ([weakSelf.delegate respondsToSelector:@selector(dismissController:)]) {
[weakSelf.delegate dismissController:YES]; [weakSelf.delegate dismissController:YES];
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
[XBLoadingView showHUDViewWithText:@"请选择所在区域"];return; [XBLoadingView showHUDViewWithText:@"请选择所在区域"];return;
} }
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, @"提示", @"确认后不可更改,请检查是否正确", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(@"提示", @"确认后不可更改,请检查是否正确", UIAlertControllerStyleAlert, ^{
[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;
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
WS(weakSelf); WS(weakSelf);
TONoticeEntity *entity = self.messageArray[indexPath.row]; TONoticeEntity *entity = self.messageArray[indexPath.row];
if (!entity.readed) { if (!entity.readed) {
ShowDefaultAlertView(self, nil, @"是否设置为已读", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, @"是否设置为已读", UIAlertControllerStyleAlert, ^{
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); }, nil);
......
...@@ -538,16 +538,16 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -538,16 +538,16 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
weChatModel.total = weakSelf.weChatModel.wxcardDenomation;break; weChatModel.total = weakSelf.weChatModel.wxcardDenomation;break;
} }
} }
NSString *message = MESSAGE(returnValue); NSString *message = returnValue[@"msg"];
if ([[self class] isBlankString: message]) { if ([[self class] isBlankString: message]) {
NSString *string = [NSString stringWithFormat:@"微信卡劵(%ld元)使用成功",weakSelf.weChatModel.wxcardDenomation]; NSString *string = [NSString stringWithFormat:@"微信卡劵(%f元)使用成功",weakSelf.weChatModel.wxcardDenomation];
ShowDefaultAlertView(self, nil, string, UIAlertControllerStyleAlert,nil,nil); ShowDefaultAlertView(nil, string, UIAlertControllerStyleAlert,nil,nil);
}else { }else {
ShowDefaultAlertView(self, nil, message, UIAlertControllerStyleAlert, nil, nil); ShowDefaultAlertView(nil, message, UIAlertControllerStyleAlert, nil, nil);
} }
[weakSelf promotionInformationExecutionOrder]; [weakSelf promotionInformationExecutionOrder];
}else{ }else{
ShowDefaultAlertView(self, nil, [NSString stringWithFormat:@"微信卡劵使用失败:(%@),是否重试?",returnValue[@"msg"]], UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, [NSString stringWithFormat:@"微信卡劵使用失败:(%@),是否重试?",returnValue[@"msg"]], UIAlertControllerStyleAlert, ^{
[weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel]; [weakSelf scanWeChatCardNumber:weakSelf.tempWeChatModel];
}, ^{ }, ^{
[weakSelf promotionInformationExecutionOrder]; [weakSelf promotionInformationExecutionOrder];
...@@ -685,11 +685,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -685,11 +685,11 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
WS(weakSelf); WS(weakSelf);
//判断是否有已抽奖未使用情况 //判断是否有已抽奖未使用情况
if (![[self class] isBlankString:self.customerDrawModel.drawId]) { if (![[self class] isBlankString:self.customerDrawModel.drawId]) {
ShowAlertView(self, nil, @"您有一个抽奖结果未使用,本次支付会默认使用", nil, @"我知道了", UIAlertControllerStyleAlert, ^{ ShowAlertView(nil, @"您有一个抽奖结果未使用,本次支付会默认使用", nil, @"我知道了", UIAlertControllerStyleAlert, ^{
[weakSelf promotionInformationExecutionOrder]; [weakSelf promotionInformationExecutionOrder];
}, nil); }, nil);
}else { }else {
ShowAlertView(self, nil, @"恭喜您获得一次大转盘抽奖机会!", nil, @"马上参与", UIAlertControllerStyleAlert, ^{ ShowAlertView(nil, @"恭喜您获得一次大转盘抽奖机会!", nil, @"马上参与", UIAlertControllerStyleAlert, ^{
[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]) {
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
- (IBAction)dismissPromotionChooseNavigation:(UIBarButtonItem *)sender { - (IBAction)dismissPromotionChooseNavigation:(UIBarButtonItem *)sender {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, nil, @"退出后此单将不在享受促销", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, @"退出后此单将不在享受促销", UIAlertControllerStyleAlert, ^{
[weakSelf dismissViewControllerAnimated:YES completion:nil]; [weakSelf dismissViewControllerAnimated:YES completion:nil];
}, nil); }, nil);
} }
......
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
- (void)undoOrderButtonClick:(NSInteger)cellindex - (void)undoOrderButtonClick:(NSInteger)cellindex
{ {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, @"提示", @"请确认是否撤销订单", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(@"提示", @"请确认是否撤销订单", UIAlertControllerStyleAlert, ^{
[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) {
......
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
WS(weakSelf); WS(weakSelf);
// 判断应用是否有使用相机的权限 // 判断应用是否有使用相机的权限
if (![BaseViewController determineCameraPermissions]) { if (![BaseViewController determineCameraPermissions]) {
ShowAlertView(self, @"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", nil, @"知道了", UIAlertControllerStyleAlert, nil, nil); ShowAlertView(@"提示", @"请在iPad的“设置-隐私-相机”选项中,允许欧立方访问你的相机", nil, @"知道了", UIAlertControllerStyleAlert, nil, nil);
} else { } else {
QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) { QRViewController *qrVC = [[QRViewController alloc] initWithScanCompleteHandler:^(NSString *url) {
[weakSelf dismissViewControllerAnimated:YES [weakSelf dismissViewControllerAnimated:YES
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
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(self, nil, @"不能查看未激活卡劵,请先上传小票激活卡劵", nil, @"我知道了", UIAlertControllerStyleAlert, ^{ ShowAlertView(nil, @"不能查看未激活卡劵,请先上传小票激活卡劵", nil, @"我知道了", UIAlertControllerStyleAlert, ^{
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); }, nil);
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
- (IBAction)cancellationButtonClick:(UIButton *)sender { - (IBAction)cancellationButtonClick:(UIButton *)sender {
WS(weakSelf); WS(weakSelf);
ShowDefaultAlertView(self, @"提示", @"切换用户将清空用户数据,是否继续?", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(@"提示", @"切换用户将清空用户数据,是否继续?", UIAlertControllerStyleAlert, ^{
//清除极光别名 //清除极光别名
[JPUSHService setTags:nil alias:@"" callbackSelector:nil object:nil]; [JPUSHService setTags:nil alias:@"" callbackSelector:nil object:nil];
[XBLoadingView showHUDViewWithDefault]; [XBLoadingView showHUDViewWithDefault];
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
}else }else
{ {
ShowAlertView(self, nil, @"切换用户失败", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil); ShowAlertView(nil, @"切换用户失败", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil);
} }
} withFailureBlock:^(id error) { } withFailureBlock:^(id error) {
[XBLoadingView hideHUDViewWithDefault]; [XBLoadingView hideHUDViewWithDefault];
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
if ([self includeChinese:self.inputRebateTextField.text]) { if ([self includeChinese:self.inputRebateTextField.text]) {
[XBLoadingView showHUDViewWithText:@"格式不正确"];return; [XBLoadingView showHUDViewWithText:@"格式不正确"];return;
} }
ShowDefaultAlertView(self, nil, [NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text], UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(nil, [NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text], UIAlertControllerStyleAlert, ^{
[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]];
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
[self showUnboundedAlertView]; [self showUnboundedAlertView];
} }
if (!self.resultEntity.isUsable && sender.tag == 101) { if (!self.resultEntity.isUsable && sender.tag == 101) {
ShowAlertView(self, @"提示", @"只能在周二和周五发起提现申请!", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil); ShowAlertView(@"提示", @"只能在周二和周五发起提现申请!", nil, @"我知道了", UIAlertControllerStyleAlert, nil, nil);
return; return;
} }
WS(weakSelf); WS(weakSelf);
......
...@@ -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.1) - YXAlertController (1.0.2)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
...@@ -86,7 +86,7 @@ DEPENDENCIES: ...@@ -86,7 +86,7 @@ DEPENDENCIES:
- 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.1) - YXAlertController (~> 1.0.2)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
...@@ -113,8 +113,8 @@ SPEC CHECKSUMS: ...@@ -113,8 +113,8 @@ SPEC CHECKSUMS:
UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4 WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac
YXAlertController: 4cd6330eef5380047b28473aef35e3bf942fcced YXAlertController: 8ca2722656d975858263b62c8ae0328c09005535
PODFILE CHECKSUM: ca99bc7218409a51a770d38b82cc9f99e6c1b2d1 PODFILE CHECKSUM: 91aa6880ad838660fc2adc77a00cb4d4cbd40356
COCOAPODS: 1.2.0 COCOAPODS: 1.2.0
...@@ -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.1) - YXAlertController (1.0.2)
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 3.1.0) - AFNetworking (~> 3.1.0)
...@@ -86,7 +86,7 @@ DEPENDENCIES: ...@@ -86,7 +86,7 @@ DEPENDENCIES:
- 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.1) - YXAlertController (~> 1.0.2)
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
...@@ -113,8 +113,8 @@ SPEC CHECKSUMS: ...@@ -113,8 +113,8 @@ SPEC CHECKSUMS:
UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff UMengUShare: 7756e2e46ceba04e3000fb2c9b1d3f61784ca2ff
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4 WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac WZLBadge: 16c08aa0a645e2591690f21cbcb410a3d878c7ac
YXAlertController: 4cd6330eef5380047b28473aef35e3bf942fcced YXAlertController: 8ca2722656d975858263b62c8ae0328c09005535
PODFILE CHECKSUM: ca99bc7218409a51a770d38b82cc9f99e6c1b2d1 PODFILE CHECKSUM: 91aa6880ad838660fc2adc77a00cb4d4cbd40356
COCOAPODS: 1.2.0 COCOAPODS: 1.2.0
...@@ -18,19 +18,17 @@ ...@@ -18,19 +18,17 @@
/** /**
默认提示选择框 默认提示选择框
@param viewController 控制器对象
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param style 风格 @param style 风格
@param completed 确定回调 @param completed 确定回调
@param canceled 取消回调 @param canceled 取消回调
*/ */
extern void ShowDefaultAlertView(UIViewController *viewController,NSString *title,NSString *message,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()); extern void ShowDefaultAlertView(NSString *title,NSString *message,UIAlertControllerStyle style,void(^completed)(),void(^canceled)());
/** /**
提示选择框 提示选择框
@param viewController 控制器对象
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param cancelTitle 取消按钮 @param cancelTitle 取消按钮
...@@ -39,7 +37,7 @@ extern void ShowDefaultAlertView(UIViewController *viewController,NSString *titl ...@@ -39,7 +37,7 @@ extern void ShowDefaultAlertView(UIViewController *viewController,NSString *titl
@param completed 确定回调 @param completed 确定回调
@param canceled 取消回调 @param canceled 取消回调
*/ */
extern void ShowAlertView(UIViewController *viewController,NSString *title,NSString *message,NSString *cancelTitle,NSString *DefaultTitle,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()); extern void ShowAlertView(NSString *title,NSString *message,NSString *cancelTitle,NSString *DefaultTitle,UIAlertControllerStyle style,void(^completed)(),void(^canceled)());
@end @end
...@@ -11,28 +11,35 @@ ...@@ -11,28 +11,35 @@
@implementation YXAlertController @implementation YXAlertController
#pragma mark -获取初始化alertView
/**
初始化base
@param title 提示标题
@param message 提示说明
@param style 风格
@return UIAlertController
*/
UIAlertController *BaseAlert(NSString *title,NSString *message,UIAlertControllerStyle style) { UIAlertController *BaseAlert(NSString *title,NSString *message,UIAlertControllerStyle style) {
UIAlertController *alertContr = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:style]; UIAlertController *alertContr = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
return alertContr; return alertContr;
} }
/** /**
默认提示选择框 默认提示选择框
@param viewController 控制器对象
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param style 风格 @param style 风格
@param completed 确定回调 @param completed 确定回调
@param canceled 取消回调 @param canceled 取消回调
*/ */
void ShowDefaultAlertView(UIViewController *viewController,NSString *title,NSString *message,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()) { void ShowDefaultAlertView(NSString *title,NSString *message,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()) {
UIAlertController *alert = BaseAlert(title, message, style); UIAlertController *alert = BaseAlert(title, message, style);
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
if (canceled) { if (canceled) {
canceled(); canceled();
} }
...@@ -42,14 +49,13 @@ void ShowDefaultAlertView(UIViewController *viewController,NSString *title,NSStr ...@@ -42,14 +49,13 @@ void ShowDefaultAlertView(UIViewController *viewController,NSString *title,NSStr
completed(); completed();
} }
}]]; }]];
[viewController presentViewController:alert animated:YES completion:nil]; [AppRootViewController() presentViewController:alert animated:YES completion:nil];
} }
/** /**
提示选择框 提示选择框
@param viewController 控制器对象
@param title 提示标题 @param title 提示标题
@param message 提示说明 @param message 提示说明
@param cancelTitle 取消按钮 @param cancelTitle 取消按钮
...@@ -58,33 +64,36 @@ void ShowDefaultAlertView(UIViewController *viewController,NSString *title,NSStr ...@@ -58,33 +64,36 @@ void ShowDefaultAlertView(UIViewController *viewController,NSString *title,NSStr
@param completed 确定回调 @param completed 确定回调
@param canceled 取消回调 @param canceled 取消回调
*/ */
void ShowAlertView(UIViewController *viewController,NSString *title,NSString *message,NSString *cancelTitle,NSString *DefaultTitle,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()) { void ShowAlertView(NSString *title,NSString *message,NSString *cancelTitle,NSString *DefaultTitle,UIAlertControllerStyle style,void(^completed)(),void(^canceled)()) {
UIAlertController *alert = BaseAlert(title, message, style); UIAlertController *alert = BaseAlert(title, message, style);
if (cancelTitle) { [alert addAction:[UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[alert addAction:[UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { if (canceled) {
if (canceled) { canceled();
canceled(); }
} }]];
}]]; [alert addAction:[UIAlertAction actionWithTitle:DefaultTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
} if (completed) {
if (DefaultTitle) { completed();
[alert addAction:[UIAlertAction actionWithTitle:DefaultTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }
if (completed) { }]];
completed(); [AppRootViewController() presentViewController:alert animated:YES completion:nil];
};
}]];
}
UIViewController *VC = [UIApplication sharedApplication].keyWindow.rootViewController;
[VC presentViewController:alert animated:YES completion:nil];
} }
/**
自动获取app最顶层控制器
@return UIViewController
*/
UIViewController *AppRootViewController() {
UIViewController *controller = [UIApplication sharedApplication].keyWindow.rootViewController;
if (controller.presentedViewController != nil) {
controller = controller.presentedViewController;
}
return controller;
}
......
...@@ -142,9 +142,11 @@ ...@@ -142,9 +142,11 @@
shareObject.webpageUrl = panoUrl; shareObject.webpageUrl = panoUrl;
messageObject.shareObject = shareObject; messageObject.shareObject = shareObject;
} }
[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); NSLog(@"************Share fail with error %@*********",error);
ShowDefaultAlertView(nil, @"分享失败", UIAlertControllerStyleAlert, nil, nil);
}else{ }else{
[XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功" completeBlock:nil]; [XBLoadingView showHUDViewWithSuccessText:@"分享微信朋友圈成功" completeBlock:nil];
} }
...@@ -195,8 +197,7 @@ ...@@ -195,8 +197,7 @@
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, ^{
ShowDefaultAlertView(self, nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{
if (weakSelf.scrollViewEndBottomBlock) { if (weakSelf.scrollViewEndBottomBlock) {
weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath); weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath);
} }
......
...@@ -22,7 +22,7 @@ target 'Lighting' do ...@@ -22,7 +22,7 @@ target 'Lighting' do
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.5.beta'
pod 'YXAlertController', '~> 1.0.1' pod 'YXAlertController', '~> 1.0.2'
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