65 lines
2.0 KiB
Objective-C
Executable File
65 lines
2.0 KiB
Objective-C
Executable File
//
|
||
// SPGonghuiApplyListCell.m
|
||
// SweetParty
|
||
//
|
||
// Created by bj_szd on 2022/7/4.
|
||
//
|
||
|
||
#import "SPGonghuiApplyListCell.h"
|
||
|
||
@implementation SPGonghuiApplyListCell
|
||
|
||
- (void)awakeFromNib {
|
||
[super awakeFromNib];
|
||
|
||
[self.agreeBtn styleGradiBlueColor];
|
||
}
|
||
|
||
- (void)setModel:(SPGonghuiApplyModel *)model {
|
||
_model = model;
|
||
|
||
[self.avatarImgV sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
||
self.nicknameLab.text = [NSString stringWithFormat:@"%@", model.nick_name];
|
||
self.IDLab.text = [NSString stringWithFormat:@"ID:%@", model.uid];
|
||
|
||
if (model.status == 1 || model.status == 3) {
|
||
self.refuseBtn.hidden = self.agreeBtn.hidden = YES;
|
||
self.statusLab.hidden = NO;
|
||
if (model.status == 1) {
|
||
self.statusLab.text = @"已同意";
|
||
self.statusLab.textColor = HEXCOLOR(0x00D195);
|
||
}else if (model.status == 3) {
|
||
self.statusLab.text = @"已拒绝";
|
||
self.statusLab.textColor = HEXCOLOR(0x999999);
|
||
|
||
}
|
||
}else {
|
||
self.refuseBtn.hidden = self.agreeBtn.hidden = NO;
|
||
self.statusLab.hidden = YES;
|
||
}
|
||
}
|
||
|
||
- (IBAction)onRefuse:(id)sender {
|
||
NSDictionary *params = @{@"id":C_string(self.model.id), @"type":@"2"};
|
||
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/guild/operate_guild" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
|
||
SPGonghuiApplyModel *model = self.model;
|
||
model.status = 3;
|
||
self.model = model;
|
||
} Failure:^(id _Nonnull errorData) {
|
||
|
||
}];
|
||
}
|
||
|
||
- (IBAction)onAgree:(id)sender {
|
||
NSDictionary *params = @{@"id":C_string(self.model.id), @"type":@"1"};
|
||
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/guild/operate_guild" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
|
||
SPGonghuiApplyModel *model = self.model;
|
||
model.status = 1;
|
||
self.model = model;
|
||
} Failure:^(id _Nonnull errorData) {
|
||
|
||
}];
|
||
}
|
||
|
||
@end
|