Commit 5e5aeefd authored by admin's avatar admin

修复上传图片排序错误 返回时刷新所有列表

parent b405c64b
...@@ -2,16 +2,4 @@ ...@@ -2,16 +2,4 @@
<Bucket <Bucket
type = "0" type = "0"
version = "2.0"> version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket> </Bucket>
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
#define Url_h #define Url_h
// url 测试环境 // url 测试环境
// #define kRedStarURL @"http://218.244.151.129:7580/" //#define kRedStarURL @"http://218.244.151.129:7580/"
// 正式环境 // 正式环境
// #define kRedStarURL @"http://219.235.234.225:7580/" #define kRedStarURL @"http://219.235.234.225:7580/"
// 最新正式环境 // 最新正式环境
#define kRedStarURL @"http://219.235.234.212:7580/" // #define kRedStarURL @"http://219.235.234.212:7580/"
// 检查更新 // 检查更新
#define kCheckUpdateURL @"redstar-server/rest/ipapk?type=ipa" #define kCheckUpdateURL @"redstar-server/rest/ipapk?type=ipa"
......
...@@ -8,6 +8,14 @@ ...@@ -8,6 +8,14 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@protocol AddPictureDelegate <NSObject>
- (void)reloadList;
@end
@interface AddPictureViewController : UIViewController @interface AddPictureViewController : UIViewController
@property (nonatomic, copy) NSString *category; @property (nonatomic, copy) NSString *category;
@property (nonatomic, assign) id <AddPictureDelegate>delegate;
@end @end
...@@ -8,7 +8,16 @@ ...@@ -8,7 +8,16 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@protocol PictureDetailDelegate <NSObject>
- (void)reloadList;
@end
@interface PictureStoryViewController : UIViewController @interface PictureStoryViewController : UIViewController
@property (nonatomic, copy) NSString *uuid; @property (nonatomic, copy) NSString *uuid;
@property (nonatomic, strong) NSString *titleStr; @property (nonatomic, strong) NSString *titleStr;
@property (nonatomic, assign) id <PictureDetailDelegate>delegate;
@end @end
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.imageNameArray = [NSMutableArray array]; self.imageNameArray = [NSMutableArray array];
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self requestPicturePraiseDetail]; [self requestPicturePraiseDetail];
} }
...@@ -90,7 +90,6 @@ ...@@ -90,7 +90,6 @@
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"]; NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSString *url = [NSString stringWithFormat:@"%@%@%@?userUuid=%@", kRedStarURL, kPicturePraiseDetailURL, self.uuid, user_uuid]; NSString *url = [NSString stringWithFormat:@"%@%@%@?userUuid=%@", kRedStarURL, kPicturePraiseDetailURL, self.uuid, user_uuid];
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
HttpClient *http = [[HttpClient alloc] initWithUrl:url]; HttpClient *http = [[HttpClient alloc] initWithUrl:url];
[http getPicturePraiseDetailWithCompletion:^(id response, NSError *error) { [http getPicturePraiseDetailWithCompletion:^(id response, NSError *error) {
...@@ -146,13 +145,12 @@ ...@@ -146,13 +145,12 @@
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData]; [self.tableView reloadData];
}); });
}]; }];
} }
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
[self.tableView reloadData];
}]; }];
} }
...@@ -666,6 +664,11 @@ ...@@ -666,6 +664,11 @@
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
}]; }];
if (_delegate && [_delegate respondsToSelector:@selector(reloadList)]) {
[_delegate reloadList];
}
} }
} }
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define kPictureTableViewCell @"pictureTabelViewCell" #define kPictureTableViewCell @"pictureTabelViewCell"
@interface PictureViewController () <UITableViewDelegate, UITableViewDataSource, TaxisViewDelegate,ScopeTableViewDelegate, TimeTableViewDelegate > @interface PictureViewController () <UITableViewDelegate, UITableViewDataSource, TaxisViewDelegate,ScopeTableViewDelegate, TimeTableViewDelegate , AddPictureDelegate, PictureDetailDelegate>
@property (nonatomic, strong) MenuView *menuView; @property (nonatomic, strong) MenuView *menuView;
@property (nonatomic, strong) TaxisView *taxisView; @property (nonatomic, strong) TaxisView *taxisView;
...@@ -53,14 +53,6 @@ ...@@ -53,14 +53,6 @@
@end @end
@implementation PictureViewController @implementation PictureViewController
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self requestPicturePraise];
}
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
...@@ -78,6 +70,8 @@ ...@@ -78,6 +70,8 @@
self.navigationController.navigationBar.translucent = NO; self.navigationController.navigationBar.translucent = NO;
} }
[self requestPicturePraise];
_page = 0; _page = 0;
} }
...@@ -127,6 +121,7 @@ ...@@ -127,6 +121,7 @@
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"]; NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500303"]) { if ([permissions containsObject:@"500303"]) {
AddPictureViewController *addPic = [[AddPictureViewController alloc] init]; AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
addPic.delegate = self;
addPic.category = self.category; addPic.category = self.category;
[self.navigationController pushViewController:addPic animated:YES]; [self.navigationController pushViewController:addPic animated:YES];
...@@ -527,6 +522,11 @@ ...@@ -527,6 +522,11 @@
return mDate; return mDate;
} }
#pragma mark - AddPictureDelegate
- (void)reloadList
{
[self requestPicturePraise];
}
#pragma mark - MoreScreenDelegate #pragma mark - MoreScreenDelegate
- (void)scopeTableViewClick:(NSInteger)row - (void)scopeTableViewClick:(NSInteger)row
...@@ -647,6 +647,7 @@ ...@@ -647,6 +647,7 @@
{ {
PictureListModel *picList = _allPraiseListArray[indexPath.row]; PictureListModel *picList = _allPraiseListArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init]; PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.delegate = self;
storyVC.uuid = picList.uuid; storyVC.uuid = picList.uuid;
storyVC.titleStr = self.titleStr; storyVC.titleStr = self.titleStr;
[self.navigationController pushViewController:storyVC animated:YES]; [self.navigationController pushViewController:storyVC animated:YES];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment