|
|
@@ -0,0 +1,142 @@
|
|
|
+//
|
|
|
+// imageVersionUpdateFailView.m
|
|
|
+// 双子星云手机
|
|
|
+//
|
|
|
+// Created by xd h on 2024/12/31.
|
|
|
+//
|
|
|
+
|
|
|
+#import "imageVersionUpdateFailView.h"
|
|
|
+
|
|
|
+@implementation imageVersionUpdateFailView
|
|
|
+
|
|
|
+- (id)initWithFrame:(CGRect)frame{
|
|
|
+ self = [super initWithFrame:frame];
|
|
|
+ self.backgroundColor = [UIColor hwColor:@"000000" alpha:0.6];
|
|
|
+ [self drawAnyView];
|
|
|
+
|
|
|
+ return self;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)drawAnyView{
|
|
|
+ UIView*whiteBgView = [UIView new];
|
|
|
+ whiteBgView.layer.cornerRadius = 8;
|
|
|
+ whiteBgView.backgroundColor = [UIColor whiteColor];
|
|
|
+ [self addSubview:whiteBgView];
|
|
|
+
|
|
|
+ [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(343.f);
|
|
|
+ make.width.mas_equalTo(300.f);
|
|
|
+ make.centerY.mas_equalTo(-40.f);
|
|
|
+ make.centerX.mas_equalTo(0.f);
|
|
|
+ }];
|
|
|
+
|
|
|
+ UIImageView *topImage = [[UIImageView alloc] init];
|
|
|
+ topImage.image = [UIImage imageNamed:@"imageVersionFailTip"];
|
|
|
+ [whiteBgView addSubview:topImage];
|
|
|
+
|
|
|
+ [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(104.f);
|
|
|
+ make.width.mas_equalTo(123.f);
|
|
|
+ make.centerX.mas_equalTo(0.f);
|
|
|
+ make.top.mas_equalTo(30.f);
|
|
|
+ }];
|
|
|
+
|
|
|
+ NSString *curTitleStr = NSLocalizedString(@"image_version_update_fail_title",nil);
|
|
|
+ UILabel *titleLab = [[UILabel alloc] init];
|
|
|
+ titleLab.text = curTitleStr;
|
|
|
+ titleLab.numberOfLines = 0;
|
|
|
+ titleLab.textColor = [UIColor blackColor];
|
|
|
+ titleLab.font = [UIFont boldSystemFontOfSize:18.0];
|
|
|
+ titleLab.textAlignment = NSTextAlignmentCenter;
|
|
|
+ [whiteBgView addSubview:titleLab];
|
|
|
+
|
|
|
+ [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ //make.height.mas_equalTo(60);
|
|
|
+ make.right.mas_equalTo(-20.f);
|
|
|
+ make.left.mas_equalTo(20.f);
|
|
|
+ make.top.equalTo(topImage.mas_bottom).offset(20);
|
|
|
+ }];
|
|
|
+
|
|
|
+ NSString *tip1Str = NSLocalizedString(@"image_version_update_fail_tip1",nil);
|
|
|
+ UILabel *tipaLab = [[UILabel alloc] init];
|
|
|
+ tipaLab.text = tip1Str;
|
|
|
+ tipaLab.numberOfLines = 0;
|
|
|
+ tipaLab.textColor = [UIColor hwColor:@"#666666"];
|
|
|
+ tipaLab.font = [UIFont systemFontOfSize:14.0];
|
|
|
+ tipaLab.textAlignment = NSTextAlignmentCenter;
|
|
|
+ [whiteBgView addSubview:tipaLab];
|
|
|
+
|
|
|
+ [tipaLab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ //make.height.mas_equalTo(60);
|
|
|
+ make.right.mas_equalTo(-20.f);
|
|
|
+ make.left.mas_equalTo(20.f);
|
|
|
+ make.top.equalTo(titleLab.mas_bottom).offset(10);
|
|
|
+ }];
|
|
|
+
|
|
|
+ NSString *tip2Str = [[NSString alloc] initWithFormat:@"SN:%@",ksharedAppDelegate.DeviceThirdIdMod.data.changeSn];
|
|
|
+ UILabel *tip2Lab = [[UILabel alloc] init];
|
|
|
+ tip2Lab.text = tip2Str;
|
|
|
+ tip2Lab.numberOfLines = 0;
|
|
|
+ tip2Lab.textColor = [UIColor hwColor:@"#666666"];
|
|
|
+ tip2Lab.font = [UIFont systemFontOfSize:14.0];
|
|
|
+ tip2Lab.textAlignment = NSTextAlignmentCenter;
|
|
|
+ [whiteBgView addSubview:tip2Lab];
|
|
|
+
|
|
|
+ [tip2Lab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ //make.height.mas_equalTo(60);
|
|
|
+ make.right.mas_equalTo(-20.f);
|
|
|
+ make.left.mas_equalTo(20.f);
|
|
|
+ make.top.equalTo(tipaLab.mas_bottom).offset(5);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+ UIButton *knowBut = [[UIButton alloc] init];
|
|
|
+ [knowBut setTitle:NSLocalizedString(@"common_I_know",nil) forState:UIControlStateNormal];
|
|
|
+ //knowBut.layer.cornerRadius = 8;
|
|
|
+ //knowBut.layer.masksToBounds = YES;
|
|
|
+ [knowBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
|
+ [knowBut addTarget:self action:@selector(colseFun) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [whiteBgView addSubview:knowBut];
|
|
|
+
|
|
|
+ CAGradientLayer *gradientLayer = [CAGradientLayer layer];
|
|
|
+ gradientLayer.frame = CGRectMake(0, 0, 268, 40);
|
|
|
+ gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:1.0].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:1.0].CGColor];
|
|
|
+ gradientLayer.locations = @[@(0), @(1.0f)];
|
|
|
+ gradientLayer.startPoint = CGPointMake(0, 0.5);
|
|
|
+ gradientLayer.endPoint = CGPointMake(0.97, 0.5);
|
|
|
+ gradientLayer.cornerRadius = 8;
|
|
|
+ [knowBut.layer addSublayer:gradientLayer];
|
|
|
+
|
|
|
+// knowBut.layer.shadowColor = [UIColor hwColor:@"#058DFB"].CGColor;
|
|
|
+// // 设置阴影透明度(0.0到1.0)
|
|
|
+// knowBut.layer.shadowOpacity = 0.5;
|
|
|
+// // 设置阴影偏移量(x, y)
|
|
|
+// knowBut.layer.shadowOffset = CGSizeMake(0, 3);
|
|
|
+// // 设置阴影模糊半径
|
|
|
+// knowBut.layer.shadowRadius = 5.0;
|
|
|
+// // 为了使阴影在按钮外部可见,需要设置masksToBounds为NO
|
|
|
+// // 注意:如果父视图设置了masksToBounds为YES,那么阴影可能仍然不可见
|
|
|
+// knowBut.layer.masksToBounds = NO;
|
|
|
+
|
|
|
+ [knowBut mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(40.f);
|
|
|
+ make.width.mas_equalTo(268.f);
|
|
|
+ make.centerX.mas_equalTo(0.f);
|
|
|
+ make.bottom.mas_equalTo(-30);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (void)colseFun
|
|
|
+{
|
|
|
+ [self removeFromSuperview];
|
|
|
+ if(_didClickUpdateDoneFun){
|
|
|
+ _didClickUpdateDoneFun();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@end
|
|
|
+
|