Browse Source

语音消息复制

桂欢 1 year ago
parent
commit
8fc05e1990

+ 1 - 1
SLAiELTS/SLAiELTS/AppDelegate.mm

@@ -21,7 +21,7 @@
     // Override point for customization after application launch.
     self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
     self.window.backgroundColor = [UIColor whiteColor];
-    [SLHttpCenter SharedInstance].serverUrl = @"http://115.238.47.235:8995";
+    [SLHttpCenter SharedInstance].serverUrl = @"http://dlchat.zheke.com";
 //    [SLHttpCenter SharedInstance].serverUrl = @"http://10.0.0.14:8088";
 //    SLBaseTabBarController *baseVc = [[SLBaseTabBarController alloc] init];
     UIViewController *vc = [SLLoginVCViewController loadViewControllewWithNib];

+ 22 - 0
SLAiELTS/SLAiELTS/Assets.xcassets/My/icon_mike_copy.imageset/Contents.json

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

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


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


+ 1 - 1
SLAiELTS/SLAiELTS/Tool/NetWorking/SLHttpCenter.m

@@ -10,7 +10,7 @@
 #import "AFNetworking.h"
 #import "SPRequestError.h"
 #import <CoreTelephony/CTCellularData.h>
-#define KTimeoutInterval 15;
+#define KTimeoutInterval 60;
 static NSString *const kNOConnect = @"检测到没有网络";
 
 @interface SLHttpCenter ()

+ 1 - 0
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Models/SLMikeSegmentModel.h

@@ -14,6 +14,7 @@ typedef enum : NSUInteger {
     SLMikeInputHidden = 3,//隐藏
     SLMikeInputTrans = 4,//翻译的英文
     SLMsgRepeat = 5,//重发
+    SLMsgCopy = 6,//复制
 
 } SLMikeInputType;
 

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

@@ -79,35 +79,8 @@
         if (!msgModel.isReceive && msgModel.showMike) {
             [weakSelf.nuisdkPlay playSendVoice:msgModel];
         }else {
-//            CGFloat f1 = [[NSDate date] timeIntervalSince1970];
             [weakSelf.nuisdkPlay startTTSWith:msgModel.sendText roleModel:[SLGlobalInfo SharedInstance].roleModel finshBlock:^{
-//                CGFloat f2 = [[NSDate date] timeIntervalSince1970];
-//                NSArray *msgArr = [msgModel.sendText componentsSeparatedByString:@" "];
-//                __block CGFloat m = 0;
-//                [msgArr enumerateObjectsUsingBlock:^(NSString *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-//                    NSInteger l = obj.length;
-//                    CGFloat x = 0;
-//                    if (l > 12) {
-//                        x = 20.0;
-//                    }else if (l > 9 && l < 12) {
-//                        x = 18.0;
-//                    }else if (l > 5 && l < 10) {
-//                        x = 14.0;
-//                    }else if (l > 3 && l < 6) {
-//                        x = 12.0;
-//                    }else {
-//                        x = 9.0;
-//                    }
-//                    m += MIN(obj.length / x, 0.6);
-//
-//                }];
-//                NSInteger timeLong = ceil(msgModel.sendText.length / 4.0 / 3);
-//                NSLog(@"%ld------=====%ld---%f---%f--%@",msgArr.count, timeLong, f2 - f1, m, msgModel.sendText);
-//                [SLCustomizeAlert showAletrWithTitle:@"播放完成" message:[NSString stringWithFormat:@"字符长度%ld\n除以12时长:%ld\n单词个数:%ld\n实际播放时长:%f\n计算时长:%f\n",msgModel.sendText.length,timeLong,msgArr.count,f2-f1,ceil(m)] sureBtnTitle:@"确定" cancelBtnTitle:@"" sureBtnAction:^{
-//
-//                } cancelBtnAction:^{
-//
-//                }];
+
             }];
         }
     };

+ 4 - 0
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/IMMessageView/YMIMBaseMessageCell.m

@@ -383,6 +383,7 @@
             }
             if (self.msgModel.isReceive) {
                 [arr insertObject:[SLMikeSegmentModel initWithSegTitle: @"播放" segImage:@"icon_filled_talk" mikeType:SLMikeInputBroadcast] atIndex:0];
+                [arr addObject:[SLMikeSegmentModel initWithSegTitle: @"复制" segImage:@"icon_mike_copy" mikeType:SLMsgCopy]];
             }
         }else if (self.msgModel.showMike && self.msgModel.showText) {
             if (bgView == self.mikeLabelBgView) {
@@ -393,6 +394,9 @@
             }
             if (bgView == self.messageLabelBgView) {
                 [arr addObject:[SLMikeSegmentModel initWithSegTitle:@"隐藏" segImage:@"icon_mike_delete" mikeType:SLMikeInputHidden]];
+                if (self.msgModel.isReceive) {
+                    [arr addObject:[SLMikeSegmentModel initWithSegTitle: @"复制" segImage:@"icon_mike_copy" mikeType:SLMsgCopy]];
+                }
             }
         }
         

+ 5 - 0
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Views/IMMessageView/YMIMMessageCollectionView.m

@@ -258,6 +258,11 @@
                 [weakSelf resultsRequestWith:model];
             }
                 break;
+            case SLMsgCopy:
+            {
+                [[UIPasteboard generalPasteboard] setString:model.sendText];
+            }
+                break;
             default:
                 break;
         }