69 lines
2.0 KiB
Objective-C
69 lines
2.0 KiB
Objective-C
//
|
|
// YYXQYueTAAlert.m
|
|
// YaYin
|
|
//
|
|
// Created by bj_szd on 2023/7/12.
|
|
// Copyright © 2023 YaYin. All rights reserved.
|
|
//
|
|
|
|
#import "YYXQYueTAAlert.h"
|
|
#import "YYXQYueTAModel.h"
|
|
|
|
@interface YYXQYueTAAlert ()
|
|
|
|
@property (nonatomic, copy) NSString *rid;
|
|
@property (nonatomic, copy) NSString *receive_uid;
|
|
|
|
@end
|
|
|
|
@implementation YYXQYueTAAlert
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
|
|
[self createUI];
|
|
}
|
|
|
|
- (void)createUI {
|
|
[self.agreeBtn setJianBianWithCGSize:CGSizeMake(ScreenWidth-30*2, 44)];
|
|
|
|
WEAK_SELF
|
|
[self.touchImgV dg_Tapped:^{
|
|
[weakSelf removeFromSuperview];
|
|
}];
|
|
}
|
|
|
|
- (void)onShowWith:(NSString *)rid receive_uid:(NSString *)receive_uid {
|
|
self.rid = rid;
|
|
self.receive_uid = receive_uid;
|
|
[KEYWINDOW addSubview:self];
|
|
|
|
[self onFetchData];
|
|
}
|
|
|
|
- (void)onFetchData {
|
|
NSDictionary *params = @{@"rid":self.rid, @"receive_uid":self.receive_uid};
|
|
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"/api/pub_room/wish_gift_info" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
|
YYXQYueTAModel *model = [YYXQYueTAModel mj_objectWithKeyValues:responseDic[@"data"]];
|
|
[self.avatarImgV sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab.text = model.nick_name;
|
|
[self.giftImgV sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
|
|
self.giftNameLab.text = model.gift_name;
|
|
self.giftPriceLab.text = [NSString stringWithFormat:@"%@", model.gift_price];
|
|
} Failure:^(id _Nonnull errorData) {
|
|
[self removeFromSuperview];
|
|
}];
|
|
}
|
|
|
|
- (IBAction)onAgree:(id)sender {
|
|
NSDictionary *params = @{@"rid":self.rid, @"receive_uid":self.receive_uid};
|
|
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"/api/pub_room/date_user_send_gift" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
|
|
[self removeFromSuperview];
|
|
} Failure:^(id _Nonnull errorData) {
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
@end
|