Commit c32cb351 by 刘卓鑫

修改首页 首充 强弹的公告弹出动画

parent 95ea42bd
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
1C5B26B8225B3B7B001B0E1B /* ZXSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */; }; 1C5B26B8225B3B7B001B0E1B /* ZXSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */; };
1C5B26BB225B3B85001B0E1B /* ZXUserSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */; }; 1C5B26BB225B3B85001B0E1B /* ZXUserSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */; };
1C5B26BE225B3B8F001B0E1B /* ZXUserSettingModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */; }; 1C5B26BE225B3B8F001B0E1B /* ZXUserSettingModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */; };
1C642757230FBB5E00AEC294 /* ZJAnimationPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C642755230FBB5D00AEC294 /* ZJAnimationPopView.m */; };
1C64275A230FBF3200AEC294 /* ZXPopAnimationTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C642759230FBF3200AEC294 /* ZXPopAnimationTool.m */; };
1C73BEED22439F8D0078947F /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEEC22439F8C0078947F /* SafariServices.framework */; }; 1C73BEED22439F8D0078947F /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEEC22439F8C0078947F /* SafariServices.framework */; };
1C73BEEF2243A0080078947F /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEEE2243A0070078947F /* EventKit.framework */; }; 1C73BEEF2243A0080078947F /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEEE2243A0070078947F /* EventKit.framework */; };
1C73BEFB22447DA90078947F /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEFA22447DA90078947F /* MessageUI.framework */; }; 1C73BEFB22447DA90078947F /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEFA22447DA90078947F /* MessageUI.framework */; };
...@@ -761,6 +763,10 @@ ...@@ -761,6 +763,10 @@
1C5B26BA225B3B84001B0E1B /* ZXUserSettingTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUserSettingTableViewCell.h; sourceTree = "<group>"; }; 1C5B26BA225B3B84001B0E1B /* ZXUserSettingTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUserSettingTableViewCell.h; sourceTree = "<group>"; };
1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXUserSettingModel.m; sourceTree = "<group>"; }; 1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXUserSettingModel.m; sourceTree = "<group>"; };
1C5B26BD225B3B8F001B0E1B /* ZXUserSettingModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUserSettingModel.h; sourceTree = "<group>"; }; 1C5B26BD225B3B8F001B0E1B /* ZXUserSettingModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUserSettingModel.h; sourceTree = "<group>"; };
1C642755230FBB5D00AEC294 /* ZJAnimationPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZJAnimationPopView.m; sourceTree = "<group>"; };
1C642756230FBB5D00AEC294 /* ZJAnimationPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZJAnimationPopView.h; sourceTree = "<group>"; };
1C642758230FBF3200AEC294 /* ZXPopAnimationTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXPopAnimationTool.h; sourceTree = "<group>"; };
1C642759230FBF3200AEC294 /* ZXPopAnimationTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXPopAnimationTool.m; sourceTree = "<group>"; };
1C73BEEC22439F8C0078947F /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; }; 1C73BEEC22439F8C0078947F /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; };
1C73BEEE2243A0070078947F /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; }; 1C73BEEE2243A0070078947F /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; };
1C73BEF822447CB40078947F /* BaiduMobAdSDK */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = BaiduMobAdSDK; path = "ColorfulSchool/Classes/百度广告/BaiduMobAdSDK.framework/BaiduMobAdSDK"; sourceTree = "<group>"; }; 1C73BEF822447CB40078947F /* BaiduMobAdSDK */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = BaiduMobAdSDK; path = "ColorfulSchool/Classes/百度广告/BaiduMobAdSDK.framework/BaiduMobAdSDK"; sourceTree = "<group>"; };
...@@ -2098,6 +2104,15 @@ ...@@ -2098,6 +2104,15 @@
path = ViewModel; path = ViewModel;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1C642754230FBB5D00AEC294 /* ZJAnimationPopView */ = {
isa = PBXGroup;
children = (
1C642756230FBB5D00AEC294 /* ZJAnimationPopView.h */,
1C642755230FBB5D00AEC294 /* ZJAnimationPopView.m */,
);
path = ZJAnimationPopView;
sourceTree = "<group>";
};
1C8853F922C1B08A00A03328 /* appointmentBath(预约洗浴) */ = { 1C8853F922C1B08A00A03328 /* appointmentBath(预约洗浴) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -4062,6 +4077,8 @@ ...@@ -4062,6 +4077,8 @@
A7DECC752079F0E20039EC22 /* ZXPayManager.m */, A7DECC752079F0E20039EC22 /* ZXPayManager.m */,
A7DECC762079F0E20039EC22 /* ZXTool.h */, A7DECC762079F0E20039EC22 /* ZXTool.h */,
A7DECC772079F0E20039EC22 /* ZXTool.m */, A7DECC772079F0E20039EC22 /* ZXTool.m */,
1C642758230FBF3200AEC294 /* ZXPopAnimationTool.h */,
1C642759230FBF3200AEC294 /* ZXPopAnimationTool.m */,
); );
path = "Tool(工具)"; path = "Tool(工具)";
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -4069,6 +4086,7 @@ ...@@ -4069,6 +4086,7 @@
A7DECC7A2079F0E20039EC22 /* Vendor(三方) */ = { A7DECC7A2079F0E20039EC22 /* Vendor(三方) */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1C642754230FBB5D00AEC294 /* ZJAnimationPopView */,
1CB3AC1023053BE0006F1724 /* CropImage */, 1CB3AC1023053BE0006F1724 /* CropImage */,
1C3AE7B722F0482D0045C969 /* SGQRCode */, 1C3AE7B722F0482D0045C969 /* SGQRCode */,
1CD9E566229B7C7500FFDA29 /* JDSDK */, 1CD9E566229B7C7500FFDA29 /* JDSDK */,
...@@ -5150,6 +5168,7 @@ ...@@ -5150,6 +5168,7 @@
22E36C931F558D1B00073AC2 /* FetchWalletTopUpDataModel.m in Sources */, 22E36C931F558D1B00073AC2 /* FetchWalletTopUpDataModel.m in Sources */,
A75436E921D34594005584CC /* CampasVersionUpdateModel.m in Sources */, A75436E921D34594005584CC /* CampasVersionUpdateModel.m in Sources */,
A7F3E17421B5330F00010E23 /* HTTPMessage.m in Sources */, A7F3E17421B5330F00010E23 /* HTTPMessage.m in Sources */,
1C642757230FBB5E00AEC294 /* ZJAnimationPopView.m in Sources */,
A7EC706C20EC9867001504C5 /* ZXWashOrderModel.m in Sources */, A7EC706C20EC9867001504C5 /* ZXWashOrderModel.m in Sources */,
A705BFC021D4AFD8004F1628 /* HTTPErrorResponse.m in Sources */, A705BFC021D4AFD8004F1628 /* HTTPErrorResponse.m in Sources */,
A7FE8D7020C8DD8C0028B721 /* ZTHomeViewController.m in Sources */, A7FE8D7020C8DD8C0028B721 /* ZTHomeViewController.m in Sources */,
...@@ -5335,6 +5354,7 @@ ...@@ -5335,6 +5354,7 @@
A7FE8D7620C8F7D30028B721 /* New_OperationCell.m in Sources */, A7FE8D7620C8F7D30028B721 /* New_OperationCell.m in Sources */,
A783E4452109BC650074623C /* ChineseString.m in Sources */, A783E4452109BC650074623C /* ChineseString.m in Sources */,
A75436E821D34594005584CC /* UpdateVersionModel.m in Sources */, A75436E821D34594005584CC /* UpdateVersionModel.m in Sources */,
1C64275A230FBF3200AEC294 /* ZXPopAnimationTool.m in Sources */,
A7F3E00E21B530F500010E23 /* ZXColorfulTopController.m in Sources */, A7F3E00E21B530F500010E23 /* ZXColorfulTopController.m in Sources */,
1CF86307230280FB0007EBC6 /* AppUpdateVersion.m in Sources */, 1CF86307230280FB0007EBC6 /* AppUpdateVersion.m in Sources */,
A756C5CB21FAA6050006E418 /* SDCycleScrollView.m in Sources */, A756C5CB21FAA6050006E418 /* SDCycleScrollView.m in Sources */,
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
[self defaultLauchConfigAndIsOpenPreventCrashManager:YES]; [self defaultLauchConfigAndIsOpenPreventCrashManager:YES];
//启动环境 //启动环境
[APIManager sharedAPIManager].lauchEnvironment = ZXColorfulSchoolEnvironmentProduct; [APIManager sharedAPIManager].lauchEnvironment = ZXColorfulSchoolEnvironmentTest;
//极光推送 //极光推送
[self initPushWithOptions:launchOptions isProduct:YES]; [self initPushWithOptions:launchOptions isProduct:YES];
......
// //
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#import "AimiWalletViewController.h" #import "AimiWalletViewController.h"
#import "enlargeClickRegionBtn.h" #import "enlargeClickRegionBtn.h"
#import "CropImageController.h" #import "CropImageController.h"
#import "ZJAnimationPopView.h"
@interface ZXHomePageViewController ()<UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, CropImageDelegate> @interface ZXHomePageViewController ()<UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, CropImageDelegate>
/** tableview */ /** tableview */
@property (nonatomic, strong) UITableView *myTableView; @property (nonatomic, strong) UITableView *myTableView;
...@@ -213,16 +214,23 @@ ...@@ -213,16 +214,23 @@
kWeakSelf(self); kWeakSelf(self);
self.announce = [[ZXHomePageAnnounceView alloc] initWithFrame:[UIScreen mainScreen].bounds jumpUrl:@""]; self.announce = [[ZXHomePageAnnounceView alloc] initWithFrame:[UIScreen mainScreen].bounds jumpUrl:@""];
self.announce.htmlStr = info.content; self.announce.htmlStr = info.content;
self.announce.comfirm = ^(BOOL isNotAlert) {
ZJAnimationPopView *popView = [ZXPopAnimationTool showPopView:self.announce fatherView:self.tabBarController.view popStyle:ZJAnimationPopStyleShakeFromBottom dismissStyle:ZJAnimationDismissStyleScale popComplete:^{
} dismissComplete:^{
kStrongSelf(self); kStrongSelf(self);
self.announce.hidden = YES; self.announce.hidden = YES;
self.announce = nil; self.announce = nil;
}];
kWeakSelf(popView);
self.announce.comfirm = ^(BOOL isNotAlert) {
kStrongSelf(self);
[weakpopView dismiss];
if (isNotAlert) { if (isNotAlert) {
//不在提示 //不在提示
[self.service notShowAlertAnnounceByNoticeCode:info.noticeCode]; [self.service notShowAlertAnnounceByNoticeCode:info.noticeCode];
} }
}; };
[self.tabBarController.view addSubview:self.announce];
} }
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
...@@ -557,16 +565,24 @@ ...@@ -557,16 +565,24 @@
} }
@weakify(self); @weakify(self);
ZJAnimationPopView *popView;
kWeakSelf(popView);
ZXHomePaeFirstRecahrgeView *firstRechargeView = [[ZXHomePaeFirstRecahrgeView alloc] initWithFirstRechargeDesc:msg rightAction:^{ ZXHomePaeFirstRecahrgeView *firstRechargeView = [[ZXHomePaeFirstRecahrgeView alloc] initWithFirstRechargeDesc:msg rightAction:^{
@strongify(self); @strongify(self);
[weakpopView dismiss];
self.isShowFirstRecharge = NO; self.isShowFirstRecharge = NO;
AimiWalletViewController * view = [[AimiWalletViewController alloc]init]; AimiWalletViewController * view = [[AimiWalletViewController alloc]init];
view.hidesBottomBarWhenPushed = YES; view.hidesBottomBarWhenPushed = YES;
view.comeFrom=@"firstTopUp"; view.comeFrom = @"firstTopUp";
[self.navigationController pushViewController:view animated:YES]; [self.navigationController pushViewController:view animated:YES];
}]; }];
firstRechargeView.frame = [UIScreen mainScreen].bounds; firstRechargeView.frame = [UIScreen mainScreen].bounds;
[self.tabBarController.view addSubview:firstRechargeView];
popView = [ZXPopAnimationTool showPopView:firstRechargeView fatherView:self.tabBarController.view popStyle:ZJAnimationPopStyleShakeFromBottom dismissStyle:ZJAnimationDismissStyleScale popComplete:^{
} dismissComplete:^{
}];
} }
- (void) createNotPayAndAnnouceView { - (void) createNotPayAndAnnouceView {
//待支付订单view //待支付订单view
......
// //
...@@ -68,12 +68,12 @@ ...@@ -68,12 +68,12 @@
make.left.equalTo(imageV).offset(10 * k6Scale); make.left.equalTo(imageV).offset(10 * k6Scale);
make.top.equalTo(imageV.mas_top); make.top.equalTo(imageV.mas_top);
make.right.equalTo(imageV).offset(-10 * k6Scale); make.right.equalTo(imageV).offset(-10 * k6Scale);
make.height.mas_equalTo(140 * k6Scale); make.height.mas_equalTo(144 * k6Scale);
}]; }];
[self.dateCountLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.dateCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(imageV.mas_right).offset(-20 * k6Scale); make.right.equalTo(imageV.mas_right).offset(-20 * k6Scale);
make.top.equalTo(self.ContentImageView.mas_bottom).offset(15 * k6Scale); make.top.equalTo(self.ContentImageView.mas_bottom).offset(12 * k6Scale);
}]; }];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
......
// //
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
- (instancetype) initWithFirstRechargeDesc:(NSString *) rechargeDesc rightAction:(dispatch_block_t) rightAction { - (instancetype) initWithFirstRechargeDesc:(NSString *) rechargeDesc rightAction:(dispatch_block_t) rightAction {
if (self = [super init]) { if (self = [super init]) {
self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; // self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
UIView *bgView = [[UIView alloc] init]; UIView *bgView = [[UIView alloc] init];
bgView.backgroundColor = [UIColor whiteColor]; bgView.backgroundColor = [UIColor whiteColor];
kViewRadius(bgView, 7 * k6Scale); kViewRadius(bgView, 7 * k6Scale);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
- (instancetype) initWithFrame:(CGRect)frame jumpUrl:(NSString *) jumpUrl { - (instancetype) initWithFrame:(CGRect)frame jumpUrl:(NSString *) jumpUrl {
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.2]; // self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.2];
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(40 * k6Scale, 85 * k6Scale, kScreenWidth - 80 * k6Scale, kScreenHeight - 170 * k6Scale)]; UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(40 * k6Scale, 85 * k6Scale, kScreenWidth - 80 * k6Scale, kScreenHeight - 170 * k6Scale)];
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
} }
#pragma mark - ==========确定事件========== #pragma mark - ==========确定事件==========
- (void) okAction:(UIButton *) sender { - (void) okAction:(UIButton *) sender {
self.hidden =YES; // self.hidden =YES;
[self removeFromSuperview]; // [self removeFromSuperview];
if (self.comfirm) { if (self.comfirm) {
self.comfirm(self.agreedBtn.selected); self.comfirm(self.agreedBtn.selected);
} }
......
// //
...@@ -290,23 +290,23 @@ heightForFooterInSection:(NSInteger)section ...@@ -290,23 +290,23 @@ heightForFooterInSection:(NSInteger)section
TicketItem * deltTicketItem=self.fetchTicketDeviceModel.ticketAndDevieceItem.userCouponList[deleteRow-1000]; TicketItem * deltTicketItem=self.fetchTicketDeviceModel.ticketAndDevieceItem.userCouponList[deleteRow-1000];
if (_alert!=nil) { if (self.alert!=nil) {
[_alert removeFromSuperview]; [self.alert removeFromSuperview];
_alert=nil; self.alert=nil;
} }
_alert=[[DeleteAlertView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)]; self.alert=[[DeleteAlertView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
_alert.message=[NSString stringWithFormat:@"是否确定删除%@券",self.equipItem.serviceName] ; self.alert.message=[NSString stringWithFormat:@"是否确定删除%@券",self.equipItem.serviceName] ;
__weak typeof(self) weakSelf=self; __weak typeof(self) weakSelf=self;
[_alert setOkClick:^{ [self.alert setOkClick:^{
weakSelf.isFromDeleteSV=YES; weakSelf.isFromDeleteSV=YES;
[weakSelf.delTicketModel deleteTicketWithStrNo:deltTicketItem.strNo]; [weakSelf.delTicketModel deleteTicketWithStrNo:deltTicketItem.strNo];
[weakSelf.alert removeFromSuperview]; [weakSelf.alert removeFromSuperview];
}]; }];
AppDelegate * app = (AppDelegate*)[UIApplication sharedApplication].delegate; AppDelegate * app = (AppDelegate*)[UIApplication sharedApplication].delegate;
[app.window addSubview:_alert]; [app.window addSubview:self.alert];
[_alert mas_makeConstraints:^(MASConstraintMaker *make) { [self.alert mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.mas_equalTo(@(0)); make.left.right.top.bottom.mas_equalTo(@(0));
}]; }];
}; };
...@@ -325,29 +325,31 @@ heightForFooterInSection:(NSInteger)section ...@@ -325,29 +325,31 @@ heightForFooterInSection:(NSInteger)section
[cell setUpDevice:deviceItem indexPath:indexPath]; [cell setUpDevice:deviceItem indexPath:indexPath];
} }
kWeakSelf(self);
cell.deleteDevice=^(int deleteRow){ cell.deleteDevice=^(int deleteRow){
kStrongSelf(self);
//tag+2000所以此处-2000; //tag+2000所以此处-2000;
DeviceItem * delDeviceItem=self.fetchTicketDeviceModel.ticketAndDevieceItem.equipmentList[deleteRow-2000]; DeviceItem * delDeviceItem=self.fetchTicketDeviceModel.ticketAndDevieceItem.equipmentList[deleteRow-2000];
if (_alert1!=nil) { if (self.alert1!=nil) {
[_alert1 removeFromSuperview]; [self.alert1 removeFromSuperview];
_alert1=nil; self.alert1=nil;
} }
_alert1=[[DeleteAlertView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)]; self.alert1=[[DeleteAlertView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
_alert1.message=@"是否确定删除设备"; self.alert1.message=@"是否确定删除设备";
__weak typeof(self) weakSelf=self; kWeakSelf(self);
[_alert1 setOkClick:^{ [self.alert1 setOkClick:^{
weakSelf.isFromDeleteSV=YES; kStrongSelf(self);
[weakSelf.delDeviceModel deleteDvieceWithEquipmentId:[NSString stringWithFormat:@"%ld",(long)delDeviceItem.equipmentId]]; self.isFromDeleteSV=YES;
[self.delDeviceModel deleteDvieceWithEquipmentId:[NSString stringWithFormat:@"%ld",(long)delDeviceItem.equipmentId]];
[weakSelf.alert1 removeFromSuperview]; [self.alert1 removeFromSuperview];
}]; }];
AppDelegate * app = (AppDelegate*)[UIApplication sharedApplication].delegate; AppDelegate * app = (AppDelegate*)[UIApplication sharedApplication].delegate;
[app.window addSubview:_alert1]; [app.window addSubview:self.alert1];
[_alert1 mas_makeConstraints:^(MASConstraintMaker *make) { [self.alert1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.mas_equalTo(@(0)); make.left.right.top.bottom.mas_equalTo(@(0));
}]; }];
}; };
......
// //
...@@ -113,12 +113,14 @@ ...@@ -113,12 +113,14 @@
[alert show]; [alert show];
return; return;
} }
__weak typeof (self) weakSelf=self; kWeakSelf(self);
codeView = [[GraphicsCode alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight) phoneNum:_phoneNumTextFeild.text]; codeView = [[GraphicsCode alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight) phoneNum:_phoneNumTextFeild.text];
codeView.fetchType = 3; codeView.fetchType = 3;
codeView.checkType = @"0"; codeView.checkType = @"0";
codeView.callBack = ^(NSString * code) { codeView.callBack = ^(NSString * code) {
[weakSelf initTimer]; kStrongSelf(self);
[self initTimer];
[self.checkCodeField becomeFirstResponder];
}; };
[codeView show:self]; [codeView show:self];
...@@ -162,8 +164,12 @@ ...@@ -162,8 +164,12 @@
- (IBAction)showBtn2Click:(id)sender { - (IBAction)showBtn2Click:(id)sender {
[self showBtnFucWithShowBtn:sender textField:_passwordFeild2]; [self showBtnFucWithShowBtn:sender textField:_passwordFeild2];
} }
- (IBAction)sureBtnClick:(id)sender { - (IBAction)sureBtnClick:(UIButton *)sender {
sender.enabled = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
sender.enabled = YES;
});
[[UIApplication sharedApplication].keyWindow endEditing:YES];
if ([_phoneNumTextFeild.text length] == 0) if ([_phoneNumTextFeild.text length] == 0)
{ {
[SVProgressHUD showErrorWithStatus:@"请输入手机号"]; [SVProgressHUD showErrorWithStatus:@"请输入手机号"];
...@@ -218,7 +224,6 @@ ...@@ -218,7 +224,6 @@
[ZXTool showText:error]; [ZXTool showText:error];
} else { } else {
[ZXTool showText:@"找回密码成功"]; [ZXTool showText:@"找回密码成功"];
[ZXTool backToLoginAndOperationInterface]; [ZXTool backToLoginAndOperationInterface];
} }
}); });
......
// //
...@@ -499,7 +499,10 @@ ...@@ -499,7 +499,10 @@
GraphicsCode *codeView = [[GraphicsCode alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight) phoneNum:self.phoneField.text]; GraphicsCode *codeView = [[GraphicsCode alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight) phoneNum:self.phoneField.text];
codeView.fetchType = 1; codeView.fetchType = 1;
codeView.checkType = @"1"; codeView.checkType = @"1";
kWeakSelf(self);
codeView.callBack = ^(NSString * code){ codeView.callBack = ^(NSString * code){
kStrongSelf(self);
[self.violaField becomeFirstResponder];
if ([code isEqualToString:@""]) { if ([code isEqualToString:@""]) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
NSString *S = [ZXTool getCurrentTime]; NSString *S = [ZXTool getCurrentTime];
......
// //
...@@ -265,10 +265,12 @@ ...@@ -265,10 +265,12 @@
codeView = [[GraphicsCode alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight) phoneNum:_phoneNumTextFeild.text]; codeView = [[GraphicsCode alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight) phoneNum:_phoneNumTextFeild.text];
codeView.fetchType = 4; codeView.fetchType = 4;
codeView.checkType = @"1"; codeView.checkType = @"1";
__weak typeof(self) weakself = self; kWeakSelf(self);
codeView.callBack = ^(NSString * code) codeView.callBack = ^(NSString * code)
{ {
[weakself initTimer]; kStrongSelf(self);
[self initTimer];
[self.checkCodeTextFeild becomeFirstResponder];
}; };
[codeView show:self]; [codeView show:self];
......
//
//
// ZXPopAnimationTool.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/8/23.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ZJAnimationPopView.h"
NS_ASSUME_NONNULL_BEGIN
@interface ZXPopAnimationTool : NSObject
/* 动态显示自定义弹窗视图
* showView 需要显示的自定义view
* 动画覆盖的view 默认是根window
* popStyle 动态弹出方式
* dismissStyle 淡出方式
* popComplete 显示完成回调
* dismissComplete 消失完成回调
*/
+ (ZJAnimationPopView *) showPopView:(UIView *) showView
fatherView:(UIView *) fatherView
popStyle:(ZJAnimationPopStyle) popStyle
dismissStyle:(ZJAnimationDismissStyle) dismissStyle
popComplete:(dispatch_block_t) popComplete
dismissComplete:(dispatch_block_t) dismissComplete;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXPopAnimationTool.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/8/23.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXPopAnimationTool.h"
@implementation ZXPopAnimationTool
+ (ZJAnimationPopView *) showPopView:(UIView *) showView
fatherView:(UIView *) fatherView
popStyle:(ZJAnimationPopStyle) popStyle
dismissStyle:(ZJAnimationDismissStyle) dismissStyle
popComplete:(dispatch_block_t) popComplete
dismissComplete:(dispatch_block_t) dismissComplete {
ZJAnimationPopView *popView = [[ZJAnimationPopView alloc] initWithCustomView:showView popStyle:popStyle dismissStyle:dismissStyle];
popView.fatherView = fatherView;
popView.isClickBGDismiss = YES;
popView.popBGAlpha = 0.5f;
popView.isObserverOrientationChange = YES;
popView.popComplete = popComplete;
popView.dismissComplete = dismissComplete;
//显示
[popView pop];
return popView;
}
@end
// //
...@@ -721,16 +721,14 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -721,16 +721,14 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
} }
+(void) backToLogin { +(void) backToLogin {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showLoadingAnimation];
});
dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_global_queue(0, 0), ^{
[XMGFileTool removeDirectoryPath:CachePath]; [XMGFileTool removeDirectoryPath:CachePath];
[ZXNotPay clearTable]; [ZXNotPay clearTable];
[ExpecptionModel clearTable]; [ExpecptionModel clearTable];
[ZXSections clearTable];
[ZXInformation clearTable];
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showLoadingAnimation];
});
NSString *appDomainStr = [[NSBundle mainBundle] bundleIdentifier]; NSString *appDomainStr = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomainStr]; [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomainStr];
//清空之后 重设api //清空之后 重设api
......
//
//
// ZJAnimationPopView.h
// ZJAnimationPopView <https://github.com/Abnerzj/ZJAnimationPopView>
//
// Created by Abnerzj on 2017/8/12.
// Copyright © 2017年 Abnerzj. All rights reserved.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <UIKit/UIKit.h>
/**
显示时动画弹框样式
*/
typedef NS_ENUM(NSInteger, ZJAnimationPopStyle) {
ZJAnimationPopStyleNO = 0, ///< 无动画
ZJAnimationPopStyleScale, ///< 缩放动画,先放大,后恢复至原大小
ZJAnimationPopStyleShakeFromTop, ///< 从顶部掉下到中间晃动动画
ZJAnimationPopStyleShakeFromBottom, ///< 从底部往上到中间晃动动画
ZJAnimationPopStyleShakeFromLeft, ///< 从左侧往右到中间晃动动画
ZJAnimationPopStyleShakeFromRight, ///< 从右侧往左到中间晃动动画
ZJAnimationPopStyleCardDropFromLeft, ///< 卡片从顶部左侧开始掉落动画
ZJAnimationPopStyleCardDropFromRight, ///< 卡片从顶部右侧开始掉落动画
ZJAnimationPopStyleLineFromBottom, ///< 平滑线性从底部推出来动画
};
/**
移除时动画弹框样式
*/
typedef NS_ENUM(NSInteger, ZJAnimationDismissStyle) {
ZJAnimationDismissStyleNO = 0, ///< 无动画
ZJAnimationDismissStyleScale, ///< 缩放动画
ZJAnimationDismissStyleDropToTop, ///< 从中间直接掉落到顶部
ZJAnimationDismissStyleDropToBottom, ///< 从中间直接掉落到底部
ZJAnimationDismissStyleDropToLeft, ///< 从中间直接掉落到左侧
ZJAnimationDismissStyleDropToRight, ///< 从中间直接掉落到右侧
ZJAnimationDismissStyleCardDropToLeft, ///< 卡片从中间往左侧掉落
ZJAnimationDismissStyleCardDropToRight, ///< 卡片从中间往右侧掉落
ZJAnimationDismissStyleCardDropToTop, ///< 卡片从中间往顶部移动消失
ZJAnimationDismissStyleLineToBottom, ///< 平滑线性掉落到底部动画
};
@interface ZJAnimationPopView : UIView
/** 显示时点击背景是否移除弹框,默认为NO。 */
@property (nonatomic) BOOL isClickBGDismiss;
/** 显示时是否监听屏幕旋转,默认为NO */
@property (nonatomic) BOOL isObserverOrientationChange;
/** 显示时背景的透明度,取值(0.0~1.0),默认为0.5 */
@property (nonatomic) CGFloat popBGAlpha;
/** fatherview */
@property (nonatomic, weak) UIView *fatherView;
/// 动画相关属性参数
/** 显示时动画时长,>= 0。不设置则使用默认的动画时长 */
@property (nonatomic) CGFloat popAnimationDuration;
/** 隐藏时动画时长,>= 0。不设置则使用默认的动画时长 */
@property (nonatomic) CGFloat dismissAnimationDuration;
/** 显示完成回调 */
@property (nullable, nonatomic, copy) void(^popComplete)(void);
/** 移除完成回调 */
@property (nullable, nonatomic, copy) void(^dismissComplete)(void);
/**
通过自定义视图来构造弹框视图
@param customView 自定义视图
*/
- (nullable instancetype)initWithCustomView:(UIView *_Nonnull)customView
popStyle:(ZJAnimationPopStyle)popStyle
dismissStyle:(ZJAnimationDismissStyle)dismissStyle;
/**
显示弹框
*/
- (void)pop;
/**
移除弹框
*/
- (void)dismiss;
@end
//
//
// ZJAnimationPopView.m
// ZJAnimationPopView <https://github.com/Abnerzj/ZJAnimationPopView>
//
// Created by Abnerzj on 2017/8/12.
// Copyright © 2017年 Abnerzj. All rights reserved.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import "ZJAnimationPopView.h"
// 角度转弧度
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
@interface ZJAnimationPopView ()<UIGestureRecognizerDelegate>
/** 内容视图 */
@property (nonatomic, strong) UIView *contentView;
/** 背景层 */
@property (nonatomic, strong) UIView *backgroundView;
/** 自定义视图 */
@property (nonatomic, strong) UIView *customView;
/** 显示时动画弹框样式 */
@property (nonatomic) ZJAnimationPopStyle animationPopStyle;
/** 移除时动画弹框样式 */
@property (nonatomic) ZJAnimationDismissStyle animationDismissStyle;
/** 显示时背景是否透明,透明度是否为<= 0,默认为NO */
@property (nonatomic) BOOL isTransparent;
@end
@implementation ZJAnimationPopView
- (nullable instancetype)initWithCustomView:(UIView *_Nonnull)customView
popStyle:(ZJAnimationPopStyle)popStyle
dismissStyle:(ZJAnimationDismissStyle)dismissStyle
{
// 检测自定义视图是否存在(check customView is exist)
if (!customView) {
return nil;
}
self = [super init];
if (self) {
_isClickBGDismiss = NO;
_isObserverOrientationChange = NO;
_popBGAlpha = 0.5f;
_isTransparent = NO;
_customView = customView;
_animationPopStyle = popStyle;
_animationDismissStyle = dismissStyle;
_popAnimationDuration = -0.1f;
_dismissAnimationDuration = -0.1f;
self.backgroundColor = [UIColor clearColor];
self.frame = CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height);
_backgroundView = [[UIView alloc] initWithFrame:self.bounds];
_backgroundView.backgroundColor = [UIColor blackColor];
_backgroundView.alpha = 0.0f;
[self addSubview:_backgroundView];
_contentView = [[UIView alloc] initWithFrame:self.bounds];
_contentView.backgroundColor = [UIColor clearColor];
[self addSubview:_contentView];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapBGLayer:)];
tap.delegate = self;
[_contentView addGestureRecognizer:tap];
customView.center = _contentView.center;
[_contentView addSubview:customView];
}
return self;
}
- (void)setIsObserverOrientationChange:(BOOL)isObserverOrientationChange
{
_isObserverOrientationChange = isObserverOrientationChange;
if (_isObserverOrientationChange) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarOrientationChange:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
}
}
- (void)setPopBGAlpha:(CGFloat)popBGAlpha
{
_popBGAlpha = (popBGAlpha <= 0.0f) ? 0.0f : ((popBGAlpha > 1.0) ? 1.0 : popBGAlpha);
_isTransparent = (_popBGAlpha == 0.0f);
}
#pragma mark 点击背景(Click background)
- (void)tapBGLayer:(UITapGestureRecognizer *)tap
{
if (_isClickBGDismiss) {
[self dismiss];
}
}
#pragma mark UIGestureRecognizer Delegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
CGPoint location = [touch locationInView:_contentView];
location = [_customView.layer convertPoint:location fromLayer:_contentView.layer];
return ![_customView.layer containsPoint:location];
}
- (void)pop
{
if (self.fatherView) {
[self.fatherView addSubview:self];
} else {
[[UIApplication sharedApplication].keyWindow addSubview:self];
}
__weak typeof(self) ws = self;
NSTimeInterval defaultDuration = [self getPopDefaultDuration:self.animationPopStyle];
NSTimeInterval duration = (_popAnimationDuration < 0.0f) ? defaultDuration : _popAnimationDuration;
if (self.animationPopStyle == ZJAnimationPopStyleNO) {
self.alpha = 0.0;
if (self.isTransparent) {
self.backgroundView.backgroundColor = [UIColor clearColor];
} else {
self.backgroundView.alpha = 0.0;
}
[UIView animateWithDuration:duration animations:^{
ws.alpha = 1.0;
if (!ws.isTransparent) {
ws.backgroundView.alpha = ws.popBGAlpha;
}
}];
} else {
if (ws.isTransparent) {
self.backgroundView.backgroundColor = [UIColor clearColor];
} else {
self.backgroundView.alpha = 0.0;
[UIView animateWithDuration:duration * 0.5 animations:^{
ws.backgroundView.alpha = ws.popBGAlpha;
}];
}
[self hanlePopAnimationWithDuration:duration];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (ws.popComplete) {
ws.popComplete();
}
});
}
- (void)dismiss
{
__weak typeof(self) ws = self;
NSTimeInterval defaultDuration = [self getDismissDefaultDuration:self.animationDismissStyle];
NSTimeInterval duration = (_dismissAnimationDuration < 0.0f) ? defaultDuration : _dismissAnimationDuration;
if (self.animationDismissStyle == ZJAnimationPopStyleNO) {
[UIView animateWithDuration:duration animations:^{
ws.alpha = 0.0;
ws.backgroundView.alpha = 0.0;
}];
} else {
if (!ws.isTransparent) {
[UIView animateWithDuration:duration * 0.5 animations:^{
ws.backgroundView.alpha = 0.0;
}];
}
[self hanleDismissAnimationWithDuration:duration];
}
if (ws.isObserverOrientationChange) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (ws.dismissComplete) {
ws.dismissComplete();
}
[ws removeFromSuperview];
});
// Immediately respond to other places with animated dismiss
self.frame = CGRectZero;
}
- (void)hanlePopAnimationWithDuration:(NSTimeInterval)duration
{
__weak typeof(self) ws = self;
switch (self.animationPopStyle) {
case ZJAnimationPopStyleScale:
{
[self animationWithLayer:self.contentView.layer duration:duration values:@[@0.0, @1.2, @1.0]]; // 另外一组动画值(the other animation values) @[@0.0, @1.2, @0.9, @1.0]
}
break;
case ZJAnimationPopStyleShakeFromTop:
case ZJAnimationPopStyleShakeFromBottom:
case ZJAnimationPopStyleShakeFromLeft:
case ZJAnimationPopStyleShakeFromRight:
{
CGPoint startPosition = self.contentView.layer.position;
if (self.animationPopStyle == ZJAnimationPopStyleShakeFromTop) {
self.contentView.layer.position = CGPointMake(startPosition.x, -startPosition.y);
} else if (self.animationPopStyle == ZJAnimationPopStyleShakeFromBottom) {
self.contentView.layer.position = CGPointMake(startPosition.x, CGRectGetMaxY(self.frame) + startPosition.y);
} else if (self.animationPopStyle == ZJAnimationPopStyleShakeFromLeft) {
self.contentView.layer.position = CGPointMake(-startPosition.x, startPosition.y);
} else {
self.contentView.layer.position = CGPointMake(CGRectGetMaxX(self.frame) + startPosition.x, startPosition.y);
}
[UIView animateWithDuration:duration delay:0 usingSpringWithDamping:0.6 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
ws.contentView.layer.position = startPosition;
} completion:nil];
}
break;
case ZJAnimationPopStyleCardDropFromLeft:
case ZJAnimationPopStyleCardDropFromRight:
{
CGPoint startPosition = self.contentView.layer.position;
if (self.animationPopStyle == ZJAnimationPopStyleCardDropFromLeft) {
self.contentView.layer.position = CGPointMake(startPosition.x * 1.0, -startPosition.y);
self.contentView.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(15.0));
} else {
self.contentView.layer.position = CGPointMake(startPosition.x * 1.0, -startPosition.y);
self.contentView.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(-15.0));
}
[UIView animateWithDuration:duration delay:0 usingSpringWithDamping:0.75 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
ws.contentView.layer.position = startPosition;
} completion:nil];
[UIView animateWithDuration:duration*0.6 animations:^{
ws.contentView.layer.transform = CATransform3DMakeRotation(DEGREES_TO_RADIANS((ws.animationPopStyle == ZJAnimationPopStyleCardDropFromRight) ? 5.5 : -5.5), 0, 0, 0);
} completion:^(BOOL finished) {
[UIView animateWithDuration:duration*0.2 animations:^{
ws.contentView.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS((ws.animationPopStyle == ZJAnimationPopStyleCardDropFromRight) ? -1.0 : 1.0));
} completion:^(BOOL finished) {
[UIView animateWithDuration:duration*0.2 animations:^{
ws.contentView.transform = CGAffineTransformMakeRotation(0.0);
} completion:nil];
}];
}];
}
break;
case ZJAnimationPopStyleLineFromBottom:
{
CGPoint startPosition = self.contentView.layer.position;
CGFloat customViewY = CGRectGetMaxY(self.frame) - self.customView.frame.size.height;
CGFloat customViewCenterY = customViewY + self.customView.frame.size.height * 0.5;
CGPoint endPosition = CGPointMake(startPosition.x, customViewCenterY);
self.contentView.layer.position = CGPointMake(startPosition.x, CGRectGetMaxY(self.frame) + startPosition.y);
[UIView animateWithDuration:duration animations:^{
ws.contentView.layer.position = endPosition;
}];
}
break;
default:
break;
}
}
- (void)hanleDismissAnimationWithDuration:(NSTimeInterval)duration
{
__weak typeof(self) ws = self;
switch (self.animationDismissStyle) {
case ZJAnimationDismissStyleScale:
{
[self animationWithLayer:self.contentView.layer duration:duration values:@[@1.0, @0.66, @0.33, @0.01]];
}
break;
case ZJAnimationDismissStyleDropToTop:
case ZJAnimationDismissStyleDropToBottom:
case ZJAnimationDismissStyleDropToLeft:
case ZJAnimationDismissStyleDropToRight:
{
CGPoint startPosition = self.contentView.layer.position;
CGPoint endPosition = self.contentView.layer.position;
if (self.animationDismissStyle == ZJAnimationDismissStyleDropToTop) {
endPosition = CGPointMake(startPosition.x, -startPosition.y);
} else if (self.animationDismissStyle == ZJAnimationDismissStyleDropToBottom) {
endPosition = CGPointMake(startPosition.x, CGRectGetMaxY(self.frame) + startPosition.y);
} else if (self.animationDismissStyle == ZJAnimationDismissStyleDropToLeft) {
endPosition = CGPointMake(-startPosition.x, startPosition.y);
} else {
endPosition = CGPointMake(CGRectGetMaxX(self.frame) + startPosition.x, startPosition.y);
}
[UIView animateWithDuration:duration delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
ws.contentView.layer.position = endPosition;
} completion:nil];
}
break;
case ZJAnimationDismissStyleCardDropToLeft:
case ZJAnimationDismissStyleCardDropToRight:
{
CGPoint startPosition = self.contentView.layer.position;
BOOL isLandscape = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation);
__block CGFloat rotateEndY = 0.0f;
[UIView animateWithDuration:duration delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
if (self.animationDismissStyle == ZJAnimationDismissStyleCardDropToLeft) {
ws.contentView.transform = CGAffineTransformMakeRotation(M_1_PI * 0.75);
if (isLandscape) rotateEndY = fabs(ws.contentView.frame.origin.y);
ws.contentView.layer.position = CGPointMake(startPosition.x, CGRectGetMaxY(ws.frame) + startPosition.y + rotateEndY);
} else {
ws.contentView.transform = CGAffineTransformMakeRotation(-M_1_PI * 0.75);
if (isLandscape) rotateEndY = fabs(ws.contentView.frame.origin.y);
ws.contentView.layer.position = CGPointMake(startPosition.x * 1.25, CGRectGetMaxY(ws.frame) + startPosition.y + rotateEndY);
}
} completion:nil];
}
break;
case ZJAnimationDismissStyleCardDropToTop:
{
CGPoint startPosition = self.contentView.layer.position;
CGPoint endPosition = CGPointMake(startPosition.x, -startPosition.y);
[UIView animateWithDuration:duration*0.2 animations:^{
ws.contentView.layer.position = CGPointMake(startPosition.x, startPosition.y + 50.0f);
} completion:^(BOOL finished) {
[UIView animateWithDuration:duration*0.8 animations:^{
ws.contentView.layer.position = endPosition;
} completion:nil];
}];
}
break;
case ZJAnimationDismissStyleLineToBottom:
{
CGPoint startPosition = self.contentView.layer.position;
CGPoint endPosition = CGPointMake(startPosition.x, CGRectGetMaxY(self.frame) + startPosition.y);
[UIView animateWithDuration:duration animations:^{
ws.contentView.layer.position = endPosition;
}];
}
break;
default:
break;
}
}
- (NSTimeInterval)getPopDefaultDuration:(ZJAnimationPopStyle)animationPopStyle
{
NSTimeInterval defaultDuration = 0.0f;
if (animationPopStyle == ZJAnimationPopStyleNO) {
defaultDuration = 0.2f;
} else if (animationPopStyle == ZJAnimationPopStyleScale ||
animationPopStyle == ZJAnimationPopStyleLineFromBottom) {
defaultDuration = 0.3f;
} else if (animationPopStyle == ZJAnimationPopStyleShakeFromTop ||
animationPopStyle == ZJAnimationPopStyleShakeFromBottom ||
animationPopStyle == ZJAnimationPopStyleShakeFromLeft ||
animationPopStyle == ZJAnimationPopStyleShakeFromRight ||
animationPopStyle == ZJAnimationPopStyleCardDropFromLeft ||
animationPopStyle == ZJAnimationPopStyleCardDropFromRight) {
defaultDuration = 0.8f;
}
return defaultDuration;
}
- (NSTimeInterval)getDismissDefaultDuration:(ZJAnimationDismissStyle)animationDismissStyle
{
NSTimeInterval defaultDuration = 0.0f;
if (animationDismissStyle == ZJAnimationDismissStyleNO ||
animationDismissStyle == ZJAnimationDismissStyleScale) {
defaultDuration = 0.2f;
} else if (animationDismissStyle == ZJAnimationDismissStyleLineToBottom) {
defaultDuration = 0.3f;
} else if (animationDismissStyle == ZJAnimationDismissStyleDropToTop ||
animationDismissStyle == ZJAnimationDismissStyleDropToBottom ||
animationDismissStyle == ZJAnimationDismissStyleDropToLeft ||
animationDismissStyle == ZJAnimationDismissStyleDropToRight ||
animationDismissStyle == ZJAnimationDismissStyleCardDropToLeft ||
animationDismissStyle == ZJAnimationDismissStyleCardDropToRight ||
animationDismissStyle == ZJAnimationDismissStyleCardDropToTop) {
defaultDuration = 0.8f;
}
return defaultDuration;
}
- (void)animationWithLayer:(CALayer *)layer duration:(CGFloat)duration values:(NSArray *)values
{
CAKeyframeAnimation *KFAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
KFAnimation.duration = duration;
KFAnimation.removedOnCompletion = NO;
KFAnimation.fillMode = kCAFillModeForwards;
NSMutableArray *valueArr = [NSMutableArray arrayWithCapacity:values.count];
for (NSUInteger i = 0; i<values.count; i++) {
CGFloat scaleValue = [values[i] floatValue];
[valueArr addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(scaleValue, scaleValue, scaleValue)]];
}
KFAnimation.values = valueArr;
KFAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
[layer addAnimation:KFAnimation forKey:nil];
}
#pragma mark 监听横竖屏方向改变
- (void)statusBarOrientationChange:(NSNotification *)notification
{
CGRect startCustomViewRect = self.customView.frame;
self.frame = CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height);
self.backgroundView.frame = self.bounds;
self.contentView.frame = self.bounds;
self.customView.frame = startCustomViewRect;
self.customView.center = self.center;
}
@end
...@@ -52,35 +52,13 @@ ...@@ -52,35 +52,13 @@
#import <MJExtension.h> #import <MJExtension.h>
#import "ZXCustomAdView.h" #import "ZXCustomAdView.h"
#import "ZXScannerViewController.h" #import "ZXScannerViewController.h"
#import "ZXPopAnimationTool.h"
#define APPversion [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] #define APPversion [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"]
#define kWidth [UIScreen mainScreen].bounds.size.width //屏幕宽度 #define kWidth [UIScreen mainScreen].bounds.size.width //屏幕宽度
#define kHeight [UIScreen mainScreen].bounds.size.height//屏幕高度 #define kHeight [UIScreen mainScreen].bounds.size.height//屏幕高度
#define uploadeUrlStr [NSString stringWithFormat:@""]//上传地址 #define uploadeUrlStr [NSString stringWithFormat:@""]//上传地址
//#define requestUrlStr [NSString stringWithFormat:@"http://api.dcrym.com/dcintsrv/mt/entrance.do"]//发布地址
//#define requestAliUrlStr [NSString stringWithFormat:@"http://api.dcrym.com/dcintsrv/pay/createAliOrder.do"]//支付宝发布接口地址
//#define requestWeiXinUrlStr [NSString stringWithFormat:@"http://api.dcrym.com/dcintsrv/pay/createWxOrder.do"]//微信接发布口地址
//#define requestUrlStr [NSString stringWithFormat:@"http://test.pxkjcn.com/dcintsrv/mt/entrance.do"]//外网测试地址
//#define requestAliUrlStr [NSString stringWithFormat:@"http://test.pxkjcn.com/dcintsrv/pay/createAliOrder.do"]//支付宝接口地址
//#define requestWeiXinUrlStr [NSString stringWithFormat:@"http://test.pxkjcn.com/dcintsrv/pay/createWxOrder.do"]//微信接口地址
//#define SqurerequestUrlStr [NSString stringWithFormat:@"http://192.168.1.193:8089/dclatintsrv/mt/entrance.do"]//格子蒋
//#define SqureImageUploadUrlStr [NSString stringWithFormat:@"http://192.168.1.193:8089/dclatintsrv/hardware/fileUpload.do"]//格子上传图片将
////数据测试
//#define requestUrlStr [NSString stringWithFormat:@"http://test.dcrym.com:8090/dcintsrv_drds/mt/entrance.do"]//外网测试地址
//#define requestAliUrlStr [NSString stringWithFormat:@"http://test.dcrym.com:8090/dcintsrv_drds/pay/createAliOrder.do"]//支付宝接口地址
//#define requestWeiXinUrlStr [NSString stringWithFormat:@"http://test.dcrym.com:8090/dcintsrv_drds/pay/createWxOrder.do"]//微信接口地址
//#define requestUrlStr [NSString stringWithFormat:@"%@/dcintsrv/mt/entrance.do",[[NSUserDefaults standardUserDefaults] objectForKey:@"schoolIp"]]//外网测试地址
//#define requestAliUrlStr [NSString stringWithFormat:@"%@/dcintsrv/pay/createAliOrder.do",[[NSUserDefaults standardUserDefaults] objectForKey:@"schoolIp"]]//支付宝接口地址
//#define requestWeiXinUrlStr [NSString stringWithFormat:@"%@/dcintsrv/pay/createWxOrder.do",[[NSUserDefaults standardUserDefaults] objectForKey:@"schoolIp"]]//微信接口地址
////
//#define SqurerequestUrlStr [NSString stringWithFormat:@"%@/dclatintsrv/mt/entrance.do",[[NSUserDefaults standardUserDefaults] objectForKey:@"squreIp"]]
//#define SqureImageUploadUrlStr [NSString stringWithFormat:@"%@/dclatintsrv/hardware/fileUpload.do",[[NSUserDefaults standardUserDefaults] objectForKey:@"squreIp"]]//格子上传图片将
#define requestUrlStr [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"schoolIp"]]//外网测试地址 #define requestUrlStr [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"schoolIp"]]//外网测试地址
#define requestAliUrlStr [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"Ali"]]//支付宝接口地址 #define requestAliUrlStr [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"Ali"]]//支付宝接口地址
......
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