diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index bdcbf1d..c5193b9 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -2293,6 +2293,15 @@ C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0837A55244FF5500034FEC5 /* EGOCache.m */; }; C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C0837A56244FF5500034FEC5 /* EGOCache.h */; }; C089767E281BCB3A0098B5FA /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C089767D281BCB3A0098B5FA /* NetworkExtension.framework */; }; + C08976AC282110280098B5FA /* arrow_right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AB282110280098B5FA /* arrow_right@2x.png */; }; + C08976B0282117930098B5FA /* 矩形.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AD282117920098B5FA /* 矩形.png */; }; + C08976B1282117930098B5FA /* 矩形@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AE282117920098B5FA /* 矩形@2x.png */; }; + C08976B2282117930098B5FA /* 矩形@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C08976AF282117930098B5FA /* 矩形@3x.png */; }; + C08976B5282119310098B5FA /* XuanduoTimerSettingViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C08976B3282119300098B5FA /* XuanduoTimerSettingViewController.h */; }; + C08976B6282119310098B5FA /* XuanduoTimerSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C08976B4282119300098B5FA /* XuanduoTimerSettingViewController.m */; }; + C08976BA2821384A0098B5FA /* TimerTypeTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = C08976B72821384A0098B5FA /* TimerTypeTableViewCell.h */; }; + C08976BB2821384A0098B5FA /* TimerTypeTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C08976B82821384A0098B5FA /* TimerTypeTableViewCell.m */; }; + C08976BC2821384A0098B5FA /* TimerTypeTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C08976B92821384A0098B5FA /* TimerTypeTableViewCell.xib */; }; C0B2F541244C6FE3001079AA /* PetStoresViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B2F53E244C6FE3001079AA /* PetStoresViewController.h */; }; C0B2F542244C6FE3001079AA /* PetStoresViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C0B2F53F244C6FE3001079AA /* PetStoresViewController.m */; }; C0B2F543244C6FE3001079AA /* PetStoresViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0B2F540244C6FE3001079AA /* PetStoresViewController.xib */; }; @@ -5776,6 +5785,15 @@ C0837A55244FF5500034FEC5 /* EGOCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EGOCache.m; sourceTree = ""; }; C0837A56244FF5500034FEC5 /* EGOCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EGOCache.h; sourceTree = ""; }; C089767D281BCB3A0098B5FA /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; + C08976AB282110280098B5FA /* arrow_right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "arrow_right@2x.png"; path = "../../../../../arrow_right@2x.png"; sourceTree = ""; }; + C08976AD282117920098B5FA /* 矩形.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形.png"; sourceTree = ""; }; + C08976AE282117920098B5FA /* 矩形@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形@2x.png"; sourceTree = ""; }; + C08976AF282117930098B5FA /* 矩形@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "矩形@3x.png"; sourceTree = ""; }; + C08976B3282119300098B5FA /* XuanduoTimerSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XuanduoTimerSettingViewController.h; sourceTree = ""; }; + C08976B4282119300098B5FA /* XuanduoTimerSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XuanduoTimerSettingViewController.m; sourceTree = ""; }; + C08976B72821384A0098B5FA /* TimerTypeTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TimerTypeTableViewCell.h; sourceTree = ""; }; + C08976B82821384A0098B5FA /* TimerTypeTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TimerTypeTableViewCell.m; sourceTree = ""; }; + C08976B92821384A0098B5FA /* TimerTypeTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TimerTypeTableViewCell.xib; sourceTree = ""; }; C0B2F53E244C6FE3001079AA /* PetStoresViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PetStoresViewController.h; sourceTree = ""; }; C0B2F53F244C6FE3001079AA /* PetStoresViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PetStoresViewController.m; sourceTree = ""; }; C0B2F540244C6FE3001079AA /* PetStoresViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PetStoresViewController.xib; sourceTree = ""; }; @@ -8992,8 +9010,12 @@ 882955A01DBDA3A100E9DDD7 /* ifishSetCell_back.png */, FA08931D2275FCF10084A609 /* light_big@2x.png */, FA0893092275DD770084A609 /* shajun_big@2x.png */, + C08976AB282110280098B5FA /* arrow_right@2x.png */, 882955A11DBDA3A100E9DDD7 /* secondSetCell.png */, 882955A21DBDA3A100E9DDD7 /* set_cellBack.png */, + C08976AD282117920098B5FA /* 矩形.png */, + C08976AE282117920098B5FA /* 矩形@2x.png */, + C08976AF282117930098B5FA /* 矩形@3x.png */, FA0893052275DD4C0084A609 /* arrow_down@2x.png */, FA0893192275FCEC0084A609 /* gas_big@2x.png */, FA08931B2275FCEE0084A609 /* wave_big@2x.png */, @@ -9696,6 +9718,8 @@ 883E76A81D48A5E50030E075 /* XuToSetViewController.h */, 883E76A91D48A5E50030E075 /* XuToSetViewController.m */, C0CCEF69280D08C600604601 /* XuanduoSettingController.h */, + C08976B3282119300098B5FA /* XuanduoTimerSettingViewController.h */, + C08976B4282119300098B5FA /* XuanduoTimerSettingViewController.m */, C0CCEF6A280D08C600604601 /* XuanduoSettingController.m */, FA0892FB2275A1B30084A609 /* Xuanduo2SettingController.h */, FA0892FC2275A1B30084A609 /* Xuanduo2SettingController.m */, @@ -9714,6 +9738,9 @@ FA0893142275F7CF0084A609 /* XuanduoSelectHeader.m */, FA0893172275F7DF0084A609 /* XuanduoSelectHeader.xib */, FA08930B2275F03F0084A609 /* PlusTableViewCell.h */, + C08976B72821384A0098B5FA /* TimerTypeTableViewCell.h */, + C08976B82821384A0098B5FA /* TimerTypeTableViewCell.m */, + C08976B92821384A0098B5FA /* TimerTypeTableViewCell.xib */, FA08930C2275F03F0084A609 /* PlusTableViewCell.m */, FA08930D2275F03F0084A609 /* PlusTableViewCell.xib */, FAFC08202279CB5900B5A07B /* SetTimerCell.h */, @@ -12962,6 +12989,7 @@ CB484E0422B8C8C80075F050 /* bprint.h in Headers */, FAFC08232279CB5900B5A07B /* SetTimerCell.h in Headers */, CB7D6AA122953BEB0014E5C7 /* YYKVStorage.h in Headers */, + C08976BA2821384A0098B5FA /* TimerTypeTableViewCell.h in Headers */, CB484DE522B8C8C80075F050 /* rational.h in Headers */, CB484DE922B8C8C80075F050 /* avutil.h in Headers */, 3D1C508C221A9EDF0096AE43 /* Utils.h in Headers */, @@ -12982,6 +13010,7 @@ CB4820492334B46100A50C92 /* ConAquarNowWiFiPwdVC.h in Headers */, 3D1C5116221A9EE00096AE43 /* KTPhotoView+SDWebImage.h in Headers */, 3D1C50BB221A9EE00096AE43 /* RegisterResult.h in Headers */, + C08976B5282119310098B5FA /* XuanduoTimerSettingViewController.h in Headers */, CBA6167F228F9AB100ED380D /* MASViewConstraint.h in Headers */, C024B7A22379668B00509424 /* NSAttributedString+AvoidCrash.h in Headers */, CB8B6468230F7F980032EB24 /* IfishMainInfoCell.h in Headers */, @@ -13452,6 +13481,7 @@ 881477CA1E6F9D8500BFB79C /* signin_popup_obtain_button.png in Resources */, 88C1B2131DCC5A1400C2C99A /* personal_iocn_about@3x.png in Resources */, 88C1B21F1DCC5A1400C2C99A /* personal_iocn_scan@3x.png in Resources */, + C08976B1282117930098B5FA /* 矩形@2x.png in Resources */, 882956681DBDA3A200E9DDD7 /* minelook_bind.png in Resources */, 887492441E7A90D000CDA284 /* fishdoctor_iocn_price.png in Resources */, 882958181DC04ED200E9DDD7 /* equipment_longpoint@2x.png in Resources */, @@ -13588,6 +13618,7 @@ FAB3721322619DB70051E107 /* Xuanduo2fController.xib in Resources */, CB4820892334E99700A50C92 /* IQKeyboardManager.bundle in Resources */, 889C14F31EA7397B00470F50 /* personal_iocn_set.png in Resources */, + C08976AC282110280098B5FA /* arrow_right@2x.png in Resources */, 883E78ED1D48A5E50030E075 /* ConnectWifiViewController.xib in Resources */, 8807074B1DDD40B40076F65A /* P2PShareViewsec2Cell.xib in Resources */, 8869B3AD1E6967DF0010F099 /* levelUp_yashark@3x.png in Resources */, @@ -13860,6 +13891,7 @@ 887492371E7A90D000CDA284 /* fishdoctor_iocn_default_gold@3x.png in Resources */, 88645B221E83CF3500234DB4 /* Ifishbanner_shouye.jpg in Resources */, 88645B231E83CF3500234DB4 /* Ifishbanner_zixun.jpg in Resources */, + C08976BC2821384A0098B5FA /* TimerTypeTableViewCell.xib in Resources */, 881A1D2B1DD2C31500BA1AF4 /* kankanlook_icon_attention@3x.png in Resources */, 8867F5D51E656F9100AF021C /* rank_iocn_mark.png in Resources */, 88C1B1E21DC9AF3700C2C99A /* home_iocn_add@2x.png in Resources */, @@ -14165,6 +14197,7 @@ 882956CE1DBDA3A300E9DDD7 /* ifishnav_dropview_list.png in Resources */, CB48209A2335CB2200A50C92 /* SDK使用说明 in Resources */, 882956101DBDA3A100E9DDD7 /* neves0019.png in Resources */, + C08976B0282117930098B5FA /* 矩形.png in Resources */, 887492391E7A90D000CDA284 /* fishdoctor_iocn_default_twentygold@2x.png in Resources */, 882957291DBDA3A300E9DDD7 /* swimmingfish0024.png in Resources */, 88742C2F1D63F9AB0074F1F8 /* CertifyListViewFirstCell.xib in Resources */, @@ -14203,6 +14236,7 @@ 882957A21DBDA3A400E9DDD7 /* xutobtn4_on@3x.png in Resources */, 3D3512DC2159C172009DDB0F /* IfishHotBarModifyNameVc.xib in Resources */, 8829577D1DBDA3A400E9DDD7 /* set_co2_off.png in Resources */, + C08976B2282117930098B5FA /* 矩形@3x.png in Resources */, 883283AB1EAF4E8200A47157 /* goldconvert_recordline@3x.png in Resources */, 8829581B1DC04ED200E9DDD7 /* equipment_point@2x.png in Resources */, 8867F5D71E656F9100AF021C /* rank_iocn_mark@3x.png in Resources */, @@ -15403,6 +15437,7 @@ C0EA8A1E23AF74F4003DC53B /* SDWebImageCompat.m in Sources */, 88F5EFAB1D48D08100CC7CAF /* AFHTTPSessionManager.m in Sources */, 886EAC581E2DC5BE00A4DF27 /* IFishShopsViewCell.m in Sources */, + C08976BB2821384A0098B5FA /* TimerTypeTableViewCell.m in Sources */, 88F5EFD21D48D08100CC7CAF /* MMProgressHUD+Class.m in Sources */, 3D1C510E221A9EE00096AE43 /* P2PPlayingbackVC.m in Sources */, 88F5EFB51D48D08100CC7CAF /* UIButton+AFNetworking.m in Sources */, @@ -15600,6 +15635,7 @@ 8868FE561E66C8BC002F7F33 /* DengJiShuoMingViewTopCell.m in Sources */, 88F5EFB91D48D08100CC7CAF /* UIWebView+AFNetworking.m in Sources */, C0D451D727955E8200609928 /* Define.m in Sources */, + C08976B6282119310098B5FA /* XuanduoTimerSettingViewController.m in Sources */, 8867F5B41E654DFD00AF021C /* DengJiView0Cell.m in Sources */, 883E785A1D48A5E50030E075 /* XuToLightModel.m in Sources */, 883E785E1D48A5E50030E075 /* CenterViewController.m in Sources */, diff --git a/Ifish/Assets.xcassets/绚多设备/Contents.json b/Ifish/Assets.xcassets/绚多设备/Contents.json index da4a164..73c0059 100644 --- a/Ifish/Assets.xcassets/绚多设备/Contents.json +++ b/Ifish/Assets.xcassets/绚多设备/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/Contents.json b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/Contents.json new file mode 100644 index 0000000..0b884a8 --- /dev/null +++ b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "normalImage.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "normalImage@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "normalImage@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage.png b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage.png new file mode 100644 index 0000000..9949653 Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage.png differ diff --git a/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage@2x.png b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage@2x.png new file mode 100644 index 0000000..c5c87a5 Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage@2x.png differ diff --git a/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage@3x.png b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage@3x.png new file mode 100644 index 0000000..c893ff7 Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/normalImage.imageset/normalImage@3x.png differ diff --git a/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/Contents.json b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/Contents.json new file mode 100644 index 0000000..159c7a2 --- /dev/null +++ b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "selectedImage.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "selectedImage@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "selectedImage@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage.png b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage.png new file mode 100644 index 0000000..6f52db0 Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage.png differ diff --git a/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage@2x.png b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage@2x.png new file mode 100644 index 0000000..d09f998 Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage@2x.png differ diff --git a/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage@3x.png b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage@3x.png new file mode 100644 index 0000000..2c9c96b Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/selectedImage.imageset/selectedImage@3x.png differ diff --git a/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m b/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m index 225f751..712fc7c 100755 --- a/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m +++ b/Ifish/Utinitys/IfishUtils/UINavigationBar+Background.m @@ -164,7 +164,7 @@ static char overlayKey; if (@available(iOS 15.0, *)) { UINavigationBarAppearance *apperar = [self getNavgationAppearanceWithNavgationController:self]; apperar.backgroundImage = image; - apperar.backgroundImageContentMode=UIViewContentModeScaleAspectFill; + // apperar.backgroundImageContentMode=UIViewContentModeScaleAspectFill; self.standardAppearance = apperar; self.scrollEdgeAppearance = apperar; }else{ diff --git a/Ifish/controllers/BaseVIewContorller/FatherController.m b/Ifish/controllers/BaseVIewContorller/FatherController.m index 31ef2fe..46dc453 100644 --- a/Ifish/controllers/BaseVIewContorller/FatherController.m +++ b/Ifish/controllers/BaseVIewContorller/FatherController.m @@ -17,7 +17,9 @@ - (void)viewDidLoad { [super viewDidLoad]; self.edgesForExtendedLayout=UIRectEdgeNone; - + if (@available(iOS 15.0, *)) { + self.tableView.sectionHeaderTopPadding = 0; + } [self setNav]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/.DS_Store b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/.DS_Store index ffb4b46..d45bfca 100644 Binary files a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/.DS_Store and b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/.DS_Store differ diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.h new file mode 100644 index 0000000..064e8b9 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.h @@ -0,0 +1,21 @@ +// +// TimerTypeTableViewCell.h +// Ifish +// +// Created by 祝发冬 on 2022/5/3. +// Copyright © 2022 lianlian. All rights reserved. +// + +#import + + +NS_ASSUME_NONNULL_BEGIN + +@interface TimerTypeTableViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UIButton *timerbtn; +@property (weak, nonatomic) IBOutlet UIButton *recoverybtn; +@property (weak, nonatomic) IBOutlet UIButton *cyclebtn; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.m new file mode 100644 index 0000000..29d1387 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.m @@ -0,0 +1,31 @@ +// +// TimerTypeTableViewCell.m +// Ifish +// +// Created by 祝发冬 on 2022/5/3. +// Copyright © 2022 lianlian. All rights reserved. +// + +#import "TimerTypeTableViewCell.h" + +@implementation TimerTypeTableViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code + [self.timerbtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(0); + make.top.mas_equalTo(0); + make.bottom.mas_equalTo(0); + make.width.mas_equalTo(120); }]; + self.timerbtn.titleEdgeInsets=UIEdgeInsetsMake(10, -90, 10, 0); + self.timerbtn.titleLabel.font=[UIFont systemFontOfSize:15]; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.xib b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.xib new file mode 100644 index 0000000..80afe29 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/TimerTypeTableViewCell.xib @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m index 208c42d..face52e 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2fController.m @@ -1047,7 +1047,7 @@ [self.navigationController pushViewController:_settingVC animated:YES]; } else if (self.dataModel.gasPump.length) { - Xuanduo2SettingController *_settingVC = [[Xuanduo2SettingController alloc] init]; + XuanduoSettingController *_settingVC = [[XuanduoSettingController alloc] init]; _settingVC.currentdevice = self.currentDevice; _settingVC.dataModel = self.dataModel; [self.navigationController pushViewController:_settingVC animated:YES]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSectionHeaderView.xib b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSectionHeaderView.xib index 0b90c97..ebc081a 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSectionHeaderView.xib +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSectionHeaderView.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -54,6 +52,7 @@ + @@ -74,7 +73,6 @@ - @@ -83,10 +81,10 @@ - - + + - + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.h index c1d9f9a..a3be72c 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.h @@ -10,10 +10,11 @@ NS_ASSUME_NONNULL_BEGIN -@interface XuanduoSelectHeader : UIView +@interface XuanduoSelectHeader : UIImageView + (instancetype)shareHeaderView; @property (weak, nonatomic) IBOutlet UIButton *controlBtn; +@property (weak, nonatomic) IBOutlet UIImageView *backImageView; - (void)configWithImageName:(NSString *)name labelName:(NSString *)labelName; @end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.m index d1fde0c..c0d0c51 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.m @@ -20,7 +20,11 @@ return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([XuanduoSelectHeader class]) owner:nil options:nil].lastObject; } - +-(void)awakeFromNib +{ + self.userInteractionEnabled=YES; + +} - (void)configWithImageName:(NSString *)name labelName:(NSString *)labelName { self.imageView.image = [UIImage imageNamed:name]; self.label.text = labelName; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.xib b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.xib index 7be2d10..2d00bf2 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.xib +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSelectHeader.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -42,6 +40,7 @@ + @@ -57,8 +56,8 @@ - + @@ -67,9 +66,9 @@ - - + + - + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSettingController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSettingController.m index 441b005..17c714c 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSettingController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoSettingController.m @@ -28,6 +28,7 @@ #import "NSString+Add.h" #import "XuToControlName.h" #import "UserExtendataArchaver.h" +#import "XuanduoTimerSettingViewController.h" #define kBtnTag 500 #define kSwitchBtnTag 600 @@ -124,9 +125,9 @@ static NSString *setTimerflag = @"SetTimerCell"; - (void)setupTable { - _titieArr = @[@"预警设置",@"喂鱼设置",@"温度校准",@"功能说明"]; + _titieArr = @[@"定时设置",@"喂鱼设置",@"温度校准",@"功能说明"]; - _imgArr = @[@"定时",@"喂鱼",@"温度校准",@"功能说明"]; + _imgArr = @[@"定时",@"喂鱼",@"温度校准",@"功能说明 "]; @@ -144,8 +145,15 @@ static NSString *setTimerflag = @"SetTimerCell"; [self.timeDic setObject:dataArr forKey:_titieArr[i]]; } + self.tableView.backgroundColor=COLOR_MIAN; + self.tableView.estimatedRowHeight=0; + self.tableView.estimatedSectionFooterHeight=0; + self.tableView.estimatedSectionHeaderHeight=0; self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone; + self.tableView.separatorInset=UIEdgeInsetsMake(0, 15, 0, 15); + + [self.tableView registerNib:[UINib nibWithNibName:temperatureCellid bundle:nil] forCellReuseIdentifier:temperatureCellid]; [self.tableView registerNib:[UINib nibWithNibName:changeWaterCellid bundle:nil] forCellReuseIdentifier:changeWaterCellid]; [self.tableView registerNib:[UINib nibWithNibName:addCellid bundle:nil] forCellReuseIdentifier:addCellid]; @@ -165,16 +173,9 @@ static NSString *setTimerflag = @"SetTimerCell"; return 2; } if (section - 2 < _titieArr.count) { - NSArray *dataArr = [self.timeDic objectForKey:_titieArr[section-2]]; - return dataArr.count; - } - else - { - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - return 1; - } + return 1; } + return 0; } @@ -183,6 +184,9 @@ static NSString *setTimerflag = @"SetTimerCell"; TemperatureSetCell *cell = [tableView dequeueReusableCellWithIdentifier:temperatureCellid]; TemperatureSetModel *model=[[TemperatureSetModel alloc]init]; model.title = @"预警设置"; + cell.icon.hidden=NO; + cell.icon.image=[UIImage imageNamed:@"预警"]; + cell.titileLabelLayout.constant=40; cell.titleLabel.text = model.title; NSLog(@"wendu str = %@",_wenduString); model.temperatureLabel = _wenduString; @@ -235,7 +239,9 @@ static NSString *setTimerflag = @"SetTimerCell"; cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle]; } - + cell.icon.hidden=NO; + cell.icon.image=[UIImage imageNamed:@"换水"]; + cell.titileLabelLayout.constant=40; return cell; @@ -363,22 +369,10 @@ static NSString *setTimerflag = @"SetTimerCell"; return 50; } }else if (indexPath.section - 2 <_titieArr.count) { - NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]]; - BOOL havePlus = [dataArr containsObject:plusflag]; - if (_selectSection == indexPath.section) { - if (havePlus && indexPath.row == dataArr.count - 1) { - return 80; - }else{ - return 50; - } - }else { - return 0; - } - } - else if(indexPath.section - 2 ==_titieArr.count&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - return 50; + return 0; } + + return 0; } @@ -386,22 +380,11 @@ static NSString *setTimerflag = @"SetTimerCell"; #pragma mark tableView 头视图和脚视图 -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ if (section == 0) { - return 5; - }else if (section == 2){ + return 0; + }else if (section >1){ return 40; - }else if (section == 3){ - return 40; - }else if (section == 4){ - return 40; - }else if (section == 5){ - - return [self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?0:40; - }else if (section == 6){ - return 40; - }else if (section == 7){ - return 40; - }else { - return CGFLOAT_MIN; + }else{ + return 0; } } @@ -411,75 +394,42 @@ static NSString *setTimerflag = @"SetTimerCell"; UIView *oneHeader = [[UIView alloc] init]; oneHeader.backgroundColor = COLOR_MIAN; return oneHeader; - }else if(section == 2){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 3){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 4){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 5){ - if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - UIView *oneHeader = [[UIView alloc] init]; - oneHeader.backgroundColor = COLOR_MIAN; - return oneHeader; - } - else - { - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - } - - }else if(section == 6){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; - } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; - }else if(section == 7){ + }else if(section > 1){ XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; headerView.controlBtn.tag = kBtnTag + section; if (_selectSection == section) { headerView.controlBtn.selected = YES; } + [headerView.controlBtn setImage:[UIImage imageNamed:@"arrow_right"] forState:UIControlStateNormal]; + // headerView.backImageView.image=[UIImage imageNamed:@"矩形"]; [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; return headerView; + }else + { + UIView *oneHeader = [[UIView alloc] init]; + oneHeader.backgroundColor = COLOR_MIAN; + return oneHeader; } return nil; } +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section +{ + CGFloat height=0; + if (section==1) + { + height=40; + } + return height; +} +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section +{ + UIView *oneHeader = [[UIView alloc] init]; + oneHeader.backgroundColor = COLOR_MIAN; + return oneHeader; +} #pragma mark tableView 点击事件 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ @@ -571,64 +521,12 @@ static NSString *setTimerflag = @"SetTimerCell"; } #pragma mark - cell的折叠 -- (void)foldAction:(UIButton *)btn { - if (_selectSection == btn.tag - kBtnTag) { - _selectSection = -1; - [self.tableView reloadData]; - }else { - _selectSection = btn.tag - kBtnTag; - ReadTimerModel *readModel = [[ReadTimerModel alloc] init]; - //杀菌不定时 - if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]&&(_selectSection - 2)==2) - { - readModel.functionCode=@"19";//读取 - } - else - { - readModel.functionCode=@"16"; - } - readModel.sendmacId =self.currentdevice.macAddress; - readModel.resavemacId = self.currentdevice.macAddress; - readModel.crc16str=@"0000"; - switch (_selectSection - 2) { - case 0: //循环泵 或 照明 - readModel.selectorNumber = @"04"; - if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - readModel.selectorNumber=@"01"; - } - break; - case 1: //增氧 - readModel.selectorNumber = @"01"; - if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - readModel.selectorNumber=@"02"; - } - break; - case 2: //灯光1 - readModel.selectorNumber = @"02"; - if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) - { - readModel.selectorNumber=@"03"; - } - break; - case 3: //灯光2 - readModel.selectorNumber = @"03"; - break; - case 4: //造浪泵 - readModel.selectorNumber = @"06"; - break; - case 5: // 杀菌灯 - readModel.selectorNumber = @"05"; - break; - default: - break; - } - NSString*readString=[NSString stringWithFormat:@"%@%@%@",readModel.description,readModel.selectorNumber,readModel.crc16str]; - NSData*readData=[dataContorl stringToHexData:readString]; - [[Socketsingleton sharedInstance] soketWriteData:readData]; - [_indicatorView startAnimating]; - } +- (void)foldAction:(UIButton *)btn +{ + XuanduoTimerSettingViewController *_settingVC = [[XuanduoTimerSettingViewController alloc] init]; + _settingVC.currentdevice = self.currentdevice; + _settingVC.dataModel = self.dataModel; + [self.navigationController pushViewController:_settingVC animated:YES]; } - (void)switchAction:(UIButton *)btn { diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTimerSettingViewController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTimerSettingViewController.h new file mode 100644 index 0000000..69e80cb --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTimerSettingViewController.h @@ -0,0 +1,27 @@ +// +// Xuanduo2SettingController.h +// Ifish +// +// Created by Alex on 2019/4/28. +// Copyright © 2019 lianlian. All rights reserved. +// + +#import "FatherController.h" +#import "IfishDeviceInfo.h" +#include "xuanduo3fModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@class Xuanduo2Model; + +@interface XuanduoTimerSettingViewController : FatherController + +@property (nonatomic,strong) UIActivityIndicatorView*indicatorView; +@property (nonatomic ,strong) id dataModel; +@property(nonatomic,strong) DeviceModel* currentdevice; + +- (void)refreshWithData:(id)model; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTimerSettingViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTimerSettingViewController.m new file mode 100644 index 0000000..4dfcafc --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuanduoTimerSettingViewController.m @@ -0,0 +1,1621 @@ +// +// Xuanduo2SettingController.m +// Ifish +// +// Created by Alex on 2019/4/28. +// Copyright © 2019 lianlian. All rights reserved. +// + +#import "XuanduoTimerSettingViewController.h" +#import "UINavigationBar+Background.h" +#import "TemperatureSetCell.h" +#import "ChangeWaterCell.h" +#import "Xuanduo2Model.h" +#import "TemperatureSetModel.h" +#import "setWaringTpModel.h" +#import "remindCyclePic.h" +#import "MyPickerView.h" +#import "PlusTableViewCell.h" +#import "SetTimerCell.h" +#import "XuanduoSectionHeaderView.h" +#import "XuanduoSelectHeader.h" +#import "MydatePickerView.h" +#import "SetTimerModel.h" +#import "ReadTimerModel.h" +#import "Xuanduo2DataUtility.h" +#import "Xuanduo2TimerModel.h" +#import "IfishDeviceInfo.h" +#import "NSString+Add.h" +#import "XuToControlName.h" +#import "UserExtendataArchaver.h" +#import "TimerTypeTableViewCell.h" + +#define kBtnTag 500 +#define kSwitchBtnTag 600 +static NSString *temperatureCellid = @"TemperatureSetCell"; +static NSString *changeWaterCellid = @"ChangeWaterCell"; +static NSString *addCellid = @"PlusTableViewCell"; +static NSString *plusflag = @"plusCell"; +static NSString *setTimerflag = @"SetTimerCell"; +static NSString *timerTypeFlag = @"TimerTypeTableViewCell"; + + + +@interface XuanduoTimerSettingViewController () +@property(nonatomic,strong) setRemindWaterModel *waterInfmodel; +@property(nonatomic,strong) Xuanduo2TimerModel *timerModel; +@property(nonatomic,strong) XuanduoCycleModel *cycleModel; + +@property (nonatomic,strong) NSMutableDictionary *timeDic; +@property(nonatomic,copy) NSString *nextChangeDateLabel; +@property(nonatomic,strong) MyHud *XuTohud; + +@end + +@implementation XuanduoTimerSettingViewController +{ + NSString *_wenduString; + NSIndexPath *_indexPath; + MyPickerView *_mypicView; + NSArray *_titieArr; + NSArray *_imgArr; + remindCyclePic*_remindPic; + BOOL _huanShuiSwitchIsOn; + NSInteger _selectSection; + MydatePickerView*_mydatepicView; + +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if (_currentdevice) { + [IFISHHTTPTOOL getRemindWaterInfWith:_currentdevice.deviceId huishuiInfo:^(setRemindWaterModel *remindModel) { + + self.waterInfmodel=remindModel; + + NSUserDefaults*defuat=[NSUserDefaults standardUserDefaults]; + + [defuat setInteger:self.waterInfmodel.remindcycle forKey:@"xuto2picResult"]; + [defuat synchronize]; + self.nextChangeDateLabel=self.waterInfmodel.remindDate; + + [self.tableView reloadData]; + }]; + } +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self setup]; + [self connect]; +} + +- (void)viewWillDisappear:(BOOL)animated{ + [_indicatorView stopAnimating]; +} + +- (void)setup { + [self.navigationController.navigationBar resetBackgroundImage]; + + NSString*title=@"定时设置"; + + [self addTitleViewWithTitle:title]; + [self refreshWithData:self.dataModel]; + [self setupTable]; + [self creatIndicatorView]; + [Socketsingleton sharedInstance].communiteDelegate = self; +} + +- (void)refreshWithData:(Xuanduo3fModel*)model { + + NSString*low = model.miniTemp; + NSString*heigh = model.maxTemp; + UInt64 lowten = [dataContorl hexToTen:low]; + UInt64 heighten = [dataContorl hexToTen:heigh]; + float formatlow = lowten/10; + float formatheigh = heighten/10; + _wenduString = [NSString stringWithFormat:@"%.0f~%.0f°C",formatlow,formatheigh]; +} + +- (void)setupTable { + + XuToControlName *name = [UserExtendataArchaver currentNewXuToControlName:self.currentdevice.macAddress]; + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + name=[UserExtendataArchaver currentPetsXuToControlName:self.currentdevice.macAddress]; + } + // _titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"]; + _titieArr = @[name.xunhuanPump,name.zengyangPump,name.light1,name.light2,name.zaolangPump,name.shajunLight]; + + _imgArr = @[@"循环棒",@"增氧泵",@"灯光1",@"灯光2",@"造浪",@"杀菌"]; + + + + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + _titieArr = @[name.xunhuanPump,name.zaolangPump,name.light1]; + _imgArr = @[@"照明开",@"换气开",@"杀菌开"]; + } + + + + _selectSection = -1; + for (int i = 0; i<_titieArr.count; i++) { + NSMutableArray *dataArr = [NSMutableArray arrayWithCapacity:0]; + if (![_titieArr[i] isEqualToString:@"杀菌"]) + { + [dataArr addObject:plusflag]; + } + + [self.timeDic setObject:dataArr forKey:_titieArr[i]]; + } + self.tableView.backgroundColor=COLOR_MIAN; + self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone; + [self.tableView registerNib:[UINib nibWithNibName:temperatureCellid bundle:nil] forCellReuseIdentifier:temperatureCellid]; + [self.tableView registerNib:[UINib nibWithNibName:changeWaterCellid bundle:nil] forCellReuseIdentifier:changeWaterCellid]; + [self.tableView registerNib:[UINib nibWithNibName:addCellid bundle:nil] forCellReuseIdentifier:addCellid]; + [self.tableView registerNib:[UINib nibWithNibName:timerTypeFlag bundle:nil] forCellReuseIdentifier:timerTypeFlag]; + [self.tableView registerNib:[UINib nibWithNibName:setTimerflag bundle:nil] forCellReuseIdentifier:setTimerflag]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 2 + self.timeDic.allKeys.count+([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?1:0); +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (section == 0) { + return 1; + }else if (section == 1){ + return 2; + } + if (section - 2 < _titieArr.count) { + NSArray *dataArr = [self.timeDic objectForKey:_titieArr[section-2]]; + return dataArr.count; + } + else + { + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + return 1; + } + } + return 0; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + if (indexPath.section == 0){ + TemperatureSetCell *cell = [tableView dequeueReusableCellWithIdentifier:temperatureCellid]; + TemperatureSetModel *model=[[TemperatureSetModel alloc]init]; + model.title = @"定时设置"; + cell.titleLabel.text = model.title; + NSLog(@"wendu str = %@",_wenduString); + model.temperatureLabel = _wenduString; + cell.temperaturelabel.text = model.temperatureLabel; + [cell.temPSwitch addTarget:self action:@selector(xuTotempSwitchAction:) forControlEvents:UIControlEventTouchUpInside]; + cell.temperaturelabel.hidden=YES; + cell.temPSwitch.hidden=YES; + cell.icon.hidden=NO; + cell.icon.image=[UIImage imageNamed:@"定时"]; + cell.titileLabelLayout.constant=40; + if (self.dataModel) { + Xuanduo2Model*model=self.dataModel; + if ([model.alarmSwitch isEqualToString:@"01"]) { + + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; + cell.temPSwitch.selected = NO; + + }else{ + + [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; + + cell.temPSwitch.selected = YES; + } + + } + + return cell; + }else if(indexPath.section == 1 && indexPath.row == 0){ + if (![self.currentdevice.waterRemind isEqual:[NSNull null]]) { + ChangeWaterCell *cell = [tableView dequeueReusableCellWithIdentifier:changeWaterCellid]; + [cell.ChangeWaterSwitch addTarget:self action:@selector(xuTochangeWaterSwitch:) forControlEvents:UIControlEventTouchUpInside]; + + if ([self.waterInfmodel.waterremind isEqualToString:@"1"]) { + [cell.ChangeWaterSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; + cell.ChangeWaterSwitch.selected = NO; + cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"firstSetCell"]]; + _huanShuiSwitchIsOn=YES; + }else{ + [cell.ChangeWaterSwitch setBackgroundImage:[UIImage imageNamed:@"graybtn_big"] forState:UIControlStateNormal]; + cell.ChangeWaterSwitch.selected = YES; + _huanShuiSwitchIsOn=NO; + cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"set_cellBack"]]; + } + + if (self.waterInfmodel.remindcycle == 0) { + //在未获取换水信息时暂时显示 + cell.huanshuiDaylabel.text=@"换水时间"; + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + cell.huanshuiDaylabel.text=@"杀菌时间"; + cell.titleLabel.text=@"杀菌提醒"; + } + }else{ + + cell.huanshuiDaylabel.text=[NSString stringWithFormat:@"%ld天",(long)self.waterInfmodel.remindcycle]; + + } + + + return cell; + + } + }else if (indexPath.section==1 && indexPath.row == 1){ + + static NSString*nextHuanShuiLablecellId=@"labelcell"; + UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:nextHuanShuiLablecellId]; + if (cell==nil) { + cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nextHuanShuiLablecellId]; + } + if (_huanShuiSwitchIsOn) { + + cell.textLabel.text=[NSString stringWithFormat:@"下次换水时间:%@",self.waterInfmodel.remindDate]; + if (!self.waterInfmodel.remindDate) { + cell.textLabel.text=[NSString stringWithFormat:@"下次换水时间:%@",self.nextChangeDateLabel]; + } + + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + cell.textLabel.text=[NSString stringWithFormat:@"下次杀菌时间:%@",self.waterInfmodel.remindDate]; + if (!self.waterInfmodel.remindDate) { + cell.textLabel.text=[NSString stringWithFormat:@"下次杀菌时间:%@",self.nextChangeDateLabel]; + } + + } + + cell.textLabel.font=[UIFont systemFontOfSize:15]; + [cell.textLabel sizeToFit]; + + cell.textLabel.textColor =[UIColor colorWithRed:146.0/256.0 green:146.0/256.0 blue:146.0/256.0 alpha:1]; + cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"secondSetCell"]]; + + } + else{ + cell.textLabel.text=@""; + } + cell.userInteractionEnabled = NO; + return cell; + + }else if(indexPath.section -2== _titieArr.count && indexPath.row == 0&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]){ + TemperatureSetCell *cell = [tableView dequeueReusableCellWithIdentifier:temperatureCellid]; + TemperatureSetModel *model=[[TemperatureSetModel alloc]init]; + model.title = @"恒温设置"; + cell.titleLabel.text = model.title; + + Xuanduo3fModel*xmodel=(Xuanduo3fModel*)_dataModel; + NSString*heating = xmodel.heatingTemperature; + UInt64 heat = [dataContorl hexToTen:heating]; + + float formatheat = heat/10; + model.temperatureLabel = [NSString stringWithFormat:@"%f",formatheat]; + cell.temPSwitch.hidden=YES; + cell.temperaturelabel.frame=cell.temPSwitch.frame; + + Xuanduo3fModel*model3=self.dataModel; + int mac=[dataContorl hexToTen:model3.heatingTemperature]; + + //float TPlabel=mac/10+(mac%10)*0.1; + float temp = mac/10.0; + NSString *stringTemp = [NSString stringWithFormat:@"%.1f℃",temp]; + cell.temperaturelabel.textAlignment=NSTextAlignmentRight; + [cell.temperaturelabel setAttributedText:[NSString ls_changeFontAndColor:[UIFont systemFontOfSize:15] Color:nil TotalString:stringTemp SubStringArray:@[@"℃"]]]; + + + + + return cell; + + } + else { + if (indexPath.section - 2 < _titieArr.count && _selectSection == indexPath.section) { + NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]]; + BOOL havePlus = [dataArr containsObject:plusflag]; + if (havePlus && (indexPath.row == dataArr.count-1)) { + TimerTypeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:timerTypeFlag forIndexPath:indexPath]; + + return cell; + }else { + SetTimerCell *cell = [tableView dequeueReusableCellWithIdentifier:setTimerflag forIndexPath:indexPath]; + cell.switchBtn.tag = kSwitchBtnTag + indexPath.row; + [cell.switchBtn addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventTouchUpInside]; + XuanduoTimerGroup *group = [dataArr objectAtIndex:havePlus?indexPath.row+1:indexPath.row]; + cell.model=group; + if ([group isKindOfClass:[XuanduoTimerGroup class]]) + { + BOOL isOn = NO; + if ([group.status isEqualToString:@"01"]) { + isOn = YES; + } + [cell configTitleLabel:[NSString stringWithFormat:@"时段%@",group.groupNumber] timer:group.time switchStatus:isOn]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + + } + else if([group isKindOfClass:[XuanduoCycleModel class]]) + { + XuanduoCycleModel*model=group; + BOOL isOn = NO; + if ([model.status isEqualToString:@"00"]) { + isOn = YES; + } + + + + [cell configTitleLabel:@"循环开关" timer:[NSString stringWithFormat:@"持续时长%d分钟",[dataContorl hexToTen:model.lastTime]] switchStatus:isOn]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + + } + return cell; + } + } + } + return [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@""]; +} + +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + return 50; + }else if (indexPath.section == 1 && indexPath.row == 0){ + return 0; + }else if (indexPath.section == 1 && indexPath.row == 1){ + if (!_huanShuiSwitchIsOn) { + }else { + return 0; + } + }else if (indexPath.section - 2 <_titieArr.count) { + NSArray *dataArr = [self.timeDic objectForKey:_titieArr[indexPath.section-2]]; + BOOL havePlus = [dataArr containsObject:plusflag]; + if (_selectSection == indexPath.section) { + if (havePlus && indexPath.row == dataArr.count - 1) { + return 40; + }else{ + return 50; + } + }else { + return 0; + } + } + else if(indexPath.section - 2 ==_titieArr.count&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + return 50; + } + + return 0; +} + +#pragma mark tableView 头视图和脚视图 +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + if (section == 0) { + return 5; + }else if (section == 2){ + return 40; + }else if (section == 3){ + return 40; + }else if (section == 4){ + return 40; + }else if (section == 5){ + + return [self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?0:40; + }else if (section == 6){ + return 40; + }else if (section == 7){ + return 40; + }else { + return CGFLOAT_MIN; + } + +} + +- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + if (section == 0) { + UIView *oneHeader = [[UIView alloc] init]; + oneHeader.backgroundColor = COLOR_MIAN; + return oneHeader; + }else if(section == 2){ + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; + if (_selectSection == section) { + headerView.controlBtn.selected = YES; + } + [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; + [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; + return headerView; + }else if(section == 3){ + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; + if (_selectSection == section) { + headerView.controlBtn.selected = YES; + } + [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; + [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; + return headerView; + }else if(section == 4){ + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; + if (_selectSection == section) { + headerView.controlBtn.selected = YES; + } + [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; + [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; + return headerView; + }else if(section == 5){ + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + UIView *oneHeader = [[UIView alloc] init]; + oneHeader.backgroundColor = COLOR_MIAN; + return oneHeader; + } + else + { + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; + if (_selectSection == section) { + headerView.controlBtn.selected = YES; + } + [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; + [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; + return headerView; + } + + }else if(section == 6){ + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; + if (_selectSection == section) { + headerView.controlBtn.selected = YES; + } + [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; + [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; + return headerView; + }else if(section == 7){ + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; + if (_selectSection == section) { + headerView.controlBtn.selected = YES; + } + [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; + [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; + return headerView; + } + + return nil; +} + +#pragma mark tableView 点击事件 + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + _indexPath = indexPath; + if (indexPath.section==0) { +// _mypicView=[[MyPickerView alloc]init]; +// +// _mypicView.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); +// [self.view.window addSubview:_mypicView]; +// [_mypicView.sureButton addTarget:self action:@selector(mypicViewRemoveByDone) forControlEvents:UIControlEventTouchUpInside]; +// [self temperatureMainQueue]; + + }else if (indexPath.section==1){ + //换水提醒日期选择 + _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:self.currentdevice.type]; + + _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); + _remindPic.type=self.currentdevice.type; + [self.view.window addSubview:_remindPic]; + [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; + [self huanShuiMainQueue]; + }else if(indexPath.section-2==_titieArr.count){ + //恒温设置 + _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:@"temp"]; + _remindPic.type=@"temp"; + + _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); + [self.view.window addSubview:_remindPic]; + [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; + [self huanShuiMainQueue]; + }else { + SetTimerCell *cell = [self.tableView cellForRowAtIndexPath:_indexPath]; + if ([cell isKindOfClass:[PlusTableViewCell class]]) { + return; + } + else if([cell isKindOfClass:[SetTimerCell class]]&&[cell.model isKindOfClass:[XuanduoCycleModel class]]) + { + //恒温设置 + _cycleModel=cell.model; + _remindPic=[[remindCyclePic alloc]initWithFrame:CGRectMake(0, 0, kScreenSize.width, kScreenSize.height) type:@"cycle"]; + _remindPic.type=@"cycle"; + + _remindPic.frame=CGRectMake(0, 0, kScreenSize.width, kScreenSize.height); + [self.view.window addSubview:_remindPic]; + [_remindPic.sureBtn addTarget:self action:@selector(xuToremindCyclePicDone) forControlEvents:UIControlEventTouchUpInside]; + [self huanShuiMainQueue]; + } + else + { + [self addTimer:nil]; + + } + } +} + +-(void)temperatureMainQueue{ + NSArray*lowArr=[_mypicView.picArr objectAtIndex:0]; + NSArray*heighArr=[_mypicView.picArr objectAtIndex:2]; + for (NSInteger i=0; i=0 && [readTimer isEqualToString:@"0116"]) { + if (!_timerModel) { + _timerModel = [[Xuanduo2TimerModel alloc] init]; + _timerModel.groupModelArr = [NSMutableArray array]; + }else { + [_timerModel.groupModelArr removeAllObjects]; + } + [Xuanduo2DataUtility readTimerSocketDataWithBackMsgModel:_timerModel addWithBackStr:string1 type:self.currentdevice.type]; + NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection-2]]; + [dataArr removeAllObjects]; + [dataArr addObject:plusflag]; + [dataArr addObjectsFromArray:_timerModel.groupModelArr]; + BOOL havePlus = [dataArr containsObject:plusflag]; + if (havePlus && dataArr.count > 10) { + [dataArr removeObjectAtIndex:0]; + }else if (!havePlus && dataArr.count < 10){ + [dataArr insertObject:plusflag atIndex:0]; + } + NSLog(@"dataarr.count = %ld",dataArr.count); + + + } + else if (_selectSection-2<_titieArr.count && _selectSection-2>=0 && [readTimer isEqualToString:@"0119"]) { + + _cycleModel=[[XuanduoCycleModel alloc]init]; + [Xuanduo2DataUtility readCycleSocketDataWithBackMsgModel:_cycleModel addWithBackStr:string1 type:self.currentdevice.type]; + NSMutableArray *dataArr = [self.timeDic objectForKey:_titieArr[_selectSection-2]]; + [dataArr removeAllObjects]; + + [dataArr addObject:_cycleModel]; + + + + } + if ([readTimer isEqualToString:@"0108"] || [readTimer isEqualToString:@"0105"]) { + [Xuanduo2DataUtility readSocketDataWithBackMsgModel:self.dataModel addWithBackData:data type:self.currentdevice.type]; + [self refreshWithData:self.dataModel]; + + } + [self.XuTohud hidmyHud]; + [self.indicatorView stopAnimating]; + [self.tableView reloadData]; +} + +-(void)ifishDeviceLogInFail{ + +} + +-(void)ifishDeviceLogInSuccees{ + +} + +-(void)ifishSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket{ + +} + + + +@end diff --git a/Ifish/ifishImgSouce/.DS_Store b/Ifish/ifishImgSouce/.DS_Store index 3b2244c..7db341d 100644 Binary files a/Ifish/ifishImgSouce/.DS_Store and b/Ifish/ifishImgSouce/.DS_Store differ diff --git a/Ifish/ifishImgSouce/XuToImg/矩形.png b/Ifish/ifishImgSouce/XuToImg/矩形.png new file mode 100644 index 0000000..11fb176 Binary files /dev/null and b/Ifish/ifishImgSouce/XuToImg/矩形.png differ diff --git a/Ifish/ifishImgSouce/XuToImg/矩形@2x.png b/Ifish/ifishImgSouce/XuToImg/矩形@2x.png new file mode 100644 index 0000000..64b9511 Binary files /dev/null and b/Ifish/ifishImgSouce/XuToImg/矩形@2x.png differ diff --git a/Ifish/ifishImgSouce/XuToImg/矩形@3x.png b/Ifish/ifishImgSouce/XuToImg/矩形@3x.png new file mode 100644 index 0000000..8be57b0 Binary files /dev/null and b/Ifish/ifishImgSouce/XuToImg/矩形@3x.png differ diff --git a/Ifish/views/.DS_Store b/Ifish/views/.DS_Store index d7bd8f3..46908bc 100644 Binary files a/Ifish/views/.DS_Store and b/Ifish/views/.DS_Store differ diff --git a/Ifish/views/setViewCell/ChangeWaterCell.h b/Ifish/views/setViewCell/ChangeWaterCell.h index 6e631ad..c5669a6 100644 --- a/Ifish/views/setViewCell/ChangeWaterCell.h +++ b/Ifish/views/setViewCell/ChangeWaterCell.h @@ -13,6 +13,8 @@ @property (weak, nonatomic) IBOutlet UILabel *huanshuiDaylabel; @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (weak, nonatomic) IBOutlet UIButton *ChangeWaterSwitch; +@property (weak, nonatomic) IBOutlet UIImageView *icon; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titileLabelLayout; @end diff --git a/Ifish/views/setViewCell/ChangeWaterCell.xib b/Ifish/views/setViewCell/ChangeWaterCell.xib index 38f503e..4381cb1 100644 --- a/Ifish/views/setViewCell/ChangeWaterCell.xib +++ b/Ifish/views/setViewCell/ChangeWaterCell.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -15,7 +13,7 @@ - + + + + @@ -55,6 +62,8 @@ + + diff --git a/Ifish/views/setViewCell/TemperatureSetCell.h b/Ifish/views/setViewCell/TemperatureSetCell.h index 9863133..dc86391 100644 --- a/Ifish/views/setViewCell/TemperatureSetCell.h +++ b/Ifish/views/setViewCell/TemperatureSetCell.h @@ -16,5 +16,6 @@ //@property (weak, nonatomic) IBOutlet UISwitch *tempSwitch; @property (weak, nonatomic) IBOutlet UIButton *temPSwitch; - +@property (weak, nonatomic) IBOutlet UIImageView *icon; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titileLabelLayout; @end diff --git a/Ifish/views/setViewCell/TemperatureSetCell.xib b/Ifish/views/setViewCell/TemperatureSetCell.xib index c7c9ced..8adedbb 100644 --- a/Ifish/views/setViewCell/TemperatureSetCell.xib +++ b/Ifish/views/setViewCell/TemperatureSetCell.xib @@ -1,12 +1,9 @@ - - - - + + - - + @@ -16,17 +13,17 @@ - + + + + + + - +