|
@@ -8,12 +8,18 @@
|
|
|
#import "ReviewsTableHearV.h"
|
|
|
#import "HCSStarRatingView.h"
|
|
|
#import "GoodsInformationM.h"
|
|
|
+
|
|
|
+#import "YJLAttributesLabel.h"
|
|
|
+
|
|
|
+#import "AS_SignUpC.h"
|
|
|
+
|
|
|
+
|
|
|
@interface ReviewsTableHearV ()
|
|
|
@property (nonatomic, strong) UILabel *customLab;
|
|
|
@property (nonatomic, strong) QMUILabel *reviewsLab;
|
|
|
@property (nonatomic, strong) HCSStarRatingView *reviews_startV;
|
|
|
@property (nonatomic, strong) QMUIButton *writeBtn;
|
|
|
-@property (nonatomic, strong) QMUILabel *tipsLab;
|
|
|
+@property (nonatomic, strong) YJLAttributesLabel *tipsLab;
|
|
|
|
|
|
@end
|
|
|
@implementation ReviewsTableHearV
|
|
@@ -61,19 +67,23 @@
|
|
|
}];
|
|
|
|
|
|
[self addSubview:self.writeBtn];
|
|
|
- [self addSubview:self.tipsLab];
|
|
|
[self.writeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.equalTo(topBgV.mas_bottom).offset(10);
|
|
|
make.left.mas_equalTo(10);
|
|
|
make.height.mas_equalTo(34);
|
|
|
make.width.mas_equalTo(105);
|
|
|
}];
|
|
|
- [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(self.writeBtn.mas_bottom);
|
|
|
- make.left.mas_equalTo(20);
|
|
|
- make.right.mas_equalTo(-20);
|
|
|
- //40;
|
|
|
- }];
|
|
|
+
|
|
|
+ [self layoutIfNeeded];
|
|
|
+ [self.writeBtn layoutIfNeeded];
|
|
|
+
|
|
|
+ [self addSubview:self.tipsLab];
|
|
|
+// [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(self.writeBtn.mas_bottom);
|
|
|
+// make.left.mas_equalTo(20);
|
|
|
+// make.right.mas_equalTo(-20);
|
|
|
+// //40;
|
|
|
+// }];
|
|
|
}
|
|
|
|
|
|
- (void)tt_confignewdata:(id)data{
|
|
@@ -140,18 +150,58 @@
|
|
|
return _writeBtn;
|
|
|
}
|
|
|
|
|
|
-- (QMUILabel *)tipsLab {
|
|
|
+//- (QMUILabel *)tipsLab {
|
|
|
+// if (!_tipsLab) {
|
|
|
+// _tipsLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
|
|
|
+// _tipsLab.textAlignment = NSTextAlignmentLeft;
|
|
|
+// _tipsLab.textColor = [UIColor colorWithHexString:@"#666666"];
|
|
|
+// _tipsLab.font = [UIFont fontWithName:Rob_Regular size:12];
|
|
|
+// _tipsLab.text = @"Only Registered Users Can Write Reviews.Please,Log In Or Register";
|
|
|
+// _tipsLab.numberOfLines =2;
|
|
|
+// }
|
|
|
+// return _tipsLab;
|
|
|
+//}
|
|
|
+
|
|
|
+-(YJLAttributesLabel *)tipsLab{
|
|
|
if (!_tipsLab) {
|
|
|
- _tipsLab = [[QMUILabel alloc] initWithFrame:CGRectZero];
|
|
|
- _tipsLab.textAlignment = NSTextAlignmentLeft;
|
|
|
- _tipsLab.textColor = [UIColor colorWithHexString:@"#666666"];
|
|
|
+ _tipsLab = [[YJLAttributesLabel alloc]init];
|
|
|
+ _tipsLab.numberOfLines = 0;
|
|
|
+ _tipsLab.userInteractionEnabled = YES;
|
|
|
+ _tipsLab.frame = CGRectMake(20, CGRectGetMaxY(self.writeBtn.frame), KScreenWidth - 40, 45);
|
|
|
+ NSString *string = @"Only Registered Users Can Write Reviews. Please,Log In Or Register";
|
|
|
+ NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
|
|
|
+ NSMutableArray *arr_text = [[NSMutableArray alloc]initWithObjects:@"Log In Or Register" ,nil];
|
|
|
+ attrStr = [self textArr:arr_text AttributedString:attrStr Connet:string];
|
|
|
+ NSMutableArray * arr_range = [[NSMutableArray alloc]initWithObjects:@"48", nil];//点击的文字开始位置设置
|
|
|
+ [_tipsLab setAttributesText:attrStr actionText:arr_text actionRange:arr_range];//d添加到UILabel上面
|
|
|
+ _tipsLab.YJLAttributesBlock = ^(NSString * _Nonnull clicktext) {//点击事件的d返回
|
|
|
+ if([clicktext isEqualToString:@"Log In Or Register"]){
|
|
|
+ [Fuction_Tool pop_toLoginVC];
|
|
|
+ }
|
|
|
+ };
|
|
|
_tipsLab.font = [UIFont fontWithName:Rob_Regular size:12];
|
|
|
- _tipsLab.text = @"Only Registered Users Can Write Reviews.Please,Log In Or Register";
|
|
|
- _tipsLab.numberOfLines =2;
|
|
|
+
|
|
|
}
|
|
|
- return _tipsLab;
|
|
|
+ return _tipsLab;
|
|
|
}
|
|
|
|
|
|
+#pragma mark 多个点击位置进行简单设置
|
|
|
+-(NSMutableAttributedString *)textArr:(NSMutableArray *)textarr AttributedString:(NSMutableAttributedString *)String Connet:(NSString *)connet{
|
|
|
+
|
|
|
+ for (int i=0; i<textarr.count; i++) {
|
|
|
+ NSRange range = [connet rangeOfString:textarr[i]];
|
|
|
+ [String addAttribute:NSLinkAttributeName
|
|
|
+ value:textarr[i]
|
|
|
+ range: range];
|
|
|
+ [String addAttribute:NSForegroundColorAttributeName
|
|
|
+ value:ThemeColor
|
|
|
+ range:range];
|
|
|
+ [String addAttribute:NSUnderlineStyleAttributeName
|
|
|
+ value:[NSNumber numberWithInteger:NSUnderlineStyleSingle]
|
|
|
+ range:range];
|
|
|
+ }
|
|
|
+ return String;
|
|
|
+}
|
|
|
|
|
|
|
|
|
@end
|