diff --git a/ProductApp/ProductApp.xcodeproj/project.pbxproj b/ProductApp/ProductApp.xcodeproj/project.pbxproj index bc1a857..275a2d5 100644 --- a/ProductApp/ProductApp.xcodeproj/project.pbxproj +++ b/ProductApp/ProductApp.xcodeproj/project.pbxproj @@ -273,6 +273,10 @@ CAA600D52CA9579800026CF4 /* KeTangXieZuoCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA600D42CA9579800026CF4 /* KeTangXieZuoCollectionViewCell.m */; }; CAA600D92CA95AAC00026CF4 /* KeTangXieZuoNJViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA600D82CA95AAC00026CF4 /* KeTangXieZuoNJViewController.m */; }; CAA600DD2CA95B0200026CF4 /* KeTangXieZuoNJTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA600DC2CA95B0200026CF4 /* KeTangXieZuoNJTableViewCell.m */; }; + CAAFA5EC2CD8597200A58D23 /* PptByOutlineModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CAAFA5EB2CD8597200A58D23 /* PptByOutlineModel.m */; }; + CAAFA5EF2CD85A1500A58D23 /* PptProgressModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CAAFA5EE2CD85A1500A58D23 /* PptProgressModel.m */; }; + CAAFA5F22CD85FC100A58D23 /* PPtYuLanZSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAAFA5F12CD85FC100A58D23 /* PPtYuLanZSViewController.m */; }; + CAAFA5F52CD86E7C00A58D23 /* PptHestoryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CAAFA5F42CD86E7C00A58D23 /* PptHestoryModel.m */; }; CAB0D36D2CAA3C6F009BF67D /* KeTangXieZuoXiangQingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAB0D36C2CAA3C6F009BF67D /* KeTangXieZuoXiangQingViewController.m */; }; CAB0D3712CAA3DAE009BF67D /* KeTangXieZuoXiangQingView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAB0D3702CAA3DAE009BF67D /* KeTangXieZuoXiangQingView.m */; }; CAB0D3752CAA47F3009BF67D /* ZhiNengXieZuoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAB0D3742CAA47F3009BF67D /* ZhiNengXieZuoViewController.m */; }; @@ -1031,6 +1035,14 @@ CAA600D82CA95AAC00026CF4 /* KeTangXieZuoNJViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KeTangXieZuoNJViewController.m; sourceTree = ""; }; CAA600DB2CA95B0200026CF4 /* KeTangXieZuoNJTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeTangXieZuoNJTableViewCell.h; sourceTree = ""; }; CAA600DC2CA95B0200026CF4 /* KeTangXieZuoNJTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KeTangXieZuoNJTableViewCell.m; sourceTree = ""; }; + CAAFA5EA2CD8597200A58D23 /* PptByOutlineModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PptByOutlineModel.h; sourceTree = ""; }; + CAAFA5EB2CD8597200A58D23 /* PptByOutlineModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PptByOutlineModel.m; sourceTree = ""; }; + CAAFA5ED2CD85A1500A58D23 /* PptProgressModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PptProgressModel.h; sourceTree = ""; }; + CAAFA5EE2CD85A1500A58D23 /* PptProgressModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PptProgressModel.m; sourceTree = ""; }; + CAAFA5F02CD85FC100A58D23 /* PPtYuLanZSViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PPtYuLanZSViewController.h; sourceTree = ""; }; + CAAFA5F12CD85FC100A58D23 /* PPtYuLanZSViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PPtYuLanZSViewController.m; sourceTree = ""; }; + CAAFA5F32CD86E7C00A58D23 /* PptHestoryModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PptHestoryModel.h; sourceTree = ""; }; + CAAFA5F42CD86E7C00A58D23 /* PptHestoryModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PptHestoryModel.m; sourceTree = ""; }; CAB0D36B2CAA3C6F009BF67D /* KeTangXieZuoXiangQingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeTangXieZuoXiangQingViewController.h; sourceTree = ""; }; CAB0D36C2CAA3C6F009BF67D /* KeTangXieZuoXiangQingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KeTangXieZuoXiangQingViewController.m; sourceTree = ""; }; CAB0D36F2CAA3DAE009BF67D /* KeTangXieZuoXiangQingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeTangXieZuoXiangQingView.h; sourceTree = ""; }; @@ -2259,6 +2271,8 @@ CA4257AB2CA2AF2400A36A10 /* cell */, CA4257A82CA2A30C00A36A10 /* StartZNPPTYuLanViewController.h */, CA4257A92CA2A30C00A36A10 /* StartZNPPTYuLanViewController.m */, + CAAFA5F02CD85FC100A58D23 /* PPtYuLanZSViewController.h */, + CAAFA5F12CD85FC100A58D23 /* PPtYuLanZSViewController.m */, ); path = "预览PPT"; sourceTree = ""; @@ -3278,6 +3292,12 @@ CAD092C72CD4794F00853A26 /* PptLangModel.m */, CAD092CF2CD4AFE300853A26 /* PptOutlineModel.h */, CAD092D02CD4AFE300853A26 /* PptOutlineModel.m */, + CAAFA5EA2CD8597200A58D23 /* PptByOutlineModel.h */, + CAAFA5EB2CD8597200A58D23 /* PptByOutlineModel.m */, + CAAFA5ED2CD85A1500A58D23 /* PptProgressModel.h */, + CAAFA5EE2CD85A1500A58D23 /* PptProgressModel.m */, + CAAFA5F32CD86E7C00A58D23 /* PptHestoryModel.h */, + CAAFA5F42CD86E7C00A58D23 /* PptHestoryModel.m */, ); path = models; sourceTree = ""; @@ -4681,6 +4701,7 @@ buildActionMask = 2147483647; files = ( CA0D086A2CA548EE0086855E /* ShouYeLiShiJiLuPGTableViewController.m in Sources */, + CAAFA5F52CD86E7C00A58D23 /* PptHestoryModel.m in Sources */, CB489F882744A0BD00DA044A /* TagView.m in Sources */, CA9CFF6E2CC9DFCC00C3E90E /* ExampleTextGreatModel.m in Sources */, CB489F672744A0BD00DA044A /* DAYIndicatorView.m in Sources */, @@ -4820,6 +4841,7 @@ CA0C3AB12CB5053600E01A72 /* ZhiNengPPTViewController.m in Sources */, CA487D8D2CA3E6B700AE773B /* StartZNPPTDaGangSonTableViewCell.m in Sources */, CA0D087F2CA55E5D0086855E /* JJGradientLabel.m in Sources */, + CAAFA5EC2CD8597200A58D23 /* PptByOutlineModel.m in Sources */, CA5D03112CC0DDF0007B3BA5 /* PayPublicYouHuiLogListViewCell.m in Sources */, CA0D08712CA54D4B0086855E /* ShouYeLiShiJiLuXZTableViewCell.m in Sources */, CB489F742744A0BD00DA044A /* MCTabBar.m in Sources */, @@ -4837,7 +4859,9 @@ CABD8C952CBF974E009A5E5E /* GongJuFanYiView.m in Sources */, CA5D02A42CC0B2DE007B3BA5 /* ImageCollectionViewCell.m in Sources */, CA8EE5232CC8C914009D73E3 /* PayManager.m in Sources */, + CAAFA5F22CD85FC100A58D23 /* PPtYuLanZSViewController.m in Sources */, CA0D084F2CA53B970086855E /* ShouYeLingYuViewController.m in Sources */, + CAAFA5EF2CD85A1500A58D23 /* PptProgressModel.m in Sources */, CA0D087C2CA55BB80086855E /* ShouYeLiShiJiLuPPTTableViewCell.m in Sources */, CA8181B02C9EB96000EE7E6E /* StartKTXZPGDetailFJView.m in Sources */, CB489F7A2744A0BD00DA044A /* FSTextView.m in Sources */, diff --git a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate index d608f74..447aa1d 100644 Binary files a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate and b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index f30e91b..7d94bfb 100644 --- a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -148,22 +148,6 @@ landmarkType = "7"> - - - - diff --git a/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.h b/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.h index f121802..9cd0c59 100644 --- a/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.h +++ b/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.h @@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN #define UserInfoModelConfig @"UserInfoModelConfig" #define UserInfoModelTemp @"UserInfoModelTemp" +#define UserInfoModelIdentityType @"UserInfoModelIdentityType" + + @class RoleTreeModelData; @interface UserInfoModel : NSObject +(UserInfoModel *)shareModel; @@ -69,6 +72,10 @@ NS_ASSUME_NONNULL_BEGIN +(void)setRole:(NSString *)value; +(void)setConfig:(NSDictionary *)value; +(void)setTemp:(NSString *)value; + ++(void)setIdentityType:(NSString *)value; + + ///退出登录 +(void)loginOut; +(void)removeAll; diff --git a/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.m b/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.m index fc5ec93..8b3fb95 100644 --- a/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.m +++ b/ProductApp/ProductApp/BaseControl/UserInfo/UserInfoModel.m @@ -29,6 +29,9 @@ static UserInfoModel *userinfo; userinfo.role = [[NSUserDefaults standardUserDefaults] objectForKey:UserInfoModelRole]; userinfo.temp = [[NSUserDefaults standardUserDefaults] objectForKey:UserInfoModelTemp]; + userinfo.identityType = [[NSUserDefaults standardUserDefaults] objectForKey:UserInfoModelIdentityType]; + + NSString *strtemp = [[NSUserDefaults standardUserDefaults] objectForKey:UserInfoModelConfig]; NSData *data = [strtemp dataUsingEncoding:NSUTF8StringEncoding]; if(data) @@ -65,6 +68,7 @@ static UserInfoModel *userinfo; [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:UserInfoModelRole]; [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:UserInfoModelConfig]; [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:UserInfoModelTemp]; + [[NSUserDefaults standardUserDefaults] setObject:@"" forKey:UserInfoModelIdentityType]; } @@ -104,6 +108,11 @@ static UserInfoModel *userinfo; { [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@",value] forKey:UserInfoModelTemp]; } ++(void)setIdentityType:(NSString *)value +{ + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithFormat:@"%@",value] forKey:UserInfoModelIdentityType]; +} + +(BOOL)pushLoinVC:(UIViewController *)vc ispush:(BOOL)ispush { ///需要判断是否需要登录 diff --git a/ProductApp/ProductApp/BaseControl/UserInfo/baseInfoModel.h b/ProductApp/ProductApp/BaseControl/UserInfo/baseInfoModel.h index fea449c..2075ede 100644 --- a/ProductApp/ProductApp/BaseControl/UserInfo/baseInfoModel.h +++ b/ProductApp/ProductApp/BaseControl/UserInfo/baseInfoModel.h @@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *namekey; @property (nonatomic, copy) NSString *namekey1; +@property (nonatomic , assign) BOOL isvalue; + @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/Configure/ConfigireSetting.h b/ProductApp/ProductApp/Configure/ConfigireSetting.h index cd64649..6bf3171 100644 --- a/ProductApp/ProductApp/Configure/ConfigireSetting.h +++ b/ProductApp/ProductApp/Configure/ConfigireSetting.h @@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN #define BaseUrl @"https://aiw.batiao8.com/" +///下载地址 +#define DownLoadUrl @"https://aiw.batiao8.com/" ///加密字符 #define MDPassword @"HQ48tw5vmE0BcQbsPlrcK5rXUifO6ANT" diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h index 54e8845..59791da 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h @@ -38,6 +38,9 @@ #import "PptThemeModel.h" #import "PptLangModel.h" #import "PptOutlineModel.h" +#import "PptByOutlineModel.h" +#import "PptProgressModel.h" +#import "PptHestoryModel.h" NS_ASSUME_NONNULL_BEGIN @@ -636,6 +639,33 @@ NS_ASSUME_NONNULL_BEGIN dicpush:(NSDictionary *)dicpush Callback:(completeModeBlock)callback; +/* + 根据思路生成 + /api/ppt/by/outline + */ ++ (void)requestPptBylineData:(UIView *)view + dicpush:(NSDictionary *)dicpush + Callback:(completeModeBlock)callback; + +/* + 查询进度 + /api/ppt/progress + id + */ ++ (void)requestPptProgressData:(UIView *)view + ID:(NSString *)ID + Callback:(completeModeBlock)callback; + +/* + 获取生成记录日志 + /api/ppt + page + status 0待生成 1.已生成大纲 2.正在生成ppt 3 已完成 4.失败 + */ ++ (void)requestPptHestoryData:(UIView *)view + page:(NSString *)page + status:(NSString *)status + Callback:(completeModeBlock)callback; @end diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m index 64c6261..d212452 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m @@ -1960,5 +1960,111 @@ }]; } +/* + 根据思路生成 + /api/ppt/by/outline + */ ++ (void)requestPptBylineData:(UIView *)view + dicpush:(NSDictionary *)dicpush + Callback:(completeModeBlock)callback +{ + NSMutableDictionary *dicQuery = [NSMutableDictionary new]; + + NSMutableDictionary *dicHeader = [NSMutableDictionary new]; + + + [YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:2 url:@"api/ppt/by/outline" paraments:dicpush Headers:dicHeader Query:dicQuery completeBlock:^(id _Nullable responseObject, NSError * _Nullable error) { + BOOL state = NO; + NSString *describle = @""; + if (responseObject==nil) { + describle = @"网络错误"; + BaseModel *model = [BaseModel new]; + model.message =describle; + callback(state,model,describle); + }else{ + NSDictionary *dicAll=responseObject; + describle = dicAll[@"message"]; + if ([[NSString stringWithFormat:@"%@",dicAll[@"code"]] intValue] == 0) { + state = YES; + } + callback(state,[PptByOutlineModel yy_modelWithJSON:dicAll],describle); + } + }]; +} + +/* + 查询进度 + /api/ppt/progress + id + */ ++ (void)requestPptProgressData:(UIView *)view + ID:(NSString *)ID + Callback:(completeModeBlock)callback +{ + NSMutableDictionary *dicQuery = [NSMutableDictionary new]; + + NSMutableDictionary *dicHeader = [NSMutableDictionary new]; + + NSMutableDictionary *dicpush = [NSMutableDictionary new]; + [dicpush setObject:[Tools isStringnil:ID] forKey:@"id"]; + + [YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:2 url:@"api/ppt/progress" paraments:dicpush Headers:dicHeader Query:dicQuery completeBlock:^(id _Nullable responseObject, NSError * _Nullable error) { + BOOL state = NO; + NSString *describle = @""; + if (responseObject==nil) { + describle = @"网络错误"; + BaseModel *model = [BaseModel new]; + model.message =describle; + callback(state,model,describle); + }else{ + NSDictionary *dicAll=responseObject; + describle = dicAll[@"message"]; + if ([[NSString stringWithFormat:@"%@",dicAll[@"code"]] intValue] == 0) { + state = YES; + } + callback(state,[PptProgressModel yy_modelWithJSON:dicAll],describle); + } + }]; +} + +/* + 获取生成记录日志 + /api/ppt + page + status 0待生成 1.已生成大纲 2.正在生成ppt 3 已完成 4.失败 + */ ++ (void)requestPptHestoryData:(UIView *)view + page:(NSString *)page + status:(NSString *)status + Callback:(completeModeBlock)callback +{ + NSMutableDictionary *dicQuery = [NSMutableDictionary new]; + [dicQuery setObject:[Tools isStringnil:page] forKey:@"page"]; + [dicQuery setObject:[Tools isStringnil:status] forKey:@"status"]; + [dicQuery setObject:@"20" forKey:@"size"]; + + NSMutableDictionary *dicHeader = [NSMutableDictionary new]; + + NSMutableDictionary *dicpush = [NSMutableDictionary new]; + + + [YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:1 url:@"api/ppt" paraments:dicpush Headers:dicHeader Query:dicQuery completeBlock:^(id _Nullable responseObject, NSError * _Nullable error) { + BOOL state = NO; + NSString *describle = @""; + if (responseObject==nil) { + describle = @"网络错误"; + BaseModel *model = [BaseModel new]; + model.message =describle; + callback(state,model,describle); + }else{ + NSDictionary *dicAll=responseObject; + describle = dicAll[@"message"]; + if ([[NSString stringWithFormat:@"%@",dicAll[@"code"]] intValue] == 0) { + state = YES; + } + callback(state,[PptHestoryModel yy_modelWithJSON:dicAll],describle); + } + }]; +} @end diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/CorrectWriteCorrectModel.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/CorrectWriteCorrectModel.h index c757e31..832a63e 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/CorrectWriteCorrectModel.h +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/CorrectWriteCorrectModel.h @@ -22,6 +22,10 @@ NS_ASSUME_NONNULL_BEGIN @interface CorrectWriteCorrectModelDataSplit : NSObject /// @property (nonatomic , strong) NSString *origin_content; + +///自己添加的数据 SSEDrawListTextModel +/// +@property (nonatomic , strong) NSArray *arrDianPin; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/ExamplePptDetailModel.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/ExamplePptDetailModel.h index e27d9e1..017137c 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/ExamplePptDetailModel.h +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/ExamplePptDetailModel.h @@ -63,6 +63,8 @@ NS_ASSUME_NONNULL_BEGIN @interface ExamplePptDetailModelDataResultOutlineChaptersItem : NSObject /// @property (nonatomic , strong) NSString *chapterTitle; +/// +@property (nonatomic , strong) NSArray *chapterContents; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptByOutlineModel.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptByOutlineModel.h new file mode 100644 index 0000000..822ac40 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptByOutlineModel.h @@ -0,0 +1,27 @@ +// +// PptByOutlineModel.h +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "BaseModel.h" + +NS_ASSUME_NONNULL_BEGIN +@class PptByOutlineModelData; +@interface PptByOutlineModel : BaseModel +/// +@property (nonatomic , strong) PptByOutlineModelData *data; +@end +@interface PptByOutlineModelData : NSObject +/// +@property (nonatomic , strong) NSString *ID; +/// +@property (nonatomic , strong) NSString *coverImgSrc; +/// +@property (nonatomic , strong) NSString *title; +/// +@property (nonatomic , strong) NSString *subTitle; + +@end +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptByOutlineModel.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptByOutlineModel.m new file mode 100644 index 0000000..59c3049 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptByOutlineModel.m @@ -0,0 +1,21 @@ +// +// PptByOutlineModel.m +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "PptByOutlineModel.h" + +@implementation PptByOutlineModel ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"data" : [PptByOutlineModelData class]}; +} +@end +@implementation PptByOutlineModelData ++ (nullable NSDictionary *)modelCustomPropertyMapper +{ + return @{@"ID" : @"id"}; +} +@end + diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptHestoryModel.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptHestoryModel.h new file mode 100644 index 0000000..8abefa4 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptHestoryModel.h @@ -0,0 +1,38 @@ +// +// PptHestoryModel.h +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "BaseModel.h" + +NS_ASSUME_NONNULL_BEGIN +@class PptHestoryModelData,PptHestoryModelDataItems; +@interface PptHestoryModel : BaseModel +/// +@property (nonatomic , strong) PptHestoryModelData *data; +@end +@interface PptHestoryModelData : NSObject +/// +@property (nonatomic , strong) NSArray *items; +@end +@interface PptHestoryModelDataItems : NSObject +/// +@property (nonatomic , strong) NSString *create_time; +/// +@property (nonatomic , strong) NSString *ID; +/// +@property (nonatomic , strong) NSString *image_src; +/// +@property (nonatomic , strong) NSString *status; +/// +@property (nonatomic , strong) NSString *status_name; +/// +@property (nonatomic , strong) NSString *sub_title; +/// +@property (nonatomic , strong) NSString *title; +/// +@property (nonatomic , strong) NSString *url; +@end +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptHestoryModel.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptHestoryModel.m new file mode 100644 index 0000000..fb1f7d5 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptHestoryModel.m @@ -0,0 +1,26 @@ +// +// PptHestoryModel.m +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "PptHestoryModel.h" + +@implementation PptHestoryModel ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"data" : [PptHestoryModelData class]}; +} +@end +@implementation PptHestoryModelData ++ (nullable NSDictionary *)modelCustomPropertyMapper +{ + return @{@"ID" : @"id"}; +} ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"items" : [PptHestoryModelDataItems class]}; +} +@end +@implementation PptHestoryModelDataItems + +@end diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptOutlineModel.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptOutlineModel.m index 276cf4e..9299d08 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptOutlineModel.m +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptOutlineModel.m @@ -13,6 +13,10 @@ } @end @implementation PptOutlineModelData ++ (nullable NSDictionary *)modelCustomPropertyMapper +{ + return @{@"ID" : @"id"}; +} + (NSDictionary *)modelContainerPropertyGenericClass { return @{@"outline" : [ExamplePptDetailModelDataResultOutline class]}; } diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptProgressModel.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptProgressModel.h new file mode 100644 index 0000000..1d27b5c --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptProgressModel.h @@ -0,0 +1,26 @@ +// +// PptProgressModel.h +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "BaseModel.h" + +NS_ASSUME_NONNULL_BEGIN +@class PptProgressModelData; +@interface PptProgressModel : BaseModel +/// +@property (nonatomic , strong) PptProgressModelData *data; +@end +@interface PptProgressModelData : NSObject +/// +@property (nonatomic , strong) NSString *process; +/// +@property (nonatomic , strong) NSString *pptId; +/// +@property (nonatomic , strong) NSString *pptUrl; +/// +@property (nonatomic , strong) NSString *errMsg; +@end +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptProgressModel.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptProgressModel.m new file mode 100644 index 0000000..cad57ac --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/PptProgressModel.m @@ -0,0 +1,18 @@ +// +// PptProgressModel.m +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "PptProgressModel.h" + +@implementation PptProgressModel ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{@"data" : [PptProgressModelData class]}; +} +@end +@implementation PptProgressModelData + +@end + diff --git a/ProductApp/ProductApp/ProductMain/引导/作文批改/view/StartZWPIView.m b/ProductApp/ProductApp/ProductMain/引导/作文批改/view/StartZWPIView.m index 2c7dc78..0afb171 100644 --- a/ProductApp/ProductApp/ProductMain/引导/作文批改/view/StartZWPIView.m +++ b/ProductApp/ProductApp/ProductMain/引导/作文批改/view/StartZWPIView.m @@ -8,7 +8,7 @@ #import "StartZWPIView.h" #import "JhtBannerScrollView.h" #import "StartZWPIViewCell.h" -#import "StartKTXZPGViewController.h" +#import "StartKTXZPGView.h" #define StartZWPICellHeight UISCREEN_HEIGHT-KMagrinTop-TabHeight-180 @@ -122,11 +122,18 @@ -(void)nextAction { - StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; - vc.type = 1; - vc.isshiyong = YES; - vc.modelDetailZWPG = self.arrdata[self.bannerView.currentIndex]; - [self.viewController.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; +// vc.type = 1; +// vc.isshiyong = YES; +// vc.modelDetailZWPG = self.arrdata[self.bannerView.currentIndex]; +// [self.viewController.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.type = 1; + view.isshiyong = YES; + view.modelDetailZWPG = self.arrdata[self.bannerView.currentIndex]; + [self.viewController.view addSubview:view]; + } -(void)lastAction { diff --git a/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/StartZWPIDetailViewController.m b/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/StartZWPIDetailViewController.m index d75b086..ab5434a 100644 --- a/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/StartZWPIDetailViewController.m +++ b/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/StartZWPIDetailViewController.m @@ -10,6 +10,8 @@ #import "NetWorkManager.h" @interface StartZWPIDetailViewController () +/// +@property (nonatomic , strong) StartZWPIDetailView *viewShow; @end @@ -35,7 +37,7 @@ } -(void)navMuenButtonAction {///分享 - + [self.viewShow shareAction]; } - (void)viewDidLoad { [super viewDidLoad]; @@ -52,6 +54,7 @@ view.modelHestory = self.modelHestory; view.arrXZImages = self.arrXZImages; view.strID = self.strID; + self.viewShow = view; if(self.arrXZImages.count>0) { [LoadAlterView show]; diff --git a/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.h b/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.h index 2f9910a..8c1c6b2 100644 --- a/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.h +++ b/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.h @@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN ///批改历史 @property (nonatomic , strong) CorrectSaveDetailModelData *modelHestory; +///分享 +-(void)shareAction; @end diff --git a/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.m b/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.m index bba27b3..1b986ae 100644 --- a/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.m +++ b/ProductApp/ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.m @@ -14,12 +14,17 @@ #import "StartKTXZPGDetailXZView.h" #import "XieZuoXiangQingViewController.h" +#import "XieZuoFenXiangAlterView.h" + @interface StartZWPIDetailView () /// @property (nonatomic , strong) UIScrollView *scvback; /// @property (nonatomic , strong) UIView *viewback; + +@property (nonatomic , strong) UIView *viewbottom; + /// @property (nonatomic , strong) StartKTXZPGDetailTabView *viewtop; /// @@ -31,6 +36,8 @@ /// @property (nonatomic , strong) StartKTXZPGDetailXZView *viewxz; +/// +@property (nonatomic , strong) XieZuoFenXiangAlterView *viewshare; @end @@ -40,6 +47,9 @@ { if(self = [super initWithFrame:frame]) { + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(haibaoAction:) name:HaiBaoNoTi object:nil]; + UIScrollView *scvback = [[UIScrollView alloc] init]; [self addSubview:scvback]; [scvback mas_makeConstraints:^(MASConstraintMaker *make) { @@ -70,7 +80,7 @@ make.height.offset(TabHeight+20); }]; [self drawBottomView:viewbottom]; - + _viewbottom = viewbottom; } return self; } @@ -78,7 +88,7 @@ { UIView *viewline = [[UIView alloc] init]; [viewline setBackgroundColor:RGBCOLOR(217, 217, 217)]; - [self addSubview:viewline]; + [view addSubview:viewline]; [viewline mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.equalTo(view); make.height.offset(1); @@ -154,6 +164,7 @@ make.top.offset(0); make.width.height.equalTo(scvback); }]; + viewzh.viewshare = self.viewshare; _viewzh = viewzh; /// } @@ -163,13 +174,20 @@ { CGPoint transP = [pan translationInView:self]; float fmax = UISCREEN_HEIGHT-NavHeight-TabHeight-20-80; + + float fmin = UISCREEN_HEIGHT*0.2; + if(self.modelHestory) + { + fmin = UISCREEN_HEIGHT*0.2+TabHeight+20; + } + if(self.viewback.top+transP.y>fmax) { self.viewback.top=fmax; } - else if(self.viewback.top+transP.y0) { UIView *viewlast = nil; @@ -319,8 +341,12 @@ { _modelHestory = modelHestory; if(self.modelHestory==nil)return; - + [self.viewbottom setHidden:YES]; + self.viewback.top = UISCREEN_HEIGHT*0.2+TabHeight+20; UIView *viewlast = nil; + + self.viewshare.arrimageUrls = self.modelHestory.images; + for(NSString *str in self.modelHestory.images) { UIImageView *imgvback = [[UIImageView alloc] init]; @@ -365,6 +391,7 @@ _arrXZImages = arrXZImages; if(arrXZImages.count>0) { + self.viewshare.arrimageUrls = self.arrXZImages; UIView *viewlast = nil; for(UIImage *image in self.arrXZImages) { @@ -405,4 +432,40 @@ self.viewzh.modelPF = modelPF; } +///分享 +-(void)shareAction +{ + if(self.viewzh.isdrawEnd==NO) + { + [HXHud showMessage:@"请等待综合评价写作完成" afterDelayType:0]; + return; + } + [self.viewController.view addSubview:self.viewshare]; + [self.viewshare show]; +} +-(void)haibaoAction:(NSNotification *)notifi +{ + self.viewtop.selecttag = [notifi.object intValue]; + [self.scvbackinfo setContentOffset:CGPointMake(UISCREEN_WIDTH*[notifi.object integerValue], 0)]; + [self showVC:[notifi.object integerValue]]; + + NSDictionary *dicuser = notifi.userInfo; + if(dicuser) + { + int row = [[dicuser objectForKey:@"index"] intValue]; + [self.viewfj setShowRow:row]; + } + +} + +-(XieZuoFenXiangAlterView *)viewshare +{ + if(!_viewshare) + { + _viewshare = [[XieZuoFenXiangAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + [_viewshare setHidden:YES]; + } + return _viewshare; +} + @end diff --git a/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/StartKTXZPGViewController.h b/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/StartKTXZPGViewController.h index 9c2ffa9..14b5a76 100644 --- a/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/StartKTXZPGViewController.h +++ b/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/StartKTXZPGViewController.h @@ -1,7 +1,7 @@ // // StartKTXZPGViewController.h // ProductApp -// +// 只使用了view // Created by 工作 on 2024/9/21. // diff --git a/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/view/StartKTXZPGView.m b/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/view/StartKTXZPGView.m index 15e38d4..58fe395 100644 --- a/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/view/StartKTXZPGView.m +++ b/ProductApp/ProductApp/ProductMain/引导/扫描识别页面/view/StartKTXZPGView.m @@ -42,6 +42,8 @@ { if(self = [super initWithFrame:frame]) { + [self setBackgroundColor:RGBCOLOR(127, 127, 127)]; + UIImageView *imgvback = [[UIImageView alloc] init]; [imgvback setImage:[UIImage imageNamed:@"zhinenAI"]]; [self addSubview:imgvback]; @@ -356,7 +358,7 @@ default: break; } - + [self removeFromSuperview]; } @end diff --git a/ProductApp/ProductApp/ProductMain/引导/智能PPT/大纲/view/StartZNPPTDaGangView.m b/ProductApp/ProductApp/ProductMain/引导/智能PPT/大纲/view/StartZNPPTDaGangView.m index e8687f8..8e45e1a 100644 --- a/ProductApp/ProductApp/ProductMain/引导/智能PPT/大纲/view/StartZNPPTDaGangView.m +++ b/ProductApp/ProductApp/ProductMain/引导/智能PPT/大纲/view/StartZNPPTDaGangView.m @@ -11,6 +11,8 @@ #import "StartZNPPTDaGangTableViewCell.h" #import "UITableView+MoveCell.h" +#import "NetWorkManager.h" +#import "PPtYuLanZSViewController.h" @interface StartZNPPTDaGangView () /// @@ -91,7 +93,14 @@ /// [tableViewinfo setDataWithArray:self.arrContent withBlock:^(NSMutableArray *newArray) { weakSelf.arrContent = newArray; - self.modelDetail.result.outline.chapters = newArray; + if(self.modelZS) + { + self.modelZS.outline.chapters = newArray; + } + else + { + self.modelDetail.result.outline.chapters = newArray; + } }]; UIButton *btnext = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 144, 46)]; @@ -116,9 +125,44 @@ { _modelZS = modelZS; if(modelZS==nil)return; - + ////////// + [self setZSNomoData]; + [self.tableView reloadData]; + [self.tableViewinfo reloadData]; } +-(void)setZSNomoData +{ + self.arrTitle = [NSMutableArray new]; + for(int i = 0 ; i < 2; i++) + { + ExamplePptDetailModelDataResultOutlineChapters *model = [ExamplePptDetailModelDataResultOutlineChapters new]; + model.chapterTitle = self.modelZS.outline.title; + if(i==1) + { + model.chapterTitle = self.modelZS.outline.subTitle; + } + model.isTitle = YES; + [self.arrTitle addObject:model]; + } + self.tableView.dataArray = self.arrTitle; + + float fheight = 0; + self.arrContent = [NSMutableArray new]; + for(ExamplePptDetailModelDataResultOutlineChapters *modelChapters in self.modelZS.outline.chapters) + { + fheight+=47; + fheight+=47*modelChapters.chapterContents.count; + } + [self.arrContent addObjectsFromArray:self.modelZS.outline.chapters]; + self.tableViewinfo.dataArray = self.arrContent; + + [self.tableViewinfo mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.offset(fheight+10); + }]; +} + +////引导页数据 -(void)setModelDetail:(ExamplePptDetailModelData *)modelDetail { _modelDetail = modelDetail; @@ -161,21 +205,21 @@ -(void)nextAction { - for(int i = 0 ; i < self.arrTitle.count; i++) - { - ExamplePptDetailModelDataResultOutlineChapters *model = self.arrTitle[i]; - if(i==1) - { - self.modelDetail.result.outline.subTitle = model.chapterTitle; - } - else - { - self.modelDetail.result.outline.title = model.chapterTitle; - } - } [StartZNPPTDaGangAlterView show]; if(self.isyindao) { + for(int i = 0 ; i < self.arrTitle.count; i++) + { + ExamplePptDetailModelDataResultOutlineChapters *model = self.arrTitle[i]; + if(i==1) + { + self.modelDetail.result.outline.subTitle = model.chapterTitle; + } + else + { + self.modelDetail.result.outline.title = model.chapterTitle; + } + } __block float fvalue = 0.0; [NSTimer scheduledTimerWithTimeInterval:0.01 repeats:YES block:^(NSTimer * _Nonnull timer) { @@ -197,9 +241,65 @@ } else { + for(int i = 0 ; i < self.arrTitle.count; i++) + { + ExamplePptDetailModelDataResultOutlineChapters *model = self.arrTitle[i]; + if(i==1) + { + self.modelZS.outline.subTitle = model.chapterTitle; + } + else + { + self.modelZS.outline.title = model.chapterTitle; + } + } + /// + NSDictionary *dicpush = [self.modelZS yy_modelToJSONObject]; + [NetWorkManager requestPptBylineData:self dicpush:dicpush Callback:^(BOOL state, PptByOutlineModel *responseObject, NSString * _Nullable describle) { + if(state) + { + [self getJinDu:responseObject.data.ID]; + } + else + { + [StartZNPPTDaGangAlterView dismis]; + [HXHud showMessage:responseObject.message afterDelayType:1]; + } + }]; } } + +-(void)getJinDu:(NSString *)strid +{ + [NetWorkManager requestPptProgressData:self ID:strid Callback:^(BOOL state, PptProgressModel *responseObject, NSString * _Nullable describle) { + if(state) + { + float fvalue= responseObject.data.process.intValue/100.0; + + if(fvalue<1) + { + [StartZNPPTDaGangAlterView setShowValue:fvalue]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self getJinDu:strid]; + }); + } + else + { + [StartZNPPTDaGangAlterView dismis]; + PPtYuLanZSViewController *vc = [PPtYuLanZSViewController new]; + vc.modelZS = responseObject.data; + [self.viewController.navigationController pushViewController:vc animated:YES]; + } + + } + else + { + [HXHud showMessage:responseObject.message afterDelayType:1]; + } + }]; +} + #pragma mark - UITableView -(void)scrollViewDidScroll:(UIScrollView *)scrollView { diff --git a/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/PPtYuLanZSViewController.h b/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/PPtYuLanZSViewController.h new file mode 100644 index 0000000..1d12441 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/PPtYuLanZSViewController.h @@ -0,0 +1,17 @@ +// +// PPtYuLanZSViewController.h +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "BaseViewController.h" +#import "PptProgressModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface PPtYuLanZSViewController : BaseViewController +/// +@property (nonatomic , strong) PptProgressModelData *modelZS; +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/PPtYuLanZSViewController.m b/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/PPtYuLanZSViewController.m new file mode 100644 index 0000000..782cce6 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/PPtYuLanZSViewController.m @@ -0,0 +1,171 @@ +// +// PPtYuLanZSViewController.m +// ProductApp +// +// Created by 工作 on 2024/11/4. +// + +#import "PPtYuLanZSViewController.h" +#import "MDBwebVIew.h" + +@interface PPtYuLanZSViewController () +@property (nonatomic , strong) MDBwebVIew *webview; +/// +@property (nonatomic , strong) NSString *strpath; +@end + +@implementation PPtYuLanZSViewController + +- (UIStatusBarStyle)preferredStatusBarStyle { + return UIStatusBarStyleDefault; +} +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:YES animated:animated]; + [self showNaviGationView:NO]; + [self.navigationView setBackgroundColor:[UIColor whiteColor]]; + [self.navigationView setTitle:@"智能PPT生成" titleColor:RGBCOLOR(51, 51, 51)]; +} +-(void)navBackButtonAction +{ + NSArray *arrvc = self.navigationController.viewControllers; + [self.navigationController popToViewController:arrvc[1] animated:YES]; +} +- (void)viewDidLoad { + [super viewDidLoad]; + [self.view setBackgroundColor:RGBCOLOR(246, 249, 250)]; + + UIScrollView *scvback = [[UIScrollView alloc] init]; + [self.view addSubview:scvback]; + [scvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(0); + make.top.offset(NavHeight); + make.width.equalTo(self.view); + make.height.equalTo(self.view).offset(-NavHeight-TabHeight-30); + }]; + + ///加载文档 + MDBwebVIew *webview = [[MDBwebVIew alloc] init]; + [scvback addSubview:webview]; + [webview setDelegate:self]; + [webview mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(scvback); + make.top.offset(5); + make.height.offset(10); + }]; + _webview = webview; + + [scvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(webview); + }]; + + UIView *viewbottom = [[UIView alloc] init]; + [viewbottom setBackgroundColor:[UIColor whiteColor]]; + [self.view addSubview:viewbottom]; + [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self.view); + make.height.offset(TabHeight+20); + }]; + [self drawBottomView:viewbottom]; + + if(self.modelZS) + { + [self loadDataInfo:self.modelZS.pptUrl]; + } +} + +-(void)loadDataInfo:(NSString *)strurl +{ + [LoadAlterView show]; + NSString *strlastpath = [strurl.lastPathComponent stringByRemovingPercentEncoding]; + if(strlastpath==nil) + { + strlastpath = strurl.lastPathComponent; + } + NSString *strpath = [self fuJianPath:strlastpath]; + if([NSData dataWithContentsOfFile:strpath]!=nil) + { + [self.webview loadDocument:strpath]; + self.strpath = strpath; + [LoadAlterView dismiss]; + } + else + { + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + NSData *data = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",strurl]]]; + [data writeToFile:strpath atomically:YES]; + dispatch_async(dispatch_get_main_queue(), ^{ + [HXLoadingHUD dismiss]; + [self.webview loadDocument:strpath]; + self.strpath = strpath; + [LoadAlterView dismiss]; + }); + }); + } +} +///附件路径 +- (NSString *) fuJianPath:(NSString *)fileNmaeParams +{ + NSString* docDir = [NSString stringWithFormat:@"%@/Documents/pengfujian", NSHomeDirectory()]; + [[NSFileManager defaultManager] createDirectoryAtPath:docDir withIntermediateDirectories:YES attributes:nil error:nil]; + NSString *imageDir = [NSString stringWithFormat:@"%@/Documents/pengfujian/%@", NSHomeDirectory(),fileNmaeParams]; + + return imageDir; +} + +-(void)webViewDidFinishLoad:(float)h webview:(MDBwebVIew *)webView +{ + [webView mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.offset(h); + }]; +} + +-(void)drawBottomView:(UIView *)view +{ + UIView *viewline = [[UIView alloc] init]; + [viewline setBackgroundColor:RGBCOLOR(217, 217, 217)]; + [view addSubview:viewline]; + [viewline mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.equalTo(view); + make.height.offset(1); + }]; + + UIButton *btpigai = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH-40, 44)]; + [btpigai setTitle:@"分享" forState:UIControlStateNormal]; + [btpigai setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [btpigai.titleLabel setFont:[UIFont boldSystemFontOfSize:16]]; + [btpigai.layer setMasksToBounds:YES]; + [btpigai.layer setCornerRadius:5]; + [view addSubview:btpigai]; + [btpigai mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(20); + make.right.equalTo(view).offset(-20); + make.top.offset(10); + make.height.offset(44); + }]; + [btpigai addTarget:self action:@selector(shareAction) forControlEvents:UIControlEventTouchUpInside]; + [Tools changedView:btpigai colors:MainJBColors startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)]; +} + +-(void)shareAction +{ + NSMutableArray *arrtemp = [NSMutableArray array]; + [arrtemp addObject:[NSURL fileURLWithPath:self.strpath]]; + + UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:arrtemp applicationActivities:nil]; + //__weak typeof(self) weakself = self; + activityVC.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) { + //上面判断是写的失败详细内容,若需求不需要这么详细,直接下面这段代码就可以 + if (activityType != nil && completed) { + //成功 + }else{ + //失败 + } + }; + [self presentViewController:activityVC animated:YES completion:^{ + + }]; +} + + +@end diff --git a/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/StartZNPPTYuLanViewController.m b/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/StartZNPPTYuLanViewController.m index a611065..a3589f7 100644 --- a/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/StartZNPPTYuLanViewController.m +++ b/ProductApp/ProductApp/ProductMain/引导/智能PPT/预览PPT/StartZNPPTYuLanViewController.m @@ -59,13 +59,8 @@ make.bottom.equalTo(self.navigationView).offset(-12); }]; - NSString *strtt = @"下载PPT"; - float f_width = 79; - if(self.isyindao) - { - strtt = @"生成自己的PPT"; - f_width = 121; - } + NSString *strtt = @"生成自己的PPT"; + float f_width = 121; UIButton *btcreate = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, f_width, 34)]; [btcreate setTitle:strtt forState:UIControlStateNormal]; [btcreate setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m index c2bac10..7f93f15 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m @@ -6,7 +6,7 @@ // #import "StartKTXZWenZhangView.h" -#import "StartKTXZPGViewController.h" +#import "StartKTXZPGView.h" @interface StartKTXZWenZhangView () @@ -452,10 +452,16 @@ return; } - StartKTXZPGViewController *vc = [[StartKTXZPGViewController alloc] init]; - vc.isshiyong = YES; - vc.modelDetailYDY = self.modelDetailYDY; - [self.viewController.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [[StartKTXZPGViewController alloc] init]; +// vc.isshiyong = YES; +// vc.modelDetailYDY = self.modelDetailYDY; +// [self.viewController.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.isshiyong = YES; + view.modelDetailYDY = self.modelDetailYDY; + [self.viewController.view addSubview:view]; + } @end diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/StartKTXZPGDetailViewController.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/StartKTXZPGDetailViewController.m index 5c9c885..2dc9a8b 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/StartKTXZPGDetailViewController.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/StartKTXZPGDetailViewController.m @@ -124,6 +124,7 @@ } }]; + } } diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/StartKTXZPGDetailView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/StartKTXZPGDetailView.m index d5e4a02..8b73a97 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/StartKTXZPGDetailView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/StartKTXZPGDetailView.m @@ -34,6 +34,9 @@ /// @property (nonatomic , strong) UIButton *btpigai; +/// +@property (nonatomic , strong) XieZuoFenXiangAlterView *viewshare; + @end @implementation StartKTXZPGDetailView @@ -42,6 +45,8 @@ { if(self = [super initWithFrame:frame]) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(haibaoAction:) name:HaiBaoNoTi object:nil]; + UIScrollView *scvback = [[UIScrollView alloc] init]; [self addSubview:scvback]; [scvback mas_makeConstraints:^(MASConstraintMaker *make) { @@ -80,7 +85,7 @@ { UIView *viewline = [[UIView alloc] init]; [viewline setBackgroundColor:RGBCOLOR(217, 217, 217)]; - [self addSubview:viewline]; + [view addSubview:viewline]; [viewline mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.equalTo(view); make.height.offset(1); @@ -158,6 +163,7 @@ make.top.offset(0); make.width.height.equalTo(scvback); }]; + viewzh.viewshare = self.viewshare; _viewzh = viewzh; /// } @@ -218,6 +224,7 @@ make.top.offset(0); make.width.height.equalTo(self.scvbackinfo); }]; + viewfj.viewshare = self.viewshare; viewfj.modelResult = self.modelDetailYDY.result; viewfj.modelContentItems = self.modelContentItems; _viewfj = viewfj; @@ -234,6 +241,7 @@ make.top.offset(0); make.width.height.equalTo(self.scvbackinfo); }]; + viewxz.viewshare = self.viewshare; viewxz.modelResult = self.modelDetailYDY.result; viewxz.strID = self.strID; _viewxz = viewxz; @@ -243,8 +251,13 @@ -(void)shareShow { - XieZuoFenXiangAlterView *view = [[XieZuoFenXiangAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; - [self.superview addSubview:view]; + if(self.viewzh.isdrawEnd==NO) + { + [HXHud showMessage:@"请等待综合评价写作完成" afterDelayType:0]; + return; + } + [self.viewController.view addSubview:self.viewshare]; + [self.viewshare show]; } @@ -313,6 +326,8 @@ _arrXZImages = arrXZImages; if(arrXZImages.count>0) { + self.viewshare.arrimageUrls = self.arrXZImages; + UIView *viewlast = nil; for(UIImage *image in self.arrXZImages) { @@ -352,5 +367,30 @@ self.viewzh.modelPF = modelPF; } +-(void)haibaoAction:(NSNotification *)notifi +{ + self.viewtop.selecttag = [notifi.object intValue]; + [self.scvbackinfo setContentOffset:CGPointMake(UISCREEN_WIDTH*[notifi.object integerValue], 0)]; + [self showVC:[notifi.object integerValue]]; + + NSDictionary *dicuser = notifi.userInfo; + if(dicuser) + { + int row = [[dicuser objectForKey:@"index"] intValue]; + [self.viewfj setShowRow:row]; + } + +} + + +-(XieZuoFenXiangAlterView *)viewshare +{ + if(!_viewshare) + { + _viewshare = [[XieZuoFenXiangAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + [_viewshare setHidden:YES]; + } + return _viewshare; +} @end diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.h b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.h index ebde14f..33143e4 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.h +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.h @@ -7,10 +7,13 @@ #import #import "TextbookInfoModel.h" +#import "XieZuoFenXiangAlterView.h" NS_ASSUME_NONNULL_BEGIN @interface StartKTXZPGDetailXZView : UIView /// +@property (nonatomic , strong) XieZuoFenXiangAlterView *viewshare; +/// @property (nonatomic , strong) TextbookInfoModelDataResult *modelResult; ///正式 diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m index 187eecd..c15cb05 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m @@ -387,8 +387,13 @@ typedef void(^backenddraw)(void); [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) { - [self drawJianYi:self.viewcontent]; - [self getdata]; + dispatch_async(dispatch_get_main_queue(), ^{ + self.viewshare.strSiLu = self.lbwzSL.strValue; + [self.viewshare refValue]; + + [self drawJianYi:self.viewcontent]; + [self getdata]; + }); } if(self.scvback.contentSize.height-self.scvback.height>0) { @@ -437,6 +442,8 @@ typedef void(^backenddraw)(void); { model.isaddEnd = YES; } + self.viewshare.arrXZJianYi = self.arrDraw; + [self.viewshare refValue]; } else { @@ -452,7 +459,7 @@ typedef void(^backenddraw)(void); for(int i = 0 ; i < arrtt.count;i++) { NSString *str = arrtt[i]; - if([str rangeOfString:@"*"].length==0)break; +// if([str rangeOfString:@"*"].length==0)break; if(i>=self.arrDraw.count||str.length==0)break; SSEDrawModel *model = self.arrDraw[i]; NSArray *arrson; diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.h b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.h index 9e2419c..e9050dc 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.h +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.h @@ -8,10 +8,13 @@ #import #import "TextbookInfoModel.h" #import "CorrectWriteCorrectModel.h" +#import "XieZuoFenXiangAlterView.h" NS_ASSUME_NONNULL_BEGIN @interface StartKTXZPGDetailFJItemView : UIView /// +@property (nonatomic , strong) XieZuoFenXiangAlterView *viewshare; +/// @property (nonatomic , strong) TextbookInfoModelDataResultSplit *model; ///正式数据 /// diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m index 2d11638..b7763b8 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m @@ -254,6 +254,11 @@ { model.isaddEnd = YES; } + if(self.modelZS) + { + self.modelZS.arrDianPin = self.arrdata; + } + [self.viewshare refValue]; } else { diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.h b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.h index 5331a27..0006e9f 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.h +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.h @@ -7,18 +7,23 @@ #import #import "TextbookInfoModel.h" - +#import "XieZuoFenXiangAlterView.h" #import "CorrectWriteCorrectModel.h" NS_ASSUME_NONNULL_BEGIN @interface StartKTXZPGDetailFJView : UIView /// +@property (nonatomic , strong) XieZuoFenXiangAlterView *viewshare; +/// @property (nonatomic , strong) TextbookInfoModelDataResult *modelResult; /////////正式数据 ///句子数据 @property (nonatomic , strong) CorrectWriteCorrectModelData *modelContentItems; +///显示第几句点评 +-(void)setShowRow:(int)row; + @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.m index adb345f..a82c52f 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJView.m @@ -9,6 +9,8 @@ #import "StartKTXZPGDetailFJItemView.h" @interface StartKTXZPGDetailFJView () +/// +@property (nonatomic , strong) NSMutableArray *arrbtn; @property (nonatomic , strong) UIView *viewtop; /// @property (nonatomic , strong) UIButton *btselect; @@ -60,6 +62,7 @@ }]; [scvback setShowsHorizontalScrollIndicator:NO]; self.arrViews = [NSMutableArray new]; + self.arrbtn = [NSMutableArray new]; UIView *viewlast = nil; for(int i = 0 ; i < values.count; i++) { @@ -92,6 +95,7 @@ [btitem setBackgroundColor:[UIColor whiteColor]]; [btitem.layer setBorderColor:RGBCOLOR(216, 216, 216).CGColor]; } + [self.arrbtn addObject:btitem]; viewlast = btitem; [self.arrViews addObject:@""]; } @@ -121,6 +125,7 @@ make.left.offset(UISCREEN_WIDTH*sender.tag); make.height.equalTo(self.scvback); }]; + viewone.viewshare = self.viewshare; if(self.modelResult) { viewone.model = self.modelResult.split_review[sender.tag]; @@ -171,12 +176,23 @@ make.top.offset(0); make.height.equalTo(self.scvback); }]; + viewone.viewshare = self.viewshare; self.arrViews[0] = viewone; viewone.strID = self.modelContentItems.ID; viewone.index = @"0"; viewone.modelZS = self.modelContentItems.split_review.firstObject; + + self.viewshare.arrOrigin_content = self.modelContentItems.split_review; } } +///显示第几句点评 +-(void)setShowRow:(int)row +{ + if(row >= self.arrViews.count)return; + [self topAction:self.arrbtn[row]]; + +} + @end diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.h b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.h index 3be9ddc..1b8b958 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.h +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.h @@ -11,10 +11,16 @@ #import "CorrectSaveDetailModel.h" +#import "XieZuoFenXiangAlterView.h" + NS_ASSUME_NONNULL_BEGIN @interface StartKTXZPGDetailZHView : UIView @property (nonatomic , assign) BOOL isdrawEnd; + +/// +@property (nonatomic , strong) XieZuoFenXiangAlterView *viewshare; + /// @property (nonatomic , strong) TextbookInfoModelDataResult *modelResult; @@ -27,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN ///批改历史 @property (nonatomic , strong) CorrectSaveDetailModelDataResult *modelHestoryResult; + @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m index 02c4882..98491f6 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m @@ -316,7 +316,6 @@ if(modelResult==nil)return; [self drawTopView:self.viewtop]; - NSArray *arrtt = @[@"",@"优点",@"建议"]; NSArray *arrvalues = @[[Tools isStringnilkong:modelResult.complex_review.full_review.review_content],[Tools isStringnilkong:modelResult.complex_review.full_review.advantage],[Tools isStringnilkong:modelResult.complex_review.full_review.disadvantage]]; self.arrdata = [NSMutableArray new]; @@ -347,6 +346,9 @@ { _modelPF = modelPF; if(modelPF==nil)return; + + self.viewshare.modelPF = modelPF; + [self drawTopView:self.viewtop]; [self getdata]; } @@ -354,6 +356,9 @@ { _modelHestoryResult = modelHestoryResult; if(modelHestoryResult==nil)return; + + self.viewshare.modelPF = modelHestoryResult.write_correct_score; + [self drawTopView:self.viewtop]; NSString *value = modelHestoryResult.write_correct_evaluate; @@ -387,6 +392,8 @@ self.iDraw = 0; self.viewDarwLast = nil; + self.viewshare.arrQWDP = self.arrdata; + dispatch_async(dispatch_get_main_queue(), ^{ if(self.isStartDrawText==NO) { @@ -420,6 +427,9 @@ self.isdrawEnd = NO; self.iDraw = 0; self.viewDarwLast = nil; + + self.viewshare.arrQWDP = self.arrdata; + } -(void)getdata { @@ -458,6 +468,7 @@ { model.isaddEnd = YES; } + [self.viewshare refValue]; } else { diff --git a/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.h b/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.h index cdbae0e..701f24f 100644 --- a/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.h +++ b/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.h @@ -10,7 +10,8 @@ NS_ASSUME_NONNULL_BEGIN @interface ShareAlterView : UIView - +///分享图片 0好友 1朋友圈 ++(void)shareImage:(UIImage *)image type:(int)type; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.m b/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.m index 6d58626..1b69746 100644 --- a/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.m +++ b/ProductApp/ProductApp/ProductMain/我的/分享/ShareAlterView.m @@ -176,5 +176,49 @@ } } - +///分享图片 ++(void)shareImage:(UIImage *)image type:(int)type +{ + switch (type) { + case 0: + { + WXImageObject *webpageObject = [WXImageObject object]; + webpageObject.imageData = UIImagePNGRepresentation(image); + WXMediaMessage *message = [WXMediaMessage message]; + [message setThumbImage:[UIImage imageNamed:@"logo"]]; + message.mediaObject = webpageObject; + + SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init]; + req.bText = NO; + req.message = message; + req.scene = WXSceneSession; + [WXApi sendReq:req completion:^(BOOL success) { + + }]; + } + break; + case 1: + { + WXImageObject *webpageObject = [WXImageObject object]; + webpageObject.imageData = UIImagePNGRepresentation(image); + WXMediaMessage *message = [WXMediaMessage message]; + [message setThumbImage:[UIImage imageNamed:@"logo"]]; + message.mediaObject = webpageObject; + + SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init]; + req.bText = NO; + req.message = message; + req.scene = WXSceneTimeline; + [WXApi sendReq:req completion:^(BOOL success) { + + }]; + } + break; + default: + { + + } + break; + } +} @end diff --git a/ProductApp/ProductApp/ProductMain/首页/ShouYeViewController.m b/ProductApp/ProductApp/ProductMain/首页/ShouYeViewController.m index 515572a..505a368 100644 --- a/ProductApp/ProductApp/ProductMain/首页/ShouYeViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/ShouYeViewController.m @@ -435,8 +435,8 @@ [PublicNetWorkManager requestUserData:self.view Callback:^(BOOL state, UserModel *responseObject, NSString * _Nullable describle) { if(state) { + [UserInfoModel setIdentityType:responseObject.data.identityType]; [UserInfoModel shareModel].isAllLevel = responseObject.data.isAllLevel; - [UserInfoModel shareModel].identityType = responseObject.data.identityType; [UserInfoModel shareModel].user_stage = responseObject.data.user_stage; [UserInfoModel setUserid:responseObject.data.user_id]; diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.h b/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.h index d488d1a..04a1163 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.h +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.h @@ -6,10 +6,25 @@ // #import "BaseViewController.h" - +#import "WriteCorrectScoreModel.h" NS_ASSUME_NONNULL_BEGIN @interface FenXiangHaiBaoViewController : BaseViewController +///图片 nsstring uiimage +@property (nonatomic , strong) NSArray *arrimageUrls; +///维度评分 +@property (nonatomic , strong) WriteCorrectScoreModelData *modelPF; +///全文点评 SSEDrawListTextModel +@property (nonatomic , strong) NSArray *arrQWDP; + +///句子点评 +@property (nonatomic , strong) NSArray *arrOrigin_content; + +///思路点评 +@property (nonatomic , strong) NSString *strSiLu; + +///写作建议 SSEDrawModel +@property (nonatomic , strong) NSArray *arrXZJianYi; @end diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.m index bcb513a..db482f0 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/FenXiangHaiBaoViewController.m @@ -34,7 +34,12 @@ make.left.right.bottom.equalTo(self.view); make.top.offset(NavHeight); }]; - + view.arrimageUrls = self.arrimageUrls; + view.modelPF = self.modelPF; + view.arrQWDP = self.arrQWDP; + view.arrOrigin_content = self.arrOrigin_content; + view.strSiLu = self.strSiLu; + view.arrXZJianYi = self.arrXZJianYi; } diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.h b/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.h index 0aea859..9a8cba9 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.h +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.h @@ -6,11 +6,33 @@ // #import - +#import "WriteCorrectScoreModel.h" NS_ASSUME_NONNULL_BEGIN +#define HaiBaoNoTi @"HaiBaoNoTi" + @interface XieZuoFenXiangAlterView : UIView +///图片 nsstring uiimage +@property (nonatomic , strong) NSArray *arrimageUrls; +///维度评分 +@property (nonatomic , strong) WriteCorrectScoreModelData *modelPF; +///全文点评 SSEDrawListTextModel +@property (nonatomic , strong) NSArray *arrQWDP; + +///句子点评 +@property (nonatomic , strong) NSArray *arrOrigin_content; + +///思路点评 +@property (nonatomic , strong) NSString *strSiLu; + +///写作建议 SSEDrawModel +@property (nonatomic , strong) NSArray *arrXZJianYi; + +-(void)show; +///刷新数据 +-(void)refValue; + @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.m index 8179ed2..5409384 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/XieZuoFenXiangAlterView.m @@ -10,11 +10,21 @@ #import "XieZuoFenXiangAlterNOTableViewCell.h" #import "FenXiangHaiBaoViewController.h" +#import "RoleTreeModel.h" +#import "SSEDrawListTextModel.h" +#import "CorrectWriteCorrectModel.h" +#import "SSEDrawModel.h" @interface XieZuoFenXiangAlterView () /// +@property (nonatomic , strong) UIView *viewback; +/// @property (nonatomic , strong) UITableView *tableView; +/// +@property (nonatomic , strong) NSMutableArray *arrdata; +@property (nonatomic , strong) NSMutableArray *arrdata1; +@property (nonatomic , strong) NSMutableArray *arrdata2; @end @implementation XieZuoFenXiangAlterView @@ -25,19 +35,15 @@ { [self setBackgroundColor:RGBACOLOR(0, 0, 0, 0.4)]; - UIView *viewback = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT*0.75)]; + UIView *viewback = [[UIView alloc] initWithFrame:CGRectMake(0, UISCREEN_HEIGHT, UISCREEN_WIDTH, UISCREEN_HEIGHT*0.75)]; [viewback setBackgroundColor:RGBCOLOR(242, 242, 242)]; [self addSubview:viewback]; - [viewback mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.bottom.equalTo(self); - make.height.offset(UISCREEN_HEIGHT*0.75); - }]; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect: viewback.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(20,20)]; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = viewback.bounds; maskLayer.path = maskPath.CGPath; viewback.layer.mask = maskLayer; - + _viewback = viewback; UIImageView *imgvback = [[UIImageView alloc] init]; [imgvback setImage:[UIImage imageNamed:@"fenxiang_back"]]; @@ -119,18 +125,91 @@ { if([touch.view isEqual:self]) { - [self removeFromSuperview]; + [self dismissAction]; return; } } } - +-(void)dismissAction +{ + [UIView animateWithDuration:0.3 animations:^{ + + self.viewback.top = UISCREEN_HEIGHT; + } completion:^(BOOL finished) { + [self setHidden:YES]; + }]; +} -(void)okAction { + [self dismissAction]; + + BOOL isselect = NO; + for(baseInfoModel *model in self.arrdata) + { + if(model.select==YES) + { + isselect = YES; + } + } + for(baseInfoModel *model in self.arrdata1) + { + if(model.select==YES) + { + isselect = YES; + } + } + for(baseInfoModel *model in self.arrdata2) + { + if(model.select==YES) + { + isselect = YES; + } + } + if(isselect==NO) + { + [HXHud showMessage:@"请选择分享内容" afterDelayType:0]; + return; + } + FenXiangHaiBaoViewController *vc = [FenXiangHaiBaoViewController new]; + vc.arrimageUrls = self.arrimageUrls; + if([self getSelectModelValues:self.arrdata tag:0]) + { + vc.modelPF = self.modelPF; + } + if([self getSelectModelValues:self.arrdata tag:1]) + { + vc.arrQWDP = self.arrQWDP; + } + + NSMutableArray *arrfenju = [NSMutableArray new]; + for(int i = 0 ; i < self.arrdata1.count; i++) + { + baseInfoModel *model = self.arrdata1[i]; + if(model.select && model.isvalue) + { + [arrfenju addObject:self.arrOrigin_content[i]]; + } + } + vc.arrOrigin_content = arrfenju; + + if([self getSelectModelValues:self.arrdata2 tag:0]) + { + vc.strSiLu = self.strSiLu; + } + if([self getSelectModelValues:self.arrdata2 tag:1]) + { + vc.arrXZJianYi = self.arrXZJianYi; + } + [self.viewController.navigationController pushViewController:vc animated:YES]; } - +-(BOOL)getSelectModelValues:(NSArray *)arr tag:(int)tag +{ + if(tag>=arr.count)return NO; + baseInfoModel *model = arr[tag]; + return model.select; +} #pragma mark - UITableView -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { @@ -140,13 +219,30 @@ { if(section==0) { - return 2; + return self.arrdata.count; + } + else if (section==1) + { + return self.arrdata1.count==0?1:self.arrdata1.count; + } + else + { + return self.arrdata2.count==0?1:self.arrdata2.count; } - return 1; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if(indexPath.section==0) + NSArray *arrtemp = self.arrdata; + if(indexPath.section==1) + { + arrtemp = self.arrdata1; + } + else if (indexPath.section==2) + { + arrtemp = self.arrdata2; + } + + if(arrtemp.count>0) { static NSString *strcell = @"XieZuoFenXiangAlterTableViewCell"; XieZuoFenXiangAlterTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:strcell]; @@ -160,14 +256,24 @@ { cell.typeline = 1; } - else if (indexPath.row==1) - {///最优一个 + else if (indexPath.row==arrtemp.count-1) + {///最后一个 cell.typeline = 0; } else { cell.typeline = 2; } + if(arrtemp.count==1) + { + cell.typeline = 3; + } + cell.model = arrtemp[indexPath.row]; + [cell setRefTable:^{ + [self.tableView reloadData]; + }]; + [cell.bthuoqu setTag:indexPath.section*1000+indexPath.row]; + [cell.bthuoqu addTarget:self action:@selector(huoquItemAction:) forControlEvents:UIControlEventTouchUpInside]; return cell; } @@ -195,12 +301,23 @@ } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - ///暂无内容 40 - if(indexPath.section==0) + NSArray *arrtemp = self.arrdata; + if(indexPath.section==1) { - return 70; + arrtemp = self.arrdata1; + } + else if (indexPath.section==2) + { + arrtemp = self.arrdata2; + } + if(arrtemp.count>0) + { + return 80; + } + else + { + return 40; } - return 40; } -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { @@ -233,34 +350,57 @@ make.centerY.equalTo(imgvback); }]; - UIButton *bthuoqu = [[UIButton alloc] init]; - [bthuoqu setTitle:@"点击获取" forState:UIControlStateNormal]; - [bthuoqu setTitleColor:RGBCOLOR(108, 119, 246) forState:UIControlStateNormal]; - [bthuoqu.titleLabel setFont:[UIFont systemFontOfSize:14]]; - [bthuoqu.layer setMasksToBounds:YES]; - [bthuoqu.layer setCornerRadius:4]; - [bthuoqu setBackgroundColor:RGBCOLOR(239, 240, 255)]; - [view addSubview:bthuoqu]; - [bthuoqu mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.sizeOffset(CGSizeMake(72, 28)); - make.centerY.equalTo(imgvback); - make.right.equalTo(view).offset(-16); - }]; - [bthuoqu setTag:section]; - [bthuoqu addTarget:self action:@selector(huoquAction:) forControlEvents:UIControlEventTouchUpInside]; + NSArray *arrtemp = self.arrdata; + if(section==1) + { + arrtemp = self.arrdata1; + } + else if (section==2) + { + arrtemp = self.arrdata2; + } - UIButton *btselect = [[UIButton alloc] init]; - [btselect setImage:[UIImage imageNamed:@"fenxiang_selectN"] forState:UIControlStateNormal]; - [btselect setImage:[UIImage imageNamed:@"fenxiang_selectY"] forState:UIControlStateSelected]; - [view addSubview:btselect]; - [btselect mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.offset(30); - make.centerY.equalTo(imgvback); - make.right.equalTo(view).offset(-10); - }]; - [btselect setHidden:YES]; - [btselect setTag:section]; - [btselect addTarget:self action:@selector(selectAllAction:) forControlEvents:UIControlEventTouchUpInside]; + if(arrtemp.count>0) + { + UISwitch *sw = [[UISwitch alloc] init]; + [sw setTag:section]; + [sw addTarget:self action:@selector(selectAllAction:) forControlEvents:UIControlEventValueChanged]; + [view addSubview:sw]; + [sw mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.offset(31); + make.width.offset(51); + make.centerY.equalTo(imgvback); + make.right.equalTo(view).offset(-10); + }]; + sw.transform = CGAffineTransformScale(sw.transform, 0.8, 0.8); + BOOL isselectall = YES; + for(baseInfoModel *model in arrtemp) + { + if(model.select==NO) + { + isselectall = NO; + } + } + sw.on = isselectall; + } + else + { + UIButton *bthuoqu = [[UIButton alloc] init]; + [bthuoqu setTitle:@"点击获取" forState:UIControlStateNormal]; + [bthuoqu setTitleColor:RGBCOLOR(108, 119, 246) forState:UIControlStateNormal]; + [bthuoqu.titleLabel setFont:[UIFont systemFontOfSize:14]]; + [bthuoqu.layer setMasksToBounds:YES]; + [bthuoqu.layer setCornerRadius:4]; + [bthuoqu setBackgroundColor:RGBCOLOR(239, 240, 255)]; + [view addSubview:bthuoqu]; + [bthuoqu mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.sizeOffset(CGSizeMake(72, 28)); + make.centerY.equalTo(imgvback); + make.right.equalTo(view).offset(-16); + }]; + [bthuoqu setTag:section]; + [bthuoqu addTarget:self action:@selector(huoquAction:) forControlEvents:UIControlEventTouchUpInside]; + } return view; } @@ -283,15 +423,146 @@ { } -///获取 +///获取 1分句点评 2写作思路 -(void)huoquAction:(UIButton *)sender { - + [self dismissAction]; + [[NSNotificationCenter defaultCenter] postNotificationName:HaiBaoNoTi object:[NSString stringWithFormat:@"%ld",sender.tag] userInfo:nil]; } -///全选分组 --(void)selectAllAction:(UIButton *)sender +///获取一个数据 一般只有分句点评数据需要单独获取 +-(void)huoquItemAction:(UIButton *)sender { - + [self dismissAction]; + if(sender.tag<1000) + { + + } + else if (sender.tag<2000) + {///分句点评 + [[NSNotificationCenter defaultCenter] postNotificationName:HaiBaoNoTi object:@"1" userInfo:@{@"index":[NSString stringWithFormat:@"%ld",sender.tag-1000]}]; + } + else + {///写作思路 + + } } +///全选分组 +-(void)selectAllAction:(UISwitch *)sender +{ + NSArray *arrtemp = self.arrdata; + if(sender.tag==1) + { + arrtemp = self.arrdata1; + } + else if (sender.tag==2) + { + arrtemp = self.arrdata2; + } + for(baseInfoModel *model in arrtemp) + { + model.select = sender.on; + } + [self.tableView reloadData]; +} +-(void)show +{ + [self setHidden:NO]; + [UIView animateWithDuration:0.3 animations:^{ + self.viewback.top = UISCREEN_HEIGHT*0.25; + }]; + [self refValue]; +} +-(void)refValue +{ + if(self.arrdata.count==0) + { + self.arrdata = [NSMutableArray new]; + NSString *strdp = @""; + for(SSEDrawListTextModel *model in self.arrQWDP) + { + strdp = [strdp stringByAppendingString:model.value]; + } + NSArray *arrvalue = @[[NSString stringWithFormat:@"评分标准:%@",[UserInfoModel shareModel].user_stage.parent_name], + [Tools isStringnil:strdp]]; + NSArray *arrtitle = @[@"维度评分",@"全文点评"]; + for(int i = 0 ; i < arrvalue.count; i++) + { + baseInfoModel *model = [baseInfoModel new]; + model.title = arrtitle[i]; + model.info = arrvalue[i]; + model.isvalue = YES; + [self.arrdata addObject:model]; + } + } + + + NSMutableArray *arrdata1 = [NSMutableArray new]; + for(int i = 0 ; i < self.arrOrigin_content.count; i++) + { + baseInfoModel *modellast = nil; + if(i0) + { + baseInfoModel *modellast = nil; + if(self.arrdata2.count>0) + { + modellast = self.arrdata2[0]; + } + + baseInfoModel *model = [baseInfoModel new]; + model.title = @"思路点评"; + model.info = self.strSiLu; + model.isvalue = YES; + model.select = modellast.select; + [arrdata2 addObject:model]; + } + if(self.arrXZJianYi.count>0) + { + NSString *strjy = @""; + for(SSEDrawModel *model in self.arrXZJianYi) + { + if(model.arrSon.count>0) + { + strjy = [NSString stringWithFormat:@"%@%@:%@",strjy,model.title,[model.arrSon componentsJoinedByString:@","]]; + } + } + if(strjy.length>0) + { + baseInfoModel *modellast = nil; + if(self.arrdata2.count>1) + { + modellast = self.arrdata2[1]; + } + + baseInfoModel *model = [baseInfoModel new]; + model.title = @"写作建议"; + model.info = strjy; + model.isvalue = YES; + model.select = modellast.select; + [arrdata2 addObject:model]; + } + } + self.arrdata2 = arrdata2; + [self.tableView reloadData]; +} @end diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.h b/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.h index 9647aff..a1d2aa2 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.h +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.h @@ -8,10 +8,19 @@ #import NS_ASSUME_NONNULL_BEGIN - +typedef void(^XieZuoFenXiangAlterTableViewCellRef)(void); @interface XieZuoFenXiangAlterTableViewCell : UITableViewCell +/// +@property (nonatomic , strong) UIButton *bthuoqu; ///0上面 1下面 2全部 @property (nonatomic , assign) NSInteger typeline; + +/// +@property (nonatomic , strong) baseInfoModel *model; + +/// +@property (nonatomic , strong) XieZuoFenXiangAlterTableViewCellRef refTable; + @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.m index 6c71dde..79f2eaf 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/cell/XieZuoFenXiangAlterTableViewCell.m @@ -71,14 +71,31 @@ make.centerY.equalTo(viewpoint); make.right.equalTo(viewback).offset(-10); }]; + [btselect addTarget:self action:@selector(selectAction:) forControlEvents:UIControlEventTouchUpInside]; _btselect = btselect; + UIButton *bthuoqu = [[UIButton alloc] init]; + [bthuoqu setTitle:@"点击获取" forState:UIControlStateNormal]; + [bthuoqu setTitleColor:RGBCOLOR(108, 119, 246) forState:UIControlStateNormal]; + [bthuoqu.titleLabel setFont:[UIFont systemFontOfSize:14]]; + [bthuoqu.layer setMasksToBounds:YES]; + [bthuoqu.layer setCornerRadius:4]; + [bthuoqu setBackgroundColor:RGBCOLOR(239, 240, 255)]; + [viewback addSubview:bthuoqu]; + [bthuoqu mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.sizeOffset(CGSizeMake(72, 28)); + make.centerY.equalTo(viewpoint); + make.right.equalTo(viewback).offset(-10); + }]; + [bthuoqu setHidden:YES]; + _bthuoqu = bthuoqu; + UILabel *lbinfo = [[UILabel alloc] init]; [lbinfo setText:@"评分标准:小学"]; [lbinfo setTextColor:RGBCOLOR(102, 102, 102)]; [lbinfo setTextAlignment:NSTextAlignmentLeft]; [lbinfo setFont:[UIFont systemFontOfSize:13]]; - [lbinfo setNumberOfLines:0]; + [lbinfo setNumberOfLines:2]; [viewback addSubview:lbinfo]; [lbinfo mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(lbname); @@ -144,5 +161,25 @@ [self.imgvline setHidden:YES]; } } +-(void)setModel:(baseInfoModel *)model +{ + _model = model; + self.lbname.text = model.title; + self.lbinfo.text = model.info; + self.btselect.hidden = !model.isvalue; + self.btselect.selected = model.select; + [self.bthuoqu setHidden:model.isvalue]; +} + +-(void)selectAction:(UIButton *)sender +{ + sender.selected = !sender.selected; + self.model.select = sender.selected; + ///刷新列表 + if(self.refTable) + { + self.refTable(); + } +} @end diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.h b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.h index 58ca591..6c72f41 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.h +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.h @@ -6,11 +6,27 @@ // #import - +#import "WriteCorrectScoreModel.h" NS_ASSUME_NONNULL_BEGIN @interface FenXiangHaiBaoView : UIView +///图片 nsstring uiimage +@property (nonatomic , strong) NSArray *arrimageUrls; +///维度评分 +@property (nonatomic , strong) WriteCorrectScoreModelData *modelPF; +///全文点评 SSEDrawListTextModel +@property (nonatomic , strong) NSArray *arrQWDP; + +///句子点评 CorrectWriteCorrectModelDataSplit +@property (nonatomic , strong) NSArray *arrOrigin_content; + +///思路点评 +@property (nonatomic , strong) NSString *strSiLu; + +///写作建议 SSEDrawModel +@property (nonatomic , strong) NSArray *arrXZJianYi; + @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.m index 3002507..3a4abad 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/FenXiangHaiBaoView.m @@ -13,6 +13,10 @@ #import "FXXieZuoJianYiView.h" #import "FXErView.h" +#import "SSEDrawListTextModel.h" +#import "CorrectWriteCorrectModel.h" + +#import "ShareAlterView.h" @interface FenXiangHaiBaoView () /// @@ -54,20 +58,24 @@ make.left.top.width.equalTo(viewback); }]; - [self drawUI]; + } return self; } +-(void)setArrXZJianYi:(NSArray *)arrXZJianYi +{ + _arrXZJianYi = arrXZJianYi; + [self drawUI]; +} -(void)drawUI { ///图片 UIView *viewlast; - for(int i = 0 ; i < 3; i++) + for(int i = 0 ; i < self.arrimageUrls.count; i++) { UIImageView *imgvback = [[UIImageView alloc] init]; - [imgvback setImage:[UIImage imageNamed:[NSString stringWithFormat:@"yd_xs_%d",i]]]; [self.scvback addSubview:imgvback]; [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { if(viewlast) @@ -80,131 +88,223 @@ } make.left.offset(16); make.width.offset(UISCREEN_WIDTH-32); + make.height.offset(100); }]; viewlast = imgvback; + if([self.arrimageUrls[i] isKindOfClass:[UIImage class]]) + { + UIImage *image = self.arrimageUrls[i]; + imgvback.image = image; + [imgvback mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.offset(image.size.height*UISCREEN_WIDTH/image.size.width); + }]; + } + else + { + NSString *str = self.arrimageUrls[i]; + [imgvback sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:nil completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { + if(image) + { + [imgvback mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.offset(image.size.height*UISCREEN_WIDTH/image.size.width); + }]; + } + }]; + } } + UIView *viewline = [[UIView alloc] init]; + [self.scvback addSubview:viewline]; + [viewline mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(self.scvback); + make.top.equalTo(viewlast.mas_bottom); + make.height.offset(1); + }]; + viewlast = viewline; + ///综合评价 - FenXiangHaiBaoInfoSuperView *viewzh = [FenXiangHaiBaoInfoSuperView new]; - [self.scvback addSubview:viewzh]; - [viewzh mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.width.equalTo(self.scvback); - make.top.equalTo(viewlast.mas_bottom).offset(7); - }]; - viewzh.strtitle = @"综合评价"; - - - FenXiangHaiBaoInfoSuperItemView *viewwdpj = [FenXiangHaiBaoInfoSuperItemView new]; - [viewzh addSubview:viewwdpj]; - [viewwdpj mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.offset(16); - make.right.equalTo(viewzh).offset(-16); - make.top.offset(149); - }]; - viewwdpj.strtitle = @"维度评分"; - viewwdpj.type = 0; - FXWDPFView *viewwdpjson = [FXWDPFView new]; - viewwdpj.viewinfo = viewwdpjson; - - - FenXiangHaiBaoInfoSuperItemView *viewqwdp = [FenXiangHaiBaoInfoSuperItemView new]; - [viewzh addSubview:viewqwdp]; - [viewqwdp mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.equalTo(viewwdpj); - make.top.equalTo(viewwdpj.mas_bottom).offset(30); - }]; - viewqwdp.strtitle = @"全文点评"; - viewqwdp.type = 1; - FXTextView *viewqwdpson = [FXTextView new]; - viewqwdp.viewinfo = viewqwdpson; - - [viewzh mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(viewqwdp).offset(35); - }]; - - - - ///分句点评 - FenXiangHaiBaoInfoSuperView *viewfjdp = [FenXiangHaiBaoInfoSuperView new]; - [self.scvback addSubview:viewfjdp]; - [viewfjdp mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.width.equalTo(self.scvback); - make.top.equalTo(viewzh.mas_bottom).offset(35); - }]; - viewfjdp.strtitle = @"分句点评"; - - UIView *viewitemlast = nil; - for(int i = 0 ; i < 5; i++) + if(self.modelPF || self.arrQWDP.count>0) { - FenXiangHaiBaoInfoSuperItemView *viewitem = [FenXiangHaiBaoInfoSuperItemView new]; - [viewfjdp addSubview:viewitem]; - [viewitem mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.offset(16); - make.right.equalTo(viewfjdp).offset(-16); - if(viewitemlast) - { - make.top.equalTo(viewitemlast.mas_bottom).offset(30); - } - else - { - make.top.offset(149); - } + FenXiangHaiBaoInfoSuperView *viewzh = [FenXiangHaiBaoInfoSuperView new]; + [self.scvback addSubview:viewzh]; + [viewzh mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(viewlast); + make.top.equalTo(viewlast.mas_bottom).offset(7); }]; - viewitem.strtitle = @"句子点评①"; - viewitem.type = i%2; - FXTextView *viewitemson = [FXTextView new]; - viewitem.viewinfo = viewitemson; + viewzh.strtitle = @"综合评价"; + UIView *viewlastitem = nil; + if(self.modelPF) + { + FenXiangHaiBaoInfoSuperItemView *viewwdpj = [FenXiangHaiBaoInfoSuperItemView new]; + [viewzh addSubview:viewwdpj]; + [viewwdpj mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.right.equalTo(viewzh).offset(-16); + make.top.offset(149); + }]; + viewwdpj.strtitle = @"维度评分"; + viewwdpj.type = 0; + FXWDPFView *viewwdpjson = [FXWDPFView new]; + viewwdpjson.modelPF = self.modelPF; + viewwdpj.viewinfo = viewwdpjson; + viewlastitem = viewwdpj; + } - viewitemlast = viewitem; + if(self.arrQWDP.count>0) + { + FenXiangHaiBaoInfoSuperItemView *viewqwdp = [FenXiangHaiBaoInfoSuperItemView new]; + [viewzh addSubview:viewqwdp]; + [viewqwdp mas_makeConstraints:^(MASConstraintMaker *make) { + if(viewlastitem) + { + make.left.right.equalTo(viewlastitem); + make.top.equalTo(viewlastitem.mas_bottom).offset(30); + } + else + { + make.left.offset(16); + make.right.equalTo(viewzh).offset(-16); + make.top.offset(149); + } + + }]; + viewqwdp.strtitle = @"全文点评"; + viewqwdp.type = 1; + FXTextView *viewqwdpson = [FXTextView new]; + NSMutableArray *arrtext = [NSMutableArray new]; + for(SSEDrawListTextModel *model in self.arrQWDP) + { + [arrtext addObject:[Tools isStringnilkong:model.value]]; + } + viewqwdpson.arrText = arrtext; + viewqwdp.viewinfo = viewqwdpson; + viewlastitem = viewqwdp; + } + + [viewzh mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(viewlastitem).offset(35); + }]; + + viewlast = viewzh; } - [viewfjdp mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(viewitemlast).offset(35); - }]; + if(self.arrOrigin_content.count>0) + { + ///分句点评 + FenXiangHaiBaoInfoSuperView *viewfjdp = [FenXiangHaiBaoInfoSuperView new]; + [self.scvback addSubview:viewfjdp]; + [viewfjdp mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(viewlast); + make.top.equalTo(viewlast.mas_bottom).offset(35); + }]; + viewfjdp.strtitle = @"分句点评"; + + UIView *viewitemlast = nil; + for(int i = 0 ; i < self.arrOrigin_content.count; i++) + { + CorrectWriteCorrectModelDataSplit *model = self.arrOrigin_content[i]; + FenXiangHaiBaoInfoSuperItemView *viewitem = [FenXiangHaiBaoInfoSuperItemView new]; + [viewfjdp addSubview:viewitem]; + [viewitem mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.right.equalTo(viewfjdp).offset(-16); + if(viewitemlast) + { + make.top.equalTo(viewitemlast.mas_bottom).offset(30); + } + else + { + make.top.offset(149); + } + }]; + viewitem.strtitle = [NSString stringWithFormat:@"句子点评%d",i+1]; + viewitem.type = i%2; + FXTextView *viewitemson = [FXTextView new]; + NSMutableArray *arrtext = [NSMutableArray new]; + for(SSEDrawListTextModel *modelson in model.arrDianPin) + { + [arrtext addObject:[Tools isStringnilkong:modelson.value]]; + } + viewitemson.arrText = arrtext; + viewitem.viewinfo = viewitemson; + + viewitemlast = viewitem; + } + + [viewfjdp mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(viewitemlast).offset(35); + }]; + viewlast = viewfjdp; + } - ///写作思路 - FenXiangHaiBaoInfoSuperView *viewxzsl = [FenXiangHaiBaoInfoSuperView new]; - [self.scvback addSubview:viewxzsl]; - [viewxzsl mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.width.equalTo(viewfjdp); - make.top.equalTo(viewfjdp.mas_bottom).offset(35); - }]; - viewxzsl.strtitle = @"写作思路"; - - FenXiangHaiBaoInfoSuperItemView *viewdianpin = [FenXiangHaiBaoInfoSuperItemView new]; - [viewxzsl addSubview:viewdianpin]; - [viewdianpin mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.offset(16); - make.right.equalTo(viewxzsl).offset(-16); - make.top.offset(149); - }]; - viewdianpin.strtitle = @"思路点评"; - viewdianpin.type = 0; - FXTextView *viewdianpinson = [FXTextView new]; - viewdianpin.viewinfo = viewdianpinson; - - FenXiangHaiBaoInfoSuperItemView *viewjianyi = [FenXiangHaiBaoInfoSuperItemView new]; - [viewxzsl addSubview:viewjianyi]; - [viewjianyi mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.equalTo(viewdianpin); - make.top.equalTo(viewdianpin.mas_bottom).offset(30); - }]; - viewjianyi.strtitle = @"写作建议"; - viewjianyi.type = 1; - FXXieZuoJianYiView *viewjianyison = [FXXieZuoJianYiView new]; - viewjianyi.viewinfo = viewjianyison; - - [viewxzsl mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(viewjianyi); - }]; + if(self.strSiLu || self.arrXZJianYi.count>0) + { + ///写作思路 + FenXiangHaiBaoInfoSuperView *viewxzsl = [FenXiangHaiBaoInfoSuperView new]; + [self.scvback addSubview:viewxzsl]; + [viewxzsl mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.width.equalTo(viewlast); + make.top.equalTo(viewlast.mas_bottom).offset(35); + }]; + viewxzsl.strtitle = @"写作思路"; + + UIView *viewitemlast = nil; + + if(self.strSiLu.length>0) + { + FenXiangHaiBaoInfoSuperItemView *viewdianpin = [FenXiangHaiBaoInfoSuperItemView new]; + [viewxzsl addSubview:viewdianpin]; + [viewdianpin mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(16); + make.right.equalTo(viewxzsl).offset(-16); + make.top.offset(149); + }]; + viewdianpin.strtitle = @"思路点评"; + viewdianpin.type = 0; + FXTextView *viewdianpinson = [FXTextView new]; + viewdianpinson.arrText = @[self.strSiLu]; + viewdianpin.viewinfo = viewdianpinson; + viewitemlast = viewdianpin; + } + + if(self.arrXZJianYi.count>0) + { + FenXiangHaiBaoInfoSuperItemView *viewjianyi = [FenXiangHaiBaoInfoSuperItemView new]; + [viewxzsl addSubview:viewjianyi]; + [viewjianyi mas_makeConstraints:^(MASConstraintMaker *make) { + if(viewitemlast) + { + make.left.right.equalTo(viewitemlast); + make.top.equalTo(viewitemlast.mas_bottom).offset(30); + } + else + { + make.left.offset(16); + make.right.equalTo(viewxzsl).offset(-16); + make.top.offset(149); + } + }]; + viewjianyi.strtitle = @"写作建议"; + viewjianyi.type = 1; + FXXieZuoJianYiView *viewjianyison = [FXXieZuoJianYiView new]; + viewjianyison.arrXZJianYi = self.arrXZJianYi; + viewjianyi.viewinfo = viewjianyison; + viewitemlast = viewjianyi; + } + + [viewxzsl mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(viewitemlast); + }]; + viewlast = viewxzsl; + } ///二维码 FXErView *viewer = [FXErView new]; [self.scvback addSubview:viewer]; [viewer mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.equalTo(viewxzsl); - make.top.equalTo(viewxzsl.mas_bottom).offset(40); + make.left.right.equalTo(viewlast); + make.top.equalTo(viewlast.mas_bottom).offset(40); }]; UIView *viewshare = [[UIView alloc] init]; @@ -246,20 +346,25 @@ -(void)shareAction:(UIButton *)sender { + if(!self.imageCreate) + { + self.imageCreate = [self jietu]; + } + + switch (sender.tag) { case 0: { - + [ShareAlterView shareImage:self.imageCreate type:0]; } break; case 1: { - + [ShareAlterView shareImage:self.imageCreate type:1]; } break; case 2: { - self.imageCreate = [self jietu]; UIImageWriteToSavedPhotosAlbum(self.imageCreate, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); } break; diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/二维码/FXErView.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/二维码/FXErView.m index cdd2810..6c2169b 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/二维码/FXErView.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/二维码/FXErView.m @@ -78,7 +78,7 @@ }]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ - UIImage *imageer = [Tools CreateStrcode:@"123" size:94]; + UIImage *imageer = [Tools CreateStrcode:DownLoadUrl size:94]; dispatch_async(dispatch_get_main_queue(), ^{ self.imgver.image = imageer; }); diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.h b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.h index e4679b0..09e5b53 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.h +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.h @@ -10,7 +10,8 @@ NS_ASSUME_NONNULL_BEGIN @interface FXXieZuoJianYiView : UIView - +///写作建议 SSEDrawModel +@property (nonatomic , strong) NSArray *arrXZJianYi; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.m index 71bf2c4..f4465cd 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/写作建议/FXXieZuoJianYiView.m @@ -10,6 +10,11 @@ @interface FXXieZuoJianYiView () +/// +@property (nonatomic , strong) UIImageView *imgvline; + +@property (nonatomic , strong) UIView *viewJianYi; +@property (nonatomic , strong) MASConstraint *viewJianYiBottom; @end @implementation FXXieZuoJianYiView @@ -22,253 +27,384 @@ [self.layer setMasksToBounds:YES]; [self.layer setCornerRadius:10]; - UIView *viewtop = [[UIView alloc] init]; - [self addSubview:viewtop]; - [viewtop mas_makeConstraints:^(MASConstraintMaker *make) { +// UIView *viewtop = [[UIView alloc] init]; +// [self addSubview:viewtop]; +// [viewtop mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.right.equalTo(self); +// make.top.offset(20); +// }]; +// [self drawTopView:viewtop]; +// +// UIView *viewcenter = [[UIView alloc] init]; +// [viewcenter setBackgroundColor:[UIColor whiteColor]]; +// [self addSubview:viewcenter]; +// [viewcenter mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.right.equalTo(self); +// make.top.equalTo(viewtop.mas_bottom); +// }]; +// [self drawCenterView:viewcenter]; +// +// UIView *viewbottom = [[UIView alloc] init]; +// [viewbottom setBackgroundColor:[UIColor whiteColor]]; +// [self addSubview:viewbottom]; +// [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.right.equalTo(self); +// make.top.equalTo(viewcenter.mas_bottom); +// }]; +// [self drawEndView:viewbottom]; + + UIView *viewback = [[UIView alloc] init]; + [viewback setClipsToBounds:YES]; + [self addSubview:viewback]; + [viewback mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self); make.top.offset(20); }]; - [self drawTopView:viewtop]; + _viewJianYi = viewback; - UIView *viewcenter = [[UIView alloc] init]; - [viewcenter setBackgroundColor:[UIColor whiteColor]]; - [self addSubview:viewcenter]; - [viewcenter mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.equalTo(self); - make.top.equalTo(viewtop.mas_bottom); - }]; - [self drawCenterView:viewcenter]; + UIImageView *imgvline = [[UIImageView alloc] initWithFrame:CGRectMake(31, 24, 2, 3000)]; + [imgvline setContentMode:UIViewContentModeScaleAspectFill]; + [imgvline setClipsToBounds:YES]; + [viewback addSubview:imgvline]; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + UIImage *imageline = [Tools drawLineImageSize:CGSizeMake(2, 3000) line_W:5 line_H:1 color:RGBCOLOR(42, 211, 237)]; + dispatch_async(dispatch_get_main_queue(), ^{ + imgvline.image = imageline; + }); + }); + _imgvline = imgvline; - UIView *viewbottom = [[UIView alloc] init]; - [viewbottom setBackgroundColor:[UIColor whiteColor]]; - [self addSubview:viewbottom]; - [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.equalTo(self); - make.top.equalTo(viewcenter.mas_bottom); - }]; - [self drawEndView:viewbottom]; [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(viewbottom); + make.bottom.equalTo(viewback); }]; } return self; } --(UILabel *)drawTopView:(UIView *)view +//-(UILabel *)drawTopView:(UIView *)view +//{ +// UIImageView *imgvback = [[UIImageView alloc] init]; +// [imgvback setImage:[UIImage imageNamed:@"yd_detail_jy_l"]]; +// [view addSubview:imgvback]; +// [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { +// make.width.height.offset(24); +// make.left.offset(20); +// make.top.offset(0); +// }]; +// +// UILabel *lbname = [[UILabel alloc] init]; +// [lbname setText:@"开头"]; +// [lbname setTextColor:RGBCOLOR(51, 51, 51)]; +// [lbname setTextAlignment:NSTextAlignmentLeft]; +// [lbname setFont:[UIFont boldSystemFontOfSize:18]]; +// [view addSubview:lbname]; +// [lbname mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(imgvback.mas_right).offset(14); +// make.centerY.equalTo(imgvback); +// }]; +// +// UIImageView *imgvline = [[UIImageView alloc] initWithFrame:CGRectMake(31, 24, 2, 3000)]; +// [imgvline setContentMode:UIViewContentModeScaleAspectFill]; +// [imgvline setClipsToBounds:YES]; +// [view addSubview:imgvline]; +// dispatch_async(dispatch_get_global_queue(0, 0), ^{ +// UIImage *imageline = [Tools drawLineImageSize:CGSizeMake(2, 3000) line_W:5 line_H:1 color:RGBCOLOR(42, 211, 237)]; +// dispatch_async(dispatch_get_main_queue(), ^{ +// imgvline.image = imageline; +// }); +// }); +// +// UILabel *lbcontent = [[UILabel alloc] init]; +// [lbcontent setText:@"以第一人称视角,通过细腻的心理描写,展现新学期第一天的紧张与期待,引出对小学生活的独特感受,如:“那日的阳光透过窗帘,照亮了我心中对未来学习生活的憧憬。”"]; +// [lbcontent setTextColor:RGBCOLOR(26, 26, 26)]; +// [lbcontent setTextAlignment:NSTextAlignmentLeft]; +// [lbcontent setFont:[UIFont systemFontOfSize:15]]; +// [lbcontent setNumberOfLines:0]; +// [view addSubview:lbcontent]; +// [lbcontent mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(lbname); +// make.top.equalTo(lbname.mas_bottom).offset(8); +// make.right.equalTo(view).offset(-15); +// }]; +// +// [view mas_makeConstraints:^(MASConstraintMaker *make) { +// make.bottom.equalTo(lbcontent).offset(15); +// }]; +// +// return lbcontent; +//} +// +// +//-(void)drawCenterView:(UIView *)view +//{ +// UIImageView *imgvback = [[UIImageView alloc] init]; +// [imgvback setImage:[UIImage imageNamed:@"yd_detail_jy_l"]]; +// [view addSubview:imgvback]; +// [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { +// make.width.height.offset(24); +// make.left.offset(20); +// make.top.offset(0); +// }]; +// +// UILabel *lbname = [[UILabel alloc] init]; +// [lbname setText:@"中间"]; +// [lbname setTextColor:RGBCOLOR(51, 51, 51)]; +// [lbname setTextAlignment:NSTextAlignmentLeft]; +// [lbname setFont:[UIFont boldSystemFontOfSize:18]]; +// [view addSubview:lbname]; +// [lbname mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(imgvback.mas_right).offset(14); +// make.centerY.equalTo(imgvback); +// }]; +// +// UIImageView *imgvline = [[UIImageView alloc] initWithFrame:CGRectMake(31, 24, 2, 3000)]; +// [imgvline setContentMode:UIViewContentModeScaleAspectFill]; +// [imgvline setClipsToBounds:YES]; +// [view addSubview:imgvline]; +// dispatch_async(dispatch_get_global_queue(0, 0), ^{ +// UIImage *imageline = [Tools drawLineImageSize:CGSizeMake(2, 3000) line_W:5 line_H:1 color:RGBCOLOR(42, 211, 237)]; +// dispatch_async(dispatch_get_main_queue(), ^{ +// imgvline.image = imageline; +// }); +// }); +// +// UIView *viewlast = nil; +// for(int i = 0 ; i < 5; i++) +// { +// UIView *viewitem = [[UIView alloc] init]; +// [view addSubview:viewitem]; +// [viewitem mas_makeConstraints:^(MASConstraintMaker *make) { +// make.right.equalTo(view); +// make.left.equalTo(lbname); +// if(viewlast) +// { +// make.top.equalTo(viewlast.mas_bottom); +// } +// else +// { +// make.top.offset(35); +// } +// }]; +// +// UILabel *lbitem = [self drawCenterItemView:viewitem value:@"描绘早晨的场景:运用细节描绘,如“熙攘的人群、校门口的敬礼仪式”,体现新环境的秩序与规矩,象征着成长的仪式感。" tag:i]; +// +// viewlast = viewitem; +// } +// +// +// [view mas_makeConstraints:^(MASConstraintMaker *make) { +// make.bottom.equalTo(viewlast); +// }]; +//} +// +// +//-(UILabel *)drawCenterItemView:(UIView *)view value:(NSString *)value tag:(int)tag +//{ +// NSString *strtt = [NSString stringWithFormat:@"第%@段落",[self getDuanLuoName:tag]]; +// float f_w = [Tools getWidthWithText:strtt height:20 font:14]+20; +// +// UIView *viewtt = [[UIView alloc] initWithFrame:CGRectMake(0, 0, f_w, 30)]; +// [view addSubview:viewtt]; +// [viewtt mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.top.offset(0); +// make.height.offset(30); +// make.width.offset(f_w); +// }]; +// [viewtt.layer setMasksToBounds:YES]; +// [viewtt.layer setCornerRadius:4]; +// [Tools changedView:viewtt colors:@[(id)RGBCOLOR(42, 211, 237).CGColor,(id)RGBCOLOR(136, 238, 118).CGColor] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)]; +// +// UILabel *lbname = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, f_w, 30)]; +// [lbname setTextColor:[UIColor whiteColor]]; +// [lbname setTextAlignment:NSTextAlignmentCenter]; +// [lbname setFont:[UIFont systemFontOfSize:14]]; +// [viewtt addSubview:lbname]; +// [lbname mas_makeConstraints:^(MASConstraintMaker *make) { +// make.center.equalTo(viewtt); +// }]; +// [lbname setText:strtt]; +// +// UILabel *lbcontent = [[UILabel alloc] init]; +// [lbcontent setText:value]; +// [lbcontent setTextColor:RGBCOLOR(26, 26, 26)]; +// [lbcontent setTextAlignment:NSTextAlignmentLeft]; +// [lbcontent setFont:[UIFont systemFontOfSize:15]]; +// [lbcontent setNumberOfLines:0]; +// [view addSubview:lbcontent]; +// [lbcontent mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(viewtt); +// make.top.equalTo(viewtt.mas_bottom).offset(8); +// make.right.equalTo(view).offset(-15); +// }]; +// [view mas_makeConstraints:^(MASConstraintMaker *make) { +// make.bottom.equalTo(lbcontent).offset(15); +// }]; +// return lbcontent; +//} +// +//-(void)drawEndView:(UIView *)view +//{ +// UIImageView *imgvback = [[UIImageView alloc] init]; +// [imgvback setImage:[UIImage imageNamed:@"yd_detail_jy_l"]]; +// [view addSubview:imgvback]; +// [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { +// make.width.height.offset(24); +// make.left.offset(20); +// make.top.offset(0); +// }]; +// +// UILabel *lbname = [[UILabel alloc] init]; +// [lbname setText:@"结尾"]; +// [lbname setTextColor:RGBCOLOR(51, 51, 51)]; +// [lbname setTextAlignment:NSTextAlignmentLeft]; +// [lbname setFont:[UIFont boldSystemFontOfSize:18]]; +// [view addSubview:lbname]; +// [lbname mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(imgvback.mas_right).offset(14); +// make.centerY.equalTo(imgvback); +// }]; +// +// +// UILabel *lbcontent = [[UILabel alloc] init]; +// [lbcontent setText:@"以第一人称视角,通过细腻的心理描写,展现新学期第一天的紧张与期待,引出对小学生活的独特感受,如:“那日的阳光透过窗帘,照亮了我心中对未来学习生活的憧憬。”"]; +// [lbcontent setTextColor:RGBCOLOR(26, 26, 26)]; +// [lbcontent setTextAlignment:NSTextAlignmentLeft]; +// [lbcontent setFont:[UIFont systemFontOfSize:15]]; +// [lbcontent setNumberOfLines:0]; +// [view addSubview:lbcontent]; +// [lbcontent mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.equalTo(lbname); +// make.top.equalTo(lbname.mas_bottom).offset(8); +// make.right.equalTo(view).offset(-15); +// }]; +// +// +// [view mas_makeConstraints:^(MASConstraintMaker *make) { +// make.bottom.equalTo(lbcontent).offset(30); +// }]; +//} + + +///绘制建议title +-(UILabel *)drawJianYiTitle:(NSString *)title lastview:(UIView *)viewlast { UIImageView *imgvback = [[UIImageView alloc] init]; [imgvback setImage:[UIImage imageNamed:@"yd_detail_jy_l"]]; - [view addSubview:imgvback]; + [self.viewJianYi addSubview:imgvback]; [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.offset(24); make.left.offset(20); - make.top.offset(0); + if(viewlast) + { + make.top.equalTo(viewlast.mas_bottom).offset(20); + } + else + { + make.top.offset(0); + } }]; UILabel *lbname = [[UILabel alloc] init]; - [lbname setText:@"开头"]; + [lbname setText:title]; [lbname setTextColor:RGBCOLOR(51, 51, 51)]; [lbname setTextAlignment:NSTextAlignmentLeft]; [lbname setFont:[UIFont boldSystemFontOfSize:18]]; - [view addSubview:lbname]; + [self.viewJianYi addSubview:lbname]; [lbname mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(imgvback.mas_right).offset(14); make.centerY.equalTo(imgvback); }]; + return lbname; +} + +-(ViewLable *)drawJianYiItemView:(UIView *)lastview tag:(int)tag +{ + if(tag>=0) + { + NSString *strtt = [NSString stringWithFormat:@"第%@段落",[Tools convertNumberToUppercase:tag]]; + float f_w = [Tools getWidthWithText:strtt height:20 font:14]+20; + + UIView *viewtt = [[UIView alloc] initWithFrame:CGRectMake(0, 0, f_w, 30)]; + [self.viewJianYi addSubview:viewtt]; + [viewtt mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(lastview); + make.top.equalTo(lastview.mas_bottom).offset(10); + make.height.offset(30); + make.width.offset(f_w); + }]; + [viewtt.layer setMasksToBounds:YES]; + [viewtt.layer setCornerRadius:4]; + [Tools changedView:viewtt colors:@[(id)RGBCOLOR(42, 211, 237).CGColor,(id)RGBCOLOR(136, 238, 118).CGColor] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)]; + + UILabel *lbname = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, f_w, 30)]; + [lbname setTextColor:[UIColor whiteColor]]; + [lbname setTextAlignment:NSTextAlignmentCenter]; + [lbname setFont:[UIFont systemFontOfSize:14]]; + [viewtt addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(viewtt); + }]; + [lbname setText:strtt]; + + lastview = viewtt; + } - UIImageView *imgvline = [[UIImageView alloc] initWithFrame:CGRectMake(31, 24, 2, 3000)]; - [imgvline setContentMode:UIViewContentModeScaleAspectFill]; - [imgvline setClipsToBounds:YES]; - [view addSubview:imgvline]; - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - UIImage *imageline = [Tools drawLineImageSize:CGSizeMake(2, 3000) line_W:5 line_H:1 color:RGBCOLOR(42, 211, 237)]; - dispatch_async(dispatch_get_main_queue(), ^{ - imgvline.image = imageline; - }); - }); - UILabel *lbcontent = [[UILabel alloc] init]; - [lbcontent setText:@"以第一人称视角,通过细腻的心理描写,展现新学期第一天的紧张与期待,引出对小学生活的独特感受,如:“那日的阳光透过窗帘,照亮了我心中对未来学习生活的憧憬。”"]; - [lbcontent setTextColor:RGBCOLOR(26, 26, 26)]; - [lbcontent setTextAlignment:NSTextAlignmentLeft]; - [lbcontent setFont:[UIFont systemFontOfSize:15]]; - [lbcontent setNumberOfLines:0]; - [view addSubview:lbcontent]; - [lbcontent mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(lbname); - make.top.equalTo(lbname.mas_bottom).offset(8); - make.right.equalTo(view).offset(-15); + ViewLable *lbwz = [[ViewLable alloc] init]; + [self.viewJianYi addSubview:lbwz]; + [lbwz mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(lastview); + make.top.equalTo(lastview.mas_bottom).offset(10); + make.right.equalTo(self.viewJianYi).offset(-20); + make.height.offset(20); }]; - - [view mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(lbcontent).offset(15); + lbwz.textColor = RGBCOLOR(61, 61, 61); + lbwz.textFont = [UIFont systemFontOfSize:15]; + lbwz.isCloseAnimation = YES; + if(self.viewJianYiBottom) + { + [self.viewJianYiBottom uninstall]; + } + [self.viewJianYi mas_makeConstraints:^(MASConstraintMaker *make) { + self.viewJianYiBottom = make.bottom.equalTo(lbwz).offset(24); }]; - - return lbcontent; + return lbwz; } --(void)drawCenterView:(UIView *)view + +-(void)setArrXZJianYi:(NSArray *)arrXZJianYi { - UIImageView *imgvback = [[UIImageView alloc] init]; - [imgvback setImage:[UIImage imageNamed:@"yd_detail_jy_l"]]; - [view addSubview:imgvback]; - [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.offset(24); - make.left.offset(20); - make.top.offset(0); - }]; - - UILabel *lbname = [[UILabel alloc] init]; - [lbname setText:@"中间"]; - [lbname setTextColor:RGBCOLOR(51, 51, 51)]; - [lbname setTextAlignment:NSTextAlignmentLeft]; - [lbname setFont:[UIFont boldSystemFontOfSize:18]]; - [view addSubview:lbname]; - [lbname mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(imgvback.mas_right).offset(14); - make.centerY.equalTo(imgvback); - }]; - - UIImageView *imgvline = [[UIImageView alloc] initWithFrame:CGRectMake(31, 24, 2, 3000)]; - [imgvline setContentMode:UIViewContentModeScaleAspectFill]; - [imgvline setClipsToBounds:YES]; - [view addSubview:imgvline]; - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - UIImage *imageline = [Tools drawLineImageSize:CGSizeMake(2, 3000) line_W:5 line_H:1 color:RGBCOLOR(42, 211, 237)]; - dispatch_async(dispatch_get_main_queue(), ^{ - imgvline.image = imageline; - }); - }); + _arrXZJianYi = arrXZJianYi; UIView *viewlast = nil; - for(int i = 0 ; i < 5; i++) + for(int j = 0 ; j1) + { + UILabel *lbyd = [self drawTextItem:self title:@"优点" color:RGBCOLOR(255, 131, 40) value:self.arrText[1] lastview:lbcontent]; + + UILabel *lbjy = [self drawTextItem:self title:@"建议" color:RGBCOLOR(203, 254, 39) value:self.arrText[2] lastview:lbyd]; + + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(lbjy).offset(16); + }]; + } + else + { + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(lbcontent).offset(16); + }]; + } - UILabel *lbjy = [self drawTextItem:self title:@"建议" color:RGBCOLOR(203, 254, 39) value:@"2你的作文写得非常好,充满了对高中生梦想的深入思考和全面了解。你的语言表达清晰明了,结构合理,逻辑性强,情感表达真挚感人。继续保持写作的热情和信心,相信你会成为一名优秀的作家。" lastview:lbyd]; - - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(lbjy).offset(16); - }]; } -(UILabel *)drawTextItem:(UIView *)view title:(NSString *)title color:(UIColor *)color value:(NSString *)value lastview:(UIView *)viewlast diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.h b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.h index 6fff8c2..d217b5f 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.h +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.h @@ -6,11 +6,12 @@ // #import - +#import "WriteCorrectScoreModel.h" NS_ASSUME_NONNULL_BEGIN @interface FXWDPFView : UIView - +///维度评分 +@property (nonatomic , strong) WriteCorrectScoreModelData *modelPF; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.m b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.m index 35c255c..6f5a500 100644 --- a/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.m +++ b/ProductApp/ProductApp/ProductMain/首页/写作分享/分享海报views/维度评分/FXWDPFView.m @@ -7,9 +7,12 @@ #import "FXWDPFView.h" +#import "RoleTreeModel.h" +#import "TextbookInfoModel.h" @interface FXWDPFView () - +/// +@property (nonatomic , strong) UILabel *lbbzName; @end @implementation FXWDPFView @@ -41,43 +44,73 @@ make.left.equalTo(lbbz.mas_right); make.centerY.equalTo(lbbz); }]; + _lbbzName = lbbzName; - int iline = 3; - UIView *viewlast = nil; - for(int i = 0; i < iline; i++) - { - for(int j = 0 ; j < 2; j++) - { - UILabel *lbname = [[UILabel alloc] init]; - [lbname setText:@"切合题意"]; - [lbname setTextColor:RGBCOLOR(61, 61, 61)]; - [lbname setTextAlignment:NSTextAlignmentLeft]; - [lbname setFont:[UIFont systemFontOfSize:14]]; - [self addSubview:lbname]; - [lbname mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.offset(20+(UISCREEN_WIDTH-70)/2.0*j); - make.top.offset(55+40*i); - }]; - - UILabel *lbvalue = [[UILabel alloc] init]; - [lbvalue setText:@"15/20分"]; - [lbvalue setTextColor:RGBCOLOR(51, 51, 51)]; - [lbvalue setTextAlignment:NSTextAlignmentLeft]; - [lbvalue setFont:[UIFont boldSystemFontOfSize:12]]; - [self addSubview:lbvalue]; - [lbvalue mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(lbname.mas_right).offset(10); - make.centerY.equalTo(lbname); - }]; - viewlast = lbname; - } - } - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.equalTo(viewlast).offset(16); - }]; } return self; } +-(void)setModelPF:(WriteCorrectScoreModelData *)modelPF +{ + _modelPF = modelPF; + self.lbbzName.text = [UserInfoModel shareModel].user_stage.parent_name; + + NSArray *arrtemp = modelPF.complex_review.score; + + NSInteger iline = arrtemp.count/2; + if(arrtemp.count%2!=0)iline+=1; + UIView *viewlast = nil; + for(int i = 0; i < iline; i++) + { + for(int j = 0 ; j < 2; j++) + { + if(i*2+j>=arrtemp.count)break; + + TextbookInfoModelDataResultComplexScore *model =arrtemp[j+i*2]; + + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:model.name]; + [lbname setTextColor:RGBCOLOR(61, 61, 61)]; + [lbname setTextAlignment:NSTextAlignmentLeft]; + [lbname setFont:[UIFont systemFontOfSize:14]]; + [self addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.offset(20+(UISCREEN_WIDTH-70)/2.0*j); + make.top.offset(55+40*i); + }]; + + UILabel *lbvalue = [[UILabel alloc] init]; + [lbvalue setText:[NSString stringWithFormat:@"%@/%@分",model.get,model.max]]; + [lbvalue setTextColor:RGBCOLOR(51, 51, 51)]; + [lbvalue setTextAlignment:NSTextAlignmentLeft]; + [lbvalue setFont:[UIFont boldSystemFontOfSize:12]]; + [self addSubview:lbvalue]; + [lbvalue mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(lbname.mas_right).offset(10); + make.centerY.equalTo(lbname); + }]; + + NSRange rangetemp = [lbvalue.text rangeOfString:@"/"]; + + UIColor *coloratt = RGBCOLOR(230, 172, 40); + if(model.get.floatValue/model.max.floatValue>=0.8) + { + coloratt = RGBCOLOR(44, 187, 157); + } + else if(model.get.floatValue/model.max.floatValue<0.6) + { + coloratt = RGBCOLOR(228, 74, 56); + } + lbvalue.attributedText = [Tools arrstring:lbvalue.text andstart:0 andend:(int)rangetemp.location andfont:[UIFont fontWithName:@"D-DIN-PRO-Bold" size:16] andcolor:coloratt]; + + viewlast = lbname; + } + } + + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(viewlast).offset(16); + }]; +} + @end diff --git a/ProductApp/ProductApp/ProductMain/首页/切换身份/ShouYeLingYuViewController.m b/ProductApp/ProductApp/ProductMain/首页/切换身份/ShouYeLingYuViewController.m index 2139d42..d1fb6a7 100644 --- a/ProductApp/ProductApp/ProductMain/首页/切换身份/ShouYeLingYuViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/切换身份/ShouYeLingYuViewController.m @@ -195,8 +195,7 @@ { [UserInfoModel shareModel].user_stage = modelson; [UserInfoModel shareModel].isAllLevel = [NSString stringWithFormat:@"%@",[NSNumber numberWithBool:NO]]; - [UserInfoModel shareModel].identityType = @"3"; - + [UserInfoModel setIdentityType:@"3"]; [UserInfoModel shareModel].isupdataJiaoyu = YES; [self.navigationController popToRootViewControllerAnimated:YES]; diff --git a/ProductApp/ProductApp/ProductMain/首页/切换身份/view/ShouYeShenFenView.m b/ProductApp/ProductApp/ProductMain/首页/切换身份/view/ShouYeShenFenView.m index 1e4a4f9..991b2a3 100644 --- a/ProductApp/ProductApp/ProductMain/首页/切换身份/view/ShouYeShenFenView.m +++ b/ProductApp/ProductApp/ProductMain/首页/切换身份/view/ShouYeShenFenView.m @@ -210,7 +210,7 @@ [UserInfoModel shareModel].isupdataJiaoyu=YES; [UserInfoModel shareModel].user_stage = modelson; [UserInfoModel shareModel].isAllLevel = [NSString stringWithFormat:@"%@",[NSNumber numberWithBool:isall]]; - [UserInfoModel shareModel].identityType = [NSString stringWithFormat:@"%d",type]; + [UserInfoModel setIdentityType:[NSString stringWithFormat:@"%d",type]]; [self.viewController.navigationController popToRootViewControllerAnimated:YES]; } else diff --git a/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/ShouYeLiShiJiLuPPTTableViewController.m b/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/ShouYeLiShiJiLuPPTTableViewController.m index e1a9e92..89f29d5 100644 --- a/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/ShouYeLiShiJiLuPPTTableViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/ShouYeLiShiJiLuPPTTableViewController.m @@ -7,12 +7,15 @@ #import "ShouYeLiShiJiLuPPTTableViewController.h" #import "ShouYeLiShiJiLuPPTTableViewCell.h" +#import "NetWorkManager.h" +#import "PPtYuLanZSViewController.h" - -@interface ShouYeLiShiJiLuPPTTableViewController () +@interface ShouYeLiShiJiLuPPTTableViewController () /// @property (nonatomic , strong) UITableView *tableView; - +/// +@property (nonatomic , strong) NSMutableArray *arrdata; +@property (nonatomic , assign) int ipage; @end @implementation ShouYeLiShiJiLuPPTTableViewController @@ -30,13 +33,43 @@ [tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.view); }]; + [self.tableView setEmptyDataSetDelegate:self]; + [self.tableView setEmptyDataSetSource:self]; _tableView = tableView; + tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + self.ipage=1; + [self getdata]; + }]; + tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ + self.ipage+=1; + [self getdata]; + }]; + self.ipage=1; + [self getdata]; + +} +-(void)getdata +{ + [NetWorkManager requestPptHestoryData:self.view page:[NSString stringWithFormat:@"%d",self.ipage] status:@"3" Callback:^(BOOL state, PptHestoryModel *responseObject, NSString * _Nullable describle) { + if(self.ipage==1)self.arrdata = [NSMutableArray new]; + [self.tableView.mj_header endRefreshing]; + [self.tableView.mj_footer endRefreshing]; + if(state) + { + [self.arrdata addObjectsFromArray:responseObject.data.items]; + } + else + { + [HXHud showMessage:responseObject.message afterDelayType:1]; + } + [self.tableView reloadData]; + }]; } #pragma mark - Table view data source -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 10; + return self.arrdata.count; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -48,7 +81,7 @@ [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; [cell setBackgroundColor:[UIColor clearColor]]; } - + cell.model = self.arrdata[indexPath.row]; return cell; } -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section @@ -73,6 +106,60 @@ } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + PptHestoryModelDataItems *model = self.arrdata[indexPath.row]; + PptProgressModelData *modelzs = [PptProgressModelData new]; + modelzs.pptUrl = model.url; + + PPtYuLanZSViewController *vc = [PPtYuLanZSViewController new]; + vc.modelZS = modelzs; + [self.navigationController pushViewController:vc animated:YES]; } +#pragma mark - DZNEmptyDataSetSource +- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView +{ + UIView *viewback = [[UIView alloc] init]; + NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:viewback attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:UISCREEN_HEIGHT-NavHeight-50]; + [viewback addConstraint:heightConstraint]; + [viewback setBackgroundColor:[UIColor clearColor]]; + [viewback setUserInteractionEnabled:YES]; + + NSString *strimg = @"fanwen_noinfo"; + + UIImageView *imgvback = [[UIImageView alloc] init]; + [imgvback setImage:[UIImage imageNamed:strimg]]; + [imgvback setContentMode:UIViewContentModeScaleAspectFit]; + [viewback addSubview:imgvback]; + [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(UISCREEN_WIDTH*0.6); + make.centerX.equalTo(viewback); + make.top.offset(50); + }]; + + NSString *str = @"暂无结果"; + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:str]; + [lbname setTextColor:RGBCOLOR(51, 51, 51)]; + [lbname setTextAlignment:NSTextAlignmentCenter]; + [lbname setFont:[UIFont boldSystemFontOfSize:20]]; + [viewback addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(imgvback.mas_bottom).offset(20); + make.centerX.equalTo(viewback); + }]; + +// UILabel *lbinfo = [[UILabel alloc] init]; +// [lbinfo setText:@"抱歉没有查询到相关的文章"]; +// [lbinfo setTextColor:RGBCOLOR(109, 109, 109)]; +// [lbinfo setTextAlignment:NSTextAlignmentCenter]; +// [lbinfo setFont:[UIFont systemFontOfSize:16]]; +// [viewback addSubview:lbinfo]; +// [lbinfo mas_makeConstraints:^(MASConstraintMaker *make) { +// make.top.equalTo(lbname.mas_bottom).offset(10); +// make.centerX.equalTo(viewback); +// }]; + + return viewback; +} + @end diff --git a/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.h b/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.h index 7338788..d1aebc1 100644 --- a/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.h +++ b/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.h @@ -6,11 +6,12 @@ // #import - +#import "PptHestoryModel.h" NS_ASSUME_NONNULL_BEGIN @interface ShouYeLiShiJiLuPPTTableViewCell : UITableViewCell - +/// +@property (nonatomic , strong) PptHestoryModelDataItems *model; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.m b/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.m index 7b02924..b2b0625 100644 --- a/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.m +++ b/ProductApp/ProductApp/ProductMain/首页/历史记录/PPT/cell/ShouYeLiShiJiLuPPTTableViewCell.m @@ -102,12 +102,16 @@ make.centerY.equalTo(imgvdown).offset(10); make.width.height.offset(50); }]; - [btdown addTarget:self action:@selector(downAction) forControlEvents:UIControlEventTouchUpInside]; + [btdown setUserInteractionEnabled:NO]; +// [btdown addTarget:self action:@selector(downAction) forControlEvents:UIControlEventTouchUpInside]; } return self; } --(void)downAction +-(void)setModel:(PptHestoryModelDataItems *)model { - + _model = model; + [self.imgvback sd_setImageWithURL:[NSURL URLWithString:[Tools isStringnil:model.image_src]] placeholderImage:nil]; + self.lbname.text = [Tools isStringnilkong:model.title]; + self.lbtime.text = [Tools isStringnilkong:model.create_time]; } @end diff --git a/ProductApp/ProductApp/ProductMain/首页/历史记录/写作/ShouYeLiShiJiLuXZTableViewController.m b/ProductApp/ProductApp/ProductMain/首页/历史记录/写作/ShouYeLiShiJiLuXZTableViewController.m index 49fcc51..3447968 100644 --- a/ProductApp/ProductApp/ProductMain/首页/历史记录/写作/ShouYeLiShiJiLuXZTableViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/历史记录/写作/ShouYeLiShiJiLuXZTableViewController.m @@ -9,7 +9,7 @@ #import "ShouYeLiShiJiLuXZTableViewCell.h" #import "NetWorkManager.h" -@interface ShouYeLiShiJiLuXZTableViewController () +@interface ShouYeLiShiJiLuXZTableViewController () /// @property (nonatomic , strong) UITableView *tableView; /// @@ -32,6 +32,8 @@ make.edges.equalTo(self.view); }]; _tableView = tableView; + [self.tableView setEmptyDataSetDelegate:self]; + [self.tableView setEmptyDataSetSource:self]; [self getdata]; } @@ -99,4 +101,51 @@ } +#pragma mark - DZNEmptyDataSetSource +- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView +{ + UIView *viewback = [[UIView alloc] init]; + NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:viewback attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:UISCREEN_HEIGHT-NavHeight-50]; + [viewback addConstraint:heightConstraint]; + [viewback setBackgroundColor:[UIColor clearColor]]; + [viewback setUserInteractionEnabled:YES]; + + NSString *strimg = @"fanwen_noinfo"; + + UIImageView *imgvback = [[UIImageView alloc] init]; + [imgvback setImage:[UIImage imageNamed:strimg]]; + [imgvback setContentMode:UIViewContentModeScaleAspectFit]; + [viewback addSubview:imgvback]; + [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(UISCREEN_WIDTH*0.6); + make.centerX.equalTo(viewback); + make.top.offset(50); + }]; + + NSString *str = @"暂无结果"; + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:str]; + [lbname setTextColor:RGBCOLOR(51, 51, 51)]; + [lbname setTextAlignment:NSTextAlignmentCenter]; + [lbname setFont:[UIFont boldSystemFontOfSize:20]]; + [viewback addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(imgvback.mas_bottom).offset(20); + make.centerX.equalTo(viewback); + }]; + +// UILabel *lbinfo = [[UILabel alloc] init]; +// [lbinfo setText:@"抱歉没有查询到相关的文章"]; +// [lbinfo setTextColor:RGBCOLOR(109, 109, 109)]; +// [lbinfo setTextAlignment:NSTextAlignmentCenter]; +// [lbinfo setFont:[UIFont systemFontOfSize:16]]; +// [viewback addSubview:lbinfo]; +// [lbinfo mas_makeConstraints:^(MASConstraintMaker *make) { +// make.top.equalTo(lbname.mas_bottom).offset(10); +// make.centerX.equalTo(viewback); +// }]; + + return viewback; +} + @end diff --git a/ProductApp/ProductApp/ProductMain/首页/历史记录/批改/ShouYeLiShiJiLuPGTableViewController.m b/ProductApp/ProductApp/ProductMain/首页/历史记录/批改/ShouYeLiShiJiLuPGTableViewController.m index e56ab75..2b96df0 100644 --- a/ProductApp/ProductApp/ProductMain/首页/历史记录/批改/ShouYeLiShiJiLuPGTableViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/历史记录/批改/ShouYeLiShiJiLuPGTableViewController.m @@ -9,7 +9,7 @@ #import "ShouYeLiShiJiLuPGTableViewCell.h" #import "NetWorkManager.h" -@interface ShouYeLiShiJiLuPGTableViewController () +@interface ShouYeLiShiJiLuPGTableViewController () /// @property (nonatomic , strong) UITableView *tableView; /// @@ -32,7 +32,8 @@ make.edges.equalTo(self.view); }]; _tableView = tableView; - + [self.tableView setEmptyDataSetDelegate:self]; + [self.tableView setEmptyDataSetSource:self]; [self getdata]; } @@ -121,4 +122,51 @@ { } +#pragma mark - DZNEmptyDataSetSource +- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView +{ + UIView *viewback = [[UIView alloc] init]; + NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:viewback attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:UISCREEN_HEIGHT-NavHeight-50]; + [viewback addConstraint:heightConstraint]; + [viewback setBackgroundColor:[UIColor clearColor]]; + [viewback setUserInteractionEnabled:YES]; + + NSString *strimg = @"fanwen_noinfo"; + + UIImageView *imgvback = [[UIImageView alloc] init]; + [imgvback setImage:[UIImage imageNamed:strimg]]; + [imgvback setContentMode:UIViewContentModeScaleAspectFit]; + [viewback addSubview:imgvback]; + [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.offset(UISCREEN_WIDTH*0.6); + make.centerX.equalTo(viewback); + make.top.offset(50); + }]; + + NSString *str = @"暂无结果"; + UILabel *lbname = [[UILabel alloc] init]; + [lbname setText:str]; + [lbname setTextColor:RGBCOLOR(51, 51, 51)]; + [lbname setTextAlignment:NSTextAlignmentCenter]; + [lbname setFont:[UIFont boldSystemFontOfSize:20]]; + [viewback addSubview:lbname]; + [lbname mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(imgvback.mas_bottom).offset(20); + make.centerX.equalTo(viewback); + }]; + +// UILabel *lbinfo = [[UILabel alloc] init]; +// [lbinfo setText:@"抱歉没有查询到相关的文章"]; +// [lbinfo setTextColor:RGBCOLOR(109, 109, 109)]; +// [lbinfo setTextAlignment:NSTextAlignmentCenter]; +// [lbinfo setFont:[UIFont systemFontOfSize:16]]; +// [viewback addSubview:lbinfo]; +// [lbinfo mas_makeConstraints:^(MASConstraintMaker *make) { +// make.top.equalTo(lbname.mas_bottom).offset(10); +// make.centerX.equalTo(viewback); +// }]; + + return viewback; +} + @end diff --git a/ProductApp/ProductApp/ProductMain/首页/自定义相机/CamreViewController.m b/ProductApp/ProductApp/ProductMain/首页/自定义相机/CamreViewController.m index 7c7f33e..1b1976e 100644 --- a/ProductApp/ProductApp/ProductMain/首页/自定义相机/CamreViewController.m +++ b/ProductApp/ProductApp/ProductMain/首页/自定义相机/CamreViewController.m @@ -15,7 +15,7 @@ #import #import -#import "StartKTXZPGViewController.h" +#import "StartKTXZPGView.h" #import "CamreShiLiView.h" #import "NetWorkManager.h" @@ -39,6 +39,10 @@ /// @property (nonatomic , strong) UIButton *btok; @property (nonatomic , strong) UIButton *btnumber; + +/// +@property (nonatomic , strong) UIButton *btimg; + /// @property (nonatomic , strong) CamreImagesView *viewImages; /// @@ -135,6 +139,12 @@ [self.btnumber setHidden:YES]; [self.viewImages setHidden:YES]; [self.btok setHidden:YES]; + + [self.btimg setImage:[UIImage imageNamed:@"cam_image"] forState:UIControlStateNormal]; + } + else + { + [self.btimg setImage:self.arrData.lastObject forState:UIControlStateNormal]; } [self.btnumber setTitle:[NSString stringWithFormat:@"%ld",self.arrData.count] forState:UIControlStateNormal]; }]; @@ -194,8 +204,11 @@ make.centerY.equalTo(btpz); make.right.equalTo(btpz.mas_left).offset(-60); }]; + [btimg.layer setMasksToBounds:YES]; + [btimg.layer setCornerRadius:12]; [btimg setTag:2]; [btimg addTarget:self action:@selector(bottomAction:) forControlEvents:UIControlEventTouchUpInside]; + _btimg = btimg; UIButton *btnumber = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; [btnumber setTitle:@"0" forState:UIControlStateNormal]; @@ -322,27 +335,43 @@ ///1作文批改 2拍照写作 if(self.type==1) { - StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; - vc.type = 1; - vc.arrXZImages = self.arrData; - [self.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; +// vc.type = 1; +// vc.arrXZImages = self.arrData; +// [self.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.type = 1; + view.arrXZImages = self.arrData; + [self.view addSubview:view]; } else if(self.type==2) { NSArray *arrtt = @[@"改写作文",@"拍题成文",@"拍照续写"]; int temp = (int)[arrtt indexOfObject:[self.viewtype getSelectName]]; - StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; - vc.type = temp+10; - vc.arrXZImages = self.arrData; - [self.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; +// vc.type = temp+10; +// vc.arrXZImages = self.arrData; +// [self.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.type = temp+10; + view.arrXZImages = self.arrData; + [self.view addSubview:view]; } else if(self.type==3) { - StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; - vc.type = 0; - vc.arrXZImages = self.arrData; - vc.textbook_id = self.textbook_id; - [self.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; +// vc.type = 0; +// vc.arrXZImages = self.arrData; +// vc.textbook_id = self.textbook_id; +// [self.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.type = 0; + view.arrXZImages = self.arrData; + view.textbook_id = self.textbook_id; + [self.view addSubview:view]; } } break; @@ -388,6 +417,8 @@ [self.btnumber setTitle:[NSString stringWithFormat:@"%ld",self.arrData.count] forState:UIControlStateNormal]; [self.btnumber setHidden:NO]; [self.btok setHidden:NO]; + [self.btimg setImage:self.arrData.lastObject forState:UIControlStateNormal]; + } failed:^(NSDictionary *info, HXPhotoModel *model) { // 获取失败 NSLog(@"失败"); @@ -589,6 +620,9 @@ [self.btnumber setTitle:[NSString stringWithFormat:@"%ld",self.arrData.count] forState:UIControlStateNormal]; [self.btnumber setHidden:NO]; [self.btok setHidden:NO]; + + [self.btimg setImage:self.arrData.lastObject forState:UIControlStateNormal]; + } //根据摄像头类型 重力方向旋转照片 - (UIImage *)fixOrientation:(UIImage *)aImage diff --git a/ProductApp/ProductApp/ProductMain/首页/自定义相机/view/CamreShiLiView.m b/ProductApp/ProductApp/ProductMain/首页/自定义相机/view/CamreShiLiView.m index 5d34189..2118ab0 100644 --- a/ProductApp/ProductApp/ProductMain/首页/自定义相机/view/CamreShiLiView.m +++ b/ProductApp/ProductApp/ProductMain/首页/自定义相机/view/CamreShiLiView.m @@ -12,7 +12,7 @@ #import "ExampleCorrectList.h"///作文批改 #import "ExamplePicModel.h" -#import "StartKTXZPGViewController.h" +#import "StartKTXZPGView.h" #define CamreShiLiViewCellHeight UISCREEN_HEIGHT-KMagrinTop-TabHeight-190 @@ -131,19 +131,30 @@ ///1作文批改 2拍照写作 if(self.type==1 || self.type == 3) { - StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; - vc.type = 1; - vc.modelDetailZWPG = self.arrdata[self.bannerView.currentIndex]; - [self.viewController.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; +// vc.type = 1; +// vc.modelDetailZWPG = self.arrdata[self.bannerView.currentIndex]; +// [self.viewController.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.type = 1; + view.modelDetailZWPG = self.arrdata[self.bannerView.currentIndex]; + [self.viewController.view addSubview:view]; } else if (self.type==2) { NSArray *arrtt = @[@"改写作文",@"拍题成文",@"拍照续写"]; int temp = (int)[arrtt indexOfObject:self.strpzname]; - StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; - vc.type = temp+10; - vc.modelXZSL = self.arrdata[self.bannerView.currentIndex]; - [self.viewController.navigationController pushViewController:vc animated:YES]; +// StartKTXZPGViewController *vc = [StartKTXZPGViewController new]; +// vc.type = temp+10; +// vc.modelXZSL = self.arrdata[self.bannerView.currentIndex]; +// [self.viewController.navigationController pushViewController:vc animated:YES]; + + StartKTXZPGView *view = [[StartKTXZPGView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)]; + view.type = temp+10; + view.modelXZSL = self.arrdata[self.bannerView.currentIndex]; + [self.viewController.view addSubview:view]; + } } #pragma mark - JhtBannerScrollViewDataSource