提交
This commit is contained in:
@@ -113,9 +113,19 @@
|
||||
showToast(@"请选择礼物");
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[QXMineNetwork roomAuctionStartWithRoomId:self.roomId user_id:self.userId gift_id:self.giftModel.gift_id relation_id:self.relationModel.relation_id auction_type:self.isRealLove?@"1":@"2" time_day:self.timeModel.relation_id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf hide];
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
|
||||
return;
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (strongSelf) {
|
||||
[strongSelf hide];
|
||||
}
|
||||
});
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
@@ -292,10 +302,21 @@
|
||||
}];
|
||||
}
|
||||
-(void)hide{
|
||||
if (!self.superview) {
|
||||
NSLog(@"⚠️ View already removed from superview");
|
||||
return;
|
||||
}
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
if (self.bgView) {
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
}
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
// 检查是否已经被移除
|
||||
if (self.superview) {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
// 避免在 dealloc 过程中访问其他属性
|
||||
// 不要在 completion block 中访问或设置其他属性
|
||||
}];
|
||||
}
|
||||
-(NSMutableArray *)relationshipArray{
|
||||
|
||||
Reference in New Issue
Block a user