Steven 1 month ago
parent
commit
4a28f4ddef

BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Chat/edit_button.imageset/edit_button@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Chat/edit_button.imageset/edit_button@3x.png


+ 10 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNetworkingManager.h

@@ -334,6 +334,16 @@ NS_ASSUME_NONNULL_BEGIN
 /// @param faliure 失败
 + (void)selectRoomConfigRequest:(NSString *)get success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
 #pragma mark -------- 群组服务
+// /api-teacher/imUserFriend/getMessageUser/CLX_2250235_STUDENT
+
+/// 查询聊天用户信息
+/// @param post post
+/// @param imUserId 用户imUserId
+/// @param success 成功
+/// @param faliure 失败
++ (void)getMessageUserRequset:(NSString *)post imUserId:(NSString *)imUserId success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure;
+
+
 // /api-teacher/imUserFriend/queryAll
 
 /// 查询好友列表

+ 15 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNetworkingManager.m

@@ -797,6 +797,21 @@
     [self request:get andWithUrl:url and:nil success:success faliure:faliure];
 }
 #pragma mark -------- 群组服务
+
+// /api-teacher/imUserFriend/getMessageUser/CLX_2250235_STUDENT
+
+/// 查询聊天用户信息
+/// @param post post
+/// @param imUserId 用户imUserId
+/// @param success 成功
+/// @param faliure 失败
++ (void)getMessageUserRequset:(NSString *)post imUserId:(NSString *)imUserId success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure {
+    
+    [self configRequestMethodJSON];
+    NSString *url = [NSString stringWithFormat:@"%@%@/%@",hostURL, @"/api-teacher/imUserFriend/getMessageUser",imUserId];
+    NSMutableDictionary *parm = [NSMutableDictionary dictionary];
+    [self request:post andWithUrl:url and:parm success:success faliure:faliure];
+}
 // /api-teacher/imUserFriend/queryAll
 
 /// 查询好友列表

+ 25 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Controller/KSChatConversationViewController.m

@@ -6,11 +6,14 @@
 //
 
 #import "KSChatConversationViewController.h"
+#import "KSPublicAlertView.h"
 
 @interface KSChatConversationViewController ()
 
 @property (nonatomic, strong) KSTXC2CChatViewController *vc;
 
+@property (nonatomic, strong) KSPublicAlertView *alertView;
+
 @end
 
 @implementation KSChatConversationViewController
@@ -59,18 +62,37 @@
 }
 
 - (void)requestData {
-    [KSNetworkingManager imUserFriendQueryDetail:KS_POST userId:self.conversation.userID success:^(NSDictionary * _Nonnull dic) {
-        if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
+    [KSNetworkingManager getMessageUserRequset:KS_POST imUserId:self.conversation.userID success:^(NSDictionary * _Nonnull dic) {
+        if ([dic ks_integerValueForKey:@"code"]) {
             NSDictionary *userDic = [dic ks_dictionaryValueForKey:@"data"];
-            NSString *userName = [userDic ks_stringValueForKey:@"friendNickname"];
+            NSString *userName = [userDic ks_stringValueForKey:@"username"];
             [self allocTitle:userName];
+            BOOL isDelUser = [userDic ks_boolValueForKey:@"delFlag"];
+            if (isDelUser) {
+                MJWeakSelf;
+                self.alertView = [KSPublicAlertView shareInstanceWithTitle:@"提示" descMessage:@"该用户已注销,是否删除会话?" leftTitle:@"否" rightTitle:@"是" cancelAction:^{
+
+                } sureAction:^{
+                    [weakSelf removeCurrentConversation];
+                }];
+            }
         }
+        
     } faliure:^(NSError * _Nonnull error) {
         
     }];
     
 }
 
+- (void)removeCurrentConversation {
+    MJWeakSelf;
+    NSString *conversationID = [NSString stringWithFormat:@"c2c_%@", self.conversation.userID];
+    [[V2TIMManager sharedInstance] deleteConversation:conversationID
+                                                 succ:^{
+        [weakSelf.navigationController popViewControllerAnimated:YES];
+    }
+                                                 fail:nil];
+}
 /*
 #pragma mark - Navigation
 

+ 8 - 8
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/GroupNotice/View/NoticeEditBodyView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -17,8 +17,8 @@
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DPp-n1-uMt">
                     <rect key="frame" x="13" y="418" width="388" height="58"/>
                     <subviews>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="设为置顶" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l5E-hK-DeW">
-                            <rect key="frame" x="16" y="19.5" width="82" height="19.5"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="设为置顶" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l5E-hK-DeW">
+                            <rect key="frame" x="16" y="19.5" width="64" height="19.5"/>
                             <fontDescription key="fontDescription" type="system" pointSize="16"/>
                             <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>
@@ -70,7 +70,7 @@
                     <rect key="frame" x="13" y="12" width="388" height="109"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="标题" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qAA-M4-xu3">
-                            <rect key="frame" x="40" y="15" width="33" height="22"/>
+                            <rect key="frame" x="40" y="15" width="32" height="22"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="22" id="c4e-iB-Yll"/>
                             </constraints>
@@ -86,7 +86,7 @@
                             <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                         </textView>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请输入标题" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6fi-W7-TxF">
-                            <rect key="frame" x="12" y="47" width="76.5" height="18"/>
+                            <rect key="frame" x="12" y="47" width="74.5" height="18"/>
                             <fontDescription key="fontDescription" type="system" pointSize="15"/>
                             <color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>
@@ -130,7 +130,7 @@
                     <rect key="frame" x="13" y="131" width="388" height="277"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="公告内容" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l9g-va-J4X">
-                            <rect key="frame" x="40" y="15" width="65.5" height="22"/>
+                            <rect key="frame" x="40" y="15" width="64" height="22"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="22" id="QC3-rJ-0hr"/>
                             </constraints>
@@ -146,7 +146,7 @@
                             <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                         </textView>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请输入公告内容" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mUd-aN-ASn">
-                            <rect key="frame" x="12" y="47" width="107.5" height="18"/>
+                            <rect key="frame" x="12" y="47" width="104.5" height="18"/>
                             <fontDescription key="fontDescription" type="system" pointSize="15"/>
                             <color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>

+ 4 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Course/MusicRoom/Controller/MusicRoomViewController.m

@@ -164,12 +164,10 @@
             return;
         }
         Records *studentModel = self.studentArray[indexPath.row];
-        if (studentModel.delFlag != YES) {
-            HomeworkDetailViewController *detailCtrl = [[HomeworkDetailViewController alloc] init];
-            detailCtrl.courseId = self.detailModel.courseId;
-            detailCtrl.studentId = studentModel.studentId;
-            [self.navigationController pushViewController:detailCtrl animated:YES];
-        }
+        HomeworkDetailViewController *detailCtrl = [[HomeworkDetailViewController alloc] init];
+        detailCtrl.courseId = self.detailModel.courseId;
+        detailCtrl.studentId = studentModel.studentId;
+        [self.navigationController pushViewController:detailCtrl animated:YES];
     }
 }
 

+ 4 - 7
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Homework/Controller/MusicRoomHomeworkStudentController.m

@@ -76,13 +76,10 @@
 }
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     Records *studentModel = self.studentArray[indexPath.row];
-    // 如果学生注销,不进入详情
-    if (studentModel.delFlag != YES) {
-        HomeworkDetailViewController *detailCtrl = [[HomeworkDetailViewController alloc] init];
-        detailCtrl.courseId = self.detailModel.courseId;
-        detailCtrl.studentId = studentModel.studentId;
-        [self.navigationController pushViewController:detailCtrl animated:YES];
-    }
+    HomeworkDetailViewController *detailCtrl = [[HomeworkDetailViewController alloc] init];
+    detailCtrl.courseId = self.detailModel.courseId;
+    detailCtrl.studentId = studentModel.studentId;
+    [self.navigationController pushViewController:detailCtrl animated:YES];
 }
 
 - (UITableView *)tableView {

+ 4 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Homework/View/HomeworkBodyView.m

@@ -229,12 +229,10 @@
         [self.naviController pushViewController:ctrl animated:YES];
     }
     else {
-        if (model.delFlag != YES) {
-            HomeworkDetailViewController *detailVC = [[HomeworkDetailViewController alloc] init];
-            detailVC.courseId = model.courseId;
-            detailVC.studentId = model.studentId;
-            [self.naviController pushViewController:detailVC animated:YES];
-        }
+        HomeworkDetailViewController *detailVC = [[HomeworkDetailViewController alloc] init];
+        detailVC.courseId = model.courseId;
+        detailVC.studentId = model.studentId;
+        [self.naviController pushViewController:detailVC animated:YES];
     }
     
 }

+ 5 - 7
KulexiuForTeacher/KulexiuForTeacher/Module/Home/MyCourse/View/MyLessonBodyView.m

@@ -447,13 +447,11 @@
 }
 
 - (void)showAccompanyDetail:(AccompanyLessonModel *)model {
-    if (model.delFlag != YES) {
-        AccompanyDetailViewController *detailVC = [[AccompanyDetailViewController alloc] init];
-        detailVC.courseId = model.courseId;
-        detailVC.courseGroupId = model.courseGoupId;
-        detailVC.studentId = model.userId;
-        [self.naviController pushViewController:detailVC animated:YES];
-    }
+    AccompanyDetailViewController *detailVC = [[AccompanyDetailViewController alloc] init];
+    detailVC.courseId = model.courseId;
+    detailVC.courseGroupId = model.courseGoupId;
+    detailVC.studentId = model.userId;
+    [self.naviController pushViewController:detailVC animated:YES];
 }
 
 - (void)showAdjustPicker:(AccompanyLessonModel *)model {