提交
This commit is contained in:
@@ -99,17 +99,18 @@
|
||||
break;
|
||||
case QXAlertViewTypeAgreeSong:
|
||||
case QXAlertViewTypeAgreePK:{
|
||||
MJWeakSelf
|
||||
@weakify(self)
|
||||
[self.cancelBtn setTitle:QXText(@"拒绝") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitle:QXText(@"同意") forState:(UIControlStateNormal)];
|
||||
__block int timeCount = 10;
|
||||
_timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
|
||||
self.timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
|
||||
@strongify(self);
|
||||
timeCount--;
|
||||
if (timeCount<=0) {
|
||||
[self->_timer invalidate];
|
||||
[weakSelf cancelAction];
|
||||
[self.timer invalidate];
|
||||
[self cancelAction];
|
||||
}else{
|
||||
[self->_cancelBtn setTitle:[NSString stringWithFormat:@"%@(%d)",QXText(@"拒绝"),timeCount] forState:(UIControlStateNormal)];
|
||||
[self.cancelBtn setTitle:[NSString stringWithFormat:@"%@(%d)",QXText(@"拒绝"),timeCount] forState:(UIControlStateNormal)];
|
||||
}
|
||||
}];
|
||||
}
|
||||
@@ -137,26 +138,28 @@
|
||||
self.titleLabel.text = title;
|
||||
}
|
||||
-(void)cancelAction{
|
||||
if (_timer) {
|
||||
[self->_timer invalidate];
|
||||
_timer = nil;
|
||||
if (self.timer) {
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
MJWeakSelf
|
||||
@weakify(self)
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
if (weakSelf.cancelBlock) {
|
||||
weakSelf.cancelBlock();
|
||||
@strongify(self)
|
||||
if (self.cancelBlock) {
|
||||
self.cancelBlock();
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
if (_timer) {
|
||||
[self->_timer invalidate];
|
||||
_timer = nil;
|
||||
if (self.timer) {
|
||||
[self.timer invalidate];
|
||||
self.timer = nil;
|
||||
}
|
||||
MJWeakSelf
|
||||
@weakify(self)
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
if (weakSelf.commitBlock) {
|
||||
weakSelf.commitBlock();
|
||||
@strongify(self)
|
||||
if (self.commitBlock) {
|
||||
self.commitBlock();
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"app_update_top_bg"]];
|
||||
self.topImageView.frame = CGRectMake(0, 0, self.bgView.width, ScaleWidth(170));
|
||||
self.topImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self.bgView addSubview:self.topImageView];
|
||||
|
||||
self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.topImageView.bottom-ScaleWidth(12), self.bgView.width, self.bgView.height-self.topImageView.height+ScaleWidth(12))];
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
-(void)initSubViews{
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_chirld_mode"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
}];
|
||||
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_first_recharge_bg"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.equalTo(self);
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
}];
|
||||
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_new_user_recharge"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.equalTo(self);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
}];
|
||||
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_nice_gift"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.equalTo(self);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
-(void)initSubViews{
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_realname"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
|
||||
@@ -260,6 +260,8 @@
|
||||
-(void)setDynamicModel:(QXDynamicModel *)dynamicModel{
|
||||
_dynamicModel = dynamicModel;
|
||||
if (![dynamicModel.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
[self.eventArray removeObjectAtIndex:2];
|
||||
}else{
|
||||
[self.eventArray removeLastObject];
|
||||
}
|
||||
MJWeakSelf
|
||||
@@ -321,7 +323,12 @@
|
||||
model3.icon = @"dynamic_delete";
|
||||
model3.name = QXText(@"删除");
|
||||
model3.Id = @"2";
|
||||
_eventArray = [NSMutableArray arrayWithArray:@[model1,model2,model3]];
|
||||
|
||||
QXShareViewModel *model4 = [[QXShareViewModel alloc] init];
|
||||
model4.icon = @"dynamic_user_black";
|
||||
model4.name = QXText(@"拉黑");
|
||||
model4.Id = @"3";
|
||||
_eventArray = [NSMutableArray arrayWithArray:@[model1,model2,model3,model4]];
|
||||
}
|
||||
return _eventArray;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user