开头段落续写
This commit is contained in:
parent
bb18d1ad55
commit
c97c18b237
|
@ -238,6 +238,10 @@
|
|||
CA8EE5232CC8C914009D73E3 /* PayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8EE5222CC8C914009D73E3 /* PayManager.m */; };
|
||||
CA8EE5262CC8C920009D73E3 /* VistaInAppPurchaseManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8EE5252CC8C920009D73E3 /* VistaInAppPurchaseManager.m */; };
|
||||
CA8EE5292CC905BD009D73E3 /* NomoAlterView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA8EE5272CC905BD009D73E3 /* NomoAlterView.m */; };
|
||||
CA9CFF6E2CC9DFCC00C3E90E /* ExampleTextGreatModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9CFF6D2CC9DFCC00C3E90E /* ExampleTextGreatModel.m */; };
|
||||
CA9CFF712CC9E9E300C3E90E /* RoleInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9CFF702CC9E9E300C3E90E /* RoleInfoModel.m */; };
|
||||
CA9CFF742CCA2FB200C3E90E /* SSEDrawListTextModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9CFF732CCA2FB200C3E90E /* SSEDrawListTextModel.m */; };
|
||||
CA9CFF772CCA457400C3E90E /* XieZuoSaveAlterView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA9CFF762CCA457400C3E90E /* XieZuoSaveAlterView.m */; };
|
||||
CAA600CD2CA92FB700026CF4 /* FXErView.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA600CC2CA92FB700026CF4 /* FXErView.m */; };
|
||||
CAA600D12CA9565500026CF4 /* KeTangXieZuoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA600D02CA9565500026CF4 /* KeTangXieZuoViewController.m */; };
|
||||
CAA600D52CA9579800026CF4 /* KeTangXieZuoCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CAA600D42CA9579800026CF4 /* KeTangXieZuoCollectionViewCell.m */; };
|
||||
|
@ -920,6 +924,14 @@
|
|||
CA8EE5252CC8C920009D73E3 /* VistaInAppPurchaseManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VistaInAppPurchaseManager.m; sourceTree = "<group>"; };
|
||||
CA8EE5272CC905BD009D73E3 /* NomoAlterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NomoAlterView.m; sourceTree = "<group>"; };
|
||||
CA8EE5282CC905BD009D73E3 /* NomoAlterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NomoAlterView.h; sourceTree = "<group>"; };
|
||||
CA9CFF6C2CC9DFCC00C3E90E /* ExampleTextGreatModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExampleTextGreatModel.h; sourceTree = "<group>"; };
|
||||
CA9CFF6D2CC9DFCC00C3E90E /* ExampleTextGreatModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTextGreatModel.m; sourceTree = "<group>"; };
|
||||
CA9CFF6F2CC9E9E300C3E90E /* RoleInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoleInfoModel.h; sourceTree = "<group>"; };
|
||||
CA9CFF702CC9E9E300C3E90E /* RoleInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoleInfoModel.m; sourceTree = "<group>"; };
|
||||
CA9CFF722CCA2FB200C3E90E /* SSEDrawListTextModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SSEDrawListTextModel.h; sourceTree = "<group>"; };
|
||||
CA9CFF732CCA2FB200C3E90E /* SSEDrawListTextModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SSEDrawListTextModel.m; sourceTree = "<group>"; };
|
||||
CA9CFF752CCA457400C3E90E /* XieZuoSaveAlterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XieZuoSaveAlterView.h; sourceTree = "<group>"; };
|
||||
CA9CFF762CCA457400C3E90E /* XieZuoSaveAlterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XieZuoSaveAlterView.m; sourceTree = "<group>"; };
|
||||
CAA600CB2CA92FB700026CF4 /* FXErView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FXErView.h; sourceTree = "<group>"; };
|
||||
CAA600CC2CA92FB700026CF4 /* FXErView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FXErView.m; sourceTree = "<group>"; };
|
||||
CAA600CF2CA9565500026CF4 /* KeTangXieZuoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeTangXieZuoViewController.h; sourceTree = "<group>"; };
|
||||
|
@ -2774,6 +2786,8 @@
|
|||
CAB0F3632CAA8523003B0C39 /* XieZuoXiangQingView.m */,
|
||||
CAB0F3652CAA8694003B0C39 /* XieZuoXiangQingSiLuView.h */,
|
||||
CAB0F3662CAA8694003B0C39 /* XieZuoXiangQingSiLuView.m */,
|
||||
CA9CFF752CCA457400C3E90E /* XieZuoSaveAlterView.h */,
|
||||
CA9CFF762CCA457400C3E90E /* XieZuoSaveAlterView.m */,
|
||||
);
|
||||
path = view;
|
||||
sourceTree = "<group>";
|
||||
|
@ -3035,6 +3049,10 @@
|
|||
CA8EE5162CC88B22009D73E3 /* ExamplePptModel.m */,
|
||||
CA8EE5182CC89319009D73E3 /* ExamplePptDetailModel.h */,
|
||||
CA8EE5192CC89319009D73E3 /* ExamplePptDetailModel.m */,
|
||||
CA9CFF6C2CC9DFCC00C3E90E /* ExampleTextGreatModel.h */,
|
||||
CA9CFF6D2CC9DFCC00C3E90E /* ExampleTextGreatModel.m */,
|
||||
CA9CFF6F2CC9E9E300C3E90E /* RoleInfoModel.h */,
|
||||
CA9CFF702CC9E9E300C3E90E /* RoleInfoModel.m */,
|
||||
);
|
||||
path = models;
|
||||
sourceTree = "<group>";
|
||||
|
@ -3492,6 +3510,8 @@
|
|||
CA81818D2C9E60B100EE7E6E /* ViewLable.m */,
|
||||
CA10DF992CC77D0F0094FEEE /* SSEDrawModel.h */,
|
||||
CA10DF9A2CC77D0F0094FEEE /* SSEDrawModel.m */,
|
||||
CA9CFF722CCA2FB200C3E90E /* SSEDrawListTextModel.h */,
|
||||
CA9CFF732CCA2FB200C3E90E /* SSEDrawListTextModel.m */,
|
||||
CA8181A52C9EAB8700EE7E6E /* PGJUILabel.h */,
|
||||
CA8181A62C9EAB8700EE7E6E /* PGJUILabel.m */,
|
||||
CA0D087D2CA55E5C0086855E /* JJGradientLabel.h */,
|
||||
|
@ -4426,6 +4446,7 @@
|
|||
files = (
|
||||
CA0D086A2CA548EE0086855E /* ShouYeLiShiJiLuPGTableViewController.m in Sources */,
|
||||
CB489F882744A0BD00DA044A /* TagView.m in Sources */,
|
||||
CA9CFF6E2CC9DFCC00C3E90E /* ExampleTextGreatModel.m in Sources */,
|
||||
CB489F672744A0BD00DA044A /* DAYIndicatorView.m in Sources */,
|
||||
CB489F8F2744A0BD00DA044A /* UITextField+SY.m in Sources */,
|
||||
CBD422BA28DAF2E800C32440 /* JhtBannerCardView.m in Sources */,
|
||||
|
@ -4508,6 +4529,7 @@
|
|||
CA487D902CA403FE00AE773B /* StartPayGoodsView.m in Sources */,
|
||||
CA5D02E22CC0DD6B007B3BA5 /* ActivityListModel.m in Sources */,
|
||||
CAC8064A2CA119C500C21AA7 /* StartZWPIDetailViewController.m in Sources */,
|
||||
CA9CFF712CC9E9E300C3E90E /* RoleInfoModel.m in Sources */,
|
||||
CB489DCA27449D5C00DA044A /* AppDelegate.m in Sources */,
|
||||
CB489F8B2744A0BD00DA044A /* NSString+extend.m in Sources */,
|
||||
CA5D02E82CC0DD6B007B3BA5 /* UserLoginModel.m in Sources */,
|
||||
|
@ -4689,6 +4711,7 @@
|
|||
CA4257912CA2652D00A36A10 /* StartZNPPTView.m in Sources */,
|
||||
CB489F632744A0BD00DA044A /* CountDownManager.m in Sources */,
|
||||
CB489F9A2744A0BD00DA044A /* baseInfoModel.m in Sources */,
|
||||
CA9CFF742CCA2FB200C3E90E /* SSEDrawListTextModel.m in Sources */,
|
||||
CB489F6E2744A0BD00DA044A /* UIButton+EnlargeTouchArea.m in Sources */,
|
||||
CB489F972744A0BD00DA044A /* WkWebviewViewController.m in Sources */,
|
||||
CB489F692744A0BD00DA044A /* CalendarDataDays.m in Sources */,
|
||||
|
@ -4733,6 +4756,7 @@
|
|||
CA5D03282CC0DDF0007B3BA5 /* PayPublicYouHuiLogListView.m in Sources */,
|
||||
CABD8CA32CBFA787009A5E5E /* GongJuImageToTextViewController.m in Sources */,
|
||||
CAF76E632CBDFF8500825E5E /* AIChatYuYinView.m in Sources */,
|
||||
CA9CFF772CCA457400C3E90E /* XieZuoSaveAlterView.m in Sources */,
|
||||
CA8181AD2C9EB95700EE7E6E /* StartKTXZPGDetailZHView.m in Sources */,
|
||||
CA5D02E42CC0DD6B007B3BA5 /* ActivityCouponModel.m in Sources */,
|
||||
CA6B97162CBCBCC1000213F3 /* FanWenDetailViewController.m in Sources */,
|
||||
|
|
Binary file not shown.
|
@ -116,5 +116,21 @@
|
|||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "22B3080E-B4F4-444B-808E-D572B53FDF79"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "ProductApp/ProductMain/首页/智能写作/段落/view/DuanLuoXieZuoCellView.m"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "163"
|
||||
endingLineNumber = "163"
|
||||
landmarkName = "-nextAction"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
[self.window setRootViewController:[[NavgationController alloc] initWithRootViewController:[StartViewController new]]];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@"0" forKey:HomeToosRef];
|
||||
// [self.window setRootViewController:[TabBarController new]];
|
||||
|
||||
[self.window makeKeyAndVisible];
|
||||
|
|
21
ProductApp/ProductApp/Assets.xcassets/首页/ic_save_dialog_bg.imageset/Contents.json
vendored
Normal file
21
ProductApp/ProductApp/Assets.xcassets/首页/ic_save_dialog_bg.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "ic_save_dialog_bg.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
ProductApp/ProductApp/Assets.xcassets/首页/ic_save_dialog_bg.imageset/ic_save_dialog_bg.png
vendored
Normal file
BIN
ProductApp/ProductApp/Assets.xcassets/首页/ic_save_dialog_bg.imageset/ic_save_dialog_bg.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
|
@ -58,6 +58,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
///0学生 1家长 2老师 3职场
|
||||
@property (nonatomic , strong) NSString *identityType;
|
||||
@property (nonatomic , strong) RoleTreeModelData *user_stage;
|
||||
///是否更新了教育的身份和年级信息
|
||||
@property (nonatomic , assign) BOOL isupdataJiaoyu;
|
||||
|
||||
+(void)setLoingState:(NSString *)value;
|
||||
+(void)setToken:(NSString *)value;
|
||||
|
|
|
@ -135,6 +135,8 @@ alpha:alphaValue]
|
|||
///引导页
|
||||
#define YingDaoYe @"YingDaoYe"
|
||||
|
||||
///首页工具刷新
|
||||
#define HomeToosRef @"HomeToosRef"
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// SSEDrawListTextModel.h
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SSEDrawListTextModel : NSObject
|
||||
///是否获取数据完成
|
||||
@property (nonatomic , assign) BOOL isaddEnd;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSString *value;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) ViewLable *lbwz;
|
||||
|
||||
///段落
|
||||
@property (nonatomic , strong) id view;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSString *title;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,12 @@
|
|||
//
|
||||
// SSEDrawListTextModel.m
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import "SSEDrawListTextModel.h"
|
||||
|
||||
@implementation SSEDrawListTextModel
|
||||
|
||||
@end
|
|
@ -2127,10 +2127,11 @@ static dispatch_source_t _timer;
|
|||
if (number == 0) {
|
||||
return digitCharacters[0];
|
||||
}
|
||||
|
||||
NSString *strtemp = [NSString stringWithFormat:@"%ld",number];
|
||||
NSInteger tempNumber = 0;
|
||||
while (tempNumber < [NSString stringWithFormat:@"%ld",number].length) {
|
||||
[uppercaseString insertString:digitCharacters[tempNumber] atIndex:0];
|
||||
while (tempNumber < strtemp.length) {
|
||||
int temp = [[strtemp substringWithRange:NSMakeRange(tempNumber, 1)] intValue];
|
||||
[uppercaseString appendString:digitCharacters[temp]];
|
||||
tempNumber++;
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
|
||||
[self configWithLabel:label];
|
||||
CGRect rect = [self characterRectAtIndex:text.length-1];
|
||||
CGPoint lastPoint = CGPointMake(rect.origin.x+rect.size.width/2.0, rect.origin.y+rect.size.height/2.0);
|
||||
CGPoint lastPoint = CGPointMake(rect.origin.x+rect.size.width, rect.origin.y+rect.size.height/2.0);
|
||||
return lastPoint;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#import "ExampleWriteList.h"
|
||||
#import "ExamplePicModel.h"
|
||||
#import "ExamplePptDetailModel.h"
|
||||
#import "ExampleTextGreatModel.h"
|
||||
#import "RoleInfoModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@ -28,7 +30,16 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
+ (void)requestRoleTreeData:(UIView *)view
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
/*
|
||||
获取年级详情 作文题材
|
||||
/api/role/info
|
||||
id 年级ID
|
||||
*/
|
||||
+ (void)requestRoleInfoData:(UIView *)view
|
||||
ID:(NSString *)ID
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
#pragma mark - 引导页
|
||||
|
||||
/*
|
||||
获取课堂写作批改详情
|
||||
|
@ -160,6 +171,48 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
tool_id:(NSString *)tool_id
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
#pragma mark - 范文
|
||||
/*
|
||||
高分作文
|
||||
/api/example/text/great
|
||||
page
|
||||
size
|
||||
role_id
|
||||
*/
|
||||
+ (void)requestExampleTextGreatData:(UIView *)view
|
||||
page:(int)page
|
||||
size:(NSString *)size
|
||||
role_id:(NSString *)role_id
|
||||
Callback:(completeModeBlock)callback;
|
||||
#pragma mark - 写作记录
|
||||
/*
|
||||
添加写作日志
|
||||
/api/write/save
|
||||
title
|
||||
scene
|
||||
info {title,score,type,stage,wordsNum,content,thinking{material,start,centerList,end}}
|
||||
*/
|
||||
/*
|
||||
private String title="我的父亲";//作文题目
|
||||
private String score="90";//作文得分
|
||||
private String type="记叙文";//作文类型
|
||||
private String stage="全学段";//
|
||||
private String wordsNum="800";//
|
||||
private String content="部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容";
|
||||
private WriteMethodBean thinking;
|
||||
{
|
||||
private String material;//题材
|
||||
private String start;//开头
|
||||
private List<String> centerList;//中间段落
|
||||
private String end;//结尾
|
||||
}
|
||||
*/
|
||||
+ (void)requestWriteSaveData:(UIView *)view
|
||||
title:(NSString *)title
|
||||
scene:(NSString *)scene
|
||||
info:(NSDictionary *)info
|
||||
Callback:(completeModeBlock)callback;
|
||||
|
||||
/*
|
||||
语言列表key分组
|
||||
/api/translate/language/key
|
||||
|
|
|
@ -41,7 +41,42 @@
|
|||
}
|
||||
}];
|
||||
}
|
||||
/*
|
||||
获取年级详情 作文题材
|
||||
/api/role/info
|
||||
id 年级ID
|
||||
*/
|
||||
+ (void)requestRoleInfoData:(UIView *)view
|
||||
ID:(NSString *)ID
|
||||
Callback:(completeModeBlock)callback
|
||||
{
|
||||
NSMutableDictionary *dicQuery = [NSMutableDictionary new];
|
||||
[dicQuery setObject:[Tools isStringnil:ID] forKey:@"id"];
|
||||
|
||||
NSMutableDictionary *dicHeader = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
|
||||
[YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:1 url:@"api/role/info" 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,[RoleInfoModel yy_modelWithJSON:dicAll],describle);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 引导页
|
||||
|
||||
|
||||
/*
|
||||
|
@ -526,12 +561,112 @@
|
|||
describle = dicAll[@"message"];
|
||||
if ([[NSString stringWithFormat:@"%@",dicAll[@"code"]] intValue] == 0) {
|
||||
state = YES;
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:HomeToosRef];
|
||||
}
|
||||
callback(state,[BaseModel yy_modelWithJSON:dicAll],describle);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 范文
|
||||
/*
|
||||
高分作文
|
||||
/api/example/text/great
|
||||
page
|
||||
size
|
||||
role_id
|
||||
*/
|
||||
+ (void)requestExampleTextGreatData:(UIView *)view
|
||||
page:(int)page
|
||||
size:(NSString *)size
|
||||
role_id:(NSString *)role_id
|
||||
Callback:(completeModeBlock)callback
|
||||
{
|
||||
NSMutableDictionary *dicQuery = [NSMutableDictionary new];
|
||||
[dicQuery setObject:[NSString stringWithFormat:@"%d",page] forKey:@"page"];
|
||||
[dicQuery setObject:[Tools isStringnil:size] forKey:@"size"];
|
||||
[dicQuery setObject:[Tools isStringnil:role_id] forKey:@"role_id"];
|
||||
|
||||
NSMutableDictionary *dicHeader = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
|
||||
|
||||
[YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:1 url:@"api/example/text/great" 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,[ExampleTextGreatModel yy_modelWithJSON:dicAll],describle);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 写作记录
|
||||
/*
|
||||
添加写作日志
|
||||
/api/write/save
|
||||
title
|
||||
scene
|
||||
info {title,score,type,stage,wordsNum,content,thinking{material,start,centerList,end}}
|
||||
*/
|
||||
/*
|
||||
private String title="我的父亲";//作文题目
|
||||
private String score="90";//作文得分
|
||||
private String type="记叙文";//作文类型
|
||||
private String stage="全学段";//
|
||||
private String wordsNum="800";//
|
||||
private String content="部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容部分作文内容";
|
||||
private WriteMethodBean thinking;
|
||||
{
|
||||
private String material;//题材
|
||||
private String start;//开头
|
||||
private List<String> centerList;//中间段落
|
||||
private String end;//结尾
|
||||
}
|
||||
*/
|
||||
+ (void)requestWriteSaveData:(UIView *)view
|
||||
title:(NSString *)title
|
||||
scene:(NSString *)scene
|
||||
info:(NSDictionary *)info
|
||||
Callback:(completeModeBlock)callback;
|
||||
{
|
||||
NSMutableDictionary *dicQuery = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicHeader = [NSMutableDictionary new];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:title] forKey:@"title"];
|
||||
[dicpush setObject:[Tools isStringnil:scene] forKey:@"scene"];
|
||||
[dicpush setObject:info forKey:@"info"];
|
||||
|
||||
[YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:2 url:@"api/write/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);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
/*
|
||||
语言列表key分组
|
||||
|
|
|
@ -19,7 +19,7 @@ typedef void(^SSENetWorkManagerBackIDValue)(NSString *value);
|
|||
|
||||
@interface SSENetWorkManager : NSObject
|
||||
+ (instancetype)shareManager;
|
||||
- (void)requestTo:(NSString*)host stage:(NSString *)stage title:(NSString *)title require:(NSString *)require title_id:(NSString *)title_id config:(SSENetWorkManagerBackConfigValue)config backValue:(SSENetWorkManagerBackStringValue)backValue error:(SSENetWorkManagerBackErrorValue)error ID:(SSENetWorkManagerBackIDValue)ID;
|
||||
- (void)requestTo:(NSString*)host dicpush:(NSDictionary *)dicpush config:(SSENetWorkManagerBackConfigValue)config backValue:(SSENetWorkManagerBackStringValue)backValue error:(SSENetWorkManagerBackErrorValue)error ID:(SSENetWorkManagerBackIDValue)ID;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
});
|
||||
return _instance;
|
||||
}
|
||||
- (void)requestTo:(NSString*)host stage:(NSString *)stage title:(NSString *)title require:(NSString *)require title_id:(NSString *)title_id config:(SSENetWorkManagerBackConfigValue)config backValue:(SSENetWorkManagerBackStringValue)backValue error:(SSENetWorkManagerBackErrorValue)error ID:(SSENetWorkManagerBackIDValue)ID;
|
||||
- (void)requestTo:(NSString*)host dicpush:(NSDictionary *)dicpush config:(SSENetWorkManagerBackConfigValue)config backValue:(SSENetWorkManagerBackStringValue)backValue error:(SSENetWorkManagerBackErrorValue)error ID:(SSENetWorkManagerBackIDValue)ID
|
||||
{
|
||||
self.backConfig = config;
|
||||
self.backValue = backValue;
|
||||
|
@ -45,16 +45,6 @@
|
|||
|
||||
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:[NSOperationQueue mainQueue]];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:stage] forKey:@"stage"];
|
||||
[dicpush setObject:[Tools isStringnil:title] forKey:@"title"];
|
||||
[dicpush setObject:[Tools isStringnil:require] forKey:@"require"];
|
||||
if(title_id.length>0)
|
||||
{
|
||||
[dicpush setObject:[Tools isStringnil:title_id] forKey:@"title_id"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:host]];
|
||||
[request setValue:@"text/event-stream" forHTTPHeaderField:@"Content-Type"];
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// ExampleTextGreatModel.h
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import "BaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class ExampleTextGreatModelData,ExampleTextGreatModelDataItems;
|
||||
@interface ExampleTextGreatModel : BaseModel
|
||||
///
|
||||
@property (nonatomic , strong) ExampleTextGreatModelData *data;
|
||||
@end
|
||||
@interface ExampleTextGreatModelData : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSString *total;
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *items;
|
||||
@end
|
||||
@interface ExampleTextGreatModelDataItems : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSString *ID;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *value;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *type_id;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *type_name;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *role_id;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *score;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *total_words;
|
||||
///一年级
|
||||
@property (nonatomic , strong) NSString *role_name;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *topic;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *title;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *content;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *create_time;
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// ExampleTextGreatModel.m
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import "ExampleTextGreatModel.h"
|
||||
|
||||
@implementation ExampleTextGreatModel
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"data" : [ExampleTextGreatModelData class]};
|
||||
}
|
||||
@end
|
||||
@implementation ExampleTextGreatModelData
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"items" : [ExampleTextGreatModelDataItems class]};
|
||||
}
|
||||
@end
|
||||
@implementation ExampleTextGreatModelDataItems
|
||||
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
|
||||
{
|
||||
return @{@"ID" : @"id"};
|
||||
}
|
||||
@end
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// RoleInfoModel.h
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import "BaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoleInfoModelData,RoleInfoModelDataConfig,RoleInfoModelDataConfigSubjects,RoleInfoModelDataConfigTechniques;
|
||||
@interface RoleInfoModel : BaseModel
|
||||
///
|
||||
@property (nonatomic , strong) RoleInfoModelData *data;
|
||||
@end
|
||||
@interface RoleInfoModelData : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSString *ID;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *name;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *pid;
|
||||
///
|
||||
@property (nonatomic , strong) RoleInfoModelDataConfig *config;
|
||||
@end
|
||||
@interface RoleInfoModelDataConfig : NSObject
|
||||
///题材
|
||||
@property (nonatomic , strong) NSArray *subjects;
|
||||
///写作手法
|
||||
@property (nonatomic , strong) RoleInfoModelDataConfigTechniques *techniques;
|
||||
|
||||
@end
|
||||
@interface RoleInfoModelDataConfigSubjects : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSString *desc;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *name;
|
||||
|
||||
@property (nonatomic , assign) BOOL select;
|
||||
|
||||
@end
|
||||
|
||||
@interface RoleInfoModelDataConfigTechniques : NSObject
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *content;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// RoleInfoModel.m
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import "RoleInfoModel.h"
|
||||
|
||||
@implementation RoleInfoModel
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"data" : [RoleInfoModelData class]};
|
||||
}
|
||||
@end
|
||||
@implementation RoleInfoModelData
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"config" : [RoleInfoModelDataConfig class]};
|
||||
}
|
||||
+ (nullable NSDictionary<NSString *, id> *)modelCustomPropertyMapper
|
||||
{
|
||||
return @{@"ID" : @"id"};
|
||||
}
|
||||
@end
|
||||
@implementation RoleInfoModelDataConfig
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"subjects" : [RoleInfoModelDataConfigSubjects class],
|
||||
@"techniques" : [RoleInfoModelDataConfigTechniques class]};
|
||||
}
|
||||
@end
|
||||
@implementation RoleInfoModelDataConfigTechniques
|
||||
+ (NSDictionary *)modelContainerPropertyGenericClass {
|
||||
return @{@"content" : [RoleInfoModelDataConfigSubjects class]};
|
||||
}
|
||||
@end
|
||||
@implementation RoleInfoModelDataConfigSubjects
|
||||
|
||||
@end
|
||||
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
|
||||
-(void)collectAction:(UIButton *)sender
|
||||
{
|
||||
if(self.model.is_fav.intValue == 1)
|
||||
if([self.model.is_fav isEqualToString:@"true"])
|
||||
{
|
||||
[NomoAlterView showInfo:@"是否取消收藏" SelectTag:^(NSInteger tag) {
|
||||
if(tag==1)
|
||||
|
|
|
@ -278,11 +278,20 @@ typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast);
|
|||
{
|
||||
[self nomoData];
|
||||
[self drawInfoView:self.viewback];
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",scenct] stage:self.strtitle title:self.modelTitle.title require:[self.arrRequire componentsJoinedByString:@"、"] title_id:title_id config:^(SSEConfigModel * _Nonnull config) {
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.strtitle] forKey:@"stage"];
|
||||
[dicpush setObject:[Tools isStringnil:self.modelTitle.title] forKey:@"title"];
|
||||
[dicpush setObject:[Tools isStringnil:[self.arrRequire componentsJoinedByString:@"、"]] forKey:@"require"];
|
||||
if(title_id.length>0)
|
||||
{
|
||||
[dicpush setObject:[Tools isStringnil:title_id] forKey:@"title_id"];
|
||||
}
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",scenct] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
self.modelConfig = config;
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
|
||||
// NSLog(@"%@",value);
|
||||
if(value.length>10)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:NO];
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *arrTools;
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *arrFanWen;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -45,7 +47,16 @@
|
|||
[self.tableView reloadData];
|
||||
}
|
||||
[self updateBtShow];
|
||||
[self getTools];
|
||||
if(self.arrTools.count==0 || [[[NSUserDefaults standardUserDefaults] objectForKey:HomeToosRef] intValue] == 1)
|
||||
{
|
||||
[self getTools];
|
||||
}
|
||||
if([UserInfoModel shareModel].isupdataJiaoyu)
|
||||
{
|
||||
[UserInfoModel shareModel].isupdataJiaoyu = NO;
|
||||
[self getFanWen];
|
||||
}
|
||||
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
@ -69,6 +80,10 @@
|
|||
make.top.offset(NavHeight+15);
|
||||
}];
|
||||
_tableView = tableView;
|
||||
tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
[self getTools];
|
||||
[self getFanWen];
|
||||
}];
|
||||
|
||||
[self getUserData];
|
||||
|
||||
|
@ -146,7 +161,7 @@
|
|||
{
|
||||
if(section==4)
|
||||
{///高分作文
|
||||
return 5;
|
||||
return self.arrFanWen.count;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -282,7 +297,7 @@
|
|||
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
||||
[cell setBackgroundColor:[UIColor clearColor]];
|
||||
}
|
||||
if(indexPath.row==4)
|
||||
if(indexPath.row==self.arrFanWen.count-1)
|
||||
{
|
||||
cell.islast = YES;
|
||||
}
|
||||
|
@ -290,6 +305,7 @@
|
|||
{
|
||||
cell.islast = NO;
|
||||
}
|
||||
cell.model = self.arrFanWen[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
||||
|
@ -408,7 +424,7 @@
|
|||
///高分作文查看更多
|
||||
-(void)morezwAction
|
||||
{
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"carnumberChangeNotifi" object:@"1"];
|
||||
}
|
||||
///用户信息
|
||||
-(void)getUserData
|
||||
|
@ -421,6 +437,7 @@
|
|||
[UserInfoModel shareModel].user_stage = responseObject.data.user_stage;
|
||||
|
||||
[self updateBtShow];
|
||||
[self getFanWen];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
@ -428,6 +445,7 @@
|
|||
-(void)getTools
|
||||
{
|
||||
[NetWorkManager requestToolsFavData:self.view page:1 size:@"100" Callback:^(BOOL state, ToolsListModel *responseObject, NSString * _Nullable describle) {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
if(state)
|
||||
{
|
||||
self.arrTools = responseObject.data.items;
|
||||
|
@ -435,6 +453,23 @@
|
|||
}
|
||||
}];
|
||||
}
|
||||
-(void)getFanWen
|
||||
{
|
||||
if([UserInfoModel shareModel].identityType.intValue==3)return;
|
||||
NSString *strrole_id = [UserInfoModel shareModel].user_stage.ID;
|
||||
if([UserInfoModel shareModel].identityType.intValue == 2 && [UserInfoModel shareModel].isAllLevel.intValue == 1)
|
||||
{
|
||||
strrole_id = [UserInfoModel shareModel].user_stage.pid;
|
||||
}
|
||||
|
||||
[NetWorkManager requestExampleTextGreatData:self.view page:1 size:@"5" role_id:strrole_id Callback:^(BOOL state, ExampleTextGreatModel *responseObject, NSString * _Nullable describle) {
|
||||
if(state)
|
||||
{
|
||||
self.arrFanWen = responseObject.data.items;
|
||||
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:4] withRowAnimation:UITableViewRowAnimationFade];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)updateBtShow
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
make.top.right.equalTo(viewback);
|
||||
make.height.offset(75);
|
||||
}];
|
||||
[self drawSmillView:viewkt title:@"课堂写作" info:@"提升能力" img:@"home_ketangback" tag:1];
|
||||
[self drawSmillView:viewkt title:@"课堂批改" info:@"提升能力" img:@"home_ketangback" tag:1];
|
||||
|
||||
|
||||
UIView *viewpg = [[UIView alloc] init];
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
[viewback setUserInteractionEnabled:YES];
|
||||
|
||||
UILabel *lbname = [[UILabel alloc] init];
|
||||
[lbname setText:@"智能写作"];
|
||||
[lbname setText:@"写作生成"];
|
||||
[lbname setTextColor:RGBCOLOR(26, 26, 26)];
|
||||
[lbname setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbname setFont:[UIFont fontWithName:@"AlimamaShuHeiTi-Bold" size:24]];
|
||||
|
@ -87,6 +87,11 @@
|
|||
|
||||
-(void)nextAction
|
||||
{
|
||||
if([UserInfoModel shareModel].user_stage==nil)
|
||||
{
|
||||
[HXHud showMessage:@"请选择身份" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
ZhiNengXieZuoViewController *vc = [ZhiNengXieZuoViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "ExampleTextGreatModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ShouYeZuoWenTableViewCell : UITableViewCell
|
||||
@property (nonatomic , assign) BOOL islast;
|
||||
///
|
||||
@property (nonatomic , strong) ExampleTextGreatModelDataItems *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -43,35 +43,56 @@
|
|||
}];
|
||||
_lbname = lbname;
|
||||
|
||||
UIView *viewtype = [[UIView alloc] init];
|
||||
[viewtype setBackgroundColor:RGBCOLOR(233, 236, 255)];
|
||||
[viewback addSubview:viewtype];
|
||||
[viewtype mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(4);
|
||||
make.height.offset(19);
|
||||
}];
|
||||
[viewtype.layer setMasksToBounds:YES];
|
||||
[viewtype.layer setCornerRadius:2];
|
||||
|
||||
UILabel *lbtype = [[UILabel alloc] init];
|
||||
[lbtype setText:@" 写景为主的记叙文 "];
|
||||
[lbtype setTextColor:RGBCOLOR(108, 119, 246)];
|
||||
[lbtype setTextAlignment:NSTextAlignmentCenter];
|
||||
[lbtype setFont:[UIFont systemFontOfSize:12]];
|
||||
[viewback addSubview:lbtype];
|
||||
[viewtype addSubview:lbtype];
|
||||
[lbtype mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(4);
|
||||
make.height.offset(19);
|
||||
make.left.offset(4);
|
||||
make.centerY.equalTo(viewtype);
|
||||
}];
|
||||
[viewtype mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(lbtype).offset(4);
|
||||
}];
|
||||
[lbtype setBackgroundColor:RGBCOLOR(233, 236, 255)];
|
||||
[lbtype.layer setMasksToBounds:YES];
|
||||
[lbtype.layer setCornerRadius:2];
|
||||
_lbtype = lbtype;
|
||||
|
||||
|
||||
UIView *viewnumber = [[UIView alloc] init];
|
||||
[viewnumber setBackgroundColor:RGBCOLOR(213, 251, 255)];
|
||||
[viewback addSubview:viewnumber];
|
||||
[viewnumber mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(viewtype.mas_right).offset(8);
|
||||
make.top.height.equalTo(viewtype);
|
||||
}];
|
||||
[viewnumber.layer setMasksToBounds:YES];
|
||||
[viewnumber.layer setCornerRadius:2];
|
||||
|
||||
UILabel *lbnumber = [[UILabel alloc] init];
|
||||
[lbnumber setText:@" 280字 "];
|
||||
[lbnumber setTextColor:RGBCOLOR(0, 193, 214)];
|
||||
[lbnumber setTextAlignment:NSTextAlignmentCenter];
|
||||
[lbnumber setFont:[UIFont systemFontOfSize:12]];
|
||||
[viewback addSubview:lbnumber];
|
||||
[viewnumber addSubview:lbnumber];
|
||||
[lbnumber mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbtype.mas_right).offset(8);
|
||||
make.top.height.equalTo(lbtype);
|
||||
make.left.offset(4);
|
||||
make.centerY.equalTo(viewnumber);
|
||||
}];
|
||||
[viewnumber mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(lbnumber).offset(4);
|
||||
}];
|
||||
[lbnumber setBackgroundColor:RGBCOLOR(213, 251, 255)];
|
||||
[lbnumber.layer setMasksToBounds:YES];
|
||||
[lbnumber.layer setCornerRadius:2];
|
||||
_lbnumber = lbnumber;
|
||||
|
||||
UILabel *lbfen = [[UILabel alloc] init];
|
||||
|
@ -104,5 +125,18 @@
|
|||
{
|
||||
[self.viewline setHidden:islast];
|
||||
}
|
||||
-(void)setModel:(ExampleTextGreatModelDataItems *)model
|
||||
{
|
||||
_model = model;
|
||||
|
||||
self.lbname.text = [Tools isStringnilkong:model.title];
|
||||
|
||||
self.lbtype.text = [NSString stringWithFormat:@"%@",[Tools isStringnilkong:model.type_name]];
|
||||
|
||||
self.lbnumber.text = [NSString stringWithFormat:@"%@字",model.total_words];
|
||||
|
||||
self.lbfen.text = [NSString stringWithFormat:@"%@分",model.score];
|
||||
self.lbfen.attributedText = [Tools arrstring:self.lbfen.text andstart:(int)self.lbfen.text.length-1 andend:1 andfont:[UIFont systemFontOfSize:14] andcolor:RGBCOLOR(255, 98, 98)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -207,6 +207,7 @@
|
|||
if(state)
|
||||
{
|
||||
modelson.select = NO;
|
||||
[UserInfoModel shareModel].isupdataJiaoyu=YES;
|
||||
[UserInfoModel shareModel].user_stage = modelson;
|
||||
[UserInfoModel shareModel].isAllLevel = [NSString stringWithFormat:@"%@",[NSNumber numberWithBool:isall]];
|
||||
[UserInfoModel shareModel].identityType = [NSString stringWithFormat:@"%d",type];
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#import "ZhiNengXieZuoViewController.h"
|
||||
#import "ZhiNengXieZuoView.h"
|
||||
#import "NetWorkManager.h"
|
||||
|
||||
@interface ZhiNengXieZuoViewController ()
|
||||
|
||||
|
@ -42,6 +43,19 @@
|
|||
make.top.offset(NavHeight);
|
||||
}];
|
||||
|
||||
[LoadAlterView show];
|
||||
[NetWorkManager requestRoleInfoData:self.view ID:[UserInfoModel shareModel].user_stage.pid Callback:^(BOOL state, RoleInfoModel *responseObject, NSString * _Nullable describle) {
|
||||
[LoadAlterView dismiss];
|
||||
if(state)
|
||||
{
|
||||
view.modelTC = responseObject.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
[HXHud showMessage:responseObject.message afterDelayType:1];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//
|
||||
// FenXiangWenZhangAlterView.h
|
||||
// ProductApp
|
||||
//
|
||||
// 分享文字
|
||||
// Created by 工作 on 2024/9/30.
|
||||
//
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
typedef void(^TiCaiAlterViewBack)(NSString *name);
|
||||
@interface TiCaiAlterView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *arrdata;
|
||||
///
|
||||
@property (nonatomic , strong) TiCaiAlterViewBack backValue;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *strtitle;
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
@property (nonatomic , strong) UILabel *lbname;
|
||||
///
|
||||
@property (nonatomic , strong) UITableView *tableView;
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrdata;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -64,7 +61,6 @@
|
|||
make.top.equalTo(lbname.mas_bottom).offset(20);
|
||||
}];
|
||||
_tableView = tableView;
|
||||
[self getdata];
|
||||
|
||||
}
|
||||
return self;
|
||||
|
@ -74,19 +70,23 @@
|
|||
self.lbname.text = strtitle;
|
||||
}
|
||||
|
||||
-(void)getdata
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
NSArray *arrtt = @[@"记叙文",@"说明文",@"抒情文",@"议论文",@"描写型"];
|
||||
NSArray *arrinfo = @[@"对生活中的人或物,进行描述,叙述,从而表达作者的思想感情。",@"主要应用在我们的生活里,方便我们更容易了解事物。",@"利于抒发作者感情,表达作者思想。",@"表达作者的观点和看法的作文类型。",@"细致入微的描写事物。"];
|
||||
self.arrdata = [NSMutableArray new];
|
||||
for(int i = 0 ; i < arrtt.count; i++)
|
||||
NSArray *arrtouch = touches.allObjects;
|
||||
for(UITouch *touchtt in arrtouch)
|
||||
{
|
||||
baseInfoModel *model = [baseInfoModel new];
|
||||
model.title = arrtt[i];
|
||||
model.info = arrinfo[i];
|
||||
[self.arrdata addObject:model];
|
||||
if([touchtt.view isEqual:self])
|
||||
{
|
||||
[self removeFromSuperview];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)setArrdata:(NSArray *)arrdata
|
||||
{
|
||||
_arrdata = arrdata;
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - UITableView
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
|
@ -120,8 +120,8 @@
|
|||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
baseInfoModel *model = self.arrdata[indexPath.section];
|
||||
float fheiht = [Tools getLabelHeightWithText:model.info width:UISCREEN_WIDTH-80 font:14 linHeight:4]+57;
|
||||
RoleInfoModelDataConfigSubjects *model = self.arrdata[indexPath.section];
|
||||
float fheiht = [Tools getLabelHeightWithText:model.desc width:UISCREEN_WIDTH-120 font:14 linHeight:4]+57;
|
||||
return fheiht;
|
||||
}
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
|
||||
|
@ -134,16 +134,17 @@
|
|||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
for(baseInfoModel *model in self.arrdata)
|
||||
for(RoleInfoModelDataConfigSubjects *model in self.arrdata)
|
||||
{
|
||||
model.select = NO;
|
||||
}
|
||||
baseInfoModel *model = self.arrdata[indexPath.section];
|
||||
RoleInfoModelDataConfigSubjects *model = self.arrdata[indexPath.section];
|
||||
model.select = YES;
|
||||
[self.tableView reloadData];
|
||||
[self.tableView setUserInteractionEnabled:NO];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
self.backValue(model.title);
|
||||
[self setUserInteractionEnabled:NO];
|
||||
self.backValue(model.name);
|
||||
[self removeFromSuperview];
|
||||
});
|
||||
|
||||
|
|
|
@ -81,7 +81,18 @@
|
|||
[self.arrdata addObject:model];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
NSArray *arrtouch = touches.allObjects;
|
||||
for(UITouch *touchtt in arrtouch)
|
||||
{
|
||||
if([touchtt.view isEqual:self])
|
||||
{
|
||||
[self removeFromSuperview];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma mark - UICollectionView
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
|
||||
{
|
||||
|
@ -123,6 +134,7 @@
|
|||
[self.collect reloadData];
|
||||
[self.collect setUserInteractionEnabled:NO];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self setUserInteractionEnabled:NO];
|
||||
self.backValue(model.title);
|
||||
[self removeFromSuperview];
|
||||
});
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RoleInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TiCaiAlterTableViewCell : UITableViewCell
|
||||
///
|
||||
@property (nonatomic , strong) baseInfoModel *model;
|
||||
@property (nonatomic , strong) RoleInfoModelDataConfigSubjects *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
[lbinfo setNumberOfLines:0];
|
||||
[viewback addSubview:lbinfo];
|
||||
[lbinfo mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(lbname);
|
||||
make.left.offset(20);
|
||||
make.right.equalTo(viewback).offset(-20);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(4);
|
||||
}];
|
||||
|
@ -63,11 +63,11 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
-(void)setModel:(baseInfoModel *)model
|
||||
-(void)setModel:(RoleInfoModelDataConfigSubjects *)model
|
||||
{
|
||||
_model = model;
|
||||
self.lbname.text = model.title;
|
||||
self.lbinfo.text = model.info;
|
||||
self.lbname.text = model.name;
|
||||
self.lbinfo.text = model.desc;
|
||||
if(model.select)
|
||||
{
|
||||
[self.viewback setBackgroundColor:RGBCOLOR(108, 119, 246)];
|
||||
|
@ -82,11 +82,11 @@
|
|||
}
|
||||
NSMutableParagraphStyle *style = [NSMutableParagraphStyle new];
|
||||
style.lineSpacing = 4;
|
||||
style.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
style.lineBreakMode = NSLineBreakByCharWrapping;
|
||||
style.alignment = NSTextAlignmentLeft;
|
||||
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:model.info];
|
||||
[attrString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, model.info.length)];
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:model.desc];
|
||||
[attrString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, model.desc.length)];
|
||||
self.lbinfo.attributedText = attrString;
|
||||
|
||||
}
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RoleInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ZhiNengXieZuoDuanLuoView : UIView
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) RoleInfoModelData *modelTC;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#import "ZhiNengXieZuoDuanLuoView.h"
|
||||
#import "TiCaiAlterView.h"
|
||||
#import "DuanLuoXieZuoViewController.h"
|
||||
|
||||
#import "RoleTreeModel.h"
|
||||
|
||||
@interface ZhiNengXieZuoDuanLuoView ()
|
||||
///
|
||||
|
@ -203,6 +203,17 @@
|
|||
}
|
||||
return field;
|
||||
}
|
||||
-(void)setModelTC:(RoleInfoModelData *)modelTC
|
||||
{
|
||||
_modelTC = modelTC;
|
||||
if(self.modelTC.config.techniques.content.count>0)
|
||||
{
|
||||
RoleInfoModelDataConfigSubjects *model = self.modelTC.config.techniques.content.firstObject;
|
||||
UITextField *field = self.arrfield[2];
|
||||
field.text = model.name;
|
||||
}
|
||||
|
||||
}
|
||||
///写作手法
|
||||
-(void)itemAction:(UIButton *)sender
|
||||
{
|
||||
|
@ -210,6 +221,7 @@
|
|||
|
||||
TiCaiAlterView *view = [[TiCaiAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.viewController.view addSubview:view];
|
||||
view.arrdata = self.modelTC.config.techniques.content;
|
||||
view.strtitle = @"写作手法";
|
||||
[view setBackValue:^(NSString * _Nonnull name) {
|
||||
UITextField *field = self.arrfield[2];
|
||||
|
@ -230,9 +242,24 @@
|
|||
///提交
|
||||
-(void)sendAction
|
||||
{
|
||||
if([self getFieldValue:0].length==0)
|
||||
{
|
||||
[HXHud showMessage:@"请输入作文标题" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
NSArray *arrbt = @[@"开头",@"段落",@"结尾"];
|
||||
DuanLuoXieZuoViewController *vc = [DuanLuoXieZuoViewController new];
|
||||
vc.strtitle = @"开头";
|
||||
vc.strtitle = arrbt[self.btselect.tag];
|
||||
vc.stage = [UserInfoModel shareModel].user_stage.name;
|
||||
vc.dic_title = [self getFieldValue:0];
|
||||
vc.require = [self getFieldValue:1];
|
||||
vc.paragraph_type = [NSString stringWithFormat:@"%ld",self.btselect.tag];
|
||||
vc.technique = [self getFieldValue:2];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(NSString *)getFieldValue:(int)tag
|
||||
{
|
||||
UITextField *field = self.arrfield[tag];
|
||||
return field.text;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RoleInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ZhiNengXieZuoQuanWenView : UIView
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) RoleInfoModelData *modelTC;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#import "TiCaiAlterView.h"
|
||||
#import "ZhiShuAlterView.h"
|
||||
#import "ChuangZuoSiLuViewController.h"
|
||||
#import "XieZuoXiangQingViewController.h"
|
||||
#import "RoleTreeModel.h"
|
||||
|
||||
@interface ZhiNengXieZuoQuanWenView ()
|
||||
///
|
||||
|
@ -156,13 +158,24 @@
|
|||
}
|
||||
return field;
|
||||
}
|
||||
|
||||
-(void)setModelTC:(RoleInfoModelData *)modelTC
|
||||
{
|
||||
_modelTC = modelTC;
|
||||
if(self.modelTC.config.subjects.count>0)
|
||||
{
|
||||
RoleInfoModelDataConfigSubjects *model = self.modelTC.config.subjects.firstObject;
|
||||
UITextField *field = self.arrfield[2];
|
||||
field.text = model.name;
|
||||
}
|
||||
|
||||
}
|
||||
-(void)itemAction:(UIButton *)sender
|
||||
{
|
||||
[self endEditing:YES];
|
||||
if(sender.tag==1)
|
||||
{
|
||||
TiCaiAlterView *view = [[TiCaiAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
view.arrdata = self.modelTC.config.subjects;
|
||||
[self.viewController.view addSubview:view];
|
||||
[view setBackValue:^(NSString * _Nonnull name) {
|
||||
UITextField *field = self.arrfield[2];
|
||||
|
@ -182,12 +195,44 @@
|
|||
///梳理思路
|
||||
-(void)shuliAction
|
||||
{
|
||||
if([self getFieldValue:0].length==0)
|
||||
{
|
||||
[HXHud showMessage:@"请输入作文标题" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
|
||||
ChuangZuoSiLuViewController *vc = [ChuangZuoSiLuViewController new];
|
||||
vc.dic_title = [self getFieldValue:0];
|
||||
vc.dic_require = [self getFieldValue:1];
|
||||
vc.dic_type = [self getFieldValue:2];
|
||||
vc.dic_require_num = [self getFieldValue:3];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
///提交
|
||||
-(void)sendAction
|
||||
{
|
||||
if([self getFieldValue:0].length==0)
|
||||
{
|
||||
[HXHud showMessage:@"请输入作文标题" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[self getFieldValue:0] forKey:@"title"];
|
||||
[dicpush setObject:[self getFieldValue:1] forKey:@"require"];
|
||||
[dicpush setObject:[self getFieldValue:2] forKey:@"type"];
|
||||
[dicpush setObject:[self getFieldValue:3] forKey:@"require_num"];
|
||||
[dicpush setObject:[Tools isStringnil:[UserInfoModel shareModel].user_stage.name] forKey:@"stage"];
|
||||
|
||||
XieZuoXiangQingViewController *vc = [XieZuoXiangQingViewController new];
|
||||
vc.scene = @"write_one_key";
|
||||
vc.dic_type = [self getFieldValue:2];
|
||||
vc.dicpush = dicpush;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(NSString *)getFieldValue:(int)tag
|
||||
{
|
||||
UITextField *field = self.arrfield[tag];
|
||||
return field.text;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "RoleInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ZhiNengXieZuoView : UIView
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) RoleInfoModelData *modelTC;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -96,6 +96,12 @@
|
|||
[self.imgvback setImage:[image resizableImageWithCapInsets:UIEdgeInsetsMake(image.size.height/2.0, 20, image.size.height/2.0, image.size.width-20)]];
|
||||
}
|
||||
}
|
||||
-(void)setModelTC:(RoleInfoModelData *)modelTC
|
||||
{
|
||||
_modelTC = modelTC;
|
||||
self.viewqw.modelTC = modelTC;
|
||||
self.viewdl.modelTC = modelTC;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,6 +10,14 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XieZuoXiangQingViewController : BaseViewController
|
||||
///
|
||||
@property (nonatomic , strong) NSString *scene;
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableDictionary *dicpush;
|
||||
///记叙文
|
||||
@property (nonatomic , strong) NSString *dic_type;
|
||||
///写作思路数据 SSEDrawModel
|
||||
@property (nonatomic , strong) NSArray *arrSL;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
[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 clearColor]];
|
||||
[self.navigationView setMuenTitle:@"反馈" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
}
|
||||
|
@ -35,7 +35,10 @@
|
|||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.offset(NavHeight);
|
||||
}];
|
||||
|
||||
view.dicpush = self.dicpush;
|
||||
view.dic_type = self.dic_type;
|
||||
view.arrSL = self.arrSL;
|
||||
view.scene = self.scene;///
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// XieZuoSaveAlterView.h
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef void(^XieZuoSaveAlterViewBack)(void);
|
||||
@interface XieZuoSaveAlterView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) XieZuoSaveAlterViewBack backValue;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,128 @@
|
|||
//
|
||||
// XieZuoSaveAlterView.m
|
||||
// ProductApp
|
||||
//
|
||||
// Created by 工作 on 2024/10/24.
|
||||
//
|
||||
|
||||
#import "XieZuoSaveAlterView.h"
|
||||
|
||||
|
||||
@interface XieZuoSaveAlterView ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation XieZuoSaveAlterView
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if(self = [super initWithFrame:frame])
|
||||
{
|
||||
[self setBackgroundColor:RGBACOLOR(0, 0, 0, 0.4)];
|
||||
|
||||
UIView *viewback = [[UIView alloc] init];
|
||||
[viewback setBackgroundColor:[UIColor whiteColor]];
|
||||
[self addSubview:viewback];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(45);
|
||||
make.right.equalTo(self).offset(-45);
|
||||
make.center.equalTo(self);
|
||||
}];
|
||||
[viewback.layer setMasksToBounds:YES];
|
||||
[viewback.layer setCornerRadius:20];
|
||||
|
||||
UIImageView *imgvback = [[UIImageView alloc] init];
|
||||
[imgvback setImage:[UIImage imageNamed:@"ic_save_dialog_bg"]];
|
||||
[viewback addSubview:imgvback];
|
||||
[imgvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.offset(80);
|
||||
make.centerX.equalTo(viewback);
|
||||
make.top.offset(10);
|
||||
}];
|
||||
|
||||
UILabel *lbname = [[UILabel alloc] init];
|
||||
[lbname setText:@"已保存到历史记录"];
|
||||
[lbname setTextColor:RGBCOLOR(51, 51, 51)];
|
||||
[lbname setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbname setFont:[UIFont systemFontOfSize:14]];
|
||||
[viewback addSubview:lbname];
|
||||
[lbname mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(imgvback.mas_bottom).offset(20);
|
||||
make.centerX.equalTo(viewback);
|
||||
}];
|
||||
|
||||
UILabel *lbts = [[UILabel alloc] init];
|
||||
[lbts setText:@"复制到粘贴板更方便分享编辑哦"];
|
||||
[lbts setTextColor:RGBCOLOR(51, 51, 51)];
|
||||
[lbts setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbts setFont:[UIFont systemFontOfSize:14]];
|
||||
[viewback addSubview:lbts];
|
||||
[lbts mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(lbname.mas_bottom).offset(12);
|
||||
make.centerX.equalTo(viewback);
|
||||
}];
|
||||
|
||||
UIButton *btlast = nil;
|
||||
NSArray *arr = @[@"取消",@"复制全文"];
|
||||
float f_w = (UISCREEN_WIDTH-192)/2.0;
|
||||
for(int i = 0; i< arr.count; i++)
|
||||
{
|
||||
UIButton *btitem = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, f_w, 40)];
|
||||
[btitem setTitle:arr[i] forState:UIControlStateNormal];
|
||||
[btitem setTitleColor:RGBCOLOR(51, 51, 51) forState:UIControlStateNormal];
|
||||
[btitem.titleLabel setFont:[UIFont boldSystemFontOfSize:16]];
|
||||
if(i==1)
|
||||
{
|
||||
[btitem setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[btitem.titleLabel setFont:[UIFont boldSystemFontOfSize:16]];
|
||||
[btitem setBackgroundColor:RGBCOLOR(255, 102, 102)];
|
||||
}
|
||||
else
|
||||
{
|
||||
[btitem.layer setBorderWidth:1];
|
||||
[btitem.layer setBorderColor:RGBCOLOR(216, 216, 216).CGColor];
|
||||
}
|
||||
[btitem.layer setMasksToBounds:YES];
|
||||
[btitem.layer setCornerRadius:15];
|
||||
[viewback addSubview:btitem];
|
||||
[btitem mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(lbts.mas_bottom).offset(20);
|
||||
if(i==1)
|
||||
{
|
||||
make.left.equalTo(viewback.mas_centerX).offset(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.right.equalTo(viewback.mas_centerX).offset(-10);
|
||||
}
|
||||
make.width.offset(f_w);
|
||||
make.height.offset(40);
|
||||
}];
|
||||
[btitem setTag:i];
|
||||
[btitem addTarget:self action:@selector(btAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
btlast = btitem;
|
||||
if(i==1)
|
||||
{
|
||||
[Tools changedView:btitem colors:MainJBColors startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(btlast).offset(20);
|
||||
}];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)btAction:(UIButton *)sender
|
||||
{
|
||||
if(sender.tag==1)
|
||||
{
|
||||
self.backValue();
|
||||
}
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
@end
|
|
@ -10,7 +10,8 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XieZuoXiangQingSiLuView : UIView
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *arrsl;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
#import "XieZuoXiangQingSiLuView.h"
|
||||
#import "SSEDrawModel.h"
|
||||
|
||||
@interface XieZuoXiangQingSiLuView ()
|
||||
///
|
||||
|
@ -15,6 +16,10 @@
|
|||
///
|
||||
@property (nonatomic , strong) MASConstraint *selfBottom;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrLB;
|
||||
|
||||
|
||||
@end
|
||||
@implementation XieZuoXiangQingSiLuView
|
||||
|
||||
|
@ -38,6 +43,7 @@
|
|||
[self drawTopView:viewtop];
|
||||
_viewtop = viewtop;
|
||||
|
||||
self.arrLB = [NSMutableArray new];
|
||||
UIView *viewlast = nil;
|
||||
NSArray *arrtt = @[@"作文题材",@"开头",@"中间",@"结尾"];
|
||||
for(int i = 0 ; i < arrtt.count; i++)
|
||||
|
@ -57,7 +63,9 @@
|
|||
}
|
||||
}];
|
||||
viewlast = viewitem;
|
||||
[self drawItemView:viewitem title:arrtt[i] content:@"选材:第一次露营的经历"];
|
||||
UILabel *lb = [self drawItemView:viewitem title:arrtt[i] content:@"选材:第一次露营的经历"];
|
||||
|
||||
[self.arrLB addObject:lb];
|
||||
}
|
||||
_viewlast = viewlast;
|
||||
|
||||
|
@ -68,7 +76,7 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
-(void)drawItemView:(UIView *)view title:(NSString *)title content:(NSString *)content
|
||||
-(UILabel *)drawItemView:(UIView *)view title:(NSString *)title content:(NSString *)content
|
||||
{
|
||||
[view setBackgroundColor:RGBCOLOR(223, 225, 251)];
|
||||
[view.layer setMasksToBounds:YES];
|
||||
|
@ -101,6 +109,7 @@
|
|||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbcontent).offset(10);
|
||||
}];
|
||||
return lbcontent;
|
||||
}
|
||||
|
||||
-(void)drawTopView:(UIView *)view
|
||||
|
@ -134,6 +143,30 @@
|
|||
|
||||
}
|
||||
|
||||
-(void)setArrsl:(NSArray *)arrsl
|
||||
{
|
||||
_arrsl = arrsl;
|
||||
if(arrsl.count==4)
|
||||
{
|
||||
for(int i = 0 ; i < arrsl.count;i++)
|
||||
{
|
||||
UILabel *lb = self.arrLB[i];
|
||||
SSEDrawModel *model = arrsl[i];
|
||||
NSString *str = [model.arrSon componentsJoinedByString:@"\n"];
|
||||
NSString *strtemp = [str substringWithRange:NSMakeRange(str.length-1, 1)];
|
||||
if([strtemp isEqualToString:@"\n"])
|
||||
{
|
||||
str = [str substringToIndex:str.length-1];
|
||||
}
|
||||
lb.text = str;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setHidden:YES];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)btzkAction:(UIButton *)sender
|
||||
{
|
||||
sender.selected = !sender.selected;
|
||||
|
|
|
@ -10,6 +10,14 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XieZuoXiangQingView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) NSString *scene;
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableDictionary *dicpush;
|
||||
///记叙文
|
||||
@property (nonatomic , strong) NSString *dic_type;
|
||||
///写作思路数据 SSEDrawModel
|
||||
@property (nonatomic , strong) NSArray *arrSL;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -9,19 +9,47 @@
|
|||
#import "XieZuoXiangQingSiLuView.h"
|
||||
#import "FenXiangWenZhangAlterView.h"
|
||||
#import "ChongXieYiPianViewController.h"
|
||||
#import "XieZuoSaveAlterView.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
#import "RoleTreeModel.h"
|
||||
#import "SSEDrawListTextModel.h"
|
||||
|
||||
@interface XieZuoXiangQingView ()
|
||||
#import "NetWorkManager.h"
|
||||
|
||||
@interface XieZuoXiangQingView ()<UIScrollViewDelegate>
|
||||
///
|
||||
@property (nonatomic , strong) UIScrollView *scvback;
|
||||
///
|
||||
@property (nonatomic , strong) UILabel *lbname;
|
||||
@property (nonatomic , strong) UILabel *lbzhishu;
|
||||
@property (nonatomic , strong) XieZuoXiangQingSiLuView *viewsl;
|
||||
|
||||
@property (nonatomic , assign) BOOL isDragging;
|
||||
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSArray *arrdata;
|
||||
@property (nonatomic , strong) NSMutableArray *arrLBWZ;
|
||||
@property (nonatomic , strong) NSMutableArray *arrBTN;
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrItems;
|
||||
@property (nonatomic , strong) NSMutableArray *arrdata;
|
||||
|
||||
@property (nonatomic , assign) BOOL isdrawEnd;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) SSEConfigModel *modelConfig;
|
||||
@property (nonatomic , assign) BOOL isStartDrawText;
|
||||
///
|
||||
@property (nonatomic , strong) NSTimer *timerDraw;
|
||||
///
|
||||
@property (nonatomic , strong) MASConstraint *bottomScroll;
|
||||
@property (nonatomic , assign) NSInteger iDraw;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewDarwLast;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) SSEDrawListTextModel *modelSelect;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XieZuoXiangQingView
|
||||
|
@ -37,6 +65,7 @@
|
|||
make.width.equalTo(self);
|
||||
make.height.equalTo(self).offset(-TabHeight-20);
|
||||
}];
|
||||
[scvback setDelegate:self];
|
||||
_scvback = scvback;
|
||||
[self drawInfoView:scvback];
|
||||
|
||||
|
@ -66,17 +95,7 @@
|
|||
make.left.top.offset(20);
|
||||
make.width.equalTo(view).offset(-40);
|
||||
}];
|
||||
|
||||
UILabel *lbyaoqiu = [[UILabel alloc] init];
|
||||
[lbyaoqiu setText:@"全文要求:写给生命"];
|
||||
[lbyaoqiu setTextColor:RGBCOLOR(109, 109, 109)];
|
||||
[lbyaoqiu setTextAlignment:NSTextAlignmentCenter];
|
||||
[lbyaoqiu setFont:[UIFont systemFontOfSize:12]];
|
||||
[view addSubview:lbyaoqiu];
|
||||
[lbyaoqiu mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(lbname);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(15);
|
||||
}];
|
||||
_lbname = lbname;
|
||||
|
||||
UILabel *lbzhishu = [[UILabel alloc] init];
|
||||
[lbzhishu setText:@"800字"];
|
||||
|
@ -86,8 +105,9 @@
|
|||
[view addSubview:lbzhishu];
|
||||
[lbzhishu mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(lbname);
|
||||
make.top.equalTo(lbyaoqiu.mas_bottom).offset(15);
|
||||
make.top.equalTo(lbname.mas_bottom).offset(15);
|
||||
}];
|
||||
_lbzhishu = lbzhishu;
|
||||
|
||||
XieZuoXiangQingSiLuView *viewsl = [XieZuoXiangQingSiLuView new];
|
||||
[view addSubview:viewsl];
|
||||
|
@ -95,13 +115,10 @@
|
|||
make.left.right.equalTo(lbname);
|
||||
make.top.equalTo(lbzhishu.mas_bottom).offset(18);
|
||||
}];
|
||||
_viewsl = viewsl;
|
||||
|
||||
|
||||
self.arrItems = [NSMutableArray new];
|
||||
self.arrdata = @[@"",@"",@"",@""];
|
||||
[self drawItemLastView:viewsl tag:0 bottom:nil];
|
||||
}
|
||||
-(void)drawItemLastView:(UIView *)view tag:(int)tag bottom:(MASConstraint *)bottom
|
||||
-(ViewLable *)drawItemLastView:(UIView *)view tag:(NSInteger)tag
|
||||
{
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[self.scvback addSubview:lbwz];
|
||||
|
@ -112,47 +129,34 @@
|
|||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:16];
|
||||
lbwz.fspeed = 0.02;
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",@"你的作文非常出色,但是可以在语言表达上更加生动有趣,增加一些形象的比喻和细节描写,让读者更加深入地了解你的思考和感受。同时,可以适当增加一些个人的经历和感受,让作文更加具有个性化和独特性。"];
|
||||
lbwz.isWriteEnd = YES;
|
||||
__strong ViewLable *lbwzSelf = lbwz;
|
||||
__block MASConstraint *bottomScroll;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
if(tag<self.arrdata.count-1)
|
||||
{
|
||||
[self drawItemLastView:lbwzSelf tag:tag+1 bottom:bottomScroll];
|
||||
}
|
||||
else
|
||||
{///全部绘制完
|
||||
self.isdrawEnd = YES;
|
||||
}
|
||||
}
|
||||
if(self.scvback.contentSize.height-self.scvback.height>0)
|
||||
{
|
||||
[self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height)];
|
||||
}
|
||||
}];
|
||||
[self.arrItems addObject:lbwz];
|
||||
if(bottom)
|
||||
if(self.bottomScroll)
|
||||
{
|
||||
[bottom uninstall];
|
||||
[self.bottomScroll uninstall];
|
||||
}
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
bottomScroll = make.bottom.equalTo(lbwz.mas_bottom).offset(20);
|
||||
self.bottomScroll = make.bottom.equalTo(lbwz.mas_bottom).offset(20);
|
||||
}];
|
||||
[self.arrLBWZ addObject:lbwz];
|
||||
|
||||
UIButton *btcx = [[UIButton alloc] init];
|
||||
[btcx setImage:[UIImage imageNamed:@"znxz_chongxie"] forState:UIControlStateNormal];
|
||||
[btcx setTitle:@"重写" forState:UIControlStateNormal];
|
||||
[btcx setTitleColor:RGBCOLOR(108, 119, 246) forState:UIControlStateNormal];
|
||||
[btcx.titleLabel setFont:[UIFont systemFontOfSize:12]];
|
||||
[btcx setImage:[UIImage imageNamed:@"xz_chongxie"] forState:UIControlStateNormal];
|
||||
[self.scvback addSubview:btcx];
|
||||
[btcx mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.sizeOffset(CGSizeMake(24, 24));
|
||||
make.left.offset(23);
|
||||
make.size.sizeOffset(CGSizeMake(54, 22));
|
||||
make.left.offset(20);
|
||||
make.top.equalTo(view.mas_bottom).offset(17);
|
||||
}];
|
||||
[btcx setIconInLeft];
|
||||
[btcx setBackgroundColor:RGBCOLOR(226, 228, 253)];
|
||||
[btcx addTarget:self action:@selector(cxAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[btcx setTag:tag];
|
||||
[btcx.layer setMasksToBounds:YES];
|
||||
[btcx.layer setCornerRadius:11];
|
||||
[self.arrBTN addObject:btcx];
|
||||
return lbwz;
|
||||
}
|
||||
|
||||
|
||||
|
@ -185,7 +189,7 @@
|
|||
[btchange addTarget:self action:@selector(bottomAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
UIButton *btcreate = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, (UISCREEN_WIDTH-52)/2.0, 40)];
|
||||
[btcreate setTitle:@"保存分享" forState:UIControlStateNormal];
|
||||
[btcreate setTitle:@"保存记录" forState:UIControlStateNormal];
|
||||
[btcreate setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[btcreate.titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
|
||||
[btcreate.layer setMasksToBounds:YES];
|
||||
|
@ -200,6 +204,34 @@
|
|||
[btcreate addTarget:self action:@selector(bottomAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[Tools changedView:btcreate colors:MainJBColors startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
|
||||
}
|
||||
-(void)setDicpush:(NSMutableDictionary *)dicpush
|
||||
{
|
||||
_dicpush = dicpush;
|
||||
self.lbname.text = [Tools isStringnilkong:[dicpush objectForKey:@"title"]];
|
||||
self.lbzhishu.text = [NSString stringWithFormat:@"%@字",[dicpush objectForKey:@"require_num"]];
|
||||
}
|
||||
-(void)setArrSL:(NSArray *)arrSL
|
||||
{
|
||||
_arrSL = arrSL;
|
||||
if(arrSL==nil)
|
||||
{
|
||||
[self.viewsl setHidden:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.viewsl setHidden:NO];
|
||||
self.viewsl.arrsl = arrSL;
|
||||
}
|
||||
|
||||
}
|
||||
-(void)setScene:(NSString *)scene
|
||||
{
|
||||
_scene = scene;
|
||||
|
||||
[self getdata];
|
||||
}
|
||||
|
||||
///重写段落
|
||||
-(void)cxAction:(UIButton *)sender
|
||||
{
|
||||
if(self.isdrawEnd==NO)
|
||||
|
@ -208,15 +240,15 @@
|
|||
return;
|
||||
}
|
||||
self.isdrawEnd = NO;
|
||||
ViewLable *lbwz = self.arrItems[sender.tag];
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",@"2341234123你的作文非常出色,但是可以在语言表达上更加生动有趣,增加一些形象的比喻和细节描写,让读者更加深入地了解你的思考和感受。同时,可以适当增加一些个人的经历和感受,让作文更加具有个性化和独特性。"];
|
||||
lbwz.isWriteEnd = YES;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
self.isdrawEnd = YES;
|
||||
}
|
||||
}];
|
||||
SSEDrawListTextModel *model = self.arrdata[sender.tag];
|
||||
model.isaddEnd = NO;
|
||||
self.modelSelect = model;
|
||||
// model.value = @"";
|
||||
// ViewLable *lbwz = model.lbwz;
|
||||
// lbwz.strValue = @"";
|
||||
|
||||
[self getDuanLuo:model.value];
|
||||
|
||||
}
|
||||
-(void)bottomAction:(UIButton *)sender
|
||||
{
|
||||
|
@ -227,23 +259,283 @@
|
|||
}
|
||||
switch (sender.tag) {
|
||||
case 0:
|
||||
{
|
||||
ChongXieYiPianViewController *vc = [ChongXieYiPianViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
{///重写
|
||||
[self getdata];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
FenXiangWenZhangAlterView *view = [[FenXiangWenZhangAlterView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT)];
|
||||
[self.viewController.view addSubview:view];
|
||||
[view setBackValue:^(NSInteger tag) {
|
||||
|
||||
}];
|
||||
}
|
||||
break;
|
||||
break;
|
||||
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];
|
||||
}
|
||||
}
|
||||
[dicinfo setObject:[arrcontent componentsJoinedByString:@"\n"] forKey:@"content"];
|
||||
[dicinfo setObject:[NSString stringWithFormat:@"%d",rand()%6+95] forKey:@"score"];
|
||||
if(self.arrSL.count==4)
|
||||
{
|
||||
NSMutableDictionary *dicThinking = [NSMutableDictionary new];
|
||||
[dicThinking setObject: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"];
|
||||
}
|
||||
|
||||
[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];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma mark - UIScrollView
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
self.isDragging = YES;
|
||||
}
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
|
||||
{
|
||||
self.isDragging = NO;
|
||||
}
|
||||
-(void)nomoData
|
||||
{
|
||||
for(UIView *view in self.arrLBWZ)
|
||||
{
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
for(UIButton *btin in self.arrBTN)
|
||||
{
|
||||
[btin removeFromSuperview];
|
||||
}
|
||||
self.arrLBWZ = [NSMutableArray new];
|
||||
self.arrBTN = [NSMutableArray new];
|
||||
self.arrdata = [NSMutableArray new];
|
||||
for(int i = 0 ; i < 200;i++)
|
||||
{
|
||||
SSEDrawListTextModel *model = [SSEDrawListTextModel new];
|
||||
[self.arrdata addObject:model];
|
||||
}
|
||||
|
||||
self.isStartDrawText = NO;
|
||||
self.isdrawEnd = NO;
|
||||
self.iDraw = 0;
|
||||
self.viewDarwLast = self.viewsl;
|
||||
if(self.arrSL.count==0)
|
||||
{
|
||||
self.viewDarwLast = self.lbzhishu;
|
||||
}
|
||||
}
|
||||
///段落重写 rewrite {content,type}
|
||||
-(void)getDuanLuo:(NSString *)content
|
||||
{
|
||||
self.modelSelect.lbwz.isWriteEnd = NO;
|
||||
[self.modelSelect.lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
|
||||
}];
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:[self.dicpush objectForKey:@"type"]] forKey:@"type"];
|
||||
[dicpush setObject:[Tools isStringnil:content] forKey:@"content"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=rewrite"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
NSLog(@"%@",value);
|
||||
if(value.length>4)
|
||||
{
|
||||
self.modelSelect.value = value;
|
||||
self.modelSelect.lbwz.strValue = [NSString stringWithFormat:@" %@",self.modelSelect.value];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
self.modelSelect.isaddEnd = YES;
|
||||
self.isdrawEnd = YES;
|
||||
self.modelSelect.lbwz.isWriteEnd = YES;
|
||||
}
|
||||
}
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
///全文
|
||||
-(void)getdata
|
||||
{
|
||||
[LoadAlterView show];
|
||||
[self nomoData];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setDictionary:self.dicpush];
|
||||
if([self.scene isEqualToString:@"write_with_outline"])
|
||||
{///思路成文
|
||||
NSMutableDictionary *dicThinking = [NSMutableDictionary new];
|
||||
[dicThinking setObject: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"];
|
||||
}
|
||||
|
||||
[dicpush setObject:dicThinking forKey:@"thinking"];
|
||||
}
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",self.scene] 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) {
|
||||
[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:@"|&&|"];
|
||||
NSArray *arrlist = [strshow componentsSeparatedByString:@"|&&|"];
|
||||
SSEDrawListTextModel *modellast;
|
||||
for(int i = 0 ; i < arrlist.count;i++)
|
||||
{
|
||||
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.timerDraw = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(drawTextInfo) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop mainRunLoop] addTimer:self.timerDraw forMode:NSRunLoopCommonModes];
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
-(void)drawTextInfo
|
||||
{
|
||||
if(self.iDraw>=self.arrdata.count)
|
||||
{
|
||||
[self.timerDraw invalidate];
|
||||
self.timerDraw = nil;
|
||||
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)
|
||||
{
|
||||
lbwz = [self drawItemLastView:self.viewDarwLast tag:self.iDraw];
|
||||
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(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;
|
||||
|
||||
lbwz.strValue = [NSString stringWithFormat:@" %@",model.value];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ChuangZuoSiLuViewController : BaseViewController
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSString *dic_title;
|
||||
@property (nonatomic , strong) NSString *dic_require;
|
||||
@property (nonatomic , strong) NSString *dic_type;
|
||||
@property (nonatomic , strong) NSString *dic_require_num;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -42,6 +42,10 @@
|
|||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.offset(NavHeight);
|
||||
}];
|
||||
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;///最后在设置要求
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ChuangZuoSiLuView : UIView
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSString *dic_title;
|
||||
@property (nonatomic , strong) NSString *dic_require;
|
||||
@property (nonatomic , strong) NSString *dic_type;
|
||||
@property (nonatomic , strong) NSString *dic_require_num;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -9,9 +9,30 @@
|
|||
#import "XieZuoXiangQingViewController.h"
|
||||
#import "HuanGeSiLuViewController.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
#import "RoleTreeModel.h"
|
||||
|
||||
typedef void(^ChuangZuoSiLuViewDraw)(void);
|
||||
@interface ChuangZuoSiLuView ()
|
||||
///
|
||||
@property (nonatomic , strong) UIScrollView *scvback;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) MASConstraint *scvBottom;
|
||||
@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;
|
||||
///
|
||||
@property (nonatomic , strong) NSTimer *timerDraw;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -41,7 +62,8 @@ typedef void(^ChuangZuoSiLuViewDraw)(void);
|
|||
make.width.equalTo(viewback);
|
||||
make.height.equalTo(viewback).offset(-90);
|
||||
}];
|
||||
[self drawInfoView:scvback];
|
||||
_scvback = scvback;
|
||||
// [self drawInfoView:scvback];
|
||||
|
||||
float f_w = (UISCREEN_WIDTH-95)/2.0;
|
||||
UIButton *btcreate = [[UIButton alloc] init];
|
||||
|
@ -92,115 +114,71 @@ typedef void(^ChuangZuoSiLuViewDraw)(void);
|
|||
return self;
|
||||
}
|
||||
|
||||
-(void)drawInfoView:(UIScrollView *)view
|
||||
#pragma mark - ///绘制大模块
|
||||
-(UIView *)drawSubItemsView:(UIView *)view title:(NSString *)title lastview:(UIView *)lastview
|
||||
{
|
||||
///题材
|
||||
UIView *viewticai = [[UIView alloc] init];
|
||||
[view addSubview:viewticai];
|
||||
[viewticai mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.offset(23);
|
||||
UIView *viewtop= [[UIView alloc] init];
|
||||
[view addSubview:viewtop];
|
||||
[viewtop mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.width.equalTo(view);
|
||||
}];
|
||||
[self drawOneTextView:viewticai title:@"题材" back:^{
|
||||
|
||||
}];
|
||||
|
||||
///开头
|
||||
UIView *viewkaitou = [[UIView alloc] init];
|
||||
[view addSubview:viewkaitou];
|
||||
[viewkaitou mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(viewticai.mas_bottom).offset(18);
|
||||
make.left.width.equalTo(view);
|
||||
}];
|
||||
[self drawOneTextView:viewkaitou title:@"开头" back:^{
|
||||
|
||||
}];
|
||||
|
||||
///中间
|
||||
UIView *viewzhongjian = [[UIView alloc] init];
|
||||
[view addSubview:viewzhongjian];
|
||||
[viewzhongjian mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(viewkaitou.mas_bottom).offset(18);
|
||||
make.left.width.equalTo(view);
|
||||
}];
|
||||
[self drawCenterView:viewzhongjian back:^{
|
||||
|
||||
}];
|
||||
|
||||
|
||||
///结尾
|
||||
UIView *viewjiewei = [[UIView alloc] init];
|
||||
[view addSubview:viewjiewei];
|
||||
[viewjiewei mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(viewzhongjian.mas_bottom).offset(18);
|
||||
make.left.width.equalTo(view);
|
||||
}];
|
||||
[self drawOneTextView:viewjiewei title:@"结尾" back:^{
|
||||
|
||||
}];
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(viewjiewei).offset(20);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)drawCenterView:(UIView *)view back:(ChuangZuoSiLuViewDraw)back
|
||||
{
|
||||
UIView *viewtop = [self drawItemView:view title:@"中间"];
|
||||
|
||||
///
|
||||
ViewLable *lbticai = [self drawItem:view lastview:viewtop];
|
||||
lbticai.strValue = @"以我心中的英雄--杨利伟为例,讲述他的热爱祖国的事迹。";
|
||||
lbticai.isWriteEnd = YES;
|
||||
[lbticai setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{///这里如果有多个需要处理
|
||||
// back();
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
ViewLable *lbticai1 = [self drawItem:view lastview:lbticai.superview];
|
||||
lbticai1.strValue = @"以我心中的英雄--杨利伟为例,讲述他的热爱祖国的事迹。";
|
||||
lbticai1.isWriteEnd = YES;
|
||||
[lbticai1 setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{///这里如果有多个需要处理
|
||||
back();
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbticai1.superview);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)drawOneTextView:(UIView *)view title:(NSString *)title back:(ChuangZuoSiLuViewDraw)back
|
||||
{
|
||||
ViewLable *lbticai = [self drawItem:view lastview:[self drawItemView:view title:title]];
|
||||
lbticai.strValue = @"以我心中的英雄--杨利伟为例,讲述他的热爱祖国的事迹。";
|
||||
lbticai.isWriteEnd = YES;
|
||||
[lbticai setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
if(lastview)
|
||||
{
|
||||
back();
|
||||
make.top.equalTo(lastview.mas_bottom).offset(18);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.top.offset(24);
|
||||
}
|
||||
make.height.offset(20);
|
||||
}];
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbticai.superview);
|
||||
}];
|
||||
[self drawTitleView:viewtop title:title];
|
||||
|
||||
return viewtop;
|
||||
}
|
||||
|
||||
-(UIView *)drawItemView:(UIView *)view title:(NSString *)title
|
||||
#pragma mark -///绘制一个小模块
|
||||
-(ViewLable *)drawSUbItemView:(UIView *)view lastview:(UIView *)lastview
|
||||
{
|
||||
UIView *viewtc = [[UIView alloc] init];
|
||||
[view addSubview:viewtc];
|
||||
[viewtc mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(15);
|
||||
make.width.equalTo(view).offset(-30);
|
||||
make.top.equalTo(lastview.mas_bottom).offset(10);
|
||||
}];
|
||||
[viewtc setBackgroundColor:RGBCOLOR(240, 241, 254)];
|
||||
[viewtc.layer setMasksToBounds:YES];
|
||||
[viewtc.layer setCornerRadius:12];
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[viewtc addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.offset(10);
|
||||
make.right.equalTo(viewtc).offset(-10);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(109, 109, 109);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:16];
|
||||
|
||||
[viewtc mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbwz).offset(10);
|
||||
}];
|
||||
|
||||
///scrollview
|
||||
if(self.scvBottom)
|
||||
{
|
||||
[self.scvBottom uninstall];
|
||||
}
|
||||
[view mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
self.scvBottom = make.bottom.equalTo(viewtc).offset(10);
|
||||
}];
|
||||
return lbwz;
|
||||
}
|
||||
-(void)drawTitleView:(UIView *)view title:(NSString *)title
|
||||
{
|
||||
UIView *viewline = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 7, 17)];
|
||||
[view addSubview:viewline];
|
||||
[viewline mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(20);
|
||||
make.top.offset(0);
|
||||
make.left.offset(17);
|
||||
make.centerY.equalTo(view);
|
||||
make.size.sizeOffset(CGSizeMake(7, 17));
|
||||
}];
|
||||
[viewline.layer setMasksToBounds:YES];
|
||||
|
@ -211,55 +189,239 @@ typedef void(^ChuangZuoSiLuViewDraw)(void);
|
|||
[lbname setText:title];
|
||||
[lbname setTextColor:RGBCOLOR(26, 26, 17)];
|
||||
[lbname setTextAlignment:NSTextAlignmentLeft];
|
||||
[lbname setFont:[UIFont boldSystemFontOfSize:16]];
|
||||
[lbname setFont:[UIFont boldSystemFontOfSize:18]];
|
||||
[view addSubview:lbname];
|
||||
[lbname mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(viewline);
|
||||
make.centerY.equalTo(view);
|
||||
make.left.equalTo(viewline.mas_right).offset(6);
|
||||
}];
|
||||
return viewline;
|
||||
}
|
||||
-(ViewLable *)drawItem:(UIView *)view lastview:(UIView *)lastview
|
||||
-(void)setDic_require:(NSString *)dic_require
|
||||
{
|
||||
UIView *viewback = [[UIView alloc] init];
|
||||
[viewback setBackgroundColor:RGBCOLOR(240, 241, 254)];
|
||||
[view addSubview:viewback];
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(20);
|
||||
make.width.equalTo(view).offset(-40);
|
||||
make.top.equalTo(lastview.mas_bottom).offset(12);
|
||||
}];
|
||||
[viewback.layer setMasksToBounds:YES];
|
||||
[viewback.layer setCornerRadius:12];
|
||||
|
||||
ViewLable *lbwz = [[ViewLable alloc] init];
|
||||
[viewback addSubview:lbwz];
|
||||
[lbwz mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(10);
|
||||
make.top.offset(10);
|
||||
make.right.equalTo(viewback).offset(-10);
|
||||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
|
||||
[viewback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(lbwz).offset(10);
|
||||
}];
|
||||
|
||||
return lbwz;
|
||||
_dic_require = dic_require;
|
||||
[self getdata:@"write_outline"];
|
||||
}
|
||||
|
||||
|
||||
///换个思路
|
||||
-(void)changeAction
|
||||
{
|
||||
if(self.isdrawEnd==NO)
|
||||
{
|
||||
[HXHud showMessage:@"请等待写作完成" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
HuanGeSiLuViewController *vc = [HuanGeSiLuViewController new];
|
||||
vc.dic_title = self.dic_title;
|
||||
vc.sse_type = @"1";
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
[vc setBackValue:^(NSString * _Nonnull value) {
|
||||
[self setDic_require:value];
|
||||
// self->_dic_require = value;
|
||||
// [self getdata:@"switch_outline"];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)sendAction
|
||||
{
|
||||
if(self.isdrawEnd==NO)
|
||||
{
|
||||
[HXHud showMessage:@"请等待写作完成" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_title] forKey:@"title"];
|
||||
[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"];
|
||||
|
||||
XieZuoXiangQingViewController *vc = [XieZuoXiangQingViewController new];
|
||||
vc.scene = @"write_with_outline";
|
||||
vc.dicpush = dicpush;
|
||||
vc.dic_type = self.dic_type;
|
||||
vc.arrSL = self.arrDraw;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)getdata:(NSString *)scenct
|
||||
{
|
||||
[LoadAlterView show];
|
||||
[self nomoData];
|
||||
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_title] forKey:@"title"];
|
||||
[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"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",scenct] 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) {
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)nomoData
|
||||
{
|
||||
for(UIView *view in self.scvback.subviews)
|
||||
{
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)chuliShuJu:(NSString *)value isfinish:(BOOL)isfinish
|
||||
{
|
||||
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:@"|&&|"];
|
||||
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.timerDraw = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(drawTextInfo) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop mainRunLoop] addTimer:self.timerDraw forMode:NSRunLoopCommonModes];
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
-(void)drawTextInfo
|
||||
{
|
||||
if(self.iDraw>=self.arrDraw.count)
|
||||
{
|
||||
[self.timerDraw invalidate];
|
||||
self.timerDraw = nil;
|
||||
self.isdrawEnd = YES;
|
||||
return;
|
||||
}
|
||||
SSEDrawModel *model = self.arrDraw[self.iDraw];
|
||||
if(model.isDrawTitle==NO)
|
||||
{
|
||||
///绘制大模块
|
||||
UIView *viewtc = [self drawSubItemsView:self.scvback title:model.title lastview:self.viewDarwLast];
|
||||
model.isDrawTitle = YES;
|
||||
self.viewDarwLast = viewtc;
|
||||
model.idrawtag = 0;
|
||||
}
|
||||
|
||||
///绘制小模块
|
||||
ViewLable *lbwz;
|
||||
if(model.arrViewLable.count<=model.idrawtag)
|
||||
{
|
||||
lbwz = [self drawSUbItemView:self.scvback lastview:self.viewDarwLast];
|
||||
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(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.superview;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -8,8 +8,25 @@
|
|||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^HuanGeSiLuViewControllerBackValue)(NSString *value);
|
||||
@interface HuanGeSiLuViewController : BaseViewController
|
||||
@property (nonatomic , strong) NSString *dic_title;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *sse_type;
|
||||
/*
|
||||
{
|
||||
AiTypeWrite = 1 //智能写作
|
||||
AiTypeCorrect = 2 //批改
|
||||
AiTypeClassroom = 3 //课堂写作
|
||||
AiTypePic = 4 //图片写作
|
||||
AiTypeTool = 5 //工具
|
||||
AiTypeExample = 6 //范文
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) HuanGeSiLuViewControllerBackValue backValue;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
[self showNaviGationView:YES];
|
||||
[self.navigationView setTitle:@"换个思路" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setBackgroundColor:[UIColor clearColor]];
|
||||
[self.navigationView setMuenTitle:@"提交" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
[self.navigationView setMuenTitle:@"反馈" titleColor:RGBCOLOR(60, 60, 60)];
|
||||
}
|
||||
-(void)navMuenButtonAction
|
||||
{
|
||||
[self.viewshow sendAction];
|
||||
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
@ -50,7 +50,15 @@
|
|||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.offset(NavHeight);
|
||||
}];
|
||||
view.dic_title = self.dic_title;
|
||||
view.sse_type = self.sse_type;///
|
||||
_viewshow = view;
|
||||
[view setBackValue:^(NSString * _Nonnull value) {
|
||||
if(self.backValue)
|
||||
{
|
||||
self.backValue(value);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -8,9 +8,13 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^HuanGeSiLuViewBack)(NSString *value);
|
||||
@interface HuanGeSiLuView : UIView
|
||||
-(void)sendAction;
|
||||
@property (nonatomic , strong) NSString *dic_title;
|
||||
///
|
||||
@property (nonatomic , strong) NSString *sse_type;
|
||||
///
|
||||
@property (nonatomic , strong) HuanGeSiLuViewBack backValue;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -10,14 +10,19 @@
|
|||
#import "HuanGeSiLuHDCollectionReusableView.h"
|
||||
#import "FSTextView.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
#import "RoleTreeModel.h"
|
||||
|
||||
@interface HuanGeSiLuView ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
///
|
||||
@property (nonatomic , strong) UICollectionView *collect;
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrselect;
|
||||
///
|
||||
@property (nonatomic , strong) FSTextView *textView;
|
||||
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrData;
|
||||
@property (nonatomic , assign) BOOL isDrawEnd;
|
||||
@end
|
||||
|
||||
@implementation HuanGeSiLuView
|
||||
|
@ -30,9 +35,19 @@
|
|||
[self addSubview:scvback];
|
||||
[scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.offset(0);
|
||||
make.width.height.equalTo(self);
|
||||
make.width.equalTo(self);
|
||||
make.height.equalTo(self).offset(-TabHeight-30);
|
||||
}];
|
||||
|
||||
UIView *viewbottom = [[UIView alloc] init];
|
||||
[viewbottom setBackgroundColor:[UIColor whiteColor]];
|
||||
[self addSubview:viewbottom];
|
||||
[viewbottom mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.equalTo(self);
|
||||
make.top.equalTo(scvback.mas_bottom);
|
||||
}];
|
||||
[self drawBottomView:viewbottom];
|
||||
|
||||
|
||||
UIView *viewcell = [[UIView alloc] init];
|
||||
[viewcell setBackgroundColor:[UIColor whiteColor]];
|
||||
|
@ -58,10 +73,28 @@
|
|||
make.bottom.equalTo(viewtext).offset(30);
|
||||
}];
|
||||
|
||||
self.arrselect = [NSMutableArray new];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)drawBottomView:(UIView *)view
|
||||
{
|
||||
UIButton *btai = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH-40, 45)];
|
||||
[btai setTitle:@"提交" forState:UIControlStateNormal];
|
||||
[btai setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[btai.titleLabel setFont:[UIFont systemFontOfSize:16]];
|
||||
[btai.layer setMasksToBounds:YES];
|
||||
[btai.layer setCornerRadius:16];
|
||||
[view addSubview:btai];
|
||||
[btai mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.offset(10);
|
||||
make.left.offset(20);
|
||||
make.right.equalTo(view).offset(-20);
|
||||
make.height.offset(45);
|
||||
}];
|
||||
[Tools changedView:btai colors:MainJBColors startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
|
||||
[btai addTarget:self action:@selector(sendAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
-(void)drawTextView:(UIView *)view
|
||||
{
|
||||
UIView *viewle = [self drawItemView:view title:@"写作要求"];
|
||||
|
@ -105,7 +138,7 @@
|
|||
make.left.offset(0);
|
||||
make.right.equalTo(view);
|
||||
make.top.equalTo(viewle.mas_bottom);
|
||||
make.height.offset(47*2+42*4-10*2+4);
|
||||
make.height.offset(47);///header 47 cell 42 需要减去多余间距 10.header.count +4
|
||||
}];
|
||||
[collect registerClass:[HuanGeSiLuCollectionViewCell class] forCellWithReuseIdentifier:@"HuanGeSiLuCollectionViewCell"];
|
||||
[collect registerClass:[HuanGeSiLuHDCollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HuanGeSiLuHDCollectionReusableView"];
|
||||
|
@ -141,24 +174,52 @@
|
|||
}];
|
||||
return viewline;
|
||||
}
|
||||
-(void)setSse_type:(NSString *)sse_type
|
||||
{
|
||||
_sse_type = sse_type;
|
||||
[self getData];
|
||||
}
|
||||
///提交
|
||||
-(void)sendAction
|
||||
{
|
||||
if(self.arrselect.count==0&&self.textView.text.length==0)
|
||||
{
|
||||
[HXHud showMessage:@"请选择或输入写作要求" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
if(self.textView.text.length>0)
|
||||
{
|
||||
[self.arrselect addObject:self.textView.text];
|
||||
}
|
||||
NSString *strtemp = [self.arrselect componentsJoinedByString:@"、"];
|
||||
self.backValue(strtemp);
|
||||
|
||||
[self.viewController.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
#pragma mark - UICollectionView
|
||||
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
|
||||
{
|
||||
return 2;
|
||||
return self.arrData.count;
|
||||
}
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
|
||||
{
|
||||
return 5;
|
||||
baseInfoModel *model = self.arrData[section];
|
||||
return model.arrvalue.count;
|
||||
}
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
HuanGeSiLuCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HuanGeSiLuCollectionViewCell" forIndexPath:indexPath];
|
||||
baseInfoModel *model = self.arrData[indexPath.section];
|
||||
NSString *str = model.arrvalue[indexPath.row];
|
||||
cell.lbname.text = str;
|
||||
|
||||
[cell.viewback setBackgroundColor:[UIColor whiteColor]];
|
||||
[cell.lbname setTextColor:RGBCOLOR(51, 51, 51)];
|
||||
if([self.arrselect containsObject:str])
|
||||
{
|
||||
[cell.viewback setBackgroundColor:RGBCOLOR(108, 119, 246)];
|
||||
[cell.lbname setTextColor:[UIColor whiteColor]];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
//定义每个section的间距
|
||||
|
@ -189,7 +250,8 @@
|
|||
if([kind isEqualToString:UICollectionElementKindSectionHeader])
|
||||
{
|
||||
HuanGeSiLuHDCollectionReusableView *header = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HuanGeSiLuHDCollectionReusableView" forIndexPath:indexPath];
|
||||
header.lbname.text = @"亲人";
|
||||
baseInfoModel *model = self.arrData[indexPath.section];
|
||||
header.lbname.text = model.name;
|
||||
|
||||
return header;
|
||||
}
|
||||
|
@ -198,7 +260,103 @@
|
|||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
///做选中操作
|
||||
|
||||
baseInfoModel *model = self.arrData[indexPath.section];
|
||||
NSString *str = model.arrvalue[indexPath.row];
|
||||
if([self.arrselect containsObject:str])
|
||||
{
|
||||
[self.arrselect removeObject:str];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.arrselect addObject:str];
|
||||
}
|
||||
[self.collect reloadData];
|
||||
}
|
||||
|
||||
-(void)getData
|
||||
{
|
||||
self.isDrawEnd = NO;
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_title] forKey:@"title"];
|
||||
[dicpush setObject:[Tools isStringnil:self.sse_type] forKey:@"sse_type"];
|
||||
[dicpush setObject:[Tools isStringnil:[UserInfoModel shareModel].user_stage.name] forKey:@"stage"];
|
||||
[LoadAlterView show];
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",@"switch_outline"] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
NSLog(@"%@",value);
|
||||
if(value.length>10)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:YES];
|
||||
}
|
||||
}
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[HXHud showMessage:errorString afterDelayType:0];
|
||||
} ID:^(NSString * _Nonnull value) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)chuliShuJu:(NSString *)value isfinish:(BOOL)isfinish
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
self.isDrawEnd = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *strshow = [value stringByReplacingOccurrencesOfString:@"# " withString:@"|&&|"];
|
||||
strshow = [strshow stringByReplacingOccurrencesOfString:@"#" withString:@"|&&|"];
|
||||
NSArray *arrtt = [strshow componentsSeparatedByString:@"|&&|"];
|
||||
self.arrData = [NSMutableArray new];
|
||||
for(NSString *strsuper in arrtt)
|
||||
{
|
||||
if(strsuper.length<2)continue;
|
||||
NSString *stritem = [strsuper stringByReplacingOccurrencesOfString:@"* " withString:@"|&&|"];
|
||||
stritem = [stritem stringByReplacingOccurrencesOfString:@"*" withString:@"|&&|"];
|
||||
NSArray *arritem = [stritem componentsSeparatedByString:@"|&&|"];
|
||||
if(arritem.count>1)
|
||||
{
|
||||
baseInfoModel *model = [baseInfoModel new];
|
||||
model.name = [arritem.firstObject stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
NSMutableArray *arrvalue = [NSMutableArray arrayWithArray:arritem];
|
||||
[arrvalue removeObjectAtIndex:0];
|
||||
[arrvalue removeObject:@""];
|
||||
model.arrvalue = arrvalue;
|
||||
if(arrvalue.count>0)
|
||||
{
|
||||
[self.arrData addObject:model];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
///更新高度
|
||||
float fheight = self.arrData.count*47;
|
||||
if(self.arrData.count>2)
|
||||
{
|
||||
fheight=fheight+4-20;
|
||||
}
|
||||
for(baseInfoModel *model in self.arrData)
|
||||
{
|
||||
NSInteger iline = model.arrvalue.count/3;
|
||||
if(model.arrvalue.count%3!=0)iline+=1;
|
||||
fheight+=iline*42;
|
||||
}
|
||||
|
||||
[self.collect mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.offset(fheight);
|
||||
}];
|
||||
|
||||
[self.collect reloadData];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -13,6 +13,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
///
|
||||
@property (nonatomic , strong) NSString *strtitle;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) NSString *stage;
|
||||
@property (nonatomic , strong) NSString *dic_title;
|
||||
@property (nonatomic , strong) NSString *require;
|
||||
///0 1 2
|
||||
@property (nonatomic , strong) NSString *paragraph_type;
|
||||
@property (nonatomic , strong) NSString *technique;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -38,6 +38,12 @@
|
|||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.offset(NavHeight);
|
||||
}];
|
||||
view.stage = self.stage;
|
||||
view.dic_title = self.dic_title;
|
||||
view.require = self.require;
|
||||
view.technique = self.technique;
|
||||
|
||||
view.paragraph_type = self.paragraph_type;///
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,14 @@ typedef void(^DuanLuoXieZuoCellViewBack)(BOOL isend);
|
|||
///
|
||||
@property (nonatomic , strong) NSString *strname;
|
||||
@property (nonatomic , strong) NSString *strvalue;
|
||||
///1个字需要多少s
|
||||
@property (nonatomic , assign) float fspeed;
|
||||
@property (nonatomic , assign) BOOL isWriteEnd;
|
||||
|
||||
///推荐手法
|
||||
@property (nonatomic , strong) NSString *technique;
|
||||
///0 1 2
|
||||
@property (nonatomic , strong) NSString *paragraph_type;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) DuanLuoXieZuoCellViewBack backValue;
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
///
|
||||
@property (nonatomic , strong) ViewLable *lbwz;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) UIButton *btnext;
|
||||
|
||||
@end
|
||||
|
||||
@implementation DuanLuoXieZuoCellView
|
||||
|
@ -44,6 +47,7 @@
|
|||
}];
|
||||
[btnext setIconInRight];
|
||||
[btnext setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
|
||||
_btnext = btnext;
|
||||
|
||||
UIView *viewback = [[UIView alloc] init];
|
||||
[viewback setBackgroundColor:RGBCOLOR(240, 241, 254)];
|
||||
|
@ -65,13 +69,9 @@
|
|||
}];
|
||||
lbwz.textColor = RGBCOLOR(61, 61, 61);
|
||||
lbwz.textFont = [UIFont systemFontOfSize:14];
|
||||
lbwz.fspeed = 0.02;
|
||||
_lbwz = lbwz;
|
||||
[lbwz setBackHeight:^(float fheight, BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
self.backValue(YES);
|
||||
}
|
||||
self.backValue(isend);
|
||||
}];
|
||||
|
||||
UILabel *lbnumber = [[UILabel alloc] init];
|
||||
|
@ -128,7 +128,14 @@
|
|||
}];
|
||||
return lbname;
|
||||
}
|
||||
|
||||
-(void)setIsWriteEnd:(BOOL)isWriteEnd
|
||||
{
|
||||
self.lbwz.isWriteEnd = isWriteEnd;
|
||||
}
|
||||
-(void)setFspeed:(float)fspeed
|
||||
{
|
||||
self.lbwz.fspeed = fspeed;
|
||||
}
|
||||
-(void)setStrname:(NSString *)strname
|
||||
{
|
||||
self.lbname.text = strname;
|
||||
|
@ -137,13 +144,25 @@
|
|||
{
|
||||
_strvalue = strvalue;
|
||||
self.lbwz.strValue = strvalue;
|
||||
self.lbwz.isWriteEnd = YES;
|
||||
|
||||
[self.lbnumber setText:[NSString stringWithFormat:@"%@ %ld字",self.technique,strvalue.length]];
|
||||
}
|
||||
-(void)setParagraph_type:(NSString *)paragraph_type
|
||||
{
|
||||
_paragraph_type = paragraph_type;
|
||||
if(self.paragraph_type.intValue>0)
|
||||
{
|
||||
[self.btnext setHidden:YES];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)nextAction
|
||||
{
|
||||
DuanLuoXieZuoQWViewController *vc = [DuanLuoXieZuoQWViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
if(self.paragraph_type.intValue==0)
|
||||
{///开头段落续写
|
||||
DuanLuoXieZuoQWViewController *vc = [DuanLuoXieZuoQWViewController new];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,6 +10,13 @@
|
|||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface DuanLuoXieZuoView : UIView
|
||||
///
|
||||
@property (nonatomic , strong) NSString *stage;
|
||||
@property (nonatomic , strong) NSString *dic_title;
|
||||
@property (nonatomic , strong) NSString *require;
|
||||
///0 1 2
|
||||
@property (nonatomic , strong) NSString *paragraph_type;
|
||||
@property (nonatomic , strong) NSString *technique;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -8,11 +8,34 @@
|
|||
#import "DuanLuoXieZuoView.h"
|
||||
#import "DuanLuoXieZuoCellView.h"
|
||||
|
||||
#import "SSENetWorkManager.h"
|
||||
#import "RoleTreeModel.h"
|
||||
|
||||
@interface DuanLuoXieZuoView ()
|
||||
|
||||
#import "SSEDrawListTextModel.h"
|
||||
|
||||
@interface DuanLuoXieZuoView ()<UIScrollViewDelegate>
|
||||
///
|
||||
@property (nonatomic , strong) UIScrollView *scvback;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) SSEConfigModel *modelConfig;
|
||||
///
|
||||
@property (nonatomic , strong) NSMutableArray *arrdata;
|
||||
|
||||
@property (nonatomic , assign) BOOL isStartDrawText;
|
||||
@property (nonatomic , assign) BOOL isdrawEnd;
|
||||
///
|
||||
@property (nonatomic , strong) NSTimer *timerDraw;
|
||||
|
||||
@property (nonatomic , assign) int iDraw;
|
||||
///
|
||||
@property (nonatomic , strong) UIView *viewDarwLast;
|
||||
@property (nonatomic , assign) BOOL isDragging;
|
||||
|
||||
///
|
||||
@property (nonatomic , strong) MASConstraint *scrollBottom;
|
||||
|
||||
@end
|
||||
|
||||
@implementation DuanLuoXieZuoView
|
||||
|
@ -23,6 +46,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);
|
||||
|
@ -31,7 +55,6 @@
|
|||
}];
|
||||
_scvback = scvback;
|
||||
|
||||
[self drawinfo];
|
||||
|
||||
UIButton *btcreate = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 160, 50)];
|
||||
[btcreate setTitle:@"再生成3段" forState:UIControlStateNormal];
|
||||
|
@ -48,29 +71,222 @@
|
|||
}];
|
||||
[btcreate addTarget:self action:@selector(createAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[Tools changedView:btcreate colors:MainJBColors startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)drawinfo
|
||||
-(DuanLuoXieZuoCellView *)drawinfo:(UIView *)viewlast
|
||||
{
|
||||
DuanLuoXieZuoCellView *viewitem = [DuanLuoXieZuoCellView new];
|
||||
[self.scvback addSubview:viewitem];
|
||||
[viewitem mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.offset(20);
|
||||
make.top.offset(20);
|
||||
if(viewlast)
|
||||
{
|
||||
make.top.equalTo(viewlast.mas_bottom).offset(15);
|
||||
}
|
||||
else
|
||||
{
|
||||
make.top.offset(20);
|
||||
}
|
||||
make.width.equalTo(self.scvback).offset(-40);
|
||||
}];
|
||||
viewitem.strname = @"结果一";
|
||||
viewitem.strvalue = @"阳光透过茂密的树叶,洒在我的帐篷上。我睁开眼睛,闻到了清新的泥土味和远处溪水的声音。这是我第一次露营,心情无比激动。";
|
||||
[viewitem setBackValue:^(BOOL isend) {
|
||||
|
||||
viewitem.technique = self.technique;
|
||||
viewitem.paragraph_type = self.paragraph_type;
|
||||
// viewitem.strname = @"结果一";
|
||||
// viewitem.strvalue = @"阳光透过茂密的树叶,洒在我的帐篷上。我睁开眼睛,闻到了清新的泥土味和远处溪水的声音。这是我第一次露营,心情无比激动。";
|
||||
// [viewitem setBackValue:^(BOOL isend) {
|
||||
//
|
||||
// }];
|
||||
if(self.scrollBottom)
|
||||
{
|
||||
[self.scrollBottom uninstall];
|
||||
}
|
||||
[self.scvback mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
self.scrollBottom = make.bottom.equalTo(viewitem).offset(20);
|
||||
}];
|
||||
|
||||
return viewitem;
|
||||
}
|
||||
|
||||
-(void)setParagraph_type:(NSString *)paragraph_type
|
||||
{
|
||||
_paragraph_type = paragraph_type;
|
||||
self.iDraw = 0;
|
||||
self.arrdata = [NSMutableArray new];
|
||||
[self addValues];
|
||||
[self getdata];
|
||||
}
|
||||
-(void)addValues
|
||||
{
|
||||
for(int i = 0 ; i < 3; i++)
|
||||
{
|
||||
SSEDrawListTextModel *model = [SSEDrawListTextModel new];
|
||||
model.title = [NSString stringWithFormat:@"结果%@",[Tools convertNumberToUppercase:self.arrdata.count+1]];
|
||||
[self.arrdata addObject:model];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)createAction
|
||||
{
|
||||
if(self.isdrawEnd==NO)
|
||||
{
|
||||
[HXHud showMessage:@"请等待写作完成" afterDelayType:0];
|
||||
return;
|
||||
}
|
||||
self.iDraw = (int)self.arrdata.count;
|
||||
[self addValues];
|
||||
[self getdata];
|
||||
}
|
||||
|
||||
-(void)getdata
|
||||
{
|
||||
self.isdrawEnd = NO;
|
||||
self.isStartDrawText = NO;
|
||||
[LoadAlterView show];
|
||||
NSString *scenct = @"write_content";
|
||||
if(self.paragraph_type.intValue==2)
|
||||
{
|
||||
scenct = @"write_ending";
|
||||
}
|
||||
NSMutableDictionary *dicpush = [NSMutableDictionary new];
|
||||
[dicpush setObject:[Tools isStringnil:self.stage] forKey:@"stage"];
|
||||
[dicpush setObject:[Tools isStringnil:self.dic_title] forKey:@"title"];
|
||||
[dicpush setObject:[Tools isStringnil:self.require] forKey:@"require"];
|
||||
[dicpush setObject:[NSNumber numberWithInt:self.paragraph_type.intValue] forKey:@"paragraph_type"];
|
||||
[dicpush setObject:[Tools isStringnil:self.technique] forKey:@"technique"];
|
||||
|
||||
[[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",scenct] dicpush:dicpush config:^(SSEConfigModel * _Nonnull config) {
|
||||
[LoadAlterView dismiss];
|
||||
self.modelConfig = config;
|
||||
} backValue:^(NSString * _Nonnull value, BOOL isfinish) {
|
||||
if(value.length>5)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isfinish)
|
||||
{
|
||||
[self chuliShuJu:value isfinish:YES];
|
||||
}
|
||||
}
|
||||
} error:^(NSString * _Nonnull errorString) {
|
||||
[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:@"|&&|"];
|
||||
if([[strshow substringWithRange:NSMakeRange(0, 4)] isEqualToString:@"|&&|"])
|
||||
{
|
||||
strshow = [strshow substringFromIndex:4];
|
||||
}
|
||||
NSArray *arrlist = [strshow componentsSeparatedByString:@"|&&|"];
|
||||
SSEDrawListTextModel *modellast;
|
||||
for(int i = 0 ; i < arrlist.count;i++)
|
||||
{
|
||||
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.timerDraw = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(drawTextInfo) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop mainRunLoop] addTimer:self.timerDraw forMode:NSRunLoopCommonModes];
|
||||
[self drawTextInfo];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
-(void)drawTextInfo
|
||||
{
|
||||
if(self.iDraw>=self.arrdata.count)
|
||||
{
|
||||
[self.timerDraw invalidate];
|
||||
self.timerDraw = nil;
|
||||
self.isdrawEnd = YES;
|
||||
return;
|
||||
}
|
||||
SSEDrawListTextModel *model = self.arrdata[self.iDraw];
|
||||
if(model.value.length==0)
|
||||
{
|
||||
self.iDraw++;
|
||||
[self drawTextInfo];
|
||||
return;
|
||||
}
|
||||
|
||||
DuanLuoXieZuoCellView *lbwz;
|
||||
if(model.view==nil)
|
||||
{
|
||||
lbwz = [self drawinfo:self.viewDarwLast];
|
||||
if(self.modelConfig.time.intValue>0)
|
||||
{
|
||||
lbwz.fspeed = self.modelConfig.time.intValue/1000.0;
|
||||
}
|
||||
[lbwz setBackValue:^(BOOL isend) {
|
||||
if(isend)
|
||||
{
|
||||
self.iDraw+=1;
|
||||
}
|
||||
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.view = lbwz;
|
||||
}
|
||||
else
|
||||
{
|
||||
lbwz = model.view;
|
||||
}
|
||||
lbwz.strvalue = model.value;
|
||||
lbwz.strname = model.title;
|
||||
lbwz.isWriteEnd = model.isaddEnd;
|
||||
|
||||
// NSLog(@"%@",model.value);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIScrollView
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
self.isDragging = YES;
|
||||
}
|
||||
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
|
||||
{
|
||||
self.isDragging = NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue