课堂批改完成
This commit is contained in:
parent
c8ca269f23
commit
ca56711ef2
|
@ -331,6 +331,8 @@
|
|||
CAC8066C2CA16DCC00C21AA7 /* StartPZXZViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAC8066B2CA16DCC00C21AA7 /* StartPZXZViewController.m */; };
|
||||
CAC806702CA16E0700C21AA7 /* StartPZXZView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAC8066F2CA16E0700C21AA7 /* StartPZXZView.m */; };
|
||||
CAC806732CA171ED00C21AA7 /* StartPZXZPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAC806722CA171ED00C21AA7 /* StartPZXZPageView.m */; };
|
||||
CAF2BC7D2CCF7F7800028275 /* TextbookModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF2BC7C2CCF7F7800028275 /* TextbookModel.m */; };
|
||||
CAF2BC812CCF8D2700028275 /* FanWenSearchListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF2BC802CCF8D2700028275 /* FanWenSearchListViewController.m */; };
|
||||
CAF76E632CBDFF8500825E5E /* AIChatYuYinView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF76E622CBDFF8500825E5E /* AIChatYuYinView.m */; };
|
||||
CAF76E662CBE01F100825E5E /* AIChatYuYinBackView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF76E652CBE01F100825E5E /* AIChatYuYinBackView.m */; };
|
||||
CAF76E692CBE0A1C00825E5E /* ToolsTypeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF76E682CBE0A1C00825E5E /* ToolsTypeModel.m */; };
|
||||
|
@ -1110,6 +1112,10 @@
|
|||
CAC8066F2CA16E0700C21AA7 /* StartPZXZView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StartPZXZView.m; sourceTree = "<group>"; };
|
||||
CAC806712CA171ED00C21AA7 /* StartPZXZPageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StartPZXZPageView.h; sourceTree = "<group>"; };
|
||||
CAC806722CA171ED00C21AA7 /* StartPZXZPageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StartPZXZPageView.m; sourceTree = "<group>"; };
|
||||
CAF2BC7B2CCF7F7800028275 /* TextbookModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextbookModel.h; sourceTree = "<group>"; };
|
||||
CAF2BC7C2CCF7F7800028275 /* TextbookModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TextbookModel.m; sourceTree = "<group>"; };
|
||||
CAF2BC7F2CCF8D2700028275 /* FanWenSearchListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FanWenSearchListViewController.h; sourceTree = "<group>"; };
|
||||
CAF2BC802CCF8D2700028275 /* FanWenSearchListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FanWenSearchListViewController.m; sourceTree = "<group>"; };
|
||||
CAF76E612CBDFF8500825E5E /* AIChatYuYinView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AIChatYuYinView.h; sourceTree = "<group>"; };
|
||||
CAF76E622CBDFF8500825E5E /* AIChatYuYinView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AIChatYuYinView.m; sourceTree = "<group>"; };
|
||||
CAF76E642CBE01F100825E5E /* AIChatYuYinBackView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AIChatYuYinBackView.h; sourceTree = "<group>"; };
|
||||
|
@ -2830,6 +2836,7 @@
|
|||
CABA145B2C9D0AF7002CB3B1 /* 范文 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CAF2BC7E2CCF8D1100028275 /* 范文搜索列表 */,
|
||||
CA6B97132CBCBCA4000213F3 /* 详情 */,
|
||||
CA6B970F2CBCAC01000213F3 /* cell */,
|
||||
CABA14622C9D0B25002CB3B1 /* FanWenViewController.h */,
|
||||
|
@ -3078,6 +3085,8 @@
|
|||
CA6D547C2CCB9FA8001B530A /* CorrectWriteErrorModel.m */,
|
||||
CA6D547E2CCBA3C2001B530A /* WriteCorrectScoreModel.h */,
|
||||
CA6D547F2CCBA3C2001B530A /* WriteCorrectScoreModel.m */,
|
||||
CAF2BC7B2CCF7F7800028275 /* TextbookModel.h */,
|
||||
CAF2BC7C2CCF7F7800028275 /* TextbookModel.m */,
|
||||
);
|
||||
path = models;
|
||||
sourceTree = "<group>";
|
||||
|
@ -3371,6 +3380,15 @@
|
|||
path = view;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CAF2BC7E2CCF8D1100028275 /* 范文搜索列表 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CAF2BC7F2CCF8D2700028275 /* FanWenSearchListViewController.h */,
|
||||
CAF2BC802CCF8D2700028275 /* FanWenSearchListViewController.m */,
|
||||
);
|
||||
path = "范文搜索列表";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CAF76E702CBE37BC00825E5E /* cell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -4548,6 +4566,7 @@
|
|||
CA5D03602CC0DE8D007B3BA5 /* YaoQingGZView.m in Sources */,
|
||||
CAF76E912CBE663000825E5E /* GongJuCreateSelectView.m in Sources */,
|
||||
CB489F7C2744A0BD00DA044A /* RSAEncrypt.m in Sources */,
|
||||
CAF2BC7D2CCF7F7800028275 /* TextbookModel.m in Sources */,
|
||||
CB489F6B2744A0BD00DA044A /* LJsignView.m in Sources */,
|
||||
CB489F622744A0BD00DA044A /* MDBwebVIew.m in Sources */,
|
||||
CB489F992744A0BD00DA044A /* UserInfoModel.m in Sources */,
|
||||
|
@ -4580,6 +4599,7 @@
|
|||
CA38685A2CC1F66E009C98B0 /* LoginWXView.m in Sources */,
|
||||
CA0D08362CA501710086855E /* ShouYeToolsTableViewCell.m in Sources */,
|
||||
CA6B97372CBD2102000213F3 /* AIChaAnswerTableViewCell.m in Sources */,
|
||||
CAF2BC812CCF8D2700028275 /* FanWenSearchListViewController.m in Sources */,
|
||||
CB489F4B2744A0BD00DA044A /* PGGDatePickView.m in Sources */,
|
||||
CB489FB72744A0BD00DA044A /* UIAlertController+Blocks.m in Sources */,
|
||||
CABA14612C9D0B1C002CB3B1 /* ShouYeViewController.m in Sources */,
|
||||
|
|
Binary file not shown.
|
@ -116,21 +116,5 @@
|
|||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "DF95B401-F15A-4534-856F-854FA4C358F4"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "ProductApp/ProductMain/引导/作文批改/批改信息/view/StartZWPIDetailView.m"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "188"
|
||||
endingLineNumber = "188"
|
||||
landmarkName = "-tiyanAction"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
_searchview = searchview;
|
||||
|
||||
UIImageView *fangdajing = [[UIImageView alloc] init];
|
||||
fangdajing.image = YXUIImage(@"搜索灰");
|
||||
fangdajing.image = YXUIImage(@"gj_search");
|
||||
[searchview addSubview:fangdajing];
|
||||
[fangdajing mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(searchview).offset(12);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#import "CorrectWriteCorrectModel.h"
|
||||
#import "CorrectWriteErrorModel.h"
|
||||
#import "WriteCorrectScoreModel.h"
|
||||
|
||||
#import "TextbookModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@ -347,6 +347,54 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
/api/correct sse
|
||||
*/
|
||||
|
||||
/*
|
||||
思路评价
|
||||
/api/correct
|
||||
correct_outline_review
|
||||
id
|
||||
*/
|
||||
|
||||
/*
|
||||
思路建议
|
||||
/api/correct
|
||||
correct_outline_suggest
|
||||
id
|
||||
*/
|
||||
|
||||
/*
|
||||
添加批改记录
|
||||
/api/correct/save
|
||||
*/
|
||||
+ (void)requestCorrectSaveData:(UIView *)view
|
||||
ID:(NSString *)ID
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
#pragma mark - 课堂写作
|
||||
/*
|
||||
课堂写作列表
|
||||
/api/textbook
|
||||
page
|
||||
season
|
||||
grade
|
||||
sort (asc)
|
||||
*/
|
||||
+ (void)requestTextbookData:(UIView *)view
|
||||
page:(int)page
|
||||
season:(NSString *)season
|
||||
grade:(NSString *)grade
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
/*
|
||||
课堂写作 -作文批改-评分2
|
||||
/api/correct/classroom_correct_score
|
||||
id
|
||||
textbook_id
|
||||
*/
|
||||
+ (void)requestCorrectClassroom_correct_scoreData:(UIView *)view
|
||||
ID:(NSString *)ID
|
||||
textbook_id:(NSString *)textbook_id
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
/*
|
||||
语言列表key分组
|
||||
/api/translate/language/key
|
||||
|
|
|
@ -1015,7 +1015,122 @@
|
|||
/api/correct sse
|
||||
*/
|
||||
|
||||
/*
|
||||
添加批改记录
|
||||
/api/correct/save
|
||||
*/
|
||||
+ (void)requestCorrectSaveData:(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/correct/save" 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,[BaseModel yy_modelWithJSON:dicAll],describle);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 课堂写作
|
||||
/*
|
||||
课堂写作列表
|
||||
/api/textbook
|
||||
page
|
||||
season
|
||||
grade
|
||||
sort (asc)
|
||||
*/
|
||||
+ (void)requestTextbookData:(UIView *)view
|
||||
page:(int)page
|
||||
season:(NSString *)season
|
||||
grade:(NSString *)grade
|
||||
Callback:(completeModeBlock)callback
|
||||
{
|
||||
NSMutableDictionary *dicQuery = [NSMutableDictionary new];
|
||||
[dicQuery setObject:[NSString stringWithFormat:@"%d",page] forKey:@"page"];
|
||||
[dicQuery setObject:[Tools isStringnil:season] forKey:@"season"];
|
||||
[dicQuery setObject:[Tools isStringnil:grade] forKey:@"grade"];
|
||||
[dicQuery setObject:[Tools stringEncode:@"unit asc"] forKey:@"sort"];
|
||||
[dicQuery setObject:@"20" forKey:@"size"];
|
||||
|
||||
NSMutableDictionary *dicHeader = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
|
||||
|
||||
[YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:1 url:@"api/textbook" 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,[TextbookModel yy_modelWithJSON:dicAll],describle);
|
||||
}
|
||||
}];
|
||||
}
|
||||
/*
|
||||
课堂写作 -作文批改-评分2
|
||||
/api/correct/classroom_correct_score
|
||||
id
|
||||
textbook_id
|
||||
*/
|
||||
+ (void)requestCorrectClassroom_correct_scoreData:(UIView *)view
|
||||
ID:(NSString *)ID
|
||||
textbook_id:(NSString *)textbook_id
|
||||
Callback:(completeModeBlock)callback
|
||||
{
|
||||
NSMutableDictionary *dicQuery = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicHeader = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:ID] forKey:@"id"];
|
||||
[dicpush setObject:[Tools isStringnil:textbook_id] forKey:@"textbook_id"];
|
||||
|
||||
[YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:2 url:@"api/correct/classroom_correct_score" 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,[WriteCorrectScoreModel yy_modelWithJSON:dicAll],describle);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
/*
|
||||
语言列表key分组
|
||||
|
|
|
@ -28,10 +28,11 @@
|
|||
+ (instancetype)shareManager
|
||||
{
|
||||
static SSENetWorkManager *_instance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_instance = [[self alloc]init];
|
||||
});
|
||||
// static dispatch_once_t onceToken;
|
||||
// dispatch_once(&onceToken, ^{
|
||||
// _instance = [[self alloc]init];
|
||||
// });
|
||||
_instance = [[self alloc]init];
|
||||
return _instance;
|
||||
}
|
||||
- (void)requestTo:(NSString*)host dicpush:(NSDictionary *)dicpush config:(SSENetWorkManagerBackConfigValue)config backValue:(SSENetWorkManagerBackStringValue)backValue error:(SSENetWorkManagerBackErrorValue)error ID:(SSENetWorkManagerBackIDValue)ID
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// TextbookModel.h
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/28.
|
||||
//
|
||||
|
||||
#import "BaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class TextbookModelData,TextbookModelDataItems;
|
||||
@interface TextbookModel : BaseModel
|
||||
///
|
||||
@property (nonatomic , strong) TextbookModelData *data;
|
||||
@end
|
||||
@interface TextbookModelData : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *items;
|
||||
@end
|
||||
@interface TextbookModelDataItems : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSString *ID;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *grade;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *season;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *unit;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *genre;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *total_score;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *word_count;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *content;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *standard;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *title;
|
||||
/////
|
||||
//@property (nonatomic , strong) NSString *value;
|
||||
/////
|
||||
//@property (nonatomic , strong) NSString *value;
|
||||
/////
|
||||
//@property (nonatomic , strong) NSString *value;
|
||||
/////
|
||||
//@property (nonatomic , strong) NSString *value;
|
||||
/////
|
||||
//@property (nonatomic , strong) NSString *value;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// TextbookModel.m
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/28.
|
||||
//
|
||||
|
||||
#import "TextbookModel.h"
|
||||
|
||||
@implementation TextbookModel
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"data" : [TextbookModelData class]};
|
||||
}
|
||||
@end
|
||||
@implementation TextbookModelData
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"items" : [TextbookModelDataItems class]};
|
||||
}
|
||||
@end
|
||||
@implementation TextbookModelDataItems
|
||||
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
|
||||
{
|
||||
return @{@"ID" : @"id"};
|
||||
}
|
||||
@end
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
[self.navigationView setTitle:@"作文批改" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setBackgroundColor:[UIColor whiteColor]];
|
||||
[self.navigationView.backButton setHidden:self.isshiyong];
|
||||
if(self.isshiyong==NO)
|
||||
if(self.strID.length>0)
|
||||
{
|
||||
[self.navigationView setMuenImg:@"xz_fenxiang"];
|
||||
}
|
||||
|
@ -47,7 +47,6 @@
|
|||
view.modelDetailZWPG = self.modelDetailZWPG;
|
||||
view.arrXZImages = self.arrXZImages;
|
||||
view.strID = self.strID;
|
||||
|
||||
if(self.arrXZImages.count>0)
|
||||
{
|
||||
[LoadAlterView show];
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#import "StartPayViewController.h"
|
||||
#import "DuanLuoXieZuoQWViewController.h"
|
||||
#import "StartKTXZPGDetailXZView.h"
|
||||
#import "XieZuoXiangQingViewController.h"
|
||||
|
||||
|
||||
@interface StartZWPIDetailView ()<UIScrollViewDelegate>
|
||||
///
|
||||
|
@ -178,6 +180,11 @@
|
|||
}
|
||||
-(void)tiyanAction
|
||||
{
|
||||
if(self.viewzh.isdrawEnd==NO)
|
||||
{
|
||||
[HXHud showMessage:@"请等待综合评价写作完成" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
if(self.isshiyong)
|
||||
{///支付
|
||||
StartPayViewController *vc = [StartPayViewController new];
|
||||
|
@ -185,8 +192,11 @@
|
|||
}
|
||||
else
|
||||
{///写作文章
|
||||
DuanLuoXieZuoQWViewController *vc = [DuanLuoXieZuoQWViewController new];
|
||||
// vc.dicpush =
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.strID] forKey:@"id"];
|
||||
XieZuoXiangQingViewController *vc = [XieZuoXiangQingViewController new];
|
||||
vc.dicpush = dicpush;
|
||||
vc.scene = @"rewrite_correct";
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
@ -204,6 +214,7 @@
|
|||
make.width.height.equalTo(self.scvbackinfo);
|
||||
}];
|
||||
viewfj.modelResult = self.modelDetailZWPG.result;
|
||||
viewfj.modelContentItems = self.modelContentItems;
|
||||
_viewfj = viewfj;
|
||||
}
|
||||
}
|
||||
|
@ -219,6 +230,7 @@
|
|||
make.width.height.equalTo(self.scvbackinfo);
|
||||
}];
|
||||
viewxz.modelResult = self.modelDetailZWPG.result;
|
||||
viewxz.strID = self.strID;
|
||||
_viewxz = viewxz;
|
||||
}
|
||||
}
|
||||
|
@ -314,6 +326,7 @@
|
|||
}
|
||||
make.height.offset(image.size.height*UISCREEN_WIDTH/image.size.width);
|
||||
}];
|
||||
imgvback.image = image;
|
||||
viewlast = imgvback;
|
||||
}
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
|
|
@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@property (nonatomic , strong) ExamplePicModelDataItems *modelXZSL;
|
||||
///写作的图片
|
||||
@property (nonatomic , strong) NSArray *arrXZImages;
|
||||
///课堂写作 课堂写作id
|
||||
@property (nonatomic , strong) NSString *textbook_id;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
}];
|
||||
view.isshiyong = self.isshiyong;
|
||||
view.type = self.type;
|
||||
view.textbook_id = self.textbook_id;
|
||||
view.modelDetailYDY = self.modelDetailYDY;
|
||||
view.modelDetailZWPG = self.modelDetailZWPG;
|
||||
view.modelXZSL = self.modelXZSL;
|
||||
|
|
|
@ -29,7 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
///写作的图片
|
||||
@property (nonatomic , strong) NSArray *arrXZImages;
|
||||
|
||||
|
||||
///课堂写作 课堂写作id
|
||||
@property (nonatomic , strong) NSString *textbook_id;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -214,6 +214,7 @@
|
|||
-(void)setArrXZImages:(NSArray *)arrXZImages
|
||||
{
|
||||
_arrXZImages = arrXZImages;
|
||||
if(arrXZImages.count==0)return;
|
||||
self.iputimagetag = 0;
|
||||
self.arrImageIDs = [NSMutableArray new];
|
||||
[self uploadImage];
|
||||
|
@ -222,7 +223,7 @@
|
|||
{
|
||||
self.imgvvalue.image = self.arrXZImages[self.iputimagetag];
|
||||
NSString *strurl = @"";
|
||||
if(self.type==1)
|
||||
if(self.type==1||self.type==0)
|
||||
{
|
||||
strurl = @"api/correct/image";
|
||||
}
|
||||
|
@ -252,9 +253,14 @@
|
|||
}
|
||||
-(void)createJiLu
|
||||
{
|
||||
if(self.type==1)
|
||||
if(self.type==1||self.type==0)
|
||||
{
|
||||
[NetWorkManager requestCorrectCreateData:self images:self.arrImageIDs sse_type:@"2" Callback:^(BOOL state, PicAiModel *responseObject, NSString * _Nullable describle) {
|
||||
NSString *sse_type = @"2";
|
||||
if(self.type == 0)
|
||||
{
|
||||
sse_type = @"3";
|
||||
}
|
||||
[NetWorkManager requestCorrectCreateData:self images:self.arrImageIDs sse_type:sse_type Callback:^(BOOL state, PicAiModel *responseObject, NSString * _Nullable describle) {
|
||||
if(state)
|
||||
{
|
||||
self.strID = responseObject.data.ID;
|
||||
|
@ -309,6 +315,10 @@
|
|||
StartKTXZPGDetailViewController *vc = [StartKTXZPGDetailViewController new];
|
||||
vc.modelDetailYDY = self.modelDetailYDY;
|
||||
vc.isshiyong = self.isshiyong;
|
||||
vc.textbook_id = self.textbook_id;
|
||||
vc.strID = self.strID;
|
||||
vc.arrXZImages = self.arrXZImages;
|
||||
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -15,6 +15,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
///引导页数据
|
||||
@property (nonatomic , strong) TextbookInfoModelData *modelDetailYDY;
|
||||
|
||||
|
||||
///批改的图片
|
||||
@property (nonatomic , strong) NSArray *arrXZImages;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *textbook_id;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#import "StartKTXZPGDetailView.h"
|
||||
|
||||
#import "KaiTongAlterView.h"
|
||||
#import "NetWorkManager.h"
|
||||
|
||||
@interface StartKTXZPGDetailViewController ()
|
||||
///
|
||||
|
@ -26,7 +27,8 @@
|
|||
[self showNaviGationView:YES];
|
||||
[self.navigationView setTitle:@"写作思路" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setBackgroundColor:[UIColor whiteColor]];
|
||||
if(!self.isshiyong)
|
||||
[self.navigationView.backButton setHidden:self.isshiyong];
|
||||
if(self.strID.length>0)
|
||||
{
|
||||
[self.navigationView setMuenImg:@"xz_fenxiang"];
|
||||
}
|
||||
|
@ -48,14 +50,81 @@
|
|||
view.isshiyong = self.isshiyong;
|
||||
view.modelDetailYDY = self.modelDetailYDY;
|
||||
_viewShow = view;
|
||||
|
||||
// if(self.isshiyong==NO)
|
||||
// {
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// KaiTongAlterView *viewkt = [[KaiTongAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
// [self.view addSubview:viewkt];
|
||||
// });
|
||||
// }
|
||||
view.arrXZImages = self.arrXZImages;
|
||||
view.strID = self.strID;
|
||||
if(self.arrXZImages.count>0)
|
||||
{
|
||||
[LoadAlterView show];
|
||||
__block int loadcount = 0;
|
||||
if([Tools isStringnil:self.textbook_id].length>0)
|
||||
{
|
||||
[NetWorkManager requestCorrectClassroom_correct_scoreData:self.view ID:self.strID textbook_id:self.textbook_id Callback:^(BOOL state, WriteCorrectScoreModel *responseObject, NSString * _Nullable describle) {
|
||||
loadcount++;
|
||||
if(state)
|
||||
{
|
||||
view.modelPF = responseObject.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
if(loadcount>=3)
|
||||
{
|
||||
[LoadAlterView dismiss];
|
||||
}
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[NetWorkManager requestCorrectWrite_correct_scoreData:self.view ID:self.strID Callback:^(BOOL state, WriteCorrectScoreModel *responseObject, NSString * _Nullable describle) {
|
||||
loadcount++;
|
||||
if(state)
|
||||
{
|
||||
view.modelPF = responseObject.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
if(loadcount>=3)
|
||||
{
|
||||
[LoadAlterView dismiss];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
[NetWorkManager requestCorrectWrite_correct_errorData:self.view ID:self.strID Callback:^(BOOL state, CorrectWriteErrorModel *responseObject, NSString * _Nullable describle) {
|
||||
loadcount++;
|
||||
if(state)
|
||||
{
|
||||
view.arrErrorLocation = responseObject.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
if(loadcount>=3)
|
||||
{
|
||||
[LoadAlterView dismiss];
|
||||
}
|
||||
}];
|
||||
[NetWorkManager requestCorrectWrite_correctData:self.view ID:self.strID Callback:^(BOOL state, CorrectWriteCorrectModel *responseObject, NSString * _Nullable describle) {
|
||||
loadcount++;
|
||||
if(state)
|
||||
{
|
||||
view.modelContentItems = responseObject.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
if(loadcount>=3)
|
||||
{
|
||||
[LoadAlterView dismiss];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TextbookInfoModel.h"
|
||||
|
||||
#import "WriteCorrectScoreModel.h"
|
||||
#import "CorrectWriteCorrectModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface StartKTXZPGDetailView : UIView
|
||||
|
@ -14,6 +18,19 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@property (nonatomic , assign) BOOL isshiyong;
|
||||
///引导页数据
|
||||
@property (nonatomic , strong) TextbookInfoModelData *modelDetailYDY;
|
||||
|
||||
///批改的图片
|
||||
@property (nonatomic , strong) NSArray *arrXZImages;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strID;
|
||||
|
||||
///评分
|
||||
@property (nonatomic , strong) WriteCorrectScoreModelData *modelPF;
|
||||
///错误位置信息
|
||||
@property (nonatomic , strong) NSArray *arrErrorLocation;
|
||||
///句子数据
|
||||
@property (nonatomic , strong) CorrectWriteCorrectModelData *modelContentItems;
|
||||
|
||||
-(void)shareShow;
|
||||
@end
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#import "StartPayViewController.h"
|
||||
#import "GaiXieRunSeViewController.h"
|
||||
#import "XieZuoFenXiangAlterView.h"
|
||||
#import "XieZuoXiangQingViewController.h"
|
||||
|
||||
@interface StartKTXZPGDetailView ()<UIScrollViewDelegate>
|
||||
///
|
||||
|
@ -181,17 +182,92 @@
|
|||
[pan setTranslation:CGPointZero inView:self];
|
||||
}
|
||||
}
|
||||
-(void)tiyanAction
|
||||
{
|
||||
if(self.viewzh.isdrawEnd==NO)
|
||||
{
|
||||
[HXHud showMessage:@"请等待综合评价写作完成" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
if(self.isshiyong)
|
||||
{
|
||||
StartPayViewController *vc = [StartPayViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
else
|
||||
{///
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.strID] forKey:@"id"];
|
||||
XieZuoXiangQingViewController *vc = [XieZuoXiangQingViewController new];
|
||||
vc.dicpush = dicpush;
|
||||
vc.scene = @"rewrite_correct";
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
|
||||
}
|
||||
}
|
||||
-(void)showVC:(NSInteger)page
|
||||
{
|
||||
if(page==1)
|
||||
{
|
||||
if(!self.viewfj)
|
||||
{
|
||||
StartKTXZPGDetailFJView *viewfj = [StartKTXZPGDetailFJView new];
|
||||
[self.scvbackinfo addSubview:viewfj];
|
||||
[viewfj mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(UISCREEN_WIDTH);
|
||||
make.top.offset(0);
|
||||
make.width.height.equalTo(self.scvbackinfo);
|
||||
}];
|
||||
viewfj.modelResult = self.modelDetailYDY.result;
|
||||
viewfj.modelContentItems = self.modelContentItems;
|
||||
_viewfj = viewfj;
|
||||
}
|
||||
}
|
||||
else if (page==2)
|
||||
{
|
||||
if(!self.viewxz)
|
||||
{
|
||||
StartKTXZPGDetailXZView *viewxz = [StartKTXZPGDetailXZView new];
|
||||
[self.scvbackinfo addSubview:viewxz];
|
||||
[viewxz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(UISCREEN_WIDTH*2);
|
||||
make.top.offset(0);
|
||||
make.width.height.equalTo(self.scvbackinfo);
|
||||
}];
|
||||
viewxz.modelResult = self.modelDetailYDY.result;
|
||||
viewxz.strID = self.strID;
|
||||
_viewxz = viewxz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)shareShow
|
||||
{
|
||||
XieZuoFenXiangAlterView *view = [[XieZuoFenXiangAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.superview addSubview:view];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollView
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
|
||||
{
|
||||
int ipage = scrollView.contentOffset.x/UISCREEN_WIDTH;
|
||||
self.viewtop.selecttag = ipage;
|
||||
[self showVC:ipage];
|
||||
}
|
||||
|
||||
-(void)setIsshiyong:(BOOL)isshiyong
|
||||
{
|
||||
_isshiyong = isshiyong;
|
||||
if(!isshiyong)
|
||||
{
|
||||
[self.btpigai setTitle:@"改写润色" forState:UIControlStateNormal];
|
||||
[self.btpigai setTitle:@"全文润色" forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
-(void)setModelDetailYDY:(TextbookInfoModelData *)modelDetailYDY
|
||||
{
|
||||
_modelDetailYDY = modelDetailYDY;
|
||||
if(modelDetailYDY==nil)return;
|
||||
if(self.modelDetailYDY.output_image.count>0)
|
||||
{
|
||||
UIView *viewlast = nil;
|
||||
|
@ -232,65 +308,49 @@
|
|||
//// 综合评价 分句点评 写作思路
|
||||
self.viewzh.modelResult = modelDetailYDY.result;
|
||||
}
|
||||
-(void)tiyanAction
|
||||
-(void)setArrXZImages:(NSArray *)arrXZImages
|
||||
{
|
||||
if(self.isshiyong)
|
||||
_arrXZImages = arrXZImages;
|
||||
if(arrXZImages.count>0)
|
||||
{
|
||||
StartPayViewController *vc = [StartPayViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
else
|
||||
{///
|
||||
GaiXieRunSeViewController *vc = [GaiXieRunSeViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
-(void)showVC:(NSInteger)page
|
||||
{
|
||||
if(page==1)
|
||||
{
|
||||
if(!self.viewfj)
|
||||
UIView *viewlast = nil;
|
||||
for(UIImage *image in self.arrXZImages)
|
||||
{
|
||||
StartKTXZPGDetailFJView *viewfj = [StartKTXZPGDetailFJView new];
|
||||
[self.scvbackinfo addSubview:viewfj];
|
||||
[viewfj mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(UISCREEN_WIDTH);
|
||||
make.top.offset(0);
|
||||
make.width.height.equalTo(self.scvbackinfo);
|
||||
UIImageView *imgvback = [[UIImageView alloc] init];
|
||||
[imgvback setContentMode:UIViewContentModeScaleAspectFit];
|
||||
[self.scvback addSubview:imgvback];
|
||||
[imgvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(0);
|
||||
make.width.offset(UISCREEN_WIDTH);
|
||||
if(viewlast)
|
||||
{
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(20);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.top.offset(0);
|
||||
}
|
||||
make.height.offset(image.size.height*UISCREEN_WIDTH/image.size.width);
|
||||
}];
|
||||
viewfj.modelResult = self.modelDetailYDY.result;
|
||||
_viewfj = viewfj;
|
||||
imgvback.image = image;
|
||||
viewlast = imgvback;
|
||||
}
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewlast).offset(20);
|
||||
}];
|
||||
}
|
||||
else if (page==2)
|
||||
{
|
||||
if(!self.viewxz)
|
||||
{
|
||||
StartKTXZPGDetailXZView *viewxz = [StartKTXZPGDetailXZView new];
|
||||
[self.scvbackinfo addSubview:viewxz];
|
||||
[viewxz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(UISCREEN_WIDTH*2);
|
||||
make.top.offset(0);
|
||||
make.width.height.equalTo(self.scvbackinfo);
|
||||
}];
|
||||
viewxz.modelResult = self.modelDetailYDY.result;
|
||||
_viewxz = viewxz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)shareShow
|
||||
{
|
||||
XieZuoFenXiangAlterView *view = [[XieZuoFenXiangAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.superview addSubview:view];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollView
|
||||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
|
||||
-(void)setStrID:(NSString *)strID
|
||||
{
|
||||
int ipage = scrollView.contentOffset.x/UISCREEN_WIDTH;
|
||||
self.viewtop.selecttag = ipage;
|
||||
[self showVC:ipage];
|
||||
_strID = strID;
|
||||
self.viewzh.strID = strID;
|
||||
}
|
||||
-(void)setModelPF:(WriteCorrectScoreModelData *)modelPF
|
||||
{
|
||||
_modelPF = modelPF;
|
||||
|
||||
self.viewzh.modelPF = modelPF;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -12,6 +12,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@interface StartKTXZPGDetailXZView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) TextbookInfoModelDataResult *modelResult;
|
||||
|
||||
///正式
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strID;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
//
|
||||
|
||||
#import "StartKTXZPGDetailXZView.h"
|
||||
#import "SSEDrawModel.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
|
||||
typedef void(^backenddraw)(void);
|
||||
|
||||
|
@ -14,7 +16,30 @@ typedef void(^backenddraw)(void);
|
|||
///
|
||||
@property (nonatomic , strong) UIScrollView *scvback;
|
||||
@property (nonatomic , strong) UIView *viewcontent;
|
||||
///
|
||||
@property (nonatomic , strong) UIImageView *imgvline;
|
||||
|
||||
@property (nonatomic , strong) UIView *viewJianYi;
|
||||
@property (nonatomic , strong) MASConstraint *viewJianYiBottom;
|
||||
@property (nonatomic , strong) MASConstraint *scrollBottom;
|
||||
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) ViewLable *lbwzSL;
|
||||
|
||||
@property (nonatomic , assign) BOOL isDragging;
|
||||
|
||||
@property (nonatomic , assign) BOOL isdrawEnd;
|
||||
|
||||
/// 绘制
|
||||
@property (nonatomic , strong) NSMutableArray *arrDraw;
|
||||
@property (nonatomic , assign) NSInteger iDraw;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewDarwLast;
|
||||
///
|
||||
@property (nonatomic , strong) SSEConfigModel *modelConfig;
|
||||
@property (nonatomic , assign) BOOL isStartDrawText;
|
||||
|
||||
@end
|
||||
|
||||
@implementation StartKTXZPGDetailXZView
|
||||
|
@ -52,330 +77,15 @@ typedef void(^backenddraw)(void);
|
|||
[viewcontent.layer setMasksToBounds:YES];
|
||||
[viewcontent.layer setCornerRadius:20];
|
||||
_viewcontent = viewcontent;
|
||||
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
self.scrollBottom = make.bottom.equalTo(viewcontent).offset(20);
|
||||
}];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)drawJianYi:(UIView *)viewLast
|
||||
{
|
||||
UIView *viewt0 = [[UIView alloc] init];
|
||||
[self.scvback addSubview:viewt0];
|
||||
[viewt0 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.width.equalTo(self.scvback);
|
||||
make.top.equalTo(viewLast.mas_bottom).offset(33);
|
||||
make.height.offset(24);
|
||||
}];
|
||||
[self drawTitleView:viewt0 title:@"写作建议"];
|
||||
|
||||
UIView *viewback = [[UIView alloc] init];
|
||||
[self.scvback addSubview:viewback];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(viewt0);
|
||||
make.top.equalTo(viewt0.mas_bottom).offset(20);
|
||||
}];
|
||||
[self.scrollBottom uninstall];
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewback).offset(20);
|
||||
}];
|
||||
|
||||
|
||||
UIView *viewstart = [[UIView alloc] init];
|
||||
[viewback addSubview:viewstart];
|
||||
[viewstart mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(viewback);
|
||||
make.top.offset(0);
|
||||
}];
|
||||
__strong UIView *viewstartself = viewstart;
|
||||
__block MASConstraint *viewbottomtr;
|
||||
[self drawTopView:viewstart back:^{
|
||||
if([self chulijianyi].count<2)return;
|
||||
///中间
|
||||
UIView *viewcenter = [[UIView alloc] init];
|
||||
[viewback addSubview:viewcenter];
|
||||
[viewcenter mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(viewback);
|
||||
make.top.equalTo(viewstartself.mas_bottom);
|
||||
}];
|
||||
__strong UIView *viewcenterself = viewcenter;
|
||||
[self drawCenterView:viewcenter back:^{
|
||||
if([self chulijianyi].count<3)return;
|
||||
///结尾
|
||||
UIView *viewbottom = [[UIView alloc] init];
|
||||
[viewback addSubview:viewbottom];
|
||||
[viewbottom mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(viewback);
|
||||
make.top.equalTo(viewcenterself.mas_bottom);
|
||||
}];
|
||||
[self drawEndView:viewbottom back:^{
|
||||
|
||||
}];
|
||||
[viewbottomtr uninstall];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
viewbottomtr = make.bottom.equalTo(viewbottom);
|
||||
}];
|
||||
}];
|
||||
[viewbottomtr uninstall];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
viewbottomtr = make.bottom.equalTo(viewcenter);
|
||||
}];
|
||||
}];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
viewbottomtr = make.bottom.equalTo(viewstart);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)drawCenterView:(UIView *)view back:(backenddraw)backvalue
|
||||
{
|
||||
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;
|
||||
});
|
||||
});
|
||||
|
||||
NSArray *arrone = [self chulijianyi];
|
||||
if(arrone.count>1)
|
||||
{
|
||||
///段落
|
||||
[self drawCenterArr:@[arrone[1],arrone[1]] tag:0 superView:view lastView:lbname bottomCon:nil back:^{
|
||||
backvalue();
|
||||
imgvline.height = view.height-24;
|
||||
}];
|
||||
}
|
||||
}
|
||||
-(void)drawCenterArr:(NSArray *)arr tag:(int)tag superView:(UIView *)view lastView:(UIView *)lastview bottomCon:(MASConstraint *)bottomCon back:(backenddraw)backvalue
|
||||
{
|
||||
UIView *viewitem = [[UIView alloc] init];
|
||||
[view addSubview:viewitem];
|
||||
[viewitem mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(58);
|
||||
make.right.equalTo(view.mas_right).offset(-15);
|
||||
make.top.equalTo(lastview.mas_bottom).offset(8);
|
||||
}];
|
||||
__block MASConstraint *tempbottom;
|
||||
__block int temptag = tag;
|
||||
[self drawCenterItemView:viewitem tag:tag value:arr[tag] back:^{
|
||||
temptag+=1;
|
||||
if(temptag<arr.count)
|
||||
{
|
||||
[self drawCenterArr:arr tag:temptag superView:view lastView:viewitem bottomCon:tempbottom back:backvalue];
|
||||
}
|
||||
else
|
||||
{
|
||||
backvalue();
|
||||
}
|
||||
}];
|
||||
if(bottomCon)
|
||||
{
|
||||
[bottomCon uninstall];
|
||||
}
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
tempbottom = make.bottom.equalTo(viewitem);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)drawCenterItemView:(UIView *)view tag:(int)tag value:(NSString *)value back:(backenddraw)backvalue
|
||||
{
|
||||
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];
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[view addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(viewtt);
|
||||
make.top.equalTo(viewtt.mas_bottom).offset(8);
|
||||
make.right.equalTo(view);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:15];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = value;
|
||||
lbwz.isWriteEnd = YES;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
backvalue();
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbwz).offset(24);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)drawEndView:(UIView *)view back:(backenddraw)backvalue
|
||||
{
|
||||
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);
|
||||
}];
|
||||
|
||||
NSArray *arrone = [self chulijianyi];
|
||||
NSString *strkt = arrone.lastObject;
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[view addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(8);
|
||||
make.right.equalTo(view).offset(-15);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:15];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = strkt;
|
||||
lbwz.isWriteEnd = YES;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
backvalue();
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbwz).offset(30);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)drawTopView:(UIView *)view back:(backenddraw)backvalue
|
||||
{
|
||||
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;
|
||||
});
|
||||
});
|
||||
|
||||
NSArray *arrone = [self chulijianyi];
|
||||
NSString *strkt = arrone.firstObject;
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[view addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(8);
|
||||
make.right.equalTo(view).offset(-15);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:15];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = strkt;
|
||||
lbwz.isWriteEnd = YES;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
imgvline.height = fheight+38;
|
||||
backvalue();
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbwz).offset(30);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)drawContentView:(UIView *)view
|
||||
-(ViewLable *)drawContentView:(UIView *)view
|
||||
{
|
||||
UIView *viewinfo = [[UIView alloc] init];
|
||||
[viewinfo setBackgroundColor:[UIColor whiteColor]];
|
||||
|
@ -396,33 +106,137 @@ typedef void(^backenddraw)(void);
|
|||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = self.modelResult.outline;
|
||||
lbwz.isWriteEnd = YES;
|
||||
__block MASConstraint *bottominfo;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
[self drawJianYi:view];
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
[viewinfo mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
bottominfo = make.bottom.equalTo(lbwz).offset(20);
|
||||
make.bottom.equalTo(lbwz).offset(20);
|
||||
}];
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewinfo).offset(15);
|
||||
}];
|
||||
|
||||
return lbwz;
|
||||
}
|
||||
-(void)drawJianYi:(UIView *)viewLast
|
||||
{
|
||||
UIView *viewt0 = [[UIView alloc] init];
|
||||
[self.scvback addSubview:viewt0];
|
||||
[viewt0 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.width.equalTo(self.scvback);
|
||||
make.top.equalTo(viewLast.mas_bottom).offset(33);
|
||||
make.height.offset(24);
|
||||
}];
|
||||
[self drawTitleView:viewt0 title:@"写作建议"];
|
||||
|
||||
UIView *viewback = [[UIView alloc] init];
|
||||
[viewback setClipsToBounds:YES];
|
||||
[self.scvback addSubview:viewback];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(viewt0);
|
||||
make.top.equalTo(viewt0.mas_bottom).offset(20);
|
||||
}];
|
||||
_viewJianYi = viewback;
|
||||
[self.scrollBottom uninstall];
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
self.scrollBottom = make.bottom.equalTo(view).offset(20);
|
||||
make.bottom.equalTo(viewback).offset(20);
|
||||
}];
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
///绘制建议title
|
||||
-(UILabel *)drawJianYiTitle:(NSString *)title lastview:(UIView *)viewlast
|
||||
{
|
||||
UIImageView *imgvback = [[UIImageView alloc] init];
|
||||
[imgvback setImage:[UIImage imageNamed:@"yd_detail_jy_l"]];
|
||||
[self.viewJianYi addSubview:imgvback];
|
||||
[imgvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.offset(24);
|
||||
make.left.offset(20);
|
||||
if(viewlast)
|
||||
{
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(20);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.top.offset(0);
|
||||
}
|
||||
}];
|
||||
|
||||
UILabel *lbname = [[UILabel alloc] init];
|
||||
[lbname setText:title];
|
||||
[lbname setTextColor:RGBCOLOR(51, 51, 51)];
|
||||
[lbname setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbname setFont:[UIFont boldSystemFontOfSize:18]];
|
||||
[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;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:15];
|
||||
if(self.viewJianYiBottom)
|
||||
{
|
||||
[self.viewJianYiBottom uninstall];
|
||||
}
|
||||
[self.viewJianYi mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
self.viewJianYiBottom = make.bottom.equalTo(lbwz).offset(24);
|
||||
}];
|
||||
return lbwz;
|
||||
}
|
||||
|
||||
-(void)drawTitleView:(UIView *)view title:(NSString *)title
|
||||
{
|
||||
UIView *viewline = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 7, 17)];
|
||||
|
@ -447,28 +261,87 @@ typedef void(^backenddraw)(void);
|
|||
make.left.equalTo(viewline.mas_right).offset(6);
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSString *)getDuanLuoName:(int)tag
|
||||
{
|
||||
NSArray *arr = @[@"一",@"二",@"三",@"四",@"五",@"六",@"七",@"八",@"九",@"十",@"十一",@"十二",@"十三"];
|
||||
NSString *strback = @"";
|
||||
@try {
|
||||
strback=arr[tag];
|
||||
} @catch (NSException *exception) {
|
||||
strback = [NSString stringWithFormat:@"%d",tag+1];
|
||||
} @finally {
|
||||
|
||||
}
|
||||
return strback;
|
||||
}
|
||||
|
||||
-(void)setModelResult:(TextbookInfoModelDataResult *)modelResult
|
||||
{
|
||||
_modelResult = modelResult;
|
||||
if(modelResult==nil)return;
|
||||
[self drawContentView:self.viewcontent];
|
||||
ViewLable *lbwz = [self drawContentView:self.viewcontent];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = self.modelResult.outline;
|
||||
lbwz.isWriteEnd = YES;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
[self drawJianYi:self.viewcontent];
|
||||
[self nomoData];
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)setStrID:(NSString *)strID
|
||||
{
|
||||
_strID = strID;
|
||||
if(strID.length>0)
|
||||
{
|
||||
ViewLable *lbwz = [self drawContentView:self.viewcontent];
|
||||
_lbwzSL = lbwz;
|
||||
[self getPingJiaData];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)nomoData
|
||||
{
|
||||
self.isdrawEnd = NO;
|
||||
self.arrDraw = [NSMutableArray new];
|
||||
self.iDraw = 0;
|
||||
self.viewDarwLast = nil;
|
||||
self.isStartDrawText = NO;
|
||||
NSArray *arrt = @[@"开头",@"中间",@"结尾"];
|
||||
for(NSString *str in arrt)
|
||||
{
|
||||
SSEDrawModel *model = [SSEDrawModel new];
|
||||
model.title = str;
|
||||
model.arrViewLable = [NSMutableArray new];
|
||||
[self.arrDraw addObject:model];
|
||||
}
|
||||
|
||||
///
|
||||
if(self.modelResult)
|
||||
{
|
||||
@try {
|
||||
NSArray *arrone = [self chulijianyi];
|
||||
SSEDrawModel *modelfirst = self.arrDraw.firstObject;
|
||||
modelfirst.arrSon = @[[Tools isStringnil:arrone.firstObject]];
|
||||
modelfirst.isaddEnd = YES;
|
||||
|
||||
NSString *strcenter = arrone[1];
|
||||
SSEDrawModel *modelcenter = self.arrDraw[1];
|
||||
modelcenter.arrSon = [strcenter componentsSeparatedByString:@"\n"];
|
||||
modelcenter.isaddEnd = YES;
|
||||
|
||||
SSEDrawModel *modelend = self.arrDraw[2];
|
||||
modelend.arrSon = [arrone[2] componentsSeparatedByString:@"\n"];
|
||||
modelend.isaddEnd = YES;
|
||||
} @catch (NSException *exception) {
|
||||
|
||||
} @finally {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(self.isStartDrawText==NO)
|
||||
{
|
||||
self.isStartDrawText = YES;
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(NSArray *)chulijianyi
|
||||
{
|
||||
NSString *strtemp = [self.modelResult.suggest stringByReplacingOccurrencesOfString:@"#开头*" withString:@""];
|
||||
|
@ -477,4 +350,232 @@ typedef void(^backenddraw)(void);
|
|||
return [strtemp componentsSeparatedByString:@"|&&|"];
|
||||
}
|
||||
|
||||
-(void)getPingJiaData
|
||||
{
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.strID] forKey:@"id"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/correct?scene=%@",@"correct_outline_review"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
self.modelConfig = config;
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
|
||||
[self chulishujuSL:value isfinish:isfinish];
|
||||
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[LoadAlterView dismiss];
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)chulishujuSL:(NSString *)value isfinish:(BOOL)isfinish
|
||||
{
|
||||
ViewLable *lbwz = self.lbwzSL;
|
||||
|
||||
if(self.modelConfig.time.intValue>0)
|
||||
{
|
||||
lbwz.fspeed = self.modelConfig.time.intValue/1000.0;
|
||||
}
|
||||
if(!isfinish)
|
||||
{
|
||||
lbwz.strValue = value;
|
||||
}
|
||||
lbwz.isWriteEnd = isfinish;
|
||||
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
[self drawJianYi:self.viewcontent];
|
||||
[self getdata];
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
///建议
|
||||
-(void)getdata
|
||||
{
|
||||
[self nomoData];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.strID] forKey:@"id"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/correct?scene=%@",@"correct_outline_suggest"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
self.modelConfig = config;
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
if(value.length>10)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:YES];
|
||||
}
|
||||
}
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[LoadAlterView dismiss];
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)chuliShuJu:(NSString *)value isfinish:(BOOL)isfinish
|
||||
{
|
||||
NSLog(@"%@",value);
|
||||
if(isfinish)
|
||||
{
|
||||
for(SSEDrawModel *model in self.arrDraw)
|
||||
{
|
||||
model.isaddEnd = YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *strshow = [value stringByReplacingOccurrencesOfString:@"# 开头" withString:@""];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#开头" withString:@""];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"# 中间" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#中间" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"# 结尾" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#结尾" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#" withString:@"|&&|"];
|
||||
NSArray *arrtt = [strshow componentsSeparatedByString:@"|&&|"];
|
||||
SSEDrawModel *modellast;
|
||||
for(int i = 0 ; i < arrtt.count;i++)
|
||||
{
|
||||
NSString *str = arrtt[i];
|
||||
if([str rangeOfString:@"*"].length==0)break;
|
||||
if(i>=self.arrDraw.count||str.length==0)break;
|
||||
SSEDrawModel *model = self.arrDraw[i];
|
||||
NSArray *arrson;
|
||||
if([str rangeOfString:@"* "].length>0)
|
||||
{
|
||||
arrson = [str componentsSeparatedByString:@"* "];
|
||||
}
|
||||
else
|
||||
{
|
||||
arrson = [str componentsSeparatedByString:@"*"];
|
||||
}
|
||||
NSMutableArray *arrvalue = [NSMutableArray arrayWithArray:arrson];
|
||||
[arrvalue removeObject:@""];
|
||||
[arrvalue removeObject:@"\n"];
|
||||
model.arrSon = arrvalue;
|
||||
if(i>0)
|
||||
{
|
||||
if(arrvalue.count>0)
|
||||
{
|
||||
modellast.isaddEnd = YES;
|
||||
}
|
||||
}
|
||||
modellast = model;
|
||||
}
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(self.isStartDrawText==NO)
|
||||
{
|
||||
self.isStartDrawText = YES;
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
-(void)drawTextInfo
|
||||
{
|
||||
if(self.iDraw>=self.arrDraw.count)
|
||||
{
|
||||
self.isdrawEnd = YES;
|
||||
return;
|
||||
}
|
||||
SSEDrawModel *model = self.arrDraw[self.iDraw];
|
||||
if(model.isDrawTitle==NO)
|
||||
{
|
||||
if(model.arrSon==nil)
|
||||
{
|
||||
if(model.isaddEnd==YES)
|
||||
{
|
||||
self.iDraw+=1;
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self drawTextInfo];
|
||||
});
|
||||
return;
|
||||
}
|
||||
///绘制大模块
|
||||
UIView *viewtc = [self drawJianYiTitle:model.title lastview:self.viewDarwLast];
|
||||
if([model.title isEqualToString:@"结尾"])
|
||||
{
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
self.imgvline.height = viewtc.top;
|
||||
});
|
||||
}
|
||||
model.isDrawTitle = YES;
|
||||
self.viewDarwLast = viewtc;
|
||||
model.idrawtag = 0;
|
||||
}
|
||||
|
||||
///绘制小模块
|
||||
ViewLable *lbwz;
|
||||
if(model.arrViewLable.count<=model.idrawtag)
|
||||
{
|
||||
if([model.title isEqualToString:@"中间"])
|
||||
{
|
||||
lbwz = [self drawJianYiItemView:self.viewDarwLast tag:(int)model.idrawtag+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz = [self drawJianYiItemView:self.viewDarwLast tag:-1];
|
||||
}
|
||||
|
||||
if(self.modelConfig.time.intValue>0)
|
||||
{
|
||||
lbwz.fspeed = self.modelConfig.time.intValue/1000.0;
|
||||
}
|
||||
[model.arrViewLable addObject:lbwz];
|
||||
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
model.idrawtag +=1;
|
||||
if(model.idrawtag>=model.arrSon.count)
|
||||
{
|
||||
self.iDraw+=1;
|
||||
}
|
||||
}
|
||||
if(fheight==-1||isend)
|
||||
{
|
||||
[self drawTextInfo];
|
||||
}
|
||||
if(self.isDragging==NO)
|
||||
{
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height) animated:NO];
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz = model.arrViewLable[model.idrawtag];
|
||||
}
|
||||
|
||||
if(model.arrSon.count-1>model.idrawtag||self.isdrawEnd==YES||self.iDraw>=self.arrDraw.count || model.isaddEnd==YES)
|
||||
{
|
||||
lbwz.isWriteEnd = YES;
|
||||
}
|
||||
|
||||
lbwz.strValue = model.arrSon[model.idrawtag];
|
||||
|
||||
self.viewDarwLast = lbwz;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -7,11 +7,17 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TextbookInfoModel.h"
|
||||
#import "CorrectWriteCorrectModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface StartKTXZPGDetailFJItemView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) TextbookInfoModelDataResultSplit *model;
|
||||
///正式数据
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strID;
|
||||
@property (nonatomic , strong) NSString *index;
|
||||
@property (nonatomic , strong) CorrectWriteCorrectModelDataSplit *modelZS;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -7,11 +7,32 @@
|
|||
|
||||
#import "StartKTXZPGDetailFJItemView.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
#import "RoleTreeModel.h"
|
||||
#import "SSEDrawListTextModel.h"
|
||||
|
||||
@interface StartKTXZPGDetailFJItemView ()
|
||||
@interface StartKTXZPGDetailFJItemView ()<UIScrollViewDelegate>
|
||||
///
|
||||
@property (nonatomic , strong) UIScrollView *scvback ;
|
||||
@property (nonatomic , strong) UIView *viewcontent;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewinfo;
|
||||
|
||||
@property (nonatomic , assign) BOOL isDragging;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrdata;
|
||||
|
||||
@property (nonatomic , assign) BOOL isdrawEnd;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) SSEConfigModel *modelConfig;
|
||||
@property (nonatomic , assign) BOOL isStartDrawText;
|
||||
///
|
||||
@property (nonatomic , strong) MASConstraint *bottomScroll;
|
||||
@property (nonatomic , assign) NSInteger iDraw;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewDarwLast;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -23,6 +44,7 @@
|
|||
{
|
||||
UIScrollView *scvback = [[UIScrollView alloc] init];
|
||||
[scvback setShowsVerticalScrollIndicator:NO];
|
||||
[scvback setDelegate:self];
|
||||
[self addSubview:scvback];
|
||||
[scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.offset(0);
|
||||
|
@ -41,6 +63,7 @@
|
|||
[viewcontent.layer setMasksToBounds:YES];
|
||||
[viewcontent.layer setCornerRadius:20];
|
||||
_viewcontent = viewcontent;
|
||||
[self drawContentView:self.viewcontent];
|
||||
|
||||
[scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewcontent);
|
||||
|
@ -71,40 +94,13 @@
|
|||
}];
|
||||
[viewinfo.layer setMasksToBounds:YES];
|
||||
[viewinfo.layer setCornerRadius:20];
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[viewinfo addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.offset(15);
|
||||
make.right.equalTo(viewinfo).offset(-15);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = self.model.review_content;
|
||||
lbwz.isWriteEnd = YES;
|
||||
__strong ViewLable *lbwzself = lbwz;
|
||||
__block MASConstraint *bottominfo;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
[self drawTextItem:viewinfo title:@"建议" color:RGBCOLOR(230, 172, 40) value:self.model.suggest lastview:lbwzself isend:YES traint:bottominfo];
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
|
||||
}];
|
||||
[viewinfo mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
bottominfo = make.bottom.equalTo(lbwz).offset(20);
|
||||
}];
|
||||
_viewinfo = viewinfo;
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewinfo).offset(15);
|
||||
}];
|
||||
}
|
||||
-(void)drawTextItem:(UIView *)view title:(NSString *)title color:(UIColor *)color value:(NSString *)value lastview:(UIView *)viewlast isend:(BOOL)isenddraw traint:(MASConstraint *)traint
|
||||
-(ViewLable *)drawTextItem:(UIView *)view title:(NSString *)title color:(UIColor *)color lastview:(UIView *)viewlast
|
||||
{
|
||||
UILabel *lbname = [[UILabel alloc] init];
|
||||
[lbname setText:title];
|
||||
|
@ -116,10 +112,21 @@
|
|||
[lbname mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.sizeOffset(CGSizeMake(46, 20));
|
||||
make.left.offset(15);
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(20);
|
||||
if(viewlast)
|
||||
{
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(20);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.top.offset(20);
|
||||
}
|
||||
}];
|
||||
[lbname.layer setMasksToBounds:YES];
|
||||
[lbname.layer setCornerRadius:10];
|
||||
if(title.length==0)
|
||||
{
|
||||
[lbname setHidden:YES];
|
||||
}
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[view addSubview:lbwz];
|
||||
|
@ -130,24 +137,221 @@
|
|||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",value];
|
||||
lbwz.isWriteEnd = YES;
|
||||
__strong ViewLable *lbwzself = lbwz;
|
||||
__block MASConstraint *bottominfo;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
|
||||
}];
|
||||
[traint uninstall];
|
||||
|
||||
if(self.bottomScroll)
|
||||
{
|
||||
[self.bottomScroll uninstall];
|
||||
}
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
bottominfo = make.bottom.equalTo(lbwz).offset(20);
|
||||
self.bottomScroll = make.bottom.equalTo(lbwz).offset(20);
|
||||
}];
|
||||
return lbwz;
|
||||
}
|
||||
-(void)setModel:(TextbookInfoModelDataResultSplit *)model
|
||||
{
|
||||
_model = model;
|
||||
|
||||
[self drawContentView:self.viewcontent];
|
||||
NSArray *arrtt = @[@"",@"优点",@"建议"];
|
||||
NSArray *arrvalues = @[[Tools isStringnilkong:model.origin_content],[Tools isStringnilkong:model.review_content],[Tools isStringnilkong:model.suggest]];
|
||||
self.arrdata = [NSMutableArray new];
|
||||
for(int i = 0 ; i < 3;i++)
|
||||
{
|
||||
SSEDrawListTextModel *model = [SSEDrawListTextModel new];
|
||||
model.title = arrtt[i];
|
||||
model.value = arrvalues[i];
|
||||
model.isaddEnd = YES;
|
||||
[self.arrdata addObject:model];
|
||||
}
|
||||
|
||||
self.isStartDrawText = NO;
|
||||
self.isdrawEnd = NO;
|
||||
self.iDraw = 0;
|
||||
self.viewDarwLast = nil;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(self.isStartDrawText==NO)
|
||||
{
|
||||
self.isStartDrawText = YES;
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
-(void)setModelZS:(CorrectWriteCorrectModelDataSplit *)modelZS
|
||||
{
|
||||
_modelZS = modelZS;
|
||||
|
||||
[self getdata];
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollView
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
self.isDragging = YES;
|
||||
}
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
|
||||
{
|
||||
self.isDragging = NO;
|
||||
}
|
||||
-(void)nomoData
|
||||
{
|
||||
NSArray *arrtt = @[@"",@"优点",@"建议"];
|
||||
self.arrdata = [NSMutableArray new];
|
||||
for(int i = 0 ; i < 3;i++)
|
||||
{
|
||||
SSEDrawListTextModel *model = [SSEDrawListTextModel new];
|
||||
model.title = arrtt[i];
|
||||
if(i==0)
|
||||
{
|
||||
model.value = self.modelZS.origin_content;
|
||||
model.isaddEnd = YES;
|
||||
}
|
||||
[self.arrdata addObject:model];
|
||||
}
|
||||
|
||||
self.isStartDrawText = NO;
|
||||
self.isdrawEnd = NO;
|
||||
self.iDraw = 0;
|
||||
self.viewDarwLast = nil;
|
||||
}
|
||||
-(void)getdata
|
||||
{
|
||||
[self nomoData];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.modelZS.origin_content] forKey:@"content"];
|
||||
[dicpush setObject:[Tools isStringnil:self.index] forKey:@"index"];
|
||||
[dicpush setObject:[Tools isStringnil:self.strID] forKey:@"id"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/correct?scene=%@",@"write_correct_evaluate_single"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
self.modelConfig = config;
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
if(value.length>10)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:YES];
|
||||
}
|
||||
}
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[LoadAlterView dismiss];
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)chuliShuJu:(NSString *)value isfinish:(BOOL)isfinish
|
||||
{
|
||||
NSLog(@"%@",value);
|
||||
if(isfinish)
|
||||
{
|
||||
for(SSEDrawListTextModel *model in self.arrdata)
|
||||
{
|
||||
model.isaddEnd = YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *strshow = [value stringByReplacingOccurrencesOfString:@"# 鼓励的评价" withString:@""];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#鼓励的评价" withString:@""];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"# 优秀的建议" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#优秀的建议" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#" withString:@"|&&|"];
|
||||
NSArray *arrlist = [strshow componentsSeparatedByString:@"|&&|"];
|
||||
SSEDrawListTextModel *modellast=self.arrdata[0];
|
||||
for(int i = 0 ; i < arrlist.count;i++)
|
||||
{
|
||||
if(i>=self.arrdata.count-1)break;
|
||||
NSString *str = arrlist[i];
|
||||
if(str.length<2)
|
||||
{
|
||||
continue;;
|
||||
}
|
||||
if(modellast)
|
||||
{
|
||||
modellast.isaddEnd = YES;
|
||||
}
|
||||
SSEDrawListTextModel *model = self.arrdata[i+1];
|
||||
str = [str stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
model.value = str;
|
||||
modellast = model;
|
||||
}
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(self.isStartDrawText==NO)
|
||||
{
|
||||
self.isStartDrawText = YES;
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
-(void)drawTextInfo
|
||||
{
|
||||
if(self.iDraw>=self.arrdata.count)
|
||||
{
|
||||
self.isdrawEnd = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
SSEDrawListTextModel *model = self.arrdata[self.iDraw];
|
||||
if(model.value.length==0)
|
||||
{
|
||||
self.iDraw++;
|
||||
[self drawTextInfo];
|
||||
return;
|
||||
}
|
||||
ViewLable *lbwz;
|
||||
if(model.lbwz==nil)
|
||||
{
|
||||
UIColor *colortemp = RGBCOLOR(108, 119, 246);
|
||||
if([model.title isEqualToString:@"建议"])
|
||||
{
|
||||
colortemp = RGBCOLOR(230, 172, 40);
|
||||
}
|
||||
lbwz = [self drawTextItem:self.viewinfo title:model.title color:colortemp lastview:self.viewDarwLast];
|
||||
|
||||
if(self.modelConfig.time.intValue>0)
|
||||
{
|
||||
lbwz.fspeed = self.modelConfig.time.intValue/1000.0;
|
||||
}
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
self.iDraw+=1;
|
||||
}
|
||||
if(fheight==-1||isend)
|
||||
{
|
||||
[self drawTextInfo];
|
||||
}
|
||||
if(self.isDragging==NO)
|
||||
{
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height) animated:NO];
|
||||
}
|
||||
}
|
||||
}];
|
||||
self.viewDarwLast = lbwz;
|
||||
model.lbwz = lbwz;
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz = model.lbwz;
|
||||
}
|
||||
lbwz.isWriteEnd = model.isaddEnd;
|
||||
if(model.title.length>0)
|
||||
{
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",model.value];
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz.strValue = model.value;
|
||||
}
|
||||
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -7,11 +7,18 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TextbookInfoModel.h"
|
||||
|
||||
#import "CorrectWriteCorrectModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface StartKTXZPGDetailFJView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) TextbookInfoModelDataResult *modelResult;
|
||||
/////////正式数据
|
||||
///句子数据
|
||||
@property (nonatomic , strong) CorrectWriteCorrectModelData *modelContentItems;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
-(void)drawTopView:(UIView *)view
|
||||
-(void)drawTopView:(UIView *)view values:(NSArray *)values
|
||||
{
|
||||
UIScrollView *scvback = [[UIScrollView alloc] init];
|
||||
[view addSubview:scvback];
|
||||
|
@ -61,7 +61,7 @@
|
|||
[scvback setShowsHorizontalScrollIndicator:NO];
|
||||
self.arrViews = [NSMutableArray new];
|
||||
UIView *viewlast = nil;
|
||||
for(int i = 0 ; i < self.modelResult.split_review.count; i++)
|
||||
for(int i = 0 ; i < values.count; i++)
|
||||
{
|
||||
UIButton *btitem = [[UIButton alloc] init];
|
||||
[btitem setTitle:[NSString stringWithFormat:@"%d",i+1] forState:UIControlStateNormal];
|
||||
|
@ -121,7 +121,16 @@
|
|||
make.left.offset(UISCREEN_WIDTH*sender.tag);
|
||||
make.height.equalTo(self.scvback);
|
||||
}];
|
||||
viewone.model = self.modelResult.split_review[sender.tag];
|
||||
if(self.modelResult)
|
||||
{
|
||||
viewone.model = self.modelResult.split_review[sender.tag];
|
||||
}
|
||||
else
|
||||
{
|
||||
viewone.strID = self.modelContentItems.ID;
|
||||
viewone.index = [NSString stringWithFormat:@"%ld",sender.tag];
|
||||
viewone.modelZS = self.modelContentItems.split_review[sender.tag];
|
||||
}
|
||||
self.arrViews[sender.tag] = viewone;
|
||||
}
|
||||
[self.scvback setContentOffset:CGPointMake(UISCREEN_WIDTH*sender.tag, 0)];
|
||||
|
@ -132,7 +141,7 @@
|
|||
if(modelResult==nil)return;
|
||||
if(self.modelResult.split_review.count>0)
|
||||
{
|
||||
[self drawTopView:self.viewtop];
|
||||
[self drawTopView:self.viewtop values:self.modelResult.split_review];
|
||||
|
||||
StartKTXZPGDetailFJItemView *viewone = [StartKTXZPGDetailFJItemView new];
|
||||
[self.scvback addSubview:viewone];
|
||||
|
@ -146,5 +155,28 @@
|
|||
viewone.model = self.modelResult.split_review.firstObject;
|
||||
}
|
||||
}
|
||||
-(void)setModelContentItems:(CorrectWriteCorrectModelData *)modelContentItems
|
||||
{
|
||||
_modelContentItems = modelContentItems;
|
||||
if(modelContentItems.split_review.count==0)return;
|
||||
|
||||
if(self.modelContentItems.split_review.count>0)
|
||||
{
|
||||
[self drawTopView:self.viewtop values:self.modelContentItems.split_review];
|
||||
|
||||
StartKTXZPGDetailFJItemView *viewone = [StartKTXZPGDetailFJItemView new];
|
||||
[self.scvback addSubview:viewone];
|
||||
[viewone mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.width.equalTo(self.scvback);
|
||||
make.top.offset(0);
|
||||
make.height.equalTo(self.scvback);
|
||||
}];
|
||||
self.arrViews[0] = viewone;
|
||||
viewone.strID = self.modelContentItems.ID;
|
||||
viewone.index = @"0";
|
||||
viewone.modelZS = self.modelContentItems.split_review.firstObject;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface StartKTXZPGDetailZHView : UIView
|
||||
|
||||
@property (nonatomic , assign) BOOL isdrawEnd;
|
||||
///
|
||||
@property (nonatomic , strong) TextbookInfoModelDataResult *modelResult;
|
||||
|
||||
|
|
|
@ -6,16 +6,36 @@
|
|||
//
|
||||
|
||||
#import "StartKTXZPGDetailZHView.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
#import "RoleTreeModel.h"
|
||||
#import "SSEDrawListTextModel.h"
|
||||
|
||||
@interface StartKTXZPGDetailZHView ()<UIScrollViewDelegate>
|
||||
///
|
||||
@property (nonatomic , strong) UIScrollView *scvback;
|
||||
@property (nonatomic , assign) BOOL isDragging;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewtop;
|
||||
@property (nonatomic , strong) UIView *viewcontent;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewinfo;
|
||||
|
||||
@property (nonatomic , assign) BOOL isDragging;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrdata;
|
||||
|
||||
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) SSEConfigModel *modelConfig;
|
||||
@property (nonatomic , assign) BOOL isStartDrawText;
|
||||
///
|
||||
@property (nonatomic , strong) MASConstraint *bottomScroll;
|
||||
@property (nonatomic , assign) NSInteger iDraw;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewDarwLast;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -66,7 +86,7 @@
|
|||
[viewcontent.layer setMasksToBounds:YES];
|
||||
[viewcontent.layer setCornerRadius:20];
|
||||
_viewcontent = viewcontent;
|
||||
|
||||
[self drawContentView:viewcontent];
|
||||
|
||||
[scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewcontent).offset(20);
|
||||
|
@ -78,70 +98,22 @@
|
|||
|
||||
-(void)drawContentView:(UIView *)view
|
||||
{
|
||||
UILabel *lbbz = [[UILabel alloc] init];
|
||||
[lbbz setText:@"评分标准:"];
|
||||
[lbbz setTextColor:RGBCOLOR(61, 61, 61)];
|
||||
[lbbz setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbbz setFont:[UIFont systemFontOfSize:12]];
|
||||
[view addSubview:lbbz];
|
||||
[lbbz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.offset(15);
|
||||
}];
|
||||
|
||||
UILabel *lbbzName = [[UILabel alloc] init];
|
||||
[lbbzName setText:[Tools isStringnilkong:self.modelResult.complex_review.full_review.style]];
|
||||
[lbbzName setTextColor:RGBCOLOR(61, 61, 61)];
|
||||
[lbbzName setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbbzName setFont:[UIFont systemFontOfSize:12]];
|
||||
[view addSubview:lbbzName];
|
||||
[lbbzName mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbbz.mas_right);
|
||||
make.centerY.equalTo(lbbz);
|
||||
}];
|
||||
|
||||
UIView *viewinfo = [[UIView alloc] init];
|
||||
[viewinfo setBackgroundColor:[UIColor whiteColor]];
|
||||
[view addSubview:viewinfo];
|
||||
[viewinfo mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(15);
|
||||
make.left.top.offset(15);
|
||||
make.right.equalTo(view).offset(-15);
|
||||
make.top.offset(47);
|
||||
}];
|
||||
[viewinfo.layer setMasksToBounds:YES];
|
||||
[viewinfo.layer setCornerRadius:20];
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[viewinfo addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.offset(15);
|
||||
make.right.equalTo(viewinfo).offset(-15);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = self.modelResult.complex_review.full_review.review_content;
|
||||
lbwz.isWriteEnd = YES;
|
||||
__strong ViewLable *lbwzself = lbwz;
|
||||
__block MASConstraint *bottominfo;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(self.isDragging==NO)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height) animated:NO];
|
||||
}
|
||||
if(isend)
|
||||
{
|
||||
[self drawTextItem:viewinfo title:@"优点" color:RGBCOLOR(108, 119, 246) value:self.modelResult.complex_review.full_review.advantage lastview:lbwzself isend:NO traint:bottominfo];
|
||||
}
|
||||
}];
|
||||
[viewinfo mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
bottominfo = make.bottom.equalTo(lbwz).offset(20);
|
||||
}];
|
||||
_viewinfo = viewinfo;
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewinfo).offset(15);
|
||||
}];
|
||||
}
|
||||
-(void)drawTextItem:(UIView *)view title:(NSString *)title color:(UIColor *)color value:(NSString *)value lastview:(UIView *)viewlast isend:(BOOL)isenddraw traint:(MASConstraint *)traint
|
||||
-(ViewLable *)drawTextItem:(UIView *)view title:(NSString *)title color:(UIColor *)color lastview:(UIView *)viewlast
|
||||
{
|
||||
UILabel *lbname = [[UILabel alloc] init];
|
||||
[lbname setText:title];
|
||||
|
@ -153,10 +125,21 @@
|
|||
[lbname mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.sizeOffset(CGSizeMake(46, 20));
|
||||
make.left.offset(15);
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(20);
|
||||
if(viewlast)
|
||||
{
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(20);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.top.offset(20);
|
||||
}
|
||||
}];
|
||||
[lbname.layer setMasksToBounds:YES];
|
||||
[lbname.layer setCornerRadius:10];
|
||||
if(title.length==0)
|
||||
{
|
||||
[lbname setHidden:YES];
|
||||
}
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[view addSubview:lbwz];
|
||||
|
@ -167,25 +150,15 @@
|
|||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",value];
|
||||
lbwz.isWriteEnd = YES;
|
||||
__strong ViewLable *lbwzself = lbwz;
|
||||
__block MASConstraint *bottominfo;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(self.isDragging==NO)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height) animated:NO];
|
||||
}
|
||||
if(isend==YES && isenddraw==NO)
|
||||
{
|
||||
[self drawTextItem:view title:@"建议" color:RGBCOLOR(230, 172, 40) value:self.modelResult.complex_review.full_review.disadvantage lastview:lbwzself isend:YES traint:bottominfo];
|
||||
}
|
||||
}];
|
||||
[traint uninstall];
|
||||
|
||||
if(self.bottomScroll)
|
||||
{
|
||||
[self.bottomScroll uninstall];
|
||||
}
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
bottominfo = make.bottom.equalTo(lbwz).offset(20);
|
||||
self.bottomScroll = make.bottom.equalTo(lbwz).offset(20);
|
||||
}];
|
||||
return lbwz;
|
||||
}
|
||||
|
||||
-(void)drawTopView:(UIView *)view
|
||||
|
@ -328,14 +301,40 @@
|
|||
_modelResult = modelResult;
|
||||
if(modelResult==nil)return;
|
||||
[self drawTopView:self.viewtop];
|
||||
[self drawContentView:self.viewcontent];
|
||||
|
||||
|
||||
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];
|
||||
for(int i = 0 ; i < 3;i++)
|
||||
{
|
||||
SSEDrawListTextModel *model = [SSEDrawListTextModel new];
|
||||
model.title = arrtt[i];
|
||||
model.value = arrvalues[i];
|
||||
model.isaddEnd = YES;
|
||||
[self.arrdata addObject:model];
|
||||
}
|
||||
|
||||
self.isStartDrawText = NO;
|
||||
self.isdrawEnd = NO;
|
||||
self.iDraw = 0;
|
||||
self.viewDarwLast = nil;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(self.isStartDrawText==NO)
|
||||
{
|
||||
self.isStartDrawText = YES;
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
-(void)setModelPF:(WriteCorrectScoreModelData *)modelPF
|
||||
{
|
||||
_modelPF = modelPF;
|
||||
if(modelPF==nil)return;
|
||||
[self drawTopView:self.viewtop];
|
||||
// [self drawContentView:self.viewcontent];
|
||||
[self getdata];
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollView
|
||||
|
@ -347,4 +346,160 @@
|
|||
{
|
||||
self.isDragging = NO;
|
||||
}
|
||||
-(void)nomoData
|
||||
{
|
||||
NSArray *arrtt = @[@"",@"优点",@"建议"];
|
||||
self.arrdata = [NSMutableArray new];
|
||||
for(int i = 0 ; i < 3;i++)
|
||||
{
|
||||
SSEDrawListTextModel *model = [SSEDrawListTextModel new];
|
||||
model.title = arrtt[i];
|
||||
[self.arrdata addObject:model];
|
||||
}
|
||||
|
||||
self.isStartDrawText = NO;
|
||||
self.isdrawEnd = NO;
|
||||
self.iDraw = 0;
|
||||
self.viewDarwLast = nil;
|
||||
}
|
||||
-(void)getdata
|
||||
{
|
||||
[self nomoData];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.strID] forKey:@"id"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/correct?scene=%@",@"write_correct_evaluate"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
self.modelConfig = config;
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
if(value.length>10)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:YES];
|
||||
}
|
||||
}
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[LoadAlterView dismiss];
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)chuliShuJu:(NSString *)value isfinish:(BOOL)isfinish
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
for(SSEDrawListTextModel *model in self.arrdata)
|
||||
{
|
||||
model.isaddEnd = YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *strshow = [value stringByReplacingOccurrencesOfString:@"# 综合评价" withString:@""];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#综合评价" withString:@""];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"# 作文优点" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#作文优点" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"# 作文缺点" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#作文缺点" withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#" withString:@"|&&|"];
|
||||
NSArray *arrlist = [strshow componentsSeparatedByString:@"|&&|"];
|
||||
SSEDrawListTextModel *modellast;
|
||||
for(int i = 0 ; i < arrlist.count;i++)
|
||||
{
|
||||
if(i>=self.arrdata.count)break;
|
||||
NSString *str = arrlist[i];
|
||||
if(str.length<2)
|
||||
{
|
||||
continue;;
|
||||
}
|
||||
if(modellast)
|
||||
{
|
||||
modellast.isaddEnd = YES;
|
||||
}
|
||||
SSEDrawListTextModel *model = self.arrdata[i];
|
||||
str = [str stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
model.value = str;
|
||||
modellast = model;
|
||||
}
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if(self.isStartDrawText==NO)
|
||||
{
|
||||
self.isStartDrawText = YES;
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
-(void)drawTextInfo
|
||||
{
|
||||
if(self.iDraw>=self.arrdata.count)
|
||||
{
|
||||
self.isdrawEnd = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
SSEDrawListTextModel *model = self.arrdata[self.iDraw];
|
||||
if(model.value.length==0)
|
||||
{
|
||||
self.iDraw++;
|
||||
[self drawTextInfo];
|
||||
return;
|
||||
}
|
||||
ViewLable *lbwz;
|
||||
if(model.lbwz==nil)
|
||||
{
|
||||
UIColor *colortemp = RGBCOLOR(108, 119, 246);
|
||||
if([model.title isEqualToString:@"建议"])
|
||||
{
|
||||
colortemp = RGBCOLOR(230, 172, 40);
|
||||
}
|
||||
lbwz = [self drawTextItem:self.viewinfo title:model.title color:colortemp lastview:self.viewDarwLast];
|
||||
|
||||
if(self.modelConfig.time.intValue>0)
|
||||
{
|
||||
lbwz.fspeed = self.modelConfig.time.intValue/1000.0;
|
||||
}
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
self.iDraw+=1;
|
||||
}
|
||||
if(fheight==-1||isend)
|
||||
{
|
||||
[self drawTextInfo];
|
||||
}
|
||||
if(self.isDragging==NO)
|
||||
{
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height) animated:NO];
|
||||
}
|
||||
}
|
||||
}];
|
||||
self.viewDarwLast = lbwz;
|
||||
model.lbwz = lbwz;
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz = model.lbwz;
|
||||
}
|
||||
lbwz.isWriteEnd = model.isaddEnd;
|
||||
if(model.title.length>0)
|
||||
{
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",model.value];
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz.strValue = model.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// FanWenSearchListViewController.h
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/28.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FanWenSearchListViewController : BaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,184 @@
|
|||
//
|
||||
// FanWenSearchListViewController.m
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/28.
|
||||
//
|
||||
|
||||
#import "FanWenSearchListViewController.h"
|
||||
#import "PGJSearchView.h"
|
||||
#import "FanWenListTableViewCell.h"
|
||||
#import "FanWenDetailViewController.h"
|
||||
|
||||
@interface FanWenSearchListViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
///
|
||||
@property (nonatomic , strong) UITableView *tableView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation FanWenSearchListViewController
|
||||
- (UIStatusBarStyle)preferredStatusBarStyle {
|
||||
return UIStatusBarStyleDefault;
|
||||
}
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
||||
[self showNaviGationView:YES];
|
||||
[self.navigationView setTitle:@"范文搜索" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setBackgroundColor:[UIColor whiteColor]];
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self.view setBackgroundColor:RGBCOLOR(251, 251, 253)];
|
||||
|
||||
|
||||
PGJSearchView *viewsearch = [[PGJSearchView alloc] init];
|
||||
[viewsearch setBackgroundColor:[UIColor whiteColor]];
|
||||
[self.view addSubview:viewsearch];
|
||||
[viewsearch mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(20);
|
||||
make.right.equalTo(self.view).offset(-20);
|
||||
make.top.offset(NavHeight+10);
|
||||
make.height.offset(40);
|
||||
}];
|
||||
[viewsearch.searchview mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.offset(40);
|
||||
}];
|
||||
[viewsearch.searchview.layer setMasksToBounds:YES];
|
||||
[viewsearch.searchview.layer setCornerRadius:6];
|
||||
[viewsearch.searchview setBackgroundColor:[UIColor whiteColor]];
|
||||
viewsearch.searchField.placeholder = @"请输入文章标题或者关键词";
|
||||
[viewsearch.searchbtn setBackgroundColor:[UIColor whiteColor]];
|
||||
[viewsearch.searchbtn setTitleColor:RGBCOLOR(252, 80, 80) forState:UIControlStateNormal];
|
||||
[Tools normalShadow:viewsearch shadowColor:RGBACOLOR(0, 0, 0, 0.1) shadowOpacity:1 cornerRadius:6 shadowRadius:10];
|
||||
[viewsearch setSearchBackAction:^(NSString * _Nonnull search) {
|
||||
|
||||
}];
|
||||
|
||||
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
|
||||
[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
|
||||
[tableView setBackgroundColor:[UIColor clearColor]];
|
||||
[tableView setDelegate:self];
|
||||
[tableView setDataSource:self];
|
||||
[self.view addSubview:tableView];
|
||||
[tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.equalTo(viewsearch.mas_bottom).offset(20);
|
||||
}];
|
||||
_tableView = tableView;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - UITableView
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
static NSString *strcell = @"FanWenListTableViewCell";
|
||||
FanWenListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:strcell];
|
||||
if(!cell)
|
||||
{
|
||||
cell = [[FanWenListTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:strcell];
|
||||
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
||||
[cell setBackgroundColor:[UIColor clearColor]];
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
|
||||
{
|
||||
return 0.01;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return 158;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
return [UIView new];
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
|
||||
{
|
||||
return [UIView new];
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
FanWenDetailViewController *vc = [FanWenDetailViewController new];
|
||||
[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-TabHeight-100];
|
||||
[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);
|
||||
}];
|
||||
|
||||
UIButton *btok = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH-230, 40)];
|
||||
[btok setTitle:@"AI写一篇" forState:UIControlStateNormal];
|
||||
[btok setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[btok.titleLabel setFont:[UIFont systemFontOfSize:16]];
|
||||
[btok.layer setMasksToBounds:YES];
|
||||
[btok.layer setCornerRadius:20];
|
||||
[btok setBackgroundColor:RGBCOLOR(108, 119, 246)];
|
||||
[viewback addSubview:btok];
|
||||
[btok mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(115);
|
||||
make.right.equalTo(viewback).offset(-115);
|
||||
make.top.equalTo(lbinfo.mas_bottom).offset(38);
|
||||
make.height.offset(40);
|
||||
}];
|
||||
[btok addTarget:self action:@selector(aiAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
return viewback;
|
||||
}
|
||||
-(void)aiAction
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
|
@ -206,6 +206,7 @@
|
|||
vc.dic_require = [self getFieldValue:1];
|
||||
vc.dic_type = [self getFieldValue:2];
|
||||
vc.dic_require_num = [self getFieldValue:3];
|
||||
vc.dic_stage = [UserInfoModel shareModel].user_stage.name;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
///提交
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
||||
[self showNaviGationView:YES];
|
||||
[self.navigationView setTitle:@"写作生成" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
if([self.scene isEqualToString:@"rewrite_correct"])
|
||||
{
|
||||
[self.navigationView setTitle:@"改写润色" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
}
|
||||
[self.navigationView setBackgroundColor:[UIColor clearColor]];
|
||||
[self.navigationView setMuenTitle:@"反馈" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
@property (nonatomic , strong) UIScrollView *scvback;
|
||||
///
|
||||
@property (nonatomic , strong) UILabel *lbname;
|
||||
@property (nonatomic , strong) UILabel *lbrequer;
|
||||
@property (nonatomic , strong) UILabel *lbzhishu;
|
||||
@property (nonatomic , strong) XieZuoXiangQingSiLuView *viewsl;
|
||||
|
||||
|
@ -95,6 +96,19 @@
|
|||
}];
|
||||
_lbname = lbname;
|
||||
|
||||
UILabel *lbrequer = [[UILabel alloc] init];
|
||||
[lbrequer setText:@""];
|
||||
[lbrequer setTextColor:RGBCOLOR(109, 109, 109)];
|
||||
[lbrequer setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbrequer setFont:[UIFont systemFontOfSize:12]];
|
||||
[lbrequer setNumberOfLines:0];
|
||||
[view addSubview:lbrequer];
|
||||
[lbrequer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(0);
|
||||
}];
|
||||
_lbrequer = lbrequer;
|
||||
|
||||
UILabel *lbzhishu = [[UILabel alloc] init];
|
||||
[lbzhishu setText:@"800字"];
|
||||
[lbzhishu setTextColor:RGBCOLOR(109, 109, 109)];
|
||||
|
@ -103,7 +117,7 @@
|
|||
[view addSubview:lbzhishu];
|
||||
[lbzhishu mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(15);
|
||||
make.top.equalTo(lbrequer.mas_bottom).offset(15);
|
||||
}];
|
||||
_lbzhishu = lbzhishu;
|
||||
|
||||
|
@ -207,6 +221,13 @@
|
|||
_dicpush = dicpush;
|
||||
self.lbname.text = [Tools isStringnilkong:[dicpush objectForKey:@"title"]];
|
||||
self.lbzhishu.text = [NSString stringWithFormat:@"%@字",[dicpush objectForKey:@"require_num"]];
|
||||
if([Tools isStringnil:[dicpush objectForKey:@"require"]].length>0)
|
||||
{
|
||||
[self.lbrequer mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.lbname.mas_bottom).offset(15);
|
||||
}];
|
||||
self.lbrequer.text = [dicpush objectForKey:@"require"];
|
||||
}
|
||||
}
|
||||
-(void)setArrSL:(NSArray *)arrSL
|
||||
{
|
||||
|
@ -225,7 +246,11 @@
|
|||
-(void)setScene:(NSString *)scene
|
||||
{
|
||||
_scene = scene;
|
||||
|
||||
if([scene isEqualToString:@"rewrite_correct"])
|
||||
{
|
||||
self.lbname.text = @"";
|
||||
self.lbzhishu.text = [NSString stringWithFormat:@"本文得分:%d分",rand()%5+95];
|
||||
}
|
||||
[self getdata];
|
||||
}
|
||||
|
||||
|
@ -261,58 +286,90 @@
|
|||
case 1:
|
||||
{///保存
|
||||
[LoadAlterView show];
|
||||
NSMutableDictionary *dicinfo = [NSMutableDictionary new];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"title"]] forKey:@"title"];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"stage"]] forKey:@"stage"];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"require_num"]] forKey:@"wordsNum"];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"type"]] forKey:@"type"];
|
||||
NSMutableArray *arrcontent = [NSMutableArray new];
|
||||
for(SSEDrawListTextModel *model in self.arrdata)
|
||||
{
|
||||
if(model.value.length>0)
|
||||
{
|
||||
[arrcontent addObject:model.value];
|
||||
}
|
||||
|
||||
if([self.scene isEqualToString:@"rewrite_correct"])
|
||||
{///批改
|
||||
[NetWorkManager requestCorrectSaveData:self ID:[self.dicpush objectForKey:@"id"] Callback:^(BOOL state, BaseModel *responseObject, NSString * _Nullable describle) {
|
||||
[LoadAlterView dismiss];
|
||||
if(state)
|
||||
{
|
||||
NSMutableArray *arrcontent = [NSMutableArray new];
|
||||
for(SSEDrawListTextModel *model in self.arrdata)
|
||||
{
|
||||
if(model.value.length>0)
|
||||
{
|
||||
[arrcontent addObject:model.value];
|
||||
}
|
||||
}
|
||||
XieZuoSaveAlterView *view = [[XieZuoSaveAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.viewController.view addSubview:view];
|
||||
[view setBackValue:^{
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.string = [arrcontent componentsJoinedByString:@"\n"];
|
||||
[HXHud showMessage:@"复制成功" afterDelayType:0];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
}];
|
||||
}
|
||||
[dicinfo setObject:[arrcontent componentsJoinedByString:@"\n"] forKey:@"content"];
|
||||
[dicinfo setObject:[NSString stringWithFormat:@"%d",rand()%6+95] forKey:@"score"];
|
||||
if(self.arrSL.count==4)
|
||||
else
|
||||
{
|
||||
NSMutableDictionary *dicThinking = [NSMutableDictionary new];
|
||||
[dicThinking setObject:self.dic_type forKey:@"material"];
|
||||
NSMutableDictionary *dicinfo = [NSMutableDictionary new];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"title"]] forKey:@"title"];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"stage"]] forKey:@"stage"];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"require_num"]] forKey:@"wordsNum"];
|
||||
[dicinfo setObject:[Tools isStringnil:[self.dicpush objectForKey:@"type"]] forKey:@"type"];
|
||||
NSMutableArray *arrcontent = [NSMutableArray new];
|
||||
for(SSEDrawListTextModel *model in self.arrdata)
|
||||
{
|
||||
if(model.value.length>0)
|
||||
{
|
||||
[arrcontent addObject:model.value];
|
||||
}
|
||||
}
|
||||
[dicinfo setObject:[arrcontent componentsJoinedByString:@"\n"] forKey:@"content"];
|
||||
[dicinfo setObject:[NSString stringWithFormat:@"%d",rand()%5+95] forKey:@"score"];
|
||||
if(self.arrSL.count==4)
|
||||
{
|
||||
SSEDrawModel *model1 = self.arrSL[1];
|
||||
[dicThinking setObject:[model1.arrSon componentsJoinedByString:@","] forKey:@"start"];
|
||||
NSMutableDictionary *dicThinking = [NSMutableDictionary new];
|
||||
[dicThinking setObject:[Tools isStringnil:self.dic_type] forKey:@"material"];
|
||||
if(self.arrSL.count==4)
|
||||
{
|
||||
SSEDrawModel *model1 = self.arrSL[1];
|
||||
[dicThinking setObject:[model1.arrSon componentsJoinedByString:@","] forKey:@"start"];
|
||||
|
||||
SSEDrawModel *model2 = self.arrSL[2];
|
||||
[dicThinking setObject:model2.arrSon==nil?@[]:model2.arrSon forKey:@"centerList"];
|
||||
|
||||
SSEDrawModel *model3 = self.arrSL[3];
|
||||
[dicThinking setObject:[model3.arrSon componentsJoinedByString:@","] forKey:@"end"];
|
||||
}
|
||||
|
||||
SSEDrawModel *model2 = self.arrSL[2];
|
||||
[dicThinking setObject:model2.arrSon==nil?@[]:model2.arrSon forKey:@"centerList"];
|
||||
|
||||
SSEDrawModel *model3 = self.arrSL[3];
|
||||
[dicThinking setObject:[model3.arrSon componentsJoinedByString:@","] forKey:@"end"];
|
||||
[dicinfo setObject:dicThinking forKey:@"thinking"];
|
||||
}
|
||||
|
||||
[dicinfo setObject:dicThinking forKey:@"thinking"];
|
||||
[NetWorkManager requestWriteSaveData:self title:[self.dicpush objectForKey:@"title"] scene:self.scene info:dicinfo Callback:^(BOOL state, BaseModel *responseObject, NSString * _Nullable describle) {
|
||||
[LoadAlterView dismiss];
|
||||
if(state)
|
||||
{
|
||||
XieZuoSaveAlterView *view = [[XieZuoSaveAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.viewController.view addSubview:view];
|
||||
[view setBackValue:^{
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.string = [arrcontent componentsJoinedByString:@"\n"];
|
||||
[HXHud showMessage:@"复制成功" afterDelayType:0];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
[NetWorkManager requestWriteSaveData:self title:[self.dicpush objectForKey:@"title"] scene:self.scene info:dicinfo Callback:^(BOOL state, BaseModel *responseObject, NSString * _Nullable describle) {
|
||||
[LoadAlterView dismiss];
|
||||
if(state)
|
||||
{
|
||||
XieZuoSaveAlterView *view = [[XieZuoSaveAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.viewController.view addSubview:view];
|
||||
[view setBackValue:^{
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.string = [arrcontent componentsJoinedByString:@"\n"];
|
||||
[HXHud showMessage:@"复制成功" afterDelayType:0];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -366,8 +423,9 @@
|
|||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:[self.dicpush objectForKey:@"type"]] forKey:@"type"];
|
||||
[dicpush setObject:[Tools isStringnil:content] forKey:@"content"];
|
||||
NSString *strcene = @"rewrite";
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=rewrite"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",strcene] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
NSLog(@"%@",value);
|
||||
if(value.length>4)
|
||||
|
|
|
@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@property (nonatomic , strong) NSString *dic_require;
|
||||
@property (nonatomic , strong) NSString *dic_type;
|
||||
@property (nonatomic , strong) NSString *dic_require_num;
|
||||
@property (nonatomic , strong) NSString *dic_stage;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -42,11 +42,11 @@
|
|||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.offset(NavHeight);
|
||||
}];
|
||||
view.dic_stage = self.dic_stage;
|
||||
view.dic_title = self.dic_title;
|
||||
view.dic_type = self.dic_type;
|
||||
view.dic_require_num = self.dic_require_num;
|
||||
view.dic_require = self.dic_require;///最后在设置要求
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@property (nonatomic , strong) NSString *dic_require;
|
||||
@property (nonatomic , strong) NSString *dic_type;
|
||||
@property (nonatomic , strong) NSString *dic_require_num;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *dic_stage;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -250,7 +250,7 @@ typedef void(^ChuangZuoSiLuViewDraw)(void);
|
|||
[dicpush setObject:[Tools isStringnil:self.dic_require] forKey:@"require"];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_type] forKey:@"type"];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_require_num] forKey:@"require_num"];
|
||||
[dicpush setObject:[Tools isStringnil:[UserInfoModel shareModel].user_stage.name] forKey:@"stage"];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_stage] forKey:@"stage"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",scenct] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
|
|
|
@ -10,8 +10,11 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface CamreViewController : BaseViewController
|
||||
///1作文批改 2拍照写作
|
||||
///1作文批改 2拍照写作 3课堂写作
|
||||
@property (nonatomic , assign) int type;
|
||||
|
||||
///课堂写作 课堂写作id
|
||||
@property (nonatomic , strong) NSString *textbook_id;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
[CamreTiShiAlterView show];
|
||||
}
|
||||
}
|
||||
if(self.type==1)
|
||||
if(self.type==1 || self.type == 3)
|
||||
{
|
||||
if([[[NSUserDefaults standardUserDefaults] objectForKey:CamreTiShiPiGai] intValue] !=1)
|
||||
{
|
||||
|
@ -153,7 +153,7 @@
|
|||
//
|
||||
viewtype.arrItems = @[@"改写作文",@"拍题成文",@"拍照续写"];
|
||||
_viewtype = viewtype;
|
||||
if(self.type==1)
|
||||
if(self.type==1 || self.type == 3)
|
||||
{
|
||||
[viewtype setHidden:YES];
|
||||
}
|
||||
|
@ -279,13 +279,13 @@
|
|||
}
|
||||
}];
|
||||
}
|
||||
else if (self.type==1)
|
||||
else if (self.type==1 || self.type == 3)
|
||||
{///作文批改
|
||||
[NetWorkManager requestExampleCorrectListData:self.view role_id:[UserInfoModel getRole_id] Callback:^(BOOL state, ExampleCorrectList *responseObject, NSString * _Nullable describle) {
|
||||
[LoadAlterView dismiss];
|
||||
if(state)
|
||||
{
|
||||
CamreShiLiView *view = [[CamreShiLiView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];;
|
||||
CamreShiLiView *view = [[CamreShiLiView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
view.type = self.type;
|
||||
view.arrdata = responseObject.data.items;
|
||||
[self.view addSubview:view];
|
||||
|
@ -336,6 +336,14 @@
|
|||
vc.arrXZImages = self.arrData;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
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];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
@ -484,7 +492,7 @@
|
|||
self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session];
|
||||
self.previewLayer.frame = CGRectMake(0, 0, width,height);
|
||||
self.previewLayer.connection.videoOrientation = AVCaptureVideoOrientationPortrait; // 图层展示拍摄角度方向
|
||||
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
||||
self.previewLayer.videoGravity = AVLayerVideoGravityResize;
|
||||
[self.view.layer addSublayer:self.previewLayer];
|
||||
|
||||
// 3.1 属性配置
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface CamreShiLiView : UIView
|
||||
///1作文批改 2拍照写作
|
||||
///1作文批改 2拍照写作 3课堂写作
|
||||
@property (nonatomic , assign) int type;
|
||||
|
||||
///拍照写作 类型
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
-(void)okAction
|
||||
{
|
||||
///1作文批改 2拍照写作
|
||||
if(self.type==1)
|
||||
if(self.type==1 || self.type == 3)
|
||||
{
|
||||
StartKTXZPGViewController *vc = [StartKTXZPGViewController new];
|
||||
vc.type = 1;
|
||||
|
|
|
@ -11,8 +11,9 @@
|
|||
|
||||
@interface KeTangXieZuoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
///
|
||||
@property (nonatomic , strong) UICollectionView *collect;
|
||||
|
||||
@property (nonatomic , strong) UICollectionView *collect;
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *arrdata;
|
||||
@end
|
||||
|
||||
@implementation KeTangXieZuoViewController
|
||||
|
@ -23,13 +24,15 @@
|
|||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
||||
[self showNaviGationView:YES];
|
||||
[self.navigationView setTitle:@"课堂写作" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setTitle:@"课堂批改" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setBackgroundColor:[UIColor whiteColor]];
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self.view setBackgroundColor:[UIColor whiteColor]];
|
||||
|
||||
self.arrdata = [[UserInfoModel shareModel].config objectForKey:@"client.textbook.tabs"];
|
||||
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 0;
|
||||
layout.minimumInteritemSpacing = 0;
|
||||
|
@ -45,17 +48,18 @@
|
|||
[collect registerClass:[KeTangXieZuoCollectionViewCell class] forCellWithReuseIdentifier:@"KeTangXieZuoCollectionViewCell"];
|
||||
_collect = collect;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionView
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
|
||||
{
|
||||
return 9;
|
||||
return self.arrdata.count;
|
||||
}
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
KeTangXieZuoCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"KeTangXieZuoCollectionViewCell" forIndexPath:indexPath];
|
||||
|
||||
cell.model = self.arrdata[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
//定义每个section的间距
|
||||
|
@ -78,7 +82,11 @@
|
|||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSDictionary *model = self.arrdata[indexPath.row];
|
||||
KeTangXieZuoNJViewController *vc = [KeTangXieZuoNJViewController new];
|
||||
vc.strtitle = [Tools isStringnilkong:[model objectForKey:@"name"]];
|
||||
vc.strID = [Tools isStringnilkong:[model objectForKey:@"id"]];
|
||||
vc.strseason = [Tools isStringnilkong:[model objectForKey:@"season"]];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KeTangXieZuoCollectionViewCell : UICollectionViewCell
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSDictionary *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -51,4 +51,12 @@
|
|||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)setModel:(NSDictionary *)model
|
||||
{
|
||||
_model = model;
|
||||
self.lbname.text = [Tools isStringnilkong:[model objectForKey:@"name"]];
|
||||
[self.imgvback sd_setImageWithURL:[NSURL URLWithString:[Tools isStringnil:[model objectForKey:@"url"]]] placeholderImage:[UIImage imageNamed:@"book_nomo"]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,7 +10,12 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KeTangXieZuoNJViewController : BaseViewController
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strtitle;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strID;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strseason;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
#import "KeTangXieZuoNJViewController.h"
|
||||
#import "KeTangXieZuoNJTableViewCell.h"
|
||||
#import "KeTangXieZuoXiangQingViewController.h"
|
||||
#import "NetWorkManager.h"
|
||||
|
||||
@interface KeTangXieZuoNJViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
///
|
||||
@property (nonatomic , strong) UITableView *tableView;
|
||||
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrdata;
|
||||
@property (nonatomic , assign) int ipage;
|
||||
@end
|
||||
|
||||
@implementation KeTangXieZuoNJViewController
|
||||
|
@ -24,7 +26,7 @@
|
|||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
||||
[self showNaviGationView:YES];
|
||||
[self.navigationView setTitle:@"三年级上册" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setTitle:self.strtitle titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setBackgroundColor:[UIColor whiteColor]];
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
|
@ -41,13 +43,37 @@
|
|||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.offset(NavHeight);
|
||||
}];
|
||||
|
||||
tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
self.ipage += 1;
|
||||
[self getdata];
|
||||
}];
|
||||
_tableView = tableView;
|
||||
self.ipage = 1;
|
||||
[self getdata];
|
||||
}
|
||||
-(void)getdata
|
||||
{
|
||||
[LoadAlterView show];
|
||||
[NetWorkManager requestTextbookData:self.view page:self.ipage season:self.strseason grade:self.strID Callback:^(BOOL state, TextbookModel *responseObject, NSString * _Nullable describle) {
|
||||
[LoadAlterView dismiss];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
if(self.ipage==1)self.arrdata = [NSMutableArray new];
|
||||
if(state)
|
||||
{
|
||||
[self.arrdata addObjectsFromArray:responseObject.data.items];
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
[self.tableView reloadData];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UITableView
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
return 10;
|
||||
return self.arrdata.count;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
|
@ -63,6 +89,7 @@
|
|||
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
||||
[cell setBackgroundColor:[UIColor clearColor]];
|
||||
}
|
||||
cell.model = self.arrdata[indexPath.section];
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
@ -77,7 +104,12 @@
|
|||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return 155;
|
||||
TextbookModelDataItems *model = self.arrdata[indexPath.section];
|
||||
|
||||
float fheiht = [Tools getLabelHeightWithText:[Tools isStringnilkong:model.content] width:UISCREEN_WIDTH-56 font:14 linHeight:5];
|
||||
if(fheiht>55)fheiht=55;
|
||||
fheiht+=100;
|
||||
return fheiht;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
|
@ -89,7 +121,10 @@
|
|||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
TextbookModelDataItems *model = self.arrdata[indexPath.section];
|
||||
KeTangXieZuoXiangQingViewController *vc = [KeTangXieZuoXiangQingViewController new];
|
||||
vc.modelDetail = model;
|
||||
vc.strtitle = self.strtitle;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "TextbookModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KeTangXieZuoNJTableViewCell : UITableViewCell
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) TextbookModelDataItems *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
_lbname = lbname;
|
||||
|
||||
UILabel *lbcontent = [[UILabel alloc] init];
|
||||
[lbcontent setText:@"假如我是一颗小星星,我愿意紧紧地围绕在月亮身边,静静地听她讲美丽动人的故事,嫦娥、玉兔,还有吴刚的桂花酒……"];
|
||||
[lbcontent setText:@" "];
|
||||
[lbcontent setTextColor:RGBCOLOR(51, 51, 51)];
|
||||
[lbcontent setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbcontent setFont:[UIFont systemFontOfSize:14]];
|
||||
|
@ -132,4 +132,47 @@
|
|||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)setModel:(TextbookModelDataItems *)model
|
||||
{
|
||||
_model = model;
|
||||
self.lbname.text = [Tools isStringnilkong:model.title];
|
||||
self.lbcontent.text = [Tools isStringnilkong:model.content];
|
||||
|
||||
NSString *str = self.lbcontent.text;
|
||||
///行间距
|
||||
NSMutableParagraphStyle *style = [NSMutableParagraphStyle new];
|
||||
style.lineSpacing = 5;
|
||||
style.lineBreakMode = NSLineBreakByCharWrapping;
|
||||
style.alignment = NSTextAlignmentLeft;
|
||||
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:str];
|
||||
[attrString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, str.length)];
|
||||
self.lbcontent.attributedText = attrString;
|
||||
|
||||
|
||||
self.lbnumber.text = [NSString stringWithFormat:@"%@单元%@ | %@字",[Tools convertNumberToUppercase:model.unit.integerValue],model.season.intValue==2?@"下":@"上",model.word_count];
|
||||
self.lbtype.text = model.genre;
|
||||
///
|
||||
float f_width = [Tools getWidthWithText:self.lbtype.text height:18 font:10]+10;
|
||||
self.viewtype.width = f_width;
|
||||
[self.viewtype mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.offset(f_width);
|
||||
}];
|
||||
|
||||
NSArray *arrtemp = [self.viewtype.layer sublayers];
|
||||
if(arrtemp.count>0)
|
||||
{
|
||||
CALayer *layer = arrtemp.firstObject;
|
||||
[layer removeFromSuperlayer];
|
||||
}
|
||||
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect: self.viewtype.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomLeft cornerRadii:CGSizeMake(8,8)];
|
||||
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
||||
maskLayer.frame = self.viewtype.bounds;
|
||||
maskLayer.path = maskPath.CGPath;
|
||||
self.viewtype.layer.mask = maskLayer;
|
||||
[Tools changedView:self.viewtype colors:MainJBColors startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
#import "TextbookModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KeTangXieZuoXiangQingViewController : BaseViewController
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strtitle;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) TextbookModelDataItems *modelDetail;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -49,7 +49,8 @@
|
|||
[self.navigationView setBackgroundColor:[UIColor clearColor]];
|
||||
}
|
||||
}];
|
||||
|
||||
view.strtitle = self.strtitle;
|
||||
view.modelDetail = self.modelDetail;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,11 +6,15 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "TextbookModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef void(^KeTangXieZuoXiangQingViewScroll)(float maxtop,float nowscroll);
|
||||
@interface KeTangXieZuoXiangQingView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strtitle;
|
||||
///
|
||||
@property (nonatomic , strong) TextbookModelDataItems *modelDetail;
|
||||
///
|
||||
@property (nonatomic , strong) KeTangXieZuoXiangQingViewScroll backvalue;
|
||||
@end
|
||||
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
//
|
||||
|
||||
#import "KeTangXieZuoXiangQingView.h"
|
||||
|
||||
#import "FanWenSearchListViewController.h"
|
||||
#import "ChuangZuoSiLuViewController.h"
|
||||
#import "XieZuoXiangQingViewController.h"
|
||||
#import "CamreViewController.h"
|
||||
|
||||
@interface KeTangXieZuoXiangQingView ()<UIScrollViewDelegate>
|
||||
///
|
||||
|
@ -19,6 +22,16 @@
|
|||
///
|
||||
@property (nonatomic , strong) UIView *viewbackwz;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) UILabel *lbtitle;
|
||||
@property (nonatomic , strong) UILabel *lbname;
|
||||
@property (nonatomic , strong) UILabel *lbinfo;
|
||||
|
||||
///课堂要求
|
||||
@property (nonatomic , strong) PGJUILabel *lbyq ;
|
||||
///写作要求
|
||||
@property (nonatomic , strong)PGJUILabel *lbyqXZ;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -59,6 +72,7 @@
|
|||
make.top.offset(0);
|
||||
make.height.offset(44);
|
||||
}];
|
||||
_lbtitle = lbtitle;
|
||||
|
||||
UILabel *lbname = [[UILabel alloc] init];
|
||||
[lbname setTextColor:[UIColor whiteColor]];
|
||||
|
@ -70,22 +84,33 @@
|
|||
make.top.offset(44);
|
||||
}];
|
||||
lbname.text = @"这儿真美";
|
||||
_lbname = lbname;
|
||||
|
||||
UIView *viewnumber = [[UIView alloc] init];
|
||||
[scvback addSubview:viewnumber];
|
||||
[viewnumber mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(8);
|
||||
make.height.offset(30);
|
||||
}];
|
||||
[viewnumber setBackgroundColor:RGBCOLOR(253, 154, 20)];
|
||||
[viewnumber.layer setMasksToBounds:YES];
|
||||
[viewnumber.layer setCornerRadius:15];
|
||||
|
||||
UILabel *lbinfo = [[UILabel alloc] init];
|
||||
[lbinfo setTextColor:[UIColor whiteColor]];
|
||||
[lbinfo setTextAlignment:NSTextAlignmentCenter];
|
||||
[lbinfo setFont:[UIFont systemFontOfSize:14]];
|
||||
[scvback addSubview:lbinfo];
|
||||
[viewnumber addSubview:lbinfo];
|
||||
[lbinfo mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(8);
|
||||
make.height.offset(30);
|
||||
make.width.offset(200);
|
||||
make.centerY.equalTo(viewnumber);
|
||||
make.left.offset(10);
|
||||
}];
|
||||
[lbinfo setBackgroundColor:RGBCOLOR(253, 154, 20)];
|
||||
[lbinfo.layer setMasksToBounds:YES];
|
||||
[lbinfo.layer setCornerRadius:15];
|
||||
lbinfo.text = @"写景为主的记叙文、六单元、300字";
|
||||
_lbinfo = lbinfo;
|
||||
[viewnumber mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(lbinfo).offset(10);
|
||||
}];
|
||||
|
||||
|
||||
UIImage *image = [UIImage imageNamed:@"yd_kt_bc"];
|
||||
|
@ -199,7 +224,7 @@
|
|||
[self drawTitleView:viewt0 title:@"课堂要求"];
|
||||
|
||||
UIButton *btmore = [[UIButton alloc] init];
|
||||
[btmore setTitle:@"更多范围" forState:UIControlStateNormal];
|
||||
[btmore setTitle:@"更多范文" forState:UIControlStateNormal];
|
||||
[btmore setTitleColor:RGBCOLOR(153, 153, 153) forState:UIControlStateNormal];
|
||||
[btmore.titleLabel setFont:[UIFont systemFontOfSize:14]];
|
||||
[viewt0 addSubview:btmore];
|
||||
|
@ -225,9 +250,10 @@
|
|||
make.top.equalTo(viewt0.mas_bottom).offset(16);
|
||||
}];
|
||||
lbyq.text = @"花园、果园,田野、小河……我们周围有许多美丽的地方,你发现了吗? 让我们把身边的美景介绍给别人吧!写之前仔细观察,看看这个地方有些什么,是什么样子的写的时候,试着运用从课文中学到的方法,围绕一个意思写。如:操场后面的小花园真美……";
|
||||
_lbyq = lbyq;
|
||||
|
||||
UIButton *btcreate = [[UIButton alloc] init];
|
||||
[btcreate setTitle:@"生成思路" forState:UIControlStateNormal];
|
||||
[btcreate setTitle:@"梳理思路" forState:UIControlStateNormal];
|
||||
[btcreate setTitleColor:RGBCOLOR(108, 119, 246) forState:UIControlStateNormal];
|
||||
[btcreate.titleLabel setFont:[UIFont systemFontOfSize:16]];
|
||||
[btcreate.layer setMasksToBounds:YES];
|
||||
|
@ -243,7 +269,7 @@
|
|||
[btcreate addTarget:self action:@selector(ccreateAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UIButton *btai = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 112, 46)];
|
||||
[btai setTitle:@"AI生成例文" forState:UIControlStateNormal];
|
||||
[btai setTitle:@"生成例文" forState:UIControlStateNormal];
|
||||
[btai setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[btai.titleLabel setFont:[UIFont systemFontOfSize:16]];
|
||||
[btai.layer setMasksToBounds:YES];
|
||||
|
@ -330,7 +356,8 @@
|
|||
make.right.equalTo(self.viewbackwz).offset(-14);
|
||||
make.top.equalTo(viewt0.mas_bottom).offset(16);
|
||||
}];
|
||||
lbyq.text = @"朝霞初照,田野宛如一幅浓墨重彩的油画,金黄的麦穗在阳光下熠熠生辉,仿佛镶嵌在大地上的颗颗明珠。微风拂过,麦浪起伏,如同大海中涌动的波涛,展现出生命的蓬勃与坚韧。勤劳的农人,手持镰刀,弯腰劳作,他们脸庞上的汗珠与麦穗上的露珠交相辉映,诠释着耕耘与收获的真谛。 蜿蜒曲折的小河,如同一首流淌的田园诗篇。河水碧波荡漾,清澈得能映射出天空的蔚蓝与云朵的洁白。河底的鹅卵石与水草交织成神秘的水下世界,小鱼儿悠然游弋,时而跃出水面,划破宁静,留下一圈圈涟漪。垂柳依依,宛如绿色的瀑布倾泻入河,与水中的倒影相互映衬,构成一幅静谧而和谐的生态画卷。 果园里,果实累累,色彩斑斓。苹果如红宝石般镶嵌在翠绿的枝叶间,梨子似金钟挂满树梢,葡萄如紫色的珍珠串串垂挂,每一颗都闪烁着诱人的光泽。阳光穿透树叶的缝隙,斑驳的光影在果实上跳跃,仿佛是大自然精心绘制的艺术佳作。空气中弥漫着浓郁的果香,那是甜蜜生活的气息,让人忍不住想要靠近,品尝这份来自大地的丰厚馈赠。 在这幅田园诗画中,我被深深打动。田野的壮美、小河的婉约、果园的丰饶,无不展现出大自然的鬼斧神工与生命的旺盛活力。我领悟到,生活之美不在远方,而在我们脚下的每一寸土地,每一滴水中,每一片叶子,每一个果实。让我们怀揣感恩之心,珍爱并呵护这份自然赐予的宝贵财富,让心灵在与大自然的亲近中得到净化与升华。";
|
||||
lbyq.text = @"-";
|
||||
_lbyqXZ = lbyq;
|
||||
|
||||
///
|
||||
|
||||
|
@ -361,7 +388,17 @@
|
|||
self.viewbackwz.layer.mask = maskLayer;
|
||||
});
|
||||
}
|
||||
|
||||
-(void)setModelDetail:(TextbookModelDataItems *)modelDetail
|
||||
{
|
||||
_modelDetail = modelDetail;
|
||||
self.lbtitle.text = self.strtitle;
|
||||
self.lbname.text = [Tools isStringnilkong:modelDetail.title];
|
||||
self.lbinfo.text = [NSString stringWithFormat:@"%@、%@单元、%@字",modelDetail.genre,[Tools convertNumberToUppercase:modelDetail.unit.integerValue],modelDetail.word_count];
|
||||
self.lbyq.text = [Tools isStringnilkong:modelDetail.content];
|
||||
self.lbyqXZ.text = [Tools isStringnilkong:modelDetail.standard];
|
||||
[self refBackView];
|
||||
[self refwenzhangView];
|
||||
}
|
||||
#pragma mark - UIScrollView
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
{
|
||||
|
@ -372,25 +409,50 @@
|
|||
self.backvalue(self.viewback.top, f_y);
|
||||
}
|
||||
}
|
||||
///AI生成例文
|
||||
///生成例文
|
||||
-(void)aiAction
|
||||
{
|
||||
NSString *strtempstate = [self.strtitle stringByReplacingOccurrencesOfString:@"上册" withString:@""];
|
||||
strtempstate = [strtempstate stringByReplacingOccurrencesOfString:@"下册" withString:@""];
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.modelDetail.title] forKey:@"title"];
|
||||
[dicpush setObject:[Tools isStringnil:self.modelDetail.content] forKey:@"require"];
|
||||
[dicpush setObject:[Tools isStringnil:self.modelDetail.genre] forKey:@"type"];
|
||||
[dicpush setObject:[Tools isStringnil:self.modelDetail.word_count] forKey:@"require_num"];
|
||||
[dicpush setObject:[Tools isStringnil:strtempstate] forKey:@"stage"];
|
||||
|
||||
XieZuoXiangQingViewController *vc = [XieZuoXiangQingViewController new];
|
||||
vc.scene = @"write_one_key";
|
||||
vc.dicpush = dicpush;
|
||||
vc.dic_type = self.modelDetail.genre;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
///生成思路
|
||||
///梳理思路
|
||||
-(void)ccreateAction
|
||||
{
|
||||
|
||||
NSString *strtempstate = [self.strtitle stringByReplacingOccurrencesOfString:@"上册" withString:@""];
|
||||
strtempstate = [strtempstate stringByReplacingOccurrencesOfString:@"下册" withString:@""];
|
||||
ChuangZuoSiLuViewController *vc = [ChuangZuoSiLuViewController new];
|
||||
vc.dic_title = self.modelDetail.title;
|
||||
vc.dic_require = self.modelDetail.content;
|
||||
vc.dic_type = self.modelDetail.genre;
|
||||
vc.dic_require_num = self.modelDetail.word_count;
|
||||
vc.dic_stage = strtempstate;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
///更多范围
|
||||
///更多范文
|
||||
-(void)moreAction
|
||||
{
|
||||
|
||||
FanWenSearchListViewController *vc = [FanWenSearchListViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
///看看我能得多少分
|
||||
-(void)pigaiAction
|
||||
{
|
||||
|
||||
CamreViewController *vc = [CamreViewController new];
|
||||
vc.type = 3;
|
||||
vc.textbook_id = self.modelDetail.ID;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue