Explorar el Código

1.调音器动效。
2.结算功能。

Steven hace 1 año
padre
commit
5d28ba7eed
Se han modificado 27 ficheros con 497 adiciones y 115 borrados
  1. 3 3
      KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj
  2. 22 0
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/CardBind/withdraw_tips.imageset/Contents.json
  3. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/CardBind/withdraw_tips.imageset/withdraw_tips@2x.png
  4. BIN
      KulexiuForTeacher/KulexiuForTeacher/Assets.xcassets/Mine/CardBind/withdraw_tips.imageset/withdraw_tips@3x.png
  5. 1 1
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNetworkingManager.m
  6. 41 28
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSVideoRecordManager.m
  7. 38 12
      KulexiuForTeacher/KulexiuForTeacher/Common/Define/PrefixHeader.pch
  8. 1 3
      KulexiuForTeacher/KulexiuForTeacher/Common/Tools/Extension/UIImage+Color.m
  9. 141 29
      KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/Controller/WithdrawViewController.m
  10. 17 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/View/WithdrawBodyView.h
  11. 36 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/View/WithdrawBodyView.m
  12. 149 21
      KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/View/WithdrawBodyView.xib
  13. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/Controller/BandCardViewController.h
  14. 6 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/Controller/BandCardViewController.m
  15. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/CardBandBodyView.m
  16. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/KSConfirmAlertView.h
  17. 9 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/KSConfirmAlertView.m
  18. 4 2
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/KSConfirmAlertView.xib
  19. 6 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/Controller/MineViewController.m
  20. 2 0
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/View/MineBottomView.h
  21. 3 2
      KulexiuForTeacher/KulexiuForTeacher/Module/Mine/View/MineBottomView.xib
  22. 1 0
      KulexiuForTeacher/KulexiuForTeacher/Module/TXLiveModule/Controller/TXLiveRoomViewController.m
  23. 3 3
      KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Controller/ToneTuningViewController.m
  24. 3 1
      KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Model/TuningFunction/Tuner.swift
  25. 3 3
      KulexiuForTeacher/KulexiuForTeacher/Module/Widget/View/KSGaugeView/KSGaugeView.m
  26. 2 2
      KulexiuForTeacher/KulexiuForTeacher/Module/Widget/View/WMGaugeView/WMGaugeView.m
  27. 0 1
      KulexiuForTeacher/KulexiuForTeacher/Module/beat/KSCloudBeatView.m

+ 3 - 3
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -6358,12 +6358,12 @@
 		BC5E4AE8291E5E26001BBCD2 /* KSGaugeView */ = {
 			isa = PBXGroup;
 			children = (
-				BC5E4AE9291E5E26001BBCD2 /* KSGaugeView.h */,
 				BC5E4AEA291E5E26001BBCD2 /* KSGaugeColorView.h */,
-				BC5E4AEB291E5E26001BBCD2 /* KSGaugeSectorView.h */,
-				BC5E4AEC291E5E26001BBCD2 /* KSGaugeView.m */,
 				BC5E4AED291E5E26001BBCD2 /* KSGaugeColorView.m */,
+				BC5E4AEB291E5E26001BBCD2 /* KSGaugeSectorView.h */,
 				BC5E4AEE291E5E26001BBCD2 /* KSGaugeSectorView.m */,
+				BC5E4AE9291E5E26001BBCD2 /* KSGaugeView.h */,
+				BC5E4AEC291E5E26001BBCD2 /* KSGaugeView.m */,
 			);
 			path = KSGaugeView;
 			sourceTree = "<group>";

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

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

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


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


+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNetworkingManager.m

@@ -1935,7 +1935,7 @@
 /// @param success 成功
 /// @param faliure 失败
 + (void)checkContractSignRequest:(NSString *)get contractType:(NSString *)contractType success:(void(^)(NSDictionary *dic))success faliure:(void(^)(NSError *error))faliure {
-    NSString *url = [NSString stringWithFormat:@"%@%@", hostURL, @"/api-teacher/sysUserContractRecord/checkContractSign"];
+    NSString *url = [NSString stringWithFormat:@"%@%@", hostURL, @"/api-teacher/sysUserContractRecord/checkContractSignV2"];
     NSMutableDictionary *parm = [NSMutableDictionary dictionary];
     [parm setValue:contractType forKey:@"contractType"];
     [self request:get andWithUrl:url and:parm success:success faliure:faliure];

+ 41 - 28
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSVideoRecordManager.m

@@ -45,6 +45,7 @@
 
 @property (nonatomic, strong) dispatch_queue_t videoRecordQueue;
 
+@property (nonatomic, assign) BOOL isChangeSession;
 
 @end
 
@@ -167,34 +168,42 @@
 }
 
 - (void)resetSession {
-    if (_ignoreAudio == NO) {
-        [_captureSession beginConfiguration];
-        if (_audioCaptureDeviceInput) {
-            [_captureSession removeInput:_audioCaptureDeviceInput];
-        }
-        
-        NSError *error = nil;
-        // 获取音频输入对象
-        AVCaptureDevice *audioCaptureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];
-        _audioCaptureDeviceInput = [[AVCaptureDeviceInput alloc] initWithDevice:audioCaptureDevice error:&error];
-        if (error) {
-            if (self.callback) {
-                self.callback(NO, @"获取音频设备输入出错!");
+    if ([_captureSession isRunning]) {
+        if (_ignoreAudio == NO) {
+            [_captureSession beginConfiguration];
+            self.isChangeSession = YES;
+
+            if (_audioCaptureDeviceInput) {
+                [_captureSession removeInput:_audioCaptureDeviceInput];
             }
-            return;
-        }
-        if ([_captureSession canAddInput:_audioCaptureDeviceInput]) {
-            [_captureSession addInput:_audioCaptureDeviceInput];
-        }
-        else {
-            if (self.callback) {
-                self.callback(NO, @"麦克风被占用!");
+            
+            NSError *error = nil;
+            // 获取音频输入对象
+            AVCaptureDevice *audioCaptureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];
+            _audioCaptureDeviceInput = [[AVCaptureDeviceInput alloc] initWithDevice:audioCaptureDevice error:&error];
+            if (error) {
+                if (self.callback) {
+                    self.callback(NO, @"获取音频设备输入出错!");
+                }
+                return;
+            }
+            if ([_captureSession canAddInput:_audioCaptureDeviceInput]) {
+                [_captureSession addInput:_audioCaptureDeviceInput];
+            }
+            else {
+                if (self.callback) {
+                    self.callback(NO, @"麦克风被占用!");
+                }
             }
+            
+            [_captureSession commitConfiguration];
+            self.isChangeSession = NO;
+
         }
-        
-        [_captureSession commitConfiguration];
     }
-    [self startSession];
+    else {
+        [self startSession];
+    }
 }
 
 
@@ -209,7 +218,7 @@
 }
 
 - (void)stopSession {
-    if (_captureSession) {
+    if (_captureSession && _isChangeSession == NO) {
         @weakObj(self);
         dispatch_async(self.videoRecordQueue, ^{
             @strongObj(self);
@@ -391,10 +400,14 @@
 }
 
 - (void)clearVideoFile {
-    if (self.videoFileURL) {
-        [self removeVideoWithPath:self.videoFileURL.path];
-        self.videoFileURL = nil;
+    if (_isRecording) {
+        return;
+    }
+    NSURL *fileUrl = [NSURL fileURLWithPath:[self getRecordFilePath]];
+    if (fileUrl) {
+        [self removeVideoWithPath:fileUrl.path];
     }
+    self.videoFileURL = nil;
 }
 
 // 上传视频

+ 38 - 12
KulexiuForTeacher/KulexiuForTeacher/Common/Define/PrefixHeader.pch

@@ -113,22 +113,48 @@ shouldPrevent = NO; \
         dispatch_sync(dispatch_get_main_queue(), block);\
     }
 
-//1. 测试且 ARC 环境
+/**
+ Synthsize a weak or strong reference.
+ 
+ Example:
+    @weakObj(self)
+    [self doSomething^{
+        @strongObj(self)
+        if (!self) return;
+        ...
+    }];
+
+ */
 #ifndef weakObj
-#define weakObj(object) autoreleasepool {} __weak __typeof__(object) object##_##weak_ = object;
+    #if DEBUG
+        #if __has_feature(objc_arc)
+        #define weakObj(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
+        #else
+        #define weakObj(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
+        #endif
+    #else
+        #if __has_feature(objc_arc)
+        #define weakObj(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
+        #else
+        #define weakObj(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
+        #endif
+    #endif
 #endif
 
 #ifndef strongObj
-#define strongObj(object) autoreleasepool {} __typeof__(object) object = object##_##weak_;
-#endif
-
-//2. 正式且 ARC 环境
-#ifndef weakObj
-#define weakObj(object) try {} @catch (...){} __weak __typeof__(object) object##_##weak_ = object;
-#endif
-
-#ifndef strongObj
-#define strongObj(object) try {} @catch (...){} __typeof__(object) object = object##_##weak_;
+    #if DEBUG
+        #if __has_feature(objc_arc)
+        #define strongObj(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
+        #else
+        #define strongObj(object) autoreleasepool{} __typeof__(object) object = block##_##object;
+        #endif
+    #else
+        #if __has_feature(objc_arc)
+        #define strongObj(object) try{} @finally{} __typeof__(object) object = weak##_##object;
+        #else
+        #define strongObj(object) try{} @finally{} __typeof__(object) object = block##_##object;
+        #endif
+    #endif
 #endif
 
 

+ 1 - 3
KulexiuForTeacher/KulexiuForTeacher/Common/Tools/Extension/UIImage+Color.m

@@ -11,9 +11,7 @@
 @implementation UIImage (Color)
 
 + (UIImage *)imageWithColor:(UIColor *)color {
-    if (self.size.width <= 0 || self.size.height <= 0) {
-        return nil;
-    }
+    
     CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
     UIGraphicsBeginImageContext(rect.size);
     CGContextRef context = UIGraphicsGetCurrentContext();

+ 141 - 29
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/Controller/WithdrawViewController.m

@@ -13,6 +13,13 @@
 #import "KSConfirmAlertView.h"
 #import "WithdrawApplyViewController.h"
 #import "KSBaseWKWebViewController.h"
+#import "MyBankCardViewController.h"
+
+typedef NS_ENUM(NSInteger, SIGN_STATUS) {
+    SIGN_STATUS_NOTSIGN,   // 未签署
+    SIGN_STATUS_ING,       // 协议签署中
+    SIGN_STATUS_SUCCESS,   // 签署成功
+};
 
 @interface WithdrawViewController ()
 
@@ -24,9 +31,41 @@
 
 @property (nonatomic, strong) WithdrawModel *drawModel;
 
+@property (nonatomic, strong) KSConfirmAlertView *alertView;
+
+@property (nonatomic, strong) NSString *signStatusString;
+
+@property (nonatomic, assign) SIGN_STATUS signType;
+
 @end
 
 @implementation WithdrawViewController
+- (void)setSignStatusString:(NSString *)signStatusString {
+//    signStatusString = @"DOING";
+    _signStatusString = signStatusString;
+    if ([signStatusString isEqualToString:@"NOT_SIGN"]) {
+        self.signType = SIGN_STATUS_NOTSIGN;
+    }
+    else if ([signStatusString isEqualToString:@"DOING"]) {
+        self.signType = SIGN_STATUS_ING;
+        [self refreshSignStatus];
+    }
+    else if ([signStatusString isEqualToString:@"SUCCESS"]){
+        self.signType = SIGN_STATUS_SUCCESS;
+    }
+    else {
+        self.signType = SIGN_STATUS_NOTSIGN;
+    }
+}
+
+- (void)refreshSignStatus {
+    @weakObj(self);
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        @strongObj(self)
+        [self checkSighMessage];
+    });
+}
+
 
 - (void)viewDidLoad {
     [super viewDidLoad];
@@ -38,21 +77,13 @@
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [self checkSighMessage];
+    [self requestData];
 }
 
 - (void)checkSighMessage {
     [KSNetworkingManager checkContractSignRequest:KS_GET contractType:@"WITHDRAW" success:^(NSDictionary * _Nonnull dic) {
         if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
-            BOOL hasSign = [dic ks_boolValueForKey:@"data"];
-            if (hasSign == NO) { // 未实名
-                [self showSignAlert];
-            }
-            else {
-                [self requestData];
-            }
-        }
-        else {
-            
+            self.signStatusString = [dic ks_stringValueForKey:@"data"];
         }
     } faliure:^(NSError * _Nonnull error) {
         
@@ -60,15 +91,16 @@
 }
 
 - (void)showSignAlert {
-    KSConfirmAlertView *alert = [KSConfirmAlertView shareInstance];
-    [alert configWithTitle:@"协议签署" subTitle:@"您需要先签署协议才能结算"];
+    self.alertView = [KSConfirmAlertView shareInstance];
+    [self.alertView configWithTitle:@"签署协议" subTitle:@"您暂未签署协议,请签署后结算"];
+    [self.alertView configLeftTitle:@"取消" rightTitle:@"去签署"];
     MJWeakSelf;
-    [alert opreationSure:^{
+    [self.alertView opreationSure:^{
         [weakSelf showWebView];
     } cancel:^{
-        [weakSelf backAction];
+//        [weakSelf backAction];
     }];
-    [alert showAlert];
+    [self.alertView showAlert];
 }
 
 - (void)showWebView {
@@ -98,37 +130,84 @@
     self.bodyView.amount = self.drawModel.amountWithdrawal;
     NSString *descAmout = [NSString formatMoneyDoubleNum:self.drawModel.amountWithdrawal];
     self.bodyView.availableAmoutLabel.text = [NSString returnNoNullStringWithString:[NSString stringWithFormat:@"可结算余额 ¥%@",descAmout]];
+    [self configBandCard];
+}
+
+- (void)configBandCard {
     if (![NSString isEmptyString:self.drawModel.userBankCard.bankCard]) {
+        self.bodyView.cardDesc.text = [NSString returnNoNullStringWithString:self.drawModel.userBankCard.bankName];
+
         NSString *cardNumber = self.drawModel.userBankCard.bankCard;
+        NSString *cardNumDesc = @"";
         if (cardNumber.length > 4) {
-            self.bodyView.cardDesc.text = [NSString stringWithFormat:@"%@(****%@)",[NSString returnNoNullStringWithString:self.drawModel.userBankCard.bankName],[cardNumber substringFromIndex:cardNumber.length - 4]];
+            cardNumDesc = [NSString stringWithFormat:@"**** **** **** %@",[cardNumber substringFromIndex:cardNumber.length - 4]];
         }
         else {
-            self.bodyView.cardDesc.text = @"银行卡信息错误";
+            cardNumDesc = [NSString stringWithFormat:@"**** **** **** %@",cardNumber];
         }
+        [self.bodyView.cardBindButton setTitle:@"去换绑" forState:UIControlStateNormal];
+        [self.bodyView configCardNum:cardNumDesc];
     }
     else {
         self.bodyView.cardDesc.text = @"您未绑定银行卡";
-        [self showBandCardAlert];
+        [self.bodyView.cardBindButton setTitle:@"去绑卡" forState:UIControlStateNormal];
+        [self.bodyView configCardNum:@""];
     }
 }
 
 - (void)configUIDisplay {
-    [self.scrollView removeFromSuperview];
     [self rightButtonTitle:@"结算记录"];
     self.bodyView = [WithdrawBodyView shareInstance];
-    [self.view addSubview:self.bodyView];
+    [self.scrollView addSubview:self.bodyView];
+    CGFloat height = [WithdrawBodyView getViewHeight];
     [self.bodyView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.edges.mas_equalTo(self.view);
+        make.left.right.mas_equalTo(self.view);
+        make.top.mas_equalTo(self.scrollView.mas_top);
+        make.top.mas_equalTo(self.scrollView.mas_bottom);
+        make.height.mas_equalTo(height);
     }];
     MJWeakSelf;
-    [self.bodyView withdrawSureCallback:^(NSString *amountString) {
-        [weakSelf submitAction:amountString];
+    [self.bodyView withdrawSureCallback:^(WITHDRAW_TYPE type, NSString * _Nullable amountString) {
+        [weakSelf withdrawAction:type amount:amountString];
     }];
+
 }
 
+- (void)withdrawAction:(WITHDRAW_TYPE)type amount:(NSString *)amountString {
+    switch (type) {
+        case WITHDRAW_TYPE_SIGN:
+        {
+            [self showWebView];
+        }
+            break;
+        case WITHDRAW_TYPE_CARD:
+        {
+            if (self.drawModel.userBankCard.bankCard == nil) {
+                [self bandCard];
+            }
+            else {
+                MyBankCardViewController *ctrl = [[MyBankCardViewController alloc] init];
+                [self.navigationController pushViewController:ctrl animated:YES];
+            }
+        }
+            break;
+        case WITHDRAW_TYPE_SURE:
+        {
+            [self submitAction:amountString];
+        }
+            break;
+        default:
+            break;
+    }
+}
+
+
 - (void)submitAction:(NSString *)amountString {
-    if (self.drawModel.userBankCard == nil) {
+    if (self.signType != SIGN_STATUS_SUCCESS) {
+        [self showSignAlert];
+        return;
+    }
+    if (self.drawModel.userBankCard.bankCard == nil) {
         [self showBandCardAlert];
         return;
     }
@@ -163,21 +242,24 @@
 
 
 - (void)showBandCardAlert {
-    KSConfirmAlertView *alert = [KSConfirmAlertView shareInstance];
-    [alert configWithTitle:@"绑定银行卡" subTitle:@"您需要先绑定银行卡后才能结算"];
+    self.alertView = [KSConfirmAlertView shareInstance];
+    [self.alertView configWithTitle:@"绑定银行卡" subTitle:@"您暂未绑定银行卡,请绑定后结算"];
+    [self.alertView configLeftTitle:@"取消" rightTitle:@"去绑定"];
+
     MJWeakSelf;
-    [alert opreationSure:^{
+    [self.alertView opreationSure:^{
         [weakSelf bandCard];
     } cancel:^{
-        [weakSelf backAction];
+//        [weakSelf backAction];
     }];
-    [alert showAlert];
+    [self.alertView showAlert];
 }
 
 
 
 - (void)bandCard {
     BandCardViewController *ctrl = [[BandCardViewController alloc] init];
+    ctrl.isFromDrawPage = YES;
     [self.navigationController pushViewController:ctrl animated:YES];
 }
 
@@ -186,6 +268,36 @@
     [self.navigationController pushViewController:recordCtrl animated:YES];
 }
 
+- (void)setSignType:(SIGN_STATUS)signType {
+    _signType = signType;
+    switch (signType) {
+        case SIGN_STATUS_SUCCESS:
+        {
+            self.bodyView.signDesc.text = @"已签署";
+            self.bodyView.signDesc.textColor = THEMECOLOR;
+        }
+            break;
+        case SIGN_STATUS_ING:
+        {
+            self.bodyView.signDesc.text = @"签署中";
+            self.bodyView.signDesc.textColor = HexRGB(0x666666);
+
+        }
+            break;
+        case SIGN_STATUS_NOTSIGN:
+        {
+            self.bodyView.signDesc.text = @"待签署";
+            self.bodyView.signDesc.textColor = HexRGB(0x666666);
+        }
+        default:
+            break;
+    }
+}
+
+- (void)dealloc {
+    NSLog(@"----------");
+}
+
 /*
  #pragma mark - Navigation
  

+ 17 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/View/WithdrawBodyView.h

@@ -7,16 +7,28 @@
 
 #import <UIKit/UIKit.h>
 
-typedef void(^WithdrawCallback)(NSString * _Nullable amountString);
+typedef NS_ENUM(NSInteger, WITHDRAW_TYPE) {
+    WITHDRAW_TYPE_SIGN,  // 协议
+    WITHDRAW_TYPE_CARD,  // 绑卡
+    WITHDRAW_TYPE_SURE,  // 确定
+};
+
+typedef void(^WithdrawCallback)(WITHDRAW_TYPE type, NSString * _Nullable amountString);
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface WithdrawBodyView : UIView
 
+@property (weak, nonatomic) IBOutlet UIButton *cardBindButton;
+
+@property (weak, nonatomic) IBOutlet UILabel *signDesc;
+
 @property (weak, nonatomic) IBOutlet UILabel *descLabel;
 
 @property (weak, nonatomic) IBOutlet UILabel *cardDesc;
 
+@property (weak, nonatomic) IBOutlet UILabel *cardNumLabel;
+
 @property (weak, nonatomic) IBOutlet UILabel *availableAmoutLabel;
 
 @property (weak, nonatomic) IBOutlet UITextField *amountField;
@@ -27,6 +39,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)withdrawSureCallback:(WithdrawCallback)callback;
 
+- (void)configCardNum:(NSString *)cardNum;
+
++ (CGFloat)getViewHeight;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 36 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/View/WithdrawBodyView.m

@@ -15,6 +15,10 @@
 
 @property (weak, nonatomic) IBOutlet UIView *backView;
 
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cardNumHeight;
+
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cardNumTop;
+
 @end
 
 @implementation WithdrawBodyView
@@ -28,6 +32,7 @@
     gradientLayer.frame = CGRectMake(0, 0, (KPortraitWidth - 28), 37);
     [self.backView.layer addSublayer:gradientLayer];
     self.amountField.delegate = self;
+    self.amountField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入金额" attributes:@{NSForegroundColorAttributeName:HexRGB(0xCCCCCC), NSFontAttributeName:[UIFont systemFontOfSize:26 weight:UIFontWeightMedium]}];
 }
 
 + (instancetype)shareInstance {
@@ -41,6 +46,18 @@
     }
 }
 
+- (void)configCardNum:(NSString *)cardNum {
+    if ([NSString isEmptyString:cardNum]) {
+        self.cardNumHeight.constant = 0;
+        self.cardNumTop.constant = 0;
+    }
+    else {
+        self.cardNumHeight.constant = 28;
+        self.cardNumTop.constant = 10;
+    }
+    self.cardNumLabel.text = [NSString returnNoNullStringWithString:cardNum];
+}
+
 - (IBAction)allWithdrawAction:(id)sender {
     [self endEditing:YES];
     self.amountField.text = [NSString stringWithFormat:@"%.2f",self.amount];
@@ -49,7 +66,21 @@
 - (IBAction)submitAction:(id)sender {
     [self endEditing:YES];
     if (self.callback) {
-        self.callback(self.amountField.text);
+        self.callback(WITHDRAW_TYPE_SURE,self.amountField.text);
+    }
+}
+
+- (IBAction)protocalAction:(id)sender {
+    [self endEditing:YES];
+    if (self.callback) {
+        self.callback(WITHDRAW_TYPE_SIGN, nil);
+    }
+}
+
+- (IBAction)cardBindAction:(id)sender {
+    [self endEditing:YES];
+    if (self.callback) {
+        self.callback(WITHDRAW_TYPE_CARD, nil);
     }
 }
 
@@ -128,6 +159,10 @@
     }
     return YES;
 }
+
++ (CGFloat)getViewHeight {
+    return 570.0f;
+}
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.

+ 149 - 21
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/WithDraw/View/WithdrawBodyView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<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_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -11,11 +11,11 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="WithdrawBodyView">
-            <rect key="frame" x="0.0" y="0.0" width="394" height="440"/>
+            <rect key="frame" x="0.0" y="0.0" width="394" height="570"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YF6-BH-p4o">
-                    <rect key="frame" x="14" y="10" width="366" height="117"/>
+                    <rect key="frame" x="14" y="116" width="366" height="142"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="到账银行卡" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ftz-jG-0oB">
                             <rect key="frame" x="12" y="12" width="82" height="22"/>
@@ -23,7 +23,7 @@
                                 <constraint firstAttribute="height" constant="22" id="YHY-1t-4VD"/>
                             </constraints>
                             <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.89803921568627454" colorSpace="calibratedRGB"/>
+                            <color key="textColor" red="0.46666666666666667" green="0.46666666666666667" blue="0.46666666666666667" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="card_icon" translatesAutoresizingMaskIntoConstraints="NO" id="FoF-7R-YW8">
@@ -34,12 +34,42 @@
                             </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="p4E-43-dK7">
-                            <rect key="frame" x="47" y="53" width="309" height="22"/>
+                            <rect key="frame" x="47" y="53" width="0.0" height="22"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="22" id="r8J-vA-TTv"/>
                             </constraints>
-                            <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.89803921568627454" colorSpace="calibratedRGB"/>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
+                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LFP-PV-umP">
+                            <rect key="frame" x="290" y="50" width="64" height="28"/>
+                            <color key="backgroundColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="64" id="FpK-og-rcu"/>
+                                <constraint firstAttribute="height" constant="28" id="aq6-7i-t0A"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="去换绑">
+                                <color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                            </state>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="14"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="cardBindAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="SlJ-60-zIX"/>
+                            </connections>
+                        </button>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jn1-Ck-lEi">
+                            <rect key="frame" x="12" y="89" width="342" height="28"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="28" id="iaR-cU-pSe"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="20"/>
+                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                     </subviews>
@@ -47,12 +77,17 @@
                     <constraints>
                         <constraint firstItem="p4E-43-dK7" firstAttribute="leading" secondItem="FoF-7R-YW8" secondAttribute="trailing" constant="7" id="1kb-nw-JeJ"/>
                         <constraint firstItem="p4E-43-dK7" firstAttribute="centerY" secondItem="FoF-7R-YW8" secondAttribute="centerY" id="1wj-je-viU"/>
-                        <constraint firstAttribute="height" constant="117" id="7Ez-gj-2My"/>
                         <constraint firstItem="ftz-jG-0oB" firstAttribute="top" secondItem="YF6-BH-p4o" secondAttribute="top" constant="12" id="GMj-YB-Y3t"/>
                         <constraint firstItem="FoF-7R-YW8" firstAttribute="top" secondItem="ftz-jG-0oB" secondAttribute="bottom" constant="15" id="HBE-Dh-XiM"/>
-                        <constraint firstAttribute="trailing" secondItem="p4E-43-dK7" secondAttribute="trailing" constant="10" id="g1Q-M2-h23"/>
+                        <constraint firstAttribute="trailing" secondItem="LFP-PV-umP" secondAttribute="trailing" constant="12" id="O5c-JT-wgA"/>
+                        <constraint firstItem="LFP-PV-umP" firstAttribute="centerY" secondItem="p4E-43-dK7" secondAttribute="centerY" id="ZAg-Cq-gNP"/>
+                        <constraint firstAttribute="bottom" secondItem="jn1-Ck-lEi" secondAttribute="bottom" constant="25" id="ZbA-TZ-amr"/>
+                        <constraint firstItem="jn1-Ck-lEi" firstAttribute="top" secondItem="FoF-7R-YW8" secondAttribute="bottom" constant="10" id="dnR-OH-2LA"/>
+                        <constraint firstAttribute="trailing" secondItem="jn1-Ck-lEi" secondAttribute="trailing" constant="12" id="e32-bh-FBm"/>
+                        <constraint firstItem="LFP-PV-umP" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="p4E-43-dK7" secondAttribute="trailing" constant="10" id="our-mC-Ynd"/>
                         <constraint firstItem="FoF-7R-YW8" firstAttribute="leading" secondItem="YF6-BH-p4o" secondAttribute="leading" constant="10" id="qWQ-ii-S20"/>
                         <constraint firstItem="ftz-jG-0oB" firstAttribute="leading" secondItem="YF6-BH-p4o" secondAttribute="leading" constant="12" id="v7q-PF-0fl"/>
+                        <constraint firstItem="jn1-Ck-lEi" firstAttribute="leading" secondItem="YF6-BH-p4o" secondAttribute="leading" constant="12" id="y6Q-g8-oJa"/>
                     </constraints>
                     <userDefinedRuntimeAttributes>
                         <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
@@ -61,15 +96,15 @@
                     </userDefinedRuntimeAttributes>
                 </view>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mtd-rZ-pVF">
-                    <rect key="frame" x="14" y="141" width="366" height="156"/>
+                    <rect key="frame" x="14" y="272" width="366" height="156"/>
                     <subviews>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="结算金额" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cnO-cN-4BH">
-                            <rect key="frame" x="11" y="10" width="65.5" height="22"/>
+                            <rect key="frame" x="10" y="10" width="65.5" height="22"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="22" id="38c-lq-W6r"/>
                             </constraints>
                             <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.8980392157" colorSpace="calibratedRGB"/>
+                            <color key="textColor" red="0.46666666666666667" green="0.46666666666666667" blue="0.46666666666666667" 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="3Yt-yf-Y5I">
@@ -102,7 +137,7 @@
                             <constraints>
                                 <constraint firstAttribute="width" constant="65" id="TUi-6F-q4H"/>
                             </constraints>
-                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                             <state key="normal" title="全部结算">
                                 <color key="titleColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
@@ -129,7 +164,7 @@
                         <constraint firstItem="3Yt-yf-Y5I" firstAttribute="top" secondItem="cnO-cN-4BH" secondAttribute="bottom" constant="36" id="QnW-VS-prX"/>
                         <constraint firstItem="Yfw-hh-XkE" firstAttribute="leading" secondItem="mtd-rZ-pVF" secondAttribute="leading" constant="14" id="UV1-ei-Iee"/>
                         <constraint firstItem="cnO-cN-4BH" firstAttribute="top" secondItem="mtd-rZ-pVF" secondAttribute="top" constant="10" id="XFD-Pg-Sxm"/>
-                        <constraint firstItem="cnO-cN-4BH" firstAttribute="leading" secondItem="mtd-rZ-pVF" secondAttribute="leading" constant="11" id="eB3-VM-xsM"/>
+                        <constraint firstItem="cnO-cN-4BH" firstAttribute="leading" secondItem="mtd-rZ-pVF" secondAttribute="leading" constant="10" id="eB3-VM-xsM"/>
                         <constraint firstItem="3Yt-yf-Y5I" firstAttribute="leading" secondItem="mtd-rZ-pVF" secondAttribute="leading" constant="12" id="epS-CG-IE4"/>
                         <constraint firstAttribute="bottom" secondItem="Yfw-hh-XkE" secondAttribute="bottom" id="gFy-KN-BKA"/>
                         <constraint firstAttribute="height" constant="156" id="kqX-bf-WZN"/>
@@ -145,14 +180,14 @@
                     </userDefinedRuntimeAttributes>
                 </view>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7V5-UT-Z1J">
-                    <rect key="frame" x="14" y="309" width="366" height="37"/>
+                    <rect key="frame" x="14" y="442" width="366" height="37"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="47x-GX-Jrs">
                             <rect key="frame" x="0.0" y="0.0" width="366" height="37"/>
                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         </view>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="单次收入结算时,平台将收取2元手续费" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="us0-rn-BWY">
-                            <rect key="frame" x="11" y="10" width="252" height="17"/>
+                            <rect key="frame" x="11" y="10" width="255" height="17"/>
                             <fontDescription key="fontDescription" type="system" pointSize="14"/>
                             <color key="textColor" red="0.8784313725490196" green="0.58039215686274503" blue="0.3529411764705882" alpha="1" colorSpace="calibratedRGB"/>
                             <nil key="highlightedColor"/>
@@ -175,7 +210,7 @@
                     </userDefinedRuntimeAttributes>
                 </view>
                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nVS-6g-C1a">
-                    <rect key="frame" x="28" y="375" width="338" height="44"/>
+                    <rect key="frame" x="28" y="508" width="338" height="44"/>
                     <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
                     <constraints>
                         <constraint firstAttribute="height" constant="44" id="2tv-U1-iXk"/>
@@ -191,21 +226,103 @@
                         <action selector="submitAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="TMU-tn-YE5"/>
                     </connections>
                 </button>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bu1-mX-XJz">
+                    <rect key="frame" x="14" y="10" width="366" height="36"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="withdraw_tips" translatesAutoresizingMaskIntoConstraints="NO" id="SH3-tj-cn3">
+                            <rect key="frame" x="12" y="10" width="16" height="16"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="16" id="AnW-6r-Bp9"/>
+                                <constraint firstAttribute="width" constant="16" id="aPm-QY-kZH"/>
+                            </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="boM-fm-2ij">
+                            <rect key="frame" x="31" y="7" width="254" height="22"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="22" id="xGJ-XO-hcc"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                            <color key="textColor" red="1" green="0.61960784313725492" blue="0.3529411764705882" alpha="1" colorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <constraints>
+                        <constraint firstItem="SH3-tj-cn3" firstAttribute="centerY" secondItem="bu1-mX-XJz" secondAttribute="centerY" id="7T7-9r-h8X"/>
+                        <constraint firstAttribute="height" constant="36" id="Mt4-a5-BhC"/>
+                        <constraint firstItem="SH3-tj-cn3" firstAttribute="leading" secondItem="bu1-mX-XJz" secondAttribute="leading" constant="12" id="ZrF-9P-SkH"/>
+                        <constraint firstItem="boM-fm-2ij" firstAttribute="leading" secondItem="SH3-tj-cn3" secondAttribute="trailing" constant="3" id="emc-ba-sxa"/>
+                        <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="boM-fm-2ij" secondAttribute="trailing" constant="12" id="hvi-NC-8u8"/>
+                        <constraint firstItem="boM-fm-2ij" firstAttribute="centerY" secondItem="SH3-tj-cn3" secondAttribute="centerY" id="xcU-ti-hwx"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="10"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9xP-rC-KIx">
+                    <rect key="frame" x="14" y="58" width="366" height="46"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="结算协议" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="thA-LF-lnj">
+                            <rect key="frame" x="12" y="12" width="70" height="22"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="70" id="NSd-KT-itc"/>
+                                <constraint firstAttribute="height" constant="22" id="Oa4-Ha-5SN"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                            <color key="textColor" red="0.46666666666666667" green="0.46666666666666667" blue="0.46666666666666667" alpha="1" colorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zl7-W1-LCY">
+                            <rect key="frame" x="354" y="12" width="0.0" height="22"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="22" id="9Aw-mg-m5L"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
+                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <gestureRecognizers/>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="zl7-W1-LCY" secondAttribute="trailing" constant="12" id="4sA-QD-yMl"/>
+                        <constraint firstAttribute="height" constant="46" id="6r5-GE-rV5"/>
+                        <constraint firstItem="zl7-W1-LCY" firstAttribute="centerY" secondItem="9xP-rC-KIx" secondAttribute="centerY" id="KKb-XH-fAC"/>
+                        <constraint firstItem="thA-LF-lnj" firstAttribute="centerY" secondItem="9xP-rC-KIx" secondAttribute="centerY" id="cPp-nV-5B8"/>
+                        <constraint firstItem="thA-LF-lnj" firstAttribute="leading" secondItem="9xP-rC-KIx" secondAttribute="leading" constant="12" id="xTa-No-Ss2"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="10"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                    <connections>
+                        <outletCollection property="gestureRecognizers" destination="xRf-lI-WfE" appends="YES" id="wT9-53-dTe"/>
+                    </connections>
+                </view>
             </subviews>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
             <constraints>
                 <constraint firstItem="nVS-6g-C1a" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="28" id="3QC-Vn-mkc"/>
                 <constraint firstItem="YF6-BH-p4o" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="4Pw-rB-Wjh"/>
                 <constraint firstItem="mtd-rZ-pVF" firstAttribute="top" secondItem="YF6-BH-p4o" secondAttribute="bottom" constant="14" id="51O-kB-C6x"/>
+                <constraint firstItem="YF6-BH-p4o" firstAttribute="top" secondItem="9xP-rC-KIx" secondAttribute="bottom" constant="12" id="6b9-0D-bnp"/>
                 <constraint firstItem="mtd-rZ-pVF" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="7li-Xi-bbt"/>
+                <constraint firstAttribute="trailing" secondItem="bu1-mX-XJz" secondAttribute="trailing" constant="14" id="8WZ-Gi-XYN"/>
+                <constraint firstItem="9xP-rC-KIx" firstAttribute="top" secondItem="bu1-mX-XJz" secondAttribute="bottom" constant="12" id="FWS-M8-CHg"/>
                 <constraint firstAttribute="trailing" secondItem="mtd-rZ-pVF" secondAttribute="trailing" constant="14" id="IAO-Ee-VtS"/>
                 <constraint firstItem="7V5-UT-Z1J" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="Loz-kt-tyc"/>
-                <constraint firstItem="7V5-UT-Z1J" firstAttribute="top" secondItem="mtd-rZ-pVF" secondAttribute="bottom" constant="12" id="N0v-5u-3Kf"/>
+                <constraint firstItem="7V5-UT-Z1J" firstAttribute="top" secondItem="mtd-rZ-pVF" secondAttribute="bottom" constant="14" id="N0v-5u-3Kf"/>
                 <constraint firstAttribute="trailing" secondItem="YF6-BH-p4o" secondAttribute="trailing" constant="14" id="dZf-jO-Fk9"/>
+                <constraint firstAttribute="trailing" secondItem="9xP-rC-KIx" secondAttribute="trailing" constant="14" id="l1l-EZ-n4p"/>
                 <constraint firstAttribute="trailing" secondItem="7V5-UT-Z1J" secondAttribute="trailing" constant="14" id="o8x-WO-21A"/>
+                <constraint firstItem="9xP-rC-KIx" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="u9F-Sx-19S"/>
+                <constraint firstItem="bu1-mX-XJz" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="w2g-xK-LrX"/>
+                <constraint firstItem="bu1-mX-XJz" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="wNo-xW-uAx"/>
                 <constraint firstItem="nVS-6g-C1a" firstAttribute="top" secondItem="7V5-UT-Z1J" secondAttribute="bottom" constant="29" id="wic-fG-9l1"/>
                 <constraint firstAttribute="trailing" secondItem="nVS-6g-C1a" secondAttribute="trailing" constant="28" id="zG6-7m-NXj"/>
-                <constraint firstItem="YF6-BH-p4o" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="zUZ-th-ghV"/>
             </constraints>
             <nil key="simulatedTopBarMetrics"/>
             <nil key="simulatedBottomBarMetrics"/>
@@ -214,14 +331,25 @@
                 <outlet property="amountField" destination="Dcf-8y-D2f" id="ODz-uA-tcR"/>
                 <outlet property="availableAmoutLabel" destination="Yfw-hh-XkE" id="LZh-hE-HLY"/>
                 <outlet property="backView" destination="47x-GX-Jrs" id="07x-ZQ-DAl"/>
+                <outlet property="cardBindButton" destination="LFP-PV-umP" id="yJJ-hH-6kH"/>
                 <outlet property="cardDesc" destination="p4E-43-dK7" id="ebb-9J-F4a"/>
+                <outlet property="cardNumHeight" destination="iaR-cU-pSe" id="bdh-bs-1f3"/>
+                <outlet property="cardNumLabel" destination="jn1-Ck-lEi" id="9Kt-KD-l9s"/>
+                <outlet property="cardNumTop" destination="dnR-OH-2LA" id="B90-J7-BI3"/>
                 <outlet property="descLabel" destination="us0-rn-BWY" id="gu7-Iv-hp3"/>
+                <outlet property="signDesc" destination="zl7-W1-LCY" id="rwt-Xu-aRc"/>
             </connections>
-            <point key="canvasLocation" x="146.37681159420291" y="-2.0089285714285712"/>
+            <point key="canvasLocation" x="146.37681159420291" y="42.1875"/>
         </view>
+        <tapGestureRecognizer id="xRf-lI-WfE">
+            <connections>
+                <action selector="protocalAction:" destination="iN0-l3-epB" id="GWF-jx-7lo"/>
+            </connections>
+        </tapGestureRecognizer>
     </objects>
     <resources>
         <image name="card_icon" width="44" height="44"/>
+        <image name="withdraw_tips" width="16" height="16"/>
         <systemColor name="systemBackgroundColor">
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
         </systemColor>

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/Controller/BandCardViewController.h

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface BandCardViewController : KSBaseViewController
 
+@property (nonatomic, assign) BOOL isFromDrawPage; // 是否从提现页面进入
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 6 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/Controller/BandCardViewController.m

@@ -148,7 +148,12 @@
     ctrl.displayImageName = isSuccess ? @"card_success" : @"card_failed";
     ctrl.topTitle = isSuccess ? @"绑定成功" : @"绑定失败";
     ctrl.descMessage = isSuccess ? @"恭喜您绑定成功!" : [NSString stringWithFormat:@"绑定失败 %@",[NSString returnNoNullStringWithString:errorMsg]];
-    ctrl.backControllerName = @"MyBankCardViewController";
+    if (self.isFromDrawPage) {
+        ctrl.backControllerName = @"WithdrawViewController";
+    }
+    else {
+        ctrl.backControllerName = @"MyBankCardViewController";
+    }
     [self.navigationController pushViewController:ctrl animated:YES];
 }
 

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/CardBandBodyView.m

@@ -35,12 +35,14 @@
 }
 
 - (IBAction)chooseBank:(id)sender {
+    [self endEditing:YES];
     if (self.callback) {
         self.callback(YES);
     }
 }
 
 - (IBAction)sureAction:(id)sender {
+    [self endEditing:YES];
     if (self.callback) {
         self.callback(NO);
     }

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/KSConfirmAlertView.h

@@ -21,6 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)showAlert;
 
+- (void)configLeftTitle:(NSString *)leftTitle rightTitle:(NSString *)rightTitle;
+
 - (void)opreationSure:(ConfirmSure)sure cancel:(ConfirmCancel)cancel;
 
 @end

+ 9 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/KSConfirmAlertView.m

@@ -9,6 +9,10 @@
 
 @interface KSConfirmAlertView ()
 
+@property (weak, nonatomic) IBOutlet UIButton *leftButton;
+
+@property (weak, nonatomic) IBOutlet UIButton *rightButton;
+
 @property (weak, nonatomic) IBOutlet UILabel *topTitleLabel;
 
 @property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@@ -33,6 +37,11 @@
     self.subTitleLabel.text = subTitle;
 }
 
+- (void)configLeftTitle:(NSString *)leftTitle rightTitle:(NSString *)rightTitle {
+    [self.leftButton setTitle:leftTitle forState:UIControlStateNormal];
+    [self.rightButton setTitle:rightTitle forState:UIControlStateNormal];
+}
+
 - (void)opreationSure:(ConfirmSure)sure cancel:(ConfirmCancel)cancel {
     if (sure) {
         self.sureCallback = sure;

+ 4 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/BankCard/View/KSConfirmAlertView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<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_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -115,6 +115,8 @@
                 <constraint firstItem="o0i-hr-vBK" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="vCi-pO-rvg"/>
             </constraints>
             <connections>
+                <outlet property="leftButton" destination="rUR-gG-b2o" id="cUh-2q-1pc"/>
+                <outlet property="rightButton" destination="QEw-9N-XM6" id="QJY-DM-VV9"/>
                 <outlet property="subTitleLabel" destination="dpE-gf-YK1" id="Ohk-m5-2JP"/>
                 <outlet property="topTitleLabel" destination="wNN-c7-gwa" id="gwU-Si-Cv9"/>
             </connections>

+ 6 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/Controller/MineViewController.m

@@ -103,7 +103,12 @@
     [self evaluateAmount:self.amount];
     [self refreshBodyView:self.isMember];
     [self refreshView];
-
+    if (self.mineInfo.isBank) {
+        self.bottomView.bandStatusView.text = @"已绑定";
+    }
+    else {
+        self.bottomView.bandStatusView.text = @"未绑定";
+    }
 
 }
 

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/View/MineBottomView.h

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface MineBottomView : UIView
 
+@property (weak, nonatomic) IBOutlet UILabel *bandStatusView;
+
 @property (nonatomic, assign) BOOL isMember;
 
 @property (nonatomic, assign) BOOL isSettlement; // 是否结算 1 结算

+ 3 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/View/MineBottomView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<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_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -387,6 +387,7 @@
             <nil key="simulatedBottomBarMetrics"/>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <connections>
+                <outlet property="bandStatusView" destination="O96-Xz-BAp" id="cea-xJ-FrQ"/>
                 <outlet property="shareAmountLabel" destination="R1A-TC-V7v" id="R6u-eQ-3Gg"/>
                 <outlet property="spreadView" destination="Fef-w6-G6G" id="Dgh-3S-mi9"/>
                 <outlet property="spreadViewHeight" destination="5Hv-uN-ddI" id="YCa-1q-YXD"/>

+ 1 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/TXLiveModule/Controller/TXLiveRoomViewController.m

@@ -581,6 +581,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
     [self resetSeatContainer];
     [self.trtcCloud exitRoom];
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        
         [self publishLocalStream];
     });
 }

+ 3 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Controller/ToneTuningViewController.m

@@ -191,9 +191,9 @@ static float correctTime = 0.5;
 
 - (void)tunerDidUpdate:(Tuner *)tuner output:(TunerOutput *)output {
     NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970];
-    if (fabs(self.lastCorrectTime - currentTime) < correctTime) {
-        return;
-    }
+//    if (fabs(self.lastCorrectTime - currentTime) < correctTime) {
+//        return;
+//    }
     self.lastCorrectTime = currentTime;
 
     if (output.amplitude < 0.01) {

+ 3 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Model/TuningFunction/Tuner.swift

@@ -164,7 +164,7 @@ private let frequencies: [Float] = [
          8192 (20次/秒)
          4096 (40次/秒)  def
          */
-        pitchTap = PitchTap(microphone!, bufferSize: 4096, handler: tap_handler)
+        pitchTap = PitchTap(microphone!, bufferSize: 6144, handler: tap_handler)
         microphone!.start()
         pitchTap!.start()
         engine!.output = silence
@@ -182,6 +182,8 @@ private let frequencies: [Float] = [
     }
     
     func tap_handler(freq: [Float], amp: [Float]) -> Void {
+        // Reduces sensitivity to background noise to prevent random / fluctuating data.
+        guard amp[0] > 0.1 else { return }
 #if DEBUG
         print("freq -- real_\(freq[0]) -- imag_\(freq[1])" )
         print("amp -- real_\(amp[0]) -- imag_\(amp[1])")

+ 3 - 3
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/View/KSGaugeView/KSGaugeView.m

@@ -275,7 +275,7 @@
  */
 - (void)setValue:(float)value animated:(BOOL)animated
 {
-    [self setValue:value animated:animated duration:0.8];
+    [self setValue:value animated:animated duration:0.2];
 }
 
 /**
@@ -283,7 +283,7 @@
  */
 - (void)setValue:(float)value animated:(BOOL)animated completion:(void (^)(BOOL finished))completion
 {
-    [self setValue:value animated:animated duration:0.8 completion:completion];
+    [self setValue:value animated:animated duration:0.2 completion:completion];
 }
 
 /**
@@ -342,7 +342,7 @@
 
 - (void)setValue:(float)value
 {
-    [self setValue:value animated:NO];
+    [self setValue:value animated:YES];
 }
 
 /*

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/View/WMGaugeView/WMGaugeView.m

@@ -578,7 +578,7 @@
  */
 - (void)setValue:(float)value animated:(BOOL)animated
 {
-    [self setValue:value animated:animated duration:0.8];
+    [self setValue:value animated:animated duration:0.2];
 }
 
 /**
@@ -586,7 +586,7 @@
  */
 - (void)setValue:(float)value animated:(BOOL)animated completion:(void (^)(BOOL finished))completion
 {
-    [self setValue:value animated:animated duration:0.8 completion:completion];
+    [self setValue:value animated:animated duration:0.2 completion:completion];
 }
 
 /**

+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/beat/KSCloudBeatView.m

@@ -280,7 +280,6 @@
         self.callback = callback;
     }
     [self startPlayAction];
-    
 }
 
 - (void)startPlayAction {