一键喂鱼和功率显示
This commit is contained in:
parent
723f284237
commit
20d110de4a
|
|
@ -65,6 +65,7 @@ typedef enum{
|
||||||
+ (BOOL)isIphoneX;
|
+ (BOOL)isIphoneX;
|
||||||
//校验是否是数字
|
//校验是否是数字
|
||||||
+(BOOL)isNumber:(NSString *)str;
|
+(BOOL)isNumber:(NSString *)str;
|
||||||
|
+ (UIImage *)createImageWithColor:(UIColor *)color;
|
||||||
//******************************输入内容正确性校验*****************************************//
|
//******************************输入内容正确性校验*****************************************//
|
||||||
#pragma 正则匹配手机号
|
#pragma 正则匹配手机号
|
||||||
+ (BOOL)checkTelNumber:(NSString *) telNumber;
|
+ (BOOL)checkTelNumber:(NSString *) telNumber;
|
||||||
|
|
|
||||||
|
|
@ -646,6 +646,17 @@ if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
||||||
|
|
||||||
titleLabel.attributedText = attributedString;
|
titleLabel.attributedText = attributedString;
|
||||||
}
|
}
|
||||||
|
+ (UIImage *)createImageWithColor:(UIColor *)color {
|
||||||
|
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
|
||||||
|
UIGraphicsBeginImageContext(rect.size);
|
||||||
|
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||||
|
CGContextSetFillColorWithColor(context, [color CGColor]);
|
||||||
|
CGContextFillRect(context, rect);
|
||||||
|
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
|
UIGraphicsEndImageContext();
|
||||||
|
|
||||||
|
return theImage;
|
||||||
|
}
|
||||||
//设置带圆角带阴影
|
//设置带圆角带阴影
|
||||||
+(void)setShadowCornerRadiusToView:(UIView *)view{
|
+(void)setShadowCornerRadiusToView:(UIView *)view{
|
||||||
view.layer.cornerRadius = kSizeFrom750(10);
|
view.layer.cornerRadius = kSizeFrom750(10);
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,12 @@
|
||||||
|
|
||||||
self.controlBtn.hidden=NO;
|
self.controlBtn.hidden=NO;
|
||||||
self.cameraBtn.hidden=NO;
|
self.cameraBtn.hidden=NO;
|
||||||
|
[self.controlBtn setTitle:@"一键喂鱼" forState:UIControlStateNormal];
|
||||||
|
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor lightGrayColor]] forState:UIControlStateNormal];
|
||||||
|
[self.controlBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateSelected];
|
||||||
|
[self.cameraBtn setTitle:@"功率" forState:UIControlStateNormal];
|
||||||
|
[self.cameraBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor lightGrayColor]] forState:UIControlStateNormal];
|
||||||
|
[self.cameraBtn setBackgroundImage:[CommonUtils createImageWithColor:[UIColor cyanColor]] forState:UIControlStateHighlighted];
|
||||||
self.heartCount=0;
|
self.heartCount=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -391,6 +397,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if ([self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO4F]||[self.currentDevice.type isEqualToString:DECICE_TYPE_XUANDUO5F])
|
||||||
|
{
|
||||||
|
[self.cameraBtn setTitle:[NSString stringWithFormat:@"%ldw",[dataContorl hexToTen:self.dataModel.powerRating]] forState:UIControlStateNormal];
|
||||||
|
if ([self.dataModel.fishFeedStatus isEqualToString:@"01"])
|
||||||
|
{
|
||||||
|
self.controlBtn.selected=YES;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.controlBtn.selected=NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//杀菌灯的状态
|
//杀菌灯的状态
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue