Commit 5261696461773a55ebf288d26ac808add7413f63
1 parent
478ad848
0.1.4
Showing
27 changed files
with
329 additions
and
601 deletions
CNLiveCMineModule.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveCMineModule' | 10 | s.name = 'CNLiveCMineModule' |
| 11 | - s.version = '0.1.3' | 11 | + s.version = '0.1.4' |
| 12 | s.summary = '网家家C端个人中心' | 12 | s.summary = '网家家C端个人中心' |
| 13 | 13 | ||
| 14 | # This description is used to generate tags and improve search results. | 14 | # This description is used to generate tags and improve search results. |
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/add_score_bg@2x.png
0 → 100644
406 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/add_score_bg@3x.png
0 → 100644
839 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/add_score_close@2x.png
0 → 100644
1.38 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/add_score_close@3x.png
0 → 100644
2.86 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/add_score_label@2x.png
0 → 100644
20.7 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/add_score_label@3x.png
0 → 100644
34.9 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/gold_whereabouts1.png
0 → 100644
22.1 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/gold_whereabouts2.png
0 → 100644
25.1 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/gold_whereabouts3.png
0 → 100644
21.7 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/gold_whereabouts4.png
0 → 100644
24.5 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/sign_day_select@2x.png
0 → 100644
3.09 KB
CNLiveCMineModule/Assets/CNLiveCMineModule.bundle/sign_day_select@3x.png
0 → 100644
6.83 KB
CNLiveCMineModule/Classes/CNCSubMine/View/CNBindingManageHeaderView.m deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNBindingManageHeaderView.m | ||
| 3 | -// CNLiveNetAdd | ||
| 4 | -// | ||
| 5 | -// Created by CNLive-zxw on 2019/9/10. | ||
| 6 | -// Copyright © 2019 cnlive. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import "CNBindingManageHeaderView.h" | ||
| 10 | -@interface CNBindingManageHeaderView() | ||
| 11 | -@property (nonatomic, strong) UILabel *title; | ||
| 12 | - | ||
| 13 | -@end | ||
| 14 | -@implementation CNBindingManageHeaderView | ||
| 15 | -static NSInteger const margin = 15; | ||
| 16 | - | ||
| 17 | -- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier { | ||
| 18 | - if (self = [super initWithReuseIdentifier:reuseIdentifier]) { | ||
| 19 | - //在这里向contentView添加控件 | ||
| 20 | - self.backgroundColor = RGBOF(0xf4f4f4); | ||
| 21 | - [self createSubviews]; | ||
| 22 | - [self xw_layoutSubviews]; | ||
| 23 | - | ||
| 24 | - } | ||
| 25 | - return self; | ||
| 26 | -} | ||
| 27 | -- (void)setText:(NSString *)text{ | ||
| 28 | - _text = text; | ||
| 29 | - _title.text = text; | ||
| 30 | -} | ||
| 31 | - | ||
| 32 | -#pragma mark - setupUI | ||
| 33 | -- (void)createSubviews { | ||
| 34 | - [self.contentView addSubview:self.title]; | ||
| 35 | - | ||
| 36 | -} | ||
| 37 | - | ||
| 38 | -- (void)xw_layoutSubviews { | ||
| 39 | - [self.title mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 40 | - make.top.equalTo(self.contentView); | ||
| 41 | - make.left.equalTo(self.contentView.mas_left).offset(margin); | ||
| 42 | - make.right.equalTo(self.contentView.mas_right).offset(-margin); | ||
| 43 | - make.bottom.equalTo(self.contentView.mas_bottom); | ||
| 44 | - | ||
| 45 | - }]; | ||
| 46 | - | ||
| 47 | -} | ||
| 48 | - | ||
| 49 | -/* | ||
| 50 | -// Only override drawRect: if you perform custom drawing. | ||
| 51 | -// An empty implementation adversely affects performance during animation. | ||
| 52 | -- (void)drawRect:(CGRect)rect { | ||
| 53 | - // Drawing code | ||
| 54 | -} | ||
| 55 | -*/ | ||
| 56 | - | ||
| 57 | -#pragma mark - Lazy Loading | ||
| 58 | -- (UILabel *)title { | ||
| 59 | - if (!_title) { | ||
| 60 | - _title = [[UILabel alloc] init]; | ||
| 61 | - _title.textColor = RGBOF(0x999999); | ||
| 62 | - _title.font = UIFontCNMake(14); | ||
| 63 | - _title.numberOfLines = 0; | ||
| 64 | - } | ||
| 65 | - return _title; | ||
| 66 | -} | ||
| 67 | - | ||
| 68 | -@end |
CNLiveCMineModule/Classes/CNGold/View/CNAddScoreView.m
| @@ -255,7 +255,7 @@ | @@ -255,7 +255,7 @@ | ||
| 255 | if (!_midImage) { | 255 | if (!_midImage) { |
| 256 | _midImage = [[UIImageView alloc] init]; | 256 | _midImage = [[UIImageView alloc] init]; |
| 257 | _midImage.userInteractionEnabled = YES; | 257 | _midImage.userInteractionEnabled = YES; |
| 258 | - _midImage.image = [UIImage imageNamed:@"add_score_bg"]; | 258 | + _midImage.image = [CNLiveCMineService imageWithMineName:@"add_score_bg"]; |
| 259 | _midImage.contentMode = UIViewContentModeCenter; | 259 | _midImage.contentMode = UIViewContentModeCenter; |
| 260 | } | 260 | } |
| 261 | return _midImage; | 261 | return _midImage; |
| @@ -264,7 +264,7 @@ | @@ -264,7 +264,7 @@ | ||
| 264 | if (!_scoreBtn) { | 264 | if (!_scoreBtn) { |
| 265 | _scoreBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | 265 | _scoreBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 266 | _scoreBtn.adjustsImageWhenHighlighted = NO; | 266 | _scoreBtn.adjustsImageWhenHighlighted = NO; |
| 267 | - [_scoreBtn setImage:[UIImage imageNamed:@"add_score_label"] forState:UIControlStateNormal]; | 267 | + [_scoreBtn setImage:[CNLiveCMineService imageWithMineName:@"add_score_label"] forState:UIControlStateNormal]; |
| 268 | [_scoreBtn addTarget:self action:@selector(clickedCloseBtn:) forControlEvents:UIControlEventTouchUpInside]; | 268 | [_scoreBtn addTarget:self action:@selector(clickedCloseBtn:) forControlEvents:UIControlEventTouchUpInside]; |
| 269 | 269 | ||
| 270 | } | 270 | } |
| @@ -286,7 +286,7 @@ | @@ -286,7 +286,7 @@ | ||
| 286 | if(!_colseBtn){ | 286 | if(!_colseBtn){ |
| 287 | _colseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | 287 | _colseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 288 | [_colseBtn addTarget:self action:@selector(clickedClose) forControlEvents:UIControlEventTouchUpInside]; | 288 | [_colseBtn addTarget:self action:@selector(clickedClose) forControlEvents:UIControlEventTouchUpInside]; |
| 289 | - [_colseBtn setImage:[UIImage imageNamed:@"add_score_close"] forState:UIControlStateNormal]; | 289 | + [_colseBtn setImage:[CNLiveCMineService imageWithMineName:@"add_score_close"] forState:UIControlStateNormal]; |
| 290 | 290 | ||
| 291 | } | 291 | } |
| 292 | return _colseBtn; | 292 | return _colseBtn; |
CNLiveCMineModule/Classes/CNGold/View/CNGoldWhereaboutsView.h
| @@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import "CAEmitterLayerView.h" | 9 | #import "CAEmitterLayerView.h" |
| 10 | -#import "CNSignInView.h" | ||
| 11 | 10 | ||
| 12 | NS_ASSUME_NONNULL_BEGIN | 11 | NS_ASSUME_NONNULL_BEGIN |
| 13 | @class CNScoreModel; | 12 | @class CNScoreModel; |
| @@ -32,8 +31,6 @@ typedef NS_ENUM(NSUInteger, CNGoldWhereaboutsViewType) { | @@ -32,8 +31,6 @@ typedef NS_ENUM(NSUInteger, CNGoldWhereaboutsViewType) { | ||
| 32 | // 默认展示添加积分视图 | 31 | // 默认展示添加积分视图 |
| 33 | + (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc score:(NSString *)score; | 32 | + (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc score:(NSString *)score; |
| 34 | 33 | ||
| 35 | -// 默认签到 | ||
| 36 | -+ (void)showGoldWhereaboutsViewModel:(CNScoreModel *)model controller:(id<CNSignInViewDelegate>)controller; | ||
| 37 | + (void)hide; | 34 | + (void)hide; |
| 38 | 35 | ||
| 39 | @end | 36 | @end |
CNLiveCMineModule/Classes/CNGold/View/CNGoldWhereaboutsView.m
| @@ -8,7 +8,6 @@ | @@ -8,7 +8,6 @@ | ||
| 8 | 8 | ||
| 9 | #import "CNGoldWhereaboutsView.h" | 9 | #import "CNGoldWhereaboutsView.h" |
| 10 | #import "CNAddScoreView.h" | 10 | #import "CNAddScoreView.h" |
| 11 | -#import "CNSignInView.h" | ||
| 12 | #import "CNScoreModel.h" | 11 | #import "CNScoreModel.h" |
| 13 | 12 | ||
| 14 | #define CNRemenberShow @"CNRemenberShow" | 13 | #define CNRemenberShow @"CNRemenberShow" |
| @@ -17,7 +16,6 @@ | @@ -17,7 +16,6 @@ | ||
| 17 | @property (nonatomic, copy) NSString *desc; | 16 | @property (nonatomic, copy) NSString *desc; |
| 18 | @property (nonatomic, copy) NSString *score; | 17 | @property (nonatomic, copy) NSString *score; |
| 19 | 18 | ||
| 20 | -@property (nonatomic, weak) id<CNSignInViewDelegate> controller; | ||
| 21 | @property (nonatomic, strong) CNScoreModel *model; | 19 | @property (nonatomic, strong) CNScoreModel *model; |
| 22 | 20 | ||
| 23 | @end | 21 | @end |
| @@ -43,13 +41,6 @@ | @@ -43,13 +41,6 @@ | ||
| 43 | [sView show:CNGoldWhereaboutsViewTypeDefault]; | 41 | [sView show:CNGoldWhereaboutsViewTypeDefault]; |
| 44 | 42 | ||
| 45 | } | 43 | } |
| 46 | -+ (void)showGoldWhereaboutsViewModel:(CNScoreModel *)model controller:(id<CNSignInViewDelegate>)controller{ | ||
| 47 | - CNGoldWhereaboutsView *sView = [[CNGoldWhereaboutsView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; | ||
| 48 | - sView.model = model; | ||
| 49 | - sView.controller = controller; | ||
| 50 | - [AppKeyWindow addSubview:sView]; | ||
| 51 | - [sView show:CNGoldWhereaboutsViewTypeSignIn]; | ||
| 52 | -} | ||
| 53 | 44 | ||
| 54 | #pragma mark - Init | 45 | #pragma mark - Init |
| 55 | - (instancetype)initWithFrame:(CGRect)frame { | 46 | - (instancetype)initWithFrame:(CGRect)frame { |
| @@ -84,7 +75,7 @@ | @@ -84,7 +75,7 @@ | ||
| 84 | snowFlake.yAcceleration = 2500.f; | 75 | snowFlake.yAcceleration = 2500.f; |
| 85 | snowFlake.emissionRange = 0.5 * M_PI; | 76 | snowFlake.emissionRange = 0.5 * M_PI; |
| 86 | snowFlake.spinRange = 0.25 * M_PI; | 77 | snowFlake.spinRange = 0.25 * M_PI; |
| 87 | - snowFlake.contents = (__bridge id _Nullable)([UIImage imageNamed:[NSString stringWithFormat:@"gold_whereabouts%d",i]].CGImage); | 78 | + snowFlake.contents = (__bridge id _Nullable)([CNLiveCMineService imageWithMineName:[NSString stringWithFormat:@"gold_whereabouts%d",i]].CGImage); |
| 88 | snowFlake.lifetime = 100.f; | 79 | snowFlake.lifetime = 100.f; |
| 89 | 80 | ||
| 90 | snowFlake.scale = 0.08; | 81 | snowFlake.scale = 0.08; |
| @@ -143,12 +134,6 @@ | @@ -143,12 +134,6 @@ | ||
| 143 | } | 134 | } |
| 144 | } | 135 | } |
| 145 | break; | 136 | break; |
| 146 | - | ||
| 147 | - case CNGoldWhereaboutsViewTypeSignIn: | ||
| 148 | - { | ||
| 149 | - [CNSignInView showSignInView:_model.score scores:_model.scores.count>0?_model.scores[0]:@"1000,2000,3000,4000,5000,6000,7000" day:_model.times url:_model.url delegate:_controller]; | ||
| 150 | - } | ||
| 151 | - break; | ||
| 152 | case CNGoldWhereaboutsViewTypeLogin: | 137 | case CNGoldWhereaboutsViewTypeLogin: |
| 153 | { | 138 | { |
| 154 | if(self.desc && ![self.desc isEqualToString:@""]){ | 139 | if(self.desc && ![self.desc isEqualToString:@""]){ |
CNLiveCMineModule/Classes/CNGold/View/CNSignInButtonSelectView.m
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | _selectView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 27, 27)]; | 39 | _selectView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 27, 27)]; |
| 40 | _selectView.center = self.center; | 40 | _selectView.center = self.center; |
| 41 | _selectView.userInteractionEnabled = YES; | 41 | _selectView.userInteractionEnabled = YES; |
| 42 | - _selectView.image = [UIImage imageNamed:@"sign_day_select"]; | 42 | + _selectView.image = [CNLiveCMineService imageWithMineName:@"sign_day_select"]; |
| 43 | } | 43 | } |
| 44 | return _selectView; | 44 | return _selectView; |
| 45 | } | 45 | } |
CNLiveCMineModule/Classes/CNGold/View/CNSignInButtonView.h deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNSignInButtonView.h | ||
| 3 | -// CNLiveNetAdd | ||
| 4 | -// | ||
| 5 | -// Created by CNLive-zxw on 2019/3/1. | ||
| 6 | -// Copyright © 2019年 cnlive. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import <UIKit/UIKit.h> | ||
| 10 | - | ||
| 11 | -NS_ASSUME_NONNULL_BEGIN | ||
| 12 | -@class CNSignInButtonView; | ||
| 13 | -@protocol CNSignInButtonViewDelegate <NSObject> | ||
| 14 | -- (void)clickedSignInButton:(CNSignInButtonView *)view day:(NSString *)day; | ||
| 15 | - | ||
| 16 | -@end | ||
| 17 | -@interface CNSignInButtonView : UIView | ||
| 18 | - | ||
| 19 | -@property (nonatomic, assign) NSInteger day; | ||
| 20 | -@property (nonatomic, copy) NSString *scores; | ||
| 21 | -@property (nonatomic, weak) id<CNSignInButtonViewDelegate> delegate; | ||
| 22 | - | ||
| 23 | -- (instancetype)initWithFrame:(CGRect)frame; | ||
| 24 | - | ||
| 25 | -@end | ||
| 26 | - | ||
| 27 | -NS_ASSUME_NONNULL_END |
CNLiveCMineModule/Classes/CNGold/View/CNSignInButtonView.m deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNSignInButtonView.m | ||
| 3 | -// CNLiveNetAdd | ||
| 4 | -// | ||
| 5 | -// Created by CNLive-zxw on 2019/3/1. | ||
| 6 | -// Copyright © 2019年 cnlive. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import "CNSignInButtonView.h" | ||
| 10 | -#import "CNSignInButtonSelectView.h" | ||
| 11 | - | ||
| 12 | -@interface CNSignInButtonView() | ||
| 13 | -@property (nonatomic, strong) NSMutableArray *btnsArr; | ||
| 14 | - | ||
| 15 | -@end | ||
| 16 | -@implementation CNSignInButtonView | ||
| 17 | -static const NSInteger margin = 6; | ||
| 18 | -#pragma mark - Init | ||
| 19 | -- (instancetype)initWithFrame:(CGRect)frame { | ||
| 20 | - self = [super initWithFrame:frame]; | ||
| 21 | - if (self) { | ||
| 22 | - [self setup]; | ||
| 23 | - } | ||
| 24 | - return self; | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | -#pragma mark - UI | ||
| 28 | -- (void)setup { | ||
| 29 | - CGFloat width = 70*(KScreenWidth/375.0); | ||
| 30 | - CGFloat height = 80*(KScreenWidth/375.0); | ||
| 31 | - | ||
| 32 | - for(int i = 0; i < 7; i++){ | ||
| 33 | - UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 34 | - btn.frame = CGRectMake(i<4?i*(width+margin):(i-4)*(width+margin), i<4?0:(margin+height), width, height); | ||
| 35 | - | ||
| 36 | - [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 37 | - [btn setImage:[UIImage imageNamed:@"sign_day_bg"] forState:UIControlStateNormal]; | ||
| 38 | - btn.adjustsImageWhenHighlighted = NO; | ||
| 39 | - btn.userInteractionEnabled = NO; | ||
| 40 | - [self.btnsArr addObject:btn]; | ||
| 41 | - [self addSubview:btn]; | ||
| 42 | - | ||
| 43 | - if(i == 6){ | ||
| 44 | - btn.width = 2*width+margin; | ||
| 45 | - [btn setImage:[UIImage imageNamed:@"sign_day_bg7"] forState:UIControlStateNormal]; | ||
| 46 | - | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - CNSignInButtonSelectView *view = [[CNSignInButtonSelectView alloc]initWithFrame:btn.bounds]; | ||
| 50 | - view.hidden = !btn.selected; | ||
| 51 | - [btn addSubview:view]; | ||
| 52 | - | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | -} | ||
| 56 | - | ||
| 57 | -#pragma mark - Setter | ||
| 58 | -- (void)setScores:(NSString *)scores{ | ||
| 59 | - _scores = scores; | ||
| 60 | - NSArray *arr = scores?[scores componentsSeparatedByString:@","]:@[@"1000",@"2000",@"3000",@"4000",@"5000",@"6000",@"7000"]; | ||
| 61 | - arr = arr.count == 7?arr:@[@"1000",@"2000",@"3000",@"4000",@"5000",@"6000",@"7000"]; | ||
| 62 | - | ||
| 63 | - CGFloat width = 70*(KScreenWidth/375.0); | ||
| 64 | - CGFloat height = 80*(KScreenWidth/375.0); | ||
| 65 | - | ||
| 66 | - for(int i = 0; i < self.btnsArr.count; i++){ | ||
| 67 | - UIButton *btn = self.btnsArr[i]; | ||
| 68 | - CGFloat day_height = 30*(KScreenWidth/375.0); | ||
| 69 | - CGFloat score_height = 25*(KScreenWidth/375.0); | ||
| 70 | - | ||
| 71 | - UILabel *day = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, day_height)]; | ||
| 72 | - day.textColor = [UIColor whiteColor]; | ||
| 73 | - day.font = [UIFont fontWithName:@"PingFangSC-Medium" size:12]; | ||
| 74 | - day.textAlignment = NSTextAlignmentCenter; | ||
| 75 | - day.text = [NSString stringWithFormat:@"第%d天",i+1]; | ||
| 76 | - [btn addSubview:day]; | ||
| 77 | - | ||
| 78 | - UILabel *score = [[UILabel alloc] initWithFrame:CGRectMake(0, height-score_height, width, score_height)]; | ||
| 79 | - score.textColor = [UIColor whiteColor]; | ||
| 80 | - score.font = [UIFont fontWithName:@"PingFangSC-Medium" size:11]; | ||
| 81 | - score.textAlignment = NSTextAlignmentCenter; | ||
| 82 | - score.text = [NSString stringWithFormat:@"+%@",arr[i]]; | ||
| 83 | - [btn addSubview:score]; | ||
| 84 | - | ||
| 85 | - if(i == 6){ | ||
| 86 | - day.frame = CGRectMake(2*margin, 0, width, day_height); | ||
| 87 | - day.textAlignment = NSTextAlignmentLeft; | ||
| 88 | - | ||
| 89 | - score.frame = CGRectMake(2*margin, height-score_height, width, score_height); | ||
| 90 | - score.textAlignment = NSTextAlignmentLeft; | ||
| 91 | - | ||
| 92 | - } | ||
| 93 | - } | ||
| 94 | -} | ||
| 95 | - | ||
| 96 | -- (void)setDay:(NSInteger)day{ | ||
| 97 | - _day = day; | ||
| 98 | - for(int i = 0; i < self.btnsArr.count; i++){ | ||
| 99 | - if(i >= day) break; | ||
| 100 | - UIButton *btn = self.btnsArr[i]; | ||
| 101 | - for (UIView *view in btn.subviews) { | ||
| 102 | - if([view isKindOfClass:[CNSignInButtonSelectView class]]){ | ||
| 103 | - view.hidden = NO; | ||
| 104 | - btn.userInteractionEnabled = NO; | ||
| 105 | - } | ||
| 106 | - } | ||
| 107 | - } | ||
| 108 | -} | ||
| 109 | - | ||
| 110 | -/* | ||
| 111 | - // Only override drawRect: if you perform custom drawing. | ||
| 112 | - // An empty implementation adversely affects performance during animation. | ||
| 113 | - - (void)drawRect:(CGRect)rect { | ||
| 114 | - // Drawing code | ||
| 115 | - } | ||
| 116 | - */ | ||
| 117 | -#pragma mark - Action | ||
| 118 | -- (void)clickBtn:(UIButton *)btn{ | ||
| 119 | -// btn.selected = !btn.selected; | ||
| 120 | - for (UIView *view in btn.subviews) { | ||
| 121 | - if([view isKindOfClass:[CNSignInButtonSelectView class]]){ | ||
| 122 | - view.hidden = NO; | ||
| 123 | - btn.userInteractionEnabled = NO; | ||
| 124 | - } | ||
| 125 | - } | ||
| 126 | - if (self.delegate && [self.delegate respondsToSelector:@selector(clickedSignInButton:day:)]) { | ||
| 127 | - [self.delegate clickedSignInButton:self day:@"1"]; | ||
| 128 | - | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | -} | ||
| 132 | -#pragma mark - Lazy loading | ||
| 133 | -- (NSMutableArray *)btnsArr{ | ||
| 134 | - if (!_btnsArr) { | ||
| 135 | - _btnsArr = [[NSMutableArray alloc] init]; | ||
| 136 | - | ||
| 137 | - } | ||
| 138 | - return _btnsArr; | ||
| 139 | -} | ||
| 140 | - | ||
| 141 | -@end |
CNLiveCMineModule/Classes/CNGold/View/CNSignInView.h deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNSignInView.h | ||
| 3 | -// CNLiveNetAdd | ||
| 4 | -// | ||
| 5 | -// Created by CNLive-zxw on 2019/3/1. | ||
| 6 | -// Copyright © 2019年 cnlive. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import <UIKit/UIKit.h> | ||
| 10 | - | ||
| 11 | -NS_ASSUME_NONNULL_BEGIN | ||
| 12 | -@class CNSignInView; | ||
| 13 | -@protocol CNSignInViewDelegate <NSObject> | ||
| 14 | -- (void)clickedrRulesButton:(CNSignInView *)view; | ||
| 15 | - | ||
| 16 | -@end | ||
| 17 | -@interface CNSignInView : UIView | ||
| 18 | -@property (nonatomic, weak) id<CNSignInViewDelegate> delegate; | ||
| 19 | -@property (nonatomic, copy) NSString *url; | ||
| 20 | - | ||
| 21 | -//+ (void)showSignInView:(NSString *)score; | ||
| 22 | -//+ (void)showSignInViewDelegate:(id<CNSignInViewDelegate>)delegate; | ||
| 23 | -//+ (void)showSignInView:(NSString *)score delegate:(id<CNSignInViewDelegate>)delegate; | ||
| 24 | -//+ (void)showSignInView:(NSString *)score day:(NSInteger)day delegate:(id<CNSignInViewDelegate>)delegate; | ||
| 25 | -//+ (void)showSignInView:(NSString *)score day:(NSInteger)day url:(NSString *)url delegate:(id<CNSignInViewDelegate>)delegate; | ||
| 26 | -/** | ||
| 27 | - * 显示签到视图 | ||
| 28 | - * | ||
| 29 | - * @param score 1000 | ||
| 30 | - * @param scores "1000,2000,3000,4000,5000,6000,7000" | ||
| 31 | - * @param day 第几天 | ||
| 32 | - * @param url 签到规则url | ||
| 33 | - * @param delegate 代理 | ||
| 34 | - * | ||
| 35 | - */ | ||
| 36 | -+ (void)showSignInView:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url delegate:(id<CNSignInViewDelegate>)delegate; | ||
| 37 | - | ||
| 38 | -@end | ||
| 39 | - | ||
| 40 | -NS_ASSUME_NONNULL_END |
CNLiveCMineModule/Classes/CNGold/View/CNSignInView.m deleted
100644 → 0
| 1 | -// | ||
| 2 | -// CNSignInView.m | ||
| 3 | -// CNLiveNetAdd | ||
| 4 | -// | ||
| 5 | -// Created by CNLive-zxw on 2019/3/1. | ||
| 6 | -// Copyright © 2019年 cnlive. All rights reserved. | ||
| 7 | -// | ||
| 8 | - | ||
| 9 | -#import "CNSignInView.h" | ||
| 10 | -#import "UIColor+CNLiveExtension.h" | ||
| 11 | -#import "CNSignInButtonView.h" | ||
| 12 | - | ||
| 13 | -@interface CNSignInView() | ||
| 14 | -@property (nonatomic, strong) UIImageView *bgView; | ||
| 15 | -@property (nonatomic, strong) QMUIButton *scoreBtn; | ||
| 16 | -@property (nonatomic, strong) UIButton *rulesBtn; | ||
| 17 | -@property (nonatomic, strong) CNSignInButtonView *signInButtonView; | ||
| 18 | -@property (nonatomic, strong) UIButton *closeBtn; | ||
| 19 | - | ||
| 20 | -@property (nonatomic, copy) NSString *score; | ||
| 21 | -@property (nonatomic, copy) NSString *scores; | ||
| 22 | -@property (nonatomic, assign) NSInteger day; | ||
| 23 | - | ||
| 24 | -@end | ||
| 25 | - | ||
| 26 | -@implementation CNSignInView | ||
| 27 | -static const NSInteger margin = 15; | ||
| 28 | -+ (void)showSignInView:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url delegate:(id<CNSignInViewDelegate>)delegate{ | ||
| 29 | - CNSignInView *view = [[CNSignInView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; | ||
| 30 | - view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | ||
| 31 | - view.score = score; | ||
| 32 | - view.scores = scores; | ||
| 33 | - view.day = day; | ||
| 34 | - view.url = url; | ||
| 35 | - view.delegate = delegate; | ||
| 36 | - [AppKeyWindow addSubview:view]; | ||
| 37 | -} | ||
| 38 | -//+ (void)showSignInView:(NSString *)score day:(NSInteger)day url:(NSString *)url delegate:(id<CNSignInViewDelegate>)delegate{ | ||
| 39 | -// CNSignInView *view = [[CNSignInView alloc]initWithFrame:CGRectMake(0, 0,KScreenWidth, KScreenHeight)]; | ||
| 40 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | ||
| 41 | -// view.score = score; | ||
| 42 | -// view.day = day; | ||
| 43 | -// view.url = url; | ||
| 44 | -// view.delegate = delegate; | ||
| 45 | -// [AppKeyWindow addSubview:view]; | ||
| 46 | -//} | ||
| 47 | -// | ||
| 48 | -//+ (void)showSignInView:(NSString *)score day:(NSInteger)day delegate:(id<CNSignInViewDelegate>)delegate{ | ||
| 49 | -// CNSignInView *view = [[CNSignInView alloc]initWithFrame:CGRectMake(0, 0,KScreenWidth, KScreenHeight)]; | ||
| 50 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | ||
| 51 | -// view.score = score; | ||
| 52 | -// view.day = day; | ||
| 53 | -// view.delegate = delegate; | ||
| 54 | -// [AppKeyWindow addSubview:view]; | ||
| 55 | -// | ||
| 56 | -//} | ||
| 57 | -// | ||
| 58 | -//+ (void)showSignInView:(NSString *)score delegate:(id<CNSignInViewDelegate>)delegate{ | ||
| 59 | -// CNSignInView *view = [[CNSignInView alloc]initWithFrame:CGRectMake(0, 0,KScreenWidth, KScreenHeight)]; | ||
| 60 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | ||
| 61 | -// view.score = score; | ||
| 62 | -// view.delegate = delegate; | ||
| 63 | -// [AppKeyWindow addSubview:view]; | ||
| 64 | -// | ||
| 65 | -//} | ||
| 66 | -// | ||
| 67 | -//+ (void)showSignInViewDelegate:(id<CNSignInViewDelegate>)delegate{ | ||
| 68 | -// CNSignInView *view = [[CNSignInView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; | ||
| 69 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | ||
| 70 | -// view.delegate = delegate; | ||
| 71 | -// [AppKeyWindow addSubview:view]; | ||
| 72 | -// | ||
| 73 | -//} | ||
| 74 | -// | ||
| 75 | -//+ (void)showSignInView:(NSString *)score{ | ||
| 76 | -// CNSignInView *view = [[CNSignInView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; | ||
| 77 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | ||
| 78 | -// view.score = score; | ||
| 79 | -// [AppKeyWindow addSubview:view]; | ||
| 80 | -// | ||
| 81 | -//} | ||
| 82 | -#pragma mark - Init | ||
| 83 | -- (instancetype)initWithFrame:(CGRect)frame { | ||
| 84 | - self = [super initWithFrame:frame]; | ||
| 85 | - if (self) { | ||
| 86 | - [self setup]; | ||
| 87 | - [self xw_layoutSubviews]; | ||
| 88 | - [self addAnimation]; | ||
| 89 | - | ||
| 90 | - } | ||
| 91 | - return self; | ||
| 92 | -} | ||
| 93 | - | ||
| 94 | -#pragma mark - UI | ||
| 95 | -- (void)setup { | ||
| 96 | - [self addSubview:self.bgView]; | ||
| 97 | - [self.bgView addSubview:self.scoreBtn]; | ||
| 98 | - [self.bgView addSubview:self.signInButtonView]; | ||
| 99 | - [self.bgView addSubview:self.rulesBtn]; | ||
| 100 | - [self addSubview:self.closeBtn]; | ||
| 101 | - | ||
| 102 | -} | ||
| 103 | -- (void)xw_layoutSubviews{ | ||
| 104 | - [_bgView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 105 | - make.centerX.equalTo(self.mas_centerX).with.offset(0); | ||
| 106 | - make.centerY.equalTo(self.mas_centerY).with.offset(-20*(KScreenWidth/375.0)); | ||
| 107 | - make.width.offset(335*(KScreenWidth/375.0)); | ||
| 108 | - make.height.offset(335*(KScreenWidth/375.0)*370/335.0); | ||
| 109 | - | ||
| 110 | - }]; | ||
| 111 | - | ||
| 112 | - [_scoreBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 113 | - make.centerX.equalTo(_bgView.mas_centerX).with.offset(0); | ||
| 114 | - make.top.equalTo(_bgView.mas_top).with.offset(45*(KScreenWidth/375.0)); | ||
| 115 | - make.width.offset(120*(KScreenWidth/375.0)); | ||
| 116 | - make.height.offset(40*(KScreenWidth/375.0)); | ||
| 117 | - | ||
| 118 | - }]; | ||
| 119 | - | ||
| 120 | - [_signInButtonView mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 121 | - make.centerX.equalTo(_bgView.mas_centerX).with.offset(0); | ||
| 122 | - make.top.equalTo(_scoreBtn.mas_bottom).with.offset(65*(KScreenWidth/375.0)); | ||
| 123 | - make.width.offset(280*(KScreenWidth/375.0)+18); | ||
| 124 | - make.height.offset(160*(KScreenWidth/375.0)+5); | ||
| 125 | - | ||
| 126 | - }]; | ||
| 127 | - | ||
| 128 | - [_rulesBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 129 | - make.centerX.equalTo(_bgView.mas_centerX).with.offset(0); | ||
| 130 | - make.top.equalTo(_signInButtonView.mas_bottom).with.offset(0); | ||
| 131 | - make.bottom.equalTo(_bgView.mas_bottom).with.offset(-0); | ||
| 132 | - make.width.offset(100*(KScreenWidth/375.0)); | ||
| 133 | - | ||
| 134 | - }]; | ||
| 135 | - | ||
| 136 | - [_closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 137 | - make.centerX.equalTo(_bgView.mas_centerX).with.offset(0); | ||
| 138 | - make.top.equalTo(_bgView.mas_bottom).with.offset(margin*(KScreenWidth/375.0)); | ||
| 139 | - make.width.offset(35*(KScreenWidth/375.0)); | ||
| 140 | - make.height.offset(35*(KScreenWidth/375.0)); | ||
| 141 | - | ||
| 142 | - }]; | ||
| 143 | - | ||
| 144 | -} | ||
| 145 | - | ||
| 146 | -#pragma mark - Private Methods | ||
| 147 | -- (void)addAnimation{ | ||
| 148 | - _bgView.transform = CGAffineTransformMake(0.01, 0, 0, 0.01, _bgView.x, _bgView.y); | ||
| 149 | - _closeBtn.transform = CGAffineTransformMake(0.01, 0, 0, 0.01, _closeBtn.x, _closeBtn.y); | ||
| 150 | - | ||
| 151 | - [UIView animateWithDuration:0.3f animations:^{ | ||
| 152 | - _bgView.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | ||
| 153 | - _closeBtn.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | ||
| 154 | - | ||
| 155 | - } completion:^(BOOL finished) { | ||
| 156 | - [UIView animateWithDuration:0.1f animations:^{ | ||
| 157 | - _bgView.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | ||
| 158 | - _closeBtn.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | ||
| 159 | - | ||
| 160 | - } completion:^(BOOL finished) { | ||
| 161 | - // 恢复原位 | ||
| 162 | - _bgView.transform = CGAffineTransformIdentity; | ||
| 163 | - _closeBtn.transform = CGAffineTransformIdentity; | ||
| 164 | - | ||
| 165 | - }]; | ||
| 166 | - | ||
| 167 | - }]; | ||
| 168 | - | ||
| 169 | -} | ||
| 170 | -- (void)hiddenAction{ | ||
| 171 | - _bgView.layer.transform = CATransform3DMakeScale(1, 1, 1); | ||
| 172 | - _closeBtn.layer.transform = CATransform3DMakeScale(1, 1, 1); | ||
| 173 | - | ||
| 174 | - [UIView animateWithDuration:0.3f animations:^{ | ||
| 175 | - // 按照比例scalex=0.001,y=0.001进行缩小 | ||
| 176 | - _bgView.layer.transform = CATransform3DMakeScale(0.001, 0.001, 1); | ||
| 177 | - _closeBtn.layer.transform = CATransform3DMakeScale(0.001, 0.001, 1); | ||
| 178 | - | ||
| 179 | - } completion:^(BOOL finished) { | ||
| 180 | - [self removeFromSuperview]; | ||
| 181 | - | ||
| 182 | - }]; | ||
| 183 | - for (UIView *view in AppKeyWindow.subviews) { | ||
| 184 | - if([view isKindOfClass:NSClassFromString(@"CNGoldWhereaboutsView")]){ | ||
| 185 | - [view removeFromSuperview]; | ||
| 186 | - | ||
| 187 | - } | ||
| 188 | - } | ||
| 189 | -} | ||
| 190 | - | ||
| 191 | -#pragma mark - Data | ||
| 192 | -- (void)setUrl:(NSString *)url{ | ||
| 193 | - _url = url; | ||
| 194 | - | ||
| 195 | -} | ||
| 196 | -- (void)setScore:(NSString *)score{ | ||
| 197 | - _score = score; | ||
| 198 | - [_scoreBtn setTitle:[NSString stringWithFormat:@"+%@",score] forState:UIControlStateNormal]; | ||
| 199 | - | ||
| 200 | -} | ||
| 201 | -- (void)setDay:(NSInteger)day{ | ||
| 202 | - _day = day; | ||
| 203 | - _signInButtonView.day = day; | ||
| 204 | -} | ||
| 205 | -- (void)setScores:(NSString *)scores{ | ||
| 206 | - _scores = scores; | ||
| 207 | - _signInButtonView.scores = scores; | ||
| 208 | - | ||
| 209 | -} | ||
| 210 | - | ||
| 211 | -/* | ||
| 212 | - // Only override drawRect: if you perform custom drawing. | ||
| 213 | - // An empty implementation adversely affects performance during animation. | ||
| 214 | - - (void)drawRect:(CGRect)rect { | ||
| 215 | - // Drawing code | ||
| 216 | - } | ||
| 217 | - */ | ||
| 218 | - | ||
| 219 | -#pragma mark - Action | ||
| 220 | -- (void)clickRulesBtn:(UIButton *)btn{ | ||
| 221 | - if (self.delegate && [self.delegate respondsToSelector:@selector(clickedrRulesButton:)]) { | ||
| 222 | - [self.delegate clickedrRulesButton:self]; | ||
| 223 | - [self removeFromSuperview]; | ||
| 224 | - | ||
| 225 | - } | ||
| 226 | - | ||
| 227 | -} | ||
| 228 | -- (void)clickCloseBtn:(UIButton *)btn{ | ||
| 229 | - [self hiddenAction]; | ||
| 230 | - | ||
| 231 | -} | ||
| 232 | -#pragma mark - Lazy loading | ||
| 233 | -- (UIImageView *)bgView{ | ||
| 234 | - if (!_bgView) { | ||
| 235 | - _bgView = [[UIImageView alloc] init]; | ||
| 236 | - _bgView.userInteractionEnabled = YES; | ||
| 237 | - _bgView.image = [UIImage imageNamed:@"sign_allday_bg"]; | ||
| 238 | - } | ||
| 239 | - return _bgView; | ||
| 240 | -} | ||
| 241 | -- (QMUIButton *)scoreBtn{ | ||
| 242 | - if(_scoreBtn == nil){ | ||
| 243 | - _scoreBtn = [QMUIButton buttonWithType:UIButtonTypeCustom]; | ||
| 244 | - _scoreBtn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20]; | ||
| 245 | -// [_scoreBtn addTarget:self action:@selector(clickScoreBtn:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 246 | - [_scoreBtn setTitle:@"+0" forState:UIControlStateNormal]; | ||
| 247 | - [_scoreBtn setImage:[UIImage imageNamed:@"sign_in_soccer"] forState:UIControlStateNormal]; | ||
| 248 | - [_scoreBtn setTitleColor:CNLiveColorWithHexString(@"FFFFFF") forState:UIControlStateNormal]; | ||
| 249 | - _scoreBtn.adjustsImageWhenHighlighted = NO; | ||
| 250 | - _scoreBtn.userInteractionEnabled = NO; | ||
| 251 | - _scoreBtn.spacingBetweenImageAndTitle = 5; | ||
| 252 | - _scoreBtn.imagePosition = QMUIButtonImagePositionRight; | ||
| 253 | - } | ||
| 254 | - return _scoreBtn; | ||
| 255 | - | ||
| 256 | -} | ||
| 257 | -- (CNSignInButtonView *)signInButtonView{ | ||
| 258 | - if(_signInButtonView == nil){ | ||
| 259 | - _signInButtonView = [[CNSignInButtonView alloc]initWithFrame:CGRectMake(0, 0, 280*(KScreenWidth/375.0)+50, 160*(KScreenWidth/375.0)+30)]; | ||
| 260 | - | ||
| 261 | - } | ||
| 262 | - return _signInButtonView; | ||
| 263 | - | ||
| 264 | -} | ||
| 265 | - | ||
| 266 | -- (UIButton *)rulesBtn{ | ||
| 267 | - if(_rulesBtn == nil){ | ||
| 268 | - _rulesBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 269 | - _rulesBtn.titleLabel.font = UIFontCNMake(14); | ||
| 270 | - [_rulesBtn addTarget:self action:@selector(clickRulesBtn:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 271 | - [_rulesBtn setTitle:@"签到规则" forState:UIControlStateNormal]; | ||
| 272 | - [_rulesBtn setTitleColor:CNLiveColorWithHexString(@"B5B5B5") forState:UIControlStateNormal]; | ||
| 273 | - _rulesBtn.adjustsImageWhenHighlighted = NO; | ||
| 274 | - } | ||
| 275 | - return _rulesBtn; | ||
| 276 | - | ||
| 277 | -} | ||
| 278 | -- (UIButton *)closeBtn{ | ||
| 279 | - if(_closeBtn == nil){ | ||
| 280 | - _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 281 | - _closeBtn.titleLabel.font = UIFontCNMake(12); | ||
| 282 | - [_closeBtn addTarget:self action:@selector(clickCloseBtn:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 283 | - [_closeBtn setImage:[UIImage imageNamed:@"sign_day_close"] forState:UIControlStateNormal]; | ||
| 284 | - _closeBtn.adjustsImageWhenHighlighted = NO; | ||
| 285 | - | ||
| 286 | - } | ||
| 287 | - return _closeBtn; | ||
| 288 | - | ||
| 289 | -} | ||
| 290 | - | ||
| 291 | -@end |
CNLiveCMineModule/Classes/CNPrivacy/View/CNPrivacyContactTableViewCell.m
| @@ -49,10 +49,10 @@ | @@ -49,10 +49,10 @@ | ||
| 49 | _nickLabel.text = [user showTitle]; | 49 | _nickLabel.text = [user showTitle]; |
| 50 | 50 | ||
| 51 | if (!_selectBtn.enabled) { | 51 | if (!_selectBtn.enabled) { |
| 52 | - [_selectBtn setBackgroundImage:[UIImage imageNamed:@"privacy_edit_no"] forState:UIControlStateNormal]; | 52 | + [_selectBtn setBackgroundImage:[CNLiveCMineService imageWithMineName:@"privacy_edit_no"] forState:UIControlStateNormal]; |
| 53 | } | 53 | } |
| 54 | else{ | 54 | else{ |
| 55 | - [_selectBtn setBackgroundImage:[UIImage imageNamed:@"privacy_sel_no"] forState:UIControlStateNormal]; | 55 | + [_selectBtn setBackgroundImage:[CNLiveCMineService imageWithMineName:@"privacy_sel_no"] forState:UIControlStateNormal]; |
| 56 | 56 | ||
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -99,8 +99,8 @@ | @@ -99,8 +99,8 @@ | ||
| 99 | - (UIButton *)selectBtn { | 99 | - (UIButton *)selectBtn { |
| 100 | if (!_selectBtn) { | 100 | if (!_selectBtn) { |
| 101 | _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | 101 | _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 102 | - [_selectBtn setBackgroundImage:[UIImage imageNamed:@"privacy_sel_no"] forState:UIControlStateNormal]; | ||
| 103 | - [_selectBtn setBackgroundImage:[UIImage imageNamed:@"privacy_sel_yes"] forState:UIControlStateSelected]; | 102 | + [_selectBtn setBackgroundImage:[CNLiveCMineService imageWithMineName:@"privacy_sel_no"] forState:UIControlStateNormal]; |
| 103 | + [_selectBtn setBackgroundImage:[CNLiveCMineService imageWithMineName:@"privacy_sel_yes"] forState:UIControlStateSelected]; | ||
| 104 | [_selectBtn addTarget:self action:@selector(onPicked:) forControlEvents:UIControlEventTouchUpInside]; | 104 | [_selectBtn addTarget:self action:@selector(onPicked:) forControlEvents:UIControlEventTouchUpInside]; |
| 105 | } | 105 | } |
| 106 | return _selectBtn; | 106 | return _selectBtn; |
| @@ -192,7 +192,7 @@ | @@ -192,7 +192,7 @@ | ||
| 192 | 192 | ||
| 193 | - (UIImageView *)moreImage { | 193 | - (UIImageView *)moreImage { |
| 194 | if (!_moreImage) { | 194 | if (!_moreImage) { |
| 195 | - _moreImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"xx_gengduo"]]; | 195 | + _moreImage = [[UIImageView alloc] initWithImage:[CNLiveCMineService imageWithMineName:@"mine_more"]]; |
| 196 | } | 196 | } |
| 197 | return _moreImage; | 197 | return _moreImage; |
| 198 | } | 198 | } |
CNLiveCMineModule/Classes/CNCSubMine/View/CNBindingManageHeaderView.h renamed to CNLiveCMineModule/Classes/CNVoiceBox/View/CNLiveBoxNoticeTipView.h
| 1 | // | 1 | // |
| 2 | -// CNBindingManageHeaderView.h | 2 | +// CNLiveBoxNoticeTipView.h |
| 3 | // CNLiveNetAdd | 3 | // CNLiveNetAdd |
| 4 | // | 4 | // |
| 5 | -// Created by CNLive-zxw on 2019/9/10. | 5 | +// Created by 梁星国 on 2019/10/22. |
| 6 | // Copyright © 2019 cnlive. All rights reserved. | 6 | // Copyright © 2019 cnlive. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import <UIKit/UIKit.h> | 9 | #import <UIKit/UIKit.h> |
| 10 | 10 | ||
| 11 | NS_ASSUME_NONNULL_BEGIN | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | -#define kCNBindingManageHeaderView @"CNBindingManageHeaderView" | ||
| 13 | 12 | ||
| 14 | -@interface CNBindingManageHeaderView : UITableViewHeaderFooterView | ||
| 15 | -@property (nonatomic, copy) NSString *text; | 13 | +@interface CNLiveBoxNoticeTipView : UIView |
| 14 | + | ||
| 15 | +@property (strong, nonatomic) UILabel *contentL; | ||
| 16 | + | ||
| 17 | +@property (strong, nonatomic) UIButton *cancelBtn; | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +@property (strong, nonatomic) NSDictionary *dic; | ||
| 21 | + | ||
| 22 | + | ||
| 23 | ++ (CNLiveBoxNoticeTipView *)showAlertAddedTo:(UIView *)view dic:(NSDictionary *)dic; | ||
| 24 | + | ||
| 25 | +- (void)showAlerView; | ||
| 26 | +- (void)hiddenAlerView; | ||
| 16 | 27 | ||
| 17 | @end | 28 | @end |
| 18 | 29 |
CNLiveCMineModule/Classes/CNVoiceBox/View/CNLiveBoxNoticeTipView.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveBoxNoticeTipView.m | ||
| 3 | +// CNLiveNetAdd | ||
| 4 | +// | ||
| 5 | +// Created by 梁星国 on 2019/10/22. | ||
| 6 | +// Copyright © 2019 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveBoxNoticeTipView.h" | ||
| 10 | + | ||
| 11 | +@implementation CNLiveBoxNoticeTipView | ||
| 12 | + | ||
| 13 | ++ (CNLiveBoxNoticeTipView *)showAlertAddedTo:(UIView *)view dic:(NSDictionary *)dic{ | ||
| 14 | + | ||
| 15 | + CNLiveBoxNoticeTipView *noticeView = [[CNLiveBoxNoticeTipView alloc] initWithFrame:CGRectMake(10, KScreenHeight, KScreenWidth - 20, 45)]; | ||
| 16 | + [view addSubview:noticeView]; | ||
| 17 | + noticeView.dic = dic; | ||
| 18 | + if ([noticeView.dic containsObjectForKey:@"text"]) { | ||
| 19 | + noticeView.contentL.text = [NSString stringWithFormat:@"%@",noticeView.dic[@"text"]]; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + return noticeView; | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +- (instancetype)initWithFrame:(CGRect)frame | ||
| 26 | +{ | ||
| 27 | + self = [super initWithFrame:frame]; | ||
| 28 | + if (self) { | ||
| 29 | + self.backgroundColor = RGBA(51, 51, 51,0.7); | ||
| 30 | + self.layer.masksToBounds = YES; | ||
| 31 | + self.layer.cornerRadius = 7.5; | ||
| 32 | + [self setupUI]; | ||
| 33 | + [self layoutUI]; | ||
| 34 | + [self showAlerView]; | ||
| 35 | + __weak typeof(self) weakSelf = self; | ||
| 36 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 37 | + [weakSelf hiddenAlerView]; | ||
| 38 | + }); | ||
| 39 | + } | ||
| 40 | + return self; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +- (void)showAlerView { | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + [UIView animateWithDuration:0.3 animations:^{ | ||
| 47 | + self.frame = CGRectMake(10, KScreenHeight - 55, KScreenWidth - 20, 45); | ||
| 48 | + }]; | ||
| 49 | + | ||
| 50 | + | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +- (void)hiddenAlerView { | ||
| 54 | + | ||
| 55 | + [UIView animateWithDuration:0.3 animations:^{ | ||
| 56 | + self.alpha = 0.3; | ||
| 57 | + if (self) { | ||
| 58 | + [self removeFromSuperview]; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + }]; | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +- (void)setupUI { | ||
| 65 | + [self addSubview:self.contentL]; | ||
| 66 | + [self addSubview:self.cancelBtn]; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +- (void)layoutUI { | ||
| 70 | + | ||
| 71 | + self.cancelBtn.frame = CGRectMake(KScreenWidth - 20 - 44, 0, 44, 44); | ||
| 72 | + | ||
| 73 | + self.contentL.frame = CGRectMake(10, 10, self.cancelBtn.left - 20, 24); | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +#pragma mark - 事件实现 | ||
| 77 | + | ||
| 78 | +- (void)checkBtnAction:(UIButton *)btn { | ||
| 79 | + [self hiddenAlerView]; | ||
| 80 | + | ||
| 81 | + | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | + | ||
| 85 | +#pragma mark - 属性 | ||
| 86 | + | ||
| 87 | +- (UILabel *)contentL { | ||
| 88 | + if (!_contentL) { | ||
| 89 | + _contentL = [[UILabel alloc]initWithFrame:CGRectZero]; | ||
| 90 | + _contentL.text = @"您被好友解除绑定亲情关系"; | ||
| 91 | + _contentL.textColor = [UIColor whiteColor]; | ||
| 92 | + _contentL.font = [UIFont systemFontOfSize:15]; | ||
| 93 | + | ||
| 94 | + } | ||
| 95 | + return _contentL; | ||
| 96 | +} | ||
| 97 | + | ||
| 98 | +- (UIButton *)cancelBtn { | ||
| 99 | + if (!_cancelBtn) { | ||
| 100 | + _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 101 | + [_cancelBtn setImage:[CNLiveCMineService imageWithMineName:@"device_header_cancle"] forState:UIControlStateNormal]; | ||
| 102 | + _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | ||
| 103 | + [_cancelBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 104 | + } | ||
| 105 | + return _cancelBtn; | ||
| 106 | + | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | + | ||
| 110 | +@end |
CNLiveCMineModule/Classes/CNVoiceBox/View/CNLiveBoxNoticeView.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveBoxNoticeView.h | ||
| 3 | +// CNLiveNetAdd | ||
| 4 | +// | ||
| 5 | +// Created by 梁星国 on 2019/10/18. | ||
| 6 | +// Copyright © 2019 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | +NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | +@interface CNLiveBoxNoticeView : UIView | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +@property (strong, nonatomic) UILabel *contentL; | ||
| 17 | + | ||
| 18 | +@property (strong, nonatomic) UIButton *ignoreBtn; | ||
| 19 | + | ||
| 20 | +@property (strong, nonatomic) UIButton *checkBtn; | ||
| 21 | + | ||
| 22 | +@property (strong, nonatomic) UIView *lineV; | ||
| 23 | + | ||
| 24 | +@property (strong, nonatomic) NSDictionary *dic; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | ++ (CNLiveBoxNoticeView *)showAlertAddedTo:(UIView *)view dic:(NSDictionary *)dic; | ||
| 28 | + | ||
| 29 | +- (void)showAlerView; | ||
| 30 | +- (void)hiddenAlerView; | ||
| 31 | + | ||
| 32 | +/*** 切换 ***/ | ||
| 33 | +@property (nonatomic, copy) void(^clickCheckBtnBlock)(CNLiveBoxNoticeView *view,UIButton *checkBtn); | ||
| 34 | + | ||
| 35 | +@end | ||
| 36 | + | ||
| 37 | +NS_ASSUME_NONNULL_END |
CNLiveCMineModule/Classes/CNVoiceBox/View/CNLiveBoxNoticeView.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveBoxNoticeView.m | ||
| 3 | +// CNLiveNetAdd | ||
| 4 | +// | ||
| 5 | +// Created by 梁星国 on 2019/10/18. | ||
| 6 | +// Copyright © 2019 cnlive. All rights reserved. | ||
| 7 | +// | ||
| 8 | + | ||
| 9 | +#import "CNLiveBoxNoticeView.h" | ||
| 10 | +#import "CNBoxUserManagerController.h" | ||
| 11 | + | ||
| 12 | +@interface CNLiveBoxNoticeView () | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | + | ||
| 17 | +@implementation CNLiveBoxNoticeView | ||
| 18 | + | ||
| 19 | ++ (CNLiveBoxNoticeView *)showAlertAddedTo:(UIView *)view dic:(NSDictionary *)dic{ | ||
| 20 | + | ||
| 21 | + CNLiveBoxNoticeView *noticeView = [[CNLiveBoxNoticeView alloc] initWithFrame:CGRectMake(10, KScreenHeight, KScreenWidth - 20, 45)]; | ||
| 22 | + [view addSubview:noticeView]; | ||
| 23 | + noticeView.dic = dic; | ||
| 24 | + if ([noticeView.dic containsObjectForKey:@"text"]) { | ||
| 25 | + noticeView.contentL.text = [NSString stringWithFormat:@"%@",noticeView.dic[@"text"]]; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + return noticeView; | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +- (instancetype)initWithFrame:(CGRect)frame | ||
| 32 | +{ | ||
| 33 | + self = [super initWithFrame:frame]; | ||
| 34 | + if (self) { | ||
| 35 | + self.backgroundColor = RGBA(51, 51, 51,0.7); | ||
| 36 | + self.layer.masksToBounds = YES; | ||
| 37 | + self.layer.cornerRadius = 7.5; | ||
| 38 | + [self setupUI]; | ||
| 39 | + [self layoutUI]; | ||
| 40 | + [self showAlerView]; | ||
| 41 | + __weak typeof(self) weakSelf = self; | ||
| 42 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | ||
| 43 | + [weakSelf hiddenAlerView]; | ||
| 44 | + }); | ||
| 45 | + } | ||
| 46 | + return self; | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +- (void)showAlerView { | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + [UIView animateWithDuration:0.3 animations:^{ | ||
| 53 | + self.frame = CGRectMake(10, KScreenHeight - 55, KScreenWidth - 20, 45); | ||
| 54 | + }]; | ||
| 55 | + | ||
| 56 | + | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +- (void)hiddenAlerView { | ||
| 60 | + | ||
| 61 | + [UIView animateWithDuration:0.3 animations:^{ | ||
| 62 | + self.alpha = 0.3; | ||
| 63 | + if (self) { | ||
| 64 | + [self removeFromSuperview]; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + }]; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +- (void)setupUI { | ||
| 71 | + [self addSubview:self.contentL]; | ||
| 72 | + [self addSubview:self.ignoreBtn]; | ||
| 73 | + [self addSubview:self.lineV]; | ||
| 74 | + [self addSubview:self.checkBtn]; | ||
| 75 | +} | ||
| 76 | + | ||
| 77 | +- (void)layoutUI { | ||
| 78 | + | ||
| 79 | + self.checkBtn.frame = CGRectMake(KScreenWidth - 20 - 44, 0, 44, 44); | ||
| 80 | + | ||
| 81 | + self.lineV.frame = CGRectMake(self.checkBtn.left - 1, 10, 1, 25); | ||
| 82 | + self.ignoreBtn.frame = CGRectMake(self.lineV.left - 44, 0, 44, 44); | ||
| 83 | + self.contentL.frame = CGRectMake(10, 10, self.ignoreBtn.left - 20, 24); | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +#pragma mark - 事件实现 | ||
| 87 | +- (void)ignoreBtnAction:(UIButton *)btn { | ||
| 88 | + [self hiddenAlerView]; | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +- (void)checkBtnAction:(UIButton *)btn { | ||
| 92 | + [self hiddenAlerView]; | ||
| 93 | + NSLog(@"去查看"); | ||
| 94 | + if (!self.dic) { | ||
| 95 | + [QMUITips showWithText:@"参数不全" inView:AppKeyWindow hideAfterDelay:0.5]; | ||
| 96 | + return; | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | +// if ([self.dic containsObjectForKey:@"familyId"]) { | ||
| 100 | +// self.contentL.text = [NSString stringWithFormat:@"%@",self.dic[@"familyId"]]; | ||
| 101 | +// } | ||
| 102 | + | ||
| 103 | + if (self.clickCheckBtnBlock) { | ||
| 104 | + self.clickCheckBtnBlock(self, btn); | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | + | ||
| 111 | +#pragma mark - 属性 | ||
| 112 | + | ||
| 113 | +- (UILabel *)contentL { | ||
| 114 | + if (!_contentL) { | ||
| 115 | + _contentL = [[UILabel alloc]initWithFrame:CGRectZero]; | ||
| 116 | + _contentL.text = @"您被好友绑定成为了亲情关系"; | ||
| 117 | + _contentL.textColor = [UIColor whiteColor]; | ||
| 118 | + _contentL.font = [UIFont systemFontOfSize:15]; | ||
| 119 | + | ||
| 120 | + } | ||
| 121 | + return _contentL; | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +- (UIView *)lineV { | ||
| 125 | + if (!_lineV) { | ||
| 126 | + _lineV = [[UIView alloc]initWithFrame:CGRectZero]; | ||
| 127 | + [_lineV setBackgroundColor:[UIColor whiteColor]]; | ||
| 128 | + } | ||
| 129 | + return _lineV; | ||
| 130 | + | ||
| 131 | +} | ||
| 132 | + | ||
| 133 | +- (UIButton *)ignoreBtn { | ||
| 134 | + if (!_ignoreBtn) { | ||
| 135 | + _ignoreBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 136 | + [_ignoreBtn setTitle:@"忽略" forState:UIControlStateNormal]; | ||
| 137 | + _ignoreBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | ||
| 138 | + [_ignoreBtn addTarget:self action:@selector(ignoreBtnAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 139 | + } | ||
| 140 | + return _ignoreBtn; | ||
| 141 | + | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | +- (UIButton *)checkBtn { | ||
| 145 | + if (!_checkBtn) { | ||
| 146 | + _checkBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
| 147 | + [_checkBtn setTitle:@"查看" forState:UIControlStateNormal]; | ||
| 148 | + _checkBtn.titleLabel.font = [UIFont systemFontOfSize:15]; | ||
| 149 | + [_checkBtn addTarget:self action:@selector(checkBtnAction:) forControlEvents:UIControlEventTouchUpInside]; | ||
| 150 | + } | ||
| 151 | + return _checkBtn; | ||
| 152 | + | ||
| 153 | +} | ||
| 154 | + | ||
| 155 | +@end |