Commit 7f49ef22 cgx

修复定时"取消设置";优化舒眠课时显示、呼吸法导航栏文案及位置

1 个父辈 75598e95
...@@ -2288,7 +2288,7 @@ ...@@ -2288,7 +2288,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 3;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
...@@ -2364,7 +2364,7 @@ ...@@ -2364,7 +2364,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
...@@ -2500,7 +2500,7 @@ ...@@ -2500,7 +2500,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements; CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 3;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4NDZ6UX8PW; DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
make.topMargin.equalTo(self.breathTextView.mas_bottom).offset(41); make.topMargin.equalTo(self.breathTextView.mas_bottom).offset(41);
}]; }];
[self.zoomView mas_makeConstraints:^(MASConstraintMaker *make) { [self.zoomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self.view); make.centerY.equalTo(self.view).offset(-(kTopHeight(0)/2.0));
make.leftMargin.equalTo(self.view).offset(90); make.leftMargin.equalTo(self.view).offset(90);
make.rightMargin.equalTo(self.view).offset(-90); make.rightMargin.equalTo(self.view).offset(-90);
make.height.equalTo(@300); make.height.equalTo(@300);
......
...@@ -400,6 +400,9 @@ ...@@ -400,6 +400,9 @@
weakSelf.countTime = 60 * [minuteDatas[index] intValue]; weakSelf.countTime = 60 * [minuteDatas[index] intValue];
weakSelf.totalTime = 60 * [minuteDatas[index] intValue]; weakSelf.totalTime = 60 * [minuteDatas[index] intValue];
[weakSelf.timer setFireDate:[NSDate date]]; [weakSelf.timer setFireDate:[NSDate date]];
} cancel:^{
[weakSelf.timer setFireDate:[NSDate distantFuture]];
[weakSelf.timeCloseBtn setTitle:@"" forState:UIControlStateNormal];
}]; }];
} }
return _timingView; return _timingView;
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
} else { } else {
BreatheController *breatheVC = [[BreatheController alloc] init]; BreatheController *breatheVC = [[BreatheController alloc] init];
breatheVC.style = sender.tag == 1 ? LottieStyleBalance : LottieStyleComfortable; breatheVC.style = sender.tag == 1 ? LottieStyleBalance : LottieStyleComfortable;
breatheVC.title = sender.tag == 1 ? @"均衡呼吸法" : @"舒睡4-7-8呼吸法"; breatheVC.title = sender.tag == 1 ? @"高效均衡呼吸法" : @"海军快速入眠特训";
[self.ds_viewController.navigationController pushViewController:breatheVC animated:YES]; [self.ds_viewController.navigationController pushViewController:breatheVC animated:YES];
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
self.courseIcon.hidden = NO; self.courseIcon.hidden = NO;
self.courseLab.hidden = NO; self.courseLab.hidden = NO;
self.courseLab.text = [NSString stringWithFormat:@"%d", model.count]; self.courseLab.text = [NSString stringWithFormat:@"%d课时", model.count];
[self.courseLab sizeToFit]; [self.courseLab sizeToFit];
[self.courseIcon mas_makeConstraints:^(MASConstraintMaker *make) { [self.courseIcon mas_makeConstraints:^(MASConstraintMaker *make) {
......
...@@ -10,13 +10,16 @@ ...@@ -10,13 +10,16 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef void(^TimingBlock)(NSInteger index, NSArray *minuteDatas); typedef void(^TimingBlock)(NSInteger index, NSArray *minuteDatas);
typedef void(^CancelBlock)(void);
/// 首页和音频播放界面定时弹框 /// 首页和音频播放界面定时弹框
@interface TimingView : UIView @interface TimingView : UIView
/// 确定block
@property (nonatomic, copy) TimingBlock timingBlock; @property (nonatomic, copy) TimingBlock timingBlock;
/// 取消block
@property (nonatomic, copy) CancelBlock cancelBlock;
- (instancetype)initWithSureBlock:(TimingBlock)block; - (instancetype)initWithSureBlock:(TimingBlock)timingBlock cancel:(CancelBlock)cancelBlock;
/// 显示定时器 /// 显示定时器
- (void)display; - (void)display;
......
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
@implementation TimingView @implementation TimingView
- (instancetype)initWithSureBlock:(TimingBlock)block { - (instancetype)initWithSureBlock:(TimingBlock)timingBlock cancel:(CancelBlock)cancelBlock {
if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) { if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) {
_currentTimeIndex = 0; _currentTimeIndex = 0;
_timingBlock = block; _timingBlock = timingBlock;
_cancelBlock = cancelBlock;
self.dk_backgroundColorPicker = DKColorPickerWithColors(ColorFromHex(0x6F7587), DSClearColor, DSWhite); self.dk_backgroundColorPicker = DKColorPickerWithColors(ColorFromHex(0x6F7587), DSClearColor, DSWhite);
self.backgroundColor = [self.backgroundColor colorWithAlphaComponent:0.6]; self.backgroundColor = [self.backgroundColor colorWithAlphaComponent:0.6];
...@@ -114,6 +115,13 @@ ...@@ -114,6 +115,13 @@
} }
} }
- (void)cancelAction {
[self dismissTimingView];
if (self.cancelBlock) {
self.cancelBlock();
}
}
#pragma mark - UIPickerViewDataSource && UIPickerViewDelegate #pragma mark - UIPickerViewDataSource && UIPickerViewDelegate
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pickerView { - (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pickerView {
return 1; return 1;
...@@ -194,7 +202,7 @@ ...@@ -194,7 +202,7 @@
if (!_cancelBtn) { if (!_cancelBtn) {
_cancelBtn = [UIButton dkBtnTitle:@"取消设置" font:SysFont(15)]; _cancelBtn = [UIButton dkBtnTitle:@"取消设置" font:SysFont(15)];
[_cancelBtn dk_setTitleColorPicker:DKColorPickerWithKey(TEXT) forState:UIControlStateNormal]; [_cancelBtn dk_setTitleColorPicker:DKColorPickerWithKey(TEXT) forState:UIControlStateNormal];
[_cancelBtn addTarget:self action:@selector(dismissTimingView) forControlEvents:UIControlEventTouchUpInside]; [_cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside];
} }
return _cancelBtn; return _cancelBtn;
} }
......
...@@ -172,6 +172,9 @@ ...@@ -172,6 +172,9 @@
weakSelf.countTime = 60 * [minuteDatas[index] intValue]; weakSelf.countTime = 60 * [minuteDatas[index] intValue];
weakSelf.totalTime = 60 * [minuteDatas[index] intValue]; weakSelf.totalTime = 60 * [minuteDatas[index] intValue];
[weakSelf.timer setFireDate:[NSDate date]]; [weakSelf.timer setFireDate:[NSDate date]];
} cancel:^{
[weakSelf.timer setFireDate:[NSDate distantFuture]];
weakSelf.timeLab.text = @"";
}]; }];
} }
return _timingView; return _timingView;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!