Commit 49adcba8 by 刘卓鑫

yuy预约洗浴部分代码

parent d51796be
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</AdditionalOptions> </AdditionalOptions>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/Tool(&#x5de5;&#x5177;)/ZXTool.m" filePath = "ColorfulSchool/Classes/Tool(&#x5de5;&#x5177;)/ZXTool.m"
timestampString = "582185487.845978" timestampString = "583834704.385074"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "1871" startingLineNumber = "1999"
endingLineNumber = "1871" endingLineNumber = "1999"
landmarkName = "+codePageIsNeedCheckNotPayOrder:" landmarkName = "+codePageIsNeedCheckNotPayOrder:"
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/JTJY(&#x91d1;&#x56fe;&#x6559;&#x80b2;)/ZXJTJYViewController.m" filePath = "ColorfulSchool/Classes/JTJY(&#x91d1;&#x56fe;&#x6559;&#x80b2;)/ZXJTJYViewController.m"
timestampString = "581503531.2722549" timestampString = "583656856.343848"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "124" startingLineNumber = "124"
...@@ -45,5 +45,21 @@ ...@@ -45,5 +45,21 @@
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ColorfulSchool/Classes/NewFirstPage(&#x65b0;&#x7248;&#x9996;&#x9875;)/Controllers/ZTHomeViewController+Extension.m"
timestampString = "583656856.343922"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "277"
endingLineNumber = "277"
landmarkName = "-firstPageJumpActionWithInfo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#import <MediaPlayer/MediaPlayer.h> #import <MediaPlayer/MediaPlayer.h>
#import "ZXSimpleRootTabbarController.h" #import "ZXSimpleRootTabbarController.h"
#import "UpdateVersionModel.h" #import "UpdateVersionModel.h"
//#import <Bugly/Bugly.h>
#define TIME_ANIMATION 1.0 #define TIME_ANIMATION 1.0
#define PERSPECTIVE -1.0 / 200.0 #define PERSPECTIVE -1.0 / 200.0
#define ROTATION_ANGLE M_PI_2 #define ROTATION_ANGLE M_PI_2
...@@ -66,14 +66,14 @@ ...@@ -66,14 +66,14 @@
[self defaultConfig]; [self defaultConfig];
//启动环境 //启动环境
[APIManager sharedAPIManager].lauchEnvironment = ZXColorfulSchoolEnvironmentProduct; [APIManager sharedAPIManager].lauchEnvironment = ZXColorfulSchoolEnvironmentTest;
//bugly //bugly
[Bugly startWithAppId:@"d3a5bd8d35"]; [Bugly startWithAppId:@"d3a5bd8d35"];
//防止crash //防止crash
[JJException configExceptionCategory:JJExceptionGuardAll]; // [JJException configExceptionCategory:JJExceptionGuardAll];
[JJException startGuardException]; // [JJException startGuardException];
//极光推送 //极光推送
[self initPushWithOptions:launchOptions isProduct:kJPushIsProduct]; [self initPushWithOptions:launchOptions isProduct:kJPushIsProduct];
...@@ -87,6 +87,30 @@ ...@@ -87,6 +87,30 @@
//设置根视图 //设置根视图
[self createWindow]; [self createWindow];
//开屏广告
if (CacheUserId && [[kUserDefaults objectForKey:kAPP_LauchAD] isEqualToString:@"yes"]) {
[[ZXTXAdTool sharedZXTXAdTool] createLauchAdByPlacmentId:kTXAdLauchPLACEMENTID];
}
//获取当前用户是否开启开屏
if (CacheUserId) {
[ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/tencent/advertisement/spread?id=%@&sourceType=iOS", [kUserDefaults valueForKey:@"SX_MONEY"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
if (common && [common.data[@"whether"] integerValue] == 1) {
[kUserDefaults setObject:@"yes" forKey:kAPP_LauchAD];
if (common.data[@"millisecond"] && [common.data[@"millisecond"] integerValue]) {
[kUserDefaults setObject:common.data[@"millisecond"] forKey:kAPP_LauchADCloseTimeinterval];
} else {
[kUserDefaults removeObjectForKey:kAPP_LauchADCloseTimeinterval];
}
} else {
[kUserDefaults setObject:@"no" forKey:kAPP_LauchAD];
[kUserDefaults removeObjectForKey:kAPP_LauchADCloseTimeinterval];
}
}];
}
// //本地版本检测 // //本地版本检测
// @weakify(self); // @weakify(self);
// [self localVersionCheckCompleted:^{ // [self localVersionCheckCompleted:^{
...@@ -180,10 +204,10 @@ ...@@ -180,10 +204,10 @@
- (void)applicationDidEnterBackground:(UIApplication *)application { - (void)applicationDidEnterBackground:(UIApplication *)application {
@try {
UIViewController *vc = [ZXTool getCurrentVC]; UIViewController *vc = [ZXTool getCurrentVC];
if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXDrinkViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXBathViewController")]) { @try {
if ([vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXDrinkViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXBathViewController")] ) {
[[NSNotificationCenter defaultCenter] postNotificationName:kSelf_help_destory_timer object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kSelf_help_destory_timer object:nil];
} }
...@@ -193,6 +217,15 @@ ...@@ -193,6 +217,15 @@
} @finally { } @finally {
} }
if ([vc isKindOfClass:NSClassFromString(@"ZXBannerJumpViewController")]) {
if ([AVAudioSession sharedInstance].isOtherAudioPlaying) {
NSError *err;
[[AVAudioSession sharedInstance] setActive:YES withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:&err];
NSLog(@"%@", err);
}
}
[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil]; [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
} }
...@@ -401,7 +434,7 @@ ...@@ -401,7 +434,7 @@
advertisingIdentifier:advertisingId]; advertisingIdentifier:advertisingId];
[JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) { [JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) {
if (resCode == 0) { if (resCode == 0) {
NSLog(@"你手机的registrationID = = = %@",registrationID); NSLog(@"你手机的registrationID = = = %@-----用户id= = = %@",registrationID, CacheUserId?CacheUserId:@"null");
} }
}]; }];
} }
......
// //
...@@ -53,8 +53,10 @@ kSINGLETON_FOR_CLASS(APIManager) ...@@ -53,8 +53,10 @@ kSINGLETON_FOR_CLASS(APIManager)
// [userDefaults setObject:@"http://192.168.1.33:8333" forKey:@"NEW_PAY"]; // [userDefaults setObject:@"http://192.168.1.33:8333" forKey:@"NEW_PAY"];
[userDefaults setObject:@"http://ex-dev-dcxy-base-app.168cad.top" forKey:@"SX_MONEY"]; [userDefaults setObject:@"http://ex-dev-dcxy-base-app.168cad.top" forKey:@"SX_MONEY"];
[userDefaults setValue:@"http://121.15.180.66:801/netpayment/BaseHttp.dll?MB_EUserPay" forKey:@"YWT_PAY"]; [userDefaults setValue:@"http://121.15.180.66:801/netpayment/BaseHttp.dll?MB_EUserPay" forKey:@"YWT_PAY"];
[userDefaults setObject:@"http://192.168.3.55:8888" forKey:@"BATH"]; // [userDefaults setObject:@"http://192.168.3.55:8888" forKey:@"BATH"];
// [userDefaults setObject:@"http://app-server.nat123.net:28881" forKey:@"BATH"]; [userDefaults setObject:@"http://ex-shower-app-server.168cad.top" forKey:@"BATH"];
// [userDefaults setObject:@"http://ex-shower-app-server.168cad.top" forKey:@"AppointBATH"];
[userDefaults setObject:@"http://192.168.3.57:8880" forKey:@"AppointBATH"];
[userDefaults synchronize]; [userDefaults synchronize];
break; break;
......
// //
...@@ -76,6 +76,15 @@ static NSString *kFailurMsg = @"数据加载失败,请检查一下当前网络 ...@@ -76,6 +76,15 @@ static NSString *kFailurMsg = @"数据加载失败,请检查一下当前网络
#define kMALL_INDEX_KEY @"main_page_index" #define kMALL_INDEX_KEY @"main_page_index"
//app开屏广告启动标记
#define kAPP_LauchAD @"kAPP_LauchAD"
//app开屏广告关闭时间
#define kAPP_LauchADCloseTimeinterval @"kAPP_LauchADCloseTimeinterval"
//获取系统对象 //获取系统对象
#define kApplication [UIApplication sharedApplication] #define kApplication [UIApplication sharedApplication]
#define kAppWindow [UIApplication sharedApplication].delegate.window #define kAppWindow [UIApplication sharedApplication].delegate.window
......
// //
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
} }
} }
NSDictionary *dic = @{@"appVersion":APPversion,@"systemVersion":[NSString stringWithFormat:@"%@", [UIDevice currentDevice].systemVersion], @"deviceInfo":[ZXTool getCurrentDevice],@"networkInfo":netInfo, @"phone":CacheAccount?[CacheAccount stringByReplacingOccurrencesOfString:[CacheAccount substringWithRange:NSMakeRange(3, 4)] withString:@"****"]:@"", @"uuid":[[[UIDevice currentDevice] identifierForVendor] UUIDString], @"sourceType":@"iOS", @"areaId":CacheCampusId?CacheCampusId:@""}; NSDictionary *dic = @{@"appVersion":APPversion,@"systemVersion":[NSString stringWithFormat:@"%@", [UIDevice currentDevice].systemVersion], @"deviceInfo":[ZXTool getCurrentDevice],@"networkInfo":netInfo, @"phone":CacheAccount?[CacheAccount stringByReplacingOccurrencesOfString:[CacheAccount substringWithRange:NSMakeRange(3, 4)] withString:@"****"]:@"", @"uuid":[[[UIDevice currentDevice] identifierForVendor] UUIDString], @"sourceType":@"iOS", @"areaId":CacheCampusId?CacheCampusId:@""};
request.headers = @{@"token": CacheToken,@"reqSource":@"app", @"Content-Type":@"application/json", @"clientSource":[dic mj_JSONString]}; request.headers = @{@"token": CacheToken?CacheToken:@"",@"reqSource":@"app", @"Content-Type":@"application/json", @"clientSource":[dic mj_JSONString]};
} onSuccess:^(id responseObject) { } onSuccess:^(id responseObject) {
CommonModel *common = [CommonModel mj_objectWithKeyValues:responseObject]; CommonModel *common = [CommonModel mj_objectWithKeyValues:responseObject];
......
// //
...@@ -617,7 +617,10 @@ ...@@ -617,7 +617,10 @@
#pragma mark - ========== 确认注册 ========== #pragma mark - ========== 确认注册 ==========
- (void) OKAction:(UIButton *) sender { - (void) OKAction:(UIButton *) sender {
if ([BYHelp stringContainsEmoji:self.nameField.text]) {
[ZXTool showText:@"用户名不能含有表情"];
return;
}
if ([self.phoneField.text length] != 11) { if ([self.phoneField.text length] != 11) {
[ZXTool showText:@"请输入11位手机号"]; [ZXTool showText:@"请输入11位手机号"];
return; return;
......
// //
...@@ -60,6 +60,8 @@ static NSString * const ID = @"CollectionCell"; ...@@ -60,6 +60,8 @@ static NSString * const ID = @"CollectionCell";
@property (nonatomic)ZX_recharge_item * selectTopUpItem; @property (nonatomic)ZX_recharge_item * selectTopUpItem;
//是否是充值完成
@property (nonatomic, assign) BOOL isRechargeCompleted;
@property (nonatomic)NSString * payTypeStr; @property (nonatomic)NSString * payTypeStr;
...@@ -114,8 +116,11 @@ static NSString * const ID = @"CollectionCell"; ...@@ -114,8 +116,11 @@ static NSString * const ID = @"CollectionCell";
} }
[beanCollectionView reloadData]; [beanCollectionView reloadData];
if ([self.accountDataModel.accountDataModelItem.aimiMoney isEqualToString:self.moneyLabel.text]) {
[ZXTool showText:@"由于网络原因,本次充值可能延迟到账,请稍后查看余额"];
} else {
self.moneyLabel.text=self.accountDataModel.accountDataModelItem.aimiMoney; self.moneyLabel.text=self.accountDataModel.accountDataModelItem.aimiMoney;
}
} }
} else if (object == self.topUpDataModel) { } else if (object == self.topUpDataModel) {
if ([keyPath isEqualToString:@"isLoaded"]) { if ([keyPath isEqualToString:@"isLoaded"]) {
...@@ -220,6 +225,7 @@ static NSString * const ID = @"CollectionCell"; ...@@ -220,6 +225,7 @@ static NSString * const ID = @"CollectionCell";
self.topUpDataModel= [FetchWalletTopUpDataModel new]; self.topUpDataModel= [FetchWalletTopUpDataModel new];
self.isNeedOld = YES; self.isNeedOld = YES;
self.isRechargeCompleted = NO;
self.naConstant.constant = kStatusBarHeight; self.naConstant.constant = kStatusBarHeight;
[self checkWalletData]; [self checkWalletData];
self.tableView.delegate=self; self.tableView.delegate=self;
...@@ -345,7 +351,11 @@ static NSString * const ID = @"CollectionCell"; ...@@ -345,7 +351,11 @@ static NSString * const ID = @"CollectionCell";
for (NSDictionary *dic in common.data) { for (NSDictionary *dic in common.data) {
servicePeasListItem *item = [servicePeasListItem mj_objectWithKeyValues:dic]; servicePeasListItem *item = [servicePeasListItem mj_objectWithKeyValues:dic];
if ([item.serviceId isEqualToString:@"0"]) { if ([item.serviceId isEqualToString:@"0"]) {
if ([[NSString stringWithFormat:@"%.2f", item.money] isEqualToString:self.moneyLabel.text]) {
[ZXTool showText:@"由于网络原因,本次充值可能延迟到账,请稍后查看余额"];
} else {
self.moneyLabel.text=[NSString stringWithFormat:@"%.2f", item.money]; self.moneyLabel.text=[NSString stringWithFormat:@"%.2f", item.money];
}
} else { } else {
[self.moneyArray addObject:item]; [self.moneyArray addObject:item];
...@@ -585,8 +595,11 @@ heightForFooterInSection:(NSInteger)section { ...@@ -585,8 +595,11 @@ heightForFooterInSection:(NSInteger)section {
for (NSDictionary *dic in common.data) { for (NSDictionary *dic in common.data) {
servicePeasListItem *item = [servicePeasListItem mj_objectWithKeyValues:dic]; servicePeasListItem *item = [servicePeasListItem mj_objectWithKeyValues:dic];
if ([item.serviceId isEqualToString:@"0"]) { if ([item.serviceId isEqualToString:@"0"]) {
if ([[NSString stringWithFormat:@"%.2f", item.money] isEqualToString:self.moneyLabel.text]) {
[ZXTool showText:@"由于网络原因,本次充值可能延迟到账,请稍后查看余额"];
} else {
self.moneyLabel.text=[NSString stringWithFormat:@"%.2f", item.money]; self.moneyLabel.text=[NSString stringWithFormat:@"%.2f", item.money];
}
} else { } else {
[self.moneyArray addObject:item]; [self.moneyArray addObject:item];
} }
......
// //
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#import "ZXDrinkConfig.h" #import "ZXDrinkConfig.h"
#import "ZXJTJYViewController.h" #import "ZXJTJYViewController.h"
#import <JDSDK/KeplerApiManager.h> #import <JDSDK/KeplerApiManager.h>
#import "ZXAppointBathService.h"
@implementation ZTHomeViewController (Extension) @implementation ZTHomeViewController (Extension)
#pragma mark - ========== 跳转外联 ========== #pragma mark - ========== 跳转外联 ==========
...@@ -43,8 +44,10 @@ ...@@ -43,8 +44,10 @@
[self.navigationController pushViewController:tabbarVC animated:YES]; [self.navigationController pushViewController:tabbarVC animated:YES];
} else if ([operation.defaultValue isEqualToString:@"999"]) { } else if ([operation.defaultValue isEqualToString:@"999"]) {
UIViewController *vc= [[NSClassFromString(@"ZXColorfulBookController") alloc] init]; [[ZXAppointBathService new] getCampusUseModeCompleted:^(BOOL is) {
UIViewController *vc= [[NSClassFromString(@"ZXAppointBathTabbarViewController") alloc] init];
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
}];
} else if ([operation.defaultValue isEqualToString:@"998"]) { } else if ([operation.defaultValue isEqualToString:@"998"]) {
//跳转商城 //跳转商城
if (self.jumpToMall) { if (self.jumpToMall) {
...@@ -77,8 +80,11 @@ ...@@ -77,8 +80,11 @@
ZXWashTabbarViewController *tabbarVC = [[ZXWashTabbarViewController alloc] init]; ZXWashTabbarViewController *tabbarVC = [[ZXWashTabbarViewController alloc] init];
[self.navigationController pushViewController:tabbarVC animated:YES]; [self.navigationController pushViewController:tabbarVC animated:YES];
} else if ([operation.defaultValue isEqualToString:@"999"]) { } else if ([operation.defaultValue isEqualToString:@"999"]) {
UIViewController *vc= [[NSClassFromString(@"ZXColorfulBookController") alloc] init]; [[ZXAppointBathService new] getCampusUseModeCompleted:^(BOOL is) {
UIViewController *vc= [[NSClassFromString(@"ZXAppointBathTabbarViewController") alloc] init];
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
}];
} else if ([operation.defaultValue isEqualToString:@"998"]) { } else if ([operation.defaultValue isEqualToString:@"998"]) {
//跳转商城 //跳转商城
if (self.jumpToMall) { if (self.jumpToMall) {
......
// //
...@@ -138,7 +138,7 @@ static NSInteger seq = 0; ...@@ -138,7 +138,7 @@ static NSInteger seq = 0;
}]; }];
// [self refreshFooter];
LoginJump *m = [LoginJump findAll].lastObject; LoginJump *m = [LoginJump findAll].lastObject;
if (m && [m.modelCode isEqualToString:@"BD"] && m.modelUrl && ![m.modelUrl isEqualToString:@""]) { if (m && [m.modelCode isEqualToString:@"BD"] && m.modelUrl && ![m.modelUrl isEqualToString:@""]) {
......
// //
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
CGRect frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight); CGRect frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight);
self.webView = [[WKWebView alloc] initWithFrame:frame]; self.webView = [[WKWebView alloc] initWithFrame:frame];
//采用WK默认缓存策略 //采用WK默认缓存策略
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[self.jumpUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[ZXTool URLEncoded:self.jumpUrl]] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60];
self.navigationController.navigationBar.hidden = NO; self.navigationController.navigationBar.hidden = NO;
[self.webView loadRequest:request]; [self.webView loadRequest:request];
[ZXTool showLoadingAnimation]; [ZXTool showLoadingAnimation];
......
// //
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
click(info); click(info);
}]; }];
}]; }];
// ima.contentMode = UIViewContentModeScaleAspectFit;
} else if (count == 2) { } else if (count == 2) {
UIImageView *image1 = [[UIImageView alloc] init]; UIImageView *image1 = [[UIImageView alloc] init];
[self addSubview:image1]; [self addSubview:image1];
...@@ -81,7 +83,8 @@ ...@@ -81,7 +83,8 @@
click(info1); click(info1);
}]; }];
}]; }];
// image1.contentMode = UIViewContentModeScaleAspectFit;
// image2.contentMode = UIViewContentModeScaleAspectFit;
} else if (count == 3) { } else if (count == 3) {
JXLayoutButton *currentBtn; JXLayoutButton *currentBtn;
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
......
// //
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
// 5> 设置扫描类型 // 5> 设置扫描类型
dataOutput.metadataObjectTypes = dataOutput.availableMetadataObjectTypes; dataOutput.metadataObjectTypes = dataOutput.availableMetadataObjectTypes;
[dataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; [dataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
[session setSessionPreset:AVCaptureSessionPresetHigh];
// 6> 设置预览图层会话 // 6> 设置预览图层会话
[self setupLayers]; [self setupLayers];
} }
......
// //
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
return ; return ;
} }
self.numberLabel.text = [NSString stringWithFormat:@"设备编号: %@", m.code]; self.numberLabel.text = [NSString stringWithFormat:@"设备编号: %@", m.code];
self.addressLabel.text = [NSString stringWithFormat:@"设备地址: %@", m.position]; self.addressLabel.text = [NSString stringWithFormat:@"设备地址: %@", m.position?m.position:@""];
self.startDrink.selected = m.isCurrentUserUsed; self.startDrink.selected = m.isCurrentUserUsed;
self.currentMerthin = m; self.currentMerthin = m;
}]; }];
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
[self.service checkUserCurrentUseMerthinCompleted:^(ZXDrinkMerthinModel *m) { [self.service checkUserCurrentUseMerthinCompleted:^(ZXDrinkMerthinModel *m) {
@strongify(self); @strongify(self);
self.numberLabel.text = [NSString stringWithFormat:@"设备编号: %@", m.code]; self.numberLabel.text = [NSString stringWithFormat:@"设备编号: %@", m.code];
self.addressLabel.text = [NSString stringWithFormat:@"设备地址: %@", m.position]; self.addressLabel.text = [NSString stringWithFormat:@"设备地址: %@", m.position?m.position:@""];
self.startDrink.selected = YES; self.startDrink.selected = YES;
self.currentMerthin = m; self.currentMerthin = m;
}]; }];
...@@ -400,7 +400,7 @@ ...@@ -400,7 +400,7 @@
} }
//刷新设备页面 //刷新设备页面
self.numberLabel.text = [NSString stringWithFormat:@"设备编号: %@", device.code]; self.numberLabel.text = [NSString stringWithFormat:@"设备编号: %@", device.code];
self.addressLabel.text = [NSString stringWithFormat:@"设备地址: %@", device.position]; self.addressLabel.text = [NSString stringWithFormat:@"设备地址: %@", device.position?device.position:@""];
self.startDrink.selected = device.isCurrentUserUsed; self.startDrink.selected = device.isCurrentUserUsed;
self.currentMerthin = device; self.currentMerthin = device;
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
......
// //
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
} else { } else {
ZXDrinkMerthinModel *m = [ZXDrinkMerthinModel mj_objectWithKeyValues:common.data]; ZXDrinkMerthinModel *m = [ZXDrinkMerthinModel mj_objectWithKeyValues:common.data];
if (m) { if (m) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kOrderRefreshTime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//递归 //递归
[self checkUserIsUserMerthinCompleted:completed]; [self checkUserIsUserMerthinCompleted:completed];
}); });
......
//
//
// ZXAppointForbbidenModel.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXAppointForbbidenModel : NSObject
//0-校区未启用预约功能,1-校区未设置惩罚时长,2-用户未在惩罚中,3-用户在惩罚中
@property (nonatomic, assign) NSInteger appointMode;
@property (nonatomic, copy) NSString *message;
//duration预约有效时长
@property (nonatomic, assign) CGFloat duration;
//系统惩罚时长
@property (nonatomic, assign) NSInteger punishment;
//使用模式: 1-蓝牙,2-预约,3-混合
@property (nonatomic, assign) NSInteger useType;
///用户剩余惩罚时长
@property (nonatomic, assign) NSInteger userPunishment;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXAppointForbbidenModel.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXAppointForbbidenModel.h"
@implementation ZXAppointForbbidenModel
@end
//
//
// ZXAppointRecordModel.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXAppointRecordModel : NSObject
@property (nonatomic, copy) NSString *appointTime;
@property (nonatomic, copy) NSString *campusName;
@property (nonatomic, copy) NSString *deviceCode;
@property (nonatomic, copy) NSString *deviceLocation;
@property (nonatomic, copy) NSString *expireTime;
@property (nonatomic, assign) BOOL used;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXAppointRecordModel.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXAppointRecordModel.h"
@implementation ZXAppointRecordModel
@end
//
//
// ZXBathConfig.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/7/1.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "JKDBModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface ZXBathConfig : JKDBModel
//豆数量
@property (nonatomic, assign) CGFloat beanAmount;
//艾米数量
@property (nonatomic, assign) CGFloat money;
//余额小于阈值时提示内容
@property (nonatomic, copy) NSString *thresholdPrompt;
//余额提示阈值,余额小于时提示
@property (nonatomic, assign) CGFloat thresholdValue;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXBathConfig.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/7/1.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXBathConfig.h"
@implementation ZXBathConfig
@end
//
//
// ZXAppointBathDeviceListTableViewCell.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZXAppointBathModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface ZXAppointBathDeviceListTableViewCell : UITableViewCell
@property (nonatomic, strong) ZXAppointBathModel *bathModel;
@end
NS_ASSUME_NONNULL_END
//
//
// WashCLoseTableViewCell.m
// ColorfulSchool
//
// Created by liuZX on 2018/6/20.
// Copyright © 2018年 Colorful Any Door. All rights reserved.
//
#import "ZXAppointBathDeviceListTableViewCell.h"
#import "CountingDownView.h"
@interface ZXAppointBathDeviceListTableViewCell()
@property (nonatomic, strong) UILabel *numberLabel;
@property (nonatomic, strong) UILabel *addressLabel;
@property (nonatomic, strong) UIImageView *menuImageView;
//@property (nonatomic, strong) CountingDownView *countingDownView;
@end
@implementation ZXAppointBathDeviceListTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
UIImageView *image1 = [[UIImageView alloc] init];
image1.image = [UIImage imageNamed:@"洗浴图标"];
UILabel *label1 = [[UILabel alloc] init];
label1.textColor = RGB(153, 153, 153);
label1.font = kFontSize(13 *k6Scale);
label1.text = @"设备编码";
UIImageView *image2 = [[UIImageView alloc] init];
image2.image = [UIImage imageNamed:@"place"];
UILabel *label2 = [[UILabel alloc] init];
label2.textColor = RGB(153, 153, 153);
label2.font = kFontSize(13 *k6Scale);
label2.text = @"设备位置";
self.numberLabel = [[UILabel alloc] init];
self.numberLabel.textColor = RGB(51, 51, 51);
self.numberLabel.font = kFontSize(15 *k6Scale);
self.addressLabel = [[UILabel alloc] init];
self.addressLabel.textColor = RGB(136, 136, 136);
self.addressLabel.numberOfLines = 0;
self.addressLabel.font = kFontSize(12 *k6Scale);
self.menuImageView = [[UIImageView alloc] init];
UILabel *label3 = [[UILabel alloc] init];
label3.textColor = RGB(248, 149, 83);
label3.font = kFontSize(16 *k6Scale);
label3.text = @"使用中";
UIImageView *line = [[UIImageView alloc] init];
line.image = [UIImage imageNamed:@"wash-line"];
line.contentMode = UIViewContentModeScaleAspectFill;
line.clipsToBounds = YES;
[self.contentView addSubview:image1];
[self.contentView addSubview:image2];
[self.contentView addSubview:label1];
[self.contentView addSubview:label2];
[self.contentView addSubview:line];
[self.contentView addSubview:label3];
[self.contentView addSubview:self.numberLabel];
[self.contentView addSubview:self.addressLabel];
[self.contentView addSubview:self.menuImageView];
[image1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(10 * k6Scale);
make.top.equalTo(self.contentView.mas_top).offset(10 * k6Scale);
make.width.height.mas_equalTo(12 * k6Scale);
}];
[image2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(10 * k6Scale);
make.top.equalTo(image1.mas_bottom).offset(10 * k6Scale);
make.width.height.mas_equalTo(12 * k6Scale);
}];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(12 * k6Scale);
make.right.equalTo(self.contentView.mas_right).offset(-12 * k6Scale); make.bottom.equalTo(self.contentView.mas_bottom);
make.height.mas_equalTo(1);
}];
[label1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(image1.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(image1.mas_centerY);
}];
[label2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(image2.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(image2.mas_centerY);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(label1.mas_right).offset(13 * k6Scale);
make.centerY.equalTo(label1.mas_centerY);
}];
[self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(label2.mas_right).offset(13 * k6Scale);
make.centerY.equalTo(label2.mas_centerY).offset(1 * k6Scale);
}];
[label3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale);
make.centerY.equalTo(self.contentView.mas_centerY);
make.width.height.mas_equalTo(48 * k6Scale);
}];
[self.menuImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale);
make.centerY.equalTo(self.contentView.mas_centerY);
make.width.height.mas_equalTo(48 * k6Scale);
}];
}
return self;
}
- (void)setBathModel:(ZXAppointBathModel *)bathModel {
_bathModel = bathModel;
self.numberLabel.text = _bathModel.code;
if (_bathModel.inPunishment) {
self.menuImageView.hidden = NO;
self.menuImageView.image = [UIImage imageNamed:@"预约按钮-grey"];
} else {
if (_bathModel.appointable) {
//显示使用中
self.menuImageView.hidden = NO;
self.menuImageView.image = [UIImage imageNamed:@"预约按钮-light"];
} else {
self.menuImageView.hidden = YES;
}
}
self.addressLabel.text = _bathModel.location;
}
@end
//
//
// ZXAppointBathRecordCell.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZXAppointRecordModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface ZXAppointBathRecordCell : UITableViewCell
@property (nonatomic, strong) ZXAppointRecordModel *recordModel;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXAppointBathRecordCell.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/6/26.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXAppointBathRecordCell.h"
@interface ZXAppointBathRecordCell ()
@property (nonatomic, strong) UILabel *codeLabel;
@property (nonatomic, strong) UILabel *addressLabel;
@property (nonatomic, strong) UILabel *startLabel;
@property (nonatomic, strong) UILabel *endLabel;
@property (nonatomic, strong) UIImageView *statusImageView;
@end
@implementation ZXAppointBathRecordCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.contentView.backgroundColor = kRGBColor(243, 243, 243, 1);
UIImage *cardImage = [UIImage imageNamed:@"卡片"];
UIImageView *contentImageView = [[UIImageView alloc] init];
contentImageView.image = cardImage;
[self.contentView addSubview:contentImageView];
[contentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(15 * k6Scale, 15 * k6Scale, 0, 15 * k6Scale));
}];
UIImageView *imageH = [[UIImageView alloc] init];
imageH.image = [UIImage imageNamed:@"洗浴"];
[contentImageView addSubview:imageH];
[imageH mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(contentImageView.mas_left).offset(15 * k6Scale);
make.top.equalTo(contentImageView.mas_top).offset(20 * k6Scale);
}];
UILabel *label1 = [[UILabel alloc] init];
label1.textColor = RGB(50, 50, 50);
label1.font = kFontSize(14 *k6Scale);
label1.text = @"我的预约";
[contentImageView addSubview:label1];
[label1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(imageH.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(imageH.mas_centerY);
}];
self.codeLabel = [[UILabel alloc] init];
self.codeLabel.textColor = RGB(50, 50, 50);
self.codeLabel.font = kFontSize(13 *k6Scale);
self.codeLabel.text = @" ";
[contentImageView addSubview:self.codeLabel];
[self.codeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(contentImageView.mas_right).offset(-10 * k6Scale);
make.centerY.equalTo(imageH.mas_centerY);
}];
UILabel *label2 = [[UILabel alloc] init];
label2.textColor = RGB(50, 50, 50);
label2.font = kFontSize(13 *k6Scale);
label2.text = @"设备编号:";
[contentImageView addSubview:label2];
[label2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.codeLabel.mas_left).offset(-10 * k6Scale);
make.centerY.equalTo(imageH.mas_centerY);
}];
UILabel *label3 = [[UILabel alloc] init];
label3.textColor = RGB(50, 50, 50);
label3.font = kFontSize(13 *k6Scale);
label3.text = @"设备位置:";
[contentImageView addSubview:label3];
[label3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(contentImageView.mas_left).offset(10 * k6Scale);
make.top.equalTo(contentImageView.mas_top).offset(85 * k6Scale);
}];
self.addressLabel = [[UILabel alloc] init];
self.addressLabel.textColor = RGB(50, 50, 50);
self.addressLabel.font = kFontSize(13 *k6Scale);
[contentImageView addSubview:self.addressLabel];
[self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(label3.mas_right).offset(10 * k6Scale);
make.top.equalTo(label3.mas_top);
}];
UILabel *label5 = [[UILabel alloc] init];
label5.textColor = RGB(50, 50, 50);
label5.font = kFontSize(13 *k6Scale);
label5.text = @"预约失效时间:";
[contentImageView addSubview:label5];
[label5 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(contentImageView.mas_left).offset(10 * k6Scale);
make.bottom.equalTo(contentImageView.mas_bottom).offset(-15 * k6Scale);
}];
UILabel *label4 = [[UILabel alloc] init];
label4.textColor = RGB(50, 50, 50);
label4.font = kFontSize(13 *k6Scale);
label4.text = @"预约开始时间:";
[contentImageView addSubview:label4];
[label4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(contentImageView.mas_left).offset(10 * k6Scale);
make.bottom.equalTo(label5.mas_top).offset(-10 * k6Scale);
}];
self.startLabel = [[UILabel alloc] init];
self.startLabel.textColor = RGB(50, 50, 50);
self.startLabel.font = kFontSize(13 *k6Scale);
[contentImageView addSubview:self.startLabel];
[self.startLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(label4.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(label4);
}];
self.endLabel = [[UILabel alloc] init];
self.endLabel.textColor = RGB(50, 50, 50);
self.endLabel.font = kFontSize(13 *k6Scale);
[contentImageView addSubview:self.endLabel];
[self.endLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(label5.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(label5);
}];
}
return self;
}
- (void)setRecordModel:(ZXAppointRecordModel *)recordModel {
_recordModel = recordModel;
self.codeLabel.text = _recordModel.deviceCode;
self.addressLabel.text = _recordModel.deviceLocation;
self.startLabel.text = _recordModel.appointTime;
self.endLabel.text = _recordModel.expireTime;
}
@end
// //
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface ZXBathViewController : UIViewController @interface ZXBathViewController : UIViewController
@property (nonatomic, assign) BOOL isAppointJump;//是否来自预约跳转而来
@end @end
......
// //
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
#import <CoreBluetooth/CoreBluetooth.h> #import <CoreBluetooth/CoreBluetooth.h>
#import "GCDAsyncSocket.h" #import "GCDAsyncSocket.h"
#import "ZXBluetoothModel.h" #import "ZXBluetoothModel.h"
#import "ZXAppointBathService.h"
#import "ZXBathConfig.h"
//开发 //开发
//#define kSocketUrl @"hard-tcp-server.nat123.net" //socket连接地址 //#define kSocketUrl @"hard-tcp-server.nat123.net" //socket连接地址
//#define kSocketPort 29800 //socket端口号 //#define kSocketPort 29800 //socket端口号
...@@ -39,6 +40,10 @@ ...@@ -39,6 +40,10 @@
@property (nonatomic, strong) CBCentralManager *centralManager; @property (nonatomic, strong) CBCentralManager *centralManager;
@property (nonatomic, strong) CBPeripheral *selectedPeripheral; @property (nonatomic, strong) CBPeripheral *selectedPeripheral;
//艾米余额label
@property (nonatomic, strong) UILabel *aimiLabel;
//洗浴豆label
@property (nonatomic, strong) UILabel *bathCoinLabel;
@property (nonatomic, strong) dispatch_source_t gcdTimer; @property (nonatomic, strong) dispatch_source_t gcdTimer;
//轮训是否还有正在使用的设备 //轮训是否还有正在使用的设备
...@@ -77,6 +82,9 @@ ...@@ -77,6 +82,9 @@
[self createNabar]; [self createNabar];
[self createUI]; [self createUI];
if (self.isAppointJump) {
[self createCodeBtn];
}
self.blueToothData = [NSMutableData data]; self.blueToothData = [NSMutableData data];
self.isServiceCut = NO;//默认不断开 self.isServiceCut = NO;//默认不断开
self.isBegingBath = NO;//默认未开始 self.isBegingBath = NO;//默认未开始
...@@ -94,6 +102,15 @@ ...@@ -94,6 +102,15 @@
[self.clientSocket connectToHost:kSocketUrl onPort:kSocketPort viaInterface:nil withTimeout:-1 error:nil]; [self.clientSocket connectToHost:kSocketUrl onPort:kSocketPort viaInterface:nil withTimeout:-1 error:nil];
@weakify(self); @weakify(self);
[ZXAppointBathService checkBathConfigCompleted:^{
@strongify(self);
ZXBathConfig *m = [ZXBathConfig findAll].lastObject;
dispatch_async(dispatch_get_main_queue(), ^{
self.aimiLabel.text = [NSString stringWithFormat:@"%.2f ", m.money];
self.bathCoinLabel.text = [NSString stringWithFormat:@"%.2f ", m.beanAmount];
});
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) { [[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) {
@strongify(self); @strongify(self);
[self createTimer]; [self createTimer];
...@@ -203,6 +220,21 @@ ...@@ -203,6 +220,21 @@
}]; }];
} }
- (void) createCodeBtn {
enlargeClickRegionBtn *showCode = [[enlargeClickRegionBtn alloc] init];
[self.view addSubview:showCode];
[showCode setBackgroundImage:[UIImage imageNamed:@"洗浴预约切换"] forState:UIControlStateNormal];
[showCode mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.view.mas_right);
make.top.equalTo(self.view.mas_top).offset(120 * k6Scale + kTopHeight);
}];
@weakify(self);
[[showCode rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
@strongify(self);
[self.navigationController popViewControllerAnimated:YES];
}];
}
- (void) createUI { - (void) createUI {
UIImageView *header = [[UIImageView alloc] initWithFrame:CGRectMake(0, kTopHeight, kScreenWidth, 205 * k6Scale)]; UIImageView *header = [[UIImageView alloc] initWithFrame:CGRectMake(0, kTopHeight, kScreenWidth, 205 * k6Scale)];
header.image = [UIImage imageNamed:@"drinkbackground"]; header.image = [UIImage imageNamed:@"drinkbackground"];
...@@ -284,11 +316,129 @@ ...@@ -284,11 +316,129 @@
self.numberLabel.text = @"设备名称: "; self.numberLabel.text = @"设备名称: ";
self.addressLabel.text = @"设备地址: "; self.addressLabel.text = @"设备地址: ";
UIView *configView = [[UIView alloc] init];
[self.view addSubview:configView];
[configView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.height.mas_equalTo(40 * k6Scale);
make.top.equalTo(header.mas_bottom);
}];
UIView *lines = [[UIView alloc] init];
lines.backgroundColor = [UIColor colorWithHexString:@"#d9d9d9"];
[configView addSubview:lines];
[lines mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(configView);
make.height.mas_equalTo(1);
}];
UIView *liness = [[UIView alloc] init];
liness.backgroundColor = [UIColor colorWithHexString:@"#d9d9d9"];
[configView addSubview:liness];
[liness mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(configView.mas_centerY);
make.centerX.equalTo(configView.mas_centerX);
make.width.mas_equalTo(1);
make.height.mas_equalTo(20 * k6Scale);
}];
self.aimiLabel = [[UILabel alloc] init];
self.aimiLabel.font = kFontSize(13 * k6Scale);
self.aimiLabel.textColor = [UIColor colorWithHexString:@"#fd790c"];
[configView addSubview:self.aimiLabel];
[self.aimiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(liness.mas_left).offset(-24 * k6Scale);
make.centerY.equalTo(liness.mas_centerY);
}];
self.aimiLabel.text = @"0.00 ";
UILabel *label1 = [[UILabel alloc] init];
label1.font = kFontSize(13 * k6Scale);
label1.textColor = [UIColor colorWithHexString:@"#feaf6d"];
[configView addSubview:label1];
[label1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.aimiLabel.mas_left).offset(-16 * k6Scale);
make.centerY.equalTo(configView.mas_centerY);
}];
label1.text = @"艾米币: ";
UIImageView *icon1 = [[UIImageView alloc] init];
[configView addSubview:icon1];
icon1.image = [UIImage imageNamed:@"艾米币"];
[icon1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(label1.mas_left).offset(-10 * k6Scale);
make.width.height.mas_equalTo(18 * k6Scale);
make.centerY.equalTo(configView);
}];
UIImageView *icon2 = [[UIImageView alloc] init];
[configView addSubview:icon2];
icon2.image = [UIImage imageNamed:@"洗浴豆"];
[icon2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(liness.mas_right).offset(24 * k6Scale);
make.width.height.mas_equalTo(18 * k6Scale);
make.centerY.equalTo(configView);
}];
UILabel *label2 = [[UILabel alloc] init];
label2.font = kFontSize(13 * k6Scale);
label2.textColor = [UIColor colorWithHexString:@"#feaf6d"];
[configView addSubview:label2];
[label2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(icon2.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(configView.mas_centerY);
}];
label2.text = @"洗浴豆: ";
self.bathCoinLabel = [[UILabel alloc] init];
self.bathCoinLabel.font = kFontSize(13 * k6Scale);
self.bathCoinLabel.textColor = [UIColor colorWithHexString:@"#fd790c"];
[configView addSubview:self.bathCoinLabel];
[self.bathCoinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(label2.mas_right).offset(24 * k6Scale);
make.centerY.equalTo(configView.mas_centerY);
}];
self.bathCoinLabel.text = @"0.00 ";
} }
#pragma mark - ==========开始洗浴按钮事件========== #pragma mark - ==========开始洗浴按钮事件==========
- (void) startBath { - (void) startBath {
BOOL isNeedAlert = NO;
ZXBathConfig *m = [ZXBathConfig findAll].lastObject;
if (self.currentBluetooth.operationMode == 3) {
if (m.money < m.thresholdValue) {
isNeedAlert = YES;
}
} else if (self.currentBluetooth.operationMode == 1 || self.currentBluetooth.operationMode == 2){
if ((m.money + m.beanAmount) < m.thresholdValue) {
isNeedAlert = YES;
}
}
if (isNeedAlert) {
@weakify(self);
NSArray *arr = [m.thresholdPrompt componentsSeparatedByString:@"{}"];
NSString *str1 = [NSString stringWithFormat:@"%.2f", m.money];
NSString *str2 = [NSString stringWithFormat:@"%.2f", m.beanAmount];
NSString *str = [[[[arr[0] stringByAppendingString:str1] stringByAppendingString:arr[1]] stringByAppendingString:str2] stringByAppendingString:arr[2]];
NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:str];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 2;// 字体的行间距
for (NSString *s in @[str1, str2]) {
NSRange range = [str rangeOfString:s];
[att addAttributes:@{NSForegroundColorAttributeName:RGB(248, 148, 85),NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:kFontSize(13 * k6Scale)} range:range];
}
[ZXTool showCustomMsg:att leftAction:^{
} rightAction:^{
@strongify(self);
[self startBathClickAction];
}];
} else {
[self startBathClickAction];
}
}
- (void) startBathClickAction {
if (self.currentPeripheralName == nil) { if (self.currentPeripheralName == nil) {
[ZXTool showText:@"请先扫描设备上的二维码"]; [ZXTool showText:@"请先扫描设备上的二维码"];
return; return;
...@@ -319,6 +469,7 @@ ...@@ -319,6 +469,7 @@
[self.view addSubview:a]; [self.view addSubview:a];
return; return;
} }
self.isServiceCut = NO;//标记为开始 self.isServiceCut = NO;//标记为开始
self.startDrink.enabled = NO;//按钮不可点击 self.startDrink.enabled = NO;//按钮不可点击
[self reConnect];//重连操作 [self reConnect];//重连操作
...@@ -326,7 +477,6 @@ ...@@ -326,7 +477,6 @@
[self checkBluetoothConectStatus]; [self checkBluetoothConectStatus];
} }
#pragma mark - ==========点击了开始按钮 5s后检测蓝牙连接状态========== #pragma mark - ==========点击了开始按钮 5s后检测蓝牙连接状态==========
- (void) checkBluetoothConectStatus { - (void) checkBluetoothConectStatus {
[ZXTool showLoadingAnimation]; [ZXTool showLoadingAnimation];
...@@ -857,4 +1007,10 @@ ...@@ -857,4 +1007,10 @@
self.useringTimer = nil; self.useringTimer = nil;
} }
} }
@end @end
// //
...@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) BOOL isOnlyBluetooth;//是否是纯蓝牙 @property (nonatomic, assign) BOOL isOnlyBluetooth;//是否是纯蓝牙
@property (nonatomic, copy) NSString *position; @property (nonatomic, copy) NSString *position;
//运营模式 1:先消费豆后消费艾米;2:先消费艾米后消费豆;3:只消费艾米
@property (nonatomic, assign) NSInteger operationMode;
@end @end
......
// //
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ZXWashMerthinModel.h" #import "ZXWashMerthinModel.h"
@interface WashCLoseTableViewCell : UITableViewCell @interface WashCLoseTableViewCell : UITableViewCell
@property (nonatomic, strong) ZXWashMerthinModel *model; @property (nonatomic, strong) ZXWashMerthinModel *model;
@end @end
// //
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
[self.menuImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.menuImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale); make.right.equalTo(self.contentView.mas_right).offset(-16 * k6Scale);
make.centerY.equalTo(self.contentView.mas_centerY); make.centerY.equalTo(self.contentView.mas_centerY);
make.width.height.mas_equalTo(55 * k6Scale); make.width.height.mas_equalTo(48 * k6Scale);
}]; }];
// [self.countingDownView mas_makeConstraints:^(MASConstraintMaker *make) { // [self.countingDownView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.right.top.bottom.equalTo(self.contentView); // make.right.top.bottom.equalTo(self.contentView);
......
// //
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
self.webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.view addSubview:self.webView]; [self.view addSubview:self.webView];
[self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil]; [self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[self.jumpUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]]; [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[ZXTool URLEncoded:self.jumpUrl]]]];
if (self.titleStr == nil) { if (self.titleStr == nil) {
[self.webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL]; [self.webView addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
} }
......
// //
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
@property (nonatomic, assign) BOOL isFristPage;//是否是首页 @property (nonatomic, assign) BOOL isFristPage;//是否是首页
@property (nonatomic, assign) BOOL isHasBottomMargin;//是否有底部间距 @property (nonatomic, assign) BOOL isHasBottomMargin;//是否有底部间距
@property (nonatomic, strong) dispatch_source_t gcdTimer; @property (nonatomic, strong) dispatch_source_t gcdTimer;
@property (nonatomic, strong) UIView *window;
@end @end
@implementation ZXTXAdTool @implementation ZXTXAdTool
...@@ -34,14 +35,23 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool) ...@@ -34,14 +35,23 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool)
#pragma mark - ========== 开屏广告 ========== #pragma mark - ========== 开屏广告 ==========
-(void) createLauchAdByPlacmentId:(NSString *) placenmentId { -(void) createLauchAdByPlacmentId:(NSString *) placenmentId {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
GDTSplashAd *splash = [[GDTSplashAd alloc] initWithAppId:kTXAdAPPID placementId:placenmentId]; GDTSplashAd *splash = [[GDTSplashAd alloc] initWithAppId:kTXAdAPPID placementId:placenmentId];
splash.delegate = self; splash.delegate = self;
splash.fetchDelay = 3; splash.fetchDelay = 3;
[splash loadAdAndShowInWindow:kAppWindow]; UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 100)];
v.backgroundColor = [UIColor whiteColor];
UIImageView *v1 = [[UIImageView alloc] init];
[v addSubview:v1];
v1.image = [UIImage imageNamed:@"logo-1.png"];
[v1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(210);
make.height.mas_equalTo(60);
make.center.equalTo(v);
}];
[splash loadAdAndShowInWindow:kAppWindow withBottomView:v];
self.splash = splash; self.splash = splash;
}
} }
- (void)splashAdApplicationWillEnterBackground:(GDTSplashAd *)splashAd - (void)splashAdApplicationWillEnterBackground:(GDTSplashAd *)splashAd
{ {
NSLog(@"%s",__FUNCTION__); NSLog(@"%s",__FUNCTION__);
...@@ -49,7 +59,32 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool) ...@@ -49,7 +59,32 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool)
-(void)splashAdSuccessPresentScreen:(GDTSplashAd *)splashAd -(void)splashAdSuccessPresentScreen:(GDTSplashAd *)splashAd
{ {
if ([kUserDefaults valueForKey:kAPP_LauchADCloseTimeinterval] && ([[kUserDefaults valueForKey:kAPP_LauchADCloseTimeinterval] integerValue] != 0)) {
NSInteger times = [[kUserDefaults valueForKey:kAPP_LauchADCloseTimeinterval] integerValue] / 1000;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(times * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIViewController *vc = [splashAd valueForKey:@"splashViewController"];
[vc dismissViewControllerAnimated:NO completion:nil];
});
}
NSLog(@"%s",__FUNCTION__); NSLog(@"%s",__FUNCTION__);
if (CacheUserId == nil) {
return;
}
@try {
//曝光
id x = [splashAd valueForKey:@"adModel"];
NSString *imageUrl = [x valueForKey:@"imgUrl"];
[ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/app/adsenseCollectData/adsenseCollectData4Add", [kUserDefaults valueForKey:@"Ad"]] para:@{@"adsenseName":@"开屏广告",@"advertType":@"曝光",@"advertTitle":@"开屏广告", @"advertImg":imageUrl, @"customerId":[kUserDefaults valueForKey:@"userId"], @"advertId":kTXAdLauchPLACEMENTID,@"platformCode":@"TXAD_iOS"} completed:^(CommonModel *common, NSString *error) {
}];
} @catch (NSException *exception) {
} @finally {
}
} }
-(void)splashAdFailToPresent:(GDTSplashAd *)splashAd withError:(NSError *)error -(void)splashAdFailToPresent:(GDTSplashAd *)splashAd withError:(NSError *)error
...@@ -86,6 +121,22 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool) ...@@ -86,6 +121,22 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool)
- (void)splashAdClicked:(GDTSplashAd *)splashAd - (void)splashAdClicked:(GDTSplashAd *)splashAd
{ {
NSLog(@"%s",__FUNCTION__); NSLog(@"%s",__FUNCTION__);
if (CacheUserId == nil) {
return;
}
@try {
//点击
id x = [splashAd valueForKey:@"adModel"];
NSString *imageUrl = [x valueForKey:@"imgUrl"];
[ZXTool requestDataHideLoadingToastWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/app/adsenseCollectData/adsenseCollectData4Add", [kUserDefaults valueForKey:@"Ad"]] para:@{@"adsenseName":@"开屏广告",@"advertType":@"点击",@"advertTitle":@"开屏广告", @"advertImg":imageUrl, @"customerId":[kUserDefaults valueForKey:@"userId"], @"advertId":kTXAdLauchPLACEMENTID,@"platformCode":@"TXAD_iOS"} completed:^(CommonModel *common, NSString *error) {
}];
} @catch (NSException *exception) {
} @finally {
}
} }
- (void)splashAdWillDismissFullScreenModal:(GDTSplashAd *)splashAd - (void)splashAdWillDismissFullScreenModal:(GDTSplashAd *)splashAd
......
// //
...@@ -22,7 +22,11 @@ typedef void(^checkIsOldCustomer)(BOOL isOld); ...@@ -22,7 +22,11 @@ typedef void(^checkIsOldCustomer)(BOOL isOld);
/*show alertText*/ /*show alertText*/
+(void) showText:(NSString *) text; +(void) showText:(NSString *) text;
+(void) showCustomMsg:(NSString *) msg;
+(void) showCustomMsg:(NSAttributedString *) msg
leftAction:(dispatch_block_t) leftAction
rightAction:(dispatch_block_t) rightAction;
/*show loading*/ /*show loading*/
+ (void)showLoadingAnimation; + (void)showLoadingAnimation;
/*hide loading*/ /*hide loading*/
...@@ -32,7 +36,7 @@ typedef void(^checkIsOldCustomer)(BOOL isOld); ...@@ -32,7 +36,7 @@ typedef void(^checkIsOldCustomer)(BOOL isOld);
+ (void)showUploadingAnimation; + (void)showUploadingAnimation;
/*hide uploading loading*/ /*hide uploading loading*/
+ (void)hideUploadingAnimation; + (void)hideUploadingAnimation;
+ (NSString *)URLEncoded:(NSString *) url;
//带确定的提示框 //带确定的提示框
+(void) showAlertText:(NSString *) text; +(void) showAlertText:(NSString *) text;
/*字典转字符串*/ /*字典转字符串*/
......
// //
...@@ -105,10 +105,137 @@ static ZXLoading *uploading = nil; ...@@ -105,10 +105,137 @@ static ZXLoading *uploading = nil;
} }
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:text preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:text preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]; UIAlertAction *ac = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil];
[alert addAction:ac]; [alert addAction:ac];
[[ZXTool getCurrentVC] presentViewController:alert animated:YES completion:nil]; [[ZXTool getCurrentVC] presentViewController:alert animated:YES completion:nil];
} }
+(void) showCustomMsg:(NSString *) msg {
UIView *holder = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
holder.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.2];
CGFloat bgH = 152 * k6Scale;
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 270 * k6Scale, bgH)];
[holder addSubview:bgView];
bgView.center = holder.center;
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.cornerRadius = 15 * k6Scale;
bgView.layer.masksToBounds = YES;
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, bgH - 45 * k6Scale, 270 * k6Scale, 1)];
line.backgroundColor = RGB(242, 242, 242);
[bgView addSubview:line];
UILabel *bottomLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, bgH - 44 * k6Scale, 270 * k6Scale, 44 * k6Scale)];
[bgView addSubview:bottomLabel];
bottomLabel.backgroundColor = [UIColor clearColor];
bottomLabel.textAlignment = NSTextAlignmentCenter;
bottomLabel.textColor = RGB(248, 149, 83);
bottomLabel.font = kFontSize(16 * k6Scale);
bottomLabel.text = @"确定";
bottomLabel.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
[bottomLabel addGestureRecognizer:tap];
__weak typeof(holder) weakholder = holder;
[[tap rac_gestureSignal] subscribeNext:^(id x) {
[weakholder removeFromSuperview];
weakholder.hidden = YES;
}];
UILabel *msgLbel = [[UILabel alloc] init];
[bgView addSubview:msgLbel];
msgLbel.textColor = [UIColor colorWithHexString:@"#333333"];
msgLbel.font = kFontSize(14 * k6Scale);
msgLbel.text = msg;
msgLbel.numberOfLines = 0;
msgLbel.textAlignment = NSTextAlignmentCenter;
[msgLbel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(bgView).insets(UIEdgeInsetsMake(10 * k6Scale, 10 * k6Scale, 45 * k6Scale, 10 * k6Scale));
}];
[[UIApplication sharedApplication].keyWindow addSubview:holder];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (holder.hidden == NO) {
[holder removeFromSuperview];
holder.hidden = YES;
}
});
}
+(void) showCustomMsg:(NSAttributedString *) msg
leftAction:(dispatch_block_t) leftAction
rightAction:(dispatch_block_t) rightAction {
UIView *holder = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
holder.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.2];
CGFloat bgH = 152 * k6Scale;
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 270 * k6Scale, bgH)];
[holder addSubview:bgView];
bgView.center = holder.center;
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.cornerRadius = 15 * k6Scale;
bgView.layer.masksToBounds = YES;
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, bgH - 45 * k6Scale, 270 * k6Scale, 1)];
line.backgroundColor = RGB(242, 242, 242);
[bgView addSubview:line];
UIView *c_line = [[UIView alloc] init];
c_line.backgroundColor = RGB(242, 242, 242);
[bgView addSubview:c_line];
[c_line mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(bgView);
make.top.equalTo(line.mas_bottom);
make.width.mas_equalTo(1);
make.bottom.equalTo(bgView.mas_bottom);
}];
UIButton *leftBtn = [[UIButton alloc] init];
[bgView addSubview:leftBtn];
leftBtn.titleLabel.font = kFontSize(16 * k6Scale);
[leftBtn setTitle:@"离开" forState:UIControlStateNormal];
[leftBtn setTitleColor:RGB(133, 133, 133) forState:UIControlStateNormal];
[leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.equalTo(bgView);
make.top.equalTo(line.mas_bottom);
make.right.equalTo(c_line.mas_left);
}];
__weak typeof(holder) weakholder = holder;
[[leftBtn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
[weakholder removeFromSuperview];
weakholder.hidden = YES;
leftAction();
}];
UIButton *rightBtn = [[UIButton alloc] init];
[bgView addSubview:rightBtn];
rightBtn.titleLabel.font = kFontSize(16 * k6Scale);
[rightBtn setTitle:@"继续" forState:UIControlStateNormal];
[rightBtn setTitleColor:RGB(248, 148, 85) forState:UIControlStateNormal];
[rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.bottom.equalTo(bgView);
make.top.equalTo(line.mas_bottom);
make.left.equalTo(c_line.mas_right);
}];
[[rightBtn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
[weakholder removeFromSuperview];
weakholder.hidden = YES;
rightAction();
}];
UILabel *msgLbel = [[UILabel alloc] init];
[bgView addSubview:msgLbel];
msgLbel.font = kFontSize(14 * k6Scale);
msgLbel.attributedText = msg;
msgLbel.numberOfLines = 0;
msgLbel.textAlignment = NSTextAlignmentCenter;
[msgLbel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(bgView).insets(UIEdgeInsetsMake(10 * k6Scale, 10 * k6Scale, 45 * k6Scale, 10 * k6Scale));
}];
[[UIApplication sharedApplication].keyWindow addSubview:holder];
}
+ (void)showLoadingAnimation { + (void)showLoadingAnimation {
...@@ -148,6 +275,7 @@ static ZXLoading *uploading = nil; ...@@ -148,6 +275,7 @@ static ZXLoading *uploading = nil;
return att; return att;
} }
/*show uploading loading*/ /*show uploading loading*/
+ (void)showUploadingAnimation { + (void)showUploadingAnimation {
...@@ -2121,4 +2249,16 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -2121,4 +2249,16 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
[userDefaults synchronize]; [userDefaults synchronize];
} }
+ (NSString *)URLEncoded:(NSString *) url {
NSString *encodedString = (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)url,
(CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",
NULL,
kCFStringEncodingUTF8));
return encodedString;
}
@end @end
// //
...@@ -90,20 +90,11 @@ ...@@ -90,20 +90,11 @@
if (error) { if (error) {
[ZXTool showText:error]; [ZXTool showText:error];
} else { } else {
if ([self.lastOrderId isEqualToString:@""]) {
NSArray *list = [ZXNewPayGroup mj_objectArrayWithKeyValuesArray:common.data]; [self.dataSource removeAllObjects];
for (ZXNewPayGroup *group in list) {
for (ZXNewPayOrder *or in group.data) {
or.groupName = group.groupName;
if (self.index) {
or.isRechargeOrder = YES;
}
[or save];
}
if (![self.dataSource containsObject:group.groupName]) {
[self.dataSource addObject:group.groupName];
}
} }
NSArray *list = [ZXNewPayGroup mj_objectArrayWithKeyValuesArray:common.data];
[self.dataSource addObjectsFromArray:list];
[self.myTableView reloadData]; [self.myTableView reloadData];
} }
}); });
...@@ -111,14 +102,11 @@ ...@@ -111,14 +102,11 @@
} }
- (void) loadNewData { - (void) loadNewData {
self.lastOrderId = @""; self.lastOrderId = @"";
[ZXNewPayOrder clearTable];
[self.dataSource removeAllObjects];
[self loadMoreData]; [self loadMoreData];
} }
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSString *group = self.dataSource[section]; ZXNewPayGroup *group = self.dataSource[section];
NSArray *arr = [ZXNewPayOrder findByCriteria:[NSString stringWithFormat:@"where groupName = '%@' and customerId = '%@'", group, CacheUserId]]; return group.data.count;
return arr.count;
} }
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
return self.dataSource.count; return self.dataSource.count;
...@@ -130,22 +118,17 @@ ...@@ -130,22 +118,17 @@
if (!cell) { if (!cell) {
cell = [[ZXNewPayOrderRechargeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ZXNewPayOrderRechargeCell"]; cell = [[ZXNewPayOrderRechargeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ZXNewPayOrderRechargeCell"];
} }
NSString *group = self.dataSource[indexPath.section]; ZXNewPayGroup *group = self.dataSource[indexPath.section];
NSArray *arr = [ZXNewPayOrder findByCriteria:[NSString stringWithFormat:@"where groupName = '%@' and customerId = '%@'", group, CacheUserId]]; cell.order = group.data[indexPath.row];
if (arr.count !=0 ) {
cell.order = arr[indexPath.row];
}
return cell; return cell;
} }
ZXNewPayOrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZXNewPayOrderTableViewCell"]; ZXNewPayOrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZXNewPayOrderTableViewCell"];
if (!cell) { if (!cell) {
cell = [[ZXNewPayOrderTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ZXNewPayOrderTableViewCell"]; cell = [[ZXNewPayOrderTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ZXNewPayOrderTableViewCell"];
} }
NSString *group = self.dataSource[indexPath.section]; ZXNewPayGroup *group = self.dataSource[indexPath.section];
NSArray *arr = [ZXNewPayOrder findByCriteria:[NSString stringWithFormat:@"where groupName = '%@' and customerId = '%@'", group, CacheUserId]];
if (arr.count !=0 ) { cell.order = group.data[indexPath.row];
cell.order = arr[indexPath.row];
}
return cell; return cell;
} }
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
...@@ -192,12 +175,12 @@ ...@@ -192,12 +175,12 @@
[bg addSubview:la]; [bg addSubview:la];
la.textColor = kTitleBlackColor; la.textColor = kTitleBlackColor;
la.font = kFontSize(12 * k6Scale); la.font = kFontSize(12 * k6Scale);
NSString *grou = self.dataSource[section]; ZXNewPayGroup *grou = self.dataSource[section];
la.text = grou; la.text = grou.groupName;
[la mas_makeConstraints:^(MASConstraintMaker *make) { [la mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(bg).insets(UIEdgeInsetsMake(5 * k6Scale, 10 * k6Scale, 5 * k6Scale, 10 * k6Scale)); make.edges.equalTo(bg).insets(UIEdgeInsetsMake(5 * k6Scale, 10 * k6Scale, 5 * k6Scale, 10 * k6Scale));
}]; }];
if (section==0) { if (section==0 && self.index==0) {
UILabel *rightlabel = [[UILabel alloc] init]; UILabel *rightlabel = [[UILabel alloc] init];
[v addSubview:rightlabel]; [v addSubview:rightlabel];
rightlabel.textColor = kTitleBlackColor; rightlabel.textColor = kTitleBlackColor;
......
// //
...@@ -47,6 +47,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -47,6 +47,9 @@ NS_ASSUME_NONNULL_BEGIN
//APP充值=01 后台充值=02 后台退款=03 //APP充值=01 后台充值=02 后台退款=03
@property (nonatomic, copy) NSString *businessType;//充值订单类型 @property (nonatomic, copy) NSString *businessType;//充值订单类型
@property (nonatomic, copy) NSString *rechargeRemark;
@property (nonatomic, assign) BOOL isRechargeOrder;//是否是充值订单 @property (nonatomic, assign) BOOL isRechargeOrder;//是否是充值订单
@property (nonatomic, copy) NSString *operType; @property (nonatomic, copy) NSString *operType;
......
// //
...@@ -121,15 +121,7 @@ ...@@ -121,15 +121,7 @@
} }
- (void)setOrder:(ZXNewPayOrder *)order { - (void)setOrder:(ZXNewPayOrder *)order {
_order = order; _order = order;
if ([_order.businessType isEqualToString:@"01"]) { self.freeDescLabel.text = _order.rechargeRemark;
self.freeDescLabel.text = @"APP充值";
} else if ([_order.businessType isEqualToString:@"02"]) {
self.freeDescLabel.text = @"后台充值";
} else if ([_order.businessType isEqualToString:@"03"]) {
self.freeDescLabel.text = @"后台退款";
} else {
self.freeDescLabel.text = @"其他充值";
}
self.freeTimeLabel.text = _order.completeAt; self.freeTimeLabel.text = _order.completeAt;
self.freeMoneyLabel.text = [NSString stringWithFormat:@"¥ %.2f", _order.actualAmount]; self.freeMoneyLabel.text = [NSString stringWithFormat:@"¥ %.2f", _order.actualAmount];
......
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.5</string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>jdlogin</string> <string>jdlogin</string>
...@@ -469,11 +469,9 @@ ...@@ -469,11 +469,9 @@
</dict> </dict>
</dict> </dict>
<key>NSBluetoothPeripheralUsageDescription</key> <key>NSBluetoothPeripheralUsageDescription</key>
<string>应用需要蓝牙权限</string> <string>应用在蓝牙洗浴时需要蓝牙权限</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>应用需要访问相机功能</string> <string>应用在紫宇洗衣、蓝牙洗浴等自助服务扫码时需要访问相机功能</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>应用需要定位功能</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>应用需要访问相册功能</string> <string>应用需要访问相册功能</string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
...@@ -483,12 +481,9 @@ ...@@ -483,12 +481,9 @@
</array> </array>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>audio</string>
<string>bluetooth-central</string> <string>bluetooth-central</string>
<string>bluetooth-peripheral</string>
<string>fetch</string> <string>fetch</string>
<string>remote-notification</string> <string>remote-notification</string>
<string>voip</string>
</array> </array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
......
// //
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
LoginJump *M = list.lastObject; LoginJump *M = list.lastObject;
isYS = [M.modelCode isEqualToString:@"DC_01"] || [M.modelCode isEqualToString:@"BD"]; isYS = [M.modelCode isEqualToString:@"DC_01"] || [M.modelCode isEqualToString:@"BD"];
} }
[self setupAllChildViewController:isYS]; [self setupAllChildViewController:YES];
} }
/* /*
Changing the delegate of a tab bar 【managed by a tab bar controller】 is not allowed. Changing the delegate of a tab bar 【managed by a tab bar controller】 is not allowed.
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "btn_search拷贝@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "btn_search拷贝@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "xxxxbg@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "xxxxbg@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "卡片@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "卡片@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "洗浴@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "洗浴@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "洗浴图标.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "洗浴图标@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "洗浴图标@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "洗浴豆.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "洗浴豆@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "洗浴豆@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "洗浴预约切换@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "洗浴预约切换@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "艾米币.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "艾米币@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "艾米币@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "蓝牙洗浴@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "蓝牙洗浴@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "预约已失效@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "预约已失效@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "预约按钮-grey@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "预约按钮-grey@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "预约按钮-light@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "预约按钮-light@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -15,8 +15,7 @@ target 'ColorfulSchool' do ...@@ -15,8 +15,7 @@ target 'ColorfulSchool' do
pod 'FMDB' pod 'FMDB'
pod 'DTCoreText' pod 'DTCoreText'
pod 'JXCategoryView' pod 'JXCategoryView'
pod 'GDTMobSDK' pod 'GDTMobSDK', '~> 4.10.5'
pod 'JJException' pod 'JJException'
pod 'Bugly' pod 'Bugly'
#pod 'MLeaksFinder'
end end
...@@ -41,9 +41,9 @@ PODS: ...@@ -41,9 +41,9 @@ PODS:
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- GDTMobSDK (4.8.7): - GDTMobSDK (4.10.5):
- GDTMobSDK/GDTMobSDK (= 4.8.7) - GDTMobSDK/GDTMobSDK (= 4.10.5)
- GDTMobSDK/GDTMobSDK (4.8.7) - GDTMobSDK/GDTMobSDK (4.10.5)
- HappyDNS (0.3.14) - HappyDNS (0.3.14)
- IQKeyboardManager (6.2.0) - IQKeyboardManager (6.2.0)
- JCore (1.2.5) - JCore (1.2.5)
...@@ -91,7 +91,7 @@ DEPENDENCIES: ...@@ -91,7 +91,7 @@ DEPENDENCIES:
- Bugly - Bugly
- DTCoreText - DTCoreText
- FMDB - FMDB
- GDTMobSDK - GDTMobSDK (~> 4.10.5)
- IQKeyboardManager - IQKeyboardManager
- JJException - JJException
- JPush - JPush
...@@ -143,7 +143,7 @@ SPEC CHECKSUMS: ...@@ -143,7 +143,7 @@ SPEC CHECKSUMS:
DTCoreText: e5d688cffc9f6a61eddd1a4f94e2046851230de3 DTCoreText: e5d688cffc9f6a61eddd1a4f94e2046851230de3
DTFoundation: f03be9fd786f11e505bb8fc44e2a3732bf0917df DTFoundation: f03be9fd786f11e505bb8fc44e2a3732bf0917df
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GDTMobSDK: cd573d3ad24736616e894ac4d9ebcccbbaf3bf1c GDTMobSDK: 815b36af278faafd38639b78eaa633d4cd211ddd
HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6 HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6
IQKeyboardManager: 6194101620b73af5e67900b8f89707a99de0b804 IQKeyboardManager: 6194101620b73af5e67900b8f89707a99de0b804
JCore: 14706de2640b25fb77dbd02332696491407f37c9 JCore: 14706de2640b25fb77dbd02332696491407f37c9
...@@ -159,6 +159,6 @@ SPEC CHECKSUMS: ...@@ -159,6 +159,6 @@ SPEC CHECKSUMS:
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
XRCarouselView: d3f949d1601e7de51604cdabd6e2f35a770e0f99 XRCarouselView: d3f949d1601e7de51604cdabd6e2f35a770e0f99
PODFILE CHECKSUM: 0ca59c0bbc7d7ab1f305c1e963070cdb31ce4f6b PODFILE CHECKSUM: e9780970eaa53ca639b637577116711a96b2b74c
COCOAPODS: 1.6.1 COCOAPODS: 1.6.1
...@@ -7,16 +7,84 @@ ...@@ -7,16 +7,84 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "GDTSDKDefines.h"
@class GDTMediaView;
@protocol GDTMediaViewDelegate <NSObject>
@optional
/**
用户点击 MediaView 回调,当 GDTVideoConfig userControlEnable 设为 YES,用户点击 mediaView 会回调。
@param mediaView 播放器实例
*/
- (void)gdt_mediaViewDidTapped:(GDTMediaView *)mediaView;
/**
播放完成回调
@param mediaView 播放器实例
*/
- (void)gdt_mediaViewDidPlayFinished:(GDTMediaView *)mediaView;
@end
@interface GDTMediaView : UIView @interface GDTMediaView : UIView
/** /**
是否支持在WWAN下自动播放视频 GDTMediaView 回调对象
*/
@property (nonatomic, weak) id <GDTMediaViewDelegate> delegate;
/**
* 视频广告时长,单位 ms
*/
- (CGFloat)videoDuration;
/**
* 视频广告已播放时长,单位 ms
*/
- (CGFloat)videoPlayTime;
/**
播放视频
*/
- (void)play;
/**
暂停视频,调用 pause 后,需要被暂停的视频广告对象,不会再自动播放,需要调用 play 才能恢复播放。
*/ */
@property (nonatomic, assign) BOOL videoAutoPlayOnWWAN; - (void)pause;
/** /**
是否支持mute视频广告 停止播放,并展示第一帧
*/ */
@property (nonatomic, assign) BOOL videoMuted; - (void)stop;
/**
播放静音开关
@param flag 是否静音
*/
- (void)muteEnable:(BOOL)flag;
/**
自定义播放按钮
@param image 自定义播放按钮图片,不设置为默认图
@param size 自定义播放按钮大小,不设置为默认大小 44 * 44
*/
- (void)setPlayButtonImage:(UIImage *)image size:(CGSize)size;
#pragma mark - DEPRECATED
/**
是否支持在WWAN下自动播放视频, 默认 NO,已废弃,请使用 GDTVideoConfig 类配置
*/
@property (nonatomic, assign) BOOL videoAutoPlayOnWWAN GDT_DEPRECATED_ATTRIBUTE;
/**
是否静音播放视频广告, 默认 YES,已废弃,请使用 GDTVideoConfig 类配置
*/
@property (nonatomic, assign) BOOL videoMuted GDT_DEPRECATED_ATTRIBUTE;
@end @end
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
- (void)bannerViewFailToReceived:(NSError *)error; - (void)bannerViewFailToReceived:(NSError *)error;
/** /**
* 应用进入后台时调用 * 详解:当点击应用下载或者广告调用系统程序打开时调用
* 详解:当点击应用下载或者广告调用系统程序打开,应用将被自动切换到后台
*/ */
- (void)bannerViewWillLeaveApplication; - (void)bannerViewWillLeaveApplication;
......
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
- (void)interstitialDidDismissScreen:(GDTMobInterstitial *)interstitial; - (void)interstitialDidDismissScreen:(GDTMobInterstitial *)interstitial;
/** /**
* 应用进入后台时回调 * 详解:当点击应用下载或者广告调用系统程序打开时调用
* 详解: 当点击下载应用时会调用系统程序打开,应用切换到后台
*/ */
- (void)interstitialApplicationWillEnterBackground:(GDTMobInterstitial *)interstitial; - (void)interstitialApplicationWillEnterBackground:(GDTMobInterstitial *)interstitial;
......
...@@ -17,6 +17,8 @@ extern NSString* const GDTNativeAdDataKeyImgUrl; ...@@ -17,6 +17,8 @@ extern NSString* const GDTNativeAdDataKeyImgUrl;
extern NSString* const GDTNativeAdDataKeyAppRating; extern NSString* const GDTNativeAdDataKeyAppRating;
extern NSString* const GDTNativeAdDataKeyAppPrice; extern NSString* const GDTNativeAdDataKeyAppPrice;
extern NSString* const GDTNativeAdDataKeyImgList; extern NSString* const GDTNativeAdDataKeyImgList;
extern NSString* const GDTNativeAdDataKeyImgWidth;
extern NSString* const GDTNativeAdDataKeyImgHeight;
@interface GDTNativeAdData : NSObject @interface GDTNativeAdData : NSObject
...@@ -31,6 +33,8 @@ extern NSString* const GDTNativeAdDataKeyImgList; ...@@ -31,6 +33,8 @@ extern NSString* const GDTNativeAdDataKeyImgList;
* 5. GDTNativeAdDataKeyAppRating 应用类广告的星级 * 5. GDTNativeAdDataKeyAppRating 应用类广告的星级
* 6. GDTNativeAdDataKeyAppPrice 应用类广告的价格 * 6. GDTNativeAdDataKeyAppPrice 应用类广告的价格
* 7. GDTNativeAdDataKeyImgList 三小图广告的图片集合 * 7. GDTNativeAdDataKeyImgList 三小图广告的图片集合
* 8. GDTNativeAdDataKeyImgWidth 素材宽度
* 9. GDTNativeAdDataKeyImgHeight 素材高度
*/ */
@property (nonatomic, retain, readonly) NSDictionary *properties; @property (nonatomic, retain, readonly) NSDictionary *properties;
/* /*
...@@ -46,6 +50,13 @@ extern NSString* const GDTNativeAdDataKeyImgList; ...@@ -46,6 +50,13 @@ extern NSString* const GDTNativeAdDataKeyImgList;
*/ */
- (BOOL)isThreeImgsAd; - (BOOL)isThreeImgsAd;
/**
返回广告的eCPM,单位:分
@return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
*/
- (NSInteger)eCPM;
@end @end
@class GDTNativeAd; @class GDTNativeAd;
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
- (void)nativeExpressAdViewDidDissmissScreen:(GDTNativeExpressAdView *)nativeExpressAdView; - (void)nativeExpressAdViewDidDissmissScreen:(GDTNativeExpressAdView *)nativeExpressAdView;
/** /**
* 原生模板广告点击之后应用进入后台时回调 * 详解:当点击应用下载或者广告调用系统程序打开时调用
*/ */
- (void)nativeExpressAdViewApplicationWillEnterBackground:(GDTNativeExpressAdView *)nativeExpressAdView; - (void)nativeExpressAdViewApplicationWillEnterBackground:(GDTNativeExpressAdView *)nativeExpressAdView;
...@@ -123,6 +123,11 @@ ...@@ -123,6 +123,11 @@
@property (nonatomic, assign) BOOL videoMuted; @property (nonatomic, assign) BOOL videoMuted;
/** /**
请求视频的时长上限,有效值范围为[5,60]。
*/
@property (nonatomic) NSInteger maxVideoDuration;
/**
* 构造方法 * 构造方法
* 详解:appId - 媒体 ID * 详解:appId - 媒体 ID
* placementId - 广告位 ID * placementId - 广告位 ID
......
...@@ -43,4 +43,11 @@ ...@@ -43,4 +43,11 @@
*/ */
- (CGFloat)videoPlayTime; - (CGFloat)videoPlayTime;
/**
返回广告的eCPM,单位:分
@return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
*/
- (NSInteger)eCPM;
@end @end
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol GDTRewardedVideoAdDelegate; @protocol GDTRewardedVideoAdDelegate;
...@@ -36,6 +37,14 @@ ...@@ -36,6 +37,14 @@
*/ */
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController; - (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
/**
返回广告的eCPM,单位:分
@return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
*/
- (NSInteger)eCPM;
@end @end
......
...@@ -39,6 +39,12 @@ typedef NS_ENUM(NSUInteger, GDTMediaPlayerStatus) { ...@@ -39,6 +39,12 @@ typedef NS_ENUM(NSUInteger, GDTMediaPlayerStatus) {
GDTMediaPlayerStatusError = 5, // 播放出错 GDTMediaPlayerStatusError = 5, // 播放出错
}; };
typedef enum GDTSDKLoginType {
GDTSDKLoginTypeUnknow = 0,
GDTSDKLoginTypeWeiXin = 1, //微信账号
GDTSDKLoginTypeQQ = 2, //QQ账号
} GDTSDKLoginType;
static inline BOOL isIPhoneXSeries() { static inline BOOL isIPhoneXSeries() {
if (@available(iOS 11.0, *)) { if (@available(iOS 11.0, *)) {
UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window]; UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window];
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
*/ */
- (void)splashAdLifeTime:(NSUInteger)time; - (void)splashAdLifeTime:(NSUInteger)time;
@end @end
@interface GDTSplashAd : NSObject @interface GDTSplashAd : NSObject
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "GDTUnifiedNativeAdDataObject.h" #import "GDTUnifiedNativeAdDataObject.h"
#import "GDTUnifiedNativeAdView.h" #import "GDTUnifiedNativeAdView.h"
NS_ASSUME_NONNULL_BEGIN
@protocol GDTUnifiedNativeAdDelegate <NSObject> @protocol GDTUnifiedNativeAdDelegate <NSObject>
...@@ -25,6 +26,11 @@ ...@@ -25,6 +26,11 @@
@property (nonatomic, weak) id<GDTUnifiedNativeAdDelegate> delegate; @property (nonatomic, weak) id<GDTUnifiedNativeAdDelegate> delegate;
/** /**
请求视频的最大时长,有效值范围为[5,60]。
*/
@property (nonatomic) NSInteger maxVideoDuration;
/**
构造方法 构造方法
@param appId 媒体ID @param appId 媒体ID
...@@ -45,3 +51,4 @@ ...@@ -45,3 +51,4 @@
*/ */
- (void)loadAdWithAdCount:(int)adCount; - (void)loadAdWithAdCount:(int)adCount;
@end @end
NS_ASSUME_NONNULL_END
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "GDTVideoConfig.h"
@interface GDTUnifiedNativeAdDataObject : NSObject @interface GDTUnifiedNativeAdDataObject : NSObject
...@@ -26,6 +27,16 @@ ...@@ -26,6 +27,16 @@
@property (nonatomic, copy, readonly) NSString *imageUrl; @property (nonatomic, copy, readonly) NSString *imageUrl;
/** /**
素材宽度,单图广告代表大图 imageUrl 宽度、多图广告代表小图 mediaUrlList 宽度
*/
@property (nonatomic, readonly) NSInteger imageWidth;
/**
素材高度,单图广告代表大图 imageUrl 高度、多图广告代表小图 mediaUrlList 高度
*/
@property (nonatomic, readonly) NSInteger imageHeight;
/**
应用类广告App 图标Url 应用类广告App 图标Url
*/ */
@property (nonatomic, copy, readonly) NSString *iconUrl; @property (nonatomic, copy, readonly) NSString *iconUrl;
...@@ -61,10 +72,23 @@ ...@@ -61,10 +72,23 @@
@property (nonatomic, readonly) BOOL isThreeImgsAd; @property (nonatomic, readonly) BOOL isThreeImgsAd;
/** /**
返回广告的eCPM,单位:分
@return 成功返回一个大于等于0的值,-1表示无权限或后台出现异常
*/
@property (nonatomic, readonly) NSInteger eCPM;
/**
视频广告播放配置
*/
@property (nonatomic, strong) GDTVideoConfig *videoConfig;
/**
判断两个自渲染2.0广告数据是否相等 判断两个自渲染2.0广告数据是否相等
@param dataObject 需要对比的自渲染2.0广告数据对象 @param dataObject 需要对比的自渲染2.0广告数据对象
@return YES or NO @return YES or NO
*/ */
- (BOOL) equlasAdData:(GDTUnifiedNativeAdDataObject *)dataObject; - (BOOL) equlasAdData:(GDTUnifiedNativeAdDataObject *)dataObject;
@end @end
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration; extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
@protocol GDTUnifiedNativeAdViewDelegate <NSObject> @protocol GDTUnifiedNativeAdViewDelegate <NSObject>
@optional
/** /**
广告曝光回调 广告曝光回调
...@@ -43,7 +45,7 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration; ...@@ -43,7 +45,7 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
/** /**
广告进入后台回调 当点击应用下载或者广告调用系统程序打开时调用
@param unifiedNativeAdView GDTUnifiedNativeAdView 实例 @param unifiedNativeAdView GDTUnifiedNativeAdView 实例
*/ */
...@@ -69,7 +71,25 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration; ...@@ -69,7 +71,25 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
@end @end
@interface GDTUnifiedNativeAdView:UIView @interface GDTUnifiedNativeAdView:UIView
/**
绑定的数据对象
*/
@property (nonatomic, strong, readonly) GDTUnifiedNativeAdDataObject *dataObject;
/**
视频广告的媒体View,绑定数据对象后自动生成,可自定义布局
*/
@property (nonatomic, strong, readonly) GDTMediaView *mediaView; @property (nonatomic, strong, readonly) GDTMediaView *mediaView;
/**
腾讯广告 LogoView,自动生成,可自定义布局
*/
@property (nonatomic, strong, readonly) GDTLogoView *logoView;
/**
广告 View 时间回调对象
*/
@property (nonatomic, weak) id<GDTUnifiedNativeAdViewDelegate> delegate; @property (nonatomic, weak) id<GDTUnifiedNativeAdViewDelegate> delegate;
/* /*
...@@ -78,8 +98,26 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration; ...@@ -78,8 +98,26 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
*/ */
@property (nonatomic, weak) UIViewController *viewController; @property (nonatomic, weak) UIViewController *viewController;
/**
自渲染2.0视图注册方法
@param dataObject 数据对象,必传字段
@param clickableViews 可点击的视图数组,此数组内的广告元素才可以响应广告对应的点击事件
*/
- (void)registerDataObject:(GDTUnifiedNativeAdDataObject *)dataObject
clickableViews:(NSArray<UIView *> *)clickableViews;
/**
注销数据对象,在 tableView、collectionView 等场景需要复用 GDTUnifiedNativeAdView 时,
需要在合适的时机,例如 cell 的 prepareForReuse 方法内执行 unregisterDataObject 方法,
将广告对象与 GDTUnifiedNativeAdView 解绑,具体可参考示例 demo 的 UnifiedNativeAdBaseTableViewCell 类
*/
- (void)unregisterDataObject;
#pragma mark - DEPRECATED
/** /**
此方法已经废弃
自渲染2.0视图注册方法 自渲染2.0视图注册方法
@param dataObject 数据对象,必传字段 @param dataObject 数据对象,必传字段
...@@ -90,10 +128,11 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration; ...@@ -90,10 +128,11 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
- (void)registerDataObject:(GDTUnifiedNativeAdDataObject *)dataObject - (void)registerDataObject:(GDTUnifiedNativeAdDataObject *)dataObject
logoView:(GDTLogoView *)logoView logoView:(GDTLogoView *)logoView
viewController:(UIViewController *)viewController viewController:(UIViewController *)viewController
clickableViews:(NSArray<UIView *> *)clickableViews; clickableViews:(NSArray<UIView *> *)clickableViews GDT_DEPRECATED_MSG_ATTRIBUTE("use registerDataObject:clickableViews: instead.");
/** /**
此方法已经废弃
自渲染2.0视图注册方法 自渲染2.0视图注册方法
@param dataObject 数据对象,必传字段 @param dataObject 数据对象,必传字段
...@@ -106,7 +145,7 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration; ...@@ -106,7 +145,7 @@ extern NSString* const kGDTUnifiedNativeAdKeyVideoDuration;
mediaView:(GDTMediaView *)mediaView mediaView:(GDTMediaView *)mediaView
logoView:(GDTLogoView *)logoView logoView:(GDTLogoView *)logoView
viewController:(UIViewController *)viewController viewController:(UIViewController *)viewController
clickableViews:(NSArray<UIView *> *)clickableViews; clickableViews:(NSArray<UIView *> *)clickableViews GDT_DEPRECATED_MSG_ATTRIBUTE("use registerDataObject:clickableViews: instead.");
@end @end
......
...@@ -41,9 +41,9 @@ PODS: ...@@ -41,9 +41,9 @@ PODS:
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- GDTMobSDK (4.8.7): - GDTMobSDK (4.10.5):
- GDTMobSDK/GDTMobSDK (= 4.8.7) - GDTMobSDK/GDTMobSDK (= 4.10.5)
- GDTMobSDK/GDTMobSDK (4.8.7) - GDTMobSDK/GDTMobSDK (4.10.5)
- HappyDNS (0.3.14) - HappyDNS (0.3.14)
- IQKeyboardManager (6.2.0) - IQKeyboardManager (6.2.0)
- JCore (1.2.5) - JCore (1.2.5)
...@@ -91,7 +91,7 @@ DEPENDENCIES: ...@@ -91,7 +91,7 @@ DEPENDENCIES:
- Bugly - Bugly
- DTCoreText - DTCoreText
- FMDB - FMDB
- GDTMobSDK - GDTMobSDK (~> 4.10.5)
- IQKeyboardManager - IQKeyboardManager
- JJException - JJException
- JPush - JPush
...@@ -143,7 +143,7 @@ SPEC CHECKSUMS: ...@@ -143,7 +143,7 @@ SPEC CHECKSUMS:
DTCoreText: e5d688cffc9f6a61eddd1a4f94e2046851230de3 DTCoreText: e5d688cffc9f6a61eddd1a4f94e2046851230de3
DTFoundation: f03be9fd786f11e505bb8fc44e2a3732bf0917df DTFoundation: f03be9fd786f11e505bb8fc44e2a3732bf0917df
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GDTMobSDK: cd573d3ad24736616e894ac4d9ebcccbbaf3bf1c GDTMobSDK: 815b36af278faafd38639b78eaa633d4cd211ddd
HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6 HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6
IQKeyboardManager: 6194101620b73af5e67900b8f89707a99de0b804 IQKeyboardManager: 6194101620b73af5e67900b8f89707a99de0b804
JCore: 14706de2640b25fb77dbd02332696491407f37c9 JCore: 14706de2640b25fb77dbd02332696491407f37c9
...@@ -159,6 +159,6 @@ SPEC CHECKSUMS: ...@@ -159,6 +159,6 @@ SPEC CHECKSUMS:
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
XRCarouselView: d3f949d1601e7de51604cdabd6e2f35a770e0f99 XRCarouselView: d3f949d1601e7de51604cdabd6e2f35a770e0f99
PODFILE CHECKSUM: 0ca59c0bbc7d7ab1f305c1e963070cdb31ce4f6b PODFILE CHECKSUM: e9780970eaa53ca639b637577116711a96b2b74c
COCOAPODS: 1.6.1 COCOAPODS: 1.6.1
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