Steven пре 4 месеци
родитељ
комит
0e41a97019

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/Controller/GroupIntroduceViewController.h

@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *groupIntroduce;
 
+@property (nonatomic, assign) BOOL canModify;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/Controller/GroupIntroduceViewController.m

@@ -55,6 +55,7 @@
 - (GroupIntroduceBodyView *)bodyView {
     if (!_bodyView) {
         _bodyView = [GroupIntroduceBodyView sharedInstance];
+        _bodyView.canModify = self.canModify;
     }
     return _bodyView;
 }

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/Controller/GroupSettingViewController.m

@@ -292,6 +292,7 @@
             GroupIntroduceViewController *ctrl = [[GroupIntroduceViewController alloc] init];
             ctrl.groupId = self.groupId;
             ctrl.groupIntroduce = self.sourceModel.introduce;
+            ctrl.canModify = NO;
             [self.navigationController pushViewController:ctrl animated:YES];
         }
             break;

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupIntroduceBodyView.h

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface GroupIntroduceBodyView : UIView
 
+@property (nonatomic, assign) BOOL canModify;
+
 + (instancetype)sharedInstance;
 
 - (void)configWithDesc:(NSString *)introduceString callback:(GroupIntroduceModifyCallback)callback;

+ 19 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupIntroduceBodyView.m

@@ -19,6 +19,7 @@
 
 @property (nonatomic, assign) NSInteger maxInputCount;
 
+@property (weak, nonatomic) IBOutlet UIButton *bottomButton;
 
 @end
 
@@ -150,6 +151,24 @@
     NSDictionary *attributes = @{NSFontAttributeName:font,NSParagraphStyleAttributeName:paragraphStyle,NSForegroundColorAttributeName:HexRGB(0x333333)};
     return attributes;
 }
+
+- (void)setCanModify:(BOOL)canModify {
+    _canModify = canModify;
+    if (canModify) {
+        self.inputView.editable = YES;
+        self.inputView.selectable = YES;
+        self.countLabel.hidden = NO;
+        self.bottomButton.hidden = NO;
+        self.bottomButton.userInteractionEnabled = YES;
+    }
+    else {
+        self.inputView.editable = NO;
+        self.inputView.selectable = NO;
+        self.countLabel.hidden = YES;
+        self.bottomButton.hidden = YES;
+        self.bottomButton.userInteractionEnabled = NO;
+    }
+}
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupIntroduceBodyView.xib

@@ -29,7 +29,7 @@
                             <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
-                        <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="ojd-Ye-Vwu">
+                        <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsVerticalScrollIndicator="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="ojd-Ye-Vwu">
                             <rect key="frame" x="12" y="45" width="341" height="239"/>
                             <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                             <color key="textColor" systemColor="labelColor"/>
@@ -107,6 +107,7 @@
             <nil key="simulatedBottomBarMetrics"/>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <connections>
+                <outlet property="bottomButton" destination="C0w-dR-pBm" id="cjE-AE-nOE"/>
                 <outlet property="countLabel" destination="Rjf-ib-50h" id="ZsS-CC-wDP"/>
                 <outlet property="inputView" destination="ojd-Ye-Vwu" id="9KT-FR-eXz"/>
                 <outlet property="tipsLabel" destination="eX5-gT-ext" id="IAg-Sd-72T"/>

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupSettingBodyView.m

@@ -330,6 +330,7 @@ typedef void(^ChooseMemberCallback)(NSString *targetId);
         self.callback(GROUPSETTING_SETTING);
     }
 }
+// 群简介
 - (IBAction)groupIntroduce:(id)sender {
     if (self.callback) {
         self.callback(GROUPSETTING_GROUPINTRODUCE);

+ 10 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Chat/Group/View/GroupSettingBodyView.xib

@@ -493,16 +493,26 @@
                                 <constraint firstAttribute="width" constant="7" id="uVm-xW-oEd"/>
                             </constraints>
                         </imageView>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DGg-Ff-sHI">
+                            <rect key="frame" x="16" y="0.0" width="398" height="1"/>
+                            <color key="backgroundColor" red="0.94117647059999998" green="0.94117647059999998" blue="0.94117647059999998" alpha="1" colorSpace="calibratedRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="1" id="2Si-eq-bYf"/>
+                            </constraints>
+                        </view>
                     </subviews>
                     <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                     <gestureRecognizers/>
                     <constraints>
                         <constraint firstItem="3g6-HZ-O7l" firstAttribute="centerY" secondItem="RYL-hu-GQa" secondAttribute="centerY" id="Ecl-HX-DUf"/>
                         <constraint firstAttribute="height" constant="55" id="FBf-Qp-5N8"/>
+                        <constraint firstAttribute="trailing" secondItem="DGg-Ff-sHI" secondAttribute="trailing" id="GvD-Qk-Eps"/>
                         <constraint firstItem="3g6-HZ-O7l" firstAttribute="leading" secondItem="rxL-8Y-p5y" secondAttribute="trailing" constant="12" id="M5d-UE-udM"/>
+                        <constraint firstItem="DGg-Ff-sHI" firstAttribute="leading" secondItem="tp6-8D-B5D" secondAttribute="leading" constant="16" id="Vgr-Bo-eiz"/>
                         <constraint firstItem="RYL-hu-GQa" firstAttribute="leading" secondItem="tp6-8D-B5D" secondAttribute="leading" constant="16" id="h05-Lh-qGj"/>
                         <constraint firstItem="rxL-8Y-p5y" firstAttribute="leading" secondItem="tp6-8D-B5D" secondAttribute="leading" constant="130" id="ieR-js-deU"/>
                         <constraint firstItem="3g6-HZ-O7l" firstAttribute="centerY" secondItem="tp6-8D-B5D" secondAttribute="centerY" id="jqB-5h-Ejb"/>
+                        <constraint firstItem="DGg-Ff-sHI" firstAttribute="top" secondItem="tp6-8D-B5D" secondAttribute="top" id="krE-xe-v0B"/>
                         <constraint firstAttribute="trailing" secondItem="3g6-HZ-O7l" secondAttribute="trailing" constant="12" id="miG-LK-e33"/>
                         <constraint firstItem="rxL-8Y-p5y" firstAttribute="centerY" secondItem="RYL-hu-GQa" secondAttribute="centerY" id="wU6-BV-fmR"/>
                     </constraints>