Переглянути джерело

Merge branch 'Branch_new' into Branch_new_launch

桂欢 1 рік тому
батько
коміт
45bc38ceec

+ 2 - 2
SLAiELTS/SLAiELTS.xcodeproj/project.pbxproj

@@ -2511,7 +2511,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 24;
+				CURRENT_PROJECT_VERSION = 27;
 				DEVELOPMENT_TEAM = 5WKRWDTA83;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2599,7 +2599,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 24;
+				CURRENT_PROJECT_VERSION = 27;
 				DEVELOPMENT_TEAM = 5WKRWDTA83;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 3 - 0
SLAiELTS/SLAiELTS/AppDelegate.mm

@@ -25,7 +25,10 @@
     UIViewController *launchScreenVc = [[UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil] instantiateInitialViewController];
     self.window.rootViewController = launchScreenVc;
 //    [SLHttpCenter SharedInstance].serverUrl = @"http://dlchat.zheke.com";
+//    [SLHttpCenter SharedInstance].webSocketUrl = @"ws://dlchat.zheke.com/api/Chat/WebSocketConnect";
     [SLHttpCenter SharedInstance].serverUrl = @"http://115.238.47.235:8995";
+    [SLHttpCenter SharedInstance].webSocketUrl = @"ws://115.238.47.235:8995/api/Chat/WebSocketConnect";
+
 //    [SLHttpCenter SharedInstance].serverUrl = @"http://10.0.0.14:8088";
     NSString *userPhone = [[NSUserDefaults standardUserDefaults] objectForKey:@"SLUserPhone"];
     NSString *userPassword = [[NSUserDefaults standardUserDefaults] objectForKey:@"SLUserPassword"];

+ 2 - 0
SLAiELTS/SLAiELTS/Tool/NetWorking/SLHttpCenter.h

@@ -42,6 +42,8 @@ static NSString *const kRequest_Data = @"data";
  */
 @property (nonatomic, strong)NSString *serverUrl;
 
+@property (nonatomic, strong)NSString *webSocketUrl;
+
 
 /*!
  @method

+ 1 - 2
SLAiELTS/SLAiELTS/Tool/NetWorking/SLWebSocketManager.m

@@ -19,7 +19,6 @@
 
 @implementation SLWebSocketManager
 
-static NSString *const SLWebSocketUrl = @"ws://115.238.47.235:8995/api/Chat/WebSocketConnect";
 
 #pragma mark-----PropertyList
 + (instancetype)SharedInstance {
@@ -35,7 +34,7 @@ static NSString *const SLWebSocketUrl = @"ws://115.238.47.235:8995/api/Chat/WebS
     if(self.webSocket){
         return;
     }
-    NSString *url = [NSString stringWithFormat:@"%@/%@",SLWebSocketUrl,[SLGlobalInfo SharedInstance].loginInfo.user.userId];
+    NSString *url = [NSString stringWithFormat:@"%@/%@",[SLHttpCenter SharedInstance].webSocketUrl,[SLGlobalInfo SharedInstance].loginInfo.user.userId];
     self.webSocket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:url]];
     self.webSocket.delegate = self;
     [self.webSocket open];

+ 2 - 1
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/Models/MessageModel.h

@@ -147,9 +147,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *message;
 
+//0文字1语音
 @property (nonatomic, assign) BOOL messageType;
 
-//是否语音
+//0发送1接收
 @property (nonatomic, assign) BOOL interactMode;
 
 @end

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

@@ -161,11 +161,15 @@
             __block NSInteger addIdx = 0;
             NSMutableArray *marr = [NSMutableArray arrayWithArray:chatModels];
             [msgRecives enumerateObjectsUsingBlock:^(SLMessageReceiveModel *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-                if ([obj.message containsString:msgModel.sendText] && addIdx == 0) {
-                    addIdx = idx;
+                if ([obj.message isEqualToString:msgModel.sendText] && addIdx == 0) {
+                    NSString *timeStr = [NSString stringWithFormat:@"%f",msgModel.sendTime * 1000];
+                    NSString *formtTime = [NSString timeFromFormatter:@"hh:mm" timeString:timeStr];
+                    if ([obj.sendDate isEqualToString:formtTime]) {
+                        addIdx = idx;
+                    }
                 }
                 if (addIdx != 0 && idx > addIdx) {
-                    if (obj.interactMode) {
+                    if (!obj.interactMode) {
                         MessageModel *model = [MessageModel initWithSendText:obj.message isReceive:obj.interactMode showMike:NO showText:YES isMike:NO];
                         [marr addObject:model];
                     }else {

+ 1 - 1
SLAiELTS/SLAiELTS/ViewControllers/Moments/MomentsVc/SLMomentsVc.m

@@ -117,8 +117,8 @@ static CGFloat textFieldH = 56;
     if ([self.userModel.userId isEqualToString:userModel.userId]) {
         self.userModel = userModel;
         [self.headerView updateHeaderViewWith:userModel.momentsMsgNotice];
+        self.headerView.bgSelImageView.hidden = NO;
         if (self.isFriendList) {
-            self.headerView.bgSelImageView.hidden = NO;
             self.headerView.frame = CGRectMake(0, 0, 0, 220 * KScaleW);
             self.tableView.tableHeaderView.frame = CGRectMake(0, 0, kSCREEN_WIDTH, 250 * KScaleW);
         }else {