You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
3.1 KiB
94 lines
3.1 KiB
// |
|
// NoWatchView.m |
|
// tongxin |
|
// |
|
// Created by ecell on 2023/5/17. |
|
// Copyright © 2023 xTT. All rights reserved. |
|
// |
|
|
|
#import "NoWatchView.h" |
|
#import "User.h" |
|
#import "Device.h" |
|
#import "CommonPopView.h" |
|
|
|
@implementation NoWatchView |
|
|
|
-(instancetype)initWithFrame:(CGRect)frame |
|
{ |
|
self = [super initWithFrame:frame]; |
|
if (self) |
|
{ |
|
self.frame = CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight); |
|
self.backgroundColor = KKClearColor; |
|
[self subView]; |
|
} |
|
return self; |
|
} |
|
- (void)subView |
|
{ |
|
UIImageView *img = [UICommon ui_imageView:CGRectZero fileName:@"NoWatch_icon"]; |
|
[self addSubview:img]; |
|
[img mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.centerX.equalTo(self); |
|
make.bottom.equalTo(self.mas_centerY).inset(iPhoneX_NavHeight); |
|
make.size.mas_equalTo(CGSizeMake(Adapted(img.image.size.width),(Adapted(img.image.size.height)))); |
|
}]; |
|
|
|
UILabel *tilabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontBoldADA_(18) textColor:KKBlack20 text:@"您还没有绑定设备" Radius:0]; |
|
[self addSubview:tilabel]; |
|
[tilabel mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.centerX.equalTo(self); |
|
make.top.equalTo(img.mas_bottom).offset(16); |
|
}]; |
|
|
|
UILabel *tilabel1 = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(14) textColor:KKGrey163 text:@"赶快绑定一个设备体验一下吧" Radius:0]; |
|
[self addSubview:tilabel1]; |
|
[tilabel1 mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.centerX.equalTo(self); |
|
make.top.equalTo(tilabel.mas_bottom).offset(5); |
|
}]; |
|
|
|
UIButton *pusBtn = [UICommon ui_buttonSimple:CGRectZero font:FontBold_(16) normalColor:KKWhiteColorColor normalText:@"添加设备" click:^(id x) { |
|
[self rightBarItemClick]; |
|
}]; |
|
pusBtn.backgroundColor = mainColor; |
|
pusBtn.layer.cornerRadius = 24; |
|
pusBtn.layer.masksToBounds = YES; |
|
[self addSubview:pusBtn]; |
|
[pusBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.centerX.equalTo(self); |
|
make.top.equalTo(tilabel1.mas_bottom).offset(20); |
|
make.size.mas_equalTo(CGSizeMake(Adapted(164), 48)); |
|
}]; |
|
|
|
} |
|
|
|
|
|
/** |
|
添加或切换设备 |
|
*/ |
|
- (void)rightBarItemClick |
|
{ |
|
//跳转 添加设备 指令 |
|
//是微信用户的,判断是否有 手机号了,没有需要添加后才能添加设备 |
|
if(cUser.wxid && (cUser.phone == nil || cUser.phone.length == 0)) |
|
{ |
|
CommonPopView *popView = [CommonPopView new]; |
|
[popView bangdinPhone]; |
|
return; |
|
} |
|
|
|
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LoginStoryboard" bundle:nil]; |
|
UINavigationController *vc = [sb instantiateViewControllerWithIdentifier:@"ScanCodeViewController"]; |
|
[[UICommon currentVC].navigationController pushViewController:vc animated:YES]; |
|
} |
|
|
|
/* |
|
// Only override drawRect: if you perform custom drawing. |
|
// An empty implementation adversely affects performance during animation. |
|
- (void)drawRect:(CGRect)rect { |
|
// Drawing code |
|
} |
|
*/ |
|
|
|
@end
|
|
|