|
@@ -14,6 +14,8 @@
|
|
|
#import "MusicRoomViewController.h"
|
|
|
#import "KSChoosePicker.h"
|
|
|
#import "MusicRoomListModel.h"
|
|
|
+#import "AuthDisplayView.h"
|
|
|
+#import "KSBaseWKWebViewController.h"
|
|
|
|
|
|
@interface MyMusicRoomBodyView ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
|
|
@@ -46,6 +48,10 @@
|
|
|
|
|
|
@property (nonatomic, strong) NSMutableArray *subjectMessageArray;
|
|
|
|
|
|
+@property (nonatomic, strong) AuthDisplayView *authView;
|
|
|
+
|
|
|
+@property (nonatomic, assign) BOOL teacherAuthPass; // 是否通过老师审核
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation MyMusicRoomBodyView
|
|
@@ -187,6 +193,12 @@
|
|
|
[self.sortView.firstButton setTitle:[self.dateFormatter stringFromDate:currentDate] forState:UIControlStateNormal];
|
|
|
[self addSubview:self.sortView];
|
|
|
}
|
|
|
+ if (self.teacherAuthPass == NO) {
|
|
|
+ [self showAuthView];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [self hideAuthView];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)sortWithType:(SORT_TYPE)type {
|
|
@@ -446,6 +458,96 @@
|
|
|
_subjectList = subjectList;
|
|
|
self.thirdChooseIndex = 0;
|
|
|
}
|
|
|
+
|
|
|
+- (void)setTeaherStatus:(NSString *)teaherStatus {
|
|
|
+ _teaherStatus = teaherStatus;
|
|
|
+ if ([teaherStatus isEqualToString:@"UNPAALY"]) { // 未申请
|
|
|
+ self.teacherAuthPass = NO;
|
|
|
+ }
|
|
|
+ else if ([teaherStatus isEqualToString:@"DOING"]) { // 审核中
|
|
|
+ self.teacherAuthPass = NO;
|
|
|
+ }
|
|
|
+ else if ([teaherStatus isEqualToString:@"UNPASS"]) { // 不通过
|
|
|
+ self.teacherAuthPass = NO;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.teacherAuthPass = YES;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (self.teacherAuthPass == NO) {
|
|
|
+ [self showAuthView];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [self hideAuthView];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)configAuthDisplay {
|
|
|
+ [self.authView configDisplayMessage:[self getAuthDisplayMessage]];
|
|
|
+ if ([self.teaherStatus isEqualToString:@"DOING"]) {
|
|
|
+ self.authView.sureButton.userInteractionEnabled = NO;
|
|
|
+ self.authView.sureButton.hidden = YES;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.authView.sureButton.userInteractionEnabled = YES;
|
|
|
+ self.authView.sureButton.hidden = NO;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)showAuthView {
|
|
|
+ [self configAuthDisplay];
|
|
|
+ if ([self.subviews containsObject:self.authView]) {
|
|
|
+ [self bringSubviewToFront:self.authView];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [self addSubview:self.authView];
|
|
|
+ [self.authView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.top.bottom.right.mas_equalTo(self);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)hideAuthView {
|
|
|
+ if ([self.subviews containsObject:self.authView]) {
|
|
|
+ [self.authView removeFromSuperview];
|
|
|
+ self.authView = nil;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (AuthDisplayView *)authView {
|
|
|
+ if (!_authView) {
|
|
|
+ _authView = [AuthDisplayView shareInstance];
|
|
|
+ [_authView.imageView setImage:[UIImage imageNamed:[self getAuthDisplayImage]]];
|
|
|
+ [_authView configDisplayMessage:[self getAuthDisplayMessage]];
|
|
|
+ MJWeakSelf;
|
|
|
+ [_authView sureCallback:^{
|
|
|
+ [weakSelf authAction];
|
|
|
+ }];
|
|
|
+ }
|
|
|
+ return _authView;
|
|
|
+}
|
|
|
+
|
|
|
+- (NSString *)getAuthDisplayImage {
|
|
|
+ return @"authTeacher_accompany";
|
|
|
+}
|
|
|
+
|
|
|
+- (NSString *)getAuthDisplayMessage {
|
|
|
+
|
|
|
+ if ([self.teaherStatus isEqualToString:@"DOING"]) { // 审核中
|
|
|
+ return @"您已提交认证申请,请耐心等待审核结果~";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return @"您还没有完成达人认证,认证后才可设置琴房课哦~";
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+- (void)authAction {
|
|
|
+ KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
|
|
|
+ webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/teacherCert"];
|
|
|
+ [self.naviController pushViewController:webCtrl animated:YES];
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
// Only override drawRect: if you perform custom drawing.
|
|
|
// An empty implementation adversely affects performance during animation.
|