Files
yuyin_ios/SweetParty/主类/Mine/GongHui/SPGonghuiApplyListCell.m
2025-08-08 11:05:33 +08:00

65 lines
2.0 KiB
Objective-C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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