Browse Source

聊天界面增加跳转好友信息按钮

桂欢 2 years ago
parent
commit
da51588a71

+ 15 - 0
SLAiELTS/SLAiELTS/ViewControllers/MessageVC/SLMessageViewController.m

@@ -9,6 +9,7 @@
 #import "YMChatServiceView.h"
 #import "MessageModel.h"
 #import "SLNuisdkPlay.h"
+#import "SLFriensInfoVc.h"
 
 @interface SLMessageViewController ()
 
@@ -25,10 +26,24 @@
     self.nuisdkPlay = nil;
 }
 
+- (void)configNavigationBar {
+    UIImage *creatImage =[UIImage imageNamed:@"icon_pyq_more_back"];
+    YMBarButtonItem *rightBarItem =[[YMBarButtonItem alloc]initWithImage:creatImage style:YMBarButtonItemPlain target:self action:@selector(moreBtnClick)];
+    rightBarItem.titleInsets = UIEdgeInsetsMake(0, 0, 0, 20);
+    self.navigationBar.rightBarButtonItem = rightBarItem;
+}
+
+- (void)moreBtnClick {
+    SLFriensInfoVc *vc = [SLFriensInfoVc loadViewControllewWithNib];
+    vc.friendModel = self.friendModel;
+    [self navPushViewController:vc animated:YES];
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view from its nib.
     self.title = self.friendModel.name;
+    [self configNavigationBar];
     NSString *key = [NSString stringWithFormat:@"%@--to--%@",self.friendModel.userId, self.friendModel.contactsId];
     NSArray *arr = [[NSUserDefaults standardUserDefaults] objectForKey:key];
     if (arr) {