Files
featherVoice/QXLive/Mine(音域)/View/QXBodyPriceRuleView.m
2025-12-04 14:11:00 +08:00

46 lines
1.4 KiB
Objective-C

//
// QXBodyPriceRuleView.m
// QXLive
//
// Created by 启星 on 2025/11/25.
//
#import "QXBodyPriceRuleView.h"
@implementation QXBodyPriceRuleView
+(void)showInView:(UIView *)view currentBodyValue:(NSString *)currentBodyValue coin:(NSString *)coin bodyValue:(NSString *)bodyValue{
UINib *nib = [UINib nibWithNibName:@"QXBodyPriceRuleView" bundle:[NSBundle mainBundle]];
QXBodyPriceRuleView *ruleView = [nib instantiateWithOwner:nil options:nil].firstObject;
ruleView.frame = UIScreen.mainScreen.bounds;
ruleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
ruleView.bgView.alpha = 0;
ruleView.currentPriceLabel.text = currentBodyValue;
ruleView.bodyPriceLabel.text = [NSString stringWithFormat:@"收礼身价,等于通过累计收礼的价值,每%@个金币等于%@身价",coin,bodyValue];
[view addSubview:ruleView];
[UIView animateWithDuration:0.2 animations:^{
ruleView.bgView.alpha = 1;
}completion:^(BOOL finished) {
}];
}
- (IBAction)closeAction:(id)sender {
[UIView animateWithDuration:0.2 animations:^{
self.bgView.alpha = 0;
}completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
- (IBAction)commitAction:(id)sender {
[UIView animateWithDuration:0.3 animations:^{
self.bgView.alpha = 0;
}completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
@end