Steven 2 years ago
parent
commit
6a8d9532f1

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

@@ -7164,7 +7164,6 @@
 				2779323927E30FC30010E277 /* LLCollectionViewCell.m in Sources */,
 				2779326A27E30FD80010E277 /* FSCalendarWeekdayView.m in Sources */,
 				BC02BCF228B32771005CB483 /* KSRejectAllSeatMessage.m in Sources */,
-				2723B69127F1803F00E0B90B /* HomeHeadView.m in Sources */,
 				BCDB0931280583C100D0BDAD /* NSObject+KSDateFormatter.m in Sources */,
 				BC4BCE702823A02F00522C8B /* AddressBottomView.m in Sources */,
 				277931EB27E30FC20010E277 /* NSArray+zh_SafeAccess.m in Sources */,

BIN
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -62,8 +62,8 @@
             filePath = "KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1675"
-            endingLineNumber = "1675"
+            startingLineNumber = "1683"
+            endingLineNumber = "1683"
             landmarkName = "-pauseLiveActionBack:"
             landmarkType = "7">
          </BreakpointContent>

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/CreateLiveViewController.m

@@ -44,7 +44,7 @@
 - (void)configUI {
     self.bodyView = [CreateLiveBodyView shareInstance];
     [self.scrollView addSubview:self.bodyView];
-    CGFloat height = kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin > 750 ? kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin : 750;
+    CGFloat height = kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin > 770 ? kScreenHeight -kNaviBarHeight - iPhoneXSafeBottomMargin : 770;
     [self.bodyView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.mas_equalTo(self.scrollView.mas_top);
         make.left.right.mas_equalTo(self.view);
@@ -89,6 +89,7 @@
     self.imageAsset = [imageAsset mutableCopy];
     // 重新布局
     [self.bodyView.coverImage setImage:[self.imageArray lastObject]];
+    self.bodyView.coverBgView.hidden = NO;
 }
 
 - (void)chooseTimeAction {

+ 8 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Live/Controller/LiveRoomViewController.m

@@ -1585,10 +1585,18 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
 - (LiveRoomHeadView *)headView {
     if (!_headView) {
         _headView = [LiveRoomHeadView shareInstance];
+        MJWeakSelf;
+        [_headView liveHeaderAction:^{
+            [weakSelf switchCamera];
+        }];
     }
     return _headView;
 }
 
+- (void)switchCamera {
+    [[RCRTCEngine sharedInstance].defaultVideoStream switchCamera];
+}
+
 - (LiveRoomBottomView *)bottomView {
     if (!_bottomView) {
         _bottomView = [LiveRoomBottomView shareInstance];

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/CreateLiveBodyView.h

@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (weak, nonatomic) IBOutlet UILabel *timeLabel;
 
+@property (weak, nonatomic) IBOutlet UIView *coverBgView;
+
 - (void)createSureCallback:(CreateLiveCallback)callback;
 
 - (void)chooseCoverCallback:(ChooseLiveCoverCallback)callback;

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/CreateLiveBodyView.m

@@ -33,7 +33,7 @@
     self.titleField.delegate = self;
     self.titleField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入直播标题" attributes:@{NSForegroundColorAttributeName:HexRGB(0xc1c1c1)}];
     self.inputView.delegate = self;
-    [self.buttonBgView drawBoardDottedLine:1.0f length:4 space:4 cornerRadius:8.0f lineColor:HexRGB(0xe3e3e3)];
+    [self.buttonBgView drawBoardDottedLine:1.0f length:4 space:4 cornerRadius:10.0f lineColor:HexRGB(0xe3e3e3)];
     
 }
 

+ 36 - 14
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/CreateLiveBodyView.xib

@@ -190,7 +190,7 @@
                     </userDefinedRuntimeAttributes>
                 </view>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eqa-D0-dj4">
-                    <rect key="frame" x="14" y="444" width="386" height="140"/>
+                    <rect key="frame" x="14" y="444" width="386" height="160"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SS1-EL-CQn">
                             <rect key="frame" x="12" y="20" width="8" height="21"/>
@@ -198,55 +198,76 @@
                             <color key="textColor" red="1" green="0.30588235289999999" blue="0.098039215690000001" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="直播封面" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dr3-xJ-pat">
-                            <rect key="frame" x="20" y="20" width="87" height="21"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="直播封面" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dr3-xJ-pat">
+                            <rect key="frame" x="20" y="20" width="69.5" height="21"/>
                             <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
                             <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="baO-ER-Xqp">
-                            <rect key="frame" x="12" y="51" width="120" height="80"/>
+                            <rect key="frame" x="12" y="51" width="160" height="90"/>
                             <subviews>
+                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="skW-NX-VPS">
+                                    <rect key="frame" x="0.0" y="0.0" width="160" height="90"/>
+                                    <color key="backgroundColor" red="0.96470588235294119" green="0.97254901960784312" blue="0.97647058823529409" alpha="1" colorSpace="calibratedRGB"/>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                            <real key="value" value="10"/>
+                                        </userDefinedRuntimeAttribute>
+                                    </userDefinedRuntimeAttributes>
+                                </view>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="image_upload" translatesAutoresizingMaskIntoConstraints="NO" id="s0N-jC-oYR">
-                                    <rect key="frame" x="43.5" y="20" width="33" height="26"/>
+                                    <rect key="frame" x="63.5" y="20" width="33" height="26"/>
                                     <constraints>
                                         <constraint firstAttribute="width" constant="33" id="XlD-eF-Jef"/>
                                         <constraint firstAttribute="height" constant="26" id="xEn-b7-iNE"/>
                                     </constraints>
                                 </imageView>
-                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="点击上传图片" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="L3A-oT-OkP">
-                                    <rect key="frame" x="17" y="56" width="86" height="17"/>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="点击上传直播封面" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="L3A-oT-OkP">
+                                    <rect key="frame" x="23" y="56" width="114.5" height="17"/>
                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                     <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
+                                <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="N23-lQ-fb8">
+                                    <rect key="frame" x="0.0" y="0.0" width="160" height="90"/>
+                                    <color key="backgroundColor" red="0.96470588235294119" green="0.97254901960784312" blue="0.97647058823529409" alpha="1" colorSpace="calibratedRGB"/>
+                                </view>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Fvg-er-LU8">
-                                    <rect key="frame" x="0.0" y="0.0" width="120" height="80"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="160" height="90"/>
                                 </imageView>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fmk-K4-q9T">
-                                    <rect key="frame" x="0.0" y="0.0" width="120" height="80"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="160" height="90"/>
                                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                     <connections>
                                         <action selector="chooseCover:" destination="iN0-l3-epB" eventType="touchUpInside" id="3I0-1t-t3N"/>
                                     </connections>
                                 </button>
                             </subviews>
-                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
+                                <constraint firstAttribute="trailing" secondItem="N23-lQ-fb8" secondAttribute="trailing" id="0Dk-Mx-t6J"/>
                                 <constraint firstItem="Fvg-er-LU8" firstAttribute="leading" secondItem="baO-ER-Xqp" secondAttribute="leading" id="67W-de-5sP"/>
                                 <constraint firstItem="Fvg-er-LU8" firstAttribute="top" secondItem="baO-ER-Xqp" secondAttribute="top" id="6Es-Ir-fRy"/>
                                 <constraint firstAttribute="bottom" secondItem="fmk-K4-q9T" secondAttribute="bottom" id="8pz-qH-sYd"/>
                                 <constraint firstAttribute="trailing" secondItem="Fvg-er-LU8" secondAttribute="trailing" id="9Xc-uG-gaK"/>
-                                <constraint firstAttribute="height" constant="80" id="Ju0-MQ-QQI"/>
+                                <constraint firstAttribute="height" constant="90" id="Ju0-MQ-QQI"/>
                                 <constraint firstItem="s0N-jC-oYR" firstAttribute="top" secondItem="baO-ER-Xqp" secondAttribute="top" constant="20" id="MRx-0E-q0q"/>
+                                <constraint firstAttribute="trailing" secondItem="skW-NX-VPS" secondAttribute="trailing" id="PaJ-LR-1Km"/>
                                 <constraint firstItem="L3A-oT-OkP" firstAttribute="centerX" secondItem="baO-ER-Xqp" secondAttribute="centerX" id="RHf-UG-5lg"/>
+                                <constraint firstItem="N23-lQ-fb8" firstAttribute="top" secondItem="baO-ER-Xqp" secondAttribute="top" id="VRN-Pm-KxY"/>
                                 <constraint firstItem="fmk-K4-q9T" firstAttribute="leading" secondItem="baO-ER-Xqp" secondAttribute="leading" id="W6r-Pu-xUV"/>
+                                <constraint firstItem="skW-NX-VPS" firstAttribute="leading" secondItem="baO-ER-Xqp" secondAttribute="leading" id="Wa8-zU-SvF"/>
                                 <constraint firstItem="s0N-jC-oYR" firstAttribute="centerX" secondItem="baO-ER-Xqp" secondAttribute="centerX" id="b0r-nH-6pc"/>
+                                <constraint firstAttribute="bottom" secondItem="skW-NX-VPS" secondAttribute="bottom" id="drJ-WP-I34"/>
                                 <constraint firstItem="L3A-oT-OkP" firstAttribute="top" secondItem="s0N-jC-oYR" secondAttribute="bottom" constant="10" id="mhx-ZT-ocz"/>
                                 <constraint firstAttribute="bottom" secondItem="Fvg-er-LU8" secondAttribute="bottom" id="nqo-qx-9rZ"/>
+                                <constraint firstItem="N23-lQ-fb8" firstAttribute="leading" secondItem="baO-ER-Xqp" secondAttribute="leading" id="ogw-oG-1IF"/>
                                 <constraint firstItem="fmk-K4-q9T" firstAttribute="top" secondItem="baO-ER-Xqp" secondAttribute="top" id="rVo-s4-I5K"/>
+                                <constraint firstAttribute="bottom" secondItem="N23-lQ-fb8" secondAttribute="bottom" id="srF-sl-yHc"/>
                                 <constraint firstAttribute="trailing" secondItem="fmk-K4-q9T" secondAttribute="trailing" id="uta-7S-faj"/>
-                                <constraint firstAttribute="width" constant="120" id="xZ0-dR-Vca"/>
+                                <constraint firstAttribute="width" constant="160" id="xZ0-dR-Vca"/>
+                                <constraint firstItem="skW-NX-VPS" firstAttribute="top" secondItem="baO-ER-Xqp" secondAttribute="top" id="xr9-7l-B1u"/>
                             </constraints>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
@@ -257,7 +278,7 @@
                     </subviews>
                     <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="140" id="OTU-Yx-213"/>
+                        <constraint firstAttribute="height" constant="160" id="OTU-Yx-213"/>
                         <constraint firstItem="SS1-EL-CQn" firstAttribute="leading" secondItem="eqa-D0-dj4" secondAttribute="leading" constant="12" id="QJT-e2-aQQ"/>
                         <constraint firstItem="baO-ER-Xqp" firstAttribute="leading" secondItem="eqa-D0-dj4" secondAttribute="leading" constant="12" id="SL9-O9-4vH"/>
                         <constraint firstItem="SS1-EL-CQn" firstAttribute="top" secondItem="eqa-D0-dj4" secondAttribute="top" constant="20" id="SMz-fC-FXj"/>
@@ -294,8 +315,9 @@
             <nil key="simulatedBottomBarMetrics"/>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <connections>
-                <outlet property="buttonBgView" destination="baO-ER-Xqp" id="aHu-ce-0wL"/>
+                <outlet property="buttonBgView" destination="skW-NX-VPS" id="5sb-hs-zlS"/>
                 <outlet property="countLabel" destination="K6I-S3-WCn" id="KTW-ST-cYe"/>
+                <outlet property="coverBgView" destination="N23-lQ-fb8" id="R9H-w1-AMo"/>
                 <outlet property="coverImage" destination="Fvg-er-LU8" id="Dap-pE-Nhb"/>
                 <outlet property="inputView" destination="ez8-R7-sTU" id="KkF-CH-6Gx"/>
                 <outlet property="timeLabel" destination="2aF-Cf-b74" id="frD-7s-QWn"/>

+ 3 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/LiveRoomHeadView.h

@@ -7,6 +7,8 @@
 
 #import <UIKit/UIKit.h>
 
+typedef void(^LiveSwitchCameraCallback)(void);
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface LiveRoomHeadView : UIView
@@ -27,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 + (instancetype)shareInstance;
 
+- (void)liveHeaderAction:(LiveSwitchCameraCallback)callback;
 
 @end
 

+ 16 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/LiveRoomHeadView.m

@@ -7,14 +7,29 @@
 
 #import "LiveRoomHeadView.h"
 
-@implementation LiveRoomHeadView
+@interface LiveRoomHeadView ()
+
+@property (nonatomic, copy) LiveSwitchCameraCallback callback;
 
+@end
 
+@implementation LiveRoomHeadView
+
+- (void)liveHeaderAction:(LiveSwitchCameraCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
 + (instancetype)shareInstance {
     LiveRoomHeadView *view = [[[NSBundle mainBundle] loadNibNamed:@"LiveRoomHeadView" owner:nil options:nil] firstObject];
     return view;
 }
 
+- (IBAction)switchCamera:(id)sender {
+    if (self.callback) {
+        self.callback();
+    }
+}
 
 /*
 // Only override drawRect: if you perform custom drawing.

+ 11 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/LiveRoomHeadView.xib

@@ -176,10 +176,20 @@
                         </userDefinedRuntimeAttribute>
                     </userDefinedRuntimeAttributes>
                 </view>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vRv-kX-ZaV">
+                    <rect key="frame" x="286" y="6.5" width="35" height="35"/>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    <state key="normal" image="live_switch"/>
+                    <connections>
+                        <action selector="switchCamera:" destination="iN0-l3-epB" eventType="touchUpInside" id="dLH-X7-w1I"/>
+                    </connections>
+                </button>
             </subviews>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <constraints>
                 <constraint firstItem="2Q6-aH-Lkg" firstAttribute="top" secondItem="Bsy-0e-Kd6" secondAttribute="bottom" constant="4" id="9DL-kc-PFQ"/>
+                <constraint firstItem="vM0-gj-bnG" firstAttribute="leading" secondItem="vRv-kX-ZaV" secondAttribute="trailing" constant="10" id="Aoe-kP-SY0"/>
+                <constraint firstItem="vM0-gj-bnG" firstAttribute="centerY" secondItem="vRv-kX-ZaV" secondAttribute="centerY" id="GQc-SW-iVo"/>
                 <constraint firstItem="2Q6-aH-Lkg" firstAttribute="leading" secondItem="Bsy-0e-Kd6" secondAttribute="leading" id="Qdk-xr-AJa"/>
                 <constraint firstAttribute="trailing" secondItem="vM0-gj-bnG" secondAttribute="trailing" constant="12" id="Sda-ur-z0i"/>
                 <constraint firstItem="RAe-xG-ljz" firstAttribute="top" secondItem="2Q6-aH-Lkg" secondAttribute="bottom" constant="5" id="T9h-lt-Lep"/>
@@ -210,6 +220,7 @@
         <image name="chatroom_member" width="32" height="32"/>
         <image name="like_logo" width="14" height="14"/>
         <image name="live_networking_good" width="20" height="15"/>
+        <image name="live_switch" width="35" height="35"/>
         <image name="user_default_avatal" width="52" height="52"/>
     </resources>
 </document>

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/View/MineFunctionView.m

@@ -43,7 +43,7 @@
                 weakSelf.callback(type);
             }
         }];
-        functionButton.frame = CGRectMake(index % 4 * (space + FUNCTIONVIEW_WIDTH), FUNCTIONVIEW_WIDTH * (index / 4), FUNCTIONVIEW_WIDTH, FUNCTIONVIEW_HEIGHT);
+        functionButton.frame = CGRectMake(space + index % 4 * (space + FUNCTIONVIEW_WIDTH), FUNCTIONVIEW_WIDTH * (index / 4), FUNCTIONVIEW_WIDTH, FUNCTIONVIEW_HEIGHT);
         [self.containerView addSubview:functionButton];
     }
 }

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/View/MineTeachToolView.m

@@ -49,10 +49,10 @@
         }];
         CGRect frame = CGRectZero;
         if (tagHandle) {
-            frame = CGRectMake((index - 1) % 4 * (space + FUNCTIONVIEW_WIDTH), FUNCTIONVIEW_WIDTH * ((index-1) / 4), FUNCTIONVIEW_WIDTH, FUNCTIONVIEW_HEIGHT);
+            frame = CGRectMake(space + (index - 1) % 4 * (space + FUNCTIONVIEW_WIDTH), FUNCTIONVIEW_WIDTH * ((index-1) / 4), FUNCTIONVIEW_WIDTH, FUNCTIONVIEW_HEIGHT);
         }
         else {
-            frame = CGRectMake(index % 4 * (space + FUNCTIONVIEW_WIDTH), FUNCTIONVIEW_WIDTH * (index / 4), FUNCTIONVIEW_WIDTH, FUNCTIONVIEW_HEIGHT);
+            frame = CGRectMake(space + index % 4 * (space + FUNCTIONVIEW_WIDTH), FUNCTIONVIEW_WIDTH * (index / 4), FUNCTIONVIEW_WIDTH, FUNCTIONVIEW_HEIGHT);
         }
         functionButton.frame = frame;
         [self.containerView addSubview:functionButton];