|
|
@@ -21,8 +21,6 @@
|
|
|
#import "HomeMemberViewController.h"
|
|
|
#import "JYPullToRefreshController.h"
|
|
|
|
|
|
-#import "MoreBtnModel.h"
|
|
|
-
|
|
|
#define kfMemberTableViewCellHeight 100.0f
|
|
|
#define kiCellInset 10
|
|
|
#define kiCellItem 2
|
|
|
@@ -56,8 +54,6 @@
|
|
|
BOOL _isNotFirstLoading, _isDeleteMode;
|
|
|
NSInteger _deviceFlag;
|
|
|
NSString *_masterNickname;
|
|
|
-
|
|
|
- NSMutableArray<MoreBtnModel *> *_arrMoreBtn;
|
|
|
}
|
|
|
|
|
|
@property (strong, nonatomic) JYPullToRefreshController *refreshController;
|
|
|
@@ -231,12 +227,12 @@
|
|
|
// NSMutableArray *btnArray = [NSMutableArray arrayWithObjects:[NSNumber numberWithInteger:masterChange],[NSNumber numberWithInteger:add],[NSNumber numberWithInteger:del], nil];
|
|
|
//
|
|
|
// [self toggleOptionsWithArray:sender btnArray:btnArray];
|
|
|
- [self toggleOptionsWithArray:sender btnArray:_arrMoreBtn];
|
|
|
+ [self toggleOptionsWithArray:sender btnArray:_moreBtnArray];
|
|
|
}
|
|
|
|
|
|
- (void)setMoreBtnArray {
|
|
|
- if (_arrMoreBtn == nil) {
|
|
|
- _arrMoreBtn = [NSMutableArray array];
|
|
|
+ if (_moreBtnArray == nil) {
|
|
|
+ _moreBtnArray = [NSMutableArray array];
|
|
|
}
|
|
|
|
|
|
if (![[JDFacade facade].loginUser hasHomeHub]) {
|
|
|
@@ -268,12 +264,12 @@
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- [_arrMoreBtn addObject:btnModel];
|
|
|
+ [_moreBtnArray addObject:btnModel];
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
MoreBtnModel *btnModel = [[MoreBtnModel alloc] initWithTyep:Refresh isEnable:YES];
|
|
|
- [_arrMoreBtn addObject:btnModel];
|
|
|
+ [_moreBtnArray addObject:btnModel];
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -320,7 +316,8 @@
|
|
|
|
|
|
if (!_masterNickname) {
|
|
|
|
|
|
- NSString *path = [NSString stringWithFormat:API_GET_HOMEGROUP_MEMBERS, [[JDFacade facade].loginUser custId], [[JDFacade facade].loginUser ctrtGrpId]];
|
|
|
+ NSString *path = [[JDFacade facade] getUrlWithCustAndGroupID:API_GET_HOMEGROUP_MEMBERS aditional:nil];
|
|
|
+// NSString *path = [NSString stringWithFormat:API_GET_HOMEGROUP_MEMBERS, [[JDFacade facade].loginUser custId], [[JDFacade facade].loginUser ctrtGrpId]];
|
|
|
|
|
|
[[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:nil modelClass:[HomeMemberListModel class] completion:^(id responseObject) {
|
|
|
if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
|
|
|
@@ -361,7 +358,8 @@
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- NSString *path = [NSString stringWithFormat:API_GET_HOMEGROUP_MEMBERS, [[JDFacade facade].loginUser custId], [[JDFacade facade].loginUser ctrtGrpId]];
|
|
|
+ NSString *path = [[JDFacade facade] getUrlWithCustAndGroupID:API_GET_HOMEGROUP_MEMBERS aditional:nil];
|
|
|
+// NSString *path = [NSString stringWithFormat:API_GET_HOMEGROUP_MEMBERS, [[JDFacade facade].loginUser custId], [[JDFacade facade].loginUser ctrtGrpId]];
|
|
|
|
|
|
[[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:nil modelClass:[HomeMemberListModel class] completion:^(id responseObject) {
|
|
|
if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
|
|
|
@@ -460,7 +458,7 @@
|
|
|
|
|
|
[cell.btnProfile sd_setBackgroundImageWithURL:[NSURL URLWithString:member.imageFileName] forState:UIControlStateNormal placeholderImage:nil options:SDWebImageRefreshCached];
|
|
|
|
|
|
- cell.lblNickname.text = member.nickname;
|
|
|
+ cell.lblNickname.text = @"";
|
|
|
cell.lblMemID.text = member.memberId;
|
|
|
|
|
|
if ([member.memberTypeCode isEqualToString:KNEET_MEMBER_TYPE_HOME]) {
|
|
|
@@ -490,6 +488,9 @@
|
|
|
cell.chkSelect.value = member;
|
|
|
cell.chkSelect.checked = [cell.chkSelect getCheckStatusFromValue];
|
|
|
|
|
|
+ cell.btnDelete.hidden = !(_isDeleteMode && [member.gradeCode isEqualToString:KNEET_MEMBER_SIMPLE] && _memberList.count > 1);
|
|
|
+ cell.btnDelete.value = member;
|
|
|
+
|
|
|
rcell = cell;
|
|
|
} else {
|
|
|
HomeMemberAddCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AddCollectionCellIdentifier" forIndexPath:indexPath];
|
|
|
@@ -507,37 +508,8 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
-//- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
|
|
|
-// viewForSupplementaryElementOfKind:(NSString *)kind
|
|
|
-// atIndexPath:(NSIndexPath *)indexPath
|
|
|
-//{
|
|
|
-//
|
|
|
-// HomeMemberCollectionFooterView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter
|
|
|
-// withReuseIdentifier:@"FooterIdentifier" forIndexPath:indexPath];
|
|
|
-
|
|
|
-// [footerView.btnAdd.label setUnderLine:footerView.btnAdd.label.text];
|
|
|
-// if (![footerView.btnAdd actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
|
|
|
-// [footerView.btnAdd addTarget:self action:@selector(addNewMember) forControlEvents:UIControlEventTouchUpInside];
|
|
|
-// }
|
|
|
-// return footerView;
|
|
|
-//}
|
|
|
-
|
|
|
-//- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section {
|
|
|
-// if (_memberList.count % _deviceFlag != 0 || [JDFacade facade].loginUser.level < 90 || _isDeleteMode) {//마스터 권한이 아니거나, 짝수가 아닐 경우
|
|
|
-// return CGSizeZero;
|
|
|
-// }
|
|
|
-
|
|
|
-// return CGSizeMake(ViewWidth(_collectionView), 168.0f);
|
|
|
-//}
|
|
|
-
|
|
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
- NSLog(@"Phone View Size : %f", IPHONE_WIDTH);
|
|
|
- NSLog(@"Collection View Size : %f", ViewWidth(_collectionView));
|
|
|
- NSLog(@"Cell Width Size : %f", (ViewWidth(_collectionView)-kiCellInset) / kiCellItem);
|
|
|
- NSLog(@"Cell Height Size : %f", ((ViewWidth(_collectionView)-kiCellInset)+kiCellRatio) / kiCellItem);
|
|
|
-
|
|
|
return CGSizeMake((ViewWidth(_collectionView)-kiCellInset) / kiCellItem, ((ViewWidth(_collectionView)-kiCellInset)+kiCellRatio) / kiCellItem);
|
|
|
- // return CGSizeMake((ViewWidth(_collectionView)-(_deviceFlag*kiCellInsetSize)) / _deviceFlag, 168.0f);
|
|
|
}
|
|
|
|
|
|
// Cell 사이 최소 간격
|