Kaynağa Gözat

部分修复

桂欢 1 yıl önce
ebeveyn
işleme
b4957f89d1

+ 10 - 1
SLAiELTS/SLAiELTS/ViewControllers/FriendsVC/SLRecomFriendsVc.m

@@ -9,6 +9,7 @@
 #import "LeftImageDesignTxtxField.h"
 #import "SLRecomFriendsCell.h"
 #import "SLRecomFriendModel.h"
+#import "SLFriensInfoVc.h"
 
 @interface SLRecomFriendsVc ()<UITableViewDelegate, UITableViewDataSource>
 
@@ -111,7 +112,15 @@
 }
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    
+    [tableView deselectRowAtIndexPath:indexPath animated:YES];
+    SLRecomFriendModel *model = [self.searchFriendsModel objectAtIndex:indexPath.row];
+    SLFriensInfoVc *vc = [SLFriensInfoVc loadViewControllewWithNib];
+    SLFriendsModel *fModel = [[SLFriendsModel alloc] init];
+    fModel.userId = model.userId;
+    fModel.userName = model.userName;
+    fModel.userHead = model.userHead;
+    vc.friendModel = fModel;
+    [self navPushViewController:vc animated:YES];
 }
 
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/FriendsVC/Views/SLRecomFriendsCell.xib

@@ -10,7 +10,7 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="114" id="KGk-i7-Jjw" customClass="SLRecomFriendsCell">
+        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="114" id="KGk-i7-Jjw" customClass="SLRecomFriendsCell">
             <rect key="frame" x="0.0" y="0.0" width="374" height="114"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">

+ 2 - 0
SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLChatListModel.h

@@ -35,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) BOOL isFriend;
 
+@property (nonatomic, assign) BOOL messageType;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 2 - 2
SLAiELTS/SLAiELTS/ViewControllers/Home/Views/Cells/SLHomeMsgTableViewCell.m

@@ -27,8 +27,8 @@
 - (void)confignCellWithModel:(SLChatListModel *)chatMode {
   NSString *userImg = [NSString stringWithFormat:@"%@%@",[SLHttpCenter SharedInstance].serverUrl, chatMode.dataHead];
     [self.headImageView sd_setImageWithURL:[NSURL URLWithString:userImg] placeholderImage:ImageName(@"icon_ellipse")];
-    self.nameLabel.text = chatMode.dataName;
-    self.msgLabel.text = [NSString replaceHasPrefix:@"\n" str:chatMode.message];
+    self.nameLabel.text = chatMode.dataName;// "[Voice Message]"
+    self.msgLabel.text = chatMode.messageType ? @"[Voice Message]" : [NSString replaceHasPrefix:@"\n" str:chatMode.message];
     self.timeLabel.text = chatMode.sendDate;
     [self.headBadgeView showBadgeWithStyle:WBadgeStyleNumber value:chatMode.unReadCount animationType:WBadgeAnimTypeNone];
 }

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Models/MessageModel.h

@@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *message;
 
-
+@property (nonatomic, assign) NSInteger messageType;
 @end
 
 @interface SLMessageDetail : NSObject

+ 2 - 1
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/IMMessageView/YMIMMessageCollectionView.m

@@ -114,6 +114,7 @@
             sendModel.chatType = 0;
             sendModel.toId = message.toId;
             sendModel.message = message.sendText;
+            sendModel.messageType = message.isMike;
             [[SLHttpCenter SharedInstance] postWithUrl:@"/api/Chat/SendMessage_WebSocket" body:[sendModel mj_JSONData] success:^(id responseObject) {
                 if (msgModel.sendFailure) {
                     msgModel.sendFailure = NO;
@@ -281,7 +282,7 @@
                 break;
             case SLMsgRepeat:
             {
-                [weakSelf resultsRequestWith:newModel];
+                [weakSelf resultsRequestWith:mModel];
             }
                 break;
             case SLMsgCopy:

+ 15 - 11
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLUserCenterViewController.m

@@ -102,18 +102,22 @@
     }
     if ([detail.title isEqualToString:@"清空聊天记录"]) {
         [SLCustomizeAlert showAletrWithTitle:@"温馨提示" message:@"是否清空聊天记录?" sureBtnTitle:@"确定" cancelBtnTitle:@"取消" sureBtnAction:^{
-            NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-            NSDictionary *dic = [userDefaults dictionaryRepresentation];
-            for (id  key in dic) {
-                if ([key isKindOfClass:NSString.class] && [key containsString:[NSString stringWithFormat:@"%@--to--",[SLGlobalInfo SharedInstance].loginInfo.user.userId]]) {
-                    [userDefaults removeObjectForKey:key];
+            [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Chat/ResetChatRecord" parameter:@{} success:^(id responseObject) {
+                NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+                NSDictionary *dic = [userDefaults dictionaryRepresentation];
+                for (id  key in dic) {
+                    if ([key isKindOfClass:NSString.class] && [key containsString:[NSString stringWithFormat:@"%@--to--",[SLGlobalInfo SharedInstance].loginInfo.user.userId]]) {
+                        [userDefaults removeObjectForKey:key];
+                    }
                 }
-            }
-            [userDefaults synchronize];
-            //语音文件
-            NSString *voicePath = [YMPath_DOCUMENT stringByAppendingFormat:@"/%@", @"voices"];
-            [[NSFileManager defaultManager] removeItemAtPath:voicePath error:nil];
-            [ZFToast ShowWithMessage:@"清空成功"];
+                [userDefaults synchronize];
+                //语音文件
+                NSString *voicePath = [YMPath_DOCUMENT stringByAppendingFormat:@"/%@", @"voices"];
+                [[NSFileManager defaultManager] removeItemAtPath:voicePath error:nil];
+                [ZFToast ShowWithMessage:@"清空成功"];
+            } failure:^(SPRequestError *error) {
+                
+            }];
         } cancelBtnAction:^{
             
         }];