diff --git a/ProductApp/ProductApp.xcodeproj/project.pbxproj b/ProductApp/ProductApp.xcodeproj/project.pbxproj index b145d1f..1ef7bf6 100644 --- a/ProductApp/ProductApp.xcodeproj/project.pbxproj +++ b/ProductApp/ProductApp.xcodeproj/project.pbxproj @@ -64,6 +64,9 @@ CA0FD6A42CA8FF5C009A4417 /* FXWDPFView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0FD6A32CA8FF5C009A4417 /* FXWDPFView.m */; }; CA0FD6A82CA900E2009A4417 /* FXTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0FD6A72CA900E2009A4417 /* FXTextView.m */; }; CA0FD6AC2CA924A1009A4417 /* FXXieZuoJianYiView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0FD6AB2CA924A1009A4417 /* FXXieZuoJianYiView.m */; }; + CA10DF982CC74FC70094FEEE /* SSEConfigModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CA10DF972CC74FC70094FEEE /* SSEConfigModel.m */; }; + CA10DF9B2CC77D0F0094FEEE /* SSEDrawModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CA10DF9A2CC77D0F0094FEEE /* SSEDrawModel.m */; }; + CA10DF9E2CC7AC040094FEEE /* ExamplePicModel.m in Sources */ = {isa = PBXBuildFile; fileRef = CA10DF9D2CC7AC040094FEEE /* ExamplePicModel.m */; }; CA11ED5A2CA648AB00209DFC /* CamreTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA11ED592CA648AB00209DFC /* CamreTypeView.m */; }; CA11ED5D2CA653F600209DFC /* CamreImagesView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA11ED5C2CA653F600209DFC /* CamreImagesView.m */; }; CA11ED612CA6556900209DFC /* CamreImagesCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CA11ED602CA6556900209DFC /* CamreImagesCollectionViewCell.m */; }; @@ -600,6 +603,12 @@ CA0FD6A72CA900E2009A4417 /* FXTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FXTextView.m; sourceTree = ""; }; CA0FD6AA2CA924A1009A4417 /* FXXieZuoJianYiView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FXXieZuoJianYiView.h; sourceTree = ""; }; CA0FD6AB2CA924A1009A4417 /* FXXieZuoJianYiView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FXXieZuoJianYiView.m; sourceTree = ""; }; + CA10DF962CC74FC70094FEEE /* SSEConfigModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SSEConfigModel.h; sourceTree = ""; }; + CA10DF972CC74FC70094FEEE /* SSEConfigModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SSEConfigModel.m; sourceTree = ""; }; + CA10DF992CC77D0F0094FEEE /* SSEDrawModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SSEDrawModel.h; sourceTree = ""; }; + CA10DF9A2CC77D0F0094FEEE /* SSEDrawModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SSEDrawModel.m; sourceTree = ""; }; + CA10DF9C2CC7AC040094FEEE /* ExamplePicModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExamplePicModel.h; sourceTree = ""; }; + CA10DF9D2CC7AC040094FEEE /* ExamplePicModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExamplePicModel.m; sourceTree = ""; }; CA11ED582CA648AB00209DFC /* CamreTypeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CamreTypeView.h; sourceTree = ""; }; CA11ED592CA648AB00209DFC /* CamreTypeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CamreTypeView.m; sourceTree = ""; }; CA11ED5B2CA653F600209DFC /* CamreImagesView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CamreImagesView.h; sourceTree = ""; }; @@ -2987,6 +2996,10 @@ CA07CD192CC6335400AF41ED /* ExampleCorrectList.m */, CA07CD1B2CC646AA00AF41ED /* ExampleWriteList.h */, CA07CD1C2CC646AA00AF41ED /* ExampleWriteList.m */, + CA10DF962CC74FC70094FEEE /* SSEConfigModel.h */, + CA10DF972CC74FC70094FEEE /* SSEConfigModel.m */, + CA10DF9C2CC7AC040094FEEE /* ExamplePicModel.h */, + CA10DF9D2CC7AC040094FEEE /* ExamplePicModel.m */, ); path = models; sourceTree = ""; @@ -3442,6 +3455,8 @@ CB489E0B2744A0BC00DA044A /* YQLocationTransform.m */, CA81818C2C9E60B100EE7E6E /* ViewLable.h */, CA81818D2C9E60B100EE7E6E /* ViewLable.m */, + CA10DF992CC77D0F0094FEEE /* SSEDrawModel.h */, + CA10DF9A2CC77D0F0094FEEE /* SSEDrawModel.m */, CA8181A52C9EAB8700EE7E6E /* PGJUILabel.h */, CA8181A62C9EAB8700EE7E6E /* PGJUILabel.m */, CA0D087D2CA55E5C0086855E /* JJGradientLabel.h */, @@ -4419,11 +4434,13 @@ CA5D035E2CC0DE8D007B3BA5 /* YaoQingAlterView.m in Sources */, CA4257AA2CA2A30C00A36A10 /* StartZNPPTYuLanViewController.m in Sources */, CB489F9D2744A0BD00DA044A /* AssistiveView.m in Sources */, + CA10DF9B2CC77D0F0094FEEE /* SSEDrawModel.m in Sources */, CABA14CB2C9D4395002CB3B1 /* GTMBases64.m in Sources */, CB489FA02744A0BD00DA044A /* UIView+ZJFrame.m in Sources */, CABA148D2C9D4312002CB3B1 /* PublicNetWorkManager.m in Sources */, CA11ED742CA69AC600209DFC /* GaiXieRunSeViewController.m in Sources */, CAB0F3602CAA84B3003B0C39 /* XieZuoXiangQingViewController.m in Sources */, + CA10DF9E2CC7AC040094FEEE /* ExamplePicModel.m in Sources */, CA4257A02CA299F900A36A10 /* StartZNPPTDaGangView.m in Sources */, CA5D02A32CC0B2DE007B3BA5 /* PeiZhiShowViewController.m in Sources */, CA5D02AC2CC0B2DE007B3BA5 /* SetViewController.m in Sources */, @@ -4691,6 +4708,7 @@ CABD8C752CBF61BB009A5E5E /* GongJuCreateSuperView.m in Sources */, CA0FD69D2CA8F907009A4417 /* FenXiangHaiBaoInfoSuperView.m in Sources */, CB489F782744A0BD00DA044A /* NSBundle+DAUtils.m in Sources */, + CA10DF982CC74FC70094FEEE /* SSEConfigModel.m in Sources */, CB489F4C2744A0BD00DA044A /* AddressListUrlAlterView.m in Sources */, CABA14DD2C9D6E40002CB3B1 /* NetWorkManager.m in Sources */, CA5D02772CC09DA4007B3BA5 /* MyViewTableViewCell.m in Sources */, diff --git a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate index 34e4cb0..265ba73 100644 Binary files a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate and b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 15d8537..d38a636 100644 --- a/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/ProductApp/ProductApp.xcworkspace/xcuserdata/gongzuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -78,8 +78,8 @@ filePath = "ProductApp/ProductMain/NetWorkManager/NetWorkManager.m" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "269" - endingLineNumber = "269" + startingLineNumber = "307" + endingLineNumber = "307" landmarkName = "+requestToolsListData:page:type_id:tool_name:is_recommend:Callback:" landmarkType = "7"> @@ -132,51 +132,5 @@ landmarkType = "7"> - - - - - - - - - - diff --git a/ProductApp/ProductApp/Other/SSEDrawModel.h b/ProductApp/ProductApp/Other/SSEDrawModel.h new file mode 100644 index 0000000..f9f74ab --- /dev/null +++ b/ProductApp/ProductApp/Other/SSEDrawModel.h @@ -0,0 +1,28 @@ +// +// SSEDrawModel.h +// ProductApp +// +// Created by 工作 on 2024/10/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SSEDrawModel : NSObject +/// +@property (nonatomic , strong) NSString *title; +///是否绘制了titile +@property (nonatomic , assign) BOOL isDrawTitle; +///子类文本数据 +@property (nonatomic , strong) NSArray *arrSon; +///当前绘制的子类tag +@property (nonatomic , assign) NSInteger idrawtag; +///绘制的ViewLable +@property (nonatomic , strong) NSMutableArray *arrViewLable; +///是否获取数据完成 +@property (nonatomic , assign) BOOL isaddEnd; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/Other/SSEDrawModel.m b/ProductApp/ProductApp/Other/SSEDrawModel.m new file mode 100644 index 0000000..56bd456 --- /dev/null +++ b/ProductApp/ProductApp/Other/SSEDrawModel.m @@ -0,0 +1,12 @@ +// +// SSEDrawModel.m +// ProductApp +// +// Created by 工作 on 2024/10/22. +// + +#import "SSEDrawModel.h" + +@implementation SSEDrawModel + +@end diff --git a/ProductApp/ProductApp/Other/ViewLable.h b/ProductApp/ProductApp/Other/ViewLable.h index b9a9767..d1ae6cb 100644 --- a/ProductApp/ProductApp/Other/ViewLable.h +++ b/ProductApp/ProductApp/Other/ViewLable.h @@ -6,7 +6,7 @@ // #import - +#import "SSEDrawModel.h" NS_ASSUME_NONNULL_BEGIN typedef void(^ViewLableBackHeight)(float fheight,BOOL isend); @interface ViewLable : UIView @@ -20,6 +20,11 @@ typedef void(^ViewLableBackHeight)(float fheight,BOOL isend); @property (nonatomic , assign) float fspeed; ///是否关闭动画写入 @property (nonatomic , assign) BOOL isCloseAnimation; +///是否写入完成 +@property (nonatomic , assign) BOOL isWriteEnd; + +///在尾部添加数据 +@property (nonatomic , strong) NSString *appendString; /// @property (nonatomic , strong) ViewLableBackHeight backHeight; diff --git a/ProductApp/ProductApp/Other/ViewLable.m b/ProductApp/ProductApp/Other/ViewLable.m index 1bfcbe9..c976eaa 100644 --- a/ProductApp/ProductApp/Other/ViewLable.m +++ b/ProductApp/ProductApp/Other/ViewLable.m @@ -50,8 +50,12 @@ make.left.right.top.equalTo(self); }]; _lbname = lbname; +// [self mas_makeConstraints:^(MASConstraintMaker *make) { +// make.height.offset(18); +// }]; + [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.offset(18); + make.bottom.equalTo(lbname); }]; UIImageView *imgvb = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)]; @@ -106,26 +110,44 @@ [self showText]; } } +-(void)setAppendString:(NSString *)appendString +{ + NSString *strtemp =@""; + if(self.strValue==nil) + { + strtemp = [[NSString alloc] initWithString:appendString]; + } + else + { + strtemp = [NSString stringWithFormat:@"%@%@",self.strValue,appendString]; + } + [self setStrValue:strtemp]; +} -(void)showText { - [self endAction]; - [self.imgvb setHidden:NO]; - self.inow = 0; - NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:self.fspeed>0?self.fspeed:0.02 target:self selector:@selector(textSpeedAppend) userInfo:nil repeats:YES]; - _timer = timer; - [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; + if(self.timer==nil) + { + [self endAction]; + [self.imgvb setHidden:NO]; + self.inow = 0; + NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:self.fspeed>0?self.fspeed:0.02 target:self selector:@selector(textSpeedAppend) userInfo:nil repeats:YES]; + _timer = timer; + [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; + } } -(void)textSpeedAppend { - if(self.inow+1>self.strValue.length) + if(self.inow+1>self.strValue.length && self.isWriteEnd==YES) { [self.timer invalidate]; self.timer = nil; [self.imgvb setHidden:YES]; - self.backHeight(self.height,YES); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.backHeight(self.height,YES); + }); return; } - + if(self.inow+1>self.strValue.length)return; NSString *str = [self.strValue substringToIndex:self.inow]; ///行间距 NSMutableParagraphStyle *style = [NSMutableParagraphStyle new]; @@ -141,9 +163,9 @@ self.inow++; float fheight = [Tools getLabelHeightWithText:self.lbname.text width:self.width font:self.lbname.font.pointSize linHeight:5]+1; - [self mas_updateConstraints:^(MASConstraintMaker *make) { - make.height.offset(fheight); - }]; +// [self mas_updateConstraints:^(MASConstraintMaker *make) { +// make.height.offset(fheight); +// }]; self.backHeight(fheight,NO); CGPoint point = [self boundingRectForLastCharacterInLabel:self.lbname]; @@ -153,35 +175,10 @@ } -// NSLog(@"%@",NSStringFromCGPoint(point)); - } - (CGPoint)boundingRectForLastCharacterInLabel:(UILabel *)label { NSString *text = label.text; -// -// NSMutableParagraphStyle *style = [NSMutableParagraphStyle new]; -// style.lineSpacing = 5; -// style.lineBreakMode = NSLineBreakByWordWrapping; -// style.alignment = NSTextAlignmentLeft; -// -// NSDictionary *attributes = @{NSFontAttributeName: label.font,NSParagraphStyleAttributeName:style}; // 设置字体属性 -// -// CGRect sz = [text boundingRectWithSize:CGSizeMake(MAXFLOAT, 20) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil]; -// -// CGRect linesSz = [text boundingRectWithSize:CGSizeMake(label.frame.size.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil]; -// -// [text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 20) lineBreakMode:NSLineBreakByWordWrapping]; -// -// CGPoint lastPoint; -// if(sz.size.height>=linesSz.size.height) -// { -// lastPoint = CGPointMake(label.frame.origin.x+sz.size.width, label.frame.origin.y+9); -// } -// else -// { -// lastPoint = CGPointMake(label.frame.origin.x+(int)sz.size.width%(int)linesSz.size.width, linesSz.size.height-sz.size.height+9); -// } - + [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); diff --git a/ProductApp/ProductApp/ProductMain/AIChart/cell/AIChatTextTableViewCell.m b/ProductApp/ProductApp/ProductMain/AIChart/cell/AIChatTextTableViewCell.m index f038ead..6df9265 100644 --- a/ProductApp/ProductApp/ProductMain/AIChart/cell/AIChatTextTableViewCell.m +++ b/ProductApp/ProductApp/ProductMain/AIChart/cell/AIChatTextTableViewCell.m @@ -189,7 +189,7 @@ self.lbvalueright.isCloseAnimation = !model.isAnimation; self.lbvalueright.strValue = strtext; - + self.lbvalueright.isWriteEnd = YES; } else { @@ -242,6 +242,7 @@ self.lbvalueLeft.isCloseAnimation = !model.isAnimation; self.lbvalueLeft.strValue = model.text; + self.lbvalueLeft.isWriteEnd = YES; } } diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h index 034e136..27d32a7 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.h @@ -14,6 +14,8 @@ #import "TextbookDetailModel.h" #import "ExampleCorrectList.h" #import "ExampleWriteList.h" +#import "ExamplePicModel.h" + NS_ASSUME_NONNULL_BEGIN @@ -67,6 +69,17 @@ NS_ASSUME_NONNULL_BEGIN role_id:(NSString *)role_id Callback:(completeModeBlock)callback; +/* + 拍图例文 + /api/example/pic + scene + role_id + */ ++ (void)requestExamplePicData:(UIView *)view + role_id:(NSString *)role_id + scene:(NSString *)scene + Callback:(completeModeBlock)callback; + /* 工具类型 /api/tools/type diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m index 50dbfc1..8fa07f1 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/NetWorkManager.m @@ -193,6 +193,44 @@ }]; } +/* + 拍图例文 + /api/example/pic + scene + role_id + */ ++ (void)requestExamplePicData:(UIView *)view + role_id:(NSString *)role_id + scene:(NSString *)scene + Callback:(completeModeBlock)callback +{ + NSMutableDictionary *dicQuery = [NSMutableDictionary new]; + [dicQuery setObject:[Tools isStringnil:role_id] forKey:@"role_id"]; + [dicQuery setObject:[Tools isStringnil:scene] forKey:@"scene"]; + + NSMutableDictionary *dicHeader = [NSMutableDictionary new]; + + NSMutableDictionary *dicpush = [NSMutableDictionary new]; + + [YSAPIClient requestWithRequestBaseUrl:BaseUrl Type:1 url:@"api/example/pic" 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,[ExamplePicModel yy_modelWithJSON:dicAll],describle); + } + }]; +} + /* 工具类型 diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.h index 1d74e40..6aca016 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.h +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.h @@ -7,11 +7,19 @@ #import #import "YSAPIClient.h" + +#import "SSEConfigModel.h" + NS_ASSUME_NONNULL_BEGIN +typedef void(^SSENetWorkManagerBackStringValue)(NSString *value,BOOL isfinish); +typedef void(^SSENetWorkManagerBackConfigValue)(SSEConfigModel *config); +typedef void(^SSENetWorkManagerBackErrorValue)(NSString *errorString); + +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; +- (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; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.m index a4622e6..c60f3c2 100644 --- a/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.m +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/SSENetWorkManager.m @@ -8,7 +8,20 @@ #import "SSENetWorkManager.h" -@interface SSENetWorkManager () +@interface SSENetWorkManager () + +/// +@property (nonatomic , strong) NSMutableString *strAll; +@property (nonatomic , strong) NSMutableString *strAllValue; +/// +@property (nonatomic , strong) SSEConfigModel *modelConfig; + +/// +@property (nonatomic , strong) SSENetWorkManagerBackConfigValue backConfig; +@property (nonatomic , strong) SSENetWorkManagerBackStringValue backValue; +@property (nonatomic , strong) SSENetWorkManagerBackErrorValue backError; +@property (nonatomic , strong) SSENetWorkManagerBackIDValue backID; + @end @implementation SSENetWorkManager @@ -21,15 +34,26 @@ }); return _instance; } -- (void)requestTo:(NSString*)host stage:(NSString *)stage title:(NSString *)title require:(NSString *)require title_id:(NSString *)title_id +- (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; { - NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] delegate:self delegateQueue:nil]; + self.backConfig = config; + self.backValue = backValue; + self.backError = error; + self.backID = ID; + + self.modelConfig = nil; + + 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"]; - [dicpush setObject:[Tools isStringnil:title_id] forKey:@"title_id"]; + if(title_id.length>0) + { + [dicpush setObject:[Tools isStringnil:title_id] forKey:@"title_id"]; + } + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:host]]; @@ -45,7 +69,6 @@ [request setValue:[Tools isStringnil:[dicheadertemp objectForKey:key]] forHTTPHeaderField:key]; } - NSString *strtoken = [UserInfoModel shareModel].token; if([Tools isStringnil:strtoken].length==0) { @@ -63,42 +86,131 @@ NSURLSessionDataTask *task = [session dataTaskWithRequest:request]; - -// NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { -// if(error) -// { -// return; -// } -// -// NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; -// if(httpResponse.statusCode != 200)return; -// -// if([httpResponse.MIMEType isEqualToString:@"text/event-stream"]) -// { -// NSString *strtemp = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; -// NSLog(@"%@",strtemp); -// } -// }]; // 启动任务 [task resume]; + } #pragma mark - NSURLSessionDelegate -- (void)URLSession:(NSURLSession *)session didBecomeInvalidWithError:(nullable NSError *)error -{ +// 接收到服务器的响应 +- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler { + + /* + 需要使用 completionHandler 回调告诉系统应该如何处理服务器返回的数据,默认是取消的。 + + NSURLSessionResponseCancel = 0, 默认的处理方式,取消 + NSURLSessionResponseAllow = 1, 接收服务器返回的数据 + NSURLSessionResponseBecomeDownload = 2, 变成一个下载请求 + NSURLSessionResponseBecomeStream 变成一个流 + */ +// NSLog(@""); + self.strAll = [NSMutableString new]; + self.strAllValue = [NSMutableString new]; + // 接收服务器返回的数据 + completionHandler(NSURLSessionResponseAllow); +} + +// 接收到服务器数据 +- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { + NSString *strtemp = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"%@",strtemp); + [self.strAll appendString:strtemp]; + NSString *stralltemp = self.strAll; + + ///错误信息 + NSRange rangeStop = [stralltemp rangeOfString:@"event:stop"]; + if(rangeStop.length != 0) + {///错误信息 字符串 + rangeStop = [stralltemp rangeOfString:@"data:"]; + if(rangeStop.length!=0) + { + NSString *strvalue = [stralltemp substringFromIndex:rangeStop.location+rangeStop.length]; + self.backError(strvalue); + [dataTask cancel]; + return; + } + } + + ///配置信息 + NSRange range = [stralltemp rangeOfString:@"event:config"]; + if(range.length != 0) + {///配置信息 {"model":"qwen-plus","time":"20"} + range = [stralltemp rangeOfString:@"data:"]; + + NSRange rangeEnd = [stralltemp rangeOfString:@"}"]; + if(range.length!=0) + { + NSString *strValue = [stralltemp substringWithRange:NSMakeRange(range.location+range.length, rangeEnd.location+1-range.location-range.length)]; + stralltemp = [stralltemp substringFromIndex:rangeEnd.location+1]; + if(!self.modelConfig) + { + self.modelConfig = [SSEConfigModel yy_modelWithJSON:strValue]; + self.backConfig(self.modelConfig); + } + } + } + NSMutableString *strAllTemp = [NSMutableString new]; + ///内容和ID + NSArray *arrMessage = [stralltemp componentsSeparatedByString:@"event:message"]; + for(NSString *str in arrMessage) + { + if(str.length==0)continue; + + NSArray *arrtemp = [str componentsSeparatedByString:@"event:"]; + BOOL islastid = [str containsString:@"event:"]; + for(int i = 0 ; i < arrtemp.count; i++) + { + NSString *strson = arrtemp[i]; + if(strson.length==0)continue; + + NSRange rangeMessage = [strson rangeOfString:@"data:"]; + if(rangeMessage.length>0) + { + NSArray *arrdatatmep = [strson componentsSeparatedByString:@"data:"]; + for(int j=0;j *)modelCustomPropertyMapper +{ + return @{@"ID" : @"id"}; +} +@end +@implementation ExamplePicModelDataItemsResult + +@end diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/SSEConfigModel.h b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/SSEConfigModel.h new file mode 100644 index 0000000..7a9b1fc --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/SSEConfigModel.h @@ -0,0 +1,19 @@ +// +// SSEConfigModel.h +// ProductApp +// +// Created by 工作 on 2024/10/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SSEConfigModel : NSObject +///、、、qwen-plus +@property (nonatomic , strong) NSString *model; +///毫秒 +@property (nonatomic , strong) NSString *time; +@end + +NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/NetWorkManager/models/SSEConfigModel.m b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/SSEConfigModel.m new file mode 100644 index 0000000..d5b0b51 --- /dev/null +++ b/ProductApp/ProductApp/ProductMain/NetWorkManager/models/SSEConfigModel.m @@ -0,0 +1,12 @@ +// +// SSEConfigModel.m +// ProductApp +// +// Created by 工作 on 2024/10/22. +// + +#import "SSEConfigModel.h" + +@implementation SSEConfigModel + +@end diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/StartPZXZViewController.m b/ProductApp/ProductApp/ProductMain/引导/拍照写作/StartPZXZViewController.m index 51dd7ce..a251546 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/StartPZXZViewController.m +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/StartPZXZViewController.m @@ -7,7 +7,7 @@ #import "StartPZXZViewController.h" #import "StartPZXZView.h" - +#import "NetWorkManager.h" @interface StartPZXZViewController () @@ -21,7 +21,7 @@ - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController setNavigationBarHidden:YES animated:NO]; - [self showNaviGationView:YES]; + [self.navigationView setHidden:YES]; [self.view setBackgroundColor:[UIColor blackColor]]; StartPZXZView *view = [[StartPZXZView alloc] init]; @@ -29,7 +29,20 @@ [view mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.view); }]; - + [view setHidden:YES]; + [LoadAlterView show]; + [NetWorkManager requestExamplePicData:self.view role_id:[Tools isStringnil:self.strpid].length>0?self.strpid:self.role_id scene:@"" Callback:^(BOOL state, ExamplePicModel *responseObject, NSString * _Nullable describle) { + [LoadAlterView dismiss]; + if(state) + { + view.arrdataYD = responseObject.data.items; + [view setHidden:NO]; + } + else + { + [HXHud showMessage:responseObject.message afterDelayType:1]; + } + }]; } @end diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.h b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.h index 388488a..c68c5b1 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.h +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.h @@ -6,12 +6,13 @@ // #import - +#import "ExamplePicModel.h" NS_ASSUME_NONNULL_BEGIN @interface StartPZXZPageView : UIView @property (nonatomic , assign) CGSize yidongsize; - +/// +@property (nonatomic , strong) ExamplePicModelDataItems *model; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.m b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.m index e69f159..b3ddd8a 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.m +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZPageView.m @@ -32,7 +32,6 @@ _scvback = scvback; UIImageView *imgvback = [[UIImageView alloc] init]; - [imgvback setImage:[UIImage imageNamed:@"yd_nomoxiangji"]]; [imgvback setContentMode:UIViewContentModeScaleAspectFit]; [scvback addSubview:imgvback]; [imgvback mas_makeConstraints:^(MASConstraintMaker *make) { @@ -45,6 +44,18 @@ } return self; } +-(void)setModel:(ExamplePicModelDataItems *)model +{ + _model = model; + if(model.image.count>0) + { + [self.imgvback sd_setImageWithURL:[NSURL URLWithString:model.image.firstObject] placeholderImage:nil]; + } + else + { + [self.imgvback setImage:[UIImage imageNamed:@"yd_nomoxiangji"]]; + } +} ///去小数点后1 x y -(void)setYidongsize:(CGSize)yidongsize { diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.h b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.h index ec139bf..f7ca107 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.h +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.h @@ -10,7 +10,8 @@ NS_ASSUME_NONNULL_BEGIN @interface StartPZXZView : UIView - +/// +@property (nonatomic , strong) NSArray *arrdataYD; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.m b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.m index 9aa3905..ff6a894 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.m +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/view/StartPZXZView.m @@ -37,7 +37,6 @@ [self addSubview:scvback]; [scvback setPagingEnabled:YES]; [scvback setShowsHorizontalScrollIndicator:NO]; - [scvback setContentSize:CGSizeMake(UISCREEN_WIDTH*3, 0)]; _scvback = scvback; if (@available(iOS 11.0, *)) { scvback.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; @@ -45,27 +44,6 @@ self.viewController.automaticallyAdjustsScrollViewInsets =NO; } - self.arrView = [NSMutableArray new]; - for(int i = 0 ; i < 3; i++) - { - StartPZXZPageView *viewitem = [StartPZXZPageView new]; - [scvback addSubview:viewitem]; - [viewitem mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.height.width.equalTo(scvback); - make.left.offset(UISCREEN_WIDTH*i); - }]; - [self.arrView addObject:viewitem]; - } - - - UIView *viewbottom = [[UIView alloc] init]; - [self addSubview:viewbottom]; - [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.bottom.equalTo(self); - make.top.equalTo(scvback.mas_bottom); - }]; - [self drawBottomView:viewbottom]; - [self tuoluo]; } return self; } @@ -73,7 +51,7 @@ -(void)drawBottomView:(UIView *)view { float f_width = 90; - NSArray *arrtop = @[@"改写作文",@"拍题成文",@"拍照续写"]; + NSArray *arrtop = self.arrdataYD; UIView *viewback = [[UIView alloc] init]; [view addSubview:viewback]; [viewback mas_makeConstraints:^(MASConstraintMaker *make) { @@ -85,8 +63,20 @@ self.arrbtn = [NSMutableArray new]; for(int i = 0 ; i < arrtop.count;i++) { + ExamplePicModelDataItems *model = arrtop[i]; UIButton *btitem = [[UIButton alloc] init]; - [btitem setTitle:arrtop[i] forState:UIControlStateNormal]; + if([model.scene isEqualToString:@"pic_rewrite"]) + { + [btitem setTitle:@"拍照改写" forState:UIControlStateNormal]; + } + else if([model.scene isEqualToString:@"pic_question"]) + { + [btitem setTitle:@"拍题写作" forState:UIControlStateNormal]; + } + else if([model.scene isEqualToString:@"pic_with_front"]) + { + [btitem setTitle:@"拍照续写" forState:UIControlStateNormal]; + } [btitem setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [btitem setTitleColor:RGBCOLOR(255, 154, 18) forState:UIControlStateSelected]; [btitem.titleLabel setFont:[UIFont boldSystemFontOfSize:14]]; @@ -121,6 +111,35 @@ [btpai addTarget:self action:@selector(paiAction) forControlEvents:UIControlEventTouchUpInside]; } +-(void)setArrdataYD:(NSArray *)arrdataYD +{ + _arrdataYD = arrdataYD; + + [self.scvback setContentSize:CGSizeMake(UISCREEN_WIDTH*arrdataYD.count, 0)]; + + self.arrView = [NSMutableArray new]; + for(int i = 0 ; i < self.arrdataYD.count; i++) + { + StartPZXZPageView *viewitem = [StartPZXZPageView new]; + [self.scvback addSubview:viewitem]; + [viewitem mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.height.width.equalTo(self.scvback); + make.left.offset(UISCREEN_WIDTH*i); + }]; + viewitem.model = self.arrdataYD[i]; + [self.arrView addObject:viewitem]; + } + + + UIView *viewbottom = [[UIView alloc] init]; + [self addSubview:viewbottom]; + [viewbottom mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self); + make.top.equalTo(self.scvback.mas_bottom); + }]; + [self drawBottomView:viewbottom]; + [self tuoluo]; +} -(void)itemAction:(UIButton *)sender { if(sender.tag==self.btselect.tag)return; @@ -136,7 +155,7 @@ NSInteger ipage = scrollView.contentOffset.x/UISCREEN_WIDTH; if(ipage>self.arrbtn.count-1)ipage=self.arrbtn.count-1; if(ipage<0)ipage=0; - self.btselect = self.arrbtn[ipage]; + [self itemAction:self.arrbtn[ipage]]; } -(void)tuoluo @@ -175,6 +194,7 @@ [self stopMotion]; /// StartPZXZDetailViewController *vc = [StartPZXZDetailViewController new]; + vc.modelYD = self.arrdataYD[self.btselect.tag]; [self.viewController.navigationController pushViewController:vc animated:YES]; } @end diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.h b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.h index 3533715..08bfa21 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.h +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.h @@ -6,10 +6,12 @@ // #import "BaseViewController.h" - +#import "ExamplePicModel.h" NS_ASSUME_NONNULL_BEGIN @interface StartPZXZDetailViewController : BaseViewController +/// +@property (nonatomic , strong) ExamplePicModelDataItems *modelYD; @end diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.m b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.m index f29806f..b766597 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.m +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/StartPZXZDetailViewController.m @@ -22,6 +22,22 @@ [self.navigationController setNavigationBarHidden:YES animated:animated]; [self showNaviGationView:YES]; [self.navigationView setTitle:@"改写成文" titleColor:RGBCOLOR(60, 60, 60)]; + if(self.modelYD) + { + if([self.modelYD.scene isEqualToString:@"pic_rewrite"]) + { + [self.navigationView setTitle:@"拍照改写" titleColor:RGBCOLOR(60, 60, 60)]; + } + else if([self.modelYD.scene isEqualToString:@"pic_question"]) + { + [self.navigationView setTitle:@"拍题写作" titleColor:RGBCOLOR(60, 60, 60)]; + } + else if([self.modelYD.scene isEqualToString:@"pic_with_front"]) + { + [self.navigationView setTitle:@"拍照续写" titleColor:RGBCOLOR(60, 60, 60)]; + } + + } [self.navigationView setBackgroundColor:[UIColor whiteColor]]; [self.navigationView.backButton setHidden:YES]; } @@ -35,6 +51,7 @@ make.left.right.bottom.equalTo(self.view); make.top.offset(NavHeight); }]; + view.modelYD = self.modelYD; } diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.h b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.h index 2e048fb..9fe355e 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.h +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.h @@ -6,11 +6,12 @@ // #import - +#import "ExamplePicModel.h" NS_ASSUME_NONNULL_BEGIN @interface StartPZXZDetailView : UIView - +/// +@property (nonatomic , strong) ExamplePicModelDataItems *modelYD; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.m b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.m index fd2f64f..b2b785e 100644 --- a/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.m +++ b/ProductApp/ProductApp/ProductMain/引导/拍照写作/文章/view/StartPZXZDetailView.m @@ -24,6 +24,11 @@ @property (nonatomic , strong) UIScrollView *scvback; @property (nonatomic , assign) BOOL isDragging; +/// +@property (nonatomic , strong) UILabel *lbname; +@property (nonatomic , strong) ViewLable *lbwz; + + @end @implementation StartPZXZDetailView @@ -142,6 +147,7 @@ make.width.equalTo(scvback).offset(-32); }]; [lbname sizeToFit]; + _lbname = lbname; ViewLable *lbwz = [[ViewLable alloc] init]; [scvback addSubview:lbwz]; @@ -151,8 +157,6 @@ }]; lbwz.textColor = RGBCOLOR(61, 61, 61); lbwz.textFont = [UIFont systemFontOfSize:14]; - lbwz.fspeed = 0.02; - lbwz.strValue = @" 假如我是一颗小星星,我愿意紧紧地围绕在月亮身边,静静地听她讲美丽动人的故事,嫦娥、玉兔,还有吴刚的桂花酒……\n 假如我是一颗小星星,我愿意做最亮的一颗,每当夜幕降临,我就高高地悬挂在夜空中,给人们送去珍贵的光明,为走夜路的人们照亮前进的方向,为在夜里害怕的孩子送去光明。"; [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) { @@ -166,7 +170,7 @@ } } }]; - + _lbwz = lbwz; [scvback mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.equalTo(lbwz).offset(20); }]; @@ -243,4 +247,24 @@ { self.isDragging = NO; } + +-(void)setModelYD:(ExamplePicModelDataItems *)modelYD +{ + _modelYD = modelYD; + + self.viweBack.model = self.modelYD; + + + NSString *strcontet = self.modelYD.result.content; + strcontet = [NSString stringWithFormat:@" %@",strcontet]; + strcontet = [strcontet stringByReplacingOccurrencesOfString:@"\n" withString:@"\n "]; + + self.lbwz.fspeed = 0.02; + self.lbwz.strValue = strcontet; + + + self.lbwz.isWriteEnd = YES; + +} + @end diff --git a/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/StartZNXZSiLuViewController.m b/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/StartZNXZSiLuViewController.m index 79d31ac..256b381 100644 --- a/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/StartZNXZSiLuViewController.m +++ b/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/StartZNXZSiLuViewController.m @@ -8,8 +8,7 @@ #import "StartZNXZSiLuViewController.h" #import "StartZNXZSiLuView.h" -#import "WebSocketManager.h" -#import "SSENetWorkManager.h" + @interface StartZNXZSiLuViewController () @@ -37,11 +36,9 @@ [view mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.view); }]; - -// [[WebSocketManager shared] connectTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",@"write_outline"] stage:self.strtitle title:self.modelTitle.title require:[self.arrRequire componentsJoinedByString:@"、"] title_id:self.modelTitle.ID]; - - - [[SSENetWorkManager shareManager] requestTo:[NSString stringWithFormat:@"https://aiw.batiao8.com/api/chat?scene=%@",@"write_outline"] stage:self.strtitle title:self.modelTitle.title require:[self.arrRequire componentsJoinedByString:@"、"] title_id:self.modelTitle.ID]; + view.strtitle = self.strtitle; + view.arrRequire = self.arrRequire; + view.modelTitle = self.modelTitle; } diff --git a/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.h b/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.h index c0ba8cc..fdff2c1 100644 --- a/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.h +++ b/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.h @@ -6,11 +6,15 @@ // #import - +#import "ExampleWriteList.h" NS_ASSUME_NONNULL_BEGIN @interface StartZNXZSiLuView : UIView - +@property (nonatomic , strong) NSString *strtitle; +/// +@property (nonatomic , strong) ExampleWriteListDataItems *modelTitle; +/// +@property (nonatomic , strong) NSArray *arrRequire; @end NS_ASSUME_NONNULL_END diff --git a/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.m b/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.m index 7cb4d50..589c15a 100644 --- a/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.m +++ b/ProductApp/ProductApp/ProductMain/引导/智能写作/思路/view/StartZNXZSiLuView.m @@ -7,20 +7,33 @@ #import "StartZNXZSiLuView.h" #import "StartPayViewController.h" +#import "SSENetWorkManager.h" typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast); @interface StartZNXZSiLuView () /// +@property (nonatomic , strong) UILabel *lbname; +/// @property (nonatomic , strong) UIView *viewback; /// @property (nonatomic , strong) UIScrollView *scvback; +/// +@property (nonatomic , strong) MASConstraint *scvBottom; @property (nonatomic , assign) BOOL isDragging; -/// -@property (nonatomic , strong) MASConstraint *scrollBottom; - @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 @implementation StartZNXZSiLuView @@ -50,6 +63,7 @@ typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast); make.right.equalTo(self).offset(-14); make.top.equalTo(imgvlog.mas_centerY).offset(-8); }]; + _lbname = lbname; UIView *viewback = [[UIView alloc] init]; [viewback setBackgroundColor:[UIColor whiteColor]]; @@ -63,7 +77,7 @@ typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast); [viewback.layer setMasksToBounds:YES]; [viewback.layer setCornerRadius:20]; _viewback = viewback; - [self drawInfoView:viewback]; + UIView *viewbottom = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UISCREEN_WIDTH, TabHeight+40)]; [viewbottom setBackgroundColor:[UIColor whiteColor]]; @@ -158,30 +172,9 @@ typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast); [scvback setDelegate:self]; _scvback = scvback; - - [self startDraw:@[@{@"title":@"题材",@"values":@[@""]}, - @{@"title":@"开头",@"values":@[@""]}, - @{@"title":@"中间",@"values":@[@"",@"",@""]}, - @{@"title":@"结尾",@"values":@[@""]}] tag:0 lastValue:nil]; } - --(void)startDraw:(NSArray *)arrtemp tag:(int)tag lastValue:(UIView *)lastValue -{ - NSDictionary *dic = arrtemp[tag]; - [self drawSubItemsView:self.scvback title:[dic objectForKey:@"title"] values:[dic objectForKey:@"values"] lastview:lastValue back:^(UIView *viewlast) { - if(tag0) - { - [self.scvback setContentOffset:CGPointMake(0, self.scvback.contentSize.height-self.scvback.height) animated:NO]; - } - } - }]; - [view mas_makeConstraints:^(MASConstraintMaker *make) { + [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)bottomAction:(UIButton *)sender { if(self.isdrawEnd==NO) @@ -284,12 +244,12 @@ typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast); self.isdrawEnd = NO; [self.scvback removeFromSuperview]; self.scvback = nil; - self.scrollBottom = nil; - [self drawInfoView:self.viewback]; + /// + + [self getdata:@"write_outline" title_id:@""]; } else - {///(45*1.028+7)*x 53 61 69 77 86 95 104 113 123 133 143 154 165 176 - ///3 1 1 + {/// StartPayViewController *vc = [StartPayViewController new]; [self.viewController.navigationController pushViewController:vc animated:YES]; } @@ -304,4 +264,182 @@ typedef void(^StartZNXZSiLuViewDrawEndBack)(UIView *viewlast); { self.isDragging = NO; } + +-(void)setModelTitle:(ExampleWriteListDataItems *)modelTitle +{ + _modelTitle = modelTitle; + + [self.lbname setText:[NSString stringWithFormat:@"%@、智能写作、%@、%@",self.strtitle,self.modelTitle.title,[self.arrRequire componentsJoinedByString:@"、"]]]; + + [self getdata:@"write_outline" title_id:self.modelTitle.ID]; +} + +-(void)getdata:(NSString *)scenct title_id:(NSString *)title_id +{ + [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) { + self.modelConfig = config; + } 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)nomoData +{ + 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 diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m index 55a2b66..c2bac10 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/view/StartKTXZWenZhangView.m @@ -423,6 +423,7 @@ _modelDetailYDY = modelDetailYDY; self.lbwz.strValue = modelDetailYDY.content; + self.lbwz.isWriteEnd = YES; } -(void)zhankaiAction:(UIButton *)sender { diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m index 09f0fd3..a92b878 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/写作思路/StartKTXZPGDetailXZView.m @@ -237,6 +237,7 @@ typedef void(^backenddraw)(void); lbwz.textFont = [UIFont systemFontOfSize:15]; lbwz.fspeed = 0.02; lbwz.strValue = value; + lbwz.isWriteEnd = YES; [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) { @@ -291,6 +292,7 @@ typedef void(^backenddraw)(void); lbwz.textFont = [UIFont systemFontOfSize:15]; lbwz.fspeed = 0.02; lbwz.strValue = strkt; + lbwz.isWriteEnd = YES; [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) { @@ -353,6 +355,7 @@ typedef void(^backenddraw)(void); lbwz.textFont = [UIFont systemFontOfSize:15]; lbwz.fspeed = 0.02; lbwz.strValue = strkt; + lbwz.isWriteEnd = YES; [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) { @@ -395,6 +398,7 @@ typedef void(^backenddraw)(void); lbwz.textFont = [UIFont systemFontOfSize:14]; lbwz.fspeed = 0.02; lbwz.strValue = self.modelResult.outline; + lbwz.isWriteEnd = YES; __block MASConstraint *bottominfo; [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m index 236d8dd..c6dadb0 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/分句点评/StartKTXZPGDetailFJItemView.m @@ -82,6 +82,7 @@ lbwz.textFont = [UIFont systemFontOfSize:14]; lbwz.fspeed = 0.02; lbwz.strValue = self.model.review_content; + lbwz.isWriteEnd = YES; __strong ViewLable *lbwzself = lbwz; __block MASConstraint *bottominfo; [lbwz setBackHeight:^(float fheight, BOOL isend) { @@ -131,6 +132,7 @@ lbwz.textFont = [UIFont systemFontOfSize:14]; lbwz.fspeed = 0.02; lbwz.strValue = [NSString stringWithFormat:@" %@",value]; + lbwz.isWriteEnd = YES; __strong ViewLable *lbwzself = lbwz; __block MASConstraint *bottominfo; [lbwz setBackHeight:^(float fheight, BOOL isend) { diff --git a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m index 414da35..5203e0d 100644 --- a/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m +++ b/ProductApp/ProductApp/ProductMain/引导/课堂写作/批改信息/view/综合评价/StartKTXZPGDetailZHView.m @@ -120,6 +120,7 @@ lbwz.textFont = [UIFont systemFontOfSize:14]; lbwz.fspeed = 0.02; lbwz.strValue = self.modelResult.complex_review.full_review.review_content; + lbwz.isWriteEnd = YES; __strong ViewLable *lbwzself = lbwz; __block MASConstraint *bottominfo; [lbwz setBackHeight:^(float fheight, BOOL isend) { @@ -168,6 +169,7 @@ lbwz.textFont = [UIFont systemFontOfSize:14]; lbwz.fspeed = 0.02; lbwz.strValue = [NSString stringWithFormat:@" %@",value]; + lbwz.isWriteEnd = YES; __strong ViewLable *lbwzself = lbwz; __block MASConstraint *bottominfo; [lbwz setBackHeight:^(float fheight, BOOL isend) { diff --git a/ProductApp/ProductApp/ProductMain/首页/改写润色/view/GaiXieRunSeView.m b/ProductApp/ProductApp/ProductMain/首页/改写润色/view/GaiXieRunSeView.m index 6ec1866..0b0cf5d 100644 --- a/ProductApp/ProductApp/ProductMain/首页/改写润色/view/GaiXieRunSeView.m +++ b/ProductApp/ProductApp/ProductMain/首页/改写润色/view/GaiXieRunSeView.m @@ -129,6 +129,7 @@ lbwz.textFont = [UIFont systemFontOfSize:16]; lbwz.fspeed = 0.02; lbwz.strValue = @" 你的作文非常出色,但是可以在语言表达上更加生动有趣,增加一些形象的比喻和细节描写,让读者更加深入地了解你的思考和感受。同时,可以适当增加一些个人的经历和感受,让作文更加具有个性化和独特性。"; + lbwz.isWriteEnd = YES; __strong ViewLable *lbwzSelf = lbwz; __block MASConstraint *bottomScroll; [lbwz setBackHeight:^(float fheight, BOOL isend) { @@ -180,6 +181,7 @@ self.isdrawEnd = NO; ViewLable *lbwz = self.arrItems[sender.tag]; lbwz.strValue = @" 1233222222222你的作文非常出色,但是可以在语言表达上更加生动有趣,增加一些形象的比喻和细节描写,让读者更加深入地了解你的思考和感受。同时,可以适当增加一些个人的经历和感受,让作文更加具有个性化和独特性。"; + lbwz.isWriteEnd = YES; [lbwz setBackHeight:^(float fheight, BOOL isend) { if(isend) { diff --git a/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/写作详情/view/XieZuoXiangQingView.m b/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/写作详情/view/XieZuoXiangQingView.m index 7e357c2..809e798 100644 --- a/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/写作详情/view/XieZuoXiangQingView.m +++ b/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/写作详情/view/XieZuoXiangQingView.m @@ -114,6 +114,7 @@ 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) { @@ -209,6 +210,7 @@ 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) { diff --git a/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/创作思路/view/ChuangZuoSiLuView.m b/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/创作思路/view/ChuangZuoSiLuView.m index 3464509..f18a8eb 100644 --- a/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/创作思路/view/ChuangZuoSiLuView.m +++ b/ProductApp/ProductApp/ProductMain/首页/智能写作/全文写作/创作思路/view/ChuangZuoSiLuView.m @@ -151,6 +151,7 @@ typedef void(^ChuangZuoSiLuViewDraw)(void); /// ViewLable *lbticai = [self drawItem:view lastview:viewtop]; lbticai.strValue = @"以我心中的英雄--杨利伟为例,讲述他的热爱祖国的事迹。"; + lbticai.isWriteEnd = YES; [lbticai setBackHeight:^(float fheight, BOOL isend) { if(isend) {///这里如果有多个需要处理 @@ -161,6 +162,7 @@ typedef void(^ChuangZuoSiLuViewDraw)(void); ViewLable *lbticai1 = [self drawItem:view lastview:lbticai.superview]; lbticai1.strValue = @"以我心中的英雄--杨利伟为例,讲述他的热爱祖国的事迹。"; + lbticai1.isWriteEnd = YES; [lbticai1 setBackHeight:^(float fheight, BOOL isend) { if(isend) {///这里如果有多个需要处理 @@ -180,6 +182,7 @@ typedef void(^ChuangZuoSiLuViewDraw)(void); { ViewLable *lbticai = [self drawItem:view lastview:[self drawItemView:view title:title]]; lbticai.strValue = @"以我心中的英雄--杨利伟为例,讲述他的热爱祖国的事迹。"; + lbticai.isWriteEnd = YES; [lbticai setBackHeight:^(float fheight, BOOL isend) { if(isend) { diff --git a/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/view/DuanLuoXieZuoCellView.m b/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/view/DuanLuoXieZuoCellView.m index 8fb03f9..ed79124 100644 --- a/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/view/DuanLuoXieZuoCellView.m +++ b/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/view/DuanLuoXieZuoCellView.m @@ -137,6 +137,7 @@ { _strvalue = strvalue; self.lbwz.strValue = strvalue; + self.lbwz.isWriteEnd = YES; } -(void)nextAction diff --git a/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/续写润色/view/DuanLuoXieZuoQWView.m b/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/续写润色/view/DuanLuoXieZuoQWView.m index 6b5e275..fa710c4 100644 --- a/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/续写润色/view/DuanLuoXieZuoQWView.m +++ b/ProductApp/ProductApp/ProductMain/首页/智能写作/段落/续写润色/view/DuanLuoXieZuoQWView.m @@ -98,6 +98,7 @@ 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) { @@ -194,6 +195,7 @@ 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) {