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

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

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