桂欢 1 rok temu
rodzic
commit
326d7eae63
31 zmienionych plików z 607 dodań i 52 usunięć
  1. 30 0
      SLAiELTS/SLAiELTS.xcodeproj/project.pbxproj
  2. BIN
      SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check.imageset/icon_check.jpg
  3. 0 21
      SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check_s.imageset/Contents.json
  4. BIN
      SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check_s.imageset/icon_check_s.jpg
  5. 2 1
      SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_my_ai_set.imageset/Contents.json
  6. BIN
      SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_my_ai_set.imageset/icon_my_ai_set@2x.png
  7. BIN
      SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_my_ai_set.imageset/icon_my_ai_set@3x.png
  8. 5 0
      SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLPageModel.h
  9. 9 0
      SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLPageModel.m
  10. 5 4
      SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLPageViewModel.m
  11. 11 3
      SLAiELTS/SLAiELTS/ViewControllers/LoginVC/Models/SLUserModel.m
  12. 1 1
      SLAiELTS/SLAiELTS/ViewControllers/MessageVC/SLMessageViewController.m
  13. 16 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.h
  14. 158 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.m
  15. 48 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.xib
  16. 4 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLModifyNicknameVc.h
  17. 15 4
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLModifyNicknameVc.m
  18. 3 2
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLModifyNicknameVc.xib
  19. 16 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.h
  20. 86 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.m
  21. 22 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.xib
  22. 8 2
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMyListCollectionViewCell.m
  23. 23 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.h
  24. 62 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.m
  25. 57 0
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.xib
  26. 0 1
      SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/SLMySpeedView.m
  27. 0 5
      SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/RoleModel.h
  28. 20 0
      SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/RoleModel.m
  29. 2 2
      SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/SLNuisdkPlay.m
  30. 1 3
      SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/SLRoleLabelViewController.m
  31. 3 3
      SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Views/SLRoleLabelView.m

+ 30 - 0
SLAiELTS/SLAiELTS.xcodeproj/project.pbxproj

@@ -131,6 +131,12 @@
 		3D3BC1CC2A25933400AEEE8E /* SLMomentsNewsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D3BC1CA2A25933400AEEE8E /* SLMomentsNewsCell.m */; };
 		3D3BC1CD2A25933400AEEE8E /* SLMomentsNewsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D3BC1CB2A25933400AEEE8E /* SLMomentsNewsCell.xib */; };
 		3D3BC34B2A25E73800AEEE8E /* icon_yb_bg.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3D3BC34A2A25E73800AEEE8E /* icon_yb_bg.jpg */; };
+		3D3BC34F2A26D7D300AEEE8E /* SLAiSetVc.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D3BC34D2A26D7D300AEEE8E /* SLAiSetVc.m */; };
+		3D3BC3502A26D7D300AEEE8E /* SLAiSetVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D3BC34E2A26D7D300AEEE8E /* SLAiSetVc.xib */; };
+		3D3BC3542A26E2B000AEEE8E /* SLMySpeedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D3BC3522A26E2B000AEEE8E /* SLMySpeedCell.m */; };
+		3D3BC3552A26E2B000AEEE8E /* SLMySpeedCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D3BC3532A26E2B000AEEE8E /* SLMySpeedCell.xib */; };
+		3D3BC35A2A27283600AEEE8E /* SLSexSetVc.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D3BC3582A27283600AEEE8E /* SLSexSetVc.m */; };
+		3D3BC35B2A27283600AEEE8E /* SLSexSetVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D3BC3592A27283600AEEE8E /* SLSexSetVc.xib */; };
 		3D5BC38B29E3E77400748197 /* SLMoentsChatView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5BC38A29E3E77400748197 /* SLMoentsChatView.m */; };
 		3D5BC38F29E3F87100748197 /* SLFriensInfoVc.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D5BC38D29E3F87100748197 /* SLFriensInfoVc.m */; };
 		3D5BC39029E3F87100748197 /* SLFriensInfoVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3D5BC38E29E3F87100748197 /* SLFriensInfoVc.xib */; };
@@ -499,6 +505,15 @@
 		3D3BC1CA2A25933400AEEE8E /* SLMomentsNewsCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLMomentsNewsCell.m; sourceTree = "<group>"; };
 		3D3BC1CB2A25933400AEEE8E /* SLMomentsNewsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLMomentsNewsCell.xib; sourceTree = "<group>"; };
 		3D3BC34A2A25E73800AEEE8E /* icon_yb_bg.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = icon_yb_bg.jpg; sourceTree = "<group>"; };
+		3D3BC34C2A26D7D300AEEE8E /* SLAiSetVc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLAiSetVc.h; sourceTree = "<group>"; };
+		3D3BC34D2A26D7D300AEEE8E /* SLAiSetVc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLAiSetVc.m; sourceTree = "<group>"; };
+		3D3BC34E2A26D7D300AEEE8E /* SLAiSetVc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLAiSetVc.xib; sourceTree = "<group>"; };
+		3D3BC3512A26E2B000AEEE8E /* SLMySpeedCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLMySpeedCell.h; sourceTree = "<group>"; };
+		3D3BC3522A26E2B000AEEE8E /* SLMySpeedCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLMySpeedCell.m; sourceTree = "<group>"; };
+		3D3BC3532A26E2B000AEEE8E /* SLMySpeedCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLMySpeedCell.xib; sourceTree = "<group>"; };
+		3D3BC3572A27283600AEEE8E /* SLSexSetVc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLSexSetVc.h; sourceTree = "<group>"; };
+		3D3BC3582A27283600AEEE8E /* SLSexSetVc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLSexSetVc.m; sourceTree = "<group>"; };
+		3D3BC3592A27283600AEEE8E /* SLSexSetVc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLSexSetVc.xib; sourceTree = "<group>"; };
 		3D5BC38929E3E77400748197 /* SLMoentsChatView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLMoentsChatView.h; sourceTree = "<group>"; };
 		3D5BC38A29E3E77400748197 /* SLMoentsChatView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLMoentsChatView.m; sourceTree = "<group>"; };
 		3D5BC38C29E3F87100748197 /* SLFriensInfoVc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLFriensInfoVc.h; sourceTree = "<group>"; };
@@ -1806,6 +1821,9 @@
 				3DF3DAE129BAFCCA00CAD3AB /* SLMySpeedCollectionViewCell.h */,
 				3DF3DAE229BAFCCA00CAD3AB /* SLMySpeedCollectionViewCell.m */,
 				3DF3DAE329BAFCCA00CAD3AB /* SLMySpeedCollectionViewCell.xib */,
+				3D3BC3512A26E2B000AEEE8E /* SLMySpeedCell.h */,
+				3D3BC3522A26E2B000AEEE8E /* SLMySpeedCell.m */,
+				3D3BC3532A26E2B000AEEE8E /* SLMySpeedCell.xib */,
 			);
 			path = Cells;
 			sourceTree = "<group>";
@@ -1843,6 +1861,12 @@
 				3D1B9CF529C071AD0008D01A /* SLFeedbackVc.h */,
 				3D1B9CF629C071AD0008D01A /* SLFeedbackVc.m */,
 				3D1B9CF729C071AD0008D01A /* SLFeedbackVc.xib */,
+				3D3BC34C2A26D7D300AEEE8E /* SLAiSetVc.h */,
+				3D3BC34D2A26D7D300AEEE8E /* SLAiSetVc.m */,
+				3D3BC34E2A26D7D300AEEE8E /* SLAiSetVc.xib */,
+				3D3BC3572A27283600AEEE8E /* SLSexSetVc.h */,
+				3D3BC3582A27283600AEEE8E /* SLSexSetVc.m */,
+				3D3BC3592A27283600AEEE8E /* SLSexSetVc.xib */,
 			);
 			path = VCs;
 			sourceTree = "<group>";
@@ -1981,6 +2005,7 @@
 				3DF3DAD329BAC90F00CAD3AB /* SLModifyNicknameVc.xib in Resources */,
 				3DF3DAB829B9B93000CAD3AB /* SLBaseCollectionViewCell.xib in Resources */,
 				3D2DC3C629B078FE0041A729 /* Resources.bundle in Resources */,
+				3D3BC3502A26D7D300AEEE8E /* SLAiSetVc.xib in Resources */,
 				3D8EBBCE2A14B6EC0008B0C1 /* SLWebViewController.xib in Resources */,
 				3DA5AF6A29B88875009E4925 /* SLLxViewController.xib in Resources */,
 				3D1B986929BEAFEB0008D01A /* SLHorScrBtns.xib in Resources */,
@@ -1997,10 +2022,12 @@
 				3D25107029AD8AA9000AE530 /* SLRoleLabelViewController.xib in Resources */,
 				3D19CBFF29E7DF6B0041A6B8 /* SLMomentsCommentVc.xib in Resources */,
 				3DBC3BC92A0B650300E8C766 /* SLNearbyPeopleCell.xib in Resources */,
+				3D3BC35B2A27283600AEEE8E /* SLSexSetVc.xib in Resources */,
 				3DE9967A29E915BF00C50A83 /* SLMomentsVc.xib in Resources */,
 				3D3BC1C72A25903700AEEE8E /* SLMomentsNewsVc.xib in Resources */,
 				3DB97D9A29D6ABF000B12754 /* LICENSE in Resources */,
 				3D1B989029BEF1AC0008D01A /* SLVocabularyCell.xib in Resources */,
+				3D3BC3552A26E2B000AEEE8E /* SLMySpeedCell.xib in Resources */,
 				3D1B988029BEEA670008D01A /* SLVocabularyView.xib in Resources */,
 				3D6EE45429F2568000B02EBB /* SLRecomFriendsVc.xib in Resources */,
 				3D2DC3F629B1E6510041A729 /* SLMikeInputView.xib in Resources */,
@@ -2174,6 +2201,7 @@
 				3D2DC3C029B0709F0041A729 /* NLSVoiceRecorder.m in Sources */,
 				3D1B989329BEF5960008D01A /* SLLxView.m in Sources */,
 				3D99620029CD2FFA0076DBD1 /* SLListViewController.m in Sources */,
+				3D3BC34F2A26D7D300AEEE8E /* SLAiSetVc.m in Sources */,
 				3D2510B929AF1970000AE530 /* SLHttpCenter.m in Sources */,
 				3D6EE45829F25AB400B02EBB /* SLRecomFriendsCell.m in Sources */,
 				3D2D8BD529DE5402009392DA /* AddressBookCell.m in Sources */,
@@ -2184,6 +2212,7 @@
 				3DB97DA329D6ABF000B12754 /* MLLabel.m in Sources */,
 				3DFEE71729B5E7F9000AA7D5 /* SLAuthorizationManager.m in Sources */,
 				3D2DC3DE29B0991E0041A729 /* YMIMBaseMessageCell.m in Sources */,
+				3D3BC35A2A27283600AEEE8E /* SLSexSetVc.m in Sources */,
 				3DB97D9E29D6ABF000B12754 /* MLLinkLabel.m in Sources */,
 				3DB97D4329D6A86E00B12754 /* SDTimeLineCell.m in Sources */,
 				3DB97D9929D6ABF000B12754 /* TTTAttributedLabel.m in Sources */,
@@ -2224,6 +2253,7 @@
 				3D8C9F8D29AC57F300678283 /* main.m in Sources */,
 				3D6EE45C29F27BCB00B02EBB /* SLRecomFriendModel.m in Sources */,
 				3D25107A29AD8DB0000AE530 /* SLPageControlSlideRound.m in Sources */,
+				3D3BC3542A26E2B000AEEE8E /* SLMySpeedCell.m in Sources */,
 				3DB069F829F7A71F005730D7 /* SLFriendPowerVc.m in Sources */,
 				3DB97D6B29D6ABC100B12754 /* SDRefreshHeaderView.m in Sources */,
 				3D2510CE29AF375B000AE530 /* SLGlobalInfo.m in Sources */,

BIN
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check.imageset/icon_check.jpg


+ 0 - 21
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check_s.imageset/Contents.json

@@ -1,21 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "icon_check_s.jpg",
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check_s.imageset/icon_check_s.jpg


+ 2 - 1
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_check.imageset/Contents.json → SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_my_ai_set.imageset/Contents.json

@@ -1,15 +1,16 @@
 {
   "images" : [
     {
-      "filename" : "icon_check.jpg",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
+      "filename" : "icon_my_ai_set@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
+      "filename" : "icon_my_ai_set@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_my_ai_set.imageset/icon_my_ai_set@2x.png


BIN
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_my_ai_set.imageset/icon_my_ai_set@3x.png


+ 5 - 0
SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLPageModel.h

@@ -29,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *bgImage;
 
+@property (nonatomic, strong) NSArray *segments;
+
 + (instancetype)initWithTitle:(NSString *)title
                       bgImage:(NSString *)bgImage;
 
@@ -38,5 +40,8 @@ NS_ASSUME_NONNULL_BEGIN
 + (instancetype)initWithTitle:(NSString *)title
                      subTitle:(NSString *)subTitle
                       bgImage:(NSString *)bgImage;
+
++ (instancetype)initWithTitle:(NSString *)title
+                     segments:(NSArray *)segments;
 @end
 NS_ASSUME_NONNULL_END

+ 9 - 0
SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLPageModel.m

@@ -33,4 +33,13 @@
     return detail;
 }
 
++ (instancetype)initWithTitle:(NSString *)title
+                     segments:(NSArray *)segments {
+    SLPageModelDetail *detail = [[SLPageModelDetail alloc] init];
+    detail.title = title;
+    detail.segments = segments;
+    return detail;
+
+}
+
 @end

+ 5 - 4
SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLPageViewModel.m

@@ -20,12 +20,13 @@
     SLPageViewModel *vm = [[SLPageViewModel alloc] initWith:model cellClass:SLMeHeaderCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 205 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
     [viewModels addObject:vm];
     
-    SLPageModel *model2 = [[SLPageModel alloc] init];
-    SLPageViewModel *vm2 = [[SLPageViewModel alloc] initWith:model2 cellClass:SLMySpeedCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 195 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
-    [viewModels addObject:vm2];
+//    SLPageModel *model2 = [[SLPageModel alloc] init];
+//    SLPageViewModel *vm2 = [[SLPageViewModel alloc] initWith:model2 cellClass:SLMySpeedCollectionViewCell.class viewSize:CGSizeMake(kSCREEN_WIDTH, 195 * KScaleW) headerSize:CGSizeMake(kSCREEN_WIDTH, 0)];
+//    [viewModels addObject:vm2];
     
     SLPageModel *model1 = [[SLPageModel alloc] init];
-    model1.modelDetails = @[[SLPageModelDetail initWithTitle:@"收藏" bgImage:@"icon_my_sc"],
+    model1.modelDetails = @[[SLPageModelDetail initWithTitle:@"AI设置" bgImage:@"icon_my_ai_set"],
+                            [SLPageModelDetail initWithTitle:@"收藏" bgImage:@"icon_my_sc"],
                             [SLPageModelDetail initWithTitle:@"朋友圈" bgImage:@"icon_my_pyq"],
                             [SLPageModelDetail initWithTitle:@"设置" bgImage:@"icon_my_set"],
                            [SLPageModelDetail initWithTitle:@"评价与反馈" bgImage:@"icon_my_yj"]];

+ 11 - 3
SLAiELTS/SLAiELTS/ViewControllers/LoginVC/Models/SLUserModel.m

@@ -40,19 +40,27 @@
         [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/HomePage" parameter:@{} success:^(id responseObject) {
             NSDictionary *dict = [responseObject objectForKey:@"data"];
             NSDictionary *modelDict = [dict objectForKey:@"list"];
-            [SLGlobalInfo SharedInstance].roleModel = [RoleModel mj_objectWithKeyValues:modelDict];
+//            [SLGlobalInfo SharedInstance].roleModel = [RoleModel mj_objectWithKeyValues:modelDict];
             [SLGlobalInfo SharedInstance].loginInfo.isAiData = [[dict objectForKey:@"isAiData"] boolValue];
         } failure:^(SPRequestError *error) {
             
         }];
-        [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/GetUserGoal" parameter:@{} success:^(id responseObject) {
+        [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/GetAssistantInfo" parameter:@{} success:^(id responseObject) {
             NSDictionary *dict = [responseObject objectForKey:@"data"];
             if ([dict isKindOfClass:NSDictionary.class]) {
-                [SLGlobalInfo SharedInstance].targetModel = [SLTargetModel mj_objectWithKeyValues:dict];
+                [SLGlobalInfo SharedInstance].roleModel = [RoleModel mj_objectWithKeyValues:dict];
             }
         } failure:^(SPRequestError *error) {
             
         }];
+//        [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/GetUserGoal" parameter:@{} success:^(id responseObject) {
+//            NSDictionary *dict = [responseObject objectForKey:@"data"];
+//            if ([dict isKindOfClass:NSDictionary.class]) {
+//                [SLGlobalInfo SharedInstance].targetModel = [SLTargetModel mj_objectWithKeyValues:dict];
+//            }
+//        } failure:^(SPRequestError *error) {
+//
+//        }];
     }
 }
 

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/SLMessageViewController.m

@@ -88,7 +88,7 @@
             [weakSelf.nuisdkPlay playSendVoice:msgModel];
         }else {
             RoleModel *model = [RoleModel mj_objectWithKeyValues:[[SLGlobalInfo SharedInstance].roleModel mj_JSONObject]];
-            model.dataSex = weakSelf.friendModel.sex;
+            model.aiSex = weakSelf.friendModel.sex;
             [weakSelf.nuisdkPlay startTTSWith:msgModel.sendText roleModel:model finshBlock:^{
 
             }];

+ 16 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.h

@@ -0,0 +1,16 @@
+//
+//  SLAiSetVc.h
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/5/31.
+//
+
+#import "SLBaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SLAiSetVc : SLBaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 158 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.m

@@ -0,0 +1,158 @@
+//
+//  SLAiSetVc.m
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/5/31.
+//
+
+#import "SLAiSetVc.h"
+#import "SLBaseTableViewCell.h"
+#import "SLMySpeedCell.h"
+#import "SLModifyNicknameVc.h"
+#import "SLNuisdkPlay.h"
+#import "SLSexSetVc.h"
+
+@interface SLAiSetVc ()<UITableViewDelegate, UITableViewDataSource,YMCustomSegmentDelegate>
+
+@property (weak, nonatomic) IBOutlet UITableView *tableView;
+
+@property (nonatomic, strong) NSMutableArray<NSArray<SLPageModelDetail *> *> *dataModels;
+
+@property (nonatomic, strong)SLNuisdkPlay *play;
+
+@end
+
+@implementation SLAiSetVc
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view from its nib.
+    self.title = @"AI设置";
+    if (@available(iOS 11.0, *)) {
+        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+    } else {
+        self.automaticallyAdjustsScrollViewInsets = NO;
+    }
+    self.tableView.estimatedRowHeight = 100;
+    [self.tableView registerNibCellWithReuseIdentifierClass:SLBaseTableViewCell.class];
+    [self.tableView registerNibCellWithReuseIdentifierClass:SLMySpeedCell.class];
+    self.tableView.backgroundColor = [UIColor colorFormString:@"#F2F3F7"];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear: animated];
+    _dataModels = nil;
+    [self.tableView reloadData];
+}
+
+- (void)dealloc {
+    [_play stopNuisdkPlay];
+    _play = nil;
+}
+
+- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
+    UITableViewCell *cell;
+    SLPageModelDetail *detail = [[self.dataModels objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
+    if (indexPath.section == 0) {
+        SLBaseTableViewCell *baseCell = [tableView dequeueReusableCellWithIdentifier:@"SLBaseTableViewCell"];
+        [baseCell confignCell:detail];
+        cell = baseCell;
+    }else {
+        SLMySpeedCell *speedCell = [tableView dequeueReusableCellWithIdentifier:@"SLMySpeedCell"];
+        speedCell.segmentView.delegate = nil;
+        [speedCell confignCell:detail];
+        speedCell.segmentView.delegate = self;
+        cell = speedCell;
+    }
+    return cell;
+}
+
+- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return [self.dataModels objectAtIndex:section].count;
+}
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+    return self.dataModels.count;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    [tableView deselectRowAtIndexPath:indexPath animated:YES];
+    SLPageModelDetail *detail = [[self.dataModels objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
+    if ([detail.title isEqualToString:@"AI昵称"]) {
+        SLModifyNicknameVc *vc = [SLModifyNicknameVc loadViewControllewWithNib];
+        vc.isAiNickName = YES;
+        [self navPushViewController:vc animated:YES];
+    }
+    if ([detail.title isEqualToString:@"性别"]) {
+        SLSexSetVc *vc = [SLSexSetVc loadViewControllewWithNib];
+        [self navPushViewController:vc animated:YES];
+    }
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    if (indexPath.section == 1) {
+        return 82.f;
+    }
+    return 50.f;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
+    return 14.f;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
+    return 0.001f;
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
+    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, 14)];
+    view.backgroundColor = [UIColor colorFormString:@"#F2F3F7"];
+    return view;
+}
+
+- (void)customSegmentSelectIndex:(NSInteger)selectIndex title:(NSString *)title {
+    NSString *speechRate = [[RoleModel roleModelDict] objectForKey:title];
+    if ([SLGlobalInfo SharedInstance].loginInfo && speechRate) {
+        RoleModel *model = [RoleModel mj_objectWithKeyValues:[[SLGlobalInfo SharedInstance].roleModel mj_keyValues]];
+        if ([title containsString:@"音"]) {
+            model.language = speechRate;
+        }else {
+            model.speechRate = speechRate;
+        }
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [self.play startTTSWith:SLDefaultPlay roleModel:model finshBlock:^{
+
+            }];
+        });
+        NSString *url = [title containsString:@"音"] ? @"/api/User/UpdateAILanguage" : @"/api/User/UpdateSpeechRate";
+        NSDictionary *params = [title containsString:@"音"] ? @{@"language" : speechRate} : @{@"speechRate" : speechRate};
+        [[SLHttpCenter SharedInstance] getWithUrl:url parameter:params success:^(id responseObject) {
+            [SLGlobalInfo SharedInstance].roleModel = model;
+        } failure:^(SPRequestError *error) {
+
+        }];
+    }
+}
+
+- (NSMutableArray<NSArray<SLPageModelDetail *> *> *)dataModels {
+    if (!_dataModels) {
+        RoleModel *user = [SLGlobalInfo SharedInstance].roleModel;
+        NSArray *arr = @[
+        @[[SLPageModelDetail initWithTitle:@"AI昵称" subTitle:user.aiName bgImage:@""],
+          [SLPageModelDetail initWithTitle:@"性别" subTitle:user.aiSex bgImage:@""],],
+          @[[SLPageModelDetail initWithTitle:@"口音设置" segments:@[@"美音", @"英音"]],
+            [SLPageModelDetail initWithTitle:@"难度设置" segments:@[@"简单", @"中等", @"困难"]],
+            [SLPageModelDetail initWithTitle:@"语速设置" segments:@[@"慢", @"中", @"快"]]],];
+        _dataModels = [NSMutableArray arrayWithArray:arr];
+    }
+    return _dataModels;
+}
+
+- (SLNuisdkPlay *)play {
+    if (!_play) {
+        _play = [[SLNuisdkPlay alloc] init];
+    }
+    return _play;
+}
+
+@end

+ 48 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLAiSetVc.xib

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SLAiSetVc">
+            <connections>
+                <outlet property="tableView" destination="s5p-KV-LPV" id="GGk-av-M0I"/>
+                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
+            <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="s5p-KV-LPV">
+                    <rect key="frame" x="0.0" y="103" width="393" height="715"/>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <connections>
+                        <outlet property="dataSource" destination="-1" id="IzM-Mi-tlf"/>
+                        <outlet property="delegate" destination="-1" id="h7p-xG-hwd"/>
+                    </connections>
+                </tableView>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="s5p-KV-LPV" secondAttribute="trailing" id="Dy5-DO-eLt"/>
+                <constraint firstItem="s5p-KV-LPV" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="44" id="XNA-nk-E3I"/>
+                <constraint firstItem="s5p-KV-LPV" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="YTw-Q7-qbg"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="s5p-KV-LPV" secondAttribute="bottom" id="xGn-gT-4Az"/>
+            </constraints>
+            <point key="canvasLocation" x="140" y="-1"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 4 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLModifyNicknameVc.h

@@ -11,6 +11,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface SLModifyNicknameVc : SLBaseViewController
 
+@property (weak, nonatomic) IBOutlet UILabel *nickLabel;
+
+@property (nonatomic, assign) BOOL isAiNickName;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 15 - 4
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLModifyNicknameVc.m

@@ -26,6 +26,9 @@
     self.navigationBar.rightBarButtonItem = rightBarItem;
     self.nickNameTextField.delegate = self;
     self.clearBtn.hidden = YES;
+    if (self.isAiNickName) {
+        self.nickLabel.text = @"AI昵称";
+    }
 }
 
 - (IBAction)clearBtnClick:(id)sender {
@@ -39,11 +42,19 @@
         [ZFToast ShowWithMessage:@"请输入昵称"];
         return;
     }
-    [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/UpdateName" parameter:@{@"name" : self.nickNameTextField.text} success:^(id responseObject) {
+    NSString *url = self.isAiNickName ? @"/api/User/UpdateAIName" : @"/api/User/UpdateName";
+    NSDictionary *params = self.isAiNickName ? @{@"aiName" : self.nickNameTextField.text} : @{@"name" : self.nickNameTextField.text};
+    [[SLHttpCenter SharedInstance] getWithUrl:url parameter:params success:^(id responseObject) {
         [ZFToast ShowWithMessage:@"保存成功"];
-        SLLoginInfo *newLoginModel = [SLGlobalInfo SharedInstance].loginInfo;
-        newLoginModel.user.userName = self.nickNameTextField.text;
-        [SLGlobalInfo SharedInstance].loginInfo = newLoginModel;
+        if (self.isAiNickName) {
+            RoleModel *newRoleModel = [SLGlobalInfo SharedInstance].roleModel;
+            newRoleModel.aiName = self.nickNameTextField.text;
+            [SLGlobalInfo SharedInstance].roleModel = newRoleModel;
+        }else {
+            SLLoginInfo *newLoginModel = [SLGlobalInfo SharedInstance].loginInfo;
+            newLoginModel.user.userName = self.nickNameTextField.text;
+            [SLGlobalInfo SharedInstance].loginInfo = newLoginModel;
+        }
     } failure:^(SPRequestError *error) {
         
     }];

+ 3 - 2
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLModifyNicknameVc.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_0" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -12,6 +12,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SLModifyNicknameVc">
             <connections>
                 <outlet property="clearBtn" destination="9gf-Go-vyj" id="eVU-Df-hhL"/>
+                <outlet property="nickLabel" destination="4VN-rt-5Yj" id="XFi-jc-lcw"/>
                 <outlet property="nickNameTextField" destination="koY-eZ-oHY" id="jGT-4n-Mn9"/>
                 <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
             </connections>

+ 16 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.h

@@ -0,0 +1,16 @@
+//
+//  SLSexSetVc.h
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/5/31.
+//
+
+#import "SLBaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SLSexSetVc : SLBaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 86 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.m

@@ -0,0 +1,86 @@
+//
+//  SLSexSetVc.m
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/5/31.
+//
+
+#import "SLSexSetVc.h"
+#import "SLBaseCellView.h"
+
+@interface SLSexSetVc ()
+
+@property (nonatomic, strong) NSString *currentSelSex;
+
+@end
+
+@implementation SLSexSetVc
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view from its nib.
+    self.title = @"设置性别";
+    YMBarButtonItem *rightBarItem = [[YMBarButtonItem alloc] initWithTitle:@"完成  " target:self action:@selector(preserveBtnClick)];
+    rightBarItem.titleInsets = UIEdgeInsetsMake(0, 0, 0, 20);
+    self.navigationBar.rightBarButtonItem = rightBarItem;
+    [self confignSexSetView];
+    self.currentSelSex = [SLGlobalInfo SharedInstance].roleModel.aiSex;
+    [self updateSexSetView];
+}
+
+- (void)updateSexSetView {
+    [self.view.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        if ([obj isKindOfClass:SLBaseCellView.class]) {
+            SLBaseCellView *baseCell = obj;
+            baseCell.leftImageView.image = ImageName(@"check_circle");
+            if ([baseCell.titleLabel.text isEqualToString:self.currentSelSex]) {
+                baseCell.leftImageView.image = ImageName(@"check_circle_filled");
+            }
+        }
+    }];
+}
+
+- (void)confignSexSetView {
+    NSArray *arr = @[[SLPageModelDetail initWithTitle:@"男" bgImage:@"check_circle"],
+      [SLPageModelDetail initWithTitle:@"女" bgImage:@"check_circle"],];
+    [arr enumerateObjectsUsingBlock:^(SLPageModelDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        SLBaseCellView *baseCell = [[SLBaseCellView alloc] initWithFrame:CGRectZero];
+        baseCell.titleLabel.text = obj.title;
+        baseCell.subTitleLabel.text = @"";
+        baseCell.leftImageView.image = ImageName(obj.bgImage);
+        baseCell.rightImageViw.hidden = YES;
+        baseCell.tag = 8888 + idx;
+        WS(weakSelf);
+        __block SLBaseCellView *blockBaseCell = baseCell;
+        [baseCell addTapWithBlock:^{
+            blockBaseCell.contentView.backgroundColor = SLColSel;
+            [UIView animateWithDuration:0.5 animations:^{
+                blockBaseCell.contentView.backgroundColor = [UIColor whiteColor];
+            }];
+            weakSelf.currentSelSex = idx ? @"女" : @"男";
+            [weakSelf updateSexSetView];
+        }];
+        baseCell.backgroundColor = [UIColor whiteColor];
+        [self.view addSubview:baseCell];
+        CGFloat top = 56 * idx * KScaleW + kNavBarHeight + 10;
+        [baseCell mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.right.equalTo(self.view);
+            make.height.mas_equalTo(56 * KScaleW);
+            make.top.equalTo(self.view).offset(top);
+        }];
+        
+    }];
+}
+
+- (void)preserveBtnClick {
+    [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/UpdateAIGender" parameter:@{@"aiGender" : self.currentSelSex} success:^(id responseObject) {
+        [ZFToast ShowWithMessage:@"保存成功"];
+        RoleModel *newRoleModel = [SLGlobalInfo SharedInstance].roleModel;
+        newRoleModel.aiSex = self.currentSelSex;
+        [SLGlobalInfo SharedInstance].roleModel = newRoleModel;
+    } failure:^(SPRequestError *error) {
+        
+    }];
+}
+
+@end

+ 22 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/VCs/SLSexSetVc.xib

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SLSexSetVc">
+            <connections>
+                <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+            <viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
+        </view>
+    </objects>
+</document>

+ 8 - 2
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMyListCollectionViewCell.m

@@ -10,6 +10,7 @@
 #import "SLFeedbackVc.h"
 #import "SLMomentsVc.h"
 #import "SLUserCenterViewController.h"
+#import "SLAiSetVc.h"
 
 @implementation SLMyListCollectionViewCell
 
@@ -30,7 +31,13 @@
             [UIView animateWithDuration:0.5 animations:^{
                 blockBaseCell.contentView.backgroundColor = [UIColor whiteColor];
             }];
-            switch (idx) {
+            switch (idx - 1) {
+                case -1:
+                {
+                    SLAiSetVc *vc = [SLAiSetVc loadViewControllewWithNib];
+                    [self.viewController navPushViewController:vc animated:YES];
+                }
+                    break;
                 case 0:
                 {
                     
@@ -42,7 +49,6 @@
                     vc.userModel = [SLGlobalInfo SharedInstance].loginInfo.user;
                     vc.isFriendList = YES;
                     [self.viewController navPushViewController:vc animated:YES];
-//                    self.viewController.rdv_tabBarController.selectedIndex = 2;
                 }
                     break;
                 case 2:

+ 23 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.h

@@ -0,0 +1,23 @@
+//
+//  SLMySpeedCell.h
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/5/31.
+//
+
+#import <UIKit/UIKit.h>
+#import "SLCustomSegment.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SLMySpeedCell : UITableViewCell
+
+@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
+
+@property (weak, nonatomic) IBOutlet SLCustomSegment *segmentView;
+
+- (void)confignCell:(SLPageModelDetail *)detail;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 62 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.m

@@ -0,0 +1,62 @@
+//
+//  SLMySpeedCell.m
+//  SLAiELTS
+//
+//  Created by Gusont on 2023/5/31.
+//
+
+#import "SLMySpeedCell.h"
+
+@interface SLMySpeedCell()
+
+@end
+
+@implementation SLMySpeedCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    SLCustomSegment *segment = self.segmentView;
+    CGRect frame = segment.frame;
+    frame.size = CGSizeMake(kSCREEN_WIDTH - 24, frame.size.height);
+    segment.frame = frame;
+    segment.normalTitleFont = 13;
+    segment.selectTitleFont = 13;
+    segment.cornerRadius = 16.0f;
+    segment.backgroundColor = [[UIColor colorFormString:@"#767680"] colorWithAlphaComponent:0.12];
+    segment.tag = 110022;
+    segment.normalBackgroundColor = [UIColor clearColor];
+    segment.selectBackgroundColor = [UIColor whiteColor];
+    segment.titleNormalColor = [UIColor colorFormString:@"#8E8E93"];
+    segment.titleSelectColor = [UIColor blackColor];
+}
+
+- (void)confignCell:(SLPageModelDetail *)detail {
+    self.titleLabel.text = detail.title;
+    __block NSString *keyStr = @"";
+    NSString *speechRate;
+    NSInteger idx = 1;
+    if ([detail.title isEqualToString:@"口音设置"]) {
+        speechRate = [SLGlobalInfo SharedInstance].roleModel.language;
+    }
+    if ([detail.title isEqualToString:@"语速设置"]) {
+        speechRate = [SLGlobalInfo SharedInstance].roleModel.speechRate;
+    }
+    if (speechRate) {
+        [[RoleModel roleSpeedModelDict] enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
+            if ([obj isEqualToString:speechRate]) {
+                keyStr = key;
+                *stop = YES;
+            }
+        }];
+        idx = [detail.segments indexOfObject:keyStr];
+    }
+    [self.segmentView setTitlesWithArray:detail.segments];
+    [self.segmentView updateWithSpacing:2 topHeight:2];
+    self.segmentView.selectIndex = idx;
+//    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+//
+//    });
+}
+
+@end

+ 57 - 0
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/Cells/SLMySpeedCell.xib

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SLMySpeedCell" rowHeight="92" id="KGk-i7-Jjw" customClass="SLMySpeedCell">
+            <rect key="frame" x="0.0" y="0.0" width="350" height="92"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="350" height="92"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的AI设置" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cag-Y6-9jZ">
+                        <rect key="frame" x="12" y="12" width="80" height="26"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="26" id="mAh-66-l3C"/>
+                        </constraints>
+                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                        <nil key="textColor"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LW1-zg-qEQ" customClass="SLCustomSegment">
+                        <rect key="frame" x="12" y="40" width="326" height="32"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="32" id="V29-We-thG"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="LW1-zg-qEQ" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="3eV-sy-nP2"/>
+                    <constraint firstItem="LW1-zg-qEQ" firstAttribute="top" secondItem="Cag-Y6-9jZ" secondAttribute="bottom" constant="2" id="QtB-cU-YXA"/>
+                    <constraint firstItem="Cag-Y6-9jZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="h8u-Gk-xYL"/>
+                    <constraint firstItem="LW1-zg-qEQ" firstAttribute="leading" secondItem="Cag-Y6-9jZ" secondAttribute="leading" id="qyd-BJ-Ynq"/>
+                    <constraint firstItem="Cag-Y6-9jZ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="12" id="t2N-Lf-Asy"/>
+                </constraints>
+            </tableViewCellContentView>
+            <connections>
+                <outlet property="segmentView" destination="LW1-zg-qEQ" id="f2U-Bv-YT3"/>
+                <outlet property="titleLabel" destination="Cag-Y6-9jZ" id="tpj-kh-lL5"/>
+            </connections>
+            <point key="canvasLocation" x="93.129770992366403" y="15.492957746478874"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 0 - 1
SLAiELTS/SLAiELTS/ViewControllers/MyVC/Views/SLMySpeedView.m

@@ -114,7 +114,6 @@
     NSString *speechRate = [[RoleModel roleSpeedModelDict] objectForKey:title];
     if ([SLGlobalInfo SharedInstance].loginInfo && speechRate) {
         [[SLHttpCenter SharedInstance] getWithUrl:@"/api/User/UpdateSpeechRate" parameter:@{@"speechRate" : speechRate} success:^(id responseObject) {
-            [ZFToast ShowWithMessage:@"保存成功"];
             [SLGlobalInfo SharedInstance].roleModel.speechRate = speechRate;
             if (self.speedBtn.isSelected) {
                 [self speedBtnClick:self.speedBtn];

+ 0 - 5
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/RoleModel.h

@@ -26,11 +26,6 @@ typedef enum : NSUInteger {
 
 @property (nonatomic, strong) NSString *userId;
 
-/// 男,女
-@property (nonatomic, strong) NSString *dataSex;
-
-@property (nonatomic, strong) NSString *dataName;
-
 /// 语音速度:0.5,1.0,1.5
 @property (nonatomic, strong) NSString *speechRate;
 

+ 20 - 0
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/RoleModel.m

@@ -7,8 +7,28 @@
 
 #import "RoleModel.h"
 
+@interface RoleModel()
+
+/// 男,女
+@property (nonatomic, strong) NSString *dataSex;
+
+@property (nonatomic, strong) NSString *dataName;
+
+
+@end
+
 @implementation RoleModel
 
+- (void)setDataSex:(NSString *)dataSex {
+    _dataSex = dataSex;
+    _aiSex = _dataSex;
+}
+
+- (void)setDataName:(NSString *)dataName {
+    _dataName = dataName;
+    _aiName = _dataName;
+}
+
 + (NSDictionary *)roleModelDict {
     return @{@"英音" : @"1",
              @"美音" : @"0",

+ 2 - 2
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Models/SLNuisdkPlay.m

@@ -188,12 +188,12 @@ static BOOL loop_flag = NO;
     NSString *fontName = @"luna";
     if ([roleModel.language isEqualToString:@"1"]) {
         fontName = @"luna";
-        if ([roleModel.dataSex isEqualToString:@"男"]) {
+        if ([roleModel.aiSex isEqualToString:@"男"]) {
             fontName = @"luca";
         }
     }else {
         fontName = @"abby";
-        if ([roleModel.dataSex isEqualToString:@"男"]) {
+        if ([roleModel.aiSex isEqualToString:@"男"]) {
             fontName = @"andy";
         }
     }

+ 1 - 3
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/SLRoleLabelViewController.m

@@ -144,7 +144,7 @@
             }
         }
         if ([roleModelType integerValue] == SLRoleName) {
-            if (!self.roleModel.dataName.length) {
+            if (!self.roleModel.aiName.length) {
                 [ZFToast ShowWithMessage:@"请输入AI助教名称"];
                 return;
             }
@@ -153,8 +153,6 @@
     
     if (self.curSelIndex == self.secPageControl.count - 1) {
         self.roleModel.userId = [SLGlobalInfo SharedInstance].loginInfo.user.userId;
-        self.roleModel.aiSex = self.roleModel.dataSex;
-        self.roleModel.aiName = self.roleModel.dataName;
         NSDictionary *dict = [self.roleModel mj_keyValues];
         //InitializeSet
         //InsertAiData

+ 3 - 3
SLAiELTS/SLAiELTS/ViewControllers/RoleLabelVC/Views/SLRoleLabelView.m

@@ -194,7 +194,7 @@
         self.roleModel.userName = textField.text;
     }
     if (textField == self.nameTextField) {
-        self.roleModel.dataName = textField.text;
+        self.roleModel.aiName = textField.text;
     }
 }
 
@@ -245,7 +245,7 @@
     switch (self.roleLabelType) {
         case SLRoleSex:
         {
-            self.roleModel.dataSex = value;
+            self.roleModel.aiSex = value;
         }
             break;
         case SLRoleappearance:
@@ -279,7 +279,7 @@
             if ([title containsString:@"音"]) {
                 self.roleModel.language = value;
             }else if ([title containsString:@"性"]) {
-                self.roleModel.dataSex = value;
+                self.roleModel.aiSex = value;
             }else {
                 self.roleModel.speechRate = value;
             }