|
|
@@ -0,0 +1,190 @@
|
|
|
+//
|
|
|
+// cloudPhoneViewController.m
|
|
|
+// 双子星云手机
|
|
|
+//
|
|
|
+// Created by xd h on 2024/6/20.
|
|
|
+//
|
|
|
+
|
|
|
+#import "cloudPhoneViewController.h"
|
|
|
+
|
|
|
+@interface cloudPhoneViewController ()
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation cloudPhoneViewController
|
|
|
+
|
|
|
+- (void)viewDidLoad {
|
|
|
+ [super viewDidLoad];
|
|
|
+ // Do any additional setup after loading the view.
|
|
|
+
|
|
|
+ [self.view setBackgroundColor:HWF5F7FAColor];
|
|
|
+
|
|
|
+ [self.toolBar setHidden:YES];
|
|
|
+ [self.navigationBar setHidden:YES];
|
|
|
+ [self.navBarBGView setHidden:YES];
|
|
|
+
|
|
|
+ [self drawAnyView];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)drawAnyView{
|
|
|
+ //顶底底部图片
|
|
|
+ UIImageView *topImageV = [UIImageView new];
|
|
|
+ topImageV.userInteractionEnabled = YES;
|
|
|
+ topImageV.image = [UIImage imageNamed:@"cloudPhone_bg"];
|
|
|
+ [self.view addSubview:topImageV];
|
|
|
+
|
|
|
+ [topImageV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ CGFloat imageTopY = 54.0;
|
|
|
+
|
|
|
+ //设置按钮
|
|
|
+ UIButton *setButton = [[UIButton alloc] init];
|
|
|
+ [setButton setBackgroundImage:[UIImage imageNamed:@"cloudPhone_set"] forState:UIControlStateNormal];
|
|
|
+ setButton.tag = 1;
|
|
|
+ [setButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.view addSubview:setButton];
|
|
|
+
|
|
|
+ [setButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.mas_equalTo(imageTopY);
|
|
|
+ make.right.mas_equalTo(-16);
|
|
|
+ make.width.mas_equalTo(24);
|
|
|
+ make.height.mas_equalTo(24);
|
|
|
+ }];
|
|
|
+
|
|
|
+ //中间图片
|
|
|
+ UIImageView *midImageV = [UIImageView new];
|
|
|
+ midImageV.userInteractionEnabled = YES;
|
|
|
+ midImageV.image = [UIImage imageNamed:@"cloudPhone_mid_img"];
|
|
|
+ [self.view addSubview:midImageV];
|
|
|
+
|
|
|
+ [midImageV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(326*WAUTOSCALE);
|
|
|
+ make.height.mas_equalTo(608*WAUTOSCALE);
|
|
|
+ make.centerX.mas_equalTo(0);
|
|
|
+ make.centerY.mas_equalTo(-10);
|
|
|
+ }];
|
|
|
+
|
|
|
+ NSString *midTopTipImageStr = @"cloudPhone_topTip_img_cs";
|
|
|
+ //欢迎
|
|
|
+ //en-US 英文 ja-JP 日文
|
|
|
+ NSArray *arLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
|
|
|
+ NSLog(@"arLanguages:%@",arLanguages);
|
|
|
+ ///获取设备当前地区的代码和APP语言环境
|
|
|
+ NSString *languageCode = [NSLocale preferredLanguages][0];
|
|
|
+
|
|
|
+ //目前支持 中文(简体 繁体) 英文 日语
|
|
|
+ if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
|
|
|
+ {
|
|
|
+ midTopTipImageStr = @"cloudPhone_topTip_img_cs";
|
|
|
+ }
|
|
|
+ else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
|
|
|
+ {
|
|
|
+ midTopTipImageStr = @"cloudPhone_topTip_img_ct";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ midTopTipImageStr = @"cloudPhone_topTip_img_en";
|
|
|
+ }
|
|
|
+
|
|
|
+ //提示文字图片
|
|
|
+ UIImageView *midTopTipImageV = [UIImageView new];
|
|
|
+ midTopTipImageV.image = [UIImage imageNamed:midTopTipImageStr];
|
|
|
+ [midImageV addSubview:midTopTipImageV];
|
|
|
+
|
|
|
+ [midTopTipImageV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(282*WAUTOSCALE);
|
|
|
+ make.height.mas_equalTo(84*WAUTOSCALE);
|
|
|
+ make.centerX.mas_equalTo(0);
|
|
|
+ make.top.equalTo(midImageV.mas_top).offset(64);
|
|
|
+ }];
|
|
|
+
|
|
|
+ //进入云机
|
|
|
+ UIButton*enterCloudPhoneButton = [[UIButton alloc] init];
|
|
|
+ CGFloat w_btn = SCREEN_W - 15*2 - 50*2;
|
|
|
+
|
|
|
+ // gradient
|
|
|
+ CAGradientLayer *gl = [CAGradientLayer layer];
|
|
|
+ gl.frame = CGRectMake(0,0,w_btn,44.f);
|
|
|
+ gl.startPoint = CGPointMake(0, 0.5);
|
|
|
+ gl.endPoint = CGPointMake(0.97, 0.5);
|
|
|
+ gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
|
|
|
+ gl.locations = @[@(0), @(1.0f)];
|
|
|
+
|
|
|
+ [enterCloudPhoneButton.layer addSublayer:gl];
|
|
|
+ [enterCloudPhoneButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
|
|
|
+ [enterCloudPhoneButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
+ [enterCloudPhoneButton setTitle:NSLocalizedString(@"cloudPhone_enter_tip",nil) forState:(UIControlStateNormal)];
|
|
|
+ [enterCloudPhoneButton.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
|
|
|
+ [enterCloudPhoneButton.layer setCornerRadius:21.f];
|
|
|
+ enterCloudPhoneButton.layer.borderWidth = 1.5;
|
|
|
+ enterCloudPhoneButton.layer.borderColor = [UIColor whiteColor].CGColor;
|
|
|
+ enterCloudPhoneButton.clipsToBounds = YES;
|
|
|
+ enterCloudPhoneButton.tag = 2;
|
|
|
+ [midImageV addSubview:enterCloudPhoneButton];
|
|
|
+
|
|
|
+ [enterCloudPhoneButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(w_btn);
|
|
|
+ make.height.mas_equalTo(42);
|
|
|
+ make.centerX.mas_equalTo(0);
|
|
|
+ make.bottom.equalTo(midImageV.mas_bottom).offset(-60);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 点击按钮
|
|
|
+- (void)didClickButtonFun:(UIButton*)but
|
|
|
+{
|
|
|
+ NSInteger tag = but.tag;
|
|
|
+ HLog(@"%ld",tag);
|
|
|
+ switch (tag) {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+// uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
|
|
|
+// [self pushViewController:vc animated:YES];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (void)viewWillAppear:(BOOL)animated{
|
|
|
+ [super viewWillAppear:animated];
|
|
|
+
|
|
|
+ [self showTabbarFun];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)viewWillDisappear:(BOOL)animated{
|
|
|
+ [super viewWillDisappear:animated];
|
|
|
+
|
|
|
+ //[self hideTabbarFun];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
|
|
|
+{
|
|
|
+ [self.navigationController pushViewController:vc animated:animated];
|
|
|
+ [self hideTabbarFun];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)showTabbarFun
|
|
|
+{
|
|
|
+ // 显示 tab bar
|
|
|
+ self.tabBarController.tabBar.hidden = NO;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)hideTabbarFun
|
|
|
+{
|
|
|
+ // 隐藏 tab bar
|
|
|
+ self.tabBarController.tabBar.hidden = YES;
|
|
|
+}
|
|
|
+@end
|