|
@@ -25,6 +25,7 @@
|
|
|
#import "ModifyPhoneCheckController.h"
|
|
|
#import "UserAuthViewController.h"
|
|
|
#import "ModifyNameViewController.h"
|
|
|
+#import "LiveRoomAlertView.h"
|
|
|
|
|
|
@interface MyStyleViewController ()<UITableViewDelegate,UITableViewDataSource,WMPlayerDelegate,RSKImageCropViewControllerDelegate,RSKImageCropViewControllerDataSource>
|
|
|
{
|
|
@@ -62,6 +63,10 @@
|
|
|
|
|
|
@property (nonatomic, strong) MyStyleEditHeadView *infoHeadView;
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL hasModify;
|
|
|
+
|
|
|
+/// 提示窗
|
|
|
+@property (nonatomic, strong) LiveRoomAlertView *alertView;
|
|
|
|
|
|
@end
|
|
|
|
|
@@ -202,6 +207,7 @@
|
|
|
[KSNetworkingManager saveTeacherStyleRequest:KS_POST styleVideo:videoArray subjectId:subjectIds subjectName:subjectNames introduction:self.content success:^(NSDictionary * _Nonnull dic) {
|
|
|
[self removehub];
|
|
|
if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) {
|
|
|
+ self.hasModify = NO;
|
|
|
MJWeakSelf;
|
|
|
NSString *descMessage = (hasNewVideoSubmit || self.hasModifyVideoImage) ? @"提交成功,请耐心等待审核" : @"保存成功";
|
|
|
[self KSShowMsg:descMessage promptCompletion:^{
|
|
@@ -252,6 +258,7 @@
|
|
|
[weakSelf chooseInstrumentWithArray:sourceArray];
|
|
|
}
|
|
|
else { // 刷新
|
|
|
+ weakSelf.hasModify = YES;
|
|
|
[weakSelf refreshInstrumentPart:sourceArray];
|
|
|
}
|
|
|
}];
|
|
@@ -261,6 +268,7 @@
|
|
|
MyStyleIntroduceCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyStyleIntroduceCell"];
|
|
|
MJWeakSelf;
|
|
|
[cell configWithIntroduceMessage:self.content modifyCallback:^(NSString * _Nullable content) {
|
|
|
+ weakSelf.hasModify = YES;
|
|
|
weakSelf.content = content;
|
|
|
}];
|
|
|
return cell;
|
|
@@ -289,7 +297,7 @@
|
|
|
MJWeakSelf;
|
|
|
[self.mediaManager noAlertCallback:^(NSString * _Nullable videoUrl, NSMutableArray * _Nullable imageArray, NSMutableArray * _Nullable imageAsset) {
|
|
|
NSLog(@"%@", videoUrl);
|
|
|
-
|
|
|
+ weakSelf.hasModify = YES;
|
|
|
[weakSelf uploadVideoWithUrl:videoUrl coverUrl:nil];
|
|
|
}];
|
|
|
[self.mediaManager pushImagePickerController];
|
|
@@ -310,6 +318,7 @@
|
|
|
NSInteger index = container.tag - 1000;
|
|
|
if (self.videoArray.count > index) {
|
|
|
if ([self canDeleteVideoIndex:index]) {
|
|
|
+ self.hasModify = YES;
|
|
|
[self.videoArray removeObjectAtIndex:index];
|
|
|
}
|
|
|
else {
|
|
@@ -334,8 +343,6 @@
|
|
|
// 裁剪
|
|
|
weakSelf.hasModifyVideoImage = YES;
|
|
|
[weakSelf cropImage:[imageArray lastObject] fileIndex:index];
|
|
|
-
|
|
|
-
|
|
|
}];
|
|
|
[self.mediaManager pushImagePickerController];
|
|
|
}
|
|
@@ -473,6 +480,7 @@
|
|
|
ctrl.preChooseArray = instrumentArray;
|
|
|
MJWeakSelf;
|
|
|
[ctrl chooseCallback:^(NSMutableArray *chooseArray) {
|
|
|
+ weakSelf.hasModify = YES;
|
|
|
[weakSelf refreshInstrumentPart:chooseArray];
|
|
|
}];
|
|
|
[self.navigationController pushViewController:ctrl animated:YES];
|
|
@@ -554,6 +562,21 @@
|
|
|
return _navView;
|
|
|
}
|
|
|
|
|
|
+- (void)backAction {
|
|
|
+ [self.view endEditing:YES];
|
|
|
+ // 根据需要返回到不同页面
|
|
|
+ if (self.hasModify) {
|
|
|
+ self.alertView = [LiveRoomAlertView liveroomAlertWithTitle:@"您尚未保存修改信息,返回后将取消修改" leftButtonTitle:@"取消" rightTitle:@"确认" inView:self.view cancel:^{
|
|
|
+
|
|
|
+ } confirm:^{
|
|
|
+ [self.navigationController popViewControllerAnimated:YES];
|
|
|
+ }];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [self.navigationController popViewControllerAnimated:YES];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
- (UITableView *)tableView {
|
|
|
if (!_tableView) {
|
|
@@ -731,14 +754,16 @@
|
|
|
|
|
|
- (CGRect)imageCropViewControllerCustomMaskRect:(RSKImageCropViewController *)controller {
|
|
|
CGFloat width = (KPortraitWidth - 40);
|
|
|
- CGFloat height = width / 16 * 9;
|
|
|
+// CGFloat height = width / 16 * 9;
|
|
|
+ CGFloat height = width;
|
|
|
return CGRectMake(20, (KPortraitHeight - height) / 2.0f, width, height);
|
|
|
}
|
|
|
|
|
|
- (UIBezierPath *)imageCropViewControllerCustomMaskPath:(RSKImageCropViewController *)controller {
|
|
|
//返回裁剪框的位置
|
|
|
CGFloat width = (KPortraitWidth - 40);
|
|
|
- CGFloat height = width / 16 * 9;
|
|
|
+// CGFloat height = width / 16 * 9;
|
|
|
+ CGFloat height = width;
|
|
|
UIBezierPath *path=[UIBezierPath bezierPathWithRoundedRect:CGRectMake(20, (KPortraitHeight - height) / 2.0f, width, height) cornerRadius:0];
|
|
|
return path;
|
|
|
}
|
|
@@ -765,6 +790,7 @@
|
|
|
*/
|
|
|
- (void)imageCropViewController:(RSKImageCropViewController *)controller didCropImage:(UIImage *)croppedImage usingCropRect:(CGRect)cropRect rotationAngle:(CGFloat)rotationAngle {
|
|
|
// croppedImage
|
|
|
+ self.hasModify = YES;
|
|
|
[self uploadImage:croppedImage index:self.chooseFileIndex];
|
|
|
[controller.navigationController dismissViewControllerAnimated:YES completion:nil];
|
|
|
}
|