首页手表监测

This commit is contained in:
NSArray
2026-03-04 18:07:02 +08:00
parent 823063653b
commit c5b5149bb1
12 changed files with 421 additions and 108 deletions
@@ -15,16 +15,10 @@
@interface XJHomePageV2HeardView ()<SDCycleScrollViewDelegate>
@property (nonatomic, strong) UIView * messageview;
@property (nonatomic, strong) SDCycleScrollView * adTitleView;
@property (nonatomic, strong) UILabel * nameLabel;
@property (nonatomic, strong) XJHomeWatchDataView * watchDataView;
@property (nonatomic, strong) UIView *messageview;
@property (nonatomic, strong) SDCycleScrollView *adTitleView;
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) XJHomeWatchDataView *watchDataView;
@end
@@ -309,12 +303,23 @@
//手表数据
self.watchDataView = [[XJHomeWatchDataView alloc] initWithFrame:CGRectZero];
self.watchDataView.tabTitles = @[@"心脑血管", @"癌症", @"慢呼", @"糖尿病", @"亚健康",@"心脑血管", @"癌症", @"慢呼", @"糖尿病", @"亚健康"];
self.watchDataView.tabTitles = @[@"心脑血管", @"癌症", @"慢呼", @"糖尿病", @"亚健康"];
self.watchDataView.tabSelectBlock = ^(NSInteger index, NSString *title) {
DLog(@"选中 %ld - %@", index, title);
// 切换 collectionView 到对应 page
};
MJWeakSelf
self.watchDataView.tabSelectBlock = ^(NSInteger index, NSString *title) {
// tab 0 完整高度,其他收缩(header 40 + tab 52 + 内容区 68 = 160
CGFloat height = (index == 0) ? 250 : 160;
[weakSelf.watchDataView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(height);
}];
[UIView animateWithDuration:0.25 animations:^{
[weakSelf layoutIfNeeded];
}];
};
self.watchDataView.watchMoreBlock = ^{
if ([self.homeTopDelegate respondsToSelector:@selector(watchDetailClick)]) {
[self.homeTopDelegate watchDetailClick];
@@ -326,7 +331,7 @@
[self.watchDataView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_offset(12);
make.right.mas_offset(-12);
make.height.mas_offset(300);
make.height.mas_offset(250);
make.top.mas_equalTo(lastImageView.mas_bottom).offset(12);
}];