Forráskód Böngészése

粉丝群空状态

Steven 5 hónapja
szülő
commit
6e1a16d882

+ 10 - 0
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -1179,6 +1179,8 @@
 		BCF7EB352C856C53006AA38C /* ScanFailBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF7EB2F2C856C52006AA38C /* ScanFailBodyView.m */; };
 		BCF7EB362C856C53006AA38C /* ScanOpenAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF7EB302C856C53006AA38C /* ScanOpenAlert.xib */; };
 		BCF7EB372C856C53006AA38C /* ScanLoginBodyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF7EB312C856C53006AA38C /* ScanLoginBodyView.xib */; };
+		BCF8A6192CF4844E00DA435B /* FansGroupEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCF8A6182CF4844E00DA435B /* FansGroupEmptyView.m */; };
+		BCF8A61B2CF4845400DA435B /* FansGroupEmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCF8A61A2CF4845400DA435B /* FansGroupEmptyView.xib */; };
 		BCFA12732CF4296E005229AC /* MusicGroupStudenListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA12712CF4296E005229AC /* MusicGroupStudenListCell.m */; };
 		BCFA12742CF4296E005229AC /* MusicGroupStudenListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCFA12722CF4296E005229AC /* MusicGroupStudenListCell.xib */; };
 		BCFA12772CF44C84005229AC /* GroupCourseStudentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA12762CF44C84005229AC /* GroupCourseStudentModel.m */; };
@@ -3156,6 +3158,9 @@
 		BCF880EC2B91C7200007B8F0 /* Config-test.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-test.xcconfig"; sourceTree = "<group>"; };
 		BCF880EE2B91C7310007B8F0 /* Config-debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-debug.xcconfig"; sourceTree = "<group>"; };
 		BCF880F12B91C7580007B8F0 /* Config-release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-release.xcconfig"; sourceTree = "<group>"; };
+		BCF8A6172CF4844E00DA435B /* FansGroupEmptyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FansGroupEmptyView.h; sourceTree = "<group>"; };
+		BCF8A6182CF4844E00DA435B /* FansGroupEmptyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FansGroupEmptyView.m; sourceTree = "<group>"; };
+		BCF8A61A2CF4845400DA435B /* FansGroupEmptyView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FansGroupEmptyView.xib; sourceTree = "<group>"; };
 		BCFA12702CF4296E005229AC /* MusicGroupStudenListCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MusicGroupStudenListCell.h; sourceTree = "<group>"; };
 		BCFA12712CF4296E005229AC /* MusicGroupStudenListCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MusicGroupStudenListCell.m; sourceTree = "<group>"; };
 		BCFA12722CF4296E005229AC /* MusicGroupStudenListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MusicGroupStudenListCell.xib; sourceTree = "<group>"; };
@@ -7002,6 +7007,9 @@
 				BCAF36EC2CEAE3E8009434AD /* FansGroupAlertView.h */,
 				BCAF36ED2CEAE3E8009434AD /* FansGroupAlertView.m */,
 				BCAF36EF2CEAE3EF009434AD /* FansGroupAlertView.xib */,
+				BCF8A6172CF4844E00DA435B /* FansGroupEmptyView.h */,
+				BCF8A6182CF4844E00DA435B /* FansGroupEmptyView.m */,
+				BCF8A61A2CF4845400DA435B /* FansGroupEmptyView.xib */,
 				BCA9AC552CEDDDEE00047BFA /* FansGroupAlertCell.h */,
 				BCA9AC562CEDDDEE00047BFA /* FansGroupAlertCell.m */,
 				BCA9AC572CEDDDEE00047BFA /* FansGroupAlertCell.xib */,
@@ -8274,6 +8282,7 @@
 				BC38C4242AF900E100ABFCC2 /* KSNewAlertView.xib in Resources */,
 				BC38C4812AFA1F4B00ABFCC2 /* MineWorksOpenDisplayCell.xib in Resources */,
 				BC7CFFBB2817E9FC00CAEB21 /* stacked_line_chart.html in Resources */,
+				BCF8A61B2CF4845400DA435B /* FansGroupEmptyView.xib in Resources */,
 				BCC583FE28A9FA8100BAB4CF /* cloud_animation_24.png in Resources */,
 				27A54CFE27E9BDC5007309A3 /* AboutUsBodyView.xib in Resources */,
 				BCA724052806AFF100DA0D0D /* AccompanyCourseInfoCell.xib in Resources */,
@@ -8897,6 +8906,7 @@
 				BC106B7E2A8F4586000759A9 /* TXLiveMessageDownSeatAll.m in Sources */,
 				BC9EFEB32C0480A500CFA7B1 /* GroupBanBottomView.m in Sources */,
 				2779320427E30FC30010E277 /* KSHoldButton.m in Sources */,
+				BCF8A6192CF4844E00DA435B /* FansGroupEmptyView.m in Sources */,
 				2779320627E30FC30010E277 /* UIView+ValueAdd.m in Sources */,
 				BCA9CE1527FD339400D558C6 /* AuthDisplayView.m in Sources */,
 				BCC408CD2AFCE0B700C60249 /* KSVideoCropViewController.m in Sources */,

+ 22 - 0
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/fansGroup_create.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "fansGroup_create@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "fansGroup_create@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/fansGroup_create.imageset/fansGroup_create@2x.png


BIN
KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/fansGroup_create.imageset/fansGroup_create@3x.png


+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/CreateStyle/Controller/MyStyleViewController.m

@@ -21,7 +21,6 @@
 #import "UserInfoManager.h"
 #import "MyCreateGroupHeadView.h"
 #import "MyStyleEditHeadView.h"
-#import "CreateFansGroupViewController.h"
 #import "ModifyPhoneCheckController.h"
 #import "UserAuthViewController.h"
 #import "ModifyNameViewController.h"

+ 17 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/Controller/MinePageViewController.m

@@ -23,6 +23,7 @@
 #import "MinePageGroupModel.h"
 #import "FansGroupAlertView.h"
 #import "KSGroupConversationController.h"
+#import "CreateFansGroupViewController.h"
 
 #define HEADER_HEIGHT (50)
 
@@ -427,12 +428,26 @@
     [alert configWithSource:self.fansGroupArray];
     [alert displayInView:self.view];
     MJWeakSelf;
-    [alert groupChatConversation:^(NSString * _Nonnull imGroupId) {
-        [weakSelf chatAction:imGroupId];
+    [alert groupChatConversation:^(BOOL isCreate, NSString * _Nullable imGroupId) {
+        if (isCreate) {
+            [weakSelf createGroup];
+        }
+        else {
+            [weakSelf chatAction:imGroupId];
+        }
     }];
+
+}
+
+- (void)createGroup {
+    CreateFansGroupViewController *ctrl = [[CreateFansGroupViewController alloc] init];
+    [self.navigationController pushViewController:ctrl animated:YES];
 }
 
 - (void)chatAction:(NSString *)imGroupId {
+    if ([NSString isEmptyString:imGroupId]) {
+        return;
+    }
     TUIChatConversationModel *model = [[TUIChatConversationModel alloc] init];
     model.groupID = imGroupId;
     KSGroupConversationController *ctrl = [[KSGroupConversationController alloc] init];

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/FansGroupAlert/FansGroupAlertView.h

@@ -7,7 +7,7 @@
 
 #import <UIKit/UIKit.h>
 
-typedef void(^FansGroupChatCallback)(NSString * _Nonnull imGroupId);
+typedef void(^FansGroupChatCallback)(BOOL isCreate, NSString * _Nullable imGroupId);
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 37 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/FansGroupAlert/FansGroupAlertView.m

@@ -7,6 +7,7 @@
 
 #import "FansGroupAlertView.h"
 #import "FansGroupAlertCell.h"
+#import "FansGroupEmptyView.h"
 
 #define ROW_HEIGHT (62)
 
@@ -21,6 +22,8 @@
 
 @property (nonatomic, strong) NSMutableArray *dataArray;
 
+@property (nonatomic, strong) FansGroupEmptyView *emptyView;
+
 @end
 
 @implementation FansGroupAlertView
@@ -39,12 +42,26 @@
 
 - (void)configWithSource:(NSMutableArray *)fansGroupArray {
     
+    if ([self.tableContainer.subviews containsObject:self.emptyView]) {
+        [self.emptyView removeFromSuperview];
+    }
     if (fansGroupArray.count > 3) {
         self.tableHeight.constant = ROW_HEIGHT * 3.5;
     }
     else {
-        self.tableHeight.constant = ROW_HEIGHT * fansGroupArray.count;
+        if (fansGroupArray.count == 0) {
+            [self.tableContainer addSubview:self.emptyView];
+            CGFloat height = [FansGroupEmptyView getViewHeight];
+            [self.emptyView mas_makeConstraints:^(MASConstraintMaker *make) {
+                make.left.right.top.bottom.mas_equalTo(self.tableContainer);
+            }];
+            self.tableHeight.constant = height;
+        }
+        else {
+            self.tableHeight.constant = ROW_HEIGHT * fansGroupArray.count;
+        }
     }
+    
     self.dataArray = [NSMutableArray arrayWithArray:fansGroupArray];
     [self.tableView reloadData];
 }
@@ -91,7 +108,7 @@
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     MinePageGroupModel *model = self.dataArray[indexPath.row];
     if (self.callback) {
-        self.callback(model.internalBaseClassIdentifier);
+        self.callback(NO, model.internalBaseClassIdentifier);
         [self removeView];
     }
 }
@@ -115,6 +132,24 @@
     }
     return _tableView;
 }
+
+- (FansGroupEmptyView *)emptyView {
+    if (!_emptyView) {
+        _emptyView = [FansGroupEmptyView sharedInstance];
+        MJWeakSelf;
+        [_emptyView createActionCallback:^{
+            [weakSelf createGroup];
+        }];
+    }
+    return _emptyView;
+}
+
+- (void)createGroup {
+    if (self.callback) {
+        self.callback(YES, nil);
+        [self removeView];
+    }
+}
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.

+ 24 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/FansGroupAlert/FansGroupEmptyView.h

@@ -0,0 +1,24 @@
+//
+//  FansGroupEmptyView.h
+//  KulexiuForTeacher
+//
+//  Created by 王智 on 2024/11/25.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef void(^CreateGroupCallback)(void);
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface FansGroupEmptyView : UIView
+
++ (instancetype)sharedInstance;
+
+- (void)createActionCallback:(CreateGroupCallback)callback;
+
++ (CGFloat)getViewHeight;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 47 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/FansGroupAlert/FansGroupEmptyView.m

@@ -0,0 +1,47 @@
+//
+//  FansGroupEmptyView.m
+//  KulexiuForTeacher
+//
+//  Created by 王智 on 2024/11/25.
+//
+
+#import "FansGroupEmptyView.h"
+
+@interface FansGroupEmptyView ()
+
+@property (nonatomic, copy) CreateGroupCallback callback;
+
+@end
+
+@implementation FansGroupEmptyView
+
++ (instancetype)sharedInstance {
+    FansGroupEmptyView *view = [[[NSBundle mainBundle] loadNibNamed:@"FansGroupEmptyView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)createActionCallback:(CreateGroupCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
+
+- (IBAction)createGroup:(id)sender {
+    if (self.callback) {
+        self.callback();
+    }
+}
+
+
++ (CGFloat)getViewHeight {
+    return 117.0f;
+}
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 91 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/FansGroupAlert/FansGroupEmptyView.xib

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="FansGroupEmptyView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="117"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="您还没有粉丝群哦!" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l2a-hQ-h8R">
+                    <rect key="frame" x="141.66666666666666" y="24" width="110" height="18"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="18" id="dsd-YR-G19"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                    <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CjH-cO-TsD">
+                    <rect key="frame" x="20" y="66" width="353" height="35"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="fansGroup_create" translatesAutoresizingMaskIntoConstraints="NO" id="CVO-yD-vX2">
+                            <rect key="frame" x="142" y="7" width="20" height="21"/>
+                        </imageView>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="去创建" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XVJ-bI-cK2">
+                            <rect key="frame" x="166" y="8.6666666666666714" width="45" height="18"/>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S9P-dw-Me9">
+                            <rect key="frame" x="0.0" y="0.0" width="353" height="35"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <connections>
+                                <action selector="createGroup:" destination="iN0-l3-epB" eventType="touchUpInside" id="6gN-AG-dcH"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <constraints>
+                        <constraint firstItem="S9P-dw-Me9" firstAttribute="leading" secondItem="CjH-cO-TsD" secondAttribute="leading" id="5Xy-wT-ibY"/>
+                        <constraint firstItem="XVJ-bI-cK2" firstAttribute="centerX" secondItem="CjH-cO-TsD" secondAttribute="centerX" constant="12" id="65x-n8-7HZ"/>
+                        <constraint firstItem="XVJ-bI-cK2" firstAttribute="centerY" secondItem="CVO-yD-vX2" secondAttribute="centerY" id="6sX-Gh-KQm"/>
+                        <constraint firstItem="XVJ-bI-cK2" firstAttribute="centerY" secondItem="CjH-cO-TsD" secondAttribute="centerY" id="IGe-98-caF"/>
+                        <constraint firstAttribute="trailing" secondItem="S9P-dw-Me9" secondAttribute="trailing" id="TR6-eJ-Gtx"/>
+                        <constraint firstAttribute="bottom" secondItem="S9P-dw-Me9" secondAttribute="bottom" id="Y5I-2R-cqw"/>
+                        <constraint firstItem="S9P-dw-Me9" firstAttribute="top" secondItem="CjH-cO-TsD" secondAttribute="top" id="cYz-Nf-bCN"/>
+                        <constraint firstItem="XVJ-bI-cK2" firstAttribute="leading" secondItem="CVO-yD-vX2" secondAttribute="trailing" constant="4" id="dLD-t9-maE"/>
+                        <constraint firstAttribute="height" constant="35" id="r8Y-gy-GP2"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="6"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="1"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                            <color key="value" red="0.8901960784313725" green="0.93725490196078431" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
+            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <constraints>
+                <constraint firstItem="l2a-hQ-h8R" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="2aq-dB-YbB"/>
+                <constraint firstAttribute="bottom" secondItem="CjH-cO-TsD" secondAttribute="bottom" constant="16" id="bgB-ET-pbE"/>
+                <constraint firstItem="l2a-hQ-h8R" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="24" id="hBT-e0-ghc"/>
+                <constraint firstItem="CjH-cO-TsD" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="xjn-a8-Awa"/>
+                <constraint firstAttribute="trailing" secondItem="CjH-cO-TsD" secondAttribute="trailing" constant="20" id="yAP-1h-lc1"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="52.671755725190835" y="-111.61971830985917"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="fansGroup_create" width="20" height="21"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>