Steven 1 éve
szülő
commit
4b94cf5a28

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

@@ -541,6 +541,8 @@
 		BC38C45F2AFA095D00ABFCC2 /* MineWorksBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC38C44F2AFA095D00ABFCC2 /* MineWorksBottomView.m */; };
 		BC38C4602AFA095D00ABFCC2 /* MineWorksBottomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC38C4502AFA095D00ABFCC2 /* MineWorksBottomView.xib */; };
 		BC38C4632AFA0AA600ABFCC2 /* KSNewGifRefreshFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = BC38C4612AFA0AA600ABFCC2 /* KSNewGifRefreshFooter.m */; };
+		BC38C4982AFA4B9C00ABFCC2 /* KSProgressLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC38C4962AFA4B9B00ABFCC2 /* KSProgressLoadingView.m */; };
+		BC38C4992AFA4B9C00ABFCC2 /* KSProgressLoadingView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC38C4972AFA4B9C00ABFCC2 /* KSProgressLoadingView.xib */; };
 		BC3A4EAB28DAC0CD001C4428 /* ShareLiveDisplayView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3A4EAA28DAC0CD001C4428 /* ShareLiveDisplayView.m */; };
 		BC3A4EAD28DAC0D6001C4428 /* ShareLiveDisplayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC3A4EAC28DAC0D6001C4428 /* ShareLiveDisplayView.xib */; };
 		BC3A4EB128DAE074001C4428 /* KSQRCreateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3A4EB028DAE074001C4428 /* KSQRCreateManager.m */; };
@@ -2114,6 +2116,9 @@
 		BC38C4502AFA095D00ABFCC2 /* MineWorksBottomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MineWorksBottomView.xib; sourceTree = "<group>"; };
 		BC38C4612AFA0AA600ABFCC2 /* KSNewGifRefreshFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSNewGifRefreshFooter.m; sourceTree = "<group>"; };
 		BC38C4622AFA0AA600ABFCC2 /* KSNewGifRefreshFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSNewGifRefreshFooter.h; sourceTree = "<group>"; };
+		BC38C4952AFA4B9900ABFCC2 /* KSProgressLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSProgressLoadingView.h; sourceTree = "<group>"; };
+		BC38C4962AFA4B9B00ABFCC2 /* KSProgressLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSProgressLoadingView.m; sourceTree = "<group>"; };
+		BC38C4972AFA4B9C00ABFCC2 /* KSProgressLoadingView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KSProgressLoadingView.xib; sourceTree = "<group>"; };
 		BC3A4EA928DAC0CD001C4428 /* ShareLiveDisplayView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareLiveDisplayView.h; sourceTree = "<group>"; };
 		BC3A4EAA28DAC0CD001C4428 /* ShareLiveDisplayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareLiveDisplayView.m; sourceTree = "<group>"; };
 		BC3A4EAC28DAC0D6001C4428 /* ShareLiveDisplayView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShareLiveDisplayView.xib; sourceTree = "<group>"; };
@@ -6211,6 +6216,9 @@
 				BC9AA0DB2ABC434900CD954D /* KSCustomLoadingView.xib */,
 				BC9AA0DC2ABC434900CD954D /* KSHudLoagingManager.h */,
 				BC9AA0D92ABC434900CD954D /* KSHudLoagingManager.m */,
+				BC38C4952AFA4B9900ABFCC2 /* KSProgressLoadingView.h */,
+				BC38C4962AFA4B9B00ABFCC2 /* KSProgressLoadingView.m */,
+				BC38C4972AFA4B9C00ABFCC2 /* KSProgressLoadingView.xib */,
 			);
 			path = LoadingManager;
 			sourceTree = "<group>";
@@ -7452,6 +7460,7 @@
 				BC71D265288804CD0010F14B /* img_55.png in Resources */,
 				BC89AC1F2AB08FF500B077AF /* TenantMusicCellView.xib in Resources */,
 				BC71D0FA2881A2420010F14B /* UMSocialSDKResources.bundle in Resources */,
+				BC38C4992AFA4B9C00ABFCC2 /* KSProgressLoadingView.xib in Resources */,
 				BC60E3D2287D592800B05441 /* KSPublicAlertView.xib in Resources */,
 				BC71D269288804CD0010F14B /* img_31.png in Resources */,
 				BC71D25D288804CD0010F14B /* img_47.png in Resources */,
@@ -7728,6 +7737,7 @@
 				BCC0F6AC2A8CDD4000C4EFA4 /* HTTPResult.m in Sources */,
 				BC83A83A2AD2825F0033D48B /* TenantNotiferMessageCell.m in Sources */,
 				277935A027E324A80010E277 /* UIView+TZLayout.m in Sources */,
+				BC38C4982AFA4B9C00ABFCC2 /* KSProgressLoadingView.m in Sources */,
 				BCA3DBBD29014B9800AE1C49 /* TunerForkManager.swift in Sources */,
 				BC38C3EC2AF893B400ABFCC2 /* KSAudioPlayAnimationView.m in Sources */,
 				2779351227E324A50010E277 /* KSNetworkAccessibleManager.m in Sources */,

+ 13 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSHudLoagingManager.h

@@ -8,6 +8,7 @@
 #import <Foundation/Foundation.h>
 #import <MBProgressHUD/MBProgressHUD.h>
 #import "KSCustomLoadingView.h"
+#import "KSProgressLoadingView.h"
 
 #define LOADING_MANAGER ([KSHudLoagingManager shareInstance])
 
@@ -19,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) KSCustomLoadingView *loadingView;
 
+@property (nonatomic, strong) KSProgressLoadingView *progressLoading;
+
 + (instancetype)shareInstance;
 
 - (void)showCustomLoading:(NSString *)text;
@@ -43,7 +46,17 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)KSShowMsg:(NSString *)message inView:(UIView *)displayView promptCompletion:(void(^)(void))promptCompletion;
 // 提示后续操作
 - (void)KSShowMsg:(NSString *)message promptCompletion:(void(^)(void))promptCompletion;
+/// 加载进度loading
+/// - Parameters:
+///   - text: 文本
+///   - progress: 进度比例 0~100
+- (void)showProgressLoading:(NSString *)text progress:(NSInteger)progress;
+
+/// 移除进度loading
+- (void)removeProgressLoading;
 
+// 进度loading后续操作
+- (void)KSShowProgressMsg:(NSString *)message promptCompletion:(void(^)(void))promptCompletion;
 @end
 
 NS_ASSUME_NONNULL_END

+ 34 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSHudLoagingManager.m

@@ -133,4 +133,38 @@
     }
     return _loadingView;
 }
+
+/// 加载进度loading
+/// - Parameters:
+///   - text: 文本
+///   - progress: 进度比例 0~100
+- (void)showProgressLoading:(NSString *)text progress:(NSInteger)progress {
+    dispatch_main_async_safe(^{
+        [self.progressLoading configProgressWithText:text progress:progress];
+        [self.progressLoading showLoadingView];
+    });
+}
+
+/// 移除进度loading
+- (void)removeProgressLoading {
+    dispatch_delay_block(DISPATCH_TIME_NOW, (int64_t)(0.5f * NSEC_PER_SEC), ^{
+        [self.progressLoading hideLoadingView];
+    });
+}
+
+- (void)removeProgressLoadingNoDelay {
+    [self.progressLoading hideLoadingView];
+
+}
+
+// 进度loading后续操作
+- (void)KSShowProgressMsg:(NSString *)message promptCompletion:(void(^)(void))promptCompletion {
+    [self.progressLoading configProgressWithText:message progress:100];
+    
+    dispatch_delay_block(DISPATCH_TIME_NOW, (int64_t)(PROMPT_TIME * NSEC_PER_SEC), ^{
+        [self removeProgressLoadingNoDelay];
+        promptCompletion();
+    });
+
+}
 @end

+ 24 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSProgressLoadingView.h

@@ -0,0 +1,24 @@
+//
+//  KSProgressLoadingView.h
+//  KulexiuSchoolStudent
+//
+//  Created by 王智 on 2023/11/7.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface KSProgressLoadingView : UIView
+
+
++ (instancetype)shareInstance;
+
+- (void)configProgressWithText:(NSString *)tipsMessage progress:(NSInteger)progress;
+
+- (void)showLoadingView;
+
+- (void)hideLoadingView;
+@end
+
+NS_ASSUME_NONNULL_END

+ 89 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSProgressLoadingView.m

@@ -0,0 +1,89 @@
+//
+//  KSProgressLoadingView.m
+//  KulexiuSchoolStudent
+//
+//  Created by 王智 on 2023/11/7.
+//
+
+#import "KSProgressLoadingView.h"
+
+@interface KSProgressLoadingView ()
+@property (weak, nonatomic) IBOutlet UIView *progressView;
+@property (weak, nonatomic) IBOutlet UIImageView *progressFillImage;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageWidth;
+
+@property (weak, nonatomic) IBOutlet UILabel *progressTipsLabel;
+
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leadingSpace;
+
+@property (nonatomic, assign) NSInteger progress;
+
+@end
+
+@implementation KSProgressLoadingView
+
++ (instancetype)shareInstance {
+    KSProgressLoadingView *view = [[[NSBundle mainBundle] loadNibNamed:@"KSProgressLoadingView" owner:nil options:nil] firstObject];
+    return view;
+}
+
+- (void)configProgressWithText:(NSString *)tipsMessage progress:(NSInteger)progress {
+    self.progressTipsLabel.text = tipsMessage;
+    NSInteger space = progress * 1.0 / 100 * 280;
+    self.progress = space;
+    [UIView animateWithDuration:0.3f animations:^{
+        self.leadingSpace.constant = space;
+    }];
+    
+}
+
+- (void)showLoadingView {
+    UIWindow *windows = [NSObject getKeyWindow];
+    [windows addSubview:self];
+    [self mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.top.bottom.mas_equalTo(windows);
+    }];
+}
+
+- (void)hideLoadingView {
+    [self removeFromSuperview];
+}
+
+- (void)setProgress:(NSInteger)progress {
+    _progress = progress;
+    CGFloat width = progress;
+    [self.progressFillImage setImage:[self createGradientImageWithColor:@[HexRGB(0x44F1D0),HexRGB(0x2DC7AA)] rect:CGRectMake(0, 0, width, 8) start:CGPointMake(0.41, 0) end:CGPointMake(0.41, 1)]];
+    self.imageWidth.constant = width;
+}
+
+- (UIImage *)createGradientImageWithColor:(NSArray *)colors rect:(CGRect)rect start:(CGPoint)start end:(CGPoint)end {
+    if (!colors.count || CGRectEqualToRect(rect, CGRectZero)) {
+        return nil;
+    }
+    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
+    
+    gradientLayer.frame = rect;
+    gradientLayer.startPoint = start;
+    gradientLayer.endPoint = end;
+    NSMutableArray *mutColors = [NSMutableArray arrayWithCapacity:colors.count];
+    for (UIColor *color in colors) {
+        [mutColors addObject:(__bridge id)color.CGColor];
+    }
+    gradientLayer.colors = [NSArray arrayWithArray:mutColors];
+    
+    UIGraphicsBeginImageContextWithOptions(gradientLayer.frame.size, gradientLayer.opaque, 0);
+    [gradientLayer renderInContext:UIGraphicsGetCurrentContext()];
+    UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return outputImage;
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 104 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSProgressLoadingView.xib

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" 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="22131"/>
+        <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="KSProgressLoadingView">
+            <rect key="frame" x="0.0" y="0.0" width="695" height="345"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <view alpha="0.71999999999999997" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bF6-xd-1LF">
+                    <rect key="frame" x="189.66666666666663" y="146.66666666666666" width="316" height="52"/>
+                    <color key="backgroundColor" red="0.52941176470588236" green="0.52941176470588236" blue="0.52941176470588236" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="316" id="1wt-uU-3Zy"/>
+                        <constraint firstAttribute="height" constant="52" id="Sx2-oq-9c8"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="26"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SUI-Ti-MzO">
+                    <rect key="frame" x="207.66666666666663" y="166.66666666666666" width="280" height="8"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dij-Zh-MfT">
+                            <rect key="frame" x="0.0" y="0.0" width="0.0" height="8"/>
+                            <constraints>
+                                <constraint firstAttribute="width" id="wgg-ol-s5w"/>
+                            </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="4"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </imageView>
+                    </subviews>
+                    <color key="backgroundColor" red="0.85490196078431369" green="0.85490196078431369" blue="0.85490196078431369" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="280" id="6W3-xW-Afz"/>
+                        <constraint firstItem="dij-Zh-MfT" firstAttribute="leading" secondItem="SUI-Ti-MzO" secondAttribute="leading" id="BFx-PL-EXX"/>
+                        <constraint firstAttribute="height" constant="8" id="Rxe-2I-dzd"/>
+                        <constraint firstAttribute="bottom" secondItem="dij-Zh-MfT" secondAttribute="bottom" id="Tb8-Rw-DUH"/>
+                        <constraint firstItem="dij-Zh-MfT" firstAttribute="top" secondItem="SUI-Ti-MzO" secondAttribute="top" id="w7a-wJ-zNa"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="4"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="progressLoading_bg" translatesAutoresizingMaskIntoConstraints="NO" id="lOs-av-owS">
+                    <rect key="frame" x="231.66666666666663" y="106.66666666666669" width="232" height="52"/>
+                </imageView>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="progress_dot" translatesAutoresizingMaskIntoConstraints="NO" id="tfN-3g-Eip">
+                    <rect key="frame" x="188.66666666666666" y="150.66666666666666" width="38" height="40"/>
+                </imageView>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rev-2X-b5J">
+                    <rect key="frame" x="347.66666666666669" y="210.66666666666666" width="0.0" height="20"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="20" id="heZ-tG-3dI"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <nil key="highlightedColor"/>
+                </label>
+            </subviews>
+            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="tfN-3g-Eip" firstAttribute="centerY" secondItem="SUI-Ti-MzO" secondAttribute="centerY" id="4iR-2i-2iO"/>
+                <constraint firstItem="SUI-Ti-MzO" firstAttribute="top" secondItem="lOs-av-owS" secondAttribute="bottom" constant="8" id="G7Z-PO-jYn"/>
+                <constraint firstItem="SUI-Ti-MzO" firstAttribute="top" secondItem="bF6-xd-1LF" secondAttribute="top" constant="20" id="Krm-0h-8e9"/>
+                <constraint firstItem="Rev-2X-b5J" firstAttribute="top" secondItem="bF6-xd-1LF" secondAttribute="bottom" constant="12" id="NLa-Co-q9p"/>
+                <constraint firstItem="SUI-Ti-MzO" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="P90-9i-wGM"/>
+                <constraint firstItem="bF6-xd-1LF" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Rtl-2b-xtU"/>
+                <constraint firstItem="tfN-3g-Eip" firstAttribute="centerX" secondItem="SUI-Ti-MzO" secondAttribute="leading" id="XYt-JF-0av"/>
+                <constraint firstItem="bF6-xd-1LF" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="eSt-r7-R85"/>
+                <constraint firstItem="lOs-av-owS" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="raj-wp-VON"/>
+                <constraint firstItem="Rev-2X-b5J" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="uHO-oY-pg3"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="imageWidth" destination="wgg-ol-s5w" id="ghk-aM-7Mc"/>
+                <outlet property="leadingSpace" destination="XYt-JF-0av" id="ugO-sL-Iph"/>
+                <outlet property="progressFillImage" destination="dij-Zh-MfT" id="g8N-Be-ems"/>
+                <outlet property="progressTipsLabel" destination="Rev-2X-b5J" id="NRr-kM-4Fg"/>
+                <outlet property="progressView" destination="SUI-Ti-MzO" id="dbn-Ug-C4y"/>
+            </connections>
+            <point key="canvasLocation" x="287.78625954198475" y="-32.74647887323944"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="progressLoading_bg" width="232" height="52"/>
+        <image name="progress_dot" width="38" height="40"/>
+    </resources>
+</document>

+ 45 - 52
KulexiuForStudent/KulexiuForStudent/Common/MediaMerge/AudioMerge/KSMediaMergeView.m

@@ -558,7 +558,7 @@
 - (void)showPublishAlert {
     self.publishAlert = [MusicPublistAlert shareInstance];
     self.publishAlert.musicName.text = [NSString returnNoNullStringWithString:self.songName];
-    [self.publishAlert.musicImage sd_setImageWithURL:[NSURL URLWithString:[self.coverImage getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"pub_music_placeholder"]];
+    [self.publishAlert.musicImage sd_setImageWithURL:[NSURL URLWithString:[self.coverImage getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"music_placeholder"]];
     self.publishAlert.userName.text = [NSString returnNoNullStringWithString:UserDefault(NicknameKey)];
     MJWeakSelf;
     [self.publishAlert chooseAction:^(PUBLISH_ACTION type) {
@@ -588,9 +588,10 @@
             self.mediaManager.maxPhotoNumber = 1;
             self.mediaManager.baseCtrl = [self findViewController];
 
-            self.mediaManager.needCropImage = NO;
+            self.mediaManager.needCropImage = YES;
             MJWeakSelf;
             [self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
+                // 裁剪
                 [weakSelf refreshViewCoverImg:imageArray];
             }];
             [self.mediaManager pushImagePickerController];
@@ -604,7 +605,7 @@
 - (void)updateWithCoverImage:(UIImage *)image {
     NSData *imgData = [UIImage turnsImaegDataByImage:image];
     NSString *fileName = @"musicCoverImg";
-    [UPLOAD_MANAGER configBucketName:@"daya"];
+    [[KSUploadManager shareInstance] configBucketName:@"klx"];
     [[KSUploadManager shareInstance] uploadImage:imgData fileName:fileName successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
         NSString *avatarUrl = [fileUrlArray lastObject];
         self.coverImage = avatarUrl;
@@ -626,23 +627,26 @@
 
 - (void)publishMusic {
     if (self.isVideoPlay) {
-        [LOADING_MANAGER showCustomLoading:@"视频合成中..."];
+        [LOADING_MANAGER showProgressLoading:@"视频合成中" progress:33];
         [KSMediaEditor mixVideoWithRecordAudio:self.recordUrl recordVolume:self.recordPlayer.volume bgAudio:self.bgAudioUrl bgAudioVolume:self.bgPlayer.volume offsetTime:self.offsetTime videoUrlStr:self.videoUrl completion:^(NSString * _Nonnull outPath, BOOL isSuccess, NSString * _Nonnull desc) {
             // 保存文件到指定文件夹
             if (isSuccess) {
                 self.filePath = outPath;
                 MJWeakSelf;
-                [self saveVideoToAsset:outPath isFormal:YES callback:^(NSString *videoUrl) {
-                    [weakSelf saveMusic:YES isFormal:YES fileUrl:videoUrl];
+                [self sendVideoActionWithUrl:outPath isFormal:YES success:^(NSString * _Nonnull uploadVideoUrl) {
+                    [weakSelf saveMusic:YES isFormal:YES fileUrl:uploadVideoUrl];
+
+                } failure:^(NSString * _Nonnull desc) {
+                    
                 }];
             }
             else {
-                [LOADING_MANAGER removeCustomLoading];
+                [LOADING_MANAGER removeProgressLoading];
             }
         }];
     }
     else {
-        [LOADING_MANAGER showCustomLoading:@"音频合成中..."];
+        [LOADING_MANAGER showProgressLoading:@"音频合成中..." progress:33];
         NSInteger realOffsetTime = self.offsetTime;
         [KSMediaEditor mixRecordAudio:self.recordUrl recordVolume:self.recordPlayer.volume bgAudio:self.bgAudioUrl bgAudioVolume:self.bgPlayer.volume offsetTime:realOffsetTime completion:^(NSString * _Nonnull outPath, BOOL isSuccess, NSString * _Nonnull desc) {
             // 保存文件到指定文件夹
@@ -656,7 +660,7 @@
                 }];
             }
             else {
-                [LOADING_MANAGER removeCustomLoading];
+                [LOADING_MANAGER removeProgressLoading];
             }
         }];
     }
@@ -671,21 +675,19 @@
             [self saveMusic:YES isFormal:NO fileUrl:self.remoteVideoUrl needBack:needBack];
         }
         else {
-            [LOADING_MANAGER showCustomLoading:@"正在上传草稿"];
-            [KSMediaEditor mixRecordVideoWithAudio:self.recordUrl recordVolume:1 videoUrlStr:self.videoUrl completion:^(NSString * _Nonnull outPath, BOOL isSuccess, NSString * _Nonnull desc) {
-                if (isSuccess) {
-                    MJWeakSelf;
-                    [self saveVideoToAsset:outPath isFormal:NO callback:^(NSString *videoUrl) {
-                        // 保存草稿
-                        [weakSelf saveMusic:YES isFormal:NO fileUrl:videoUrl needBack:needBack];
-                    }];
-                }
-                else {
-                    [LOADING_MANAGER removeCustomLoading];
-
-                }
+            MJWeakSelf;
+            /*
+            [self saveVideoURLToAsset:self.videoUrl isFormal:NO callback:^(NSString *videoUrl) {
+                // 保存草稿
+                [weakSelf saveMusic:YES isFormal:NO fileUrl:videoUrl needBack:needBack];
+            }];
+             */
+            [self sendVideoActionWithUrlPath:self.videoUrl isFormal:NO success:^(NSString * _Nonnull uploadVideoUrl) {
+                // 保存草稿
+                [weakSelf saveMusic:YES isFormal:NO fileUrl:uploadVideoUrl needBack:needBack];
+            } failure:^(NSString * _Nonnull desc) {
+                [LOADING_MANAGER MBShowAUTOHidingInWindow:@"上传失败"];
             }];
-            
         }
     }
     else {
@@ -868,17 +870,16 @@
     [parm setValue:@(self.originalVolume) forKey:@"originalVolume"];
     [parm setValue:@(self.accompanyVolume) forKey:@"accompanyVolume"];
     self.jsonConfig = [parm mj_JSONString];
-    [LOADING_MANAGER showCustomLoading:@"加载中..."];
+    [LOADING_MANAGER showProgressLoading:@"加载中..." progress:66];
     [KSNetworkingManager saveMusicMessage:KS_POST jsonConfig:self.jsonConfig img:self.coverImage videoUrl:fileUrl accompanyUrl:self.remoteBgAudioUrl desc:self.desc type:type musicPracticeRecordId:self.recordId success:^(NSDictionary * _Nonnull dic) {
-        [LOADING_MANAGER removeCustomLoading];
         if ([dic ks_integerValueForKey:@"code"] == 200) {
             if (isFormal) {
-                [LOADING_MANAGER KSShowMsg:@"发布成功" promptCompletion:^{
+                [LOADING_MANAGER KSShowProgressMsg:@"发布成功" promptCompletion:^{
                     [self removeView];
                 }];
             }
             else {
-                [LOADING_MANAGER KSShowMsg:@"保存成功" promptCompletion:^{
+                [LOADING_MANAGER KSShowProgressMsg:@"保存成功" promptCompletion:^{
                     self.hasModify = NO;
                     if (needBack) {
                         [self removeViewTips:NO];
@@ -887,10 +888,11 @@
             }
         }
         else {
+            [LOADING_MANAGER removeProgressLoading];
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
     } faliure:^(NSError * _Nonnull error) {
-        [LOADING_MANAGER removeCustomLoading];
+        [LOADING_MANAGER removeProgressLoading];
     }];
 }
 
@@ -906,7 +908,7 @@
                 NSLog(@"导出后的视频:%@",[NSString stringWithFormat:@"%.2fM",(CGFloat)outputData.length/(1024*1024)]);
                 // 上传
                 dispatch_main_async_safe(^{
-                    [self sendVideoActionWith:outputPath isFormal:isFormal success:success failure:faliure];
+                    [self sendVideoActionWithUrl:outputPath isFormal:isFormal success:success failure:faliure];
                 });
                 
             } failure:^(NSString *errorMessage, NSError *error) {
@@ -926,23 +928,16 @@
     }
 }
 
-
-- (void)sendVideoActionWith:(NSString *)fileUrl isFormal:(BOOL)isFormal success:(void (^)(NSString * _Nonnull))success failure:(void (^)(NSString * _Nonnull))faliure {
+- (void)sendVideoActionWithUrlPath:(NSURL *)fileUrl isFormal:(BOOL)isFormal success:(void (^)(NSString * _Nonnull uploadVideoUrl))success failure:(void (^)(NSString * _Nonnull desc))faliure {
     NSString *tips = isFormal ? @"正在上传作品" : @"正在上传草稿";
-    [LOADING_MANAGER showCustomLoading:tips];
-    NSData *fileData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:fileUrl]];
+    [LOADING_MANAGER showProgressLoading:tips progress:66];
+    NSData *fileData = [NSData dataWithContentsOfURL:fileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[fileUrl pathExtension]];
-    [UPLOAD_MANAGER configBucketName:@"daya"];
+    [[KSUploadManager shareInstance] configBucketName:@"klx"];
     [[KSUploadManager shareInstance] videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
-        // 显示进度
-        int progress = (int)(bytesWritten / totalBytes * 100);
-        __block NSString *tipsMessage = [NSString stringWithFormat:@"%@\n%d%%",tips,progress];
-        dispatch_main_async_safe(^{
-            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
-        });
+
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
         dispatch_main_async_safe(^{
-            [LOADING_MANAGER removeCustomLoading];
             NSString *fileUrl = [fileUrlArray lastObject];
             success(fileUrl);
         });
@@ -950,33 +945,31 @@
         
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
         dispatch_main_async_safe(^{
-            [LOADING_MANAGER removeCustomLoading];
+            [LOADING_MANAGER removeProgressLoading];
             faliure(descMessaeg);
         });
         
     }];
 }
 
+- (void)sendVideoActionWithUrl:(NSString *)fileUrl isFormal:(BOOL)isFormal success:(void (^)(NSString * _Nonnull uploadVideoUrl))success failure:(void (^)(NSString * _Nonnull desc))faliure {
+    [self sendAudioWithURLPath:[NSURL fileURLWithPath:fileUrl] isFormal:isFormal success:success failure:faliure];
+}
+
 - (void)sendAudioWithURLPath:(NSURL *)fileUrl isFormal:(BOOL)isFormal success:(void(^)(NSString *audioUrl))success failure:(void(^)(NSString *desc))faliure {
     NSString *tips = isFormal ? @"正在上传作品" : @"正在上传草稿";
 
-    [LOADING_MANAGER showCustomLoading:tips];
+    [LOADING_MANAGER showProgressLoading:tips progress:66];
     NSData *fileData = [NSData dataWithContentsOfURL:fileUrl];
     NSString *suffix = [NSString stringWithFormat:@".%@",[fileUrl pathExtension]];
-    [UPLOAD_MANAGER configBucketName:@"daya"];
+    [UPLOAD_MANAGER configBucketName:@"klx"];
     [UPLOAD_MANAGER uploadFile:fileData fileName:@"evaluateAudio" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
-        // 显示进度
-        int progress = (int)(bytesWritten / totalBytes * 100);
-        __block NSString *tipsMessage = [NSString stringWithFormat:@"%@\n%d%%",tips,progress];
-        dispatch_main_async_safe(^{
-            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
-        });
+
     } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
-        [LOADING_MANAGER removeCustomLoading];
         NSString *fileUrl = [fileUrlArray lastObject];
         success(fileUrl);
     } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
-        [LOADING_MANAGER removeCustomLoading];
+        [LOADING_MANAGER removeProgressLoading];
         faliure(descMessaeg);
     }];
     

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Common/MediaMerge/AudioMerge/MusicPublistAlert.m

@@ -28,8 +28,8 @@
     
 //    CAGradientLayer *titleLayer = [UIView createGradientLayerFromColor:HexRGB(0x44C9FF) startPoint:CGPointMake(0, 0.5) endColor:HexRGB(0x259CFE) endPoint:CGPointMake(1, 0.5) bounds:CGRectMake(0, 0, 220, 38)];
 //    [self.sureButton.layer addSublayer:titleLayer];
-//    self.backView.layer.cornerRadius = 4;
-//    self.backView.layer.maskedCorners = kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner;
+    self.backView.layer.cornerRadius = 4;
+    self.backView.layer.maskedCorners = kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner;
 }
 + (instancetype)shareInstance {
     MusicPublistAlert *view = [[[NSBundle mainBundle] loadNibNamed:@"MusicPublistAlert" owner:nil options:nil] firstObject];

+ 6 - 3
KulexiuForStudent/KulexiuForStudent/Module/Mine/Works/Controller/MineWorksViewController.m

@@ -68,7 +68,7 @@
     self.categoryView.titleColorGradientEnabled = YES;
     
     JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
-    lineView.indicatorColor = HexRGB(0x2DC7AA);
+    lineView.indicatorColor = HexRGB(0x1CACF1);
     lineView.indicatorWidth = 16;
     lineView.height = 4;
     lineView.verticalMargin = 5;
@@ -98,8 +98,11 @@
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
-    if (self.listViewArray.count > self.categoryView.selectedIndex) {
-        id value = self.listViewArray[self.categoryView.selectedIndex];
+    [self refreshAllPage];
+}
+
+- (void)refreshAllPage {
+    for (id value in self.listViewArray) {
         if ([value isKindOfClass:[KSJXBodyView class]]) {
             KSJXBodyView *listView = (KSJXBodyView *)value;
             [listView beginFirstRefresh];