桂欢 hai 1 ano
pai
achega
c17d42b618

+ 2 - 0
SLAiELTS/SLAiELTS/ViewControllers/Home/Models/SLChatListModel.h

@@ -29,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *dataName;
 
+@property (nonatomic, strong) NSString *sex;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 1 - 0
SLAiELTS/SLAiELTS/ViewControllers/Home/Views/SLHomeView.m

@@ -89,6 +89,7 @@
     model.userId = chatModel.friendId;
     model.userName = chatModel.dataName;
     model.userHead = chatModel.dataHead;
+    model.sex = chatModel.sex;
     vc.friendModel = model;
     [self.viewController navPushViewController:vc animated:YES];
 }

+ 6 - 3
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/SLMessageViewController.m

@@ -44,7 +44,6 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view from its nib.
     self.title = self.friendModel.userName;
-    [self configNavigationBar];
     dispatch_async(dispatch_queue_create("sl.cache.chat.date", DISPATCH_QUEUE_CONCURRENT), ^{
         NSString *key = [NSString stringWithFormat:@"%@--to--%@",[SLGlobalInfo SharedInstance].loginInfo.user.userId, self.friendModel.userId];
         NSArray *arr = [[NSUserDefaults standardUserDefaults] objectForKey:key];
@@ -77,7 +76,9 @@
         if (!msgModel.isReceive && msgModel.showMike) {
             [weakSelf.nuisdkPlay playSendVoice:msgModel];
         }else {
-            [weakSelf.nuisdkPlay startTTSWith:msgModel.sendText roleModel:[SLGlobalInfo SharedInstance].roleModel finshBlock:^{
+            RoleModel *model = [RoleModel mj_objectWithKeyValues:[[SLGlobalInfo SharedInstance].roleModel mj_JSONObject]];
+            model.dataSex = weakSelf.friendModel.sex;
+            [weakSelf.nuisdkPlay startTTSWith:msgModel.sendText roleModel:model finshBlock:^{
 
             }];
         }
@@ -88,6 +89,8 @@
 //        
 //    }];
     
+    [self configNavigationBar];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillShowNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardWillHideNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationEnterBackground) name: UIApplicationDidEnterBackgroundNotification object:nil];
@@ -204,7 +207,7 @@
         _mikeInputView.nuiSpeechRecognizer.recognizerResultBlock = ^(NSString * _Nonnull text, NSString * _Nonnull voicePath) {
             MessageModel *model = [MessageModel initWithSendText:text isReceive:NO showMike:YES showText:NO isMike:YES voicePath:voicePath];
             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                if (model.audioDuration < 1.2) {
+                if (model.audioDuration < 1.0) {
                     [ZFToast ShowWithMessage:@"说话时间太短!"];
                 }else {
                     model.toId = weakSelf.friendModel.userId;

+ 2 - 2
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/IMMessageView/YMIMBaseMessageCell.m

@@ -84,9 +84,9 @@
          
         CGFloat nowDate = [[NSDate date] timeIntervalSince1970];
         if (nowDate - msgModel.sendTime > 60 * 60 * 24) {
-            self.timeLabel.text = [NSString timeFromFormatter:@"M月d日 H:m" timeString:timeStr];
+            self.timeLabel.text = [NSString timeFromFormatter:@"M月d日 H:mm" timeString:timeStr];
         }else {
-            self.timeLabel.text = [NSString timeFromFormatter:@"H:m" timeString:timeStr];
+            self.timeLabel.text = [NSString timeFromFormatter:@"H:mm" timeString:timeStr];
         }
         topTimeHeight = 23.f;
         [self.timeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {

+ 0 - 13
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/SLMikeInputView.m

@@ -11,8 +11,6 @@
 
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *imgHeightConst;
 
-@property (nonatomic, strong) NSMutableArray *sinXViews;
-
 @end
 
 @implementation SLMikeInputView
@@ -49,25 +47,14 @@
     self.clipsToBounds = YES;
     self.contentView.hidden = YES;
     [self nuiSpeechRecognizer];
-    self.sinXViews = [NSMutableArray new];
-    for (NSUInteger i = 0; i < 32+12; i++) {
-        UIView *sinView = [[UIView alloc]initWithFrame:CGRectMake(200 + i * 5, 200, 3, 3)];
-        sinView.layer.cornerRadius = 1.5f;
-        sinView.layer.masksToBounds = YES;
-        sinView.backgroundColor = [UIColor redColor];
-        [self.sinXViews addObject:sinView];
-        [self addSubview:sinView];
-     }
     
     WS(weakSelf);
     self.nuiSpeechRecognizer.onVolumeChangedBlock = ^(CGFloat volume) {
         NSInteger v = MIN(36, (volume + 160) / 4);
         NSLog(@"===%ld==%f-%@",v,volume,[NSString stringWithFormat:@"音波_000%02ld",v]);
-        
         dispatch_async(dispatch_get_main_queue(), ^{
             weakSelf.mikeTipImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"音波_000%02ld.png",v]];
         });
-        
     };
 }