|
|
@@ -23,6 +23,10 @@
|
|
|
@property(nonatomic,strong) UIButton*day7Button;
|
|
|
@property(nonatomic,strong) UIButton*dayForeverButton;
|
|
|
|
|
|
+@property(nonatomic,strong) UIButton*addButton;//+
|
|
|
+@property(nonatomic,strong) UITextField *shareNumberTF;
|
|
|
+@property(nonatomic,strong) UIButton*reduceButton;//-
|
|
|
+
|
|
|
@property(nonatomic,strong) UIButton*PrivacyShareButton;
|
|
|
@end
|
|
|
|
|
|
@@ -47,7 +51,7 @@
|
|
|
make.left.mas_equalTo(0);
|
|
|
make.right.mas_equalTo(0);
|
|
|
make.bottom.mas_equalTo(0);
|
|
|
- make.height.mas_equalTo(305 + AdaptTabHeight);
|
|
|
+ make.height.mas_equalTo(345 + AdaptTabHeight);
|
|
|
}];
|
|
|
|
|
|
|
|
|
@@ -126,6 +130,73 @@
|
|
|
make.height.mas_equalTo(25);
|
|
|
}];
|
|
|
|
|
|
+ //1.4.1 添加分享次数限制
|
|
|
+ NSString *thridTitleStr = NSLocalizedString(@"share_number_limit_title",nil);
|
|
|
+ UILabel *thridTitleLabel = [[UILabel alloc] init];
|
|
|
+ thridTitleLabel.font = [UIFont systemFontOfSize:14.0];
|
|
|
+ thridTitleLabel.textColor = [UIColor hwColor:@"#666666" alpha:1.0];
|
|
|
+ thridTitleLabel.text = thridTitleStr;
|
|
|
+ [whiteBgView addSubview:thridTitleLabel];
|
|
|
+
|
|
|
+ CGFloat thridWith = [thridTitleStr boundingRectWithSize:CGSizeMake(300, 20) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0]} context:nil].size.width + 10;
|
|
|
+
|
|
|
+ [thridTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(25);
|
|
|
+ make.width.mas_equalTo(thridWith);
|
|
|
+ make.top.equalTo(secondTitleLabel.mas_bottom).offset(10);
|
|
|
+ make.height.mas_equalTo(25);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _addButton = [[UIButton alloc] init];
|
|
|
+ [_addButton setImage:[UIImage imageNamed:@"common_add_d"] forState:UIControlStateDisabled];
|
|
|
+ [_addButton setImage:[UIImage imageNamed:@"common_add_N"] forState:UIControlStateNormal];
|
|
|
+ [_addButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ _addButton.tag = 3;
|
|
|
+ [whiteBgView addSubview:_addButton];
|
|
|
+ _addButton.enabled = NO;
|
|
|
+
|
|
|
+ [_addButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.right.mas_equalTo(-20);
|
|
|
+ make.centerY.equalTo(thridTitleLabel.mas_centerY).offset(0);
|
|
|
+ make.width.mas_equalTo(30);
|
|
|
+ make.height.mas_equalTo(30);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _shareNumberTF = [[UITextField alloc] init];
|
|
|
+ _shareNumberTF.backgroundColor = [UIColor hwColor:@"#F1F2F3" alpha:1.0];
|
|
|
+ _shareNumberTF.layer.cornerRadius = 8;
|
|
|
+ _shareNumberTF.textColor = [UIColor blackColor];
|
|
|
+ _shareNumberTF.textAlignment = NSTextAlignmentCenter;
|
|
|
+ _shareNumberTF.font = [UIFont systemFontOfSize:14.0];
|
|
|
+ _shareNumberTF.text = @"80";
|
|
|
+ //_shareNumberTF.delegate = self;
|
|
|
+ _shareNumberTF.keyboardType = UIKeyboardTypeNumberPad;
|
|
|
+ [whiteBgView addSubview:_shareNumberTF];
|
|
|
+ [_shareNumberTF setTintColor:[UIColor hwColor:@"#01B7EA" alpha:1.0]];
|
|
|
+
|
|
|
+ [_shareNumberTF mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.right.equalTo(_addButton.mas_left).offset(-5);
|
|
|
+ make.centerY.equalTo(thridTitleLabel.mas_centerY).offset(0);
|
|
|
+ make.width.mas_equalTo(50);
|
|
|
+ make.height.mas_equalTo(25);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _reduceButton = [[UIButton alloc] init];
|
|
|
+ [_reduceButton setImage:[UIImage imageNamed:@"common_reduce_d"] forState:UIControlStateDisabled];
|
|
|
+ [_reduceButton setImage:[UIImage imageNamed:@"common_reduce_N"] forState:UIControlStateNormal];
|
|
|
+ [_reduceButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ _reduceButton.tag = 4;
|
|
|
+ [whiteBgView addSubview:_reduceButton];
|
|
|
+
|
|
|
+ [_reduceButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.right.equalTo(_shareNumberTF.mas_left).offset(-5);
|
|
|
+ make.centerY.equalTo(thridTitleLabel.mas_centerY).offset(0);
|
|
|
+ make.width.mas_equalTo(30);
|
|
|
+ make.height.mas_equalTo(30);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
NSArray *titleArr = @[NSLocalizedString(@"share_by_weixin",nil),
|
|
|
NSLocalizedString(@"share_by_QQ",nil),
|
|
|
NSLocalizedString(@"share_by_timeLine",nil),
|
|
|
@@ -149,7 +220,7 @@
|
|
|
make.width.mas_equalTo(curButFullWidth);
|
|
|
make.left.mas_equalTo(i*curButFullWidth);
|
|
|
make.height.mas_equalTo(80);
|
|
|
- make.top.equalTo(secondTitleLabel.mas_bottom).offset(20);
|
|
|
+ make.top.equalTo(thridTitleLabel.mas_bottom).offset(20);
|
|
|
}];
|
|
|
|
|
|
if(i== titleArr.count -1){
|
|
|
@@ -264,6 +335,26 @@
|
|
|
//私密分享
|
|
|
_PrivacyShareButton.hidden = YES;
|
|
|
}
|
|
|
+ else if(tag==3){
|
|
|
+ NSInteger number = _shareNumberTF.text.integerValue;
|
|
|
+ number ++;
|
|
|
+ _shareNumberTF.text = [[NSString alloc] initWithFormat:@"%ld",number];
|
|
|
+ if(number == 80){
|
|
|
+ _addButton.enabled = NO;
|
|
|
+ }
|
|
|
+
|
|
|
+ _reduceButton.enabled = YES;
|
|
|
+ }
|
|
|
+ else if(tag==4){
|
|
|
+ NSInteger number = _shareNumberTF.text.integerValue;
|
|
|
+ number --;
|
|
|
+ _shareNumberTF.text = [[NSString alloc] initWithFormat:@"%ld",number];
|
|
|
+ if(number == 1){
|
|
|
+ _reduceButton.enabled = NO;
|
|
|
+ }
|
|
|
+
|
|
|
+ _addButton.enabled = YES;
|
|
|
+ }
|
|
|
else if(tag == 100){
|
|
|
[self removeFromSuperview];
|
|
|
}
|