MyPointController.m
3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// MyPointController.m
// DreamSleep
//
// Created by peter on 2022/5/26.
//
#import "MyPointController.h"
#import "ScoreTaskRequestModel.h"
#import "ScoreDetailController.h"
#import "MyPointView.h"
@interface MyPointController () <MyPointViewDelegate>
@property (nonatomic, strong) MyPointView *myPointView;
@property (nonatomic, strong) UIButton *scoreDetailBtn;
@end
@implementation MyPointController
- (void)loadView {
self.view = self.myPointView;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.myPointView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
self.naviBgColor = DSClearColor;
self.naviBarAlpha = 1.0;
self.naviTitle = @"我的积分";
self.titleLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, DkTitleColor, DSWhite);
[self.backBtn dk_setImage:DKImagePickerWithNames(@"cus_back_icon", @"sys_back_icon", @"sys_back_icon") forState:UIControlStateNormal];
[self.dsNaviBar addSubview:self.backBtn];
[self.dsNaviBar addSubview:self.scoreDetailBtn];
[self.scoreDetailBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.dsNaviBar);
make.bottom.equalTo(self.dsNaviBar).offset(-7);
make.size.mas_equalTo(CGSizeMake(81, 26));
}];
[ScoreTaskRequestModel queryUserIntegralRankWithCompletion:^(ScoreTaskRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
[self.myPointView updateScoreLevelView:requestModel.scoreModel];
}
}];
[ScoreTaskRequestModel queryWeekTotalRankWithQueryType:0 completion:^(ScoreTaskRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
}
}];
}
#pragma mark - Action
- (void)lookDetailAction {
ScoreDetailController *detailVC = [ScoreDetailController new];
[self.navigationController pushViewController:detailVC animated:YES];
}
#pragma mark - MyPointViewDelegate
- (void)didScrollToMaxOffsetY:(BOOL)isMax {
if (isMax) {
self.isNeedUpdateStatusBarStyle = YES;
self.dsNaviBar.dk_backgroundColorPicker = DKColorPickerWithColors(BrandColor, SubNaviDarkColor, BrandColor);
[self.backBtn setImage:[UIImage imageNamed:@"sys_back_icon"] forState:UIControlStateNormal];
self.titleLab.textColor = DSWhite;
[self.scoreDetailBtn setTitleColor:DSWhite forState:UIControlStateNormal];
} else {
self.naviBgColor = DSClearColor;
self.isNeedUpdateStatusBarStyle = NO;
[self.backBtn dk_setImage:DKImagePickerWithNames(@"cus_back_icon", @"sys_back_icon", @"sys_back_icon") forState:UIControlStateNormal];
self.titleLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, DkTitleColor, DSWhite);
[self.scoreDetailBtn dk_setTitleColorPicker:DKColorPickerWithKey(Dk_TITLE) forState:UIControlStateNormal];
}
self.scoreDetailBtn.layer.borderColor = self.scoreDetailBtn.titleLabel.textColor.CGColor;
}
#pragma mark - lazy
- (UIButton *)scoreDetailBtn {
if (!_scoreDetailBtn) {
_scoreDetailBtn = [UIButton btnWithTitle:@"积分明细" font:SysFont(12.0)];
[_scoreDetailBtn dk_setTitleColorPicker:DKColorPickerWithKey(Dk_TITLE) forState:UIControlStateNormal];
_scoreDetailBtn.layer.borderColor = _scoreDetailBtn.titleLabel.textColor.CGColor;
_scoreDetailBtn.layer.borderWidth = 1.0;
_scoreDetailBtn.layer.cornerRadius = 13.0;
_scoreDetailBtn.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
[_scoreDetailBtn addTarget:self action:@selector(lookDetailAction) forControlEvents:UIControlEventTouchUpInside];
}
return _scoreDetailBtn;
}
- (MyPointView *)myPointView {
if (!_myPointView) {
_myPointView = [[MyPointView alloc] initWithDelegate:self];
}
return _myPointView;
}
@end