@property (nonatomic,strong) MJRefreshBaseView *baseView;
@property (nonatomic,strong) MJRefreshHeaderView *headerView;
@property (nonatomic,strong) MJRefreshFooterView *footerView;
self.headerView = [[MJRefreshHeaderView alloc]initWithScrollView:_tableView];
self.footerView = [[MJRefreshFooterView alloc]initWithScrollView:_tableView];
self.headerView.delegate = self;
self.footerView.delegate = self;
#pragma mark - 刷新代理协议
-(void)sendMessage{
[self.baseView endRefreshing];
}
-(void)refreshViewBeginRefreshing:(MJRefreshBaseView *)refreshView{
if (refreshView == _headerView) {
_down = YES;
_baseView = refreshView;
[self geturl:KgetDynamicsV17];
}
else if (refreshView == _footerView){
_down = NO;
_baseView = refreshView;
NSString *url = [NSString stringWithFormat:KgetDynamicsV17FriendRefresh,[UserModel sharedInstance].memberId,self.regDateLast];
[self geturl:url];
}
}
if (_down) {
[_tableDataSource removeAllObjects];
}
NSMutableDictionary * param_Refresh = [NSMutableDictionary dictionary];
NSString *memStr = [UserModel sharedInstance].memberId;
[param_Refresh setValue:memStr forKey:@"memberId"];
[param_Refresh setValue:self.regDateLast forKey:@"beforeDynamicId"];
[param_Refresh setValue:KAPPID forKey:@"appId"];
[param_Refresh setValue:KappSecret forKey:@"appSecret"];
[param_Refresh setValue:[CommonTools getTimeScamp] forKey:@"timestamp"];
NSArray * paramArr = @[[NSString stringWithFormat:@"memberId%@",param_Refresh[@"memberId"]],[NSString stringWithFormat:@"beforeDynamicId%@",param_Refresh[@"beforeDynamicId"]],[NSString stringWithFormat:@"appId%@",param_Refresh[@"appId"]],[NSString stringWithFormat:@"appSecret%@",param_Refresh[@"appSecret"]],[NSString stringWithFormat:@"timestamp%@",param_Refresh[@"timestamp"]]];
//刷新的时候只要再传这两个参数就可以了!!!
[_param setValue:param_Refresh[@"timestamp"] forKey:@"timestamp"];
[_param setValue:[CommonTools tokenmd5StringFromArray:paramArr] forKey:@"digest"];
@property (nonatomic,strong) MJRefreshHeaderView *headerView;
@property (nonatomic,strong) MJRefreshFooterView *footerView;
self.headerView = [[MJRefreshHeaderView alloc]initWithScrollView:_tableView];
self.footerView = [[MJRefreshFooterView alloc]initWithScrollView:_tableView];
self.headerView.delegate = self;
self.footerView.delegate = self;
#pragma mark - 刷新代理协议
-(void)sendMessage{
[self.baseView endRefreshing];
}
-(void)refreshViewBeginRefreshing:(MJRefreshBaseView *)refreshView{
if (refreshView == _headerView) {
_down = YES;
_baseView = refreshView;
[self geturl:KgetDynamicsV17];
}
else if (refreshView == _footerView){
_down = NO;
_baseView = refreshView;
NSString *url = [NSString stringWithFormat:KgetDynamicsV17FriendRefresh,[UserModel sharedInstance].memberId,self.regDateLast];
[self geturl:url];
}
}
if (_down) {
[_tableDataSource removeAllObjects];
}
NSMutableDictionary * param_Refresh = [NSMutableDictionary dictionary];
NSString *memStr = [UserModel sharedInstance].memberId;
[param_Refresh setValue:memStr forKey:@"memberId"];
[param_Refresh setValue:self.regDateLast forKey:@"beforeDynamicId"];
[param_Refresh setValue:KAPPID forKey:@"appId"];
[param_Refresh setValue:KappSecret forKey:@"appSecret"];
[param_Refresh setValue:[CommonTools getTimeScamp] forKey:@"timestamp"];
NSArray * paramArr = @[[NSString stringWithFormat:@"memberId%@",param_Refresh[@"memberId"]],[NSString stringWithFormat:@"beforeDynamicId%@",param_Refresh[@"beforeDynamicId"]],[NSString stringWithFormat:@"appId%@",param_Refresh[@"appId"]],[NSString stringWithFormat:@"appSecret%@",param_Refresh[@"appSecret"]],[NSString stringWithFormat:@"timestamp%@",param_Refresh[@"timestamp"]]];
//刷新的时候只要再传这两个参数就可以了!!!
[_param setValue:param_Refresh[@"timestamp"] forKey:@"timestamp"];
[_param setValue:[CommonTools tokenmd5StringFromArray:paramArr] forKey:@"digest"];