Browse Source

部分优化

桂欢 2 years ago
parent
commit
5df6787581

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/LoginVC/SLForgetPWViewController.m

@@ -35,7 +35,7 @@
 
 
 - (IBAction)retrieveBtnClick:(id)sender {
 - (IBAction)retrieveBtnClick:(id)sender {
     NSString *phoneStr = self.phoneTextField.text;
     NSString *phoneStr = self.phoneTextField.text;
-    if (!phoneStr) {
+    if (!phoneStr.length) {
         [ZFToast ShowWithMessage:@"请输入手机号"];
         [ZFToast ShowWithMessage:@"请输入手机号"];
         return;
         return;
     }
     }

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/Moments/MomentsVc/SLCreatMomentsVc.m

@@ -151,7 +151,7 @@
             NSString *url = [responseObject objectForKey:@"data"];
             NSString *url = [responseObject objectForKey:@"data"];
             InsertFriendCircle(url);
             InsertFriendCircle(url);
         } failure:^(SPRequestError *error) {
         } failure:^(SPRequestError *error) {
-            [ZFToast ShowWithMessage:error.msg];
+            
         }];
         }];
     }else {
     }else {
         InsertFriendCircle(@"");
         InsertFriendCircle(@"");

+ 13 - 2
SLAiELTS/SLAiELTS/ViewControllers/Moments/Views/Cell/SDTimeLineCell.m

@@ -107,7 +107,7 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
     _contentLabel.font = [UIFont systemFontOfSize:contentLabelFontSize];
     _contentLabel.font = [UIFont systemFontOfSize:contentLabelFontSize];
     _contentLabel.numberOfLines = 0;
     _contentLabel.numberOfLines = 0;
     if (maxContentLabelHeight == 0) {
     if (maxContentLabelHeight == 0) {
-        maxContentLabelHeight = _contentLabel.font.lineHeight * 3;
+        maxContentLabelHeight = 20 * 3;
     }
     }
     
     
     _moreButton = [UIButton new];
     _moreButton = [UIButton new];
@@ -244,7 +244,8 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
     NSString *userImg = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl, model.userImg];
     NSString *userImg = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl, model.userImg];
     [_iconView sd_setImageWithURL:[NSURL URLWithString:userImg] placeholderImage:ImageName(@"icon_ellipse")];
     [_iconView sd_setImageWithURL:[NSURL URLWithString:userImg] placeholderImage:ImageName(@"icon_ellipse")];
     _nameLable.text = model.userName;
     _nameLable.text = model.userName;
-    _contentLabel.text = model.friendContent;
+//    _contentLabel.text = model.friendContent;
+    _contentLabel.attributedText = [self generateAttributedStringWithFriendContent:model.friendContent];
     NSArray *friendImgUrls = [model.friendImgUrl componentsSeparatedByString:@","];
     NSArray *friendImgUrls = [model.friendImgUrl componentsSeparatedByString:@","];
     _picContainerView.cellModel = _model;
     _picContainerView.cellModel = _model;
     _picContainerView.picPathStringsArray = friendImgUrls;
     _picContainerView.picPathStringsArray = friendImgUrls;
@@ -285,6 +286,16 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
     _commentView.indexPath = self.indexPath;
     _commentView.indexPath = self.indexPath;
 }
 }
 
 
+- (NSMutableAttributedString *)generateAttributedStringWithFriendContent:(NSString *)friendContent
+{
+    NSString *text = friendContent;
+    NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:text];
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.lineSpacing = 4.0f;
+    [attString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, text.length)];
+    return attString;
+}
+
 - (void)setFrame:(CGRect)frame
 - (void)setFrame:(CGRect)frame
 {
 {
     [super setFrame:frame];
     [super setFrame:frame];

+ 5 - 3
SLAiELTS/SLAiELTS/ViewControllers/Moments/Views/CommentView/SDTimeLineCellCommentView.m

@@ -241,7 +241,7 @@
         .topSpaceToView(lastTopView, topMargin)
         .topSpaceToView(lastTopView, topMargin)
         .autoHeightRatio(0);
         .autoHeightRatio(0);
         
         
-//        label.isAttributedContent = YES;
+        label.isAttributedContent = YES;
         lastTopView = label;
         lastTopView = label;
     }
     }
     
     
@@ -276,8 +276,11 @@
     NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:text];
     NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:text];
     [attString setAttributes:@{NSLinkAttributeName : model.userId} range:[text rangeOfString:model.userName]];
     [attString setAttributes:@{NSLinkAttributeName : model.userId} range:[text rangeOfString:model.userName]];
     if (model.replyUserName) {
     if (model.replyUserName) {
-        [attString setAttributes:@{NSLinkAttributeName : model.friendId} range:[text rangeOfString:model.replyUserName]];
+        [attString setAttributes:@{NSLinkAttributeName : model.friendId} range:[text rangeOfString:[@" " stringByAppendingFormat:@"%@", model.replyUserName]]];
     }
     }
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.lineSpacing = 4.0f;
+    [attString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, text.length)];
 //    [attString setAttributes:@{NSLinkAttributeName : model.content, NSForegroundColorAttributeName : SLColor(@"#384962"), NSFontAttributeName : [UIFont systemFontOfSize:12]} range:[text rangeOfString:model.content]];
 //    [attString setAttributes:@{NSLinkAttributeName : model.content, NSForegroundColorAttributeName : SLColor(@"#384962"), NSFontAttributeName : [UIFont systemFontOfSize:12]} range:[text rangeOfString:model.content]];
     return attString;
     return attString;
 }
 }
@@ -292,7 +295,6 @@
     return attString;
     return attString;
 }
 }
 
 
-
 #pragma mark - MLLinkLabelDelegate
 #pragma mark - MLLinkLabelDelegate
 
 
 - (void)didClickLink:(MLLink *)link linkText:(NSString *)linkText linkLabel:(MLLinkLabel *)linkLabel
 - (void)didClickLink:(MLLink *)link linkText:(NSString *)linkText linkLabel:(MLLinkLabel *)linkLabel

+ 7 - 2
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLUserCenterViewController.m

@@ -107,10 +107,15 @@
 
 
 - (NSMutableArray<NSArray<SLPageModelDetail *> *> *)dataModels {
 - (NSMutableArray<NSArray<SLPageModelDetail *> *> *)dataModels {
     if (!_dataModels) {
     if (!_dataModels) {
+        SLUserModel *user = [SLGlobalInfo SharedInstance].loginInfo.user;
         NSArray *arr = @[
         NSArray *arr = @[
         @[[SLPageModelDetail initWithTitle:@"头像" subTitle:@"" bgImage:@""],
         @[[SLPageModelDetail initWithTitle:@"头像" subTitle:@"" bgImage:@""],
-            [SLPageModelDetail initWithTitle:@"昵称" subTitle:[SLGlobalInfo SharedInstance].loginInfo.user.name bgImage:@""],
-            [SLPageModelDetail initWithTitle:@"手机号" subTitle:[SLGlobalInfo SharedInstance].loginInfo.user.phone bgImage:@""]],
+          [SLPageModelDetail initWithTitle:@"昵称" subTitle:user.name bgImage:@""],
+          [SLPageModelDetail initWithTitle:@"手机号" subTitle:user.phone bgImage:@""],
+          [SLPageModelDetail initWithTitle:@"DLid" subTitle:user.name bgImage:@""],
+          [SLPageModelDetail initWithTitle:@"性别" subTitle:@"" bgImage:@""],
+          [SLPageModelDetail initWithTitle:@"地区" subTitle:@"" bgImage:@""],
+          [SLPageModelDetail initWithTitle:@"星座" subTitle:@"" bgImage:@""],],
           @[[SLPageModelDetail initWithTitle:@"用户协议" subTitle:@"" bgImage:@""],
           @[[SLPageModelDetail initWithTitle:@"用户协议" subTitle:@"" bgImage:@""],
             [SLPageModelDetail initWithTitle:@"隐私政策" subTitle:@"" bgImage:@""]],
             [SLPageModelDetail initWithTitle:@"隐私政策" subTitle:@"" bgImage:@""]],
           @[[SLPageModelDetail initWithTitle:@"退出登录" subTitle:@"" bgImage:@""],]];
           @[[SLPageModelDetail initWithTitle:@"退出登录" subTitle:@"" bgImage:@""],]];

+ 3 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/SLMySpeedView.m

@@ -109,6 +109,9 @@
         [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/UpdateSpeechRate" parameter:@{@"speechRate" : speechRate} success:^(id responseObject) {
         [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/UpdateSpeechRate" parameter:@{@"speechRate" : speechRate} success:^(id responseObject) {
             [ZFToast ShowWithMessage:@"保存成功"];
             [ZFToast ShowWithMessage:@"保存成功"];
             [SLGlobalInfo SharedInstance].roleModel.speechRate = speechRate;
             [SLGlobalInfo SharedInstance].roleModel.speechRate = speechRate;
+            if (self.speedBtn.isSelected) {
+                [self speedBtnClick:self.speedBtn];
+            }
         } failure:^(SPRequestError *error) {
         } failure:^(SPRequestError *error) {
             
             
         }];
         }];

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/SLMySpeedView.xib

@@ -33,7 +33,7 @@
                     <color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
                     <color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
                     <nil key="highlightedColor"/>
                 </label>
                 </label>
-                <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IeF-7j-J7B">
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IeF-7j-J7B">
                     <rect key="frame" x="364" y="5.3333333333333321" width="60" height="26"/>
                     <rect key="frame" x="364" y="5.3333333333333321" width="60" height="26"/>
                     <constraints>
                     <constraints>
                         <constraint firstAttribute="width" constant="60" id="ES6-pY-S9m"/>
                         <constraint firstAttribute="width" constant="60" id="ES6-pY-S9m"/>