Commit 37e7bcee912abee711d6478f88ac58421d5b41b0
1 parent
da394ef0
no message
Showing
11 changed files
with
118 additions
and
159 deletions
CNLiveIntegralModule/Classes/Module/CNLiveIntegralService.m
| ... | ... | @@ -93,10 +93,10 @@ |
| 93 | 93 | |
| 94 | 94 | // 视图 |
| 95 | 95 | + (void)showAddScoreViewWithDesc:(NSString *)desc score:(NSString *)score{ |
| 96 | - [CNLiveAddScoreView showAddScoreViewWithDesc:desc score:score]; | |
| 96 | + [CNLiveAddScoreView showWithDesc:desc score:score]; | |
| 97 | 97 | } |
| 98 | -+ (void)showAddScoreViewWithDesc:(NSString *)desc login:(NSString *)login delegate:(id<CNLiveAddScoreViewDelegate>)delegate{ | |
| 99 | - [CNLiveAddScoreView showAddScoreViewWithDesc:desc login:login delegate:delegate]; | |
| 98 | ++ (void)showAddScoreViewWithDesc:(NSString *)desc score:(NSString *)score delegate:(id<CNLiveAddScoreViewDelegate>)delegate{ | |
| 99 | + [CNLiveAddScoreView showWithDesc:desc score:score delegate:delegate]; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | + (void)hideAddScoreView{ |
| ... | ... | @@ -105,19 +105,19 @@ |
| 105 | 105 | |
| 106 | 106 | #pragma mark - 金币下落 |
| 107 | 107 | // 游客模式浏览加积分 |
| 108 | -+ (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc delegate:(id<CNLiveGoldWhereaboutsViewDelegate>) delegate{ | |
| 109 | - [CNLiveGoldWhereaboutsView showGoldWhereaboutsViewWithDesc:desc delegate:delegate]; | |
| 108 | ++ (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc delegate:(id)delegate{ | |
| 109 | + [CNLiveGoldWhereaboutsView showWithDesc:desc delegate:delegate]; | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // 默认展示添加积分视图 |
| 113 | 113 | + (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc score:(NSString *)score{ |
| 114 | - [CNLiveGoldWhereaboutsView showGoldWhereaboutsViewWithDesc:desc score:score]; | |
| 114 | + [CNLiveGoldWhereaboutsView showWithDesc:desc score:score]; | |
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | // 默认签到 |
| 119 | -+ (void)showGoldWhereaboutsViewModel:(CNLiveScoreModel *)model controller:(id<CNLiveSignInViewDelegate>)controller{ | |
| 120 | - [CNLiveGoldWhereaboutsView showGoldWhereaboutsViewModel:model controller:controller]; | |
| 119 | ++ (void)showGoldWhereaboutsViewModel:(CNLiveScoreModel *)model{ | |
| 120 | + [CNLiveGoldWhereaboutsView show:model]; | |
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | + (void)hideGoldWhereaboutsView{ |
| ... | ... | @@ -125,8 +125,8 @@ |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | #pragma mark - 签到 |
| 128 | -+ (void)showSignInView:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url delegate:(id<CNLiveSignInViewDelegate>)delegate{ | |
| 129 | - [CNLiveSignInView showSignInView:score scores:scores day:day url:url delegate:delegate]; | |
| 128 | ++ (void)showSignInView:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url{ | |
| 129 | + [CNLiveSignInView showWithScore:score scores:scores day:day url:url]; | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | @end | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveAddScoreView.h
| ... | ... | @@ -17,8 +17,11 @@ NS_ASSUME_NONNULL_BEGIN |
| 17 | 17 | @interface CNLiveAddScoreView : UIView |
| 18 | 18 | @property (nonatomic, weak) id delegate; |
| 19 | 19 | |
| 20 | -+ (void)showAddScoreViewWithDesc:(NSString *)desc score:(NSString *)score; | |
| 21 | -+ (void)showAddScoreViewWithDesc:(NSString *)desc login:(NSString *)login delegate:(id)delegate; | |
| 20 | +// 做任务增加积分 | |
| 21 | ++ (void)showWithDesc:(NSString *)desc score:(NSString *)score; | |
| 22 | + | |
| 23 | +// 游客模式增加积分 | |
| 24 | ++ (void)showWithDesc:(NSString *)desc score:(NSString *)score delegate:(id)delegate; | |
| 22 | 25 | |
| 23 | 26 | + (void)hide; |
| 24 | 27 | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveAddScoreView.m
| ... | ... | @@ -28,13 +28,12 @@ |
| 28 | 28 | |
| 29 | 29 | @property (nonatomic, copy) NSString *score; |
| 30 | 30 | @property (nonatomic, copy) NSString *desc; |
| 31 | -@property (nonatomic, copy) NSString *login; | |
| 32 | 31 | |
| 33 | 32 | @end |
| 34 | 33 | |
| 35 | 34 | @implementation CNLiveAddScoreView |
| 36 | 35 | #pragma mark - Using Method |
| 37 | -+ (void)showAddScoreViewWithDesc:(NSString *)desc score:(NSString *)score{ | |
| 36 | ++ (void)showWithDesc:(NSString *)desc score:(NSString *)score{ | |
| 38 | 37 | CNLiveAddScoreView *view = [[CNLiveAddScoreView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; |
| 39 | 38 | view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; |
| 40 | 39 | view.desc = desc; |
| ... | ... | @@ -42,11 +41,11 @@ |
| 42 | 41 | [[UIApplication sharedApplication].keyWindow addSubview:view]; |
| 43 | 42 | |
| 44 | 43 | } |
| 45 | -+ (void)showAddScoreViewWithDesc:(NSString *)desc login:(NSString *)login delegate:(id<CNLiveAddScoreViewDelegate>)delegate { | |
| 44 | ++ (void)showWithDesc:(NSString *)desc score:(NSString *)score delegate:(id<CNLiveAddScoreViewDelegate>)delegate { | |
| 46 | 45 | CNLiveAddScoreView *view = [[CNLiveAddScoreView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; |
| 47 | 46 | view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; |
| 48 | 47 | view.desc = desc; |
| 49 | - view.login = login; | |
| 48 | + view.score = score; | |
| 50 | 49 | view.delegate = delegate; |
| 51 | 50 | [[UIApplication sharedApplication].keyWindow addSubview:view]; |
| 52 | 51 | } |
| ... | ... | @@ -114,15 +113,15 @@ |
| 114 | 113 | } |
| 115 | 114 | |
| 116 | 115 | #pragma mark - Data |
| 117 | -- (void)setLogin:(NSString *)login{ | |
| 118 | - _login = login; | |
| 119 | - _scoreLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20]; | |
| 120 | - _scoreLabel.text = login; | |
| 121 | -} | |
| 122 | 116 | - (void)setScore:(NSString *)score{ |
| 123 | 117 | _score = score; |
| 124 | - _scoreLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:30]; | |
| 125 | - _scoreLabel.text = [NSString stringWithFormat:@"+%@",score]; | |
| 118 | + if([score isEqualToString:@"立即登录"]){ | |
| 119 | + _scoreLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20]; | |
| 120 | + _scoreLabel.text = score; | |
| 121 | + }else{ | |
| 122 | + _scoreLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:30]; | |
| 123 | + _scoreLabel.text = [NSString stringWithFormat:@"+%@",score]; | |
| 124 | + } | |
| 126 | 125 | |
| 127 | 126 | } |
| 128 | 127 | |
| ... | ... | @@ -173,27 +172,27 @@ |
| 173 | 172 | _descLabel.transform = CGAffineTransformMake(0.01, 0, 0, 0.01, _scoreLabel.left, _scoreLabel.top); |
| 174 | 173 | |
| 175 | 174 | [UIView animateWithDuration:0.3f animations:^{ |
| 176 | - _midImage.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 177 | - _scoreBtn.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 178 | - _scoreLabel.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 179 | - _colseBtn.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 180 | - _descLabel.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 175 | + self->_midImage.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 176 | + self->_scoreBtn.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 177 | + self->_scoreLabel.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 178 | + self->_colseBtn.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 179 | + self->_descLabel.transform = CGAffineTransformMake(1.05f, 0, 0, 1.0f, 0, 0); | |
| 181 | 180 | |
| 182 | 181 | } completion:^(BOOL finished) { |
| 183 | 182 | [UIView animateWithDuration:0.1f animations:^{ |
| 184 | - _midImage.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 185 | - _scoreBtn.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 186 | - _scoreLabel.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 187 | - _colseBtn.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 188 | - _descLabel.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 183 | + self->_midImage.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 184 | + self->_scoreBtn.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 185 | + self->_scoreLabel.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 186 | + self->_colseBtn.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 187 | + self->_descLabel.transform = CGAffineTransformMake(1, 0, 0, 1, 0, 0); | |
| 189 | 188 | |
| 190 | 189 | } completion:^(BOOL finished) { |
| 191 | 190 | // 恢复原位 |
| 192 | - _midImage.transform = CGAffineTransformIdentity; | |
| 193 | - _scoreBtn.transform = CGAffineTransformIdentity; | |
| 194 | - _scoreLabel.transform = CGAffineTransformIdentity; | |
| 195 | - _colseBtn.transform = CGAffineTransformIdentity; | |
| 196 | - _descLabel.transform = CGAffineTransformIdentity; | |
| 191 | + self->_midImage.transform = CGAffineTransformIdentity; | |
| 192 | + self->_scoreBtn.transform = CGAffineTransformIdentity; | |
| 193 | + self->_scoreLabel.transform = CGAffineTransformIdentity; | |
| 194 | + self->_colseBtn.transform = CGAffineTransformIdentity; | |
| 195 | + self->_descLabel.transform = CGAffineTransformIdentity; | |
| 197 | 196 | |
| 198 | 197 | }]; |
| 199 | 198 | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveGoldWhereaboutsView.h
| ... | ... | @@ -16,23 +16,23 @@ NS_ASSUME_NONNULL_BEGIN |
| 16 | 16 | @class CNLiveScoreModel; |
| 17 | 17 | |
| 18 | 18 | typedef NS_ENUM(NSUInteger, CNLiveGoldWhereaboutsViewType) { |
| 19 | - CNLiveGoldWhereaboutsViewTypeDefault,//熊猫 | |
| 20 | 19 | CNLiveGoldWhereaboutsViewTypeSignIn,//签到 |
| 21 | - CNLiveGoldWhereaboutsViewTypeLogin,//游客登录 | |
| 20 | + CNLiveGoldWhereaboutsViewTypeAddScore,//熊猫 | |
| 21 | + CNLiveGoldWhereaboutsViewTypeLogin//游客登录 | |
| 22 | 22 | |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | @interface CNLiveGoldWhereaboutsView : CAEmitterLayerView |
| 26 | -@property (nonatomic, weak) id delegate; | |
| 27 | 26 | |
| 28 | -// 游客模式浏览加积分 | |
| 29 | -+ (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc delegate:(id)delegate; | |
| 27 | +// 默认签到 | |
| 28 | ++ (void)show:(CNLiveScoreModel *)model; | |
| 30 | 29 | |
| 31 | 30 | // 默认展示添加积分视图 |
| 32 | -+ (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc score:(NSString *)score; | |
| 31 | ++ (void)showWithDesc:(NSString *)desc score:(NSString *)score; | |
| 32 | + | |
| 33 | +// 游客模式浏览加积分 | |
| 34 | ++ (void)showWithDesc:(NSString *)desc delegate:(id)delegate; | |
| 33 | 35 | |
| 34 | -// 默认签到 | |
| 35 | -+ (void)showGoldWhereaboutsViewModel:(CNLiveScoreModel *)model controller:(id)controller; | |
| 36 | 36 | + (void)hide; |
| 37 | 37 | |
| 38 | 38 | @end | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveGoldWhereaboutsView.m
| ... | ... | @@ -23,13 +23,14 @@ |
| 23 | 23 | @property (nonatomic, copy) NSString *desc; |
| 24 | 24 | @property (nonatomic, copy) NSString *score; |
| 25 | 25 | |
| 26 | -@property (nonatomic, weak) id<CNLiveSignInViewDelegate> controller; | |
| 27 | 26 | @property (nonatomic, strong) CNLiveScoreModel *model; |
| 28 | 27 | |
| 28 | +@property (nonatomic, weak) id delegate; | |
| 29 | + | |
| 29 | 30 | @end |
| 30 | 31 | @implementation CNLiveGoldWhereaboutsView |
| 31 | 32 | #pragma mark - Using Method |
| 32 | -+ (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc delegate:(id<CNLiveGoldWhereaboutsViewDelegate>) delegate{//浏览加积分 | |
| 33 | ++ (void)showWithDesc:(NSString *)desc delegate:(id)delegate{//浏览加积分 | |
| 33 | 34 | CNLiveGoldWhereaboutsView *sView = [[CNLiveGoldWhereaboutsView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; |
| 34 | 35 | sView.desc = desc; |
| 35 | 36 | sView.delegate = delegate; |
| ... | ... | @@ -37,18 +38,18 @@ |
| 37 | 38 | [sView show:CNLiveGoldWhereaboutsViewTypeLogin]; |
| 38 | 39 | } |
| 39 | 40 | |
| 40 | -+ (void)showGoldWhereaboutsViewWithDesc:(NSString *)desc score:(NSString *)score{ | |
| 41 | ++ (void)showWithDesc:(NSString *)desc score:(NSString *)score{ | |
| 41 | 42 | CNLiveGoldWhereaboutsView *sView = [[CNLiveGoldWhereaboutsView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; |
| 42 | 43 | sView.desc = desc; |
| 43 | 44 | sView.score = score; |
| 44 | 45 | [[UIApplication sharedApplication].keyWindow addSubview:sView]; |
| 45 | - [sView show:CNLiveGoldWhereaboutsViewTypeDefault]; | |
| 46 | + [sView show:CNLiveGoldWhereaboutsViewTypeAddScore]; | |
| 46 | 47 | |
| 47 | 48 | } |
| 48 | -+ (void)showGoldWhereaboutsViewModel:(CNLiveScoreModel *)model controller:(id<CNLiveSignInViewDelegate>)controller{ | |
| 49 | + | |
| 50 | ++ (void)show:(CNLiveScoreModel *)model { | |
| 49 | 51 | CNLiveGoldWhereaboutsView *sView = [[CNLiveGoldWhereaboutsView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)]; |
| 50 | 52 | sView.model = model; |
| 51 | - sView.controller = controller; | |
| 52 | 53 | [[UIApplication sharedApplication].keyWindow addSubview:sView]; |
| 53 | 54 | [sView show:CNLiveGoldWhereaboutsViewTypeSignIn]; |
| 54 | 55 | } |
| ... | ... | @@ -140,25 +141,26 @@ |
| 140 | 141 | } |
| 141 | 142 | |
| 142 | 143 | switch (type) { |
| 143 | - case CNLiveGoldWhereaboutsViewTypeDefault: | |
| 144 | + case CNLiveGoldWhereaboutsViewTypeSignIn://签到 | |
| 145 | + { | |
| 146 | + [CNLiveSignInView showWithScore:self.model.score scores:self.model.scores.count>0?self.model.scores[0]:@"1000,2000,3000,4000,5000,6000,7000" day:self.model.times url:self.model.url]; | |
| 147 | + } | |
| 148 | + break; | |
| 149 | + | |
| 150 | + case CNLiveGoldWhereaboutsViewTypeAddScore://增加积分 | |
| 144 | 151 | { |
| 145 | 152 | if(self.score && ![self.score isEqualToString:@""] && self.desc && ![self.desc isEqualToString:@""]){ |
| 146 | - [CNLiveAddScoreView showAddScoreViewWithDesc:self.desc score:self.score]; | |
| 153 | + [CNLiveAddScoreView showWithDesc:self.desc score:self.score]; | |
| 147 | 154 | }else{ |
| 148 | 155 | [self hide]; |
| 149 | 156 | } |
| 150 | 157 | } |
| 151 | 158 | break; |
| 152 | 159 | |
| 153 | - case CNLiveGoldWhereaboutsViewTypeSignIn: | |
| 154 | - { | |
| 155 | - [CNLiveSignInView 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]; | |
| 156 | - } | |
| 157 | - break; | |
| 158 | - case CNLiveGoldWhereaboutsViewTypeLogin: | |
| 160 | + case CNLiveGoldWhereaboutsViewTypeLogin://立即登录 | |
| 159 | 161 | { |
| 160 | 162 | if(self.desc && ![self.desc isEqualToString:@""]){ |
| 161 | - [CNLiveAddScoreView showAddScoreViewWithDesc:self.desc login:@"立即登录" delegate:self]; | |
| 163 | + [CNLiveAddScoreView showWithDesc:self.desc score:@"立即登录" delegate:self.delegate]; | |
| 162 | 164 | }else{ |
| 163 | 165 | [self hide]; |
| 164 | 166 | } |
| ... | ... | @@ -235,13 +237,13 @@ |
| 235 | 237 | // Drawing code |
| 236 | 238 | } |
| 237 | 239 | */ |
| 240 | + | |
| 238 | 241 | - (void)dealloc{ |
| 239 | 242 | NSLog(@"CNLiveGoldWhereaboutsView - dealloc"); |
| 240 | 243 | } |
| 244 | + | |
| 241 | 245 | - (void)loginNow{ |
| 242 | - if (self.delegate && [self.delegate respondsToSelector:@selector(loginNow)]) { | |
| 243 | - [self.delegate loginNow]; | |
| 244 | - } | |
| 246 | + [self hide]; | |
| 245 | 247 | } |
| 246 | 248 | |
| 247 | 249 | @end | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveRewardRulesView.h
CNLiveIntegralModule/Classes/Tools/CNLiveRewardRulesView.m
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | |
| 15 | 15 | #import "CNLiveGoldWhereaboutsView.h" |
| 16 | 16 | |
| 17 | -@interface CNLiveRewardRulesView()<WKNavigationDelegate,WKUIDelegate> | |
| 17 | +@interface CNLiveRewardRulesView()<WKNavigationDelegate, WKUIDelegate> | |
| 18 | 18 | @property (nonatomic, strong) UIImageView *bgView; |
| 19 | 19 | @property (nonatomic, strong) UIButton *closeBtn; |
| 20 | 20 | @property (nonatomic, strong) WKWebView *webView; |
| ... | ... | @@ -25,19 +25,14 @@ |
| 25 | 25 | static const NSInteger margin = 0; |
| 26 | 26 | |
| 27 | 27 | #pragma mark - Using Method |
| 28 | -+ (void)showRewardRulesView:(NSString *)url{ | |
| 28 | ++ (void)show:(NSString *)url{ | |
| 29 | 29 | CNLiveRewardRulesView *view = [[CNLiveRewardRulesView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| 30 | 30 | view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; |
| 31 | 31 | [view.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]]; |
| 32 | 32 | [[UIApplication sharedApplication].keyWindow addSubview:view]; |
| 33 | 33 | |
| 34 | 34 | } |
| 35 | -+ (void)showRewardRulesView{ | |
| 36 | - CNLiveRewardRulesView *view = [[CNLiveRewardRulesView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 37 | - view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | |
| 38 | - [[UIApplication sharedApplication].keyWindow addSubview:view]; | |
| 39 | - | |
| 40 | -} | |
| 35 | + | |
| 41 | 36 | #pragma mark - Init |
| 42 | 37 | - (instancetype)initWithFrame:(CGRect)frame { |
| 43 | 38 | self = [super initWithFrame:frame]; |
| ... | ... | @@ -46,6 +41,7 @@ static const NSInteger margin = 0; |
| 46 | 41 | } |
| 47 | 42 | return self; |
| 48 | 43 | } |
| 44 | + | |
| 49 | 45 | #pragma mark - UI |
| 50 | 46 | - (void)setup { |
| 51 | 47 | [self addSubview:self.bgView]; |
| ... | ... | @@ -54,6 +50,7 @@ static const NSInteger margin = 0; |
| 54 | 50 | [self addAnimation]; |
| 55 | 51 | |
| 56 | 52 | } |
| 53 | + | |
| 57 | 54 | - (void)layoutSubviews{ |
| 58 | 55 | [super layoutSubviews]; |
| 59 | 56 | [_bgView mas_makeConstraints:^(MASConstraintMaker *make) { |
| ... | ... | @@ -81,7 +78,7 @@ static const NSInteger margin = 0; |
| 81 | 78 | }]; |
| 82 | 79 | |
| 83 | 80 | } |
| 84 | -#pragma mark - Data | |
| 81 | + | |
| 85 | 82 | #pragma mark - Private Methods |
| 86 | 83 | - (void)addAnimation{ |
| 87 | 84 | _bgView.transform = CGAffineTransformMake(0.01, 0, 0, 0.01, _bgView.left, _bgView.top); |
| ... | ... | @@ -106,7 +103,7 @@ static const NSInteger margin = 0; |
| 106 | 103 | |
| 107 | 104 | [UIView animateWithDuration:0.3f animations:^{ |
| 108 | 105 | // 按照比例scalex=0.001,y=0.001进行缩小 |
| 109 | - _bgView.layer.transform = CATransform3DMakeScale(0.001, 0.001, 1); | |
| 106 | + self->_bgView.layer.transform = CATransform3DMakeScale(0.001, 0.001, 1); | |
| 110 | 107 | |
| 111 | 108 | } completion:^(BOOL finished) { |
| 112 | 109 | [self removeFromSuperview]; |
| ... | ... | @@ -129,8 +126,9 @@ static const NSInteger margin = 0; |
| 129 | 126 | // Drawing code |
| 130 | 127 | } |
| 131 | 128 | */ |
| 129 | + | |
| 132 | 130 | #pragma mark - Action |
| 133 | -- (void)clickCloseBtn:(UIButton *)btn{ | |
| 131 | +- (void)closeDidClicked:(UIButton *)btn{ | |
| 134 | 132 | [self hiddenAction]; |
| 135 | 133 | |
| 136 | 134 | } |
| ... | ... | @@ -172,7 +170,7 @@ static const NSInteger margin = 0; |
| 172 | 170 | if(_closeBtn == nil){ |
| 173 | 171 | _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 174 | 172 | _closeBtn.titleLabel.font = UIFontMake(15); |
| 175 | - [_closeBtn addTarget:self action:@selector(clickCloseBtn:) forControlEvents:UIControlEventTouchUpInside]; | |
| 173 | + [_closeBtn addTarget:self action:@selector(closeDidClicked:) forControlEvents:UIControlEventTouchUpInside]; | |
| 176 | 174 | [_closeBtn setTitle:@"我知道了" forState:UIControlStateNormal]; |
| 177 | 175 | [_closeBtn setTitleColor:[UIColor colorWithRed:35/255.0 green:212/255.0 blue:30/255.0 alpha:1.0] forState:UIControlStateNormal]; |
| 178 | 176 | _closeBtn.adjustsImageWhenHighlighted = NO; | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveSignInView.h
| ... | ... | @@ -15,20 +15,18 @@ |
| 15 | 15 | NS_ASSUME_NONNULL_BEGIN |
| 16 | 16 | |
| 17 | 17 | @interface CNLiveSignInView : UIView |
| 18 | -@property (nonatomic, weak) id delegate; | |
| 19 | 18 | @property (nonatomic, copy) NSString *url; |
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | - * 显示签到视图 | |
| 21 | + * 签到 | |
| 23 | 22 | * |
| 24 | 23 | * @param score 1000 |
| 25 | 24 | * @param scores "1000,2000,3000,4000,5000,6000,7000" |
| 26 | 25 | * @param day 第几天 |
| 27 | 26 | * @param url 签到规则url |
| 28 | - * @param delegate 代理 | |
| 29 | 27 | * |
| 30 | 28 | */ |
| 31 | -+ (void)showSignInView:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url delegate:(id)delegate; | |
| 29 | ++ (void)showWithScore:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url; | |
| 32 | 30 | |
| 33 | 31 | @end |
| 34 | 32 | ... | ... |
CNLiveIntegralModule/Classes/Tools/CNLiveSignInView.m
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | |
| 17 | 17 | #import "CNLiveSignInButtonView.h" |
| 18 | 18 | #import "CNLiveGoldWhereaboutsView.h" |
| 19 | +#import "CNLiveRewardRulesView.h" | |
| 19 | 20 | |
| 20 | 21 | @interface CNLiveSignInView() |
| 21 | 22 | @property (nonatomic, strong) UIImageView *bgView; |
| ... | ... | @@ -32,60 +33,16 @@ |
| 32 | 33 | |
| 33 | 34 | @implementation CNLiveSignInView |
| 34 | 35 | static const NSInteger margin = 15; |
| 35 | -+ (void)showSignInView:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url delegate:(id<CNLiveSignInViewDelegate>)delegate{ | |
| 36 | ++ (void)showWithScore:(NSString *)score scores:(NSString *)scores day:(NSInteger)day url:(NSString *)url{ | |
| 36 | 37 | CNLiveSignInView *view = [[CNLiveSignInView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; |
| 37 | 38 | view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; |
| 38 | 39 | view.score = score; |
| 39 | 40 | view.scores = scores; |
| 40 | 41 | view.day = day; |
| 41 | 42 | view.url = url; |
| 42 | - view.delegate = delegate; | |
| 43 | 43 | [[UIApplication sharedApplication].keyWindow addSubview:view]; |
| 44 | 44 | } |
| 45 | -//+ (void)showSignInView:(NSString *)score day:(NSInteger)day url:(NSString *)url delegate:(id<CNLiveSignInViewDelegate>)delegate{ | |
| 46 | -// CNLiveSignInView *view = [[CNLiveSignInView alloc]initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 47 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | |
| 48 | -// view.score = score; | |
| 49 | -// view.day = day; | |
| 50 | -// view.url = url; | |
| 51 | -// view.delegate = delegate; | |
| 52 | -// [[UIApplication sharedApplication].keyWindow addSubview:view]; | |
| 53 | -//} | |
| 54 | -// | |
| 55 | -//+ (void)showSignInView:(NSString *)score day:(NSInteger)day delegate:(id<CNLiveSignInViewDelegate>)delegate{ | |
| 56 | -// CNLiveSignInView *view = [[CNLiveSignInView alloc]initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 57 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | |
| 58 | -// view.score = score; | |
| 59 | -// view.day = day; | |
| 60 | -// view.delegate = delegate; | |
| 61 | -// [[UIApplication sharedApplication].keyWindow addSubview:view]; | |
| 62 | -// | |
| 63 | -//} | |
| 64 | -// | |
| 65 | -//+ (void)showSignInView:(NSString *)score delegate:(id<CNLiveSignInViewDelegate>)delegate{ | |
| 66 | -// CNLiveSignInView *view = [[CNLiveSignInView alloc]initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 67 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | |
| 68 | -// view.score = score; | |
| 69 | -// view.delegate = delegate; | |
| 70 | -// [[UIApplication sharedApplication].keyWindow addSubview:view]; | |
| 71 | -// | |
| 72 | -//} | |
| 73 | -// | |
| 74 | -//+ (void)showSignInViewDelegate:(id<CNLiveSignInViewDelegate>)delegate{ | |
| 75 | -// CNLiveSignInView *view = [[CNLiveSignInView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 76 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | |
| 77 | -// view.delegate = delegate; | |
| 78 | -// [[UIApplication sharedApplication].keyWindow addSubview:view]; | |
| 79 | -// | |
| 80 | -//} | |
| 81 | -// | |
| 82 | -//+ (void)showSignInView:(NSString *)score{ | |
| 83 | -// CNLiveSignInView *view = [[CNLiveSignInView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 84 | -// view.backgroundColor = [UIColor colorWithWhite:0.2f alpha:0.4f]; | |
| 85 | -// view.score = score; | |
| 86 | -// [[UIApplication sharedApplication].keyWindow addSubview:view]; | |
| 87 | -// | |
| 88 | -//} | |
| 45 | + | |
| 89 | 46 | #pragma mark - Init |
| 90 | 47 | - (instancetype)initWithFrame:(CGRect)frame { |
| 91 | 48 | self = [super initWithFrame:frame]; |
| ... | ... | @@ -225,11 +182,8 @@ static const NSInteger margin = 15; |
| 225 | 182 | |
| 226 | 183 | #pragma mark - Action |
| 227 | 184 | - (void)clickRulesBtn:(UIButton *)btn{ |
| 228 | - if (self.delegate && [self.delegate respondsToSelector:@selector(clickedrRulesButton:)]) { | |
| 229 | - [self.delegate clickedrRulesButton:self]; | |
| 230 | - [self removeFromSuperview]; | |
| 231 | - | |
| 232 | - } | |
| 185 | + [self removeFromSuperview]; | |
| 186 | + [CNLiveRewardRulesView show:self.url]; | |
| 233 | 187 | |
| 234 | 188 | } |
| 235 | 189 | - (void)clickCloseBtn:(UIButton *)btn{ | ... | ... |
Example/CNLiveIntegralModule.xcodeproj/project.pbxproj
| ... | ... | @@ -207,7 +207,7 @@ |
| 207 | 207 | 6003F586195388D20070C39A /* Sources */, |
| 208 | 208 | 6003F587195388D20070C39A /* Frameworks */, |
| 209 | 209 | 6003F588195388D20070C39A /* Resources */, |
| 210 | - DC6D3F3A697DDBCCAD911966 /* [CP] Embed Pods Frameworks */, | |
| 210 | + 4C2E5425FBAFD3161FA4DFD3 /* [CP] Embed Pods Frameworks */, | |
| 211 | 211 | ); |
| 212 | 212 | buildRules = ( |
| 213 | 213 | ); |
| ... | ... | @@ -320,29 +320,7 @@ |
| 320 | 320 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; |
| 321 | 321 | showEnvVarsInLog = 0; |
| 322 | 322 | }; |
| 323 | - BBC4CB889090285A0AAFD6A5 /* [CP] Check Pods Manifest.lock */ = { | |
| 324 | - isa = PBXShellScriptBuildPhase; | |
| 325 | - buildActionMask = 2147483647; | |
| 326 | - files = ( | |
| 327 | - ); | |
| 328 | - inputFileListPaths = ( | |
| 329 | - ); | |
| 330 | - inputPaths = ( | |
| 331 | - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 332 | - "${PODS_ROOT}/Manifest.lock", | |
| 333 | - ); | |
| 334 | - name = "[CP] Check Pods Manifest.lock"; | |
| 335 | - outputFileListPaths = ( | |
| 336 | - ); | |
| 337 | - outputPaths = ( | |
| 338 | - "$(DERIVED_FILE_DIR)/Pods-CNLiveIntegralModule_Example-checkManifestLockResult.txt", | |
| 339 | - ); | |
| 340 | - runOnlyForDeploymentPostprocessing = 0; | |
| 341 | - shellPath = /bin/sh; | |
| 342 | - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | |
| 343 | - showEnvVarsInLog = 0; | |
| 344 | - }; | |
| 345 | - DC6D3F3A697DDBCCAD911966 /* [CP] Embed Pods Frameworks */ = { | |
| 323 | + 4C2E5425FBAFD3161FA4DFD3 /* [CP] Embed Pods Frameworks */ = { | |
| 346 | 324 | isa = PBXShellScriptBuildPhase; |
| 347 | 325 | buildActionMask = 2147483647; |
| 348 | 326 | files = ( |
| ... | ... | @@ -390,6 +368,28 @@ |
| 390 | 368 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveIntegralModule_Example/Pods-CNLiveIntegralModule_Example-frameworks.sh\"\n"; |
| 391 | 369 | showEnvVarsInLog = 0; |
| 392 | 370 | }; |
| 371 | + BBC4CB889090285A0AAFD6A5 /* [CP] Check Pods Manifest.lock */ = { | |
| 372 | + isa = PBXShellScriptBuildPhase; | |
| 373 | + buildActionMask = 2147483647; | |
| 374 | + files = ( | |
| 375 | + ); | |
| 376 | + inputFileListPaths = ( | |
| 377 | + ); | |
| 378 | + inputPaths = ( | |
| 379 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | |
| 380 | + "${PODS_ROOT}/Manifest.lock", | |
| 381 | + ); | |
| 382 | + name = "[CP] Check Pods Manifest.lock"; | |
| 383 | + outputFileListPaths = ( | |
| 384 | + ); | |
| 385 | + outputPaths = ( | |
| 386 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveIntegralModule_Example-checkManifestLockResult.txt", | |
| 387 | + ); | |
| 388 | + runOnlyForDeploymentPostprocessing = 0; | |
| 389 | + shellPath = /bin/sh; | |
| 390 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | |
| 391 | + showEnvVarsInLog = 0; | |
| 392 | + }; | |
| 393 | 393 | /* End PBXShellScriptBuildPhase section */ |
| 394 | 394 | |
| 395 | 395 | /* Begin PBXSourcesBuildPhase section */ | ... | ... |
Example/CNLiveIntegralModule/CNLIVEAppDelegate.m
| ... | ... | @@ -12,8 +12,14 @@ |
| 12 | 12 | #import "CNLiveGoldWhereaboutsView.h" |
| 13 | 13 | #import "CNLiveAddScoreView.h" |
| 14 | 14 | #import "CNLiveSignInView.h" |
| 15 | +#import "CNLiveIntegralServiceProtocol.h" | |
| 16 | +@interface CNLIVEAppDelegate()<CNLiveAddScoreViewDelegate> | |
| 15 | 17 | |
| 18 | +@end | |
| 16 | 19 | @implementation CNLIVEAppDelegate |
| 20 | +- (void)loginNow{ | |
| 21 | + | |
| 22 | +} | |
| 17 | 23 | |
| 18 | 24 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 19 | 25 | { |
| ... | ... | @@ -32,11 +38,11 @@ |
| 32 | 38 | |
| 33 | 39 | |
| 34 | 40 | [self.window makeKeyAndVisible]; |
| 35 | -// [CNLiveGoldWhereaboutsView showGoldWhereaboutsViewWithDesc:@"asd" delegate:self]; | |
| 41 | + [CNLiveGoldWhereaboutsView showWithDesc:@"asd" delegate:self]; | |
| 36 | 42 | |
| 37 | 43 | // [CNLiveAddScoreView showAddScoreViewWithDesc:@"asd" login:@"asdasd" delegate:self]; |
| 38 | 44 | |
| 39 | - [CNLiveSignInView showSignInView:@"asd" scores:@"312" day:1 url:@"asd" delegate:self]; | |
| 45 | +// [CNLiveSignInView showWithScore:@"asd" scores:@"312" day:1 url:@"http://www.baidu.com"]; | |
| 40 | 46 | return YES; |
| 41 | 47 | } |
| 42 | 48 | ... | ... |