Commit b3b0f1e3 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 4e998a20
This diff is collapsed.
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "编组@2x.png", "filename" : "选中@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "编组@3x.png", "filename" : "选中@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "苹果6.7.8-引导页-3@2x.png", "filename" : "苹果6.7.8-引导页-3副本@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "苹果6.7.8-引导页-3@3x.png", "filename" : "苹果6.7.8-引导页-3副本@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "super苹果引导11-3@2x.png", "filename" : "super苹果引导11-3副本@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "super苹果引导11-3@3x.png", "filename" : "super苹果引导11-3副本@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "声波@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "声波@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "编组 4@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "编组 4@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "虫子-实@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "虫子-实@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "宠物 (2)@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "宠物 (2)@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "编组 3@2x.png", "filename" : "表盘@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "编组 3@3x.png", "filename" : "表盘@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "位图@2x.png", "filename" : "%E5%8D%83%E5%BA%93%E7%BD%91_APP%E9%A1%B5%E9%9D%A2%E7%A9%BA%E7%8A%B6%E6%80%81%E6%B8%90%E5%8F%98%E6%89%81%E5%B9%B3%E9%A3%8E_%E5%85%83%E7%B4%A0%E7%BC%96%E5%8F%B712272362@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "位图@3x.png", "filename" : "%E5%8D%83%E5%BA%93%E7%BD%91_APP%E9%A1%B5%E9%9D%A2%E7%A9%BA%E7%8A%B6%E6%80%81%E6%B8%90%E5%8F%98%E6%89%81%E5%B9%B3%E9%A3%8E_%E5%85%83%E7%B4%A0%E7%BC%96%E5%8F%B712272362@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina5_5" orientation="portrait" appearance="light"/> <device id="retina5_5" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
...@@ -22,15 +22,15 @@ ...@@ -22,15 +22,15 @@
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints> <constraints>
<constraint firstItem="acc-Rv-JIN" firstAttribute="centerY" secondItem="6Tk-OE-BBY" secondAttribute="centerY" constant="-60" id="E7q-4D-g0o"/> <constraint firstItem="acc-Rv-JIN" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" constant="-60" id="E7q-4D-g0o"/>
<constraint firstItem="acc-Rv-JIN" firstAttribute="centerX" secondItem="6Tk-OE-BBY" secondAttribute="centerX" id="qL0-ib-AtF"/> <constraint firstItem="acc-Rv-JIN" firstAttribute="centerX" secondItem="eOI-jj-n0w" secondAttribute="centerX" id="qL0-ib-AtF"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> <viewLayoutGuide key="safeArea" id="eOI-jj-n0w"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="53" y="375"/> <point key="canvasLocation" x="52.173913043478265" y="374.18478260869568"/>
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
......
This diff is collapsed.
...@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface ICGuideViewController : ICBaseViewController @interface ICGuideViewController : ICBaseViewController
@property (nonatomic, copy) void(^clickCallBack)(BOOL);
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -36,9 +36,14 @@ ...@@ -36,9 +36,14 @@
} }
- (void)dismissGuideView { - (void)dismissGuideView {
ICHomeViewController *homeVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICHomeViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:homeVC]; if (self.clickCallBack) {
[UIApplication sharedApplication].keyWindow.rootViewController = navc; self.clickCallBack(YES);
}
// ICHomeViewController *homeVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICHomeViewController"];
// ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:homeVC];
// [UIApplication sharedApplication].keyWindow.rootViewController = navc;
} }
# pragma mark - UICollectionViewDataSource, UICollectionViewDelegate # pragma mark - UICollectionViewDataSource, UICollectionViewDelegate
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
#import "ICIPAProductModel.h" #import "ICIPAProductModel.h"
#import "Data.h" #import "Data.h"
@interface ICIAPViewController () @interface ICIAPViewController (){
NSTimer * timer;
int timerCount;
}
@property (weak, nonatomic) IBOutlet UIView *weakContentView; @property (weak, nonatomic) IBOutlet UIView *weakContentView;
@property (weak, nonatomic) IBOutlet UIView *yearContentView; @property (weak, nonatomic) IBOutlet UIView *yearContentView;
...@@ -39,6 +42,10 @@ ...@@ -39,6 +42,10 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[MobClick event:@"pay_page_view"];
[MobClick beginEvent:@"pay_page_stay"];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
self.weakContentView.layer.cornerRadius = KScaleWidth(8); self.weakContentView.layer.cornerRadius = KScaleWidth(8);
self.yearContentView.layer.cornerRadius = KScaleWidth(8);; self.yearContentView.layer.cornerRadius = KScaleWidth(8);;
...@@ -64,34 +71,40 @@ ...@@ -64,34 +71,40 @@
self.function2Label.text = ICLocalized(@"SecurelyData");//@"安全隐藏敏感数据"; self.function2Label.text = ICLocalized(@"SecurelyData");//@"安全隐藏敏感数据";
self.function3Label.text = ICLocalized(@"ForgetAdvert");//@"忘掉广告和限制"; self.function3Label.text = ICLocalized(@"ForgetAdvert");//@"忘掉广告和限制";
CAKeyframeAnimation *animation = [CAKeyframeAnimation animation]; // CAKeyframeAnimation *animation = [CAKeyframeAnimation animation];
// animation.keyPath = @"transform.scale";
// animation.duration = 1.6;
// animation.repeatCount = CGFLOAT_MAX;
// animation.values = @[@(1),@(1.05),@(0.96),@(1),@(1.08),@(0.98),@(1)];
// animation.keyTimes = @[@(0),@(0.13),@(0.26),@(0.39),@(0.52),@(0.9),@(1)];
// animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
// [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
// [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
// [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
// [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
// [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
// [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
// [self.yearContentView.layer addAnimation:animation forKey:nil];
CABasicAnimation * animation = [[CABasicAnimation alloc] init];
animation.duration = .66f;
animation.beginTime = 0.f;
animation.fromValue = @(0.94);
animation.toValue = @(1.00);
animation.keyPath = @"transform.scale"; animation.keyPath = @"transform.scale";
animation.duration = 1.6; animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
animation.repeatCount = CGFLOAT_MAX; animation.autoreverses = true;
animation.repeatCount = MAXFLOAT;
[self.yearContentView.layer addAnimation:animation forKey: @"transform.scale"];
animation.values = @[@(1),@(1.05),@(0.96),@(1),@(1.08),@(0.98),@(1)]; }
animation.keyTimes = @[@(0),@(0.13),@(0.26),@(0.39),@(0.52),@(0.9),@(1)];
animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], - (void)dealloc{
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], [MobClick endEvent:@"pay_page_stay"];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], NSLog(@"ICIAPViewController dealloc");
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], }
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], - (void)timerStart {
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; timerCount++;
[self.yearContentView.layer addAnimation:animation forKey:nil];
// CABasicAnimation * animation = [[CABasicAnimation alloc] init];
// animation.duration = 1.f;
// animation.beginTime = 0.f;
// animation.fromValue = @(0.95);
// animation.toValue = @(1.05);
// animation.keyPath = @"transform.scale";
// animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
// animation.autoreverses = true;
// animation.repeatCount = MAXFLOAT;
// [self.yearContentView.layer addAnimation:animation forKey: @"transform.scale"];
} }
-(void)getIpaList { -(void)getIpaList {
...@@ -129,7 +142,7 @@ ...@@ -129,7 +142,7 @@
} }
- (void)selectedWeakAction { - (void)selectedWeakAction {
[MobClick event:@"pay_weekly"]; [MobClick event:@"pay_week_vip_click"];
if (self.products.count == 0){ if (self.products.count == 0){
return; return;
} }
...@@ -139,11 +152,11 @@ ...@@ -139,11 +152,11 @@
break; break;
} }
} }
[self startPlanAction:_currentProduct]; [self startPlanAction:_currentProduct index:1];
} }
- (void)selectedYearAction { - (void)selectedYearAction {
[MobClick event:@"pay_yearly"]; [MobClick event:@"pay_year_vip_click"];
if (self.products.count == 0){ if (self.products.count == 0){
return; return;
} }
...@@ -153,7 +166,7 @@ ...@@ -153,7 +166,7 @@
break; break;
} }
} }
[self startPlanAction:_currentProduct]; [self startPlanAction:_currentProduct index:0];
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
...@@ -163,13 +176,13 @@ ...@@ -163,13 +176,13 @@
// dismiss // dismiss
- (IBAction)dismissAction { - (IBAction)dismissAction {
[MobClick event:@"close_trial_page"]; [MobClick event:@"pay_payment_close_click"];
[self dismissViewControllerAnimated:true completion:nil]; [self dismissViewControllerAnimated:true completion:nil];
} }
// 恢复购买 // 恢复购买
- (IBAction)restoreAction { - (IBAction)restoreAction {
[MobClick event:@"resume_pay"]; [MobClick event:@"pay_restore_click"];
[ICPurchaseManager restorePurchasesWithSuccess:^{ [ICPurchaseManager restorePurchasesWithSuccess:^{
[[ICUserManager shared] getUserInfo:^(ZTUserInfoModel * _Nonnull model) { [[ICUserManager shared] getUserInfo:^(ZTUserInfoModel * _Nonnull model) {
[self dismissViewControllerAnimated:true completion:nil]; [self dismissViewControllerAnimated:true completion:nil];
...@@ -180,14 +193,21 @@ ...@@ -180,14 +193,21 @@
} }
// 开始计划 // 开始计划
- (IBAction)startPlanAction:(ICIPAProductModel *)model { - (IBAction)startPlanAction:(ICIPAProductModel *)model index:(NSInteger)index{
[MobClick event:@"description_pay_button"]; [MobClick event:@"description_pay_button"];
[MobClick event:@"trial_use"]; [MobClick event:@"trial_use"];
NSString *payTypeStr = model.productId; NSString *payTypeStr = model.productId;
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[ICPurchaseManager purchaseWithProductIdWithProductId:payTypeStr inView:self.view success:^{ [ICPurchaseManager purchaseWithProductIdWithProductId:payTypeStr inView:self.view success:^{
[MobClick event:@"pay_suc"]; // [MobClick event:@"pay_suc"];
if (index == 0) {
[MobClick event:@"pay_year_success"];
}else if (index == 1){
[MobClick event:@"pay_week_success"];
}
[[ICUserManager shared] getUserInfo:^(ZTUserInfoModel * _Nonnull model) { [[ICUserManager shared] getUserInfo:^(ZTUserInfoModel * _Nonnull model) {
[weakSelf dismissViewControllerAnimated:true completion:nil]; [weakSelf dismissViewControllerAnimated:true completion:nil];
} failure:^{ } failure:^{
...@@ -216,8 +236,4 @@ ...@@ -216,8 +236,4 @@
[self.navigationController pushViewController:webView animated:true]; [self.navigationController pushViewController:webView animated:true];
} }
- (void)dealloc{
NSLog(@"ICIAPViewController dealloc");
}
@end @end
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#import "ICAdsTrackModel.h" #import "ICAdsTrackModel.h"
#import "ICCustomLaunchScreenView.h" #import "ICCustomLaunchScreenView.h"
#import "ZJGuideConfig.h"
#define kAPP_Version @"app_version" #define kAPP_Version @"app_version"
@interface AppDelegate ()<BUSplashAdDelegate> @interface AppDelegate ()<BUSplashAdDelegate>
...@@ -50,53 +52,81 @@ ...@@ -50,53 +52,81 @@
self.window = [[UIWindow alloc] initWithFrame: UIScreen.mainScreen.bounds]; self.window = [[UIWindow alloc] initWithFrame: UIScreen.mainScreen.bounds];
self.window.backgroundColor = [UIColor whiteColor]; // 窗口背景色 self.window.backgroundColor = [UIColor whiteColor]; // 窗口背景色
[self.window makeKeyAndVisible];
//当前运行的版本 ICHomeViewController *homeVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICHomeViewController"];
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:homeVC];
//本地保存的版本号 self.window.rootViewController = navc;
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; // NSString *codeId = [[data Read] objectForKey:kAdCodeId];
NSString *localVersion = [userDefault objectForKey:kAPP_Version]; // [self setupBUAdSDK:codeId];
[[ICUserManager shared] getServiceInfo]; [ZJGuideConfig configWithWindow:self.window finishMainVC:navc showGuide:^(BOOL result) {
if (!result) {
if ([currentVersion isEqualToString:localVersion]) { if ([ICUserManager shared].isShowSplashAd) {
//已经运行过该版本 if ([ICUserManager shared].isMember) {
ICHomeViewController *homeVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICHomeViewController"]; NSString *codeId = [[data Read] objectForKey:kAdCodeId];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:homeVC]; if (codeId.length > 0) {
self.window.rootViewController = navc; [self setupBUAdSDK:codeId];
}
if ([ICUserManager shared].isShowSplashAd) { } else {
if ([ICUserManager shared].isMember) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:kSplashAdViewDismissed object:nil];
});
}
} else {
NSString *codeId = [[data Read] objectForKey:kAdCodeId]; NSString *codeId = [[data Read] objectForKey:kAdCodeId];
if (codeId.length > 0) { if (codeId.length > 0) {
[self setupBUAdSDK:codeId]; [self setupBUAdSDK:codeId];
} }
} else {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:kSplashAdViewDismissed object:nil];
});
}
} else {
NSString *codeId = [[data Read] objectForKey:kAdCodeId];
if (codeId.length > 0) {
[self setupBUAdSDK:codeId];
} }
} }
} else { }];
//同意 更新储存版本 切换rootVC
[userDefault setObject:currentVersion forKey:kAPP_Version];
//ICGuideViewController
ICGuideViewController *guideVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICGuideViewController"];
self.window.rootViewController = guideVC;
}
[self.window makeKeyAndVisible]; // 让当前窗口成为主窗口 // //当前运行的版本
// NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
// //本地保存的版本号
// NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
// NSString *localVersion = [userDefault objectForKey:kAPP_Version];
//
// [[ICUserManager shared] getServiceInfo];
//
// if ([currentVersion isEqualToString:localVersion]) {
// //已经运行过该版本
// ICHomeViewController *homeVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICHomeViewController"];
// ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:homeVC];
// self.window.rootViewController = navc;
//
// if ([ICUserManager shared].isShowSplashAd) {
// if ([ICUserManager shared].isMember) {
// NSString *codeId = [[data Read] objectForKey:kAdCodeId];
// if (codeId.length > 0) {
// [self setupBUAdSDK:codeId];
// }
// } else {
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [[NSNotificationCenter defaultCenter] postNotificationName:kSplashAdViewDismissed object:nil];
// });
// }
// } else {
// NSString *codeId = [[data Read] objectForKey:kAdCodeId];
// if (codeId.length > 0) {
// [self setupBUAdSDK:codeId];
// }
// }
// } else {
// //同意 更新储存版本 切换rootVC
// [userDefault setObject:currentVersion forKey:kAPP_Version];
// //ICGuideViewController
// ICGuideViewController *guideVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICGuideViewController"];
// self.window.rootViewController = guideVC;
// }
NSMutableDictionary *dict = @{@"event": @"guazinovel", @"action": @"app_start", @"value": @""}.mutableCopy; NSMutableDictionary *dict = @{@"event": @"guazinovel", @"action": @"app_start", @"value": @""}.mutableCopy;
[[ZTNetworkTools shared] postWithLogCollection:logCollection parameters:dict success:^(id _Nullable __autoreleasing * _Nullable response) { [[ZTNetworkTools shared] postWithLogCollection:logCollection parameters:dict success:^(id _Nullable __autoreleasing * _Nullable response) {
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
}]; }];
[self reqestAdInfo]; [self reqestAdInfo];
return YES; return YES;
......
...@@ -29,13 +29,13 @@ ...@@ -29,13 +29,13 @@
[contentView addSubview:iconView]; [contentView addSubview:iconView];
[iconView mas_makeConstraints:^(MASConstraintMaker *make) { [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self); make.centerX.mas_equalTo(self);
make.centerY.mas_equalTo(self).mas_offset(-50); make.centerY.mas_equalTo(self).mas_offset(-80);
}]; }];
UILabel *tipLabel = [[UILabel alloc] init]; UILabel *tipLabel = [[UILabel alloc] init];
tipLabel.text = title; tipLabel.text = title;
tipLabel.textColor = kColorFromRGB(0xCED3DB); tipLabel.textColor = kColorFromRGB(0x333333);
tipLabel.font = [UIFont systemFontOfSize:14]; tipLabel.font = [UIFont systemFontOfSize:16];
tipLabel.textAlignment = NSTextAlignmentCenter; tipLabel.textAlignment = NSTextAlignmentCenter;
[contentView addSubview:tipLabel]; [contentView addSubview:tipLabel];
[tipLabel mas_makeConstraints:^(MASConstraintMaker *make) { [tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
......
//
// ZJGuideConfig.h
// ZhiJi
//
// Created by 明津李 on 2020/6/14.
// Copyright © 2020 Company. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZJGuideConfig : NSObject
+ (instancetype)shared;
+ (void)configWithWindow:(UIWindow *)window finishMainVC:(UIViewController *)finishMainVC showGuide:(void(^)(BOOL))result;
@end
NS_ASSUME_NONNULL_END
//
// ZJGuideConfig.m
// ZhiJi
//
// Created by 明津李 on 2020/6/14.
// Copyright © 2020 Company. All rights reserved.
//
#import "ZJGuideConfig.h"
#import "ICGuideViewController.h"
#import "ICUserManager.h"
#import "LaunchScreenPlaceHolderView.h"
@interface ZJGuideConfig ()
@property (nonatomic, strong) ICGuideViewController * vc;
@property (nonatomic, strong) LaunchScreenPlaceHolderView * launchScreen;
@property (nonatomic, strong) UIViewController * finishMainVC;
@property (nonatomic, strong) UIWindow * currentWindow;
@end
#define kAPP_Version @"app_version"
@implementation ZJGuideConfig
+ (instancetype)shared
{
static ZJGuideConfig *config;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
ICGuideViewController *guideVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICGuideViewController"];
config = [[ZJGuideConfig alloc] init];
//创建guide控制器
config.vc = guideVC;
// [[ICUserManager shared] getUserInfo:nil failure:nil];
// [[ZJUserInfoManager shared] getServiceInfo:nil];
});
return config;
}
+ (void)configWithWindow:(UIWindow *)window finishMainVC:(UIViewController *)finishMainVC showGuide:(void(^)(BOOL))result{
ZJGuideConfig * config = [ZJGuideConfig shared];
// [config checkVersionWithWindow:window finishMainVC:finishMainVC];
[config fakeLaunchScreenWithWindow:window finishMainVC:finishMainVC showGuide:result];
}
- (void)fakeLaunchScreenWithWindow:(UIWindow *)window finishMainVC:(UIViewController *)finishMainVC showGuide:(void(^)(BOOL))result{
self.currentWindow = window;
self.launchScreen = [[UINib nibWithNibName:@"LaunchScreenPlaceHolderView" bundle:nil] instantiateWithOwner:self options:nil].firstObject;
// self.launchScreen.frame = CGRectMake(0, [[UIApplication sharedApplication] statusBarFrame].size.height, window.bounds.size.width, window.bounds.size.height-[[UIApplication sharedApplication] statusBarFrame].size.height);
// self.launchScreen.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
[window addSubview:self.launchScreen];
[self.launchScreen layoutIfNeeded];
[self.launchScreen layoutSubviews];
[self.launchScreen mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(window);
}];
__weak typeof(self) weakSelf = self;
self.launchScreen.finishCallBack = ^{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
[weakSelf checkVersionWithWindow:window finishMainVC:finishMainVC showGuide:result];
[weakSelf.launchScreen removeFromSuperview];
});
});
};
}
- (void)checkVersionWithWindow:(UIWindow *)window finishMainVC:(UIViewController *)finishMainVC showGuide:(void(^)(BOOL))result{
ZJGuideConfig * config = [ZJGuideConfig shared];
//当前运行的版本
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
//本地保存的版本号
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
NSString *localVersion = [userDefault objectForKey:kAPP_Version];
if ([currentVersion isEqualToString:localVersion]) {
//已经运行过该版本
window.rootViewController = finishMainVC;
if (result) {
result(NO);
}
} else {
[MobClick event:@"app_startup_show"];
config.vc.clickCallBack = ^(BOOL agree) {
if (agree) {
//同意 更新储存版本 切换rootVC
[userDefault setObject:currentVersion forKey:kAPP_Version];
[userDefault synchronize];
window.rootViewController = finishMainVC;
}else{
exit(0);
}
};
if (result) {
result(YES);
}
window.rootViewController = config.vc;
}
}
@end
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
@property (strong, nonatomic) SCHomeHeaderView * headerView; @property (strong, nonatomic) SCHomeHeaderView * headerView;
@property (strong, nonatomic) NSArray * dataSource; @property (strong, nonatomic) NSArray * dataSource;
IBInspectable
@end @end
@implementation ICHomeViewController @implementation ICHomeViewController
...@@ -39,20 +41,21 @@ ...@@ -39,20 +41,21 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
_dataSource = @[@{@"image":@"home_cell_0", @"title":@"照片和视频", @"details":@"清除相似照片与视频"}, [MobClick event:@"home_pop"];
_dataSource = @[@{@"image":@"home_cell_0", @"title":@"照片和视频", @"details":@"清理重复照片和视频"},
@{@"image":@"home_cell_2", @"title":@"日历和提醒事项", @"details":@"清理过期提醒事项"}, @{@"image":@"home_cell_2", @"title":@"日历和提醒事项", @"details":@"清理过期提醒事项"},
@{@"image":@"home_cell_3", @"title":@"手机清灰", @"details":@"除尘·修复听筒音量"}, @{@"image":@"home_cell_3", @"title":@"赫兹声波", @"details":@""},
@{@"image":@"home_cell_4", @"title":@"网速检测", @"details":@"一键测试你的网络速度"}, @{@"image":@"home_cell_5", @"title":@"声波助手", @"details":@""},
@{@"image":@"home_cell_5", @"title":@"分贝检测", @"details":@"专业的噪音检测仪"}, @{@"image":@"home_cell_4", @"title":@"网络测速", @"details":@""},
@{@"image":@"home_cell_6", @"title":@"电池寿命", @"details":@"延长iPhone电池寿命"}, @{@"image":@"home_cell_6", @"title":@"电池小贴士", @"details":@""},
/*@{@"image":@"home_cell_7", @"title":@"相册统计", @"details":@"种类占比"}*/]; /*@{@"image":@"home_cell_7", @"title":@"相册统计", @"details":@"种类占比"}*/];
[self setupUI]; [self setupUI];
[[ICUserManager shared] loginAndGetUserInfo:^(ZTUserInfoModel * _Nonnull model) { [[ICUserManager shared] loginAndGetUserInfo:^(ZTUserInfoModel * _Nonnull model) {
[[ICUserManager shared] getServiceInfo]; [[ICUserManager shared] getServiceInfo];
if (!model.isMember) { if (![ICUserManager shared].isMember) {
Data * data = [[Data alloc] init]; Data * data = [[Data alloc] init];
NSDictionary * dic = [[data Read] objectForKey:@"open1close0"]; NSDictionary * dic = [[data Read] objectForKey:@"open1close0"];
...@@ -150,7 +153,7 @@ ...@@ -150,7 +153,7 @@
NSLog(@"%.1f/%.0f", usedMem, totalMem); NSLog(@"%.1f/%.0f", usedMem, totalMem);
NSLog(@"%.2f", usedMem/totalMem); NSLog(@"%.2f", usedMem/totalMem);
self.headerView.usedSpaceScaleLabel.text = [NSString stringWithFormat:@"%@ %.0f%%",ICLocalized(@"Used"), [[ICDiskKit takenSpace] floatValue]/totalMem * 100]; self.headerView.usedSpaceScaleLabel.text = [NSString stringWithFormat:@"%.0f%%", [[ICDiskKit takenSpace] floatValue]/totalMem * 100];
self.headerView.spacePercentLabel.text = [NSString stringWithFormat:@"%@/%.0fGB", [ICDiskKit takenSpace], totalMem]; self.headerView.spacePercentLabel.text = [NSString stringWithFormat:@"%@/%.0fGB", [ICDiskKit takenSpace], totalMem];
} }
...@@ -230,6 +233,14 @@ ...@@ -230,6 +233,14 @@
cell.titleLab.text = [dic objectForKey:@"title"]; cell.titleLab.text = [dic objectForKey:@"title"];
cell.detailsLab.text = [dic objectForKey:@"details"]; cell.detailsLab.text = [dic objectForKey:@"details"];
if (cell.detailsLab.text.length == 0) {
cell.titleBottomConstraint.constant = -2+cell.titleLab.frame.size.height/2;
cell.detailsLab.hidden = YES;
}else{
cell.titleBottomConstraint.constant = -2;
cell.detailsLab.hidden = NO;
}
if (indexPath.item%2!=0) { if (indexPath.item%2!=0) {
cell.right.hidden = YES; cell.right.hidden = YES;
}else{ }else{
...@@ -259,7 +270,7 @@ ...@@ -259,7 +270,7 @@
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{ - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
if (kind == UICollectionElementKindSectionHeader) { if (kind == UICollectionElementKindSectionHeader) {
SCHomeHeaderView * header = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"SCHomeHeaderView" forIndexPath:indexPath]; SCHomeHeaderView * header = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"SCHomeHeaderView" forIndexPath:indexPath];
header.backgroundColor = [UIColor whiteColor]; header.backgroundColor = [UIColor whiteColor];
self.headerView = header; self.headerView = header;
...@@ -319,6 +330,7 @@ ...@@ -319,6 +330,7 @@
break; break;
case 1: case 1:
{ {
[MobClick event:@"home_overdue_calendar"];
ICCalendarManageController *calendarVC = [[ICCalendarManageController alloc] init]; ICCalendarManageController *calendarVC = [[ICCalendarManageController alloc] init];
[self.navigationController pushViewController:calendarVC animated:true]; [self.navigationController pushViewController:calendarVC animated:true];
} }
...@@ -329,30 +341,33 @@ ...@@ -329,30 +341,33 @@
ICCleanDustViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICCleanDustViewController"]; ICCleanDustViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICCleanDustViewController"];
[self.navigationController pushViewController:vc animated:true]; [self.navigationController pushViewController:vc animated:true];
}else { }else {
[MobClick event:@"phone_deash_clean"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
} }
} }
break; break;
case 3: case 4:
{ {
if ([ICUserManager shared].isMember) { if ([ICUserManager shared].isMember) {
ICNetworkSpeedViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICNetworkSpeedViewController"]; ICNetworkSpeedViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICNetworkSpeedViewController"];
[self.navigationController pushViewController:vc animated:true]; [self.navigationController pushViewController:vc animated:true];
}else { }else {
[MobClick event:@"network_speed_detection"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
} }
} }
break; break;
case 4: case 3:
{ {
if ([ICUserManager shared].isMember) { if ([ICUserManager shared].isMember) {
ICDbTestViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICDbTestViewController"]; ICDbTestViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICDbTestViewController"];
[self.navigationController pushViewController:vc animated:true]; [self.navigationController pushViewController:vc animated:true];
}else { }else {
[MobClick event:@"db_detection"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
...@@ -365,6 +380,7 @@ ...@@ -365,6 +380,7 @@
ICBatteryCareViewController *vc = [[ICBatteryCareViewController alloc] init]; ICBatteryCareViewController *vc = [[ICBatteryCareViewController alloc] init];
[self.navigationController pushViewController:vc animated:true]; [self.navigationController pushViewController:vc animated:true];
}else { }else {
[MobClick event:@"battery_life"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
......
...@@ -38,7 +38,12 @@ ...@@ -38,7 +38,12 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.navigationItem.title = @"屏幕截图";
if (self.photoType == LocationPhoto){
}else{
self.navigationItem.title = @"屏幕截图";
}
self.itemSource = [NSMutableArray array]; self.itemSource = [NSMutableArray array];
...@@ -60,7 +65,7 @@ ...@@ -60,7 +65,7 @@
UIButton *selectBtn = [[UIButton alloc] init]; UIButton *selectBtn = [[UIButton alloc] init];
[selectBtn setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal]; [selectBtn setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal];
[selectBtn setTitle: ICLocalized(@"CancelAll") forState:UIControlStateSelected]; [selectBtn setTitle: ICLocalized(@"CancelAll") forState:UIControlStateSelected];
[selectBtn setTitleColor:[UIColor colorWithHex:0x030303] forState:UIControlStateNormal]; [selectBtn setTitleColor:kMassColor forState:UIControlStateNormal];
selectBtn.titleLabel.font = [UIFont systemFontOfSize:16]; selectBtn.titleLabel.font = [UIFont systemFontOfSize:16];
[selectBtn addTarget:self action:@selector(selectAllOrNotAction:) forControlEvents:UIControlEventTouchUpInside]; [selectBtn addTarget:self action:@selector(selectAllOrNotAction:) forControlEvents:UIControlEventTouchUpInside];
self.selectAllBtn = selectBtn; self.selectAllBtn = selectBtn;
...@@ -70,6 +75,9 @@ ...@@ -70,6 +75,9 @@
UIButton *deleteBtn = [[UIButton alloc] init]; UIButton *deleteBtn = [[UIButton alloc] init];
[deleteBtn setBackgroundImage:[UIImage imageNamed:@"global_green_btn_bg"] forState:UIControlStateNormal]; [deleteBtn setBackgroundImage:[UIImage imageNamed:@"global_green_btn_bg"] forState:UIControlStateNormal];
[deleteBtn setTitle: ICLocalized(@"DeleteScreenshots") forState:UIControlStateNormal]; //@"删除截图" [deleteBtn setTitle: ICLocalized(@"DeleteScreenshots") forState:UIControlStateNormal]; //@"删除截图"
if (self.photoType == LocationPhoto){
[deleteBtn setTitle: @"删除照片" forState:UIControlStateNormal];
}
[self.view addSubview:deleteBtn]; [self.view addSubview:deleteBtn];
[self.view bringSubviewToFront:deleteBtn]; [self.view bringSubviewToFront:deleteBtn];
...@@ -222,7 +230,10 @@ ...@@ -222,7 +230,10 @@
- (UICollectionView *)collectionView { - (UICollectionView *)collectionView {
if (!_collectionView) { if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
CGFloat itemCount = 4; CGFloat itemCount = 3;
if (self.photoType == LocationPhoto){
itemCount = 2;
}
CGFloat distance = 8; CGFloat distance = 8;
CGFloat width = self.view.frame.size.width; CGFloat width = self.view.frame.size.width;
CGFloat itemWH = (width - distance * (itemCount + 1)) / itemCount - 1; CGFloat itemWH = (width - distance * (itemCount + 1)) / itemCount - 1;
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
for (NSArray *models in dict.allValues) { for (NSArray *models in dict.allValues) {
[items addObjectsFromArray:models]; [items addObjectsFromArray:models];
} }
vc.title = dict.allKeys.firstObject;
vc.currentlocationGroudIndex = indexPath.row; vc.currentlocationGroudIndex = indexPath.row;
vc.similarArr = items; vc.similarArr = items;
vc.photoType = LocationPhoto; vc.photoType = LocationPhoto;
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
NSLog(@"%@ -- %@", startDate, endDate); NSLog(@"%@ -- %@", startDate, endDate);
// weakSelf.photoMgr.startDate = startDate; // weakSelf.photoMgr.startDate = startDate;
// weakSelf.photoMgr.endDate = endDate; // weakSelf.photoMgr.endDate = endDate;
[MobClick event:@"photo_select_time_period"];
NSMutableArray *temp = [NSMutableArray array]; NSMutableArray *temp = [NSMutableArray array];
for (ICBasePhotoModel *model in weakSelf.photoMgr.snapshotArray) { for (ICBasePhotoModel *model in weakSelf.photoMgr.snapshotArray) {
...@@ -124,7 +125,12 @@ ...@@ -124,7 +125,12 @@
// [MBProgressHUD showLoading:@"正在查询,请稍后..." toView:self.view]; // [MBProgressHUD showLoading:@"正在查询,请稍后..." toView:self.view];
[self.photoMgr loadLocationPhotoWithProcess:^(NSInteger current, NSInteger total) { [self.photoMgr loadLocationPhotoWithProcess:^(NSInteger current, NSInteger total) {
NSLog(@"loadLocationPhotoWithProcess %ld", (long)current); NSLog(@"loadLocationPhotoWithProcess %ld", (long)current);
cell.progressView.strokeStart = ((CGFloat)current / (CGFloat)(total / 4)); if (current == 0) {
cell.progressView.strokeStart = 0;
}else{
cell.progressView.strokeStart = ((CGFloat)current / (CGFloat)(total / 4));
}
// cell.progressView.strokeStart = ((CGFloat)current / (CGFloat)(total / 4));
cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)weakSelf.photoMgr.locationArray.count]; cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)weakSelf.photoMgr.locationArray.count];
} completionHandler:^(BOOL success, NSError *error) { } completionHandler:^(BOOL success, NSError *error) {
// [MBProgressHUD hideHUDForView:self.view]; // [MBProgressHUD hideHUDForView:self.view];
...@@ -261,6 +267,35 @@ ...@@ -261,6 +267,35 @@
} }
} else { } else {
switch (indexPath.row) {
case 0: {
[MobClick event:@"photo_and_video_screenshot"];
}
break;
case 1: {
[MobClick event:@"photo_and_video_spot"];
}
break;
case 2: {
[MobClick event:@"photo_and_video_similar_photo"];
}
break;
case 3: {
[MobClick event:@"photo_and_video_similar_video"];
}
break;
case 4: {
[MobClick event:@"photo_and_video_similar_live_photo"];
}
break;
case 5: {
[MobClick event:@"photo_and_video_similar_burst_photo"];
}
break;
default:
break;
}
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
[self screenshotDetailAction]; [self screenshotDetailAction];
break; break;
case 2: case 2:
[MobClick event:@"clean_now_similar_video"];
break; break;
case 3: case 3:
[self livePhotoDetailAction]; [self livePhotoDetailAction];
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
self.screenshotContentView.hidden = false; self.screenshotContentView.hidden = false;
self.livePhotoContentView.hidden = false; self.livePhotoContentView.hidden = false;
self.similarPhotoContentView.hidden = false; self.similarPhotoContentView.hidden = false;
self.similarVideoContentView.hidden = true; self.similarVideoContentView.hidden = false;
self.pauseButton.hidden = true; self.pauseButton.hidden = true;
self.clearAllButton.hidden = false; self.clearAllButton.hidden = false;
self.stepTipLabel.hidden = true; self.stepTipLabel.hidden = true;
...@@ -260,6 +260,7 @@ ...@@ -260,6 +260,7 @@
[MBProgressHUD showError: ICLocalized(@"NoPhotosCleanup")];//@"无照片可清理"]; [MBProgressHUD showError: ICLocalized(@"NoPhotosCleanup")];//@"无照片可清理"];
} }
} else { } else {
[MobClick event:@"clean_now_delete_all"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
...@@ -289,7 +290,7 @@ ...@@ -289,7 +290,7 @@
} }
- (IBAction)screenshotDetailAction { - (IBAction)screenshotDetailAction {
[MobClick event:@"screenshot_click"]; [MobClick event:@"screenshot_click"];
if ([ICUserManager shared].isMember) { if ([ICUserManager shared].isMember) {
ICNormalPhotoViewController *vc = [ICNormalPhotoViewController new]; ICNormalPhotoViewController *vc = [ICNormalPhotoViewController new];
vc.similarArr = self.photoMgr.snapshotArray; vc.similarArr = self.photoMgr.snapshotArray;
...@@ -297,6 +298,7 @@ ...@@ -297,6 +298,7 @@
vc.navigationItem.title = ICLocalized(@"ScreenCapture"); //@"屏幕截图"; vc.navigationItem.title = ICLocalized(@"ScreenCapture"); //@"屏幕截图";
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} else { } else {
[MobClick event:@"clean_now_screenshot"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
...@@ -312,6 +314,7 @@ ...@@ -312,6 +314,7 @@
vc.photoType = SimilayLivePhoto; vc.photoType = SimilayLivePhoto;
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} else { } else {
[MobClick event:@"clean_now_similar_live_photo"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
...@@ -327,6 +330,7 @@ ...@@ -327,6 +330,7 @@
vc.photoType = SimilayNormalPhoto; vc.photoType = SimilayNormalPhoto;
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} else { } else {
[MobClick event:@"clean_now_similar_photo"];
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
UIButton *selectBtn = [[UIButton alloc] init]; UIButton *selectBtn = [[UIButton alloc] init];
[selectBtn setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal]; [selectBtn setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal];
[selectBtn setTitle: ICLocalized(@"CancelAll") forState:UIControlStateSelected]; [selectBtn setTitle: ICLocalized(@"CancelAll") forState:UIControlStateSelected];
[selectBtn setTitleColor:[UIColor colorWithHex:0x030303] forState:UIControlStateNormal]; [selectBtn setTitleColor:kMassColor forState:UIControlStateNormal];
selectBtn.titleLabel.font = [UIFont systemFontOfSize:16]; selectBtn.titleLabel.font = [UIFont systemFontOfSize:16];
[selectBtn addTarget:self action:@selector(selectAllOrNotAction:) forControlEvents:UIControlEventTouchUpInside]; [selectBtn addTarget:self action:@selector(selectAllOrNotAction:) forControlEvents:UIControlEventTouchUpInside];
selectBtn.selected = true; selectBtn.selected = true;
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
[MobClick event:@"similar_live_photo_delete_click"]; [MobClick event:@"similar_live_photo_delete_click"];
break; break;
case SimilayVideoPhoto: case SimilayVideoPhoto:
[MobClick event:@"similar_photo_delete_all_click"]; [MobClick event:@"similar_video_delete_all_click"];
default: default:
break; break;
} }
......
...@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) IBOutlet UIView * left; @property (nonatomic, weak) IBOutlet UIView * left;
@property (nonatomic, weak) IBOutlet UIView * right; @property (nonatomic, weak) IBOutlet UIView * right;
@property (nonatomic, weak) IBOutlet NSLayoutConstraint * titleBottomConstraint;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<constraint firstAttribute="width" secondItem="Zv4-WU-omb" secondAttribute="height" id="8bM-lL-T2A"/> <constraint firstAttribute="width" secondItem="Zv4-WU-omb" secondAttribute="height" id="8bM-lL-T2A"/>
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="52.3/64 GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zHw-24-34Q"> <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="52.3/64 GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zHw-24-34Q">
<rect key="frame" x="170.5" y="241.5" width="74.5" height="17"/> <rect key="frame" x="170.5" y="241.5" width="74.5" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/> <nil key="textColor"/>
......
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
cover.frame = self.contentView.bounds; cover.frame = self.contentView.bounds;
cover.backgroundColor = [[UIColor colorWithHex:0x478DFE] colorWithAlphaComponent:0.3]; cover.backgroundColor = [[UIColor colorWithHex:0x478DFE] colorWithAlphaComponent:0.3];
cover.hidden = true; cover.hidden = true;
[self addSubview:cover]; // [self addSubview:cover];
self.coverView = cover; // self.coverView = cover;
CGFloat selectWH = 20; //frame.size.width * 0.3; CGFloat selectWH = 20; //frame.size.width * 0.3;
CGFloat selectX = frame.size.width - selectWH; CGFloat selectX = frame.size.width - selectWH;
UIButton *selectBtn = [[UIButton alloc] initWithFrame:CGRectMake(selectX - 5, 5, selectWH, selectWH)]; UIButton *selectBtn = [[UIButton alloc] initWithFrame:CGRectMake(selectX - 5, selectX-5, selectWH, selectWH)];
[self addSubview:selectBtn]; [self addSubview:selectBtn];
self.selectBtn = selectBtn; self.selectBtn = selectBtn;
[selectBtn setImage:[UIImage imageNamed:@"contact_choose"] forState:UIControlStateNormal]; [selectBtn setImage:[UIImage imageNamed:@"contact_choose"] forState:UIControlStateNormal];
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Super Cleaner 需要访问您的相机权限才能分析相似图片和视频</string> <string>Super Cleaner 需要访问您的相机权限才能分析相似图片和视频</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>Super Cleaner 需要访问您的麦克风才能进行分贝检测</string> <string>Super Cleaner 需要访问您的麦克风才能进行检测</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>Super Cleaner 需要访问您的相册权限才能分析相似图片和视频</string> <string>Super Cleaner 需要访问您的相册权限才能分析相似图片和视频</string>
<key>NSRemindersUsageDescription</key> <key>NSRemindersUsageDescription</key>
......
//
// LaunchScreenPlaceHolderView.h
// ZhiJi
//
// Created by 明津李 on 2020/6/29.
// Copyright © 2020 Company. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface LaunchScreenPlaceHolderView : UIView
@property (nonatomic, copy) void (^finishCallBack)(void);
@end
NS_ASSUME_NONNULL_END
//
// LaunchScreenPlaceHolderView.m
// ZhiJi
//
// Created by 明津李 on 2020/6/29.
// Copyright © 2020 Company. All rights reserved.
//
#import "LaunchScreenPlaceHolderView.h"
#import "ICUserManager.h"
@interface LaunchScreenPlaceHolderView(){
dispatch_source_t timer;
__block int count;
}
@end
@implementation LaunchScreenPlaceHolderView
- (instancetype)init{
if (self = [super init]) {
[self prepare];
}
return self;
}
- (void)awakeFromNib{
[super awakeFromNib];
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
if(self = [super initWithCoder:aDecoder]){
[self prepare];
}
return self;
}
- (void)prepare{
[[ICUserManager shared] loginAndGetUserInfo:^(ZTUserInfoModel * _Nonnull model) {
if (self.finishCallBack) {
self.finishCallBack();
}
if(self->timer){
dispatch_source_cancel(self->timer);
}
} failure:^{
if (self.finishCallBack) {
self.finishCallBack();
}
if(self->timer){
dispatch_source_cancel(self->timer);
}
}];
[self setTimer];
}
- (void)setTimer{
count = 3;
timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
dispatch_source_set_timer(timer, DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(timer, ^{
if (self->count > 0) {
self->count--;
}else{
if (self.finishCallBack) {
self.finishCallBack();
}
dispatch_source_cancel(self->timer);
}
});
dispatch_resume(timer);
}
- (void)dealloc{
dispatch_source_cancel(self->timer);
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina5_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LaunchScreenPlaceHolderView"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="LaunchScreenPlaceHolderView">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="screen_launch_icon" translatesAutoresizingMaskIntoConstraints="NO" id="TeR-ta-q9a">
<rect key="frame" x="93.666666666666686" y="205.66666666666663" width="227" height="205"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="TeR-ta-q9a" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" constant="-60" id="CXk-t6-QnM"/>
<constraint firstItem="TeR-ta-q9a" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="U2d-g9-nW9"/>
</constraints>
<point key="canvasLocation" x="139" y="90"/>
</view>
</objects>
<resources>
<image name="screen_launch_icon" width="227" height="205"/>
</resources>
</document>
...@@ -58,14 +58,10 @@ static ICUserManager * manager; ...@@ -58,14 +58,10 @@ static ICUserManager * manager;
- (BOOL)isMember { - (BOOL)isMember {
return true;
NSString *dateString = [[NSUserDefaults standardUserDefaults] valueForKeyPath:@"expiryDate"]; NSString *dateString = [[NSUserDefaults standardUserDefaults] valueForKeyPath:@"expiryDate"];
// if (dateString.length <= 0) {
//#ifdef DEBUG
// return YES;
//#else
// return self.model.isMember;
//#endif
// }
if (!dateString) { if (!dateString) {
Data * data = [[Data alloc] init]; Data * data = [[Data alloc] init];
dateString = [NSString stringWithFormat:@"%@ 23:59", [[data Read] objectForKey:@"memberEndTime"]]; dateString = [NSString stringWithFormat:@"%@ 23:59", [[data Read] objectForKey:@"memberEndTime"]];
...@@ -76,13 +72,20 @@ static ICUserManager * manager; ...@@ -76,13 +72,20 @@ static ICUserManager * manager;
NSDate *expiryDate = [formatter dateFromString:dateString]; NSDate *expiryDate = [formatter dateFromString:dateString];
NSLog(@"expiryDate == %@", expiryDate); NSLog(@"expiryDate == %@", expiryDate);
NSLog(@"currentDate %@", [NSDate date]); NSLog(@"currentDate %@", [NSDate date]);
if ([expiryDate timeIntervalSinceDate:[NSDate date]] > 0) {
return true; if (self.model) {
return self.model.isMember;
}else{
if ([expiryDate timeIntervalSinceDate:[NSDate date]] > 0) {
return true;
}else{
return false;
}
} }
// else if ([expiryDate timeIntervalSinceDate:[NSDate date]] <= 0) { // else if ([expiryDate timeIntervalSinceDate:[NSDate date]] <= 0) {
// return false; // return false;
// } // }
return self.model.isMember; // return self.model.isMember;
} }
- (NSString *)token{ - (NSString *)token{
......
...@@ -204,6 +204,7 @@ static ZTNetworkTools* _tools = nil; ...@@ -204,6 +204,7 @@ static ZTNetworkTools* _tools = nil;
NSString *bb = [key stringByAppendingFormat:@"=%@", ddd[key]]; NSString *bb = [key stringByAppendingFormat:@"=%@", ddd[key]];
aaa = [aaa stringByAppendingFormat:@"&%@", bb]; aaa = [aaa stringByAppendingFormat:@"&%@", bb];
} }
NSLog(@"%@", [urlString stringByAppendingFormat:@"?%@", aaa]);
NSMutableURLRequest *req = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString: [urlString stringByAppendingFormat:@"?%@", aaa] parameters:nil error:nil]; NSMutableURLRequest *req = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString: [urlString stringByAppendingFormat:@"?%@", aaa] parameters:nil error:nil];
req.timeoutInterval= 10; req.timeoutInterval= 10;
...@@ -455,10 +456,10 @@ static ZTNetworkTools* _tools = nil; ...@@ -455,10 +456,10 @@ static ZTNetworkTools* _tools = nil;
@"iPad4,4" : @"iPad Mini", // (2nd Generation iPad Mini - Wifi) @"iPad4,4" : @"iPad Mini", // (2nd Generation iPad Mini - Wifi)
@"iPad4,5" : @"iPad Mini", // (2nd Generation iPad Mini - Cellular) @"iPad4,5" : @"iPad Mini", // (2nd Generation iPad Mini - Cellular)
@"iPad4,7" : @"iPad Mini", // (3rd Generation iPad Mini - Wifi (model A1599)) @"iPad4,7" : @"iPad Mini", // (3rd Generation iPad Mini - Wifi (model A1599))
@"iPad6,7" : @"iPad Pro (12.9\")", // iPad Pro 12.9 inches - (model A1584) @"iPad6,7" : @"iPad Pro (12.9)", // iPad Pro 12.9 inches - (model A1584)
@"iPad6,8" : @"iPad Pro (12.9\")", // iPad Pro 12.9 inches - (model A1652) @"iPad6,8" : @"iPad Pro (12.9)", // iPad Pro 12.9 inches - (model A1652)
@"iPad6,3" : @"iPad Pro (9.7\")", // iPad Pro 9.7 inches - (model A1673) @"iPad6,3" : @"iPad Pro (9.7)", // iPad Pro 9.7 inches - (model A1673)
@"iPad6,4" : @"iPad Pro (9.7\")" // iPad Pro 9.7 inches - (models A1674 and A1675) @"iPad6,4" : @"iPad Pro (9.7)" // iPad Pro 9.7 inches - (models A1674 and A1675)
}; };
} }
......
...@@ -143,6 +143,11 @@ ...@@ -143,6 +143,11 @@
[self.navigationController pushViewController:calendarVC animated:true]; [self.navigationController pushViewController:calendarVC animated:true];
} }
} else { } else {
if (indexPath.row == 0) {
[MobClick event:@"calendar_and_reminder_overdue_calender"];
} else {
[MobClick event:@"calendar_and_reminder_overdue_reminder"];
}
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"]; ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC]; ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[self presentViewController:navc animated:true completion:nil]; [self presentViewController:navc animated:true completion:nil];
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
self.selectAllButton = [[UIButton alloc] init]; self.selectAllButton = [[UIButton alloc] init];
[self.selectAllButton setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal]; [self.selectAllButton setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal];
[self.selectAllButton addTarget:self action: @selector(chooseAction) forControlEvents:UIControlEventTouchUpInside]; [self.selectAllButton addTarget:self action: @selector(chooseAction) forControlEvents:UIControlEventTouchUpInside];
[self.selectAllButton setTitleColor:UIColor.blackColor forState: UIControlStateNormal]; [self.selectAllButton setTitleColor:kMassColor forState: UIControlStateNormal];
self.selectAllButton.titleLabel.font = [UIFont systemFontOfSize:17]; self.selectAllButton.titleLabel.font = [UIFont systemFontOfSize:17];
[self.selectAllButton sizeToFit]; [self.selectAllButton sizeToFit];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView: self.selectAllButton]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView: self.selectAllButton];
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
self.selectAllButton = [[UIButton alloc] init]; self.selectAllButton = [[UIButton alloc] init];
[self.selectAllButton setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal]; [self.selectAllButton setTitle: ICLocalized(@"ChooseAll") forState:UIControlStateNormal];
[self.selectAllButton addTarget:self action: @selector(chooseAction) forControlEvents:UIControlEventTouchUpInside]; [self.selectAllButton addTarget:self action: @selector(chooseAction) forControlEvents:UIControlEventTouchUpInside];
[self.selectAllButton setTitleColor:UIColor.blackColor forState: UIControlStateNormal]; [self.selectAllButton setTitleColor:kMassColor forState: UIControlStateNormal];
self.selectAllButton.titleLabel.font = [UIFont systemFontOfSize:17]; self.selectAllButton.titleLabel.font = [UIFont systemFontOfSize:17];
[self.selectAllButton sizeToFit]; [self.selectAllButton sizeToFit];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView: self.selectAllButton]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView: self.selectAllButton];
......
...@@ -35,6 +35,7 @@ typedef enum : NSUInteger { ...@@ -35,6 +35,7 @@ typedef enum : NSUInteger {
@property (weak, nonatomic) IBOutlet UIView *sliderContentView; @property (weak, nonatomic) IBOutlet UIView *sliderContentView;
@property (weak, nonatomic) IBOutlet UIImageView *centerImageView; @property (weak, nonatomic) IBOutlet UIImageView *centerImageView;
@property (weak, nonatomic) IBOutlet UIImageView *centerBgImageView;
@property (nonatomic, assign) ICPlayVoiceType voiceType; @property (nonatomic, assign) ICPlayVoiceType voiceType;
...@@ -156,19 +157,22 @@ typedef enum : NSUInteger { ...@@ -156,19 +157,22 @@ typedef enum : NSUInteger {
switch (sender.tag) { switch (sender.tag) {
case 1000: case 1000:
self.centerImageView.image = [UIImage imageNamed: @"tool_dust_image"]; self.centerImageView.image = [UIImage imageNamed: @"tool_clean_dust_center"];
self.centerBgImageView.image = [UIImage imageNamed:@"tool_clean_dust_center_bg"];
self.voiceType = ClearDustType; self.voiceType = ClearDustType;
self.bgCycleImageView.image = [UIImage imageNamed:@"tool_dust_clean_cycle_icon_1"]; self.bgCycleImageView.image = [UIImage imageNamed:@"tool_dust_clean_cycle_icon_1"];
break; break;
case 1001: case 1001:
self.centerImageView.image = [UIImage imageNamed: @"tool_mos_image"]; self.centerImageView.image = [UIImage imageNamed: @"tool_drive_mos_center"];
self.centerBgImageView.image = nil;
self.voiceType = DriveMosType; self.voiceType = DriveMosType;
self.bgCycleImageView.image = [UIImage imageNamed:@"tool_dust_clean_cycle_icon"]; self.bgCycleImageView.image = [UIImage imageNamed:@"tool_dust_clean_cycle_icon_1"];
break; break;
case 1002: case 1002:
self.centerImageView.image = [UIImage imageNamed: @"tool_pet_icon"]; self.centerImageView.image = [UIImage imageNamed: @"tool_drive_pet_center"];
self.centerBgImageView.image = nil;
self.voiceType = DrivePetType; self.voiceType = DrivePetType;
self.bgCycleImageView.image = [UIImage imageNamed:@"tool_dust_clean_cycle_icon"]; self.bgCycleImageView.image = [UIImage imageNamed:@"tool_dust_clean_cycle_icon_1"];
break; break;
default: default:
break; break;
......
...@@ -139,11 +139,11 @@ ...@@ -139,11 +139,11 @@
networkSpeed = [[QBTools formattedFileSize:speed] floatValue]; networkSpeed = [[QBTools formattedFileSize:speed] floatValue];
unit = @"MB"; unit = @"MB";
} }
networkSpeed = [speedStr floatValue]; // networkSpeed = [speedStr floatValue];
[weakSelf refreshDownloadDashboard: networkSpeed]; [weakSelf refreshDownloadDashboard: networkSpeed];
self.board.speedUnit = unit; self.board.speedUnit = unit;
self.board.mbpsValue = networkSpeed; self.board.mbpsValue = [speedStr floatValue];;
} finishMeasureBlock:^(float speed) { } finishMeasureBlock:^(float speed) {
NSString* speedStr = [NSString stringWithFormat:@"%@/S", [QBTools formattedFileSize:speed]]; NSString* speedStr = [NSString stringWithFormat:@"%@/S", [QBTools formattedFileSize:speed]];
......
...@@ -90,35 +90,56 @@ class ICDbDashboardLayer: CALayer { ...@@ -90,35 +90,56 @@ class ICDbDashboardLayer: CALayer {
override func draw(in ctx: CGContext) { override func draw(in ctx: CGContext) {
let radius = self.frame.width * 0.45 let radius = self.frame.width * 0.38
let center = CGPoint(x: self.frame.width * 0.5, y: self.frame.height * 0.5) let center = CGPoint(x: self.frame.width * 0.5, y: self.frame.height * 0.5)
let endAngle = self.number * CGFloat.pi * 1.5 + CGFloat.pi * 0.75 let endAngle = self.number * CGFloat.pi * 1.3 + CGFloat.pi * 0.86
ctx.setLineWidth(24) let outerEndAngle = self.number * CGFloat.pi * 1.24 + CGFloat.pi * 0.88
print("\(self.number)")
ctx.setLineWidth(18)
ctx.setStrokeColor(UIColor(hexString: "E5E5E5").cgColor) ctx.setStrokeColor(UIColor(hexString: "E5E5E5").cgColor)
ctx.setLineCap(.butt) ctx.setLineCap(.butt)
ctx.addArc(center: center, radius: radius - 10, startAngle: CGFloat.pi * 0.75, endAngle: CGFloat.pi * 0.25, clockwise: false) ctx.addArc(center: center, radius: radius - 10, startAngle: CGFloat.pi * 0.86, endAngle: CGFloat.pi * 0.15, clockwise: false)
// phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0 // phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0
ctx.setLineDash(phase: 0, lengths: [3, 10]) ctx.setLineDash(phase: 0, lengths: [3, 10])
ctx.strokePath() ctx.strokePath()
ctx.setLineWidth(24) ctx.setLineWidth(18)
ctx.setStrokeColor(massColor.cgColor) ctx.setStrokeColor(massColor.cgColor)
ctx.setLineCap(.butt) ctx.setLineCap(.butt)
ctx.addArc(center: center, radius: radius - 10, startAngle: CGFloat.pi * 0.75, endAngle: endAngle, clockwise: false) ctx.addArc(center: center, radius: radius - 10, startAngle: CGFloat.pi * 0.86, endAngle: endAngle, clockwise: false)
// phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0 // phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0
// lengths通常都包含两个数字,第一个是绘制的宽度,第二个表示跳过的宽度,也可以设置多个 // lengths通常都包含两个数字,第一个是绘制的宽度,第二个表示跳过的宽度,也可以设置多个
ctx.setLineDash(phase: 0, lengths: [3, 10]) ctx.setLineDash(phase: 0, lengths: [3, 10])
ctx.strokePath() ctx.strokePath()
ctx.setLineWidth(5) // ctx.setLineWidth(5)
ctx.setStrokeColor(UIColor(hexString: "E5E5E5").cgColor) // ctx.setStrokeColor(UIColor(hexString: "E5E5E5").cgColor)
// ctx.setLineCap(.butt)
// ctx.addArc(center: center, radius: radius - 30, startAngle: CGFloat.pi * 0.75, endAngle: CGFloat.pi * 0.25, clockwise: false)
// // phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0
// // lengths通常都包含两个数字,第一个是绘制的宽度,第二个表示跳过的宽度,也可以设置多个
// ctx.setLineDash(phase: 0, lengths: [3, 10])
// ctx.strokePath()
ctx.setLineWidth(1)
ctx.setStrokeColor(massColor.cgColor)
ctx.setLineCap(.butt) ctx.setLineCap(.butt)
ctx.addArc(center: center, radius: radius - 30, startAngle: CGFloat.pi * 0.75, endAngle: CGFloat.pi * 0.25, clockwise: false) ctx.addArc(center: center, radius: radius + 10, startAngle: CGFloat.pi * 0.88, endAngle: CGFloat.pi * 0.12, clockwise: false)
// phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0 // phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0
// lengths通常都包含两个数字,第一个是绘制的宽度,第二个表示跳过的宽度,也可以设置多个 // lengths通常都包含两个数字,第一个是绘制的宽度,第二个表示跳过的宽度,也可以设置多个
ctx.setLineDash(phase: 0, lengths: [3, 10]) ctx.setLineDash(phase: 0, lengths: [3, 0])
ctx.strokePath()
ctx.setLineWidth(20)
ctx.setStrokeColor(massColor.withAlphaComponent(0.5).cgColor)
ctx.setLineCap(.butt)
ctx.addArc(center: center, radius: radius + 21, startAngle: CGFloat.pi * 0.88, endAngle: outerEndAngle, clockwise: false)
// phase表示开始绘制之前跳过多少点进行绘制,默认一般设置为0
// lengths通常都包含两个数字,第一个是绘制的宽度,第二个表示跳过的宽度,也可以设置多个
ctx.setLineDash(phase: 0, lengths: [3, 0])
ctx.strokePath() ctx.strokePath()
} }
} }
//
// XMDotProgressView.h
// XMDotProgressView
//
// Created by xiaoming on 14/11/27.
// Copyright (c) 2014年 XiaoMing. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XMDotProgressView : UIView
@property (nonatomic, strong) UIColor *dotSelectedColor;
@property (nonatomic, strong) UIColor *dotUnseletedColor;
@property (nonatomic, assign) CGFloat dotDiameter; //default is 10
@property (nonatomic, assign) CGFloat paddingLeft; //default is 10 第一个点与view左边距,注意从圆的最左边算起
@property (nonatomic, assign) CGFloat progressLineHeight; //default is 2;
@property (nonatomic, assign, readonly) NSInteger seletedCount; // default is 0
@property (nonatomic, strong, readonly) NSArray *dotItemArray; //里面是 YBSDotItem
/**
* 设置方法,必须在设置完属性之后调用,否则设置的属性无效,这个初始化方法没有dotView下面的描述label
*
* @param argTotalDotCount <#argTotalDotCount description#>
*/
- (void)setupWithTotalDotCount:(NSInteger)argTotalDotCount;
/**
* 初始化设置方法,注意array的item是YBSDotItem,这个初始化方法有描述label
*
* @param argArray <#argArray description#>
*/
- (void)setupWithDotItem:(NSArray *)argArray;
- (void)setSeletedCount:(NSInteger)seletedCount;
- (void)setSeletedCount:(NSInteger)seletedCount animated:(BOOL)animated;
@end
@interface XMDotItem : NSObject
@property (nonatomic, copy) NSString *dotDescription;
@property (nonatomic, assign) NSInteger dotStatus;
@end
This diff is collapsed.
...@@ -65,8 +65,13 @@ ...@@ -65,8 +65,13 @@
-(void)meausurNet -(void)meausurNet
{ {
NSArray *urlArray = @[@"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.he.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest.bmcc.com.cn:8080/speedtest/random4000x4000.jpg", @"http://bj3.unicomtest.com:8080/speedtest/random4000x4000.jpg"]; NSArray *urlArray = @[@"http://myspeed.giantcomm.net:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.rd.ks.cox.net:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.chisholmbb.com:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.satel.usch.com:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.wilsontelephone.com:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.ideatek.com:8080/speedtest/random4000x4000.jpg"];
int value = arc4random() % urlArray.count; int value = arc4random() % urlArray.count;
NSString *urlString = urlArray[value]; NSString *urlString = urlArray[value];
...@@ -131,7 +136,12 @@ ...@@ -131,7 +136,12 @@
NSLog(@"connectionDidFinishLoading"); NSLog(@"connectionDidFinishLoading");
// [self finishMeasure]; // [self finishMeasure];
NSArray *urlArray = @[@"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.tj.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest1.he.chinamobile.com:8080/speedtest/random4000x4000.jpg", @"http://speedtest.bmcc.com.cn:8080/speedtest/random4000x4000.jpg", @"http://bj3.unicomtest.com:8080/speedtest/random4000x4000.jpg"]; NSArray *urlArray = @[@"http://myspeed.giantcomm.net:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.rd.ks.cox.net:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.chisholmbb.com:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.satel.usch.com:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.wilsontelephone.com:8080/speedtest/random4000x4000.jpg",
@"http://speedtest.ideatek.com:8080/speedtest/random4000x4000.jpg"];
int value = arc4random() % urlArray.count; int value = arc4random() % urlArray.count;
......
...@@ -30,6 +30,21 @@ ...@@ -30,6 +30,21 @@
return self; return self;
} }
-(void)drawRect:(CGRect)rect{
NSInteger count = 7;
NSInteger currentIndex = self.value/((self.maximumValue-1)/(count-2));
// 画圆
for (NSInteger i = 0; i < count; i ++) {
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(i * ((self.bounds.size.width-self.bounds.size.height)/(count-2))+2.5, 3, self.bounds.size.height-5, self.bounds.size.height-5) cornerRadius:((self.bounds.size.height-5)/2)];
[self.maximumTrackTintColor set];
if (currentIndex >= i) {
[self.thumbTintColor set];
}
[path fill];
}
}
#pragma mark - Overwrite functions #pragma mark - Overwrite functions
- (CGRect)trackRectForBounds:(CGRect)bounds { - (CGRect)trackRectForBounds:(CGRect)bounds {
...@@ -42,12 +57,14 @@ ...@@ -42,12 +57,14 @@
[super setValue:value animated:animated]; [super setValue:value animated:animated];
[self sliderValueChanged:self]; [self sliderValueChanged:self];
[self setNeedsDisplay];
} }
- (void)setValue:(float)value { - (void)setValue:(float)value {
[super setValue:value]; [super setValue:value];
[self sliderValueChanged:self]; [self sliderValueChanged:self];
[self setNeedsDisplay];
} }
#pragma mark - Setter functions #pragma mark - Setter functions
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#define kAdClkTracking @"ad_clk_tracking" #define kAdClkTracking @"ad_clk_tracking"
#define kAdImpTracking @"ad_imp_tracking" #define kAdImpTracking @"ad_imp_tracking"
#define ServerAds @"https://bs.zhangxinhulian.com/v3/ads"
#define userAgreement @"https://newspool.huolea.com/sspapiNovel/su/custom/clearapp/user.html" #define userAgreement @"https://newspool.huolea.com/sspapiNovel/su/custom/clearapp/user.html"
#define privacyPolicy @"https://newspool.huolea.com/sspapiNovel/su/custom/clearapp/privacy.html" #define privacyPolicy @"https://newspool.huolea.com/sspapiNovel/su/custom/clearapp/privacy.html"
#define feedbackUrl @"https://cdn-apph5.zhangxinzhixun.com/favorite/CommonProblem?token=%@&uid=%@" #define feedbackUrl @"https://cdn-apph5.zhangxinzhixun.com/favorite/CommonProblem?token=%@&uid=%@"
...@@ -77,12 +75,16 @@ ...@@ -77,12 +75,16 @@
// //
//#define ServerReport @"http://reporttest.zhangxinhulian.com" //#define ServerReport @"http://reporttest.zhangxinhulian.com"
//#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址 //#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址
//#define ServerAds @"https://bs.zhangxinhulian.com/v3/ads"
// //
//#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]); //#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
//#else //#else
#define ServerReport @"http://report.zhangxinhulian.com" #define ServerReport @"http://report.guazinovel.com"
#define ServerHost @"https://feedapi.zhangxinhulian.com" #define ServerHost @"http://feedapi.guazinovel.com"
#define ServerAds @"https://bs.guazinovel.com/v3/ads"
//#define NSLog(format, ...) nil //#define NSLog(format, ...) nil
//#endif //#endif
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
"Pause" = "暂停"; "Pause" = "暂停";
"PhoneCleaning" = "手机清灰"; "PhoneCleaning" = "手机清灰";
"DecibelDetection" = "分贝检测"; "DecibelDetection" = "声波助手";
"InternetSpeedTest" = "网络测速"; "InternetSpeedTest" = "网络测速";
"PowerSavingTips" = "来自 Super Cleaner 9个省电小妙招"; "PowerSavingTips" = "来自 Super Cleaner 9个省电小妙招";
"ExtendBatteryLife" = "教您延长iPhone电池寿命"; "ExtendBatteryLife" = "教您延长iPhone电池寿命";
......
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