Fenix Wang 8 年 前
コミット
990199238e

BIN
NIMDemo/NIM.xcworkspace/xcuserdata/Fenix.xcuserdatad/UserInterfaceState.xcuserstate


+ 14 - 0
NIMDemo/NIM.xcworkspace/xcuserdata/Fenix.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -19,5 +19,19 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../../../../Fenix/XCode_Project/NIM_iOS_Demo_v3/NIMDemo/NIMDemo/ImagePagerViewController.h"
+            timestampString = "521008279.124025"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "6"
+            endingLineNumber = "6">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 27 - 10
NIMDemo/NIMDemo/GroupTableController.m

@@ -20,6 +20,8 @@
 
 @interface GroupTableController () <CLLocationManagerDelegate>
 
+@property (nonatomic, strong) UIButton *localBtn;
+
 @property (nonatomic, strong) NSMutableArray *groupArr;
 @property(strong, nonatomic) CLLocationManager *locationManager;
 
@@ -75,19 +77,19 @@
         }
     }
     
-    UIButton *localBtn = [UIButton buttonWithType:UIButtonTypeCustom];
-    [localBtn setTitle:title forState:UIControlStateNormal];
-    [localBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
-    [localBtn addTarget:self action:@selector(relocaltion) forControlEvents:UIControlEventTouchUpInside];
-    [localBtn setImage:[UIImage imageNamed:@"交易帖_03 (4)"] forState:UIControlStateNormal];
-    localBtn.imageEdgeInsets = UIEdgeInsetsMake(2, -5, 2, 5);
-    localBtn.titleLabel.font = [UIFont systemFontOfSize: 15.0];
-    [localBtn sizeToFit];
+    _localBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    [_localBtn setTitle:title forState:UIControlStateNormal];
+    [_localBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    [_localBtn addTarget:self action:@selector(relocaltion) forControlEvents:UIControlEventTouchUpInside];
+    [_localBtn setImage:[UIImage imageNamed:@"交易帖_03 (4)"] forState:UIControlStateNormal];
+    _localBtn.imageEdgeInsets = UIEdgeInsetsMake(2, -5, 2, 5);
+    _localBtn.titleLabel.font = [UIFont systemFontOfSize: 15.0];
+    [_localBtn sizeToFit];
     
     UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
     spacer.width = -5;
     
-    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:localBtn];
+    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:_localBtn];
     [navItem setLeftBarButtonItems:@[spacer, leftItem]];
     
     UIButton *createBtn = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -102,7 +104,7 @@
     if(!self.groupArr)
         [self setDataList];
     
-    if(user.districtRoomId && user.firstTimeJoin == YES)
+    if(user.districtRoomId && user.districtRoomId.length > 0 && user.firstTimeJoin == YES)
     {
         user.firstTimeJoin = NO;
         [self startTeamChat:user.districtRoomId animated:NO];
@@ -440,6 +442,21 @@
             
             [wself setDataList];
             [wself.tableView reloadData];
+            
+            if(user.district && user.district.length > 0)
+            {
+                NSString *title = @"";
+                if([user.city isEqualToString:user.district])
+                    title = user.city;
+                else
+                    title = [NSString stringWithFormat:@"%@%@", user.city, user.district];
+                
+                if(title.length > 6)
+                {
+                    title = [NSString stringWithFormat:@"%@%@", [title substringWithRange:NSMakeRange(0, 6)], @"..."];
+                }
+                [wself.localBtn setTitle:title forState:UIControlStateNormal];
+            }
         }
         
     } failure:^(NSURLSessionDataTask *task, NSError * error) {

+ 13 - 1
NIMDemo/NIMDemo/ImagePagerViewController.m

@@ -10,6 +10,8 @@
 #import "NIMPageView.h"
 #import "UIView+NTES.h"
 #import "UIImageView+WebCache.h"
+#import "SVProgressHUD.h"
+
 
 @interface ImagePagerViewController ()<NIMPageViewDataSource,NIMPageViewDelegate>
 
@@ -86,11 +88,21 @@
     [thumbView sd_setImageWithURL:thumbUrl];
     [subView addSubview:thumbView];
     
+    UIActivityIndicatorView* act = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(_pageView.width/2 - 15, _pageView.height/2 - 15, 30, 30)];
+    act.activityIndicatorViewStyle=UIActivityIndicatorViewStyleGray;
+    act.color = UIColor.whiteColor;
+    [act startAnimating];
+    
+    
     UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, _pageView.width, _pageView.height)];
-    [imgView sd_setImageWithURL:imageUrl];
+    [imgView sd_setImageWithURL:imageUrl completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
+        [act stopAnimating];
+    }];
     imgView.contentMode =  UIViewContentModeScaleAspectFit;
     [subView addSubview:imgView];
     
+    [subView addSubview:act];
+    
     return subView;
 }
 

+ 15 - 1
NIMDemo/NIMDemo/SectionTrade/TradeViewController.m

@@ -42,6 +42,8 @@
 @property (nonatomic,strong)  TradeTopBarItem           *tradeItem2;
 @property (nonatomic,strong)  NSTimer                   *timer;
 
+@property (nonatomic, strong) UISearchController        *seachController;
+
 @end
 
 @implementation TradeViewController
@@ -157,6 +159,18 @@ float postHeight = 30;
     [self.view addSubview:_tradeItem2];
     
     _timer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(requestLastTradeDataList) userInfo:nil repeats:YES];
+    
+    
+    
+    
+    
+    _seachController = [[UISearchController alloc] initWithSearchResultsController:nil];
+    _seachController.searchBar.barTintColor = User.orangeColor;
+    _seachController.hidesNavigationBarDuringPresentation = YES;
+    _seachController.searchBar.tintColor = UIColor.whiteColor;
+    
+    [self.view addSubview:_seachController.searchBar];
+    
 }
 
 - (void)didReceiveMemoryWarning {
@@ -316,7 +330,7 @@ float postHeight = 30;
 
 - (void)onTouchSearch:(int)sender{
     NSLog(@"onTouchSearch");
-    
+    [_seachController setActive:YES];
     
 }
 

+ 4 - 2
NIMDemo/NIMDemo/SocialPublishViewController.m

@@ -48,8 +48,8 @@ int picColumns = 5;
     
     
     
-    UINavigationItem *navItem = self.navigationController.navigationItem;
-    navItem.title = @"发布";
+    UINavigationItem *navItem = self.navigationItem;
+    [navItem setTitle:@"发布"];
     
     CGFloat navBottom = self.navigationController.navigationBar.bottom;
     
@@ -373,6 +373,8 @@ int picColumns = 5;
             NSLog(@"Json解析结果 = %d   %@", code, data);
             [self.view makeToast:@"发布成功" duration:2.0 position:CSToastPositionCenter];
             [self.navigationController popViewControllerAnimated:YES];
+            
+            [User sharedInfo].hasNewSocial = YES;
         }
         else{
             [self.view makeToast:@"发布失败" duration:2.0 position:CSToastPositionCenter];

+ 13 - 0
NIMDemo/NIMDemo/SocialTableViewController.m

@@ -98,6 +98,14 @@
     
     UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:publishBtn];
     [navItem setRightBarButtonItems:@[rightItem]];
+    
+    
+    if([User sharedInfo].hasNewSocial)
+    {
+        [User sharedInfo].hasNewSocial = false;
+        [self reset];
+    }
+    
 }
 
 - (UITableView *)tableView
@@ -118,6 +126,11 @@
     return _tableView;
 }
 
+- (void)reset{
+    _dataList = [[NSMutableArray alloc] init];
+    [_dataList addObject:[User sharedInfo]];
+    [self fetchDataList];
+}
 
 - (void)fetchDataList{
     

+ 3 - 2
NIMDemo/NIMDemo/User.h

@@ -31,8 +31,9 @@
 @property (nonatomic, nullable) NSString *districtRoomId;
 
 
-@property (nonatomic, assign)   int      newCreateTeamId;
-@property (nonatomic, assign)   BOOL     firstTimeJoin;
+@property (nonatomic, assign) int       newCreateTeamId;
+@property (nonatomic, assign) BOOL      firstTimeJoin;
+@property (nonatomic, assign) BOOL      hasNewSocial;
 
 @property (nonatomic, strong, nonnull)   NSMutableDictionary * giftGotDict;
 @property (nonatomic, strong, nonnull)   NSMutableDictionary * tradeGotDict;

+ 5 - 1
NIMDemo/NIMDemo/ViewController.m

@@ -16,6 +16,7 @@
 #import "NTESService.h"
 #import "NTESLoginManager.h"
 #import "HttpRequest.h"
+#import "SVProgressHUD.h"
 
 @interface ViewController ()
 
@@ -48,6 +49,8 @@
     //如果有缓存用户名密码推荐使用自动登录
     if ([account length] && [token length])
     {
+        [SVProgressHUD show];
+        
         NIMAutoLoginData *loginData = [[NIMAutoLoginData alloc] init];
         loginData.account = account;
         loginData.token = token;
@@ -59,8 +62,9 @@
             UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
             UIViewController *next = [board instantiateViewControllerWithIdentifier:@"TabBarView"];
             [self.navigationController pushViewController:next animated:NO];
+            [SVProgressHUD dismiss];
         } failure:^{
-            
+            [SVProgressHUD dismiss];
         }];
     }
     else