瀏覽代碼

取消上传功能完善

Steven 6 月之前
父節點
當前提交
173ccf8c26
共有 16 個文件被更改,包括 344 次插入17 次删除
  1. 18 8
      KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj
  2. 9 1
      KulexiuForStudent/KulexiuForStudent/Common/Base/AccompanyWebView/KSCloudWebManager.m
  3. 6 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.h
  4. 30 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.m
  5. 27 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.xib
  6. 4 0
      KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSHudLoagingManager.h
  7. 16 3
      KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSHudLoagingManager.m
  8. 9 1
      KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m
  9. 9 1
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Feedback/Controller/FeedbackViewController.m
  10. 11 1
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/Controller/AccountDeleteViewController.m
  11. 22 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.h
  12. 69 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.m
  13. 107 0
      KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.xib
  14. 2 2
      KulexiuForStudent/KulexiuForStudent/Module/Widget/Controller/ToneTuningViewController.m
  15. 5 0
      KulexiuForStudent/KulexiuForStudent/ToolKit/KSToolLibrary.framework/Headers/KSUploadManager.h
  16. 二進制
      KulexiuForStudent/KulexiuForStudent/ToolKit/KSToolLibrary.framework/KSToolLibrary

+ 18 - 8
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -306,7 +306,10 @@
 		BC12639F28FF8E7400509E90 /* HomeRecommendMusicView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC12639E28FF8E7400509E90 /* HomeRecommendMusicView.xib */; };
 		BC1D02422C0490AB001F6A94 /* KSMuteTipsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC1D023F2C0490AB001F6A94 /* KSMuteTipsView.xib */; };
 		BC1D02432C0490AB001F6A94 /* KSMuteTipsView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1D02402C0490AB001F6A94 /* KSMuteTipsView.m */; };
-		BC1E28422C76DE640063E0A1 /* CloudAccompanyLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC1E28412C76DE640063E0A1 /* CloudAccompanyLibrary.framework */; };
+		BC1E28492C77151A0063E0A1 /* KSDeleteFailedAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1E28482C77151A0063E0A1 /* KSDeleteFailedAlertView.m */; };
+		BC1E284B2C7715210063E0A1 /* KSDeleteFailedAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC1E284A2C7715210063E0A1 /* KSDeleteFailedAlertView.xib */; };
+		BC1E28542C7839460063E0A1 /* KSToolLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC1E28532C7839460063E0A1 /* KSToolLibrary.framework */; };
+		BC1E28602C783BB70063E0A1 /* CloudAccompanyLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC1E285F2C783BB70063E0A1 /* CloudAccompanyLibrary.framework */; };
 		BC27A06E280FF56C00F91E27 /* AccompanyEvaluateCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC27A06A280FF56B00F91E27 /* AccompanyEvaluateCell.xib */; };
 		BC27A06F280FF56C00F91E27 /* AccompanyStudentEvaCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BC27A06B280FF56C00F91E27 /* AccompanyStudentEvaCell.m */; };
 		BC27A070280FF56C00F91E27 /* AccompanyStudentEvaCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC27A06C280FF56C00F91E27 /* AccompanyStudentEvaCell.xib */; };
@@ -595,7 +598,6 @@
 		BC83A8402AD28AA60033D48B /* TenantNotiferNavView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC83A83F2AD28AA60033D48B /* TenantNotiferNavView.xib */; };
 		BC84183F2AC2D96600D8F90E /* PasswordCheckBodyView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC84183E2AC2D96600D8F90E /* PasswordCheckBodyView.m */; };
 		BC8418412AC2D96C00D8F90E /* PasswordCheckBodyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC8418402AC2D96C00D8F90E /* PasswordCheckBodyView.xib */; };
-		BC85A9DF2C6B5268003C1ABE /* KSToolLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC85A9DD2C6B5268003C1ABE /* KSToolLibrary.framework */; };
 		BC85A9E62C6B570E003C1ABE /* KSRealtimeAnalyzer.m in Sources */ = {isa = PBXBuildFile; fileRef = BC85A9E22C6B570E003C1ABE /* KSRealtimeAnalyzer.m */; };
 		BC85A9E72C6B570E003C1ABE /* KSSpectrumView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC85A9E42C6B570E003C1ABE /* KSSpectrumView.m */; };
 		BC85A9EA2C6B5959003C1ABE /* KSTargetWebSocketManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BC85A9E92C6B5959003C1ABE /* KSTargetWebSocketManager.m */; };
@@ -1507,7 +1509,11 @@
 		BC1D023F2C0490AB001F6A94 /* KSMuteTipsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = KSMuteTipsView.xib; sourceTree = "<group>"; };
 		BC1D02402C0490AB001F6A94 /* KSMuteTipsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSMuteTipsView.m; sourceTree = "<group>"; };
 		BC1D02412C0490AB001F6A94 /* KSMuteTipsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSMuteTipsView.h; sourceTree = "<group>"; };
-		BC1E28412C76DE640063E0A1 /* CloudAccompanyLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CloudAccompanyLibrary.framework; sourceTree = "<group>"; };
+		BC1E28472C77151A0063E0A1 /* KSDeleteFailedAlertView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSDeleteFailedAlertView.h; sourceTree = "<group>"; };
+		BC1E28482C77151A0063E0A1 /* KSDeleteFailedAlertView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KSDeleteFailedAlertView.m; sourceTree = "<group>"; };
+		BC1E284A2C7715210063E0A1 /* KSDeleteFailedAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KSDeleteFailedAlertView.xib; sourceTree = "<group>"; };
+		BC1E28532C7839460063E0A1 /* KSToolLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = KSToolLibrary.framework; sourceTree = "<group>"; };
+		BC1E285F2C783BB70063E0A1 /* CloudAccompanyLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CloudAccompanyLibrary.framework; sourceTree = "<group>"; };
 		BC255E822B29425F00A1FC27 /* SwiftImportHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftImportHeader.h; sourceTree = "<group>"; };
 		BC255E832B29425F00A1FC27 /* WebViewBaseConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewBaseConfig.h; sourceTree = "<group>"; };
 		BC27A068280FF56B00F91E27 /* AccompanyEvaluateCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccompanyEvaluateCell.h; sourceTree = "<group>"; };
@@ -1940,7 +1946,6 @@
 		BC84183D2AC2D96600D8F90E /* PasswordCheckBodyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PasswordCheckBodyView.h; sourceTree = "<group>"; };
 		BC84183E2AC2D96600D8F90E /* PasswordCheckBodyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PasswordCheckBodyView.m; sourceTree = "<group>"; };
 		BC8418402AC2D96C00D8F90E /* PasswordCheckBodyView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PasswordCheckBodyView.xib; sourceTree = "<group>"; };
-		BC85A9DD2C6B5268003C1ABE /* KSToolLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = KSToolLibrary.framework; sourceTree = "<group>"; };
 		BC85A9E12C6B570E003C1ABE /* KSRealtimeAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSRealtimeAnalyzer.h; sourceTree = "<group>"; };
 		BC85A9E22C6B570E003C1ABE /* KSRealtimeAnalyzer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSRealtimeAnalyzer.m; sourceTree = "<group>"; };
 		BC85A9E32C6B570E003C1ABE /* KSSpectrumView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSSpectrumView.h; sourceTree = "<group>"; };
@@ -2486,7 +2491,6 @@
 				BCA1136828A3A5CF007FAFB9 /* Accelerate.framework in Frameworks */,
 				BCFEE1932AD15C0E000E888F /* SoundpipeAudioKit in Frameworks */,
 				BCFEE18D2AD15BD4000E888F /* AudioKitEX in Frameworks */,
-				BC85A9DF2C6B5268003C1ABE /* KSToolLibrary.framework in Frameworks */,
 				BC8B6E152856E20800866917 /* WebKit.framework in Frameworks */,
 				BC8A45CB283DDEA100094BBB /* AVFoundation.framework in Frameworks */,
 				BCD9294F28F8FCA4006793E4 /* AudioKit in Frameworks */,
@@ -2508,8 +2512,9 @@
 				BC71D1002881A2420010F14B /* libWeChatSDK.a in Frameworks */,
 				BC71D0F62881A2420010F14B /* UMRemoteConfig.framework in Frameworks */,
 				BC8A45C5283DDE6D00094BBB /* AudioToolbox.framework in Frameworks */,
+				BC1E28542C7839460063E0A1 /* KSToolLibrary.framework in Frameworks */,
 				BC8A45C3283DDE5C00094BBB /* CoreMIDI.framework in Frameworks */,
-				BC1E28422C76DE640063E0A1 /* CloudAccompanyLibrary.framework in Frameworks */,
+				BC1E28602C783BB70063E0A1 /* CloudAccompanyLibrary.framework in Frameworks */,
 				BC71D0FB2881A2420010F14B /* UShareUI.framework in Frameworks */,
 				BC71D0FD2881A2420010F14B /* libSocialWeChat.a in Frameworks */,
 				7ED0E7B1704A93EF8D10E5E6 /* libPods-KulexiuForStudent.a in Frameworks */,
@@ -4584,8 +4589,8 @@
 				BC00A65F2BB58FDB00231B74 /* LLPhotoBrowse.bundle */,
 				BC00A6602BB58FDC00231B74 /* WMPlayer.bundle */,
 				BC3A55682BAA7B19002E1616 /* KSTunerLibrary.framework */,
-				BC85A9DD2C6B5268003C1ABE /* KSToolLibrary.framework */,
-				BC1E28412C76DE640063E0A1 /* CloudAccompanyLibrary.framework */,
+				BC1E28532C7839460063E0A1 /* KSToolLibrary.framework */,
+				BC1E285F2C783BB70063E0A1 /* CloudAccompanyLibrary.framework */,
 				BC3BF62F2B9EAFC800831494 /* client.p12 */,
 			);
 			path = ToolKit;
@@ -4720,6 +4725,9 @@
 				BC60E3CA287D552800B05441 /* DeleteAccountBodyView.h */,
 				BC60E3C9287D552800B05441 /* DeleteAccountBodyView.m */,
 				BC60E3CB287D552800B05441 /* DeleteAccountBodyView.xib */,
+				BC1E28472C77151A0063E0A1 /* KSDeleteFailedAlertView.h */,
+				BC1E28482C77151A0063E0A1 /* KSDeleteFailedAlertView.m */,
+				BC1E284A2C7715210063E0A1 /* KSDeleteFailedAlertView.xib */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -6325,6 +6333,7 @@
 				BCC583CE28A9EC6400BAB4CF /* cloud_animation_0.png in Resources */,
 				BCFE53ED2812897600AD6786 /* HomeLiveCouseCell.xib in Resources */,
 				BC71D256288804CD0010F14B /* img_14.png in Resources */,
+				BC1E284B2C7715210063E0A1 /* KSDeleteFailedAlertView.xib in Resources */,
 				BC38C3EF2AF893B400ABFCC2 /* KSPlayerSliderView.xib in Resources */,
 				275FA24527E73E0100CFEA2E /* InstrumentDescView.xib in Resources */,
 				BCC583B628A9EC6400BAB4CF /* cloud_animation_20.png in Resources */,
@@ -6871,6 +6880,7 @@
 				BC83A83E2AD28A9F0033D48B /* TenantNotiferNavView.m in Sources */,
 				BC106C032A933829000759A9 /* TXLiveMessageOpenLive.m in Sources */,
 				BCECE2462B3D670500C0D555 /* FeedbackViewController.m in Sources */,
+				BC1E28492C77151A0063E0A1 /* KSDeleteFailedAlertView.m in Sources */,
 				BC2888592A80F7BF0064B773 /* TXIMLinsenter.m in Sources */,
 				BCC0F6D42A8CE1BE00C4EFA4 /* LoginHelper.m in Sources */,
 				275FA23C27E7356B00CFEA2E /* VefiBodyView.m in Sources */,

+ 9 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/AccompanyWebView/KSCloudWebManager.m

@@ -134,9 +134,17 @@
     }];
 }
 
+- (void)removeLoadHud {
+    [LOADING_MANAGER removeCustomLoading];
+}
+
 // 上传
 - (void)uploadFile:(NSString *)uploadFileUrl success:(void (^)(NSString * _Nonnull))success faliure:(void (^)(NSString * _Nonnull))faliure {
-    [LOADING_MANAGER showCustomLoading:@"上传中..."];
+    [LOADING_MANAGER showCancelCustomLoading:@"上传中..." cancel:^{
+        [UPLOAD_MANAGER cancelUploadCallback:^{
+            [self removeLoadHud];
+        }];
+    }];
     NSData *fileData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:uploadFileUrl]];
     NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
     [UPLOAD_MANAGER configWithfilePath:@"/user/"];

+ 6 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.h

@@ -7,10 +7,14 @@
 
 #import <UIKit/UIKit.h>
 
+typedef void(^KSCustomLoadingCancel)(void);
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface KSCustomLoadingView : UIView
 
+@property (nonatomic, assign) BOOL showCancelButton;
+
 + (instancetype)shareInstance;
 
 @property (nonatomic, strong) NSString *displayText;
@@ -19,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)hideLoadingView;
 
+- (void)cancelActionCallback:(KSCustomLoadingCancel)cancel;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 30 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.m

@@ -10,15 +10,22 @@
 
 @interface KSCustomLoadingView ()
 
+@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
+
 @property (weak, nonatomic) IBOutlet UIView *containerView;
 
 @property (weak, nonatomic) IBOutlet UILabel *text;
 
 @property (nonatomic, strong) LOTAnimationView *animationView;
 
+@property (nonatomic, copy) KSCustomLoadingCancel cancelBlock;
+
 @end
 
 @implementation KSCustomLoadingView
+- (void)awakeFromNib {
+    [super awakeFromNib];
+}
 
 + (instancetype)shareInstance {
     KSCustomLoadingView *view = [[[NSBundle mainBundle] loadNibNamed:@"KSCustomLoadingView" owner:nil options:nil] firstObject];
@@ -45,6 +52,18 @@
     [self removeFromSuperview];
 }
 
+- (void)cancelActionCallback:(KSCustomLoadingCancel)cancel {
+    if (cancel) {
+        self.cancelBlock = cancel;
+    }
+}
+
+- (IBAction)cancelAction:(id)sender {
+    if (self.cancelBlock) {
+        self.cancelBlock();
+    }
+}
+
 - (LOTAnimationView *)animationView {
     if (!_animationView) {
         _animationView = [LOTAnimationView animationNamed:@"student_refresh"];
@@ -60,6 +79,17 @@
     self.text.text = displayText;
 }
 
+- (void)setShowCancelButton:(BOOL)showCancelButton {
+    _showCancelButton = showCancelButton;
+    if (showCancelButton) {
+        self.cancelButton.hidden = NO;
+        self.cancelButton.userInteractionEnabled = YES;
+    }
+    else {
+        self.cancelButton.hidden = YES;
+        self.cancelButton.userInteractionEnabled = NO;
+    }
+}
 
 /*
 // Only override drawRect: if you perform custom drawing.

+ 27 - 0
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSCustomLoadingView.xib

@@ -46,9 +46,35 @@
                         </userDefinedRuntimeAttribute>
                     </userDefinedRuntimeAttributes>
                 </view>
+                <button hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aE0-9f-0lL">
+                    <rect key="frame" x="154.66666666666666" y="492" width="84" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="30" id="J5I-g3-IsJ"/>
+                        <constraint firstAttribute="width" constant="84" id="xCn-Eg-EvM"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    <state key="normal" title="取消上传"/>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                            <color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="1"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="15"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                    <connections>
+                        <action selector="cancelAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="Hev-5e-L6Y"/>
+                    </connections>
+                </button>
             </subviews>
             <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="calibratedRGB"/>
             <constraints>
+                <constraint firstItem="aE0-9f-0lL" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="L6x-yj-zuC"/>
+                <constraint firstItem="aE0-9f-0lL" firstAttribute="top" secondItem="Ftd-2r-orp" secondAttribute="bottom" constant="16" id="RcN-QA-1bo"/>
                 <constraint firstItem="Ftd-2r-orp" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="TgS-11-bcY"/>
                 <constraint firstItem="Ftd-2r-orp" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="al5-ls-aaQ"/>
             </constraints>
@@ -56,6 +82,7 @@
             <nil key="simulatedBottomBarMetrics"/>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <connections>
+                <outlet property="cancelButton" destination="aE0-9f-0lL" id="R7k-C5-J5c"/>
                 <outlet property="containerView" destination="2VA-sp-63Q" id="NBh-da-mnS"/>
                 <outlet property="text" destination="jQZ-bq-s4l" id="Dnm-NR-TwV"/>
             </connections>

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

@@ -10,6 +10,8 @@
 #import "KSCustomLoadingView.h"
 #import "KSProgressLoadingView.h"
 
+typedef void(^KSLoadingCancel)(void);
+
 #define LOADING_MANAGER ([KSHudLoagingManager shareInstance])
 
 NS_ASSUME_NONNULL_BEGIN
@@ -26,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)showCustomLoading:(NSString *)text;
 
+- (void)showCancelCustomLoading:(NSString *)text cancel:(KSLoadingCancel)cancel;
+
 - (void)removeCustomLoading;
 
 - (void)showHUD;

+ 16 - 3
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSHudLoagingManager.m

@@ -12,7 +12,6 @@
 
 @interface KSHudLoagingManager ()
 
-
 @end
 
 @implementation KSHudLoagingManager
@@ -28,14 +27,28 @@
 }
 
 - (void)showCustomLoading:(NSString *)text {
-    self.loadingView.displayText = text;
     dispatch_main_async_safe(^{
+        self.loadingView.showCancelButton = NO;
+        self.loadingView.displayText = text;
         [self.loadingView showLoadingView];
     });
 }
 
+- (void)showCancelCustomLoading:(NSString *)text cancel:(KSLoadingCancel)cancel {
+    dispatch_main_async_safe(^{
+        self.loadingView.showCancelButton = YES;
+        self.loadingView.displayText = text;
+        [self.loadingView showLoadingView];
+        [self.loadingView cancelActionCallback:^{
+            cancel();
+        }];
+    });
+}
+
 - (void)removeCustomLoading {
-    [self.loadingView hideLoadingView];
+    dispatch_main_async_safe(^{
+        [self.loadingView hideLoadingView];
+    });
 }
 
 

+ 9 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m

@@ -751,11 +751,19 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
     }];
 }
 
+- (void)removeLoadHud {
+    [LOADING_MANAGER removeCustomLoading];
+}
+
 - (void)videCropImage:(UIImage *)cover content:(NSDictionary *)content {
     NSData *imgData = [UIImage turnsImaegDataByImage:cover];
     NSString *fileName = @"videoCoverImage";
     
-    [LOADING_MANAGER showCustomLoading:@"上传中..."];
+    [LOADING_MANAGER showCancelCustomLoading:@"上传中..." cancel:^{
+        [UPLOAD_MANAGER cancelUploadCallback:^{
+            [self removeLoadHud];
+        }];
+    }];
     [UPLOAD_MANAGER configWithfilePath:@"/user/"];
     [UPLOAD_MANAGER uploadFile:imgData fileName:fileName fileSuffix:[UIImage typeForImageData:imgData] progress:^(int64_t bytesWritten, int64_t totalBytes) {
         // 显示进度

+ 9 - 1
KulexiuForStudent/KulexiuForStudent/Module/Mine/Feedback/Controller/FeedbackViewController.m

@@ -162,13 +162,21 @@
     
 }
 
+- (void)removeLoadHud {
+    [LOADING_MANAGER removeCustomLoading];
+}
+
 - (void)submitWithPhone:(NSString *)phone suggestion:(NSString *)suggession {
     
     if ([NSString isEmptyString:self.feedbackType]) {
         [LOADING_MANAGER MBShowAUTOHidingInWindow:@"请选择反馈类型"];
         return;
     }
-    [LOADING_MANAGER showCustomLoading:@"加载中..."];
+    [LOADING_MANAGER showCancelCustomLoading:@"加载中..." cancel:^{
+        [UPLOAD_MANAGER cancelUploadCallback:^{
+            [self removeLoadHud];
+        }];
+    }];
     if (self.imageArray.count) {
         NSMutableArray *imageDataArray = [NSMutableArray array];
         for (UIImage *image in self.imageArray) {

+ 11 - 1
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/Controller/AccountDeleteViewController.m

@@ -14,6 +14,7 @@
 #import "JPUSHService.h"
 #import "UserInfoManager.h"
 #import "GroupQuitAlert.h"
+#import "KSDeleteFailedAlertView.h"
 
 @interface AccountDeleteViewController ()
 {
@@ -24,6 +25,7 @@
 
 @property (nonatomic, strong) GroupQuitAlert *alertView;
 
+@property (nonatomic, strong) KSDeleteFailedAlertView *failAlert;
 
 @end
 
@@ -66,7 +68,6 @@
         [self veriCheckWithParm:parm];
     }
     else if (action == DELETEACCOUNT_SURE) {
-        
         MJWeakSelf;
         self.alertView = [GroupQuitAlert shareInstance];
         [self.alertView configTitle:@"提示" desc:@"注销账号后您所有的留存信息将被清空且无法恢复,请谨慎操作" callback:^(BOOL isSure) {
@@ -88,6 +89,9 @@
                 [self successDeleteBack];
             }];
         }
+        else if ([dic ks_integerValueForKey:@"code"] == 5201) {
+            [self showFailAlert:@[]];
+        }
         else {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
         }
@@ -96,6 +100,12 @@
     }];
 }
 
+- (void)showFailAlert:(NSArray *)messageList {
+    self.failAlert = [KSDeleteFailedAlertView shareIntance];
+    [self.failAlert configWithSource:messageList];
+    [self.failAlert showAlert];
+}
+
 - (void)successDeleteBack {
 
     [APPLOGIN_MANAGER logoutActionWithMsg:@""];

+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.h

@@ -0,0 +1,22 @@
+//
+//  KSDeleteFailedAlertView.h
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/8/22.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface KSDeleteFailedAlertView : UIView
+
++ (instancetype)shareIntance;
+
+- (void)configWithSource:(NSArray *)messageList;
+
+- (void)showAlert;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 69 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.m

@@ -0,0 +1,69 @@
+//
+//  KSDeleteFailedAlertView.m
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/8/22.
+//
+
+#import "KSDeleteFailedAlertView.h"
+
+@interface KSDeleteFailedAlertView ()
+
+@property (weak, nonatomic) IBOutlet UIView *containerView;
+
+@property (weak, nonatomic) IBOutlet UILabel *descLabel;
+
+@end
+
+@implementation KSDeleteFailedAlertView
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+}
+
++ (instancetype)shareIntance {
+    KSDeleteFailedAlertView *view = [[[NSBundle mainBundle] loadNibNamed:@"KSDeleteFailedAlertView" owner:nil options:nil] firstObject];
+    return view;
+    
+}
+
+- (void)configWithSource:(NSArray *)messageList {
+    NSMutableArray *array = [NSMutableArray array];
+    if (messageList.count == 1) {
+        [array addObject:[messageList lastObject]];
+    }
+    else {
+        for (NSInteger index = 0; index < messageList.count; index++) {
+            NSString *desc = messageList[index];
+            NSString *formatString = [NSString stringWithFormat:@"%zd、%@",(index+1),desc];
+            [array addObject:formatString];
+        }
+    }
+    NSString *newString = [NSString returnNoNullStringWithString:[array componentsJoinedByString:@"\n"]];
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:6];//调整行间距
+    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:newString attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:14.0f],NSForegroundColorAttributeName:HexRGB(0x666666)}];
+    self.descLabel.attributedText = attr;
+}
+
+- (void)showAlert {
+    [[NSObject getKeyWindow] addSubview:self];
+}
+
+- (void)removeAlert {
+    [self removeFromSuperview];
+}
+
+- (IBAction)hideAlert:(id)sender {
+    [self removeAlert];
+}
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 107 - 0
KulexiuForStudent/KulexiuForStudent/Module/Mine/Setting/DeleteAccount/View/KSDeleteFailedAlertView.xib

@@ -0,0 +1,107 @@
+<?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">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
+        <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="KSDeleteFailedAlertView">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A1m-G5-f05">
+                    <rect key="frame" x="44" y="338" width="305" height="176"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="注销失败" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PVB-qM-x6a">
+                            <rect key="frame" x="115.66666666666666" y="20" width="73.666666666666657" height="25"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="25" id="5Ls-7e-acn"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
+                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <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="8w7-2y-inS">
+                            <rect key="frame" x="20" y="65" width="265" height="24"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="24" id="YDH-Mj-MAN"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
+                            <color key="textColor" red="0.95686274509803915" green="0.27058823529411763" blue="0.25490196078431371" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tua-23-XnI">
+                            <rect key="frame" x="20" y="91" width="269" height="0.0"/>
+                            <fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="14"/>
+                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yzR-DS-KGK">
+                            <rect key="frame" x="20" y="116" width="265" height="40"/>
+                            <color key="backgroundColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="40" id="a7o-Kz-WXl"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="我知道了"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="20"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="hideAlert:" destination="iN0-l3-epB" eventType="touchUpInside" id="g9v-BP-Ro6"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="yzR-DS-KGK" secondAttribute="bottom" constant="20" id="6Q3-Fm-JeX"/>
+                        <constraint firstItem="yzR-DS-KGK" firstAttribute="top" secondItem="Tua-23-XnI" secondAttribute="bottom" constant="25" id="Aax-Nx-aK2"/>
+                        <constraint firstItem="8w7-2y-inS" firstAttribute="leading" secondItem="A1m-G5-f05" secondAttribute="leading" constant="20" id="IQa-n3-U97"/>
+                        <constraint firstAttribute="trailing" secondItem="8w7-2y-inS" secondAttribute="trailing" constant="20" id="MlC-Wt-oh8"/>
+                        <constraint firstItem="yzR-DS-KGK" firstAttribute="leading" secondItem="A1m-G5-f05" secondAttribute="leading" constant="20" id="PEA-Sm-aRY"/>
+                        <constraint firstItem="PVB-qM-x6a" firstAttribute="centerX" secondItem="A1m-G5-f05" secondAttribute="centerX" id="RXl-ic-FKV"/>
+                        <constraint firstAttribute="trailing" secondItem="Tua-23-XnI" secondAttribute="trailing" constant="16" id="cKx-or-yGl"/>
+                        <constraint firstItem="Tua-23-XnI" firstAttribute="leading" secondItem="A1m-G5-f05" secondAttribute="leading" constant="20" id="cT0-KC-a7J"/>
+                        <constraint firstItem="PVB-qM-x6a" firstAttribute="top" secondItem="A1m-G5-f05" secondAttribute="top" constant="20" id="dwl-Vf-6pz"/>
+                        <constraint firstItem="Tua-23-XnI" firstAttribute="top" secondItem="8w7-2y-inS" secondAttribute="bottom" constant="2" id="hbF-8k-g9I"/>
+                        <constraint firstItem="8w7-2y-inS" firstAttribute="top" secondItem="PVB-qM-x6a" secondAttribute="bottom" constant="20" id="oai-CY-oS5"/>
+                        <constraint firstAttribute="trailing" secondItem="yzR-DS-KGK" secondAttribute="trailing" constant="20" id="v7L-gE-0Va"/>
+                        <constraint firstAttribute="width" constant="305" id="vZ4-Vt-GoE"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="12"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
+            <gestureRecognizers/>
+            <constraints>
+                <constraint firstItem="A1m-G5-f05" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="3s4-xg-Jf0"/>
+                <constraint firstItem="A1m-G5-f05" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="JEk-Hf-P73"/>
+            </constraints>
+            <nil key="simulatedTopBarMetrics"/>
+            <nil key="simulatedBottomBarMetrics"/>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="containerView" destination="A1m-G5-f05" id="ghD-gs-9dw"/>
+                <outlet property="descLabel" destination="Tua-23-XnI" id="TaP-9q-3WF"/>
+            </connections>
+            <point key="canvasLocation" x="26.717557251908396" y="19.718309859154932"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 2 - 2
KulexiuForStudent/KulexiuForStudent/Module/Widget/Controller/ToneTuningViewController.m

@@ -482,10 +482,10 @@
         self.instrumentPicker = [[KSChoosePicker alloc] initWithTitle:@"" sourceData:self.instrumentArray lastChooseIndex:self.lastChooseIndex sureButtonColor:CLIENT_THEMECOLOR chooseReturnWithBlock:^(NSString * _Nonnull returnValue, NSInteger chooseIndex) {
             weakSelf.lastChooseIndex = chooseIndex;
             weakSelf.settingView.instrumentLabel.text = returnValue;
-            NSInteger pitchRate = [self.picthRateArray[chooseIndex] integerValue];
+            NSInteger pitchRate = [weakSelf.picthRateArray[chooseIndex] integerValue];
             weakSelf.A4Frequence = frequence;
             weakSelf.settingView.toneChangeRate = pitchRate;
-            weakSelf.settingView.transferPicthDesc = self.picthDescArray[chooseIndex];
+            weakSelf.settingView.transferPicthDesc = weakSelf.picthDescArray[chooseIndex];
         } cancel:^{
             
         }];

+ 5 - 0
KulexiuForStudent/KulexiuForStudent/ToolKit/KSToolLibrary.framework/Headers/KSUploadManager.h

@@ -11,6 +11,8 @@ typedef void(^KSUploadSuccess)(NSMutableArray * _Nonnull fileUrlArray);
 typedef void(^KSUploadFailer)(NSError * _Nullable error, NSString * _Nullable descMessaeg);
 typedef void(^KSUploadProgress)(int64_t bytesWritten,int64_t totalBytes);
 
+typedef void(^KSUploadCancel)(void);
+
 #define UPLOAD_MANAGER ([KSUploadManager shareInstance])
 
 @protocol KSUploadManagerDelegate <NSObject>
@@ -41,6 +43,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)uploadFile:(NSData *)fileData fileName:(NSString *)fileName fileSuffix:(NSString *)fileSuffix progress:(KSUploadProgress)uploadProgress successCallback:(KSUploadSuccess)success faliure:(KSUploadFailer)faliure;
 
+// 取消上传
+- (void)cancelUploadCallback:(KSUploadCancel)cancal;
+
 @end
 
 NS_ASSUME_NONNULL_END

二進制
KulexiuForStudent/KulexiuForStudent/ToolKit/KSToolLibrary.framework/KSToolLibrary