56 lines
1.2 KiB
Objective-C
Executable File
56 lines
1.2 KiB
Objective-C
Executable File
//
|
|
// YYRoomNameAlert.m
|
|
// SweetParty
|
|
//
|
|
// Created by bj_szd on 2022/6/9.
|
|
//
|
|
|
|
#import "YYRoomNameAlert.h"
|
|
|
|
@interface YYRoomNameAlert ()
|
|
|
|
@end
|
|
|
|
@implementation YYRoomNameAlert
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
|
|
[self createUI];
|
|
}
|
|
|
|
- (void)createUI {
|
|
[self.confirmBtn setJianBianWithCGSize:CGSizeMake(ScreenWidth-32*2, 45)];
|
|
|
|
WEAK_SELF
|
|
[self.touchImgV dg_Tapped:^{
|
|
[weakSelf removeFromSuperview];
|
|
}];
|
|
}
|
|
|
|
- (void)setModel:(YYRoomSetModel *)model {
|
|
_model = model;
|
|
|
|
self.nameTF.text = model.room_name;
|
|
}
|
|
|
|
- (IBAction)onConfirm:(id)sender {
|
|
if (self.nameTF.text.length <= 0) {
|
|
[HelpPageDefine showMessage:@"请输入房间名字"];
|
|
return;
|
|
}
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithDictionary:self.model.mj_JSONObject];
|
|
[params setObject:self.nameTF.text forKey:@"room_name"];
|
|
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"/api/room/modify_room_info" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
|
|
if (self.onCompleteBlock) {
|
|
self.onCompleteBlock();
|
|
}
|
|
[self removeFromSuperview];
|
|
|
|
} Failure:^(id _Nonnull errorData) {
|
|
|
|
}];
|
|
}
|
|
|
|
@end
|