“wangdongchao” vor 1 Jahr
Ursprung
Commit
ef8775b321

+ 65 - 15
Asteria/Fuction/Goods/Revies/V/ReviewsTableHearV.m

@@ -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

+ 1 - 1
Asteria/Fuction/Goods/VC/ASGoodsDetailsViewController.m

@@ -244,7 +244,7 @@
     NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
     [params setObject:self.entity_id forKey:@"pid"];
 //    [params setObject:@0 forKey:@"img"];
-    [params setObject:@"Newest" forKey:@"sortreview"];
+    [params setObject:@"sortreview" forKey:@"sortreview"];
     [params setObject:@(self.TableV.Page) forKey:@"p"];
     [params setObject:@3 forKey:@"limit"];
     [self.VM ry_requestGetApi:Goods_productGetProductsReview param:params];

+ 9 - 2
Asteria/Fuction/Goods/VC/AS_GoodsReviewsListC.m

@@ -115,8 +115,15 @@
 -(void)reqNet_Goods_productGetProductsReview:(NSString *)sortreType{
     NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
     [params setObject:self.goodsM.Id forKey:@"pid"];
-    [params setObject:@1 forKey:@"img"];
-    [params setObject:sortreType forKey:@"sortreview"];
+    
+    if ([sortreType isEqualToString:@"All"]) {
+        
+    } else if ([sortreType isEqualToString:@"Newest"]) {
+        [params setObject:@"sortreview" forKey:@"sortreview"];
+    } else if ([sortreType isEqualToString:@"Pictures"]) {
+        [params setObject:@"img" forKey:@"img"];
+    }
+    
     [params setObject:@(self.TableV.Page) forKey:@"p"];
     [params setObject:@10 forKey:@"limit"];
     [self.VM ry_requestGetApi:Goods_productGetProductsReview param:params];

+ 5 - 4
Asteria/Fuction/Login/V/LoginSignUpV.m

@@ -94,16 +94,17 @@
     }else if(self.xxx_regPassWord.xxx_passwordTF.text.length<6){
         [self makeToast:@"Please set the correct password." duration:2 position:CSToastPositionCenter];
         return;
-    }else if(!isValid(self.xxx_netDateStr)){
-        [self makeToast:@"Please set Date Of Birth." duration:2 position:CSToastPositionCenter];
-        return;
     }
+//    else if(!isValid(self.xxx_netDateStr)){
+//        [self makeToast:@"Please set Date Of Birth." duration:2 position:CSToastPositionCenter];
+//        return;
+//    }
     
     NSMutableDictionary *customer = [NSMutableDictionary dictionary];
     [customer setObject:self.xxx_firstName.text forKey:@"firstname"];
     [customer setObject:self.xxx_lasetName.text forKey:@"lastname"];
     [customer setObject:self.xxx_regMmailV.xxx_emailTF.text forKey:@"email"];
-    [customer setObject:self.xxx_netDateStr forKey:@"dob"];
+    [customer setObject:AS_String_NotNull(self.xxx_netDateStr) forKey:@"dob"];
     NSMutableDictionary *tempDic = [NSMutableDictionary dictionary];
     [tempDic setObject:customer forKey:@"customer"];
     [tempDic setObject:self.xxx_regPassWord.xxx_passwordTF.text forKey:@"password"];