Commit a4f46392 cgx

完成我的积分头部视图

1 个父辈 6da72bcf
正在显示 29 个修改的文件 包含 461 行增加7 行删除
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C499284F4F0D000F3089 /* DailyTaskCell.m */; }; D037C49A284F4F0D000F3089 /* DailyTaskCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C499284F4F0D000F3089 /* DailyTaskCell.m */; };
D037C49D284F5DE8000F3089 /* TaskPointSrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C49C284F5DE8000F3089 /* TaskPointSrollView.m */; }; D037C49D284F5DE8000F3089 /* TaskPointSrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D037C49C284F5DE8000F3089 /* TaskPointSrollView.m */; };
D03AE82B281A9010001C0726 /* MyFeedDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */; }; D03AE82B281A9010001C0726 /* MyFeedDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */; };
D0404A2B2870930A0062AD30 /* BeizerView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0404A2A2870930A0062AD30 /* BeizerView.m */; };
D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD54285B11860043A4CE /* VersionUpdateBox.m */; }; D043DD55285B11860043A4CE /* VersionUpdateBox.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD54285B11860043A4CE /* VersionUpdateBox.m */; };
D043DD58285B25EE0043A4CE /* VersionRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD57285B25EE0043A4CE /* VersionRequestModel.m */; }; D043DD58285B25EE0043A4CE /* VersionRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D043DD57285B25EE0043A4CE /* VersionRequestModel.m */; };
D0496798283484CC00FB81E5 /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0496797283484CC00FB81E5 /* ProfileTableView.m */; }; D0496798283484CC00FB81E5 /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0496797283484CC00FB81E5 /* ProfileTableView.m */; };
...@@ -330,6 +331,8 @@ ...@@ -330,6 +331,8 @@
D03ABDAF28328F4300DD88B0 /* UnityFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UnityFramework.framework; path = "TapiOS/build/Release-iphoneos/UnityFramework.framework"; sourceTree = "<group>"; }; D03ABDAF28328F4300DD88B0 /* UnityFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UnityFramework.framework; path = "TapiOS/build/Release-iphoneos/UnityFramework.framework"; sourceTree = "<group>"; };
D03AE829281A9010001C0726 /* MyFeedDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFeedDetailModel.h; sourceTree = "<group>"; }; D03AE829281A9010001C0726 /* MyFeedDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFeedDetailModel.h; sourceTree = "<group>"; };
D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyFeedDetailModel.m; sourceTree = "<group>"; }; D03AE82A281A9010001C0726 /* MyFeedDetailModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyFeedDetailModel.m; sourceTree = "<group>"; };
D0404A292870930A0062AD30 /* BeizerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BeizerView.h; sourceTree = "<group>"; };
D0404A2A2870930A0062AD30 /* BeizerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BeizerView.m; sourceTree = "<group>"; };
D043DD53285B11860043A4CE /* VersionUpdateBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionUpdateBox.h; sourceTree = "<group>"; }; D043DD53285B11860043A4CE /* VersionUpdateBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionUpdateBox.h; sourceTree = "<group>"; };
D043DD54285B11860043A4CE /* VersionUpdateBox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VersionUpdateBox.m; sourceTree = "<group>"; }; D043DD54285B11860043A4CE /* VersionUpdateBox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VersionUpdateBox.m; sourceTree = "<group>"; };
D043DD56285B25EE0043A4CE /* VersionRequestModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionRequestModel.h; sourceTree = "<group>"; }; D043DD56285B25EE0043A4CE /* VersionRequestModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VersionRequestModel.h; sourceTree = "<group>"; };
...@@ -1106,6 +1109,8 @@ ...@@ -1106,6 +1109,8 @@
D01DC95028701ECD0035B78B /* MyPointView.m */, D01DC95028701ECD0035B78B /* MyPointView.m */,
D01DC952287022740035B78B /* ScoreLevelView.h */, D01DC952287022740035B78B /* ScoreLevelView.h */,
D01DC953287022740035B78B /* ScoreLevelView.m */, D01DC953287022740035B78B /* ScoreLevelView.m */,
D0404A292870930A0062AD30 /* BeizerView.h */,
D0404A2A2870930A0062AD30 /* BeizerView.m */,
D0071C6E28707BCB0035AD8A /* ScoreRulesView.h */, D0071C6E28707BCB0035AD8A /* ScoreRulesView.h */,
D0071C6F28707BCC0035AD8A /* ScoreRulesView.m */, D0071C6F28707BCC0035AD8A /* ScoreRulesView.m */,
D01DC955287023C20035B78B /* RankHeadView.h */, D01DC955287023C20035B78B /* RankHeadView.h */,
...@@ -2005,6 +2010,7 @@ ...@@ -2005,6 +2010,7 @@
D0534F092835D90400F8892E /* DSNaviBarViewController.m in Sources */, D0534F092835D90400F8892E /* DSNaviBarViewController.m in Sources */,
D04B3D9A27F6D4D90022F8DF /* LeadingController.m in Sources */, D04B3D9A27F6D4D90022F8DF /* LeadingController.m in Sources */,
D0031549284DAC0D00CFE94D /* RelaxBodyView.m in Sources */, D0031549284DAC0D00CFE94D /* RelaxBodyView.m in Sources */,
D0404A2B2870930A0062AD30 /* BeizerView.m in Sources */,
D053BEE9280F9E310028CCFC /* CloseAlertView.m in Sources */, D053BEE9280F9E310028CCFC /* CloseAlertView.m in Sources */,
D0D00199282C9402004EAFA1 /* NoiseView.m in Sources */, D0D00199282C9402004EAFA1 /* NoiseView.m in Sources */,
D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */, D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */,
......
//
// BeizerView.h
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 自定义贝塞尔曲线
@interface BeizerView : UIView
@property(nonatomic, assign)float progressRate;
@property(nonatomic, strong)UIColor *color;
@property(nonatomic, assign)float x;//cetner x
@property(nonatomic, assign)float y;//center y
@property(nonatomic, assign)float radius;//半径
@property(nonatomic, assign)float startAngle;//起始位置
- (void)animateProgress:(float)progress animate:(BOOL)animate;
@end
NS_ASSUME_NONNULL_END
//
// BeizerView.m
// DreamSleep
//
// Created by peter on 2022/7/2.
//
#import "BeizerView.h"
@interface BeizerView ()
@property(nonatomic,assign) float step;
@property(nonatomic,assign) float total;
@end
@implementation BeizerView
- (void)drawRect:(CGRect)rect
{
[[UIColor orangeColor] set];
DSLog(@"====:%f, %f", self.width, self.height);
UIBezierPath *path9 = [UIBezierPath bezierPath];
[path9 moveToPoint:CGPointMake(0, self.height)];
[path9 addLineToPoint:CGPointMake(36+36, self.height)];
[path9 addCurveToPoint:CGPointMake(self.width, 0) controlPoint1:CGPointMake(36+36, self.height) controlPoint2:CGPointMake(self.width - 56, self.height - 34)];
// [path9 addQuadCurveToPoint:CGPointMake(self.width, 0) controlPoint:CGPointMake(self.width - 56, self.height - 34)];
// [path9 stroke];
// 创建CAShapeLayer
CAShapeLayer *layer = [CAShapeLayer layer];
layer.fillColor = [UIColor clearColor].CGColor;
layer.lineWidth = 2.0f;
layer.lineCap = kCALineCapRound;
layer.lineJoin = kCALineJoinRound;
layer.strokeColor = [UIColor blueColor].CGColor;
[self.layer addSublayer:layer];
layer.path = path9.CGPath;
// CAGradientLayer *gradLayer = [CAGradientLayer layer];
// gradLayer.frame = CGRectMake(100, 100, 100, 100);
// gradLayer.colors = @[(__bridge id)[UIColor redColor].CGColor,(__bridge id)[UIColor greenColor].CGColor,(__bridge id)[UIColor orangeColor].CGColor];
// gradLayer.startPoint = CGPointMake(0, 1);
// gradLayer.endPoint = CGPointMake(1, 1);
// gradLayer.locations = @[@0.2,@0.5,@0.7];
// gradLayer.type = kCAGradientLayerAxial;
// [layer addSublayer:gradLayer];
// 创建Animation
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
animation.fromValue = @(0.0);
animation.toValue = @(1.0);
layer.autoreverses = NO;
animation.duration = 4.0;
// 设置layer的animation
[layer addAnimation:animation forKey:nil];
}
- (void)animateProgress:(float)progress animate:(BOOL)animate
{
// _progressRate = progress;
if (animate) {
self.total = progress;
/*
利用定时器做进度动画
*/
[NSTimer scheduledTimerWithTimeInterval:0.01
target:self
selector:@selector(numberAnimation:)
userInfo:nil
repeats:YES];
}else{
[self setNeedsDisplay];
}
}
-(void)numberAnimation:(NSTimer*)timer {
_step += 0.01;
if (self.step > self.total) {
[timer invalidate];
timer = nil;
self.step = 0;
return;
}
self.progressRate = self.step;
[self setNeedsDisplay];
}
@end
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.myPointView.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
self.naviBgColor = DSClearColor; self.naviBgColor = DSClearColor;
self.naviBarAlpha = 1.0; self.naviBarAlpha = 1.0;
self.naviTitle = @"我的积分"; self.naviTitle = @"我的积分";
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
[ScoreTaskRequestModel queryWeekTotalRankWithQueryType:0 completion:^(ScoreTaskRequestModel * _Nonnull requestModel) { [ScoreTaskRequestModel queryWeekTotalRankWithQueryType:0 completion:^(ScoreTaskRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) { if (requestModel.resCode == DSResCodeSuccess) {
[self.myPointView updateRankView:requestModel];
} }
}]; }];
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "MyScoreModel.h" #import "MyScoreModel.h"
#import "ScoreTaskRequestModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
...@@ -27,6 +28,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -27,6 +28,9 @@ NS_ASSUME_NONNULL_BEGIN
/// @param scoreModel scoreModel /// @param scoreModel scoreModel
- (void)updateScoreLevelView:(MyScoreModel *)scoreModel; - (void)updateScoreLevelView:(MyScoreModel *)scoreModel;
/// 更新积分排名视图
/// @param scoreRankRequestModel scoreRankRequestModel
- (void)updateRankView:(ScoreTaskRequestModel *)scoreRankRequestModel;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
- (instancetype)initWithDelegate:(id<MyPointViewDelegate>)delegate { - (instancetype)initWithDelegate:(id<MyPointViewDelegate>)delegate {
if (self = [super init]) { if (self = [super init]) {
self.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
_delegate = delegate; _delegate = delegate;
self.vccanScroll = YES; self.vccanScroll = YES;
...@@ -48,6 +50,10 @@ ...@@ -48,6 +50,10 @@
[self.scoreLevelView updateData:scoreModel]; [self.scoreLevelView updateData:scoreModel];
} }
- (void)updateRankView:(ScoreTaskRequestModel *)scoreRankRequestModel {
[self.rankHeadView updateMyRankView:scoreRankRequestModel.userRankModel];
}
#pragma mark - UITableViewDelegate && UITableViewDataSource #pragma mark - UITableViewDelegate && UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.rankListArr.count; return self.rankListArr.count;
...@@ -121,7 +127,7 @@ ...@@ -121,7 +127,7 @@
- (RankHeadView *)rankHeadView { - (RankHeadView *)rankHeadView {
if (!_rankHeadView) { if (!_rankHeadView) {
_rankHeadView = [[RankHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 186)]; _rankHeadView = [[RankHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 325)];
} }
return _rankHeadView; return _rankHeadView;
} }
......
...@@ -6,12 +6,17 @@ ...@@ -6,12 +6,17 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "RankModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// 自定义等级头部视图 /// 自定义当前用户等级头部视图
@interface RankHeadView : UIView @interface RankHeadView : UIView
/// 更新我的等级排名数据
/// @param userRankModel myRankModel
- (void)updateMyRankView:(RankModel *)myRankModel;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -8,16 +8,221 @@ ...@@ -8,16 +8,221 @@
#import "RankHeadView.h" #import "RankHeadView.h"
@interface RankHeadView () @interface RankHeadView ()
@property (nonatomic, strong) UIImageView *rankIV;
@property (nonatomic, strong) NSArray *btns;
@property (nonatomic, strong) UIImageView *markerIV;
@property (nonatomic, assign) NSInteger curIndex;
@property (nonatomic, strong) UIView *otherView;
@property (nonatomic, strong) UILabel *myNameLab;
@property (nonatomic, strong) UILabel *myRankLab;
@property (nonatomic, strong) UILabel *myScoreLab;
@end @end
@implementation RankHeadView @implementation RankHeadView
- (instancetype)initWithFrame:(CGRect)frame { - (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor greenColor]; self.curIndex = 0;
[self addSubview:self.rankIV];
UIButton *weekBtn = [self buildBtnWithTitle:@"周排行榜" tag:0];
UIButton *totalBtn = [self buildBtnWithTitle:@"总排行榜" tag:1];
self.btns = @[weekBtn, totalBtn];
[self addSubview:self.markerIV];
[self adjustMarkLayout];
[self addSubview:self.otherView];
CGFloat rankIV_H = kScreenWidth * 147 / 375;
[self.rankIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self);
make.height.equalTo(@(rankIV_H));
}];
[weekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.rankIV.mas_bottom);
make.left.equalTo(self);
make.height.equalTo(@40);
}];
[totalBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(weekBtn);
make.right.equalTo(self);
make.size.equalTo(weekBtn);
make.left.equalTo(weekBtn.mas_right);
}];
[self.otherView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(weekBtn.mas_bottom);
make.left.right.equalTo(self);
make.height.equalTo(@138);
}];
[self layoutIfNeeded];
self.height = CGRectGetMaxY(self.otherView.frame);
} }
return self; return self;
} }
- (UIButton *)buildBtnWithTitle:(NSString *)title tag:(NSInteger)tag {
WS(weakSelf);
UIButton *btn = [UIButton new];
btn.tag = tag;
[btn addTouchUpInsideHandler:^(NSInteger tag) {
weakSelf.curIndex = tag;
[weakSelf adjustMarkLayout];
}];
[btn setTitle:title forState:UIControlStateNormal];
[btn dk_setBackgroundColorPicker:DKColorPickerWithColors(ColorFromHex(0x4670FF), ColorFromHex(0x2341A3), DSWhite)];
[self addSubview:btn];
return btn;
}
- (void)adjustMarkLayout {
[self.btns enumerateObjectsUsingBlock:^(UIButton * obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (self.curIndex == idx) {
[obj setTitleColor:DSWhite forState:UIControlStateNormal];
[obj.titleLabel setFont:BoldFont(16.0)];
} else {
[obj setTitleColor:ColorFromHexA(0xFFFFFF, .8) forState:UIControlStateNormal];
[obj.titleLabel setFont:SysFont(14.0)];
}
}];
UIButton *btn = self.btns[self.curIndex];
[UIView animateWithDuration:.8 animations:^{
[self.markerIV mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(btn);
make.bottom.equalTo(btn);
}];
}];
}
- (void)updateMyRankView:(RankModel *)myRankModel {
self.myNameLab.text = myRankModel.user_name;
self.myRankLab.text = [NSString stringWithFormat:@"第%ld名", myRankModel.rank];
self.myScoreLab.text = [NSString stringWithFormat:@"%ld", myRankModel.points];
}
#pragma mark - lazy
- (UIImageView *)rankIV {
if (!_rankIV) {
_rankIV = [[UIImageView alloc] dk_initWithImagePicker:DKImagePickerWithNames(@"bg_jf_paihangbang", @"dk_bg_jf_paihangbang", @"bg_jf_paihangbang")];
}
return _rankIV;
}
- (UIImageView *)markerIV {
if (!_markerIV) {
_markerIV = [[UIImageView alloc] dk_initWithImagePicker:DKImagePickerWithNames(@"ic_jf_select", @"dk_ic_jf_select", @"ic_jf_select")];
_markerIV.size = CGSizeMake(10, 5);
}
return _markerIV;
}
- (UIView *)otherView {
if (!_otherView) {
_otherView = [UIView new];
UIView *shadowView = [UIView new];
shadowView.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, ColorFromHex(0x1F263F), DSWhite);
[shadowView cornerRadius:12.0];
shadowView.layer.dk_shadowColorPicker = DKColorPickerWithColors(ColorFromRGBA(162.0, 239.0, 254.0, 1.0), ColorFromRGBA(162.0, 239.0, 254.0, .2), DSWhite);
shadowView.layer.shadowOffset = CGSizeMake(0, 1);
shadowView.layer.shadowOpacity = 1;
shadowView.layer.shadowRadius = 4;
[_otherView addSubview:shadowView];
// 我的成绩
UILabel *myScoreTitleLab = [UILabel labWithText:@"我的\n成绩" textColor:BrandColor font:SysFont(14.0)];
myScoreTitleLab.numberOfLines = 0;
[shadowView addSubview:myScoreTitleLab];
// 我的头像
UIImageView *myHeadIV = [UIImageView new];
[myHeadIV cornerRadius:20.0];
myHeadIV.dk_alphaPicker = DKAlphaPickerWithAlphas(1, .5, .5);
[myHeadIV yy_setImageWithURL:[NSURL URLWithString:[LoginUtils getFaceImg]] placeholder:[UIImage imageNamed:@"basicPlaceholder"]];
[shadowView addSubview:myHeadIV];
// 我的名称
UILabel *myNameLab = [UILabel labWithFont:SysFont(14.0)];
myNameLab.dk_textColorPicker = DKColorPickerWithColors(SubTitleColor, ColorFromHexA(0xFFFFFF, .5), DSWhite);
[shadowView addSubview:myNameLab];
self.myNameLab = myNameLab;
// 我的排名
UILabel *myRankLab = [UILabel labWithTextColor:BrandColor font:SysFont(14.0)];
myRankLab.textAlignment = NSTextAlignmentRight;
[shadowView addSubview:myRankLab];
self.myRankLab = myRankLab;
// 分割线
UIView *lineView = [UIView new];
lineView.backgroundColor = ColorFromHex(0xF5F5F5);
[shadowView addSubview:lineView];
// 我的积分
UILabel *myScoreLab = [UILabel labWithTextColor:BrandColor font:SysFont(14.0)];
myScoreLab.textAlignment = NSTextAlignmentCenter;
[shadowView addSubview:myScoreLab];
self.myScoreLab = myScoreLab;
UILabel *rankLab = [UILabel labWithText:@"排名" font:SysFont(14.0) fit:YES];
rankLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite);
[_otherView addSubview:rankLab];
UILabel *userLab = [UILabel labWithText:@"用户" font:SysFont(14.0) fit:YES];
userLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite);
[_otherView addSubview:userLab];
UILabel *scoreLab = [UILabel labWithText:@"积分" font:SysFont(14.0) fit:YES];
scoreLab.textAlignment = NSTextAlignmentCenter;
scoreLab.dk_textColorPicker = DKColorPickerWithColors(SmallTextColor, ColorFromHexA(0xFFFFFF, .3), DSWhite);
[_otherView addSubview:scoreLab];
[shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(_otherView).offset(24);
make.left.equalTo(_otherView).offset(15);
make.right.equalTo(_otherView).offset(-15);
make.height.equalTo(@64);
}];
[myScoreTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(shadowView).offset(20);
make.centerY.equalTo(shadowView);
}];
[myHeadIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.equalTo(@40);
make.centerY.equalTo(myScoreTitleLab);
make.left.equalTo(myScoreTitleLab.mas_right).offset(20);
}];
[myNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(myHeadIV);
make.left.equalTo(myHeadIV.mas_right).offset(14);
}];
[myRankLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(myHeadIV);
make.left.equalTo(myNameLab.mas_right).offset(20);
make.right.equalTo(lineView.mas_left).offset(-20);
}];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(shadowView);
make.top.equalTo(shadowView).offset(12);
make.right.equalTo(shadowView).offset(-64);
make.width.equalTo(@1);
}];
[myScoreLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(myHeadIV);
make.right.equalTo(shadowView);
make.left.equalTo(lineView.mas_right);
}];
[rankLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(_otherView).offset(35);
make.top.equalTo(shadowView.mas_bottom).offset(24);
}];
[userLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(rankLab);
make.left.equalTo(rankLab.mas_right).offset(26);
}];
[scoreLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(rankLab);
make.right.equalTo(_otherView).offset(-15);
make.width.equalTo(@64);
}];
}
return _otherView;
}
@end @end
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
#import "ScoreLevelView.h" #import "ScoreLevelView.h"
#import "BeizerView.h"
#import "ScoreRulesView.h" #import "ScoreRulesView.h"
@interface ScoreLevelView () @interface ScoreLevelView ()
...@@ -16,6 +17,7 @@ ...@@ -16,6 +17,7 @@
@property (nonatomic, strong) UIButton *rulesBtn; @property (nonatomic, strong) UIButton *rulesBtn;
@property (nonatomic, strong) UILabel *curRankLab; @property (nonatomic, strong) UILabel *curRankLab;
@property (nonatomic, strong) UILabel *nextRankLab; @property (nonatomic, strong) UILabel *nextRankLab;
@property (nonatomic, strong) BeizerView *beizerView;
@property (nonatomic, strong) ScoreRulesView *scoreRulesView; @property (nonatomic, strong) ScoreRulesView *scoreRulesView;
@property (nonatomic, strong) NSArray *rulesArr; @property (nonatomic, strong) NSArray *rulesArr;
@end @end
...@@ -33,6 +35,7 @@ ...@@ -33,6 +35,7 @@
[self addSubview:self.rulesBtn]; [self addSubview:self.rulesBtn];
[self addSubview:self.curRankLab]; [self addSubview:self.curRankLab];
[self addSubview:self.nextRankLab]; [self addSubview:self.nextRankLab];
[self addSubview:self.beizerView];
CGFloat h = 150*(kScreenWidth - 30)/345; CGFloat h = 150*(kScreenWidth - 30)/345;
[self.cardIV mas_makeConstraints:^(MASConstraintMaker *make) { [self.cardIV mas_makeConstraints:^(MASConstraintMaker *make) {
...@@ -51,6 +54,11 @@ ...@@ -51,6 +54,11 @@
make.right.equalTo(self.cardIV).offset(-9); make.right.equalTo(self.cardIV).offset(-9);
make.size.mas_equalTo(CGSizeMake(64, 21)); make.size.mas_equalTo(CGSizeMake(64, 21));
}]; }];
[self.beizerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.cardIV);
make.bottom.equalTo(self.cardIV).offset(-36);
make.height.equalTo(@76);
}];
} }
return self; return self;
} }
...@@ -63,6 +71,7 @@ ...@@ -63,6 +71,7 @@
[self.rewardIV yy_setImageWithURL:[NSURL URLWithString:scoreModel.reward_img] placeholder:[UIImage imageNamed:@"basicPlaceholder"]]; [self.rewardIV yy_setImageWithURL:[NSURL URLWithString:scoreModel.reward_img] placeholder:[UIImage imageNamed:@"basicPlaceholder"]];
self.curRankLab.text = scoreModel.cur_rank; self.curRankLab.text = scoreModel.cur_rank;
self.nextRankLab.text = scoreModel.next_rank; self.nextRankLab.text = scoreModel.next_rank;
[self.beizerView animateProgress:.8 animate:YES];
[self.curRankNameLab mas_makeConstraints:^(MASConstraintMaker *make) { [self.curRankNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.cardIV).offset(20); make.left.equalTo(self.cardIV).offset(20);
...@@ -117,7 +126,7 @@ ...@@ -117,7 +126,7 @@
_rulesBtn = [UIButton btnWithTitle:@"积分规则" titleColor:DSWhite font:SysFont(12.0)]; _rulesBtn = [UIButton btnWithTitle:@"积分规则" titleColor:DSWhite font:SysFont(12.0)];
_rulesBtn.backgroundColor = ColorFromHex(0x89CAD3); _rulesBtn.backgroundColor = ColorFromHex(0x89CAD3);
[_rulesBtn addTouchUpInsideHandler:^(NSInteger tag) { [_rulesBtn addTouchUpInsideHandler:^(NSInteger tag) {
[weakSelf.scoreRulesView showRulesAlertViewWithData:self.rulesArr]; [weakSelf.scoreRulesView showRulesAlertViewWithData:weakSelf.rulesArr];
}]; }];
[_rulesBtn cornerRadius:10.0]; [_rulesBtn cornerRadius:10.0];
} }
...@@ -139,6 +148,19 @@ ...@@ -139,6 +148,19 @@
return _nextRankLab; return _nextRankLab;
} }
- (BeizerView *)beizerView {
if (!_beizerView) {
_beizerView = [[BeizerView alloc]initWithFrame:CGRectZero];
_beizerView.x = 50;
_beizerView.y = 50;
_beizerView.radius = 40;
_beizerView.backgroundColor = DSClearColor;
// [_beizerView debugViewShowBorder];
// _beizerView.layer.anchorPoint = CGPointMake(0.5, 0.5);
}
return _beizerView;
}
- (ScoreRulesView *)scoreRulesView { - (ScoreRulesView *)scoreRulesView {
if (!_scoreRulesView) { if (!_scoreRulesView) {
_scoreRulesView = [ScoreRulesView new]; _scoreRulesView = [ScoreRulesView new];
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
[aCoder encodeObject:@(_is_access) forKey:@"is_access"]; [aCoder encodeObject:@(_is_access) forKey:@"is_access"];
[aCoder encodeObject:_level_img forKey:@"level_img"]; [aCoder encodeObject:_level_img forKey:@"level_img"];
[aCoder encodeObject:@(_total_points) forKey:@"total_points"]; [aCoder encodeObject:@(_total_points) forKey:@"total_points"];
[aCoder encodeObject:_user_name forKey:@"user_name"];
} }
- (id)initWithCoder:(NSCoder *)aDecoder { - (id)initWithCoder:(NSCoder *)aDecoder {
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
_is_access = [[aDecoder decodeObjectForKey:@"is_access"] intValue]; _is_access = [[aDecoder decodeObjectForKey:@"is_access"] intValue];
_level_img = [aDecoder decodeObjectForKey:@"level_img"]; _level_img = [aDecoder decodeObjectForKey:@"level_img"];
_total_points = [[aDecoder decodeObjectForKey:@"total_points"] intValue]; _total_points = [[aDecoder decodeObjectForKey:@"total_points"] intValue];
_user_name = [aDecoder decodeObjectForKey:@"user_name"] ;
return self; return self;
} }
......
{
"images" : [
{
"filename" : "bg_jf_paihangbang.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "bg_jf_paihangbang@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "bg_jf_paihangbang@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_bg_jf_paihangbang.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_bg_jf_paihangbang@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_bg_jf_paihangbang@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dk_ic_jf_select.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dk_ic_jf_select@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dk_ic_jf_select@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_jf_select.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_jf_select@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_jf_select@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!