新版本
This commit is contained in:
@@ -35,6 +35,11 @@
|
||||
self.subTitleLable.text=vo.subTitle;
|
||||
self.iconImgV.image=[UIImage imageNamed:vo.iconUrl];
|
||||
self.arrowImgV.hidden=!vo.isShowArrow;
|
||||
if (vo.phv<120&&[vo.title containsString:@"水循环"]) {
|
||||
[self.subTitleLable setTextColor:[UIColor redColor]];
|
||||
}else{
|
||||
[self.subTitleLable setTextColor:[UIColor colorWithRed:109/255.0 green:109/255.0 blue:109/255.0 alpha:1.0]];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="70" id="KGk-i7-Jjw" customClass="IFishHotBarCell">
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="70" id="KGk-i7-Jjw" customClass="IFishHotBarCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
|
||||
@@ -7,13 +7,19 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishHotBarVo.h"
|
||||
@protocol ChangeWaterDelegate <NSObject>
|
||||
@optional
|
||||
-(void)didSelectRow1:(NSString*)v andRow2:(NSString*)v2;
|
||||
-(void)submitText:(NSString*)w andh:(NSString*)h andV:(NSString*)v;
|
||||
-(void)didSelectTeamptrue:(NSString*)up andDown:(NSString*)down andT:(NSString*)t andWarnCode:(NSString*)code;
|
||||
-(void)didSelectRemindTime:(NSString*)time;
|
||||
-(void)clickWormCode:(NSString*)code;
|
||||
@end
|
||||
|
||||
@interface IFishWaterChangeView : UIView
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *picker;
|
||||
@property(nonatomic,weak)id<ChangeWaterDelegate> myDelegate;
|
||||
@property(nonatomic,assign)NSInteger viewType;
|
||||
@property(nonatomic,strong)IfishHotBarVo*hotVo;
|
||||
@end
|
||||
|
||||
@@ -10,49 +10,199 @@
|
||||
|
||||
@interface IFishWaterChangeView()<UIPickerViewDelegate,UIPickerViewDataSource>
|
||||
|
||||
@property(nonatomic,strong)NSArray*data1;
|
||||
@property(nonatomic,strong)NSArray*data2;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *pickerBottom;
|
||||
@property(nonatomic,strong)NSMutableArray*data1;
|
||||
@property(nonatomic,strong)NSMutableArray*data2;
|
||||
@property(nonatomic,strong)NSMutableArray*templetrueArr;
|
||||
@property(nonatomic,strong)NSMutableArray*dayArr;
|
||||
@property(nonatomic,strong)NSMutableArray*timeArr;
|
||||
@property(nonatomic,copy)NSString*selectVaule1;
|
||||
@property(nonatomic,copy)NSString*selectVaule2;
|
||||
@property(nonatomic,copy)NSString*selectVaule3;
|
||||
@property(nonatomic,copy)NSString*warnCode;
|
||||
@property (weak, nonatomic) IBOutlet UIView *topTempPicker;
|
||||
@property (weak, nonatomic) IBOutlet UIView *bottomPicker;
|
||||
@property (weak, nonatomic) IBOutlet UIView *heightView;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *longTextF;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *widthTextF;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *heightTextF;
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *topUiPick;
|
||||
@property (weak, nonatomic) IBOutlet UIPickerView *bottomUiPicker;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *openBtn;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *bottomTextF;
|
||||
@end
|
||||
|
||||
@implementation IFishWaterChangeView
|
||||
|
||||
-(NSArray *)data1{
|
||||
-(NSMutableArray *)data1{
|
||||
if (_data1==nil) {
|
||||
_data1=@[@"1",@"2",@"3",@"4"];
|
||||
_data2=@[@"1:00",@"2:00",@"3:00",@"4:00"];
|
||||
_data1=[NSMutableArray array];
|
||||
_data2=[NSMutableArray array];
|
||||
}
|
||||
return _data1;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)timeArr{
|
||||
if (_timeArr==nil) {
|
||||
_timeArr=[NSMutableArray array];
|
||||
for (int i=5; i<25; i++) {
|
||||
NSString*day=[NSString stringWithFormat:@"%d:00",i];
|
||||
[_timeArr addObject:day];
|
||||
}
|
||||
}
|
||||
return _timeArr;
|
||||
}
|
||||
|
||||
-(NSMutableArray*)dayArr{
|
||||
if (_dayArr==nil) {
|
||||
_dayArr=[NSMutableArray array];
|
||||
for (int i=1; i<31; i++) {
|
||||
NSString*day=[NSString stringWithFormat:@"%d天",i];
|
||||
[_dayArr addObject:day];
|
||||
}
|
||||
}
|
||||
return _dayArr;
|
||||
}
|
||||
|
||||
-(NSMutableArray*)templetrueArr{
|
||||
if (_templetrueArr==nil) {
|
||||
_templetrueArr=[NSMutableArray array];
|
||||
for (int i=20; i<41; i++) {
|
||||
NSString*temp=[NSString stringWithFormat:@"%d°c",i];
|
||||
[_templetrueArr addObject:temp];
|
||||
}
|
||||
}
|
||||
return _templetrueArr;
|
||||
}
|
||||
|
||||
|
||||
-(void)setViewType:(NSInteger)viewType{
|
||||
_viewType=viewType;
|
||||
self.topTempPicker.hidden=YES;
|
||||
self.heightView.hidden=YES;
|
||||
self.bottomPicker.hidden=YES;
|
||||
[self.data1 removeAllObjects];
|
||||
[self.data2 removeAllObjects];
|
||||
if (viewType==0) {// 设置水温
|
||||
self.topTempPicker.hidden=NO;
|
||||
self.bottomPicker.hidden=NO;
|
||||
self.bottomTextF.text=@"请输设置预警温度";
|
||||
[self.data1 addObjectsFromArray:self.templetrueArr];
|
||||
[self.data2 addObjectsFromArray:self.templetrueArr];
|
||||
[self.topUiPick reloadAllComponents];
|
||||
[self.bottomUiPicker reloadAllComponents];
|
||||
self.openBtn.hidden=NO;
|
||||
self.pickerBottom.constant=240.0;
|
||||
if ([self.hotVo.wornCode isEqualToString:@"01"]) {
|
||||
self.openBtn.selected=YES;
|
||||
}else{
|
||||
self.openBtn.selected=NO;
|
||||
}
|
||||
if ( self.hotVo.heaterNum) {
|
||||
self.hotVo.heaterNum=[self.hotVo.heaterNum stringByReplacingOccurrencesOfString:@"°c" withString:@""];
|
||||
NSInteger heaterNum=round([self.hotVo.heaterNum integerValue]-20) ;
|
||||
[self.topUiPick selectRow:heaterNum inComponent:0 animated:NO];
|
||||
self.selectVaule1=self.hotVo.heaterNum;
|
||||
}
|
||||
|
||||
|
||||
if (self.hotVo.downTeamp) {
|
||||
self.hotVo.downTeamp=[self.hotVo.downTeamp stringByReplacingOccurrencesOfString:@"°c" withString:@""];
|
||||
NSInteger downTeamp=round([self.hotVo.downTeamp integerValue]-20);
|
||||
downTeamp=downTeamp<0?0:downTeamp;
|
||||
[self.bottomUiPicker selectRow:downTeamp inComponent:0 animated:NO];
|
||||
self.selectVaule2=self.hotVo.downTeamp;
|
||||
}
|
||||
|
||||
if (self.hotVo.upTeamp) {
|
||||
self.hotVo.upTeamp=[self.hotVo.upTeamp stringByReplacingOccurrencesOfString:@"°c" withString:@""];
|
||||
NSInteger upTeamp=round([self.hotVo.upTeamp integerValue]-20) ;
|
||||
upTeamp=upTeamp>0?upTeamp:0;
|
||||
[self.bottomUiPicker selectRow:upTeamp inComponent:1 animated:NO];
|
||||
self.selectVaule3=self.hotVo.upTeamp;
|
||||
}
|
||||
|
||||
|
||||
}else if(viewType==1){//容器大小
|
||||
self.bottomTextF.text=@"请输入水体部分尺寸:";
|
||||
self.heightView.hidden=NO;
|
||||
self.bottomPicker.hidden=NO;
|
||||
self.openBtn.hidden=YES;
|
||||
[self.longTextF becomeFirstResponder];
|
||||
self.pickerBottom.constant=340.0;
|
||||
if (self.hotVo.heater) {
|
||||
if(self.hotVo.heater.heaterLong.length){
|
||||
self.longTextF.text=self.hotVo.heater.heaterLong;
|
||||
}
|
||||
if(self.hotVo.heater.heaterWidth.length){
|
||||
self.widthTextF.text=self.hotVo.heater.heaterWidth;
|
||||
}
|
||||
if(self.hotVo.heater.heaterHeight.length){
|
||||
self.heightTextF.text=self.hotVo.heater.heaterHeight;
|
||||
}
|
||||
}
|
||||
|
||||
}else if (viewType==2){//流量
|
||||
self.bottomPicker.hidden=NO;
|
||||
}else if (viewType==4){//换水周期
|
||||
self.bottomPicker.hidden=NO;
|
||||
[self.data1 addObjectsFromArray:self.dayArr];
|
||||
[self.data2 addObjectsFromArray:self.timeArr];
|
||||
[self.topUiPick reloadAllComponents];
|
||||
[self.bottomUiPicker reloadAllComponents];
|
||||
self.bottomTextF.text=@"换水周期选择:";
|
||||
self.openBtn.hidden=NO;
|
||||
self.selectVaule2=self.data1[0];
|
||||
if (self.hotVo.heater.heaterCycle!=nil) {
|
||||
|
||||
[self.bottomUiPicker selectRow:[self.hotVo.heater.heaterCycle integerValue]-1 inComponent:0 animated:NO];
|
||||
self.selectVaule2=self.hotVo.heater.heaterCycle;
|
||||
}else{
|
||||
self.selectVaule2=@"1";
|
||||
}
|
||||
self.selectVaule3=self.data2[0];
|
||||
if (self.hotVo.heater.heaterReminderTime.length&&self.hotVo.heater.heaterReminderTime!=nil) {
|
||||
self.openBtn.selected=YES;
|
||||
[self.bottomUiPicker selectRow:[self.hotVo.heater.heaterReminderTime integerValue]-5 inComponent:1 animated:NO];
|
||||
self.selectVaule3=self.hotVo.heater.heaterReminderTime;
|
||||
}else{
|
||||
self.openBtn.selected=NO;
|
||||
self.selectVaule3=@"5";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// if(self.data1.count>0){
|
||||
// self.selectVaule1=self.data1[0];
|
||||
// self.selectVaule2=self.data1[0];
|
||||
// }
|
||||
// if (self.data2.count>0) {
|
||||
// self.selectVaule3=self.data2[0];
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)clickSubmit:(id)sender {
|
||||
self.hidden=YES;
|
||||
if(_viewType==5){
|
||||
[self.myDelegate didSelectRow1:self.selectVaule1 andRow2:self.selectVaule2];
|
||||
[self.myDelegate didSelectRow1:self.selectVaule2 andRow2:self.selectVaule3];
|
||||
}else if (_viewType==0){
|
||||
// [self.myDelegate didSelectTeamptrue:self.selectVaule2];
|
||||
NSString*code=self.openBtn.selected?@"01":@"00";
|
||||
|
||||
[self.myDelegate didSelectTeamptrue:self.selectVaule3 andDown:self.selectVaule2 andT:self.selectVaule1 andWarnCode:code];
|
||||
}else if (_viewType==1){
|
||||
[self.myDelegate submitText:self.widthTextF.text andh:self.heightTextF.text andV:self.longTextF.text];
|
||||
}else if(_viewType==4){
|
||||
// [self.myDelegate didSelectRemindTime:self.selectVaule2];
|
||||
if(self.openBtn.selected==NO){
|
||||
[self.myDelegate didSelectRow1:self.selectVaule2 andRow2:@""];
|
||||
}else{
|
||||
[self.myDelegate didSelectRow1:self.selectVaule2 andRow2:self.selectVaule3];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)awakeFromNib{
|
||||
@@ -64,6 +214,9 @@
|
||||
|
||||
//返回多少列
|
||||
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
|
||||
if (pickerView==self.topUiPick) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -74,19 +227,27 @@
|
||||
|
||||
//每一行的数据
|
||||
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
|
||||
if(component==0){
|
||||
if (pickerView==self.topUiPick) {
|
||||
return self.data1[row];
|
||||
}else{
|
||||
if(component==0){
|
||||
return self.data1[row];
|
||||
}
|
||||
return self.data2[row];
|
||||
}
|
||||
return self.data2[row];
|
||||
}
|
||||
|
||||
//选中时的效果
|
||||
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
|
||||
// self.selectValue = self.data[row];
|
||||
if (component==0) {
|
||||
if (pickerView==self.topUiPick) {
|
||||
self.selectVaule1=self.data1[row];
|
||||
}else{
|
||||
self.selectVaule2=self.data2[row];
|
||||
if (component==0) {
|
||||
self.selectVaule2=self.data1[row];
|
||||
}else{
|
||||
self.selectVaule3=self.data2[row];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +270,13 @@
|
||||
// cellView.backgroundColor = [UIColor redColor];
|
||||
// return cellView;
|
||||
//}
|
||||
- (IBAction)clickOpenBtn:(UIButton *)sender {
|
||||
sender.selected=!sender.selected;
|
||||
if(self.viewType==0){
|
||||
self.hotVo.wornCode=sender.selected?@"01":@"00";
|
||||
[self.myDelegate clickWormCode:self.hotVo.wornCode];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,8 +15,14 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fFD-6v-pYn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<connections>
|
||||
<action selector="clickBg:" destination="iN0-l3-epB" eventType="touchUpInside" id="74b-Bj-5Fq"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sS3-bH-IDb">
|
||||
<rect key="frame" x="12" y="379" width="351" height="188"/>
|
||||
<rect key="frame" x="12" y="239" width="351" height="188"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RVp-L7-2i4">
|
||||
<rect key="frame" x="2" y="30" width="347" height="121"/>
|
||||
@@ -35,23 +41,32 @@
|
||||
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="请设置预警温度" translatesAutoresizingMaskIntoConstraints="NO" id="xAc-ty-lpS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="351" height="32"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="换水周期选择" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4pR-AW-f8n">
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="换水预警温度" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4pR-AW-f8n">
|
||||
<rect key="frame" x="23" y="7.5" width="92" height="18"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S6l-x3-P2c">
|
||||
<rect key="frame" x="295" y="1" width="52" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" backgroundImage="开关按钮">
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S6l-x3-P2c">
|
||||
<rect key="frame" x="304" y="4" width="43" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="43" id="loB-UO-c2h"/>
|
||||
<constraint firstAttribute="height" constant="25" id="mhg-Yr-ruS"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="graybtn_big">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<state key="selected" backgroundImage="greenbtn_big"/>
|
||||
<connections>
|
||||
<action selector="clickOpenBtn:" destination="iN0-l3-epB" eventType="touchUpInside" id="xHx-yK-bIy"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="4pR-AW-f8n" firstAttribute="centerY" secondItem="C1u-7E-RB7" secondAttribute="centerY" id="CRt-1B-fzV"/>
|
||||
<constraint firstItem="S6l-x3-P2c" firstAttribute="top" secondItem="C1u-7E-RB7" secondAttribute="top" constant="4" id="Fnv-H5-nRL"/>
|
||||
<constraint firstAttribute="trailing" secondItem="S6l-x3-P2c" secondAttribute="trailing" constant="4" id="IMy-aI-aAJ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="xAc-ty-lpS" secondAttribute="bottom" id="K6j-dv-bHW"/>
|
||||
<constraint firstAttribute="trailing" secondItem="xAc-ty-lpS" secondAttribute="trailing" id="M5l-nx-wBd"/>
|
||||
<constraint firstItem="4pR-AW-f8n" firstAttribute="leading" secondItem="C1u-7E-RB7" secondAttribute="leading" constant="23" id="QDK-TY-a4v"/>
|
||||
@@ -108,35 +123,35 @@
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UWW-Ib-xQ3" userLabel="设置容器高度">
|
||||
<rect key="frame" x="14" y="414" width="347" height="118"/>
|
||||
<rect key="frame" x="14" y="274" width="347" height="118"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="长宽" translatesAutoresizingMaskIntoConstraints="NO" id="VGT-Vs-9H2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="347" height="118"/>
|
||||
</imageView>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="8cR-O7-A7z">
|
||||
<rect key="frame" x="58" y="57" width="49" height="30"/>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="8cR-O7-A7z">
|
||||
<rect key="frame" x="58" y="67" width="49" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="49" id="ITT-cl-rS3"/>
|
||||
<constraint firstAttribute="height" constant="30" id="SZ5-OH-yXi"/>
|
||||
<constraint firstAttribute="height" constant="20" id="SZ5-OH-yXi"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="AC4-7c-ujI">
|
||||
<rect key="frame" x="221" y="20" width="48" height="30"/>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="AC4-7c-ujI">
|
||||
<rect key="frame" x="221" y="30" width="48" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="B1X-7U-tcD"/>
|
||||
<constraint firstAttribute="height" constant="20" id="B1X-7U-tcD"/>
|
||||
<constraint firstAttribute="width" constant="48" id="LVS-he-GHZ"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="2LO-Mp-im1">
|
||||
<rect key="frame" x="58" y="20" width="49" height="30"/>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="2LO-Mp-im1">
|
||||
<rect key="frame" x="58" y="30" width="49" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="2yd-7Q-Ykb"/>
|
||||
<constraint firstAttribute="height" constant="20" id="2yd-7Q-Ykb"/>
|
||||
<constraint firstAttribute="width" constant="49" id="ynt-rK-riP"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
@@ -147,11 +162,11 @@
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="VGT-Vs-9H2" secondAttribute="bottom" id="9TD-pz-c2u"/>
|
||||
<constraint firstItem="2LO-Mp-im1" firstAttribute="top" secondItem="UWW-Ib-xQ3" secondAttribute="top" constant="20" id="9r2-wR-fa1"/>
|
||||
<constraint firstItem="8cR-O7-A7z" firstAttribute="top" secondItem="2LO-Mp-im1" secondAttribute="bottom" constant="7" id="FoN-Ym-ygh"/>
|
||||
<constraint firstItem="2LO-Mp-im1" firstAttribute="top" secondItem="UWW-Ib-xQ3" secondAttribute="top" constant="30" id="9r2-wR-fa1"/>
|
||||
<constraint firstItem="8cR-O7-A7z" firstAttribute="top" secondItem="2LO-Mp-im1" secondAttribute="bottom" constant="17" id="FoN-Ym-ygh"/>
|
||||
<constraint firstItem="2LO-Mp-im1" firstAttribute="leading" secondItem="UWW-Ib-xQ3" secondAttribute="leading" constant="58" id="LeA-cK-gXT"/>
|
||||
<constraint firstItem="VGT-Vs-9H2" firstAttribute="top" secondItem="UWW-Ib-xQ3" secondAttribute="top" id="ZMR-fp-1b0"/>
|
||||
<constraint firstItem="AC4-7c-ujI" firstAttribute="top" secondItem="UWW-Ib-xQ3" secondAttribute="top" constant="20" id="eBB-wB-pPq"/>
|
||||
<constraint firstItem="AC4-7c-ujI" firstAttribute="top" secondItem="UWW-Ib-xQ3" secondAttribute="top" constant="30" id="eBB-wB-pPq"/>
|
||||
<constraint firstAttribute="trailing" secondItem="VGT-Vs-9H2" secondAttribute="trailing" id="fwJ-As-qhZ"/>
|
||||
<constraint firstItem="8cR-O7-A7z" firstAttribute="centerX" secondItem="2LO-Mp-im1" secondAttribute="centerX" id="iST-gw-MgC"/>
|
||||
<constraint firstItem="VGT-Vs-9H2" firstAttribute="leading" secondItem="UWW-Ib-xQ3" secondAttribute="leading" id="rHT-K0-Jjm"/>
|
||||
@@ -159,7 +174,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GUi-mC-ZWy" userLabel="设置加热器">
|
||||
<rect key="frame" x="12" y="229" width="351" height="150"/>
|
||||
<rect key="frame" x="12" y="89" width="351" height="150"/>
|
||||
<subviews>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QZi-AX-KLU">
|
||||
<rect key="frame" x="2" y="32" width="347" height="121"/>
|
||||
@@ -216,28 +231,41 @@
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.1347388698630137" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="fFD-6v-pYn" secondAttribute="trailing" id="2Ku-hM-Gmb"/>
|
||||
<constraint firstItem="sS3-bH-IDb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="12" id="47Y-la-C7u"/>
|
||||
<constraint firstItem="sS3-bH-IDb" firstAttribute="top" secondItem="GUi-mC-ZWy" secondAttribute="bottom" id="51h-Fe-bOX"/>
|
||||
<constraint firstItem="UWW-Ib-xQ3" firstAttribute="top" secondItem="sS3-bH-IDb" secondAttribute="top" constant="35" id="C3d-Jz-gnZ"/>
|
||||
<constraint firstItem="fFD-6v-pYn" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="M3n-S0-Lmj"/>
|
||||
<constraint firstItem="UWW-Ib-xQ3" firstAttribute="bottom" secondItem="sS3-bH-IDb" secondAttribute="bottom" constant="-35" id="N6X-0h-OQp"/>
|
||||
<constraint firstAttribute="bottom" secondItem="sS3-bH-IDb" secondAttribute="bottom" constant="100" id="Wvv-fr-my6"/>
|
||||
<constraint firstAttribute="bottom" secondItem="sS3-bH-IDb" secondAttribute="bottom" constant="240" id="Wvv-fr-my6"/>
|
||||
<constraint firstAttribute="bottom" secondItem="fFD-6v-pYn" secondAttribute="bottom" id="Xm7-Ep-fOQ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="sS3-bH-IDb" secondAttribute="trailing" constant="12" id="dTS-pW-dyJ"/>
|
||||
<constraint firstItem="GUi-mC-ZWy" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="12" id="fUb-aa-feS"/>
|
||||
<constraint firstAttribute="trailing" secondItem="UWW-Ib-xQ3" secondAttribute="trailing" constant="14" id="qxd-yx-0wN"/>
|
||||
<constraint firstItem="UWW-Ib-xQ3" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="14" id="vEs-Cc-e6u"/>
|
||||
<constraint firstItem="fFD-6v-pYn" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="vX9-W8-fdB"/>
|
||||
<constraint firstAttribute="trailing" secondItem="GUi-mC-ZWy" secondAttribute="trailing" constant="12" id="xnk-A8-mY0"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="bottomPicker" destination="sS3-bH-IDb" id="dA5-DG-v9K"/>
|
||||
<outlet property="bottomTextF" destination="4pR-AW-f8n" id="yMf-aj-etI"/>
|
||||
<outlet property="bottomUiPicker" destination="RVp-L7-2i4" id="n8s-6e-Ybu"/>
|
||||
<outlet property="heightTextF" destination="8cR-O7-A7z" id="VIW-tJ-uOr"/>
|
||||
<outlet property="heightView" destination="UWW-Ib-xQ3" id="cBM-Tc-aUU"/>
|
||||
<outlet property="longTextF" destination="2LO-Mp-im1" id="UXa-Ec-lE2"/>
|
||||
<outlet property="openBtn" destination="S6l-x3-P2c" id="rFd-hL-k2Q"/>
|
||||
<outlet property="picker" destination="RVp-L7-2i4" id="kaf-wt-kXj"/>
|
||||
<outlet property="pickerBottom" destination="Wvv-fr-my6" id="AR9-Ii-lU1"/>
|
||||
<outlet property="topTempPicker" destination="GUi-mC-ZWy" id="wou-bx-Jr6"/>
|
||||
<outlet property="topUiPick" destination="QZi-AX-KLU" id="svk-gv-AnC"/>
|
||||
<outlet property="widthTextF" destination="AC4-7c-ujI" id="oxg-lr-VbK"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="33.5" y="103.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="开关按钮" width="52" height="30"/>
|
||||
<image name="graybtn_big" width="86" height="47"/>
|
||||
<image name="greenbtn_big" width="86" height="47"/>
|
||||
<image name="确定" width="375" height="55"/>
|
||||
<image name="虚线" width="12" height="111"/>
|
||||
<image name="请设置加热温度" width="375" height="48"/>
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface IfishChatView : UIView
|
||||
|
||||
@property(nonatomic,strong)NSArray*datas;
|
||||
@end
|
||||
|
||||
@@ -7,46 +7,134 @@
|
||||
//
|
||||
|
||||
#import "IfishChatView.h"
|
||||
#import "IfishHistroyVo.h"
|
||||
|
||||
|
||||
|
||||
@interface IfishChatView()
|
||||
@property(nonatomic,strong)NSMutableArray*line1;
|
||||
@property(nonatomic,strong)NSMutableArray*line2;
|
||||
@property(nonatomic,strong)UIView *lablesView;
|
||||
@property(nonatomic,strong)UILabel*numLable;
|
||||
@end
|
||||
|
||||
|
||||
@implementation IfishChatView
|
||||
|
||||
-(UILabel *)numLable{
|
||||
if (_numLable==nil) {
|
||||
_numLable=[[UILabel alloc]init];
|
||||
[self addSubview:_numLable];
|
||||
}
|
||||
return _numLable;
|
||||
}
|
||||
|
||||
-(UIView *)lablesView{
|
||||
if (_lablesView==nil) {
|
||||
_lablesView=[[UIView alloc]init];
|
||||
_lablesView.frame=CGRectMake(290, 0, 28, 190);
|
||||
_lablesView.backgroundColor=[UIColor clearColor];
|
||||
[self addSubview:_lablesView];
|
||||
}
|
||||
return _lablesView;
|
||||
}
|
||||
|
||||
-(NSArray *)line1{
|
||||
if (_line1==nil) {
|
||||
_line1=[NSMutableArray array];
|
||||
}
|
||||
[_line1 removeAllObjects];
|
||||
if (_datas.count) {
|
||||
NSSortDescriptor *ageSD = [NSSortDescriptor sortDescriptorWithKey:@"heaterGatheringTime_int" ascending:YES];
|
||||
self.datas = [self.datas sortedArrayUsingDescriptors:@[ageSD]];
|
||||
|
||||
for (int i=0; i<50; i++) {
|
||||
CGFloat x=10*(i+1);
|
||||
CGPoint p1=CGPointMake(x, x);
|
||||
// CGFloat gapW= 357*scale*0.1;
|
||||
for (int i=0; i<self.datas.count; i++) {
|
||||
IfishHistroyVo*vo=self.datas[i];
|
||||
CGFloat x=(([vo.heaterGatheringTime floatValue]/24)*270+19);
|
||||
if(vo.heaterWaterTemperature.integerValue>350){
|
||||
vo.heaterWaterTemperature=@"350";
|
||||
}else if(vo.heaterWaterTemperature.integerValue<250){
|
||||
continue;
|
||||
}
|
||||
CGFloat y=188*(1-((vo.heaterWaterTemperature.integerValue*0.1-25)/10))+36.5;//*-1*+158;
|
||||
CGPoint p1=CGPointMake(x, y);
|
||||
// NSLog(@"%f-------%f--%f-",y,vo.heaterWaterTemperature.integerValue*0.1,x);
|
||||
[_line1 addObject:NSStringFromCGPoint(p1)];
|
||||
}
|
||||
}
|
||||
|
||||
return _line1;
|
||||
}
|
||||
|
||||
-(NSArray *)line2{
|
||||
if (_line2==nil) {
|
||||
_line2=[NSMutableArray array];
|
||||
}
|
||||
if (_datas.count) {
|
||||
NSSortDescriptor *PhSD = [NSSortDescriptor sortDescriptorWithKey:@"heaterPh_int" ascending:YES];
|
||||
NSMutableArray*arr = [[self.datas sortedArrayUsingDescriptors:@[PhSD]] mutableCopy];
|
||||
|
||||
for (int i=0; i<50; i++) {
|
||||
CGFloat x=10*(i+1);
|
||||
CGFloat y=sin(x)*10+5;
|
||||
IfishHistroyVo*vo=arr[0];
|
||||
NSInteger miniPh=vo.heaterPh_int-50;
|
||||
|
||||
IfishHistroyVo*vo1=arr[arr.count-1];
|
||||
NSInteger maxPh=vo1.heaterPh_int+50;
|
||||
|
||||
NSInteger range=maxPh-miniPh;
|
||||
|
||||
|
||||
[_line2 removeAllObjects];
|
||||
for (int i=0; i<self.datas.count; i++) {
|
||||
IfishHistroyVo*vo=self.datas[i];
|
||||
CGFloat x=(([vo.heaterGatheringTime floatValue]/24)*270+19);
|
||||
CGFloat y=(1-((vo.heaterPh.floatValue-miniPh)/range))*188+36.5;
|
||||
|
||||
CGPoint p1=CGPointMake(x, y);
|
||||
[_line2 addObject:NSStringFromCGPoint(p1)];
|
||||
}
|
||||
}
|
||||
|
||||
return _line2;
|
||||
}
|
||||
|
||||
-(void)setLables{
|
||||
NSSortDescriptor *PhSD = [NSSortDescriptor sortDescriptorWithKey:@"heaterPh_int" ascending:YES];
|
||||
NSMutableArray*arr = [[self.datas sortedArrayUsingDescriptors:@[PhSD]] mutableCopy];
|
||||
|
||||
IfishHistroyVo*vo=arr[0];
|
||||
NSInteger miniPh=vo.heaterPh_int-50;
|
||||
|
||||
IfishHistroyVo*vo1=arr[arr.count-1];
|
||||
NSInteger maxPh=vo1.heaterPh_int+50;
|
||||
|
||||
NSInteger range=maxPh-miniPh;
|
||||
|
||||
if (_lablesView) {
|
||||
[self.lablesView removeFromSuperview];
|
||||
_lablesView=nil;
|
||||
}
|
||||
// [self addSubview:self.lablesView];
|
||||
for (int i=0; i<10; i++) {
|
||||
UILabel*lable=[[UILabel alloc]init];
|
||||
NSInteger pos=10-i;
|
||||
lable.frame=CGRectMake(0, i*9+i*10+33, 24, 9);
|
||||
lable.text=[NSString stringWithFormat:@"%.0f",miniPh+range*0.1*pos];
|
||||
lable.font=[UIFont systemFontOfSize:8];
|
||||
|
||||
// Only override drawRect: if you perform custom drawing.
|
||||
// An empty implementation adversely affects performance during animation.
|
||||
- (void)drawRect:(CGRect)rect {
|
||||
[self.lablesView addSubview:lable];
|
||||
}
|
||||
NSLog(@"lable=================");
|
||||
}
|
||||
|
||||
|
||||
-(void)setDatas:(NSArray *)datas{
|
||||
_datas=datas;
|
||||
[self setLables];
|
||||
[self layoutIfNeeded];
|
||||
}
|
||||
|
||||
-(void)drawLine{
|
||||
UIColor *color = [UIColor redColor];
|
||||
[color set]; //设置线条颜色
|
||||
|
||||
@@ -56,18 +144,38 @@
|
||||
path.lineCapStyle = kCGLineCapRound; //线条拐角
|
||||
path.lineJoinStyle = kCGLineJoinRound; //终点处理
|
||||
|
||||
[path moveToPoint:CGPointMake(0.0, 0.0)];//起点
|
||||
|
||||
|
||||
// Draw the lines
|
||||
for (int i=0; i<self.line1.count; i++) {
|
||||
|
||||
NSString* p=self.line1[i];
|
||||
if (i==0) {
|
||||
[path moveToPoint:CGPointFromString(p)];//起点
|
||||
}
|
||||
[path addLineToPoint:CGPointFromString(p)];
|
||||
}
|
||||
|
||||
// [path closePath];//第五条线通过调用closePath方法得到的
|
||||
// [path closePath];//第五条线通过调用closePath方法得到的
|
||||
|
||||
[path stroke];//Draws line 根据坐标点连线
|
||||
|
||||
for (int i=0; i<self.line1.count; i++) {
|
||||
|
||||
NSString* p=self.line1[i];
|
||||
CGPoint point=CGPointFromString(p);
|
||||
UIBezierPath *path0 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(point.x-2, point.y-2, 4, 4) cornerRadius:2];
|
||||
[path0 stroke];
|
||||
[path0 fill];
|
||||
|
||||
// UIButton*btn0=[UIButton buttonWithType:1];
|
||||
// btn0.frame=CGRectMake(point.x-3, point.x-3, 6, 6);
|
||||
// [btn0 addTarget:self action:@selector(clickPoint:) forControlEvents:UIControlEventTouchUpInside];
|
||||
// [self addSubview:btn0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// [path stroke];//Draws line 根据坐标点连线
|
||||
[path stroke];//颜色填充
|
||||
|
||||
|
||||
UIColor *color1 = [UIColor blueColor];
|
||||
@@ -76,28 +184,67 @@
|
||||
UIBezierPath* path1 = [UIBezierPath bezierPath];
|
||||
path1.lineWidth = 1.0;
|
||||
|
||||
|
||||
|
||||
path1.lineCapStyle = kCGLineCapRound; //线条拐角
|
||||
path1.lineJoinStyle = kCGLineJoinRound; //终点处理
|
||||
|
||||
[path1 moveToPoint:CGPointMake(0.0, 100.0)];//起点
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// [path1 moveToPoint:CGPointMake(0.0, 0.0)];//起点
|
||||
|
||||
// Draw the lines
|
||||
for (int i=0; i<self.line2.count; i++) {
|
||||
NSString* p=self.line2[i];
|
||||
if (i==0) {
|
||||
[path1 moveToPoint:CGPointFromString(p)];//起点
|
||||
}
|
||||
[path1 addLineToPoint:CGPointFromString(p)];
|
||||
}
|
||||
|
||||
// [path closePath];//第五条线通过调用closePath方法得到的
|
||||
|
||||
// [path stroke];//Draws line 根据坐标点连线
|
||||
CGFloat dashPattern[] = {3,1};// 3实线,1空白
|
||||
// CGFloat dashPattern[] = {3,1};// 3实线,1空白
|
||||
|
||||
[path1 setLineDash:dashPattern count:1 phase:1];
|
||||
// [path1 setLineDash:dashPattern count:1 phase:1];
|
||||
[path1 stroke];//颜色填充
|
||||
|
||||
|
||||
|
||||
for (int i=0; i<self.line1.count; i++) {
|
||||
|
||||
NSString* p=self.line2[i];
|
||||
CGPoint point=CGPointFromString(p);
|
||||
UIBezierPath *path01 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(point.x-1.5, point.y-1.5, 3, 3) cornerRadius:2];
|
||||
[path01 stroke];
|
||||
[path01 fill];
|
||||
|
||||
// UIButton*btn1=[UIButton buttonWithType:1];
|
||||
// btn1.frame=CGRectMake(point.x-3, point.x-3, 6, 6);
|
||||
// btn1.tag=i;
|
||||
// btn1.backgroundColor=[UIColor blackColor];
|
||||
// [btn1 addTarget:self action:@selector(clickPoint:) forControlEvents:UIControlEventTouchUpInside];
|
||||
// [self addSubview:btn1];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)clickPoint:(UIButton*)btn{
|
||||
IfishHistroyVo*vo=self.datas[btn.tag];
|
||||
self.numLable.text=vo.heaterWaterTemperature;
|
||||
}
|
||||
|
||||
-(void)clickPoint1:(UIButton*)btn{
|
||||
IfishHistroyVo*vo=self.datas[btn.tag];
|
||||
self.numLable.text=vo.heaterPh;
|
||||
}
|
||||
|
||||
//
|
||||
-(void)drawRect:(CGRect)rect{
|
||||
[self drawLine];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface IfishHistoryView : UIView
|
||||
|
||||
@protocol IfishHistoryViewBottomBarDelete <NSObject>
|
||||
@optional
|
||||
-(void)clickBottomBarWithIdx:(NSInteger)idx;
|
||||
@end
|
||||
|
||||
|
||||
@interface IfishHistoryView : UIView
|
||||
@property(nonatomic,strong)NSArray*datas;
|
||||
@property(nonatomic,copy)NSString*curdateStr;
|
||||
@property(nonatomic,weak)id<IfishHistoryViewBottomBarDelete>myDeleget;
|
||||
@end
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
//
|
||||
|
||||
#import "IfishHistoryView.h"
|
||||
#import "IfishChatView.h"
|
||||
#import "IfishHistroyVo.h"
|
||||
#import "PNChart.h"
|
||||
#import "SVProgressHUD.h"
|
||||
|
||||
@interface IfishHistoryView()
|
||||
@property (strong, nonatomic)IfishChatView *chartView;
|
||||
@property (weak, nonatomic) IBOutlet IfishChatView *chartHolder;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *chartHeight;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *chartWidth;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *lableHeight;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *curDatetitle;
|
||||
@property(nonatomic,strong)NSMutableArray*line1;
|
||||
@end
|
||||
|
||||
@implementation IfishHistoryView
|
||||
|
||||
@@ -17,8 +32,44 @@
|
||||
// Drawing code
|
||||
}
|
||||
*/
|
||||
|
||||
-(IfishChatView *)chartView{
|
||||
if (_chartView==nil) {
|
||||
_chartView=[[IfishChatView alloc]init];
|
||||
_chartView.frame=self.chartHolder.bounds;
|
||||
_chartView.backgroundColor=[UIColor clearColor];
|
||||
[self.chartHolder addSubview:_chartView];
|
||||
}
|
||||
return _chartView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)setDatas:(NSArray *)datas{
|
||||
_datas=datas;
|
||||
if (datas.count<1) {
|
||||
// [SVProgressHUD showInfoWithStatus:@"暂无数据"];
|
||||
return;
|
||||
}
|
||||
if (self.chartView) {
|
||||
[self.chartView removeFromSuperview];
|
||||
_chartView=nil;
|
||||
}
|
||||
self.chartView.datas=datas;
|
||||
self.curDatetitle.text=self.curdateStr;
|
||||
// [self initLineChart];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (IBAction)clickBg:(id)sender {
|
||||
self.hidden=YES;
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)clickBottomBar:(UIButton*)sender {
|
||||
[self.myDeleget clickBottomBarWithIdx:sender.tag];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -21,24 +21,93 @@
|
||||
<action selector="clickBg:" destination="iN0-l3-epB" eventType="touchUpInside" id="d08-z9-v9h"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="O2o-sf-tcG" customClass="IfishChatView">
|
||||
<rect key="frame" x="12" y="378" width="351" height="177"/>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gCt-ke-ZyH">
|
||||
<rect key="frame" x="10" y="164.5" width="355" height="338"/>
|
||||
<subviews>
|
||||
<button opaque="NO" tag="10" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Wvo-bU-MzQ">
|
||||
<rect key="frame" x="10" y="300" width="40" height="28"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<state key="normal" title="前一天">
|
||||
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="clickBottomBar:" destination="iN0-l3-epB" eventType="touchUpInside" id="PKC-QD-Ler"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" tag="11" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="867-ay-tug">
|
||||
<rect key="frame" x="305" y="300" width="40" height="28"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<state key="normal" title="后一天">
|
||||
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="clickBottomBar:" destination="iN0-l3-epB" eventType="touchUpInside" id="ULN-iZ-cCh"/>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="走势图" translatesAutoresizingMaskIntoConstraints="NO" id="KOt-M2-Dd2">
|
||||
<rect key="frame" x="20" y="9.5" width="315" height="270"/>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qbs-BN-bJI" customClass="IfishChatView">
|
||||
<rect key="frame" x="20" y="10" width="315" height="270"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dIS-Dw-qe1">
|
||||
<rect key="frame" x="157.5" y="4" width="0.0" height="0.0"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="dIS-Dw-qe1" firstAttribute="centerX" secondItem="Qbs-BN-bJI" secondAttribute="centerX" id="QUF-1r-EB5"/>
|
||||
<constraint firstItem="dIS-Dw-qe1" firstAttribute="top" secondItem="Qbs-BN-bJI" secondAttribute="top" constant="4" id="YmV-Oy-7IE"/>
|
||||
<constraint firstAttribute="width" constant="315" id="dn1-rH-AVD"/>
|
||||
<constraint firstAttribute="height" constant="270" id="lEF-HT-pRo"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="图表中温度,流量为0或不存在时图表中不体现" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gwB-Ff-4Go">
|
||||
<rect key="frame" x="72" y="288" width="211" height="12"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="177" id="gnS-mM-h2g"/>
|
||||
<constraint firstAttribute="height" constant="338" id="8aC-Rs-V2O"/>
|
||||
<constraint firstItem="KOt-M2-Dd2" firstAttribute="width" secondItem="Qbs-BN-bJI" secondAttribute="width" id="DNE-3F-DGX"/>
|
||||
<constraint firstItem="gwB-Ff-4Go" firstAttribute="centerX" secondItem="gCt-ke-ZyH" secondAttribute="centerX" id="G61-Vc-66t"/>
|
||||
<constraint firstAttribute="trailing" secondItem="867-ay-tug" secondAttribute="trailing" constant="10" id="Hi9-fm-dyZ"/>
|
||||
<constraint firstItem="Qbs-BN-bJI" firstAttribute="top" secondItem="gCt-ke-ZyH" secondAttribute="top" constant="10" id="MgW-4X-UWJ"/>
|
||||
<constraint firstItem="Qbs-BN-bJI" firstAttribute="centerX" secondItem="gCt-ke-ZyH" secondAttribute="centerX" id="Sfh-QT-Pn4"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Wvo-bU-MzQ" secondAttribute="bottom" constant="10" id="VlT-ro-Gad"/>
|
||||
<constraint firstItem="gwB-Ff-4Go" firstAttribute="top" secondItem="Qbs-BN-bJI" secondAttribute="bottom" constant="8" id="c6L-8J-cWA"/>
|
||||
<constraint firstItem="KOt-M2-Dd2" firstAttribute="height" secondItem="Qbs-BN-bJI" secondAttribute="height" id="dld-AE-g6d"/>
|
||||
<constraint firstItem="Wvo-bU-MzQ" firstAttribute="leading" secondItem="gCt-ke-ZyH" secondAttribute="leading" constant="10" id="e1d-jF-7D0"/>
|
||||
<constraint firstItem="KOt-M2-Dd2" firstAttribute="centerX" secondItem="Qbs-BN-bJI" secondAttribute="centerX" id="kVe-Gj-il4"/>
|
||||
<constraint firstItem="KOt-M2-Dd2" firstAttribute="top" secondItem="Qbs-BN-bJI" secondAttribute="top" id="sZQ-CQ-LGw"/>
|
||||
<constraint firstAttribute="bottom" secondItem="867-ay-tug" secondAttribute="bottom" constant="10" id="ySi-fC-9Of"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.20994755993150685" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="gCt-ke-ZyH" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="3wc-85-00z"/>
|
||||
<constraint firstItem="gCt-ke-ZyH" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="55m-6M-dcc"/>
|
||||
<constraint firstAttribute="bottom" secondItem="69h-Z5-zDB" secondAttribute="bottom" id="8ZV-V1-tgA"/>
|
||||
<constraint firstItem="69h-Z5-zDB" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="OcJ-PS-bmM"/>
|
||||
<constraint firstAttribute="bottom" secondItem="O2o-sf-tcG" secondAttribute="bottom" constant="112" id="Sbm-6h-9S9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="69h-Z5-zDB" secondAttribute="trailing" id="TYK-Fj-3Kv"/>
|
||||
<constraint firstAttribute="trailing" secondItem="O2o-sf-tcG" secondAttribute="trailing" constant="12" id="U2T-xW-ZTi"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gCt-ke-ZyH" secondAttribute="trailing" constant="10" id="eMu-Wt-oOw"/>
|
||||
<constraint firstItem="69h-Z5-zDB" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="lLw-5d-kFj"/>
|
||||
<constraint firstItem="O2o-sf-tcG" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="12" id="sN7-SB-aaH"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="chartHolder" destination="Qbs-BN-bJI" id="FDp-Om-vbH"/>
|
||||
<outlet property="curDatetitle" destination="dIS-Dw-qe1" id="brm-O7-fOG"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="33.5" y="122.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="走势图" width="526" height="453"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// IfishHotBarHeader.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by 罗艺 on 2018/9/27.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface IfishHotBarHeader : UIView
|
||||
@property (weak, nonatomic) IBOutlet UILabel *degreeLable;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// IfishHotBarHeader.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by 罗艺 on 2018/9/27.
|
||||
// Copyright © 2018年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishHotBarHeader.h"
|
||||
|
||||
@implementation IfishHotBarHeader
|
||||
|
||||
/*
|
||||
// Only override drawRect: if you perform custom drawing.
|
||||
// An empty implementation adversely affects performance during animation.
|
||||
- (void)drawRect:(CGRect)rect {
|
||||
// Drawing code
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="IfishHotBarHeader">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="293"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="HotBarBg" translatesAutoresizingMaskIntoConstraints="NO" id="c65-cl-9xM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="293"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Iu0-Mz-jJX">
|
||||
<rect key="frame" x="187.5" y="146.5" width="0.0" height="0.0"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="31"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="c65-cl-9xM" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="ALz-EG-IbW"/>
|
||||
<constraint firstItem="Iu0-Mz-jJX" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="F6H-cz-wDn"/>
|
||||
<constraint firstItem="Iu0-Mz-jJX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="OzF-x0-QeB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="c65-cl-9xM" secondAttribute="bottom" id="Sh3-8a-d9C"/>
|
||||
<constraint firstItem="c65-cl-9xM" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="rtn-gN-A5q"/>
|
||||
<constraint firstAttribute="trailing" secondItem="c65-cl-9xM" secondAttribute="trailing" id="vJR-Xd-VTr"/>
|
||||
</constraints>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="degreeLable" destination="Iu0-Mz-jJX" id="thM-Nu-9h3"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="18" y="-87"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="HotBarBg" width="375" height="206"/>
|
||||
</resources>
|
||||
</document>
|
||||
Reference in New Issue
Block a user