diff --git a/.DS_Store b/.DS_Store index 6667d3f..1dcd696 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index 5f2243a..129258d 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -2254,6 +2254,14 @@ C024B7AF2379668B00509424 /* NSMutableString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79B2379668B00509424 /* NSMutableString+AvoidCrash.h */; }; C024B7B02379668B00509424 /* NSMutableAttributedString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79C2379668B00509424 /* NSMutableAttributedString+AvoidCrash.h */; }; C024B7B12379668B00509424 /* NSMutableArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */; }; + C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0837A55244FF5500034FEC5 /* EGOCache.m */; }; + C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C0837A56244FF5500034FEC5 /* EGOCache.h */; }; + 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 */; }; + C0B2F55D244D5577001079AA /* StoreNameView.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B2F55B244D5577001079AA /* StoreNameView.h */; }; + C0B2F55E244D5577001079AA /* StoreNameView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0B2F55C244D5577001079AA /* StoreNameView.m */; }; + C0B2F560244D568E001079AA /* StoreNameView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0B2F55F244D568E001079AA /* StoreNameView.xib */; }; C0E746D5239E4A7D001BCD6D /* wechatlogin.png in Resources */ = {isa = PBXBuildFile; fileRef = C0E746D4239E4A7C001BCD6D /* wechatlogin.png */; }; C0E7D6C023A1D11500256A10 /* WXApiRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = C0E7D6BC23A1D11200256A10 /* WXApiRequestHandler.h */; }; C0E7D6C123A1D11500256A10 /* WXApiManager.h in Headers */ = {isa = PBXBuildFile; fileRef = C0E7D6BD23A1D11200256A10 /* WXApiManager.h */; }; @@ -2305,6 +2313,8 @@ C0EA8A3023AF74F4003DC53B /* UIButton+WebCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C0EA8A0F23AF74F3003DC53B /* UIButton+WebCache.m */; }; C0EA8A3123AF74F4003DC53B /* UIImage+GIF.h in Headers */ = {isa = PBXBuildFile; fileRef = C0EA8A1023AF74F3003DC53B /* UIImage+GIF.h */; }; C0F0400C23756F3C00B61D3B /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0F0400B23756F3C00B61D3B /* ExternalAccessory.framework */; }; + C0F6E1C0243B0A840071ECB9 /* xuanduo3fModel.h in Headers */ = {isa = PBXBuildFile; fileRef = C0F6E1BE243B0A840071ECB9 /* xuanduo3fModel.h */; }; + C0F6E1C1243B0A840071ECB9 /* xuanduo3fModel.m in Sources */ = {isa = PBXBuildFile; fileRef = C0F6E1BF243B0A840071ECB9 /* xuanduo3fModel.m */; }; CB0F4E8622951A130091C76D /* SVRadialGradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */; }; CB0F4E8722951A130091C76D /* SVIndefiniteAnimatedView.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */; }; CB0F4E8822951A130091C76D /* SVProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = CB0F4E7D22951A130091C76D /* SVProgressHUD.h */; }; @@ -5694,6 +5704,14 @@ C024B79B2379668B00509424 /* NSMutableString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableString+AvoidCrash.h"; sourceTree = ""; }; C024B79C2379668B00509424 /* NSMutableAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableAttributedString+AvoidCrash.h"; sourceTree = ""; }; C024B79D2379668B00509424 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = ""; }; + 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 = ""; }; + 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 = ""; }; + C0B2F55B244D5577001079AA /* StoreNameView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StoreNameView.h; sourceTree = ""; }; + C0B2F55C244D5577001079AA /* StoreNameView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StoreNameView.m; sourceTree = ""; }; + C0B2F55F244D568E001079AA /* StoreNameView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StoreNameView.xib; sourceTree = ""; }; C0E746D4239E4A7C001BCD6D /* wechatlogin.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wechatlogin.png; sourceTree = ""; }; C0E7D6BC23A1D11200256A10 /* WXApiRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiRequestHandler.h; sourceTree = ""; }; C0E7D6BD23A1D11200256A10 /* WXApiManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXApiManager.h; sourceTree = ""; }; @@ -5745,6 +5763,8 @@ C0EA8A0F23AF74F3003DC53B /* UIButton+WebCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+WebCache.m"; sourceTree = ""; }; C0EA8A1023AF74F3003DC53B /* UIImage+GIF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+GIF.h"; sourceTree = ""; }; C0F0400B23756F3C00B61D3B /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; }; + C0F6E1BE243B0A840071ECB9 /* xuanduo3fModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xuanduo3fModel.h; sourceTree = ""; }; + C0F6E1BF243B0A840071ECB9 /* xuanduo3fModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = xuanduo3fModel.m; sourceTree = ""; }; CB0F4E7B22951A130091C76D /* SVRadialGradientLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVRadialGradientLayer.m; sourceTree = ""; }; CB0F4E7C22951A130091C76D /* SVIndefiniteAnimatedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVIndefiniteAnimatedView.h; sourceTree = ""; }; CB0F4E7D22951A130091C76D /* SVProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVProgressHUD.h; sourceTree = ""; }; @@ -9263,6 +9283,7 @@ 883E76461D48A5E50030E075 /* controllers */ = { isa = PBXGroup; children = ( + C0B2F53D244C6FAF001079AA /* pets */, CB4820462334B37100A50C92 /* ConnectAauariumVC */, CBA615F6228E526C00ED380D /* message */, 3D1C4F00221A9EDD0096AE43 /* IfishYooseeFile */, @@ -9486,6 +9507,8 @@ 883E76A31D48A5E50030E075 /* XutoBackMsgModel.m */, FA0892E7226B22C90084A609 /* Xuanduo2Model.h */, FA0892E8226B22C90084A609 /* Xuanduo2Model.m */, + C0F6E1BE243B0A840071ECB9 /* xuanduo3fModel.h */, + C0F6E1BF243B0A840071ECB9 /* xuanduo3fModel.m */, FAA732D6227C1DA80062C252 /* Xuanduo2TimerModel.h */, FAA732D7227C1DA80062C252 /* Xuanduo2TimerModel.m */, FA0892EB226C15000084A609 /* Xuanduo2DataUtility.h */, @@ -9868,6 +9891,7 @@ 883E791A1D48ACFF0030E075 /* Utinitys */ = { isa = PBXGroup; children = ( + C0837A54244FF5500034FEC5 /* EGOCache */, 885BD30E1E260B3C00CDB65A /* shuomingshu.html */, 887495541DAE1B2D00F8F4E2 /* IfishUtils */, 883E791B1D48ACFF0030E075 /* DataCenter */, @@ -9974,6 +9998,7 @@ 883E79451D48B0280030E075 /* views */ = { isa = PBXGroup; children = ( + C0B2F55A244D552A001079AA /* petsStoreName */, CB4820532334E2E800A50C92 /* HKPieChartView */, 887491D31E78CCA000CDA284 /* IifshSegmentView */, 8869B3701E6939FE0010F099 /* NJKWebViewProgress */, @@ -12180,6 +12205,35 @@ path = AvoidCrash; sourceTree = ""; }; + C0837A54244FF5500034FEC5 /* EGOCache */ = { + isa = PBXGroup; + children = ( + C0837A55244FF5500034FEC5 /* EGOCache.m */, + C0837A56244FF5500034FEC5 /* EGOCache.h */, + ); + path = EGOCache; + sourceTree = ""; + }; + C0B2F53D244C6FAF001079AA /* pets */ = { + isa = PBXGroup; + children = ( + C0B2F53E244C6FE3001079AA /* PetStoresViewController.h */, + C0B2F53F244C6FE3001079AA /* PetStoresViewController.m */, + C0B2F540244C6FE3001079AA /* PetStoresViewController.xib */, + ); + path = pets; + sourceTree = ""; + }; + C0B2F55A244D552A001079AA /* petsStoreName */ = { + isa = PBXGroup; + children = ( + C0B2F55B244D5577001079AA /* StoreNameView.h */, + C0B2F55C244D5577001079AA /* StoreNameView.m */, + C0B2F55F244D568E001079AA /* StoreNameView.xib */, + ); + name = petsStoreName; + sourceTree = ""; + }; C0E7D6C423A1D16C00256A10 /* Helper */ = { isa = PBXGroup; children = ( @@ -12866,6 +12920,7 @@ 3D1C50B4221A9EDF0096AE43 /* YTheNaviBar.h in Headers */, 3D1C5121221A9EE00096AE43 /* CameraBottomCollectionViewCell.h in Headers */, CB484E1222B8C8C90075F050 /* vdpau.h in Headers */, + C0B2F55D244D5577001079AA /* StoreNameView.h in Headers */, C0EA8A1323AF74F4003DC53B /* UIImageView+WebCache.h in Headers */, CB4820962334E99700A50C92 /* IQUIView+Hierarchy.h in Headers */, FA0892E9226B22C90084A609 /* Xuanduo2Model.h in Headers */, @@ -12888,16 +12943,19 @@ CB484DFA22B8C8C80075F050 /* log.h in Headers */, CB48207F2334E99700A50C92 /* IQPreviousNextView.h in Headers */, FA0893152275F7CF0084A609 /* XuanduoSelectHeader.h in Headers */, + C0837A58244FF5510034FEC5 /* EGOCache.h in Headers */, 3D1C50D1221A9EE00096AE43 /* SVPullToRefresh.h in Headers */, CB7D6AB022954DE20014E5C7 /* CommonUtils.h in Headers */, 3D1C513C221A9EE10096AE43 /* FishControlFourthCell.h in Headers */, 3D1C5086221A9EDF0096AE43 /* KTThumbView.h in Headers */, 3D1C50E5221A9EE00096AE43 /* ShakeManager.h in Headers */, 3D1C5088221A9EDF0096AE43 /* KTThumbsView.h in Headers */, + C0F6E1C0243B0A840071ECB9 /* xuanduo3fModel.h in Headers */, 3D1C513F221A9EE10096AE43 /* FishControlThreedViewCell.h in Headers */, FA0892F52270BED00084A609 /* XuanduoHuliModel.h in Headers */, C024B79F2379668B00509424 /* AvoidCrash.h in Headers */, C024B7AE2379668B00509424 /* NSObject+AvoidCrash.h in Headers */, + C0B2F541244C6FE3001079AA /* PetStoresViewController.h in Headers */, 3D1C50C7221A9EE00096AE43 /* LocalDevice.h in Headers */, 3D1C50A0221A9EDF0096AE43 /* TouchButton.h in Headers */, CBB0243723517947002900D5 /* MJExtension.h in Headers */, @@ -13935,6 +13993,7 @@ E51D7D58208CE121001FF053 /* CustomModeSetCell.xib in Resources */, 882956A61DBDA3A200E9DDD7 /* community_left@2x.png in Resources */, 883E79181D48A74F0030E075 /* scanscanBg.png in Resources */, + C0B2F543244C6FE3001079AA /* PetStoresViewController.xib in Resources */, 3D1C50D5221A9EE00096AE43 /* SVPullToRefresh.bundle in Resources */, 8871C4981E6D507B000AA49F /* signin_condition_await@3x.png in Resources */, 883283481EAEE60500A47157 /* ifish_look_on.png in Resources */, @@ -14211,6 +14270,7 @@ 8871C4A41E6D507B000AA49F /* signin_condition_gift_conduct@3x.png in Resources */, 881672121EA5DE2B00BEBF23 /* FZLanTingHei-L-GBK-M.TTF in Resources */, 881478121E712A2700BFB79C /* task_choiceLookShops@3x.png in Resources */, + C0B2F560244D568E001079AA /* StoreNameView.xib in Resources */, 882956211DBDA3A100E9DDD7 /* neves0036.png in Resources */, 8865120C1E979BF100BABDF1 /* personal_iocn_share@3x.png in Resources */, 8814781B1E712A2700BFB79C /* task_ifishDoctorpng.png in Resources */, @@ -14525,6 +14585,7 @@ 883E79C21D48B0280030E075 /* InfoCell.m in Sources */, CBA6169A22924F1E00ED380D /* MessageAlertView.m in Sources */, C0EA8A1F23AF74F4003DC53B /* SDWebImagePrefetcher.m in Sources */, + C0B2F55E244D5577001079AA /* StoreNameView.m in Sources */, 88F5EE531D48CA2800CC7CAF /* ESPUDPSocketClient.m in Sources */, 883E78561D48A5E50030E075 /* IfishBlackListCenterViewController.m in Sources */, CB484E1A22B8C8C90075F050 /* RtspInterface.mm in Sources */, @@ -14825,6 +14886,7 @@ 88613F701E5C1E86008D2C69 /* IfishFeedCellHeaghtCalculator.m in Sources */, 8816722E1EA5DE2B00BEBF23 /* UMComFeedDetailCommentCell.m in Sources */, CB4820832334E99700A50C92 /* IQPreviousNextView.m in Sources */, + C0F6E1C1243B0A840071ECB9 /* xuanduo3fModel.m in Sources */, 883E78951D48A5E50030E075 /* IfishMessageViewCell.m in Sources */, 887DA78C1D547A49001DB880 /* IfishTanSuoViewCell.m in Sources */, 8816720D1EA5DE2B00BEBF23 /* UMComEmojiPageView.m in Sources */, @@ -14885,6 +14947,7 @@ 881671AA1EA5DE2B00BEBF23 /* UMComDataOperationErrorHandler.m in Sources */, 881671D21EA5DE2B00BEBF23 /* UMComPostReplyEditView.m in Sources */, 88F5EFC71D48D08100CC7CAF /* JHRefreshBaseView.m in Sources */, + C0837A57244FF5510034FEC5 /* EGOCache.m in Sources */, 881671A51EA5DE2B00BEBF23 /* UMComLikeListDataController.m in Sources */, 88597AC21E56BAF1003D0E5C /* WFTailoringViewController.m in Sources */, 882957FD1DC0443600E9DDD7 /* IfishCardScrollView.m in Sources */, @@ -15290,6 +15353,7 @@ 3D3447A0212D113D00CF3941 /* IFishHotBarCell.m in Sources */, 8871FB101EBC80850038E99A /* FishSelectDeviceListViewCell.m in Sources */, 881672421EA5DE2B00BEBF23 /* UMComSimplicityUserCenterViewController.m in Sources */, + C0B2F542244C6FE3001079AA /* PetStoresViewController.m in Sources */, 3D8F649A21571D7C00F04BD3 /* HitbarWifeVc.m in Sources */, 8861258F1E2731CC004A6097 /* JuNengSoketBackUtls.m in Sources */, 88F5EFD11D48D08100CC7CAF /* MMProgressHUD+Animations.m in Sources */, @@ -15622,10 +15686,10 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_ENTITLEMENTS = Ifish/Ifish.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; @@ -15740,11 +15804,11 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "compiler-default"; CODE_SIGN_ENTITLEMENTS = Ifish/Ifish.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 3; - DEVELOPMENT_TEAM = WFX8GD5HFX; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -15829,7 +15893,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.shyuying.Ifish8; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = production2; + PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = 1; USER_HEADER_SEARCH_PATHS = ""; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Ifish/Assets.xcassets/HotBar/加热系统.imageset/加热系统.png b/Ifish/Assets.xcassets/HotBar/加热系统.imageset/加热系统.png index 10cde86..45001e8 100644 Binary files a/Ifish/Assets.xcassets/HotBar/加热系统.imageset/加热系统.png and b/Ifish/Assets.xcassets/HotBar/加热系统.imageset/加热系统.png differ diff --git a/Ifish/Assets.xcassets/HotBar/摄像头.imageset/摄像头.png b/Ifish/Assets.xcassets/HotBar/摄像头.imageset/摄像头.png index 4048bd3..3c3065c 100644 Binary files a/Ifish/Assets.xcassets/HotBar/摄像头.imageset/摄像头.png and b/Ifish/Assets.xcassets/HotBar/摄像头.imageset/摄像头.png differ diff --git a/Ifish/Assets.xcassets/HotBar/敬请期待.imageset/敬请期待.png b/Ifish/Assets.xcassets/HotBar/敬请期待.imageset/敬请期待.png index 361fef9..43d54f8 100644 Binary files a/Ifish/Assets.xcassets/HotBar/敬请期待.imageset/敬请期待.png and b/Ifish/Assets.xcassets/HotBar/敬请期待.imageset/敬请期待.png differ diff --git a/Ifish/Assets.xcassets/HotBar/智能宠物系统.imageset/Contents.json b/Ifish/Assets.xcassets/HotBar/智能宠物系统.imageset/Contents.json new file mode 100644 index 0000000..2b9eb4f --- /dev/null +++ b/Ifish/Assets.xcassets/HotBar/智能宠物系统.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "智能宠物系统.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/HotBar/智能宠物系统.imageset/智能宠物系统.png b/Ifish/Assets.xcassets/HotBar/智能宠物系统.imageset/智能宠物系统.png new file mode 100644 index 0000000..a856466 Binary files /dev/null and b/Ifish/Assets.xcassets/HotBar/智能宠物系统.imageset/智能宠物系统.png differ diff --git a/Ifish/Assets.xcassets/HotBar/水族控制系统.imageset/水族控制系统.png b/Ifish/Assets.xcassets/HotBar/水族控制系统.imageset/水族控制系统.png index 9f2ae2c..bd36c16 100644 Binary files a/Ifish/Assets.xcassets/HotBar/水族控制系统.imageset/水族控制系统.png and b/Ifish/Assets.xcassets/HotBar/水族控制系统.imageset/水族控制系统.png differ diff --git a/Ifish/Assets.xcassets/petimage/Contents.json b/Ifish/Assets.xcassets/petimage/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/firstlogo.dataset/Contents.json b/Ifish/Assets.xcassets/petimage/firstlogo.dataset/Contents.json new file mode 100644 index 0000000..4b71af6 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/firstlogo.dataset/Contents.json @@ -0,0 +1,12 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "data" : [ + { + "idiom" : "universal", + "filename" : "firstlogo" + } + ] +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/firstlogo.dataset/firstlogo b/Ifish/Assets.xcassets/petimage/firstlogo.dataset/firstlogo new file mode 100644 index 0000000..800ad1d Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/firstlogo.dataset/firstlogo differ diff --git a/Ifish/Assets.xcassets/petimage/logo.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/logo.imageset/Contents.json new file mode 100644 index 0000000..8463aca --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/logo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "logo.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/logo.imageset/logo.png b/Ifish/Assets.xcassets/petimage/logo.imageset/logo.png new file mode 100644 index 0000000..bbad3aa Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/logo.imageset/logo.png differ diff --git a/Ifish/Assets.xcassets/petimage/pet.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/pet.imageset/Contents.json new file mode 100644 index 0000000..4bd009a --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/pet.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "pet.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/pet.imageset/pet.png b/Ifish/Assets.xcassets/petimage/pet.imageset/pet.png new file mode 100644 index 0000000..7bfd03f Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/pet.imageset/pet.png differ diff --git a/Ifish/Assets.xcassets/petimage/petsImage.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/petsImage.imageset/Contents.json new file mode 100644 index 0000000..e4bbb16 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/petsImage.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "petsImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/petsImage.imageset/petsImage.png b/Ifish/Assets.xcassets/petimage/petsImage.imageset/petsImage.png new file mode 100644 index 0000000..800ad1d Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/petsImage.imageset/petsImage.png differ diff --git a/Ifish/Assets.xcassets/petimage/xialasanjiao.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/xialasanjiao.imageset/Contents.json new file mode 100644 index 0000000..dd738dc --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/xialasanjiao.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "xialasanjiao.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/xialasanjiao.imageset/xialasanjiao.png b/Ifish/Assets.xcassets/petimage/xialasanjiao.imageset/xialasanjiao.png new file mode 100644 index 0000000..f3fdf36 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/xialasanjiao.imageset/xialasanjiao.png differ diff --git a/Ifish/Assets.xcassets/petimage/恒温关.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/恒温关.imageset/Contents.json new file mode 100644 index 0000000..1b4b31b --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/恒温关.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "恒温关.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/恒温关.imageset/恒温关.png b/Ifish/Assets.xcassets/petimage/恒温关.imageset/恒温关.png new file mode 100644 index 0000000..5eb2319 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/恒温关.imageset/恒温关.png differ diff --git a/Ifish/Assets.xcassets/petimage/恒温开.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/恒温开.imageset/Contents.json new file mode 100644 index 0000000..2af8939 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/恒温开.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "恒温开.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/恒温开.imageset/恒温开.png b/Ifish/Assets.xcassets/petimage/恒温开.imageset/恒温开.png new file mode 100644 index 0000000..34b12dc Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/恒温开.imageset/恒温开.png differ diff --git a/Ifish/Assets.xcassets/petimage/换气关.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/换气关.imageset/Contents.json new file mode 100644 index 0000000..ad5dfb5 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/换气关.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "换气关.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/换气关.imageset/换气关.png b/Ifish/Assets.xcassets/petimage/换气关.imageset/换气关.png new file mode 100644 index 0000000..0d4b688 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/换气关.imageset/换气关.png differ diff --git a/Ifish/Assets.xcassets/petimage/换气开.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/换气开.imageset/Contents.json new file mode 100644 index 0000000..d3c9deb --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/换气开.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "换气开.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/换气开.imageset/换气开.png b/Ifish/Assets.xcassets/petimage/换气开.imageset/换气开.png new file mode 100644 index 0000000..53b75e0 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/换气开.imageset/换气开.png differ diff --git a/Ifish/Assets.xcassets/petimage/杀菌关.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/杀菌关.imageset/Contents.json new file mode 100644 index 0000000..d1b59ef --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/杀菌关.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "杀菌关.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/杀菌关.imageset/杀菌关.png b/Ifish/Assets.xcassets/petimage/杀菌关.imageset/杀菌关.png new file mode 100644 index 0000000..3295d06 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/杀菌关.imageset/杀菌关.png differ diff --git a/Ifish/Assets.xcassets/petimage/杀菌开.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/杀菌开.imageset/Contents.json new file mode 100644 index 0000000..e7b1847 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/杀菌开.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "杀菌开.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/杀菌开.imageset/杀菌开.png b/Ifish/Assets.xcassets/petimage/杀菌开.imageset/杀菌开.png new file mode 100644 index 0000000..3584aa4 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/杀菌开.imageset/杀菌开.png differ diff --git a/Ifish/Assets.xcassets/petimage/照明关.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/照明关.imageset/Contents.json new file mode 100644 index 0000000..c386348 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/照明关.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "照明关.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/照明关.imageset/照明关.png b/Ifish/Assets.xcassets/petimage/照明关.imageset/照明关.png new file mode 100644 index 0000000..fb60075 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/照明关.imageset/照明关.png differ diff --git a/Ifish/Assets.xcassets/petimage/照明开.imageset/Contents.json b/Ifish/Assets.xcassets/petimage/照明开.imageset/Contents.json new file mode 100644 index 0000000..6dbea22 --- /dev/null +++ b/Ifish/Assets.xcassets/petimage/照明开.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "照明开.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/petimage/照明开.imageset/照明开.png b/Ifish/Assets.xcassets/petimage/照明开.imageset/照明开.png new file mode 100644 index 0000000..408bc47 Binary files /dev/null and b/Ifish/Assets.xcassets/petimage/照明开.imageset/照明开.png differ diff --git a/Ifish/Assets.xcassets/绚多设备/pets.imageset/Contents.json b/Ifish/Assets.xcassets/绚多设备/pets.imageset/Contents.json new file mode 100644 index 0000000..0a0eec3 --- /dev/null +++ b/Ifish/Assets.xcassets/绚多设备/pets.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "pets.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Ifish/Assets.xcassets/绚多设备/pets.imageset/pets.png b/Ifish/Assets.xcassets/绚多设备/pets.imageset/pets.png new file mode 100644 index 0000000..780d660 Binary files /dev/null and b/Ifish/Assets.xcassets/绚多设备/pets.imageset/pets.png differ diff --git a/Ifish/Info.plist b/Ifish/Info.plist index f9fa328..c619fd3 100644 --- a/Ifish/Info.plist +++ b/Ifish/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.1.4 + 5.1.5 CFBundleSignature ???? CFBundleURLTypes @@ -70,7 +70,7 @@ CFBundleVersion - 19 + 3 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/Ifish/Utinitys/DataCenter/DataCenter.h b/Ifish/Utinitys/DataCenter/DataCenter.h index 0f7c117..40cd180 100644 --- a/Ifish/Utinitys/DataCenter/DataCenter.h +++ b/Ifish/Utinitys/DataCenter/DataCenter.h @@ -7,7 +7,7 @@ // #import - +#import "EGOCache.h" @interface DataCenter : NSObject @@ -16,6 +16,8 @@ -(void)setValue:(id)value forKey:(NSString*)key; // 获取数据 -(id)valueForKey:(NSString*)key; +@property (nonatomic, strong) EGOCache *cache; +-(void)cacheinit:(NSString*)useid; @end diff --git a/Ifish/Utinitys/DataCenter/DataCenter.m b/Ifish/Utinitys/DataCenter/DataCenter.m index 6cedba3..8201c3c 100644 --- a/Ifish/Utinitys/DataCenter/DataCenter.m +++ b/Ifish/Utinitys/DataCenter/DataCenter.m @@ -44,9 +44,16 @@ _dict=[[NSMutableDictionary alloc]init]; } + } return self; } +-(void)cacheinit:(NSString*)useid +{ +NSArray*arr=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + self.cache = [[EGOCache alloc] initWithCacheDirectory:[arr.firstObject stringByAppendingPathComponent:[NSString stringWithFormat:@"ifish/%@",[CommonUtils getNotNilStr:useid]]]]; +[self.cache setDefaultTimeoutInterval:864000000]; +} //根据文件名 获取指定文件名的在沙盒Documents的 全路径 -(NSString*)getFullFilePathWithName:(NSString *)name{ //方法1 diff --git a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h index c95da98..f6e2ca4 100644 --- a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h +++ b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.h @@ -57,5 +57,6 @@ //新绚多 +(void)saveNewXuToControlName:(XuToControlName *)nameModel; +(XuToControlName *)currentNewXuToControlName:(NSString *)macaddress; ++(XuToControlName *)currentPetsXuToControlName:(NSString *)macaddress; @end diff --git a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m index 5812577..8fac588 100644 --- a/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m +++ b/Ifish/Utinitys/DataCenter/UserExtendataArchaver.m @@ -241,6 +241,26 @@ return controlName; } ++(XuToControlName *)currentPetsXuToControlName:(NSString *)macaddress +{ + NSString *key = [NSString stringWithFormat:@"newXuTo%@",macaddress]; + NSString *file = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:key]; + XuToControlName *controlName = [NSKeyedUnarchiver unarchiveObjectWithFile:file]; + if (!controlName||[controlName isKindOfClass:[NSNull class]]) { + controlName = [[XuToControlName alloc] init]; + controlName.shajunLight = @"杀菌灯"; + controlName.zengyangPump = @"换气"; + controlName.light1 = @"杀菌"; + controlName.light2 = @"恒温"; + controlName.zaolangPump = @"造浪泵"; + controlName.huLiDeng = @"护理灯"; + controlName.xunhuanPump = @"照明"; + controlName.jiaRe = @"加热棒"; + controlName.macAddress = macaddress; + } + return controlName; + +} diff --git a/Ifish/Utinitys/EGOCache/EGOCache.h b/Ifish/Utinitys/EGOCache/EGOCache.h new file mode 100755 index 0000000..ab84607 --- /dev/null +++ b/Ifish/Utinitys/EGOCache/EGOCache.h @@ -0,0 +1,96 @@ +// +// EGOCache.h +// enormego +// +// Created by Shaun Harrison. +// Copyright (c) 2009-2017 enormego. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#import + +#if TARGET_OS_IPHONE + #import +#endif + +#if TARGET_OS_OSX + #import +#endif + +//! Project version number for EGOCache. +FOUNDATION_EXPORT double EGOCacheVersionNumber; + +//! Project version string for EGOCache. +FOUNDATION_EXPORT const unsigned char EGOCacheVersionString[]; + +#if !__has_feature(nullability) +# define nullable +# define nonnull +# define __nullable +# define __nonnull +#endif + +@interface EGOCache : NSObject + +// Global cache for easy use ++ (nonnull instancetype)globalCache; + +// Opitionally create a different EGOCache instance with it's own cache directory +- (nonnull instancetype)initWithCacheDirectory:(NSString* __nonnull)cacheDirectory; + +- (void)clearCache; +- (void)removeCacheForKey:(NSString* __nonnull)key; + +- (BOOL)hasCacheForKey:(NSString* __nonnull)key; + +- (NSData* __nullable)dataForKey:(NSString* __nonnull)key; +- (void)setData:(NSData* __nonnull)data forKey:(NSString* __nonnull)key; +- (void)setData:(NSData* __nonnull)data forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; + +- (NSString* __nullable)stringForKey:(NSString* __nonnull)key; +- (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key; +- (void)setString:(NSString* __nonnull)aString forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; + +- (NSDate* __nullable)dateForKey:(NSString* __nonnull)key; +- (NSArray* __nonnull)allKeys; + +#if TARGET_OS_IPHONE +- (UIImage* __nullable)imageForKey:(NSString* __nonnull)key; +- (void)setImage:(UIImage* __nonnull)anImage forKey:(NSString* __nonnull)key; +- (void)setImage:(UIImage* __nonnull)anImage forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; +#else +- (NSImage* __nullable)imageForKey:(NSString* __nonnull)key; +- (void)setImage:(NSImage* __nonnull)anImage forKey:(NSString* __nonnull)key; +- (void)setImage:(NSImage* __nonnull)anImage forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; +#endif + +- (NSData* __nullable)plistForKey:(NSString* __nonnull)key; +- (void)setPlist:(nonnull id)plistObject forKey:(NSString* __nonnull)key; +- (void)setPlist:(nonnull id)plistObject forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; + +- (void)copyFilePath:(NSString* __nonnull)filePath asKey:(NSString* __nonnull)key; +- (void)copyFilePath:(NSString* __nonnull)filePath asKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; + +- (nullable id)objectForKey:(NSString* __nonnull)key; +- (void)setObject:(nonnull id)anObject forKey:(NSString* __nonnull)key; +- (void)setObject:(nonnull id)anObject forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; + +@property(nonatomic) NSTimeInterval defaultTimeoutInterval; // Default is 1 day +@end diff --git a/Ifish/Utinitys/EGOCache/EGOCache.m b/Ifish/Utinitys/EGOCache/EGOCache.m new file mode 100755 index 0000000..de8abda --- /dev/null +++ b/Ifish/Utinitys/EGOCache/EGOCache.m @@ -0,0 +1,368 @@ +// +// EGOCache.m +// enormego +// +// Created by Shaun Harrison. +// Copyright (c) 2009-2017 enormego. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#import "EGOCache.h" + +#if DEBUG +# define CHECK_FOR_EGOCACHE_PLIST() if([key isEqualToString:@"EGOCache.plist"]) { \ + NSLog(@"EGOCache.plist is a reserved key and can not be modified."); \ + return; } +#else +# define CHECK_FOR_EGOCACHE_PLIST() if([key isEqualToString:@"EGOCache.plist"]) return; +#endif + +static inline NSString* cachePathForKey(NSString* directory, NSString* key) { + key = [key stringByReplacingOccurrencesOfString:@"/" withString:@"_"]; + return [directory stringByAppendingPathComponent:key]; +} + +#pragma mark - + +@interface EGOCache () { + dispatch_queue_t _cacheInfoQueue; + dispatch_queue_t _frozenCacheInfoQueue; + dispatch_queue_t _diskQueue; + NSMutableDictionary* _cacheInfo; + NSString* _directory; + BOOL _needsSave; +} + +@property(nonatomic,copy) NSDictionary* frozenCacheInfo; +@end + +@implementation EGOCache + ++ (instancetype)globalCache { + static id instance; + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + instance = [[[self class] alloc] init]; + }); + + return instance; +} + +- (instancetype)init { + NSString* cachesDirectory = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0]; + NSString* oldCachesDirectory = [[[cachesDirectory stringByAppendingPathComponent:[[NSProcessInfo processInfo] processName]] stringByAppendingPathComponent:@"EGOCache"] copy]; + + if([[NSFileManager defaultManager] fileExistsAtPath:oldCachesDirectory]) { + [[NSFileManager defaultManager] removeItemAtPath:oldCachesDirectory error:NULL]; + } + + cachesDirectory = [[[cachesDirectory stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]] stringByAppendingPathComponent:@"EGOCache"] copy]; + return [self initWithCacheDirectory:cachesDirectory]; +} + +- (instancetype)initWithCacheDirectory:(NSString*)cacheDirectory { + if((self = [super init])) { + _cacheInfoQueue = dispatch_queue_create("com.enormego.egocache.info", DISPATCH_QUEUE_SERIAL); + dispatch_queue_t priority = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); + dispatch_set_target_queue(priority, _cacheInfoQueue); + + _frozenCacheInfoQueue = dispatch_queue_create("com.enormego.egocache.info.frozen", DISPATCH_QUEUE_SERIAL); + priority = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); + dispatch_set_target_queue(priority, _frozenCacheInfoQueue); + + _diskQueue = dispatch_queue_create("com.enormego.egocache.disk", DISPATCH_QUEUE_CONCURRENT); + priority = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); + dispatch_set_target_queue(priority, _diskQueue); + + + _directory = cacheDirectory; + + _cacheInfo = [[NSDictionary dictionaryWithContentsOfFile:cachePathForKey(_directory, @"EGOCache.plist")] mutableCopy]; + + if(!_cacheInfo) { + _cacheInfo = [[NSMutableDictionary alloc] init]; + } + + [[NSFileManager defaultManager] createDirectoryAtPath:_directory withIntermediateDirectories:YES attributes:nil error:NULL]; + + NSTimeInterval now = [[NSDate date] timeIntervalSinceReferenceDate]; + NSMutableArray* removedKeys = [[NSMutableArray alloc] init]; + + for(NSString* key in _cacheInfo) { + if([_cacheInfo[key] timeIntervalSinceReferenceDate] <= now) { + [[NSFileManager defaultManager] removeItemAtPath:cachePathForKey(_directory, key) error:NULL]; + [removedKeys addObject:key]; + } + } + + [_cacheInfo removeObjectsForKeys:removedKeys]; + self.frozenCacheInfo = _cacheInfo; + [self setDefaultTimeoutInterval:86400]; + } + + return self; +} + +- (void)clearCache { + dispatch_sync(_cacheInfoQueue, ^{ + for(NSString* key in _cacheInfo) { + [[NSFileManager defaultManager] removeItemAtPath:cachePathForKey(_directory, key) error:NULL]; + } + + [_cacheInfo removeAllObjects]; + + dispatch_sync(_frozenCacheInfoQueue, ^{ + self.frozenCacheInfo = [_cacheInfo copy]; + }); + + [self setNeedsSave]; + }); +} + +- (void)removeCacheForKey:(NSString*)key { + CHECK_FOR_EGOCACHE_PLIST(); + + dispatch_async(_diskQueue, ^{ + [[NSFileManager defaultManager] removeItemAtPath:cachePathForKey(_directory, key) error:NULL]; + }); + + [self setCacheTimeoutInterval:0 forKey:key]; +} + +- (BOOL)hasCacheForKey:(NSString*)key { + NSDate* date = [self dateForKey:key]; + if(date == nil) return NO; + if([date timeIntervalSinceReferenceDate] < CFAbsoluteTimeGetCurrent()) return NO; + + return [[NSFileManager defaultManager] fileExistsAtPath:cachePathForKey(_directory, key)]; +} + +- (NSDate*)dateForKey:(NSString*)key { + __block NSDate* date = nil; + + dispatch_sync(_frozenCacheInfoQueue, ^{ + date = (self.frozenCacheInfo)[key]; + }); + + return date; +} + +- (NSArray*)allKeys { + __block NSArray* keys = nil; + + dispatch_sync(_frozenCacheInfoQueue, ^{ + keys = [self.frozenCacheInfo allKeys]; + }); + + return keys; +} + +- (void)setCacheTimeoutInterval:(NSTimeInterval)timeoutInterval forKey:(NSString*)key { + NSDate* date = timeoutInterval > 0 ? [NSDate dateWithTimeIntervalSinceNow:timeoutInterval] : nil; + + // Temporarily store in the frozen state for quick reads + dispatch_sync(_frozenCacheInfoQueue, ^{ + NSMutableDictionary* info = [self.frozenCacheInfo mutableCopy]; + + if(date) { + info[key] = date; + } else { + [info removeObjectForKey:key]; + } + + self.frozenCacheInfo = info; + }); + + // Save the final copy (this may be blocked by other operations) + dispatch_async(_cacheInfoQueue, ^{ + if(date) { + _cacheInfo[key] = date; + } else { + [_cacheInfo removeObjectForKey:key]; + } + + dispatch_sync(_frozenCacheInfoQueue, ^{ + self.frozenCacheInfo = [_cacheInfo copy]; + }); + + [self setNeedsSave]; + }); +} + +#pragma mark - +#pragma mark Copy file methods + +- (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key { + [self copyFilePath:filePath asKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { + dispatch_async(_diskQueue, ^{ + [[NSFileManager defaultManager] copyItemAtPath:filePath toPath:cachePathForKey(_directory, key) error:NULL]; + }); + + [self setCacheTimeoutInterval:timeoutInterval forKey:key]; +} + +#pragma mark - +#pragma mark Data methods + +- (void)setData:(NSData*)data forKey:(NSString*)key { + [self setData:data forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)setData:(NSData*)data forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { + CHECK_FOR_EGOCACHE_PLIST(); + + NSString* cachePath = cachePathForKey(_directory, key); + + dispatch_async(_diskQueue, ^{ + [data writeToFile:cachePath atomically:YES]; + }); + + [self setCacheTimeoutInterval:timeoutInterval forKey:key]; +} + +- (void)setNeedsSave { + dispatch_async(_cacheInfoQueue, ^{ + if(_needsSave) return; + _needsSave = YES; + + double delayInSeconds = 0.5; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); + dispatch_after(popTime, _cacheInfoQueue, ^(void){ + if(!_needsSave) return; + [_cacheInfo writeToFile:cachePathForKey(_directory, @"EGOCache.plist") atomically:YES]; + _needsSave = NO; + }); + }); +} + +- (NSData*)dataForKey:(NSString*)key { + if([self hasCacheForKey:key]) { + return [NSData dataWithContentsOfFile:cachePathForKey(_directory, key) options:0 error:NULL]; + } else { + return nil; + } +} + +#pragma mark - +#pragma mark String methods + +- (NSString*)stringForKey:(NSString*)key { + return [[NSString alloc] initWithData:[self dataForKey:key] encoding:NSUTF8StringEncoding]; +} + +- (void)setString:(NSString*)aString forKey:(NSString*)key { + [self setString:aString forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { + [self setData:[aString dataUsingEncoding:NSUTF8StringEncoding] forKey:key withTimeoutInterval:timeoutInterval]; +} + +#pragma mark - +#pragma mark Image methds + +#if TARGET_OS_IPHONE + +- (UIImage*)imageForKey:(NSString*)key { + UIImage* image = nil; + + @try { + image = [NSKeyedUnarchiver unarchiveObjectWithFile:cachePathForKey(_directory, key)]; + } @catch (NSException* e) { + // Surpress any unarchiving exceptions and continue with nil + } + + return image; +} + +- (void)setImage:(UIImage*)anImage forKey:(NSString*)key { + [self setImage:anImage forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)setImage:(UIImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { + @try { + // Using NSKeyedArchiver preserves all information such as scale, orientation, and the proper image format instead of saving everything as pngs + [self setData:[NSKeyedArchiver archivedDataWithRootObject:anImage] forKey:key withTimeoutInterval:timeoutInterval]; + } @catch (NSException* e) { + // Something went wrong, but we'll fail silently. + } +} + +#else + +- (NSImage*)imageForKey:(NSString*)key { + return [[NSImage alloc] initWithData:[self dataForKey:key]]; +} + +- (void)setImage:(NSImage*)anImage forKey:(NSString*)key { + [self setImage:anImage forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)setImage:(NSImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { + [self setData:[[NSBitmapImageRep imageRepWithData:anImage.TIFFRepresentation] representationUsingType:NSPNGFileType properties:@{ }] forKey:key withTimeoutInterval:timeoutInterval]; +} + +#endif + +#pragma mark - +#pragma mark Property List methods + +- (NSData*)plistForKey:(NSString*)key; { + NSData* plistData = [self dataForKey:key]; + return [NSPropertyListSerialization propertyListWithData:plistData options:NSPropertyListImmutable format:nil error:nil]; +} + +- (void)setPlist:(id)plistObject forKey:(NSString*)key; { + [self setPlist:plistObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; { + // Binary plists are used over XML for better performance + NSData* plistData = [NSPropertyListSerialization dataWithPropertyList:plistObject format:NSPropertyListBinaryFormat_v1_0 options:0 error:nil]; + + if(plistData != nil) { + [self setData:plistData forKey:key withTimeoutInterval:timeoutInterval]; + } +} + +#pragma mark - +#pragma mark Object methods + +- (id)objectForKey:(NSString*)key { + if([self hasCacheForKey:key]) { + return [NSKeyedUnarchiver unarchiveObjectWithData:[self dataForKey:key]]; + } else { + return nil; + } +} + +- (void)setObject:(id)anObject forKey:(NSString*)key { + [self setObject:anObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; +} + +- (void)setObject:(id)anObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { + [self setData:[NSKeyedArchiver archivedDataWithRootObject:anObject] forKey:key withTimeoutInterval:timeoutInterval]; +} + +@end diff --git a/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m b/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m index ddf9693..cb77c04 100644 --- a/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m +++ b/Ifish/Utinitys/IfishHttpRequest/AFNOHeaderHttpTool.m @@ -313,10 +313,24 @@ methodType url : (NSString *)url failure:(void (^)(NSError* err))failure { + NSString*macid=[[deviceId componentsSeparatedByString:@"_"] firstObject]; + + NSString*deviceType=[[deviceId componentsSeparatedByString:@"_"] lastObject]; + + NSString*type=@"0";//0换水 1杀菌 + + if ([deviceType isEqualToString:@"3f"]) + { + type=@"1"; + } + + + NSDictionary*para=@{ - @"deviceId":deviceId, + @"deviceId":macid, @"waterRemind":waterRemind, - @"remindCycle":remindCycle + @"remindCycle":remindCycle, + @"type":type }; [AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:kSetRemindWaterInf params:para success:success failure:failure]; diff --git a/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m b/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m index c76fa48..406f019 100644 --- a/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m +++ b/Ifish/Utinitys/IfishHttpRequest/IfishDataUnity.m @@ -173,6 +173,13 @@ UINavigationController *xuanduo2fNav=[[UINavigationController alloc]initWithRootViewController:xuanduo2fVc]; [UIApplication sharedApplication].delegate.window.rootViewController = xuanduo2fNav; } + else if([devicemodel.type isEqualToString:DECICE_TYPE_XUANDUO3F]){ + //绚多新设备 + Xuanduo2fController *xuanduo2fVc = [Xuanduo2fController new]; + xuanduo2fVc.currentDevice = devicemodel; + UINavigationController *xuanduo2fNav=[[UINavigationController alloc]initWithRootViewController:xuanduo2fVc]; + [UIApplication sharedApplication].delegate.window.rootViewController = xuanduo2fNav; + } else{ int controlAmount=[devicemodel.controlAmount intValue]; diff --git a/Ifish/Utinitys/IfishHttpRequest/IfishUserDataUnity.m b/Ifish/Utinitys/IfishHttpRequest/IfishUserDataUnity.m index 0df87d6..c01477c 100644 --- a/Ifish/Utinitys/IfishHttpRequest/IfishUserDataUnity.m +++ b/Ifish/Utinitys/IfishHttpRequest/IfishUserDataUnity.m @@ -32,7 +32,9 @@ NSDictionary *userDic=dataDic[@"userInfo"]; UserModel *model=[[UserModel alloc] initWithDict:userDic]; + [[DataCenter defaultDtacenter]setValue:model forKey:@"UserLogIn"]; + [[DataCenter defaultDtacenter] cacheinit:[model.userId stringValue]]; //金币任务等级 NSDictionary *userAssetDic=dataDic[@"userAsset"]; @@ -88,6 +90,7 @@ NSDictionary *userDic=dataDic[@"userInfo"]; UserModel *model=[[UserModel alloc] initWithDict:userDic]; [[DataCenter defaultDtacenter]setValue:model forKey:@"UserLogIn"]; + [[DataCenter defaultDtacenter] cacheinit:[model.userId stringValue]]; NSUserDefaults*userdefult=[NSUserDefaults standardUserDefaults]; if (model.unionId.length) { [userdefult setObject:model.unionId forKey:@"unionId"]; diff --git a/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h b/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h index 39ac9f9..af59318 100644 --- a/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h +++ b/Ifish/Utinitys/IfishUtils/IfishDeviceInfo.h @@ -31,6 +31,7 @@ #define DECICE_TYPE_XUANDUOOF @"0f" //0x0f//无屏幕 #define DECICE_TYPE_XUANDUO1F @"1f" //0x1f//有屏幕 #define DECICE_TYPE_XUANDUO2F @"2f" //新设备 +#define DECICE_TYPE_XUANDUO3F @"3f" //宠物笼 //可丽爱 #define DECICE_TYPE_KELIAI @"aa" //0xaa diff --git a/Ifish/Utinitys/ifishDeviceCommunicationDataUnity/DeviceCommunicateDataUnity.m b/Ifish/Utinitys/ifishDeviceCommunicationDataUnity/DeviceCommunicateDataUnity.m index 2797f87..4bba45a 100644 --- a/Ifish/Utinitys/ifishDeviceCommunicationDataUnity/DeviceCommunicateDataUnity.m +++ b/Ifish/Utinitys/ifishDeviceCommunicationDataUnity/DeviceCommunicateDataUnity.m @@ -157,7 +157,10 @@ NSString*startTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(4, 4)]; NSString*endTimeHex1=[backModel.timer1 substringWithRange:NSMakeRange(8, 4)]; - + if (!backModel.timer1) + { + return nil; + } // 十进制 NSString*startTimeTen1=[dataContorl hexStringToDateString:startTimeHex1]; NSString*endTimeTen1=[dataContorl hexStringToDateString:endTimeHex1]; diff --git a/Ifish/controllers/ConnectAauariumVC/ConAquarChooseWiFiVC.m b/Ifish/controllers/ConnectAauariumVC/ConAquarChooseWiFiVC.m index 63d2273..843141f 100644 --- a/Ifish/controllers/ConnectAauariumVC/ConAquarChooseWiFiVC.m +++ b/Ifish/controllers/ConnectAauariumVC/ConAquarChooseWiFiVC.m @@ -124,7 +124,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi [self.view makeToast:@"请先连接设备热点"]; return; } - if ([wifiName rangeOfString:@"ifish"].location!=NSNotFound||[wifiName rangeOfString:@"GW"].location!=NSNotFound) { + if ([wifiName rangeOfString:@"ifish"].location!=NSNotFound||[wifiName rangeOfString:@"GW"].location!=NSNotFound||[wifiName isEqualToString:@"WLAN"]) { //wifi正确,则尝试连接设备 if(self.deviceType==DEVICECAMERA) { @@ -141,6 +141,7 @@ Assign BOOL isGoChangeWiFi;//更换为设备的WiFi connecting.bssid = self.bssid; connecting.wifiName = self.wifiName; connecting.wifiPassword = self.wifiPwd; + connecting.deviceType=self.deviceType; [self.navigationController pushViewController:connecting animated:YES]; } diff --git a/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m b/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m index 9efb5b2..4205792 100644 --- a/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m +++ b/Ifish/controllers/ConnectAauariumVC/ConAquarMethodVC.m @@ -79,7 +79,7 @@ Strong UILabel *subTitleLabel; -(void)buttonClick:(UIButton *)sender{ self.hidesBottomBarWhenPushed = YES; if (sender.tag==0) { - + //智能连接 if (self.deviceType==DEVICECAMERA) { YooseeNextConnectViewController *nextvc=[[YooseeNextConnectViewController alloc] init]; @@ -95,7 +95,7 @@ Strong UILabel *subTitleLabel; [self.navigationController pushViewController:wifivc animated:YES]; } - + //热点链接 }else{ ConAquarNowWiFiPwdVC *vc = InitObject(ConAquarNowWiFiPwdVC); vc.deviceType=self.deviceType; diff --git a/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.h b/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.h index b120bcd..fd81b16 100644 --- a/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.h +++ b/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.h @@ -7,6 +7,8 @@ // #import "BaseViewController.h" +#import "StoreNameView.h" +#import "DXPopover.h" NS_ASSUME_NONNULL_BEGIN @@ -20,6 +22,9 @@ Copy NSString *ssid; Copy NSString *bssid; //界面复用 设备类型 @property (assign, nonatomic) SmartDeviceType deviceType; +@property (nonatomic, strong) UIView *mask; +@property (nonatomic, strong) StoreNameView *storeNameView; +@property (nonatomic, strong) NSString *storeName; @end NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m b/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m index 8cf5416..5269e83 100644 --- a/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m +++ b/Ifish/controllers/ConnectAauariumVC/ConnectingAquarVC.m @@ -14,6 +14,7 @@ #import "ESPTouchResult.h" #import "ESPTouchTask.h" #import "IfishDataUnity.h" +#import "MyMD5.h" #import @interface ConnectingAquarVC () Strong HKPieChartView *progressView; @@ -67,6 +68,7 @@ Copy NSString *deviceId; // // Do any additional setup after loading the view. self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(timerAction) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes]; + [self showStoreNameView]; } //AP模式配网 @@ -263,7 +265,7 @@ Copy NSString *deviceId; BOOL networkOk = NO; AFNetworkReachabilityStatus status = [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus; - if (status == AFNetworkReachabilityStatusReachableViaWiFi) { + if (status == AFNetworkReachabilityStatusReachableViaWiFi||status == AFNetworkReachabilityStatusUnknown) { if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) { networkOk = YES; } @@ -285,9 +287,20 @@ Copy NSString *deviceId; self.bindTimer = nil; } self.retryTimes = 0; - [self bindDeviceWithSsid:self.macAddress]; + if (self.deviceType==DEVICEPETS) + { + [self showStoreNameView]; + } + else + { + [self bindDeviceWithSsid:self.macAddress]; + } } + + + + - (void)udpHelperMessage:(NSString *)msg { self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; self.HUD.mode = MBProgressHUDModeIndeterminate; @@ -298,6 +311,55 @@ Copy NSString *deviceId; [self.timer invalidate]; self.timer = nil; } +-(UIView *)mask +{ + if (!_mask) + { + UIView*mask=[[UIView alloc]initWithFrame:self.view.bounds]; + mask.backgroundColor=[UIColor lightGrayColor]; + mask.alpha=0.5; + _mask=mask; + UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissStore)]; + [mask addGestureRecognizer:tap]; + } + + return _mask; +} +-(void)dismissStore +{ + [self.storeNameView removeFromSuperview]; + [self.mask removeFromSuperview]; + [self.progressView endProgressWithString:@"绑定已经取消..."]; +} +-(void)showStoreNameView +{ + [self.HUD hide:YES]; + [self.storeNameView removeFromSuperview]; + StoreNameView*store=[[[NSBundle mainBundle] loadNibNamed:@"StoreNameView" owner:self options:nil] lastObject]; + store.frame=CGRectMake((SCREEN_WIDTH-280)/2.0, 100, 280, 280); + + self.storeNameView=store; + WEAK_SELF; + store.cancelBlock=^(){ + [weakSelf.mask removeFromSuperview]; + [weakSelf.storeNameView removeFromSuperview]; + [weakSelf.HUD show:YES]; + [weakSelf.progressView endProgressWithString:@"绑定已经取消..."]; + + }; + store.sureBlock=^(NSString*name) + { + [weakSelf.mask removeFromSuperview]; + [weakSelf.storeNameView removeFromSuperview]; + weakSelf.storeName=name; + [self bindDeviceWithSsid:self.macAddress]; + [weakSelf.HUD show:YES]; + }; + + [self.view addSubview:self.mask]; + [self.view addSubview:self.storeNameView]; + +} #pragma mark - bind -(void)bindDeviceWithSsid:(NSString*)bssid{ NSLog(@"设备bssid_%@",bssid); @@ -306,7 +368,21 @@ Copy NSString *deviceId; self.HUD.labelText = @"正在绑定设备"; [self appendTrakContent:[NSString stringWithFormat:@"绑定参数 userID:%@", userId]]; [self appendTrakContent:[NSString stringWithFormat:@"绑定参数 macaddress:%@", bssid]]; - [AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) { + NSString*url=[NSString stringWithFormat:@"%@%@",kBindDevice,userId]; + NSMutableDictionary*bind=[[NSMutableDictionary alloc]initWithDictionary:@{@"macAddress":bssid}]; + NSString* timestamp=[NSString stringWithFormat:@"%lld",[[NSDate date] timeIntervalSince1970]*1000]; + NSString*token=[MyMD5 md5:[NSString stringWithFormat:@"%@%@ifish8",userId,timestamp]]; + + if (self.deviceType==DEVICEPETS) + { + url=[NSString stringWithFormat:@"%@",[NSString stringWithFormat:@"%@/api/user/bindPetDevice.do",JIEKOUPORT]]; + bind[@"token"]=token; + bind[@"timestamp"]=timestamp; + bind[@"storeName"]=self.storeName.length?self.storeName:@"宠物店"; + bind[@"userId"]=userId; + + } + [AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:bind success:^(id response) { [self endProgress]; self.isBindingDevice = NO; self.macAddress = nil; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.h index db35517..a2fdeab 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.h @@ -10,5 +10,6 @@ @interface RuSunChangeNameTitleViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UITextField *deviceName; +@property (weak, nonatomic) IBOutlet UILabel *cNTitle; @end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.xib b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.xib index 7df682a..6e001ae 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.xib +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/RuSunTemp/RuSunIndependence/RuSunChangeNameTitleViewCell.xib @@ -1,12 +1,11 @@ - + - - + @@ -27,7 +26,7 @@ - + @@ -57,6 +56,7 @@ + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m index ff78375..fe6c40c 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/ThreeControl/ThreeControlCenterViewController.m @@ -559,8 +559,12 @@ typedef NS_ENUM(NSInteger,ThreeControBackMsgTape){ [DeviceCommunicateDataUnity resetThreeControlButtonState:_light1Button addlight2:_light2Button addpump:_pumpButton withBackModel:_backmodel]; // 实时刷新设置界面 时间设置 - _SetTimeVC.timeArr=[DeviceCommunicateDataUnity refreshThreeControlTimerAddTemperatureWithBackMassageModel:_backmodel]; - [_SetTimeVC.tableView reloadData]; + if (_SetTimeVC) + { + _SetTimeVC.timeArr=[DeviceCommunicateDataUnity refreshThreeControlTimerAddTemperatureWithBackMassageModel:_backmodel]; + [_SetTimeVC.tableView reloadData]; + } + } diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.h index eb446c6..cf265eb 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.h @@ -8,7 +8,7 @@ #import -@interface XuToControlName : NSObject +@interface XuToControlName : NSObject @property(nonatomic,copy) NSString *airPump; @property(nonatomic,copy) NSString *light1; @property(nonatomic,copy) NSString *light2; @@ -21,6 +21,8 @@ @property(nonatomic,copy) NSString *zengyangPump; @property(nonatomic,copy) NSString *zaolangPump; @property(nonatomic,copy) NSString *xunhuanPump; +@property(nonatomic,copy) NSString *type; + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.m index 3aeb302..5f4e88f 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlName.m @@ -24,6 +24,7 @@ [aCoder encodeObject:_zengyangPump forKey:@"zengyangPump"]; [aCoder encodeObject:_zaolangPump forKey:@"zaolangPump"]; [aCoder encodeObject:_xunhuanPump forKey:@"xunhuanPump"]; + [aCoder encodeObject:_type forKey:@"type"]; } @@ -43,6 +44,7 @@ self.zengyangPump = [aDecoder decodeObjectForKey:@"zengyangPump"]; self.zaolangPump = [aDecoder decodeObjectForKey:@"zaolangPump"]; self.xunhuanPump = [aDecoder decodeObjectForKey:@"xunhuanPump"]; + self.type = [aDecoder decodeObjectForKey:@"type"]; } return self; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.h index 775f042..52cf002 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.h @@ -7,9 +7,12 @@ // #import "IfishDeviceControlNameBaseController.h" +#import "IfishDeviceInfo.h" +#import "DeviceModel.h" @interface XuToControlNameViewController : IfishDeviceControlNameBaseController @property (nonatomic,assign) BOOL isNewdevice; + @end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.m index 8e249d6..9e40294 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToControlNameViewController.m @@ -10,6 +10,7 @@ #import "XuToControlName.h" #import "UserExtendataArchaver.h" #import "RuSunChangeNameTextViewCell.h" +#import "RuSunChangeNameTitleViewCell.h" #define XUTOCHCELL_AIR 50000 #define XUTOCHCELL_LIANGHT1 50001 #define XUTOCHCELL_LIANGHT2 50002 @@ -36,14 +37,28 @@ -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + NSInteger count=0; if (section==0) { - return 1; + count=1; }else{ - return _isNewdevice?8:6; + if (self.isNewdevice) + { + count=8; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + count=4; + } + } + else + { + count=6; + } + } + + return count; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ @@ -55,7 +70,11 @@ if (indexPath.section==0) { - return [super baseViewLoadDeviceNameCell:indexPath intable:tableView]; + RuSunChangeNameTitleViewCell*cell= (RuSunChangeNameTitleViewCell*)[super baseViewLoadDeviceNameCell:indexPath intable:tableView]; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + cell.cNTitle.text=@"宠物笼"; + } + return cell; } RuSunChangeNameTextViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"RuSunChangeNameTextViewCell"]; @@ -72,6 +91,9 @@ NSArray *titles; if (_isNewdevice) { titles = @[@"杀菌灯",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"护理灯",@"循环泵",@"加热棒"]; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + titles = @[@"照明",@"换气",@"杀菌",@"恒温"]; + } }else { titles = @[@"气泵",@"灯1",@"灯2",@"护理灯",@"水泵",@"加热棒"]; } @@ -83,6 +105,9 @@ XuToControlName *name; if (_isNewdevice) { name = [UserExtendataArchaver currentNewXuToControlName:self.device.macAddress]; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + name = [UserExtendataArchaver currentPetsXuToControlName:self.device.macAddress]; + } }else { name = [UserExtendataArchaver currentXuToControlName:self.device.macAddress]; } @@ -92,6 +117,9 @@ if ((cell.chName.text.length>0) & ![cell.chName.text isEqualToString:@"控制名"] & ![cell.chName.text isEqualToString:name.shajunLight]) { }else { cell.chName.text = name.shajunLight; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + cell.chName.text = name.xunhuanPump; + } } }else { cell.chName.text = name.airPump; @@ -157,6 +185,95 @@ //RunSunCHNameCustom 本地处理 保存按钮名称 不与服务器交互 XuToControlName *name = [[XuToControlName alloc] init]; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + name=[UserExtendataArchaver currentXuToControlName:self.device.macAddress]; + for (RuSunChangeNameTextViewCell*cell in [self.tableView visibleCells]) { + + if (![cell isKindOfClass:[RuSunChangeNameTextViewCell class]]) { + + continue; + } + if ([cell.chTitle.text isEqualToString:@"照明"]) { + + if (cell.chName.text.length>3) + { + [self.view makeToast:@"照明不能超过3个字"]; + return; + } + else if (cell.chName.text.length==0) + { + [self.view makeToast:@"照明不能为空"]; + return; + + } + else + { + name.xunhuanPump=cell.chName.text; + } + } + else if ([cell.chTitle.text isEqualToString:@"换气"]) { + + if (cell.chName.text.length>3) + { + [self.view makeToast:@"换气不能超过3个字"]; + return; + } + else if (cell.chName.text.length==0) + { + [self.view makeToast:@"换气不能为空"]; + return; + + } + else + { + name.zengyangPump=cell.chName.text; + } + } + else if ([cell.chTitle.text isEqualToString:@"杀菌"]) { + + if (cell.chName.text.length>3) + { + [self.view makeToast:@"杀菌不能超过3个字"]; + return; + } + else if (cell.chName.text.length==0) + { + [self.view makeToast:@"杀菌不能为空"]; + return; + + } + else + { + name.light1=cell.chName.text; + } + } + else if ([cell.chTitle.text isEqualToString:@"恒温"]) { + + if (cell.chName.text.length>3) + { + [self.view makeToast:@"恒温不能超过3个字"]; + return; + } + else if (cell.chName.text.length==0) + { + [self.view makeToast:@"恒温不能为空"]; + return; + + } + else + { + name.light2=cell.chName.text; + } + } + + + + } + [UserExtendataArchaver saveNewXuToControlName:name]; + [self upLoadDeviceName]; + return; + } RuSunChangeNameTextViewCell*cell1 = [self.view viewWithTag:XUTOCHCELL_AIR]; if (cell1.chName.text.length>3) { if (_isNewdevice) { diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToSetViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToSetViewController.m index 77cf4ab..f8c59fc 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToSetViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/XuToSetViewController.m @@ -849,7 +849,8 @@ Strong XuToControlName *xutoName;//水族箱内各种名字 NSLog(@"ni hua dong tai kuai"); str=[NSString stringWithFormat:@"%ld",(long)self.waterInfmodel.remindcycle]; - [_remindPic makeToast:@"请设置换水天数"]; + NSString*title=@"请设置换水天数"; + [_remindPic makeToast:title]; return; } diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.h index ca8776c..412b246 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.h @@ -9,16 +9,18 @@ #import #import "Xuanduo2Model.h" #import "Xuanduo2TimerModel.h" +#import "IfishDeviceInfo.h" +#import "xuanduo3fModel.h" NS_ASSUME_NONNULL_BEGIN @interface Xuanduo2DataUtility : NSObject -+(void)readSocketDataWithBackMsgModel:(Xuanduo2Model*)xuanduoModel addWithBackData:(NSData*)data; ++(void)readSocketDataWithBackMsgModel:(id)xuanduoModel addWithBackData:(NSData*)data type:(NSString*)type; -+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr; ++(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(NSString*)type; -+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(Xuanduo2Model*)backModel; ++(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(id)backModel type:(NSString*)type; @end NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m index 64e8a38..379f6b8 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2DataUtility.m @@ -8,11 +8,17 @@ #import "Xuanduo2DataUtility.h" + @implementation Xuanduo2DataUtility -+(void)readSocketDataWithBackMsgModel:(Xuanduo2Model*)xuanduoModel addWithBackData:(NSData*)data{ ++(void)readSocketDataWithBackMsgModel:(id)model addWithBackData:(NSData*)data type:(nonnull NSString *)type{ NSString *dataString = [dataContorl dataToHexString:data];// 转十六进制 @try { + + if ([type isEqualToString:DECICE_TYPE_XUANDUO2F]&&[model isKindOfClass:[Xuanduo2Model class]]) + { + + Xuanduo2Model*xuanduoModel=model; xuanduoModel.gasPump = [dataString substringWithRange:NSMakeRange(30, 4)]; xuanduoModel.light1 = [dataString substringWithRange:NSMakeRange(34, 4)]; xuanduoModel.light2 = [dataString substringWithRange:NSMakeRange(38, 4)]; @@ -28,6 +34,23 @@ xuanduoModel.alarmSwitch = [dataString substringWithRange:NSMakeRange(74, 2)]; xuanduoModel.miniTemp = [dataString substringWithRange:NSMakeRange(76, 4)]; xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(80, 4)]; + } + else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]&&[model isKindOfClass:[Xuanduo3fModel class]]) + { + + Xuanduo3fModel*xuanduoModel=model; + xuanduoModel.light = [dataString substringWithRange:NSMakeRange(30, 4)]; + xuanduoModel.gasPump = [dataString substringWithRange:NSMakeRange(34, 4)]; + xuanduoModel.uvLamp = [dataString substringWithRange:NSMakeRange(38, 4)]; + xuanduoModel.constTmep = [dataString substringWithRange:NSMakeRange(42, 4)]; + xuanduoModel.temperature = [dataString substringWithRange:NSMakeRange(46, 4)]; + xuanduoModel.heatingTemperature = [dataString substringWithRange:NSMakeRange(50, 4)]; + xuanduoModel.vuPHstatus = [dataString substringWithRange:NSMakeRange(54, 4)]; + xuanduoModel.alarmSwitch = [dataString substringWithRange:NSMakeRange(58, 2)]; + xuanduoModel.miniTemp = [dataString substringWithRange:NSMakeRange(60, 4)]; + xuanduoModel.maxTemp = [dataString substringWithRange:NSMakeRange(64, 4)]; + + } } @catch (NSException *exception) { } @finally { @@ -36,7 +59,12 @@ } -+(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(Xuanduo2Model*)backModel{ ++(void)resetNewXuanduoButtonState:(UIButton*)uvLightBtn gasPumpLight:(UIButton*)gasLightBtn light1:(UIButton*)light1Btn light2:(UIButton*)light2Btn waveLight:(UIButton*)waveLightBtn huliLight:(UIButton*)huliLightBtn waterLight:(UIButton*)waterLightBtn heatLight:(UIButton*)heatLightBtn withModel:(Xuanduo2Model*)model type:(nonnull NSString *)type{ + + if ([type isEqualToString:DECICE_TYPE_XUANDUO2F]) + { + + Xuanduo2Model*backModel=model; // 杀菌灯 NSString *stateString1 = [backModel.uvLamp substringWithRange:NSMakeRange(2, 2)]; if ([stateString1 isEqualToString:@"01"]) { @@ -91,9 +119,46 @@ }else{ heatLightBtn.selected = NO; } + + } + else if ([type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + + // 杀菌 + Xuanduo3fModel*backModel=model; + NSString *stateString1 = [backModel.uvLamp substringWithRange:NSMakeRange(2, 2)]; + if ([stateString1 isEqualToString:@"01"]) { + light1Btn.selected = YES; + }else{ + light1Btn.selected = NO; + } + // 换气 + NSString *stateString2 = [backModel.gasPump substringWithRange:NSMakeRange(2, 2)]; + if ([stateString2 isEqualToString:@"01"]) { + gasLightBtn.selected = YES; + }else{ + gasLightBtn.selected = NO; + } + // 灯 + NSString *stateString3 = [backModel.light substringWithRange:NSMakeRange(2, 2)]; + if ([stateString3 isEqualToString:@"01"]) { + waterLightBtn.selected = YES; + }else{ + waterLightBtn.selected = NO; + } + // 恒温 + NSString *stateString4 = [backModel.constTmep substringWithRange:NSMakeRange(2, 2)]; + if ([stateString4 isEqualToString:@"01"]) { + light2Btn.selected = YES; + }else{ + light2Btn.selected = NO; + } + + } + } -+(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr { ++(void)readTimerSocketDataWithBackMsgModel:(Xuanduo2TimerModel*)xuanduoTimerModel addWithBackStr:(NSString*)dataStr type:(nonnull NSString *)type{ xuanduoTimerModel.lightNumber = [dataStr substringWithRange:NSMakeRange(30, 2)]; xuanduoTimerModel.groupSum = [dataStr substringWithRange:NSMakeRange(32, 2)]; UInt64 sum = [dataContorl hexToTen:xuanduoTimerModel.groupSum]; diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.h index 8b9d68a..9ea319a 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.h +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.h @@ -7,6 +7,8 @@ // #import "FatherController.h" +#import "IfishDeviceInfo.h" +#include "xuanduo3fModel.h" NS_ASSUME_NONNULL_BEGIN @@ -15,10 +17,10 @@ NS_ASSUME_NONNULL_BEGIN @interface Xuanduo2SettingController : FatherController @property (nonatomic,strong) UIActivityIndicatorView*indicatorView; -@property (nonatomic ,strong) Xuanduo2Model *dataModel; +@property (nonatomic ,strong) id dataModel; @property(nonatomic,strong) DeviceModel* currentdevice; -- (void)refreshWithData:(Xuanduo2Model *)model; +- (void)refreshWithData:(id)model; @end diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m index e0c1ea6..88bb564 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/Xuanduo2SettingController.m @@ -24,6 +24,8 @@ #import "ReadTimerModel.h" #import "Xuanduo2DataUtility.h" #import "Xuanduo2TimerModel.h" +#import "IfishDeviceInfo.h" +#import "NSString+Add.h" #define kBtnTag 500 #define kSwitchBtnTag 600 @@ -54,6 +56,7 @@ static NSString *setTimerflag = @"SetTimerCell"; BOOL _huanShuiSwitchIsOn; NSInteger _selectSection; MydatePickerView*_mydatepicView; + } - (void)viewWillAppear:(BOOL)animated { @@ -86,14 +89,25 @@ static NSString *setTimerflag = @"SetTimerCell"; - (void)setup { [self.navigationController.navigationBar resetBackgroundImage]; - [self addTitleViewWithTitle:@"水族箱设置"]; + + NSString*title=@"水族箱设置"; + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO2F]) { + title = @"水族箱设置"; + } + else if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + title = @"宠物笼设置"; + } + + [self addTitleViewWithTitle:title]; [self refreshWithData:self.dataModel]; [self setupTable]; [self creatIndicatorView]; [Socketsingleton sharedInstance].communiteDelegate = self; } -- (void)refreshWithData:(Xuanduo2Model *)model { +- (void)refreshWithData:(Xuanduo3fModel*)model { + NSString*low = model.miniTemp; NSString*heigh = model.maxTemp; UInt64 lowten = [dataContorl hexToTen:low]; @@ -106,6 +120,14 @@ static NSString *setTimerflag = @"SetTimerCell"; - (void)setupTable { _titieArr = @[@"循环泵",@"增氧泵",@"灯光1",@"灯光2",@"造浪泵",@"杀菌灯"]; _imgArr = @[@"xunhuan_big",@"gas_big",@"light_big",@"light_big",@"wave_big",@"shajun_big"]; + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + _titieArr = @[@"照明",@"换气",@"杀菌"]; + _imgArr = @[@"照明开",@"换气开",@"杀菌开"]; + } + + + _selectSection = -1; for (int i = 0; i<_titieArr.count; i++) { NSMutableArray *dataArr = [NSMutableArray arrayWithCapacity:0]; @@ -123,7 +145,7 @@ static NSString *setTimerflag = @"SetTimerCell"; #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2 + self.timeDic.allKeys.count; + return 2 + self.timeDic.allKeys.count+([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?1:0); } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { @@ -136,6 +158,13 @@ static NSString *setTimerflag = @"SetTimerCell"; NSArray *dataArr = [self.timeDic objectForKey:_titieArr[section-2]]; return dataArr.count; } + else + { + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + return 1; + } + } return 0; } @@ -150,7 +179,8 @@ static NSString *setTimerflag = @"SetTimerCell"; cell.temperaturelabel.text = model.temperatureLabel; [cell.temPSwitch addTarget:self action:@selector(xuTotempSwitchAction:) forControlEvents:UIControlEventTouchUpInside]; if (self.dataModel) { - if ([self.dataModel.alarmSwitch isEqualToString:@"01"]) { + Xuanduo2Model*model=self.dataModel; + if ([model.alarmSwitch isEqualToString:@"01"]) { [cell.temPSwitch setBackgroundImage:[UIImage imageNamed:@"greenbtn_big"] forState:UIControlStateNormal]; cell.temPSwitch.selected = NO; @@ -185,6 +215,11 @@ static NSString *setTimerflag = @"SetTimerCell"; 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]; @@ -210,19 +245,55 @@ static NSString *setTimerflag = @"SetTimerCell"; 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{ + } + else{ cell.textLabel.text=@""; } cell.userInteractionEnabled = NO; return cell; - }else { + }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; + NSLog(@"wendu str = %@",_wenduString); + model.temperatureLabel = _wenduString; + cell.temPSwitch.hidden=YES; + cell.temperaturelabel.frame=cell.temPSwitch.frame; + + Xuanduo3fModel*model3=self.dataModel; + int mac=[dataContorl hexToTen:model3.temperature]; + + //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]; @@ -272,6 +343,10 @@ static NSString *setTimerflag = @"SetTimerCell"; return 0; } } + else if(indexPath.section - 2 ==_titieArr.count&&[self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + return 50; + } return 0; } @@ -281,13 +356,14 @@ static NSString *setTimerflag = @"SetTimerCell"; if (section == 0) { return 5; }else if (section == 2){ - return 80; + return 40; }else if (section == 3){ return 40; }else if (section == 4){ return 40; }else if (section == 5){ - return 40; + + return [self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]?0:40; }else if (section == 6){ return 40; }else if (section == 7){ @@ -304,14 +380,14 @@ static NSString *setTimerflag = @"SetTimerCell"; oneHeader.backgroundColor = COLOR_MIAN; return oneHeader; }else if(section == 2){ - XuanduoSectionHeaderView *section1HeaderView = [XuanduoSectionHeaderView shareHeaderView]; - section1HeaderView.arrowBtn.tag = kBtnTag + section; + XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; + headerView.controlBtn.tag = kBtnTag + section; if (_selectSection == section) { - section1HeaderView.arrowBtn.selected = YES; + headerView.controlBtn.selected = YES; } - section1HeaderView.titleLabel.text = _titieArr[section-2]; - [section1HeaderView.arrowBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - return section1HeaderView; + [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; @@ -331,14 +407,24 @@ static NSString *setTimerflag = @"SetTimerCell"; [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; return headerView; }else if(section == 5){ - XuanduoSelectHeader *headerView = [XuanduoSelectHeader shareHeaderView]; - headerView.controlBtn.tag = kBtnTag + section; - if (_selectSection == section) { - headerView.controlBtn.selected = YES; + if ([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + UIView *oneHeader = [[UIView alloc] init]; + oneHeader.backgroundColor = COLOR_MIAN; + return oneHeader; } - [headerView.controlBtn addTarget:self action:@selector(foldAction:) forControlEvents:UIControlEventTouchUpInside]; - [headerView configWithImageName:_imgArr[section-2] labelName:_titieArr[section-2]]; - return headerView; + 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; @@ -378,6 +464,16 @@ static NSString *setTimerflag = @"SetTimerCell"; //换水提醒日期选择 _remindPic=[[remindCyclePic alloc]init]; + _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]; @@ -438,14 +534,26 @@ static NSString *setTimerflag = @"SetTimerCell"; readModel.resavemacId = self.currentdevice.macAddress; readModel.crc16str=@"0000"; switch (_selectSection - 2) { - case 0: //循环泵 + 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"; @@ -494,16 +602,32 @@ static NSString *setTimerflag = @"SetTimerCell"; case 0: //循环泵 { timerModel.selectorNumber = @"04"; + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"01"; + } } break; case 1: //增氧 { timerModel.selectorNumber = @"01"; + + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"02"; + } + } break; case 2: //灯光1 { timerModel.selectorNumber = @"02"; + + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"03"; + } + } break; case 3: //灯光2 @@ -648,16 +772,32 @@ static NSString *setTimerflag = @"SetTimerCell"; case 0: //循环泵 { timerModel.selectorNumber = @"04"; + + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"01"; + } + } break; case 1: //增氧 { timerModel.selectorNumber = @"01"; + + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"02"; + } + } break; case 2: //灯光1 { timerModel.selectorNumber = @"02"; + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"03"; + } } break; case 3: //灯光2 @@ -724,16 +864,28 @@ static NSString *setTimerflag = @"SetTimerCell"; case 0: //循环泵 { timerModel.selectorNumber = @"04"; + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"01"; + } } break; case 1: //增氧 { timerModel.selectorNumber = @"01"; + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"02"; + } } break; case 2: //灯光1 { timerModel.selectorNumber = @"02"; + if([self.currentdevice.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + timerModel.selectorNumber=@"03"; + } } break; case 3: //灯光2 @@ -901,7 +1053,23 @@ static NSString *setTimerflag = @"SetTimerCell"; #pragma mark 默认换水时间 -(void)huanShuiMainQueue{ - if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) { + if (_indexPath.section-2==_titieArr.count) + { + Xuanduo3fModel*model3=self.dataModel; + int mac=[dataContorl hexToTen:model3.temperature]; + + //float TPlabel=mac/10+(mac%10)*0.1; + NSInteger temp = mac/10.0; + if (temp<1) + { + temp=1; + } + [_remindPic.pic selectRow:temp-1 inComponent:0 animated:NO]; + + return; + } + + else if (_remindPic.picViewResultString !=nil || (_remindPic.picViewResultString ==nil && self.waterInfmodel.remindcycle !=0 )) { NSArray*shijianArr=[_remindPic.picArr objectAtIndex:0]; NSLog(@"a"); for (NSInteger k=0; k - + @@ -14,7 +14,9 @@ + + @@ -34,6 +36,7 @@ + @@ -42,29 +45,50 @@ - + - + - + + - + - + @@ -208,7 +232,7 @@ + + + + @@ -277,6 +321,7 @@ + @@ -312,11 +357,13 @@ + + diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/xuanduo3fModel.h b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/xuanduo3fModel.h new file mode 100644 index 0000000..d7dc937 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/xuanduo3fModel.h @@ -0,0 +1,55 @@ +// +// xuanduo3fModel.h +// Ifish +// +// Created by 祝发冬 on 2020/4/6. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +#if 0 +01 +08 +bcddc2450947 +bcddc2450947 +24 — 36字节 +0101 照明 +0201 换气 +0301 杀菌 +0401 恒温 +024e 温度 +0140 加热温度 +007d 杀菌倒计时 +01 报警开关 +00c8 最低报警温度 +012c 最高报警温度 +2244 crc16校验码 +#endif +@interface Xuanduo3fModel : NSObject +/// 换气 -- 气泵 +@property (nonatomic, strong) NSString *gasPump; +/// 灯1 +@property (nonatomic, strong) NSString *light; + +/// 杀菌灯 +@property (nonatomic, strong) NSString *uvLamp; +/// 杀菌倒计时PH +@property (nonatomic, strong) NSString *vuPHstatus; +/// 恒温 +@property (nonatomic, strong) NSString *constTmep; +///温度 +@property (nonatomic, strong) NSString *temperature; +/// 加热温度 +@property (nonatomic, strong) NSString *heatingTemperature; + +/// 报警开关 +@property (nonatomic, strong) NSString *alarmSwitch; +/// 最低温 +@property (nonatomic, strong) NSString *miniTemp; +/// 最高温 +@property (nonatomic, strong) NSString *maxTemp; +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/xuanduo3fModel.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/xuanduo3fModel.m new file mode 100644 index 0000000..ce4c8e3 --- /dev/null +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/XuTo/xuanduo3fModel.m @@ -0,0 +1,13 @@ +// +// xuanduo3fModel.m +// Ifish +// +// Created by 祝发冬 on 2020/4/6. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import "xuanduo3fModel.h" + +@implementation Xuanduo3fModel + +@end diff --git a/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.h b/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.h index 65f3441..4110404 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.h +++ b/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.h @@ -7,6 +7,7 @@ // #import "BaseViewController.h" +#import "IfishDeviceInfo.h" //修改设备名 及控制名 子类实现DataSource即可 typedef void (^deviceNameBlock)(NSString *); diff --git a/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.m b/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.m index 3dac136..5ecdfd8 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/IfishDeviceControlNameBaseController.m @@ -160,7 +160,12 @@ [para setValue: cell.deviceName.text forKey:@"showName"]; if (cell.deviceName.text.length <= 6) { - [mannager POST:kUpdateDeviceUser parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) { + NSString*url=kUpdateDeviceUser; + if ([self.device.type isEqualToString:DECICE_TYPE_XUANDUO3F]) + { + url=[NSString stringWithFormat:@"%@/api/user/updatePetDeviceUser.do",JIEKOUPORT]; + } + [mannager POST:url parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) { if (responseObject) { NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil]; NSLog(@"result:%@",resultDic[@"result"]); @@ -168,7 +173,7 @@ if ([resultDic[@"result"] isEqualToString:@"100"]) { [self.view makeToast:@"修改成功"]; - + [[NSNotificationCenter defaultCenter]postNotificationName:@"updateUserInfobyValidation" object:nil]; NSString *strName =[NSString stringWithFormat:@"%@",cell.deviceName.text]; diff --git a/Ifish/controllers/HotBar/IfishHotBarVc.m b/Ifish/controllers/HotBar/IfishHotBarVc.m index 4622032..1573393 100644 --- a/Ifish/controllers/HotBar/IfishHotBarVc.m +++ b/Ifish/controllers/HotBar/IfishHotBarVc.m @@ -175,6 +175,7 @@ Assign BOOL isInitHostoryView; vo.subTitle=[NSString stringWithFormat:@"%.1f°c",[self.vo.heaterNum floatValue]]; [self.mainTableView reloadData]; [self setHeatTeapWith:temp]; + [[DataCenter defaultDtacenter].cache setString:[NSString stringWithFormat:@"%.1f°c",[self.vo.heaterNum floatValue]] forKey:@"heaterTemperature"]; } //设置预警温度 -(void)didSelectTeamptrue:(NSString *)up andDown:(NSString *)down andWarnCode:(NSString *)code{ @@ -195,7 +196,7 @@ Assign BOOL isInitHostoryView; vo.title=@"设置水温"; vo.iconUrl=@"温度图标"; vo.isShowArrow=YES; - vo.subTitle=@""; + vo.subTitle=[CommonUtils getNotNilStr:[[DataCenter defaultDtacenter].cache stringForKey:@"heaterTemperature"]]; [_datas addObject:vo]; //预警温度 add V5.0.0 @@ -355,6 +356,9 @@ Assign BOOL isInitHostoryView; [SVProgressHUD dismiss]; if ([result integerValue]==100) { self.vo=[IfishHotBarVo mj_objectWithKeyValues:dict[@"data"]]; + if (!self.vo) { + self.vo=self.datas[0]; + } if (self.vo.phs.count>0) { NSDate *curDate = [NSDate dateWithTimeInterval:self.curDay*60*60*-24 sinceDate:[NSDate date]]; NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];//创建一个日期格式化器 @@ -412,6 +416,11 @@ Assign BOOL isInitHostoryView; self.historyView.hidden=NO; }else{ + NSLog(@"index%ld___%ld",indexPath.section,indexPath.row); + if (!self.vo) + { + self.vo=self.datas[indexPath.row]; + } [self changeWaterView]; self.changeWaterView.hotVo=self.vo; self.changeWaterView.viewType=indexPath.row; diff --git a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m index 0077557..e7ce529 100644 --- a/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m +++ b/Ifish/controllers/IfishTabControllers/我的/mineControllers/pushSetControllrs/AboutUsViewController.m @@ -25,7 +25,7 @@ // CFShow((__bridge CFTypeRef)(infoDic)); NSString *app_Version=[infoDic objectForKey:@"CFBundleShortVersionString"]; NSLog(@"app_Version%@",app_Version); - app_Version=@"4.7.4"; + app_Version=@"4.7.5"; NSString *versionStr = [NSString stringWithFormat:@"v%@",app_Version]; NSString *buildVersion = [infoDic objectForKey:@"CFBundleVersion"]; if (buildVersion.length > 0) { diff --git a/Ifish/controllers/IfishTabControllers/设备/FormatTankAddCamera.h b/Ifish/controllers/IfishTabControllers/设备/FormatTankAddCamera.h index c1abb40..5731375 100644 --- a/Ifish/controllers/IfishTabControllers/设备/FormatTankAddCamera.h +++ b/Ifish/controllers/IfishTabControllers/设备/FormatTankAddCamera.h @@ -15,6 +15,7 @@ @property (nonatomic,copy) NSString *imgeaName; @property (nonatomic,copy) NSString *deviceName; @property (nonatomic,strong) DeviceModel *device; +@property (nonatomic,strong) NSMutableArray *list;//设备列表 @property (nonatomic,strong) IfishCameraModel *camera; @end diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/FishSelectDeviceListViewCell.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/FishSelectDeviceListViewCell.m index a4ff878..fabad99 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/FishSelectDeviceListViewCell.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/FishSelectDeviceListViewCell.m @@ -26,6 +26,9 @@ self.deviceImg.image = [UIImage imageNamed:@"加热系统"]; } else if (indexPath.row ==3){ + self.deviceImg.image = [UIImage imageNamed:@"智能宠物系统"]; + } + else if (indexPath.row ==4){ self.deviceImg.image = [UIImage imageNamed:@"敬请期待"]; } diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m index 16dc45c..1feb25c 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m @@ -86,7 +86,7 @@ extern BOOL isfromCameraView; -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - return 4; + return 5; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ @@ -102,7 +102,7 @@ extern BOOL isfromCameraView; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - return 378/2.0; + return 278/2.0; } - (void)didReceiveMemoryWarning { @@ -126,10 +126,10 @@ extern BOOL isfromCameraView; { //摄像头 NSArray * cameraArr =[[DataCenter defaultDtacenter]valueForKey:@"cameraArr"]; - if ([cameraArr count]>=5) { - [self.view makeToast:@"设备已达上限"]; - return; - } +// if ([cameraArr count]>=5) { +// [self.view makeToast:@"设备已达上限"]; +// return; +// } if ( [GWP2PClient sharedClient].linkStatus==P2PLinkStatusOK) { @@ -156,12 +156,12 @@ extern BOOL isfromCameraView; //水族箱 NSArray * deviceArr =[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"]; - if ([deviceArr count]>=5) { - - [self.view makeToast:@"设备已达上限"]; - return; - - } +// if ([deviceArr count]>=5) { +// +// [self.view makeToast:@"设备已达上限"]; +// return; +// +// } self.hidesBottomBarWhenPushed = YES; ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC); methodVC.deviceType=DEVICEAQUARIUM; @@ -190,6 +190,25 @@ extern BOOL isfromCameraView; //[self.view makeToast:@"敬请期待"]; 加热棒 + } + break; + case 3: + { + + self.hidesBottomBarWhenPushed = YES; + ConAquarMethodVC *methodVC = InitObject(ConAquarMethodVC); + methodVC.deviceType=DEVICEPETS; + methodVC.titleString=@"连接宠物笼"; + + [self.navigationController pushViewController:methodVC animated:YES]; + + // SecondConnectWifiController *wifivc=[[SecondConnectWifiController alloc]init]; + // wifivc.vcTitle=@"连接加热器"; + // [self.navigationController pushViewController:wifivc animated:YES]; + // [wifivc addTitleViewWithTitle:@"连接加热器"]; + //[self.view makeToast:@"敬请期待"]; 加热棒 + + } break; diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m index 236a04e..e9b46cd 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceViewController.m @@ -43,6 +43,10 @@ #import "PushMessageModel.h" #import "IfishInformationListViewCell.h"//资讯 #import "JHRefresh.h"//refresh +#import "PetStoresViewController.h" +#import "StoreNameView.h" +#import "ConnectingAquarVC.h" +#import "SecondConnectWifiController.h" @interface IfishDeviceViewController () @property(nonatomic,strong)UITableView *tableView; @@ -52,6 +56,7 @@ @property(nonatomic,strong) DXPopover *popover; @property(nonatomic,strong) NSArray *cameraArr; +@property(nonatomic,strong) NSMutableDictionary *petStores; @property(nonatomic,strong) UIButton*rightButton; @@ -373,18 +378,40 @@ Assign BOOL isPush; //设备信息 NSArray*deviceArray=dataDic[@"device"]; NSArray*cameraA=dataDic[@"camera"]; + //宠物店 + NSMutableDictionary*petStores=[NSMutableDictionary dictionary]; NSMutableArray *deviceArr = [[NSMutableArray alloc] init]; if ([deviceArray count]!=0) { for (NSDictionary*deviceDic in deviceArray) { DeviceModel*devicemodel=[[DeviceModel alloc] initWithDict:deviceDic]; - [deviceArr insertObject:devicemodel atIndex:0]; + if (devicemodel.storeName.length)//宠物笼 + + { + NSString*storeName=devicemodel.storeName; + NSMutableArray*array=petStores[storeName]; + if (!array) { + array=[NSMutableArray array]; + + } + [array insertObject:devicemodel atIndex:0]; + + petStores[storeName]=array; + } + else { + [deviceArr insertObject:devicemodel atIndex:0]; + } + } } [[DataCenter defaultDtacenter]setValue:deviceArr forKey:@"deviceInfo"]; + + self.petStores=petStores; + [[DataCenter defaultDtacenter]setValue:petStores forKey:@"petStores"]; + //存储摄像头设备信息 NSMutableArray *camras = [[NSMutableArray alloc] init]; if (cameraA .count !=0) { @@ -805,6 +832,7 @@ Assign BOOL isPush; self.deviceArr =[dataContorl getallDevices]; self.cameraArr =[dataContorl getallCameras]; + self.petStores= [[DataCenter defaultDtacenter]valueForKey:@"petStores"]; [self getTotalDeviceArrWith:self.deviceArr addCameraArr:self.cameraArr]; [self.tableView reloadData]; @@ -839,6 +867,16 @@ Assign BOOL isPush; [self.totalArr addObject:deviceListModel]; } + for (NSString *store in self.petStores) { + FormatTankAddCamera *deviceListModel =[[FormatTankAddCamera alloc] init]; + deviceListModel.list = self.petStores[store]; + deviceListModel.type = @"pets"; + deviceListModel.deviceName = store; + deviceListModel.imgeaName = @"petsImage"; + [self.totalArr addObject:deviceListModel]; + + } + } @@ -1184,7 +1222,48 @@ Assign BOOL isPush; [[Socketsingleton sharedInstance] cutOffSocket]; [[IfishDataUnity shareDataInstance] initAppCenterVcWith:model.device addWithdissMisVc:nil]; - }else if ([model.type isEqualToString:@"camera"]){ + } + else if ([model.type isEqualToString:@"pets"]) + { +// PetStoresViewController*store=[[PetStoresViewController alloc]init]; +// store.store=model; + [[DataCenter defaultDtacenter] setValue:model forKey:@"currentStore"]; + + DeviceModel*pushDevice=nil; + NSString*macid=[[DataCenter defaultDtacenter].cache stringForKey:@"currentPetDevice"]; + if (macid.length) + { + BOOL find=NO; + for (DeviceModel*de in model.list) { + if ([macid isEqualToString:de.macAddress]) + { + find=YES; + pushDevice=de; + break; + } + } + + if (find) + { + + } + else + { + pushDevice=model.list.firstObject; + } + } + else + { + pushDevice=model.list.firstObject; + } + + [[DataCenter defaultDtacenter].cache setString:pushDevice.macAddress forKey:@"currentPetDevice"]; + [[Socketsingleton sharedInstance] cutOffSocket]; + [[IfishDataUnity shareDataInstance] initAppCenterVcWith:pushDevice addWithdissMisVc:nil]; + + + } + else if ([model.type isEqualToString:@"camera"]){ // self.hidesBottomBarWhenPushed = YES; // IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init]; @@ -1547,7 +1626,7 @@ Assign BOOL isPush; } NSIndexSet *asset = [NSIndexSet indexSetWithIndex:2]; - [weskSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone]; + [weskSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationAutomatic]; } [weskSelf.progressHud hide:YES]; diff --git a/Ifish/controllers/IfishTabControllers/设备/Informations/View/IfishInformationListViewCell.xib b/Ifish/controllers/IfishTabControllers/设备/Informations/View/IfishInformationListViewCell.xib index 543769d..5cd6bc9 100644 --- a/Ifish/controllers/IfishTabControllers/设备/Informations/View/IfishInformationListViewCell.xib +++ b/Ifish/controllers/IfishTabControllers/设备/Informations/View/IfishInformationListViewCell.xib @@ -1,12 +1,11 @@ - - + + - - + @@ -20,14 +19,14 @@ - + - + - + - + @@ -105,6 +104,11 @@ + + + + + diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index de19555..89d2792 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -2211,7 +2211,15 @@ Strong UIImage *screenShotImage;//截图 [[Socketsingleton sharedInstance] cutOffSocket]; [AppDelegate sharedDefault].canFullScreen = NO; //改 tab 栏后新增 - [self setAppTabRoot]; + if ([self.navigationController.viewControllers firstObject]==self) + { + [self setAppTabRoot]; + } + else + { + [self.navigationController popViewControllerAnimated:YES]; + } + } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m index 2342975..3b29a93 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/yooseFishTankView/MonitorBootmView.m @@ -1799,7 +1799,7 @@ if (!_xuanduoBack) { _xuanduoBack = [[Xuanduo2Model alloc] init]; } - [Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data]; + [Xuanduo2DataUtility readSocketDataWithBackMsgModel:_xuanduoBack addWithBackData:data type:DECICE_TYPE_XUANDUO2F]; self.temperature = [BootomViewSoketBackMasgConreol getTempNewWayWithSoketData:data adddeviceType:DECICE_TYPE_XUANDUO2F]; [self.collectionView reloadData]; }else{ diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/Constants.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/Constants.h index 5e4d8db..6a924a4 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/Constants.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/Constants.h @@ -197,7 +197,8 @@ typedef NS_ENUM(NSUInteger, SmartDeviceType) { DEVICEAQUARIUM , /// 加热 - DEVICEHEATING + DEVICEHEATING, + DEVICEPETS }; #define Ali_Push_APPKey @"26007228" #define Ali_Push_APPSecret @"87c9206424399968ba11a56a9a979cfe" diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h index 516714f..6746cb2 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.h @@ -8,12 +8,16 @@ #import "BaseViewController.h" #import "LXWaveProgressView.h" +#import "StoreNameView.h" @interface SecondConnectWifiController : BaseViewController @property (weak, nonatomic) IBOutlet UIImageView *wifigifImgView; @property (weak, nonatomic) IBOutlet UILabel *wifiNamelabel; @property (weak, nonatomic) IBOutlet UITextField *wifiTextFiled; @property (weak, nonatomic) IBOutlet UILabel *redTextLable; +@property (nonatomic, strong) UIView *mask; +@property (nonatomic, strong) StoreNameView *storeNameView; +@property (nonatomic, strong) NSString *storeName; - (IBAction)makeSureButton:(id)sender; diff --git a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m index cf4f4c0..fe4ca46 100644 --- a/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m +++ b/Ifish/controllers/leftcontrollers/SecondConnectWifiController.m @@ -16,7 +16,7 @@ #import "ESPTouchTask.h" #import "ESPTouchResult.h" #import "ESPTouchDelegate.h" - +#import "MyMD5.h" #import "ChatroomModel.h" #import "MMProgressHUD.h" #import "MMProgressHUDOverlayView.h" @@ -135,6 +135,7 @@ extern BOOL isfromCameraView; [self creatConnectStateUI]; //获取WiFi名称 [self getSSid]; + [self showStoreNameView]; } - (void)updateUI { @@ -565,7 +566,7 @@ extern BOOL isfromCameraView; NSUInteger count = 0; // max results to be displayed, if it is more than maxDisplayCount, // just show the count of redundant ones - const int maxDisplayCount = 5; + const int maxDisplayCount = 100000; if ([firstResult isSuc]) { @@ -573,7 +574,8 @@ extern BOOL isfromCameraView; NSArray*arry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"]; DeviceModel*model=[[DeviceModel alloc]init]; - if (arry.count<5) { + //if (arry.count<5) + { NSMutableArray*macdressArr=[[NSMutableArray alloc]init]; for (model in arry) { @@ -592,17 +594,25 @@ extern BOOL isfromCameraView; }else{ - [self bindDeviceWithSsid:_deviceBssid]; + if (self.deviceType==DEVICEPETS) { + [self showStoreNameView]; + } + else + { + [self bindDeviceWithSsid:_deviceBssid]; + } + } - }else{ - - [self.view makeToast:@"您的设备数量已超过限制"]; - [self mmPogressHUDdismiss]; - [self connectNormalView]; - - } + } +// else{ +// +// [self.view makeToast:@"您的设备数量已超过限制"]; +// [self mmPogressHUDdismiss]; +// [self connectNormalView]; +// +// } for (int i = 0; i < [esptouchResultArray count]; ++i) @@ -660,11 +670,76 @@ extern BOOL isfromCameraView; } +-(UIView *)mask +{ + if (!_mask) + { + UIView*mask=[[UIView alloc]initWithFrame:self.view.bounds]; + mask.backgroundColor=[UIColor lightGrayColor]; + mask.alpha=0.5; + _mask=mask; + UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissStore)]; + [mask addGestureRecognizer:tap]; + } + + return _mask; +} +-(void)dismissStore +{ + [self.storeNameView removeFromSuperview]; + [self.mask removeFromSuperview]; + +} +-(void)showStoreNameView +{ + + [self.storeNameView removeFromSuperview]; + StoreNameView*store=[[[NSBundle mainBundle] loadNibNamed:@"StoreNameView" owner:self options:nil] lastObject]; + store.frame=CGRectMake((SCREEN_WIDTH-280)/2.0, 100, 280, 280); + self.storeNameView.center=self.mask.center; + + self.storeNameView=store; + WEAK_SELF; + store.cancelBlock=^(){ + [weakSelf.mask removeFromSuperview]; + [weakSelf.storeNameView removeFromSuperview]; + + }; + store.sureBlock=^(NSString*name) + { + [weakSelf.mask removeFromSuperview]; + [weakSelf.storeNameView removeFromSuperview]; + weakSelf.storeName=name; + [weakSelf bindDeviceWithSsid:_deviceBssid]; + }; + + [self.view addSubview:self.mask]; + [self.view addSubview:self.storeNameView]; + +} #pragma mark 绑定设备 -(void)bindDeviceWithSsid:(NSString*)bssid{ NSLog(@"设备bssid_%@",bssid); NSString *userId = [dataContorl dataControlGetUserIdInfo]; - [AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) { + [AFHttpTool requestWihtMethod:RequestMethodTypePost url:@"" params:@{} success:^(id response) { + + } failure:^(NSError *err) { + + }]; + NSString*url=[NSString stringWithFormat:@"%@%@",kBindDevice,userId]; + NSMutableDictionary*bind=[[NSMutableDictionary alloc]initWithDictionary:@{@"macAddress":bssid}]; + NSString* timestamp=[NSString stringWithFormat:@"%lld",[[NSDate date] timeIntervalSince1970]*1000]; + NSString*token=[MyMD5 md5:[NSString stringWithFormat:@"%@%@ifish8",userId,timestamp]]; + + if (self.deviceType==DEVICEPETS) + { + url=[NSString stringWithFormat:@"%@%@",[NSString stringWithFormat:@"%@/api/user/bindPetDevice.do/",JIEKOUPORT],userId]; + bind[@"token"]=token; + bind[@"timestamp"]=timestamp; + bind[@"storeName"]=[NSString stringWithFormat:@"宠物笼%lld",[[NSDate date] timeIntervalSince1970]]; + } + + [AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:bind success:^(id response) { NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil]; NSLog(@"data:%@",resultDic[@"data"]); if ([resultDic[@"result"] isEqualToString:@"100"]) { diff --git a/Ifish/controllers/pets/PetStoresViewController.h b/Ifish/controllers/pets/PetStoresViewController.h new file mode 100644 index 0000000..5146a88 --- /dev/null +++ b/Ifish/controllers/pets/PetStoresViewController.h @@ -0,0 +1,19 @@ +// +// PetStoresViewController.h +// Ifish +// +// Created by 祝发冬 on 2020/4/19. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import "BaseViewController.h" +#import "FormatTankAddCamera.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface PetStoresViewController : BaseViewController +@property (weak, nonatomic) IBOutlet UITableView *tableView; +@property (nonatomic, strong) FormatTankAddCamera *store;//一个商店的 +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/pets/PetStoresViewController.m b/Ifish/controllers/pets/PetStoresViewController.m new file mode 100644 index 0000000..f9c24e2 --- /dev/null +++ b/Ifish/controllers/pets/PetStoresViewController.m @@ -0,0 +1,134 @@ +// +// PetStoresViewController.m +// Ifish +// +// Created by 祝发冬 on 2020/4/19. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import "PetStoresViewController.h" +#import "IfishDataUnity.h" +#import "IfishDeviceInfo.h" + +@interface PetStoresViewController () + +@end + +@implementation PetStoresViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + [self addTitleViewWithTitle:self.store.deviceName]; + // Do any additional setup after loading the view from its nib. +} +-(void)addTitleViewWithTitle:(NSString *)title +{ + UIButton*button=[UIButton buttonWithType:UIButtonTypeCustom]; + button.frame=CGRectMake(0, 0, kSizeFrom750(300), 44); + [button setTitle:title forState:UIControlStateNormal]; + button.titleLabel.font=[UIFont systemFontOfSize:19]; + [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(changeStoreName:) forControlEvents:UIControlEventTouchUpInside]; + + + + self.navigationItem.titleView=button; +} +-(void)changeStoreName:(UIButton*)button +{ + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"修改名称" message:nil preferredStyle:UIAlertControllerStyleAlert]; + + + //增加确定按钮; + [alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + //获取第1个输入框; + UITextField *passTextField = alertController.textFields.firstObject; + + + NSString*name=passTextField.text; + if (name.length) + { + NSString*url=[NSString stringWithFormat:@"%@/api/user/updatePetStore.do",JIEKOUPORT]; + UserModel*model=[dataContorl getUserInfo]; + + + [AFHttpTool requestWihtMethod:RequestMethodTypePost url:url params:@{@"userId":model.userId,@"oldName":self.store.deviceName,@"newName":name} success:^(id response) { + + + NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil]; + NSLog(@"data:%@",resultDic[@"data"]); + ; + if ([resultDic[@"result"] isEqualToString:@"100"]) { + + [self.view makeToast:@"修改成功"]; + self.store.deviceName=name; + [self addTitleViewWithTitle:name]; + [[NSNotificationCenter defaultCenter]postNotificationName:@"updateUserInfobyValidation" object:nil]; + } + else + { + [self.view makeToast:@"修改失败"]; + } + + } failure:^(NSError *err) { + [self.view makeToast:@"修改失败"]; + }]; + } + else + { + [self.view makeToast:@"名字不能为空"]; + } + + + + + }]]; + [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + }]]; + + + + [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { + + textField.text = self.store.deviceName; + + }]; + + [self presentViewController:alertController animated:true completion:nil]; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.store.list.count; +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"pets"]; + DeviceModel*model= self.store.list[indexPath.row]; + if (!cell) + { + cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"pets"]; + } + cell.textLabel.text=model.showName; + return cell; +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + DeviceModel*model= self.store.list[indexPath.row]; + [[Socketsingleton sharedInstance] cutOffSocket]; + [[IfishDataUnity shareDataInstance] initAppCenterVcWith:model addWithdissMisVc:nil]; + [[DataCenter defaultDtacenter].cache setString:model.macAddress forKey:@"currentPetDevice"]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Ifish/controllers/pets/PetStoresViewController.xib b/Ifish/controllers/pets/PetStoresViewController.xib new file mode 100644 index 0000000..8a42c84 --- /dev/null +++ b/Ifish/controllers/pets/PetStoresViewController.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/models/ifishUserModel/DeviceModel.h b/Ifish/models/ifishUserModel/DeviceModel.h index 70f4980..8d1ffc5 100644 --- a/Ifish/models/ifishUserModel/DeviceModel.h +++ b/Ifish/models/ifishUserModel/DeviceModel.h @@ -86,6 +86,7 @@ @property(nonatomic,copy) NSString *userId; @property(nonatomic,copy) NSString *venderDto; +@property (nonatomic, strong) NSString *storeName;//宠物店 // 厂家 信息vender //厂家 diff --git a/Ifish/models/ifishUserModel/DeviceModel.m b/Ifish/models/ifishUserModel/DeviceModel.m index 7ca9f15..1eea044 100644 --- a/Ifish/models/ifishUserModel/DeviceModel.m +++ b/Ifish/models/ifishUserModel/DeviceModel.m @@ -121,6 +121,7 @@ _isPushWendu = dict[@"isPushWendu"]; _venderDto=dict[@"venderDto"]; _deviceIp=dict[@"deviceIp"]; + _storeName=dict[@"storeName"]; if ([_venderDto isEqual:[NSNull null]]) { _venderDto=@""; diff --git a/Ifish/models/ifishUserModel/UserModel.h b/Ifish/models/ifishUserModel/UserModel.h index cb2f88e..9d0a9ce 100644 --- a/Ifish/models/ifishUserModel/UserModel.h +++ b/Ifish/models/ifishUserModel/UserModel.h @@ -8,7 +8,7 @@ #import -@interface UserModel : NSObject +@interface UserModel : NSObject @property(nonatomic,copy)NSString*phoneNumber; @property(nonatomic,strong)NSNumber*userId; diff --git a/Ifish/models/ifishUserModel/UserModel.m b/Ifish/models/ifishUserModel/UserModel.m index 5ca10b6..5bb5b1c 100644 --- a/Ifish/models/ifishUserModel/UserModel.m +++ b/Ifish/models/ifishUserModel/UserModel.m @@ -16,7 +16,7 @@ [aCoder encodeObject:self.nickName forKey:@"nickName"]; [aCoder encodeObject:self.userSex forKey:@"userSex"]; [aCoder encodeObject:self.userImg forKey:@"userImg"]; - [aCoder encodeObject:self forKey:@"signature"]; + [aCoder encodeObject:self.signature forKey:@"signature"]; [aCoder encodeObject:self.P2PVerifyCode1 forKey:@"P2PVerifyCode1"]; [aCoder encodeObject:self.P2PVerifyCode2 forKey:@"P2PVerifyCode2"]; [aCoder encodeObject:self.sessionID forKey:@"sessionID"]; @@ -82,4 +82,5 @@ return self; } + @end diff --git a/Ifish/views/IfishPopView/LXPopView.h b/Ifish/views/IfishPopView/LXPopView.h index 55b27a1..ddea168 100644 --- a/Ifish/views/IfishPopView/LXPopView.h +++ b/Ifish/views/IfishPopView/LXPopView.h @@ -13,7 +13,7 @@ @required -(void)disSelectedPopViewIndex:(NSIndexPath *)Index; - +-(UITableViewCell *)tableView:(UITableView *)tableView cellForPopViewIndexPath:(NSIndexPath *)indexPath; @end @@ -30,5 +30,7 @@ @property(nonatomic,strong) NSArray *titles; @property(nonatomic,strong) NSArray *titleImgs; @property(nonatomic,strong) UIImage *backgroundImage; +@property (nonatomic, strong) UIImageView *backImageView; +-(void)changeStyle:(NSString*)style; @end diff --git a/Ifish/views/IfishPopView/LXPopView.m b/Ifish/views/IfishPopView/LXPopView.m index 4d74ee6..39af5ed 100644 --- a/Ifish/views/IfishPopView/LXPopView.m +++ b/Ifish/views/IfishPopView/LXPopView.m @@ -34,6 +34,7 @@ UIImageView *bakc=[[UIImageView alloc] initWithFrame:CGRectMake(0, 10, self.frame.size.width, self.frame.size.height)]; bakc.image = self.backgroundImage; + self.backImageView=bakc; //bakc.backgroundColor = [UIColor redColor]; [self addSubview:bakc]; @@ -56,6 +57,12 @@ [self addSubview:self.tableView]; } +-(void)changeStyle:(NSString*)style +{ + self.backgroundColor=[UIColor whiteColor]; + [self.backImageView removeFromSuperview]; + self.tableView.backgroundColor=[UIColor whiteColor]; +} #pragma mark - Table view data source @@ -77,22 +84,30 @@ { - - PopCell *cell =[tableView dequeueReusableCellWithIdentifier:@"PopCell"]; - - if (!cell) { + UITableViewCell*realcell; + if ([self.delegate respondsToSelector:@selector(tableView:cellForPopViewIndexPath:)]) { + realcell=[self.delegate tableView:tableView cellForPopViewIndexPath:indexPath]; + } + else + { + PopCell *cell =[tableView dequeueReusableCellWithIdentifier:@"PopCell"]; - cell = [[[NSBundle mainBundle] loadNibNamed:@"PopCell" owner:self options:nil]lastObject]; + if (!cell) { + + cell = [[[NSBundle mainBundle] loadNibNamed:@"PopCell" owner:self options:nil]lastObject]; + + } + cell.nametitle.text = self.titles[indexPath.row]; + cell.backgroundColor = [UIColor colorWithRed:40.0/256.0 green:40.0/256.0 blue:40.0/256.0 alpha:1]; + cell.nametitle.textColor = [UIColor whiteColor]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.popViewHeaderImg.image = [UIImage imageNamed:self.titleImgs[indexPath.row]]; + realcell=cell; } - cell.nametitle.text = self.titles[indexPath.row]; - cell.backgroundColor = [UIColor colorWithRed:40.0/256.0 green:40.0/256.0 blue:40.0/256.0 alpha:1]; - cell.nametitle.textColor = [UIColor whiteColor]; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - cell.popViewHeaderImg.image = [UIImage imageNamed:self.titleImgs[indexPath.row]]; - return cell; + return realcell; } diff --git a/Ifish/views/StoreNameView.h b/Ifish/views/StoreNameView.h new file mode 100644 index 0000000..d0ed4d5 --- /dev/null +++ b/Ifish/views/StoreNameView.h @@ -0,0 +1,32 @@ +// +// StoreNameView.h +// Ifish +// +// Created by 祝发冬 on 2020/4/20. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import +#import "LXPopView.h" +#import "DXPopover.h" +#import "AppDelegate.h" +NS_ASSUME_NONNULL_BEGIN + +@interface StoreNameView : UIView +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) IBOutlet UILabel *createStoreLabel; +@property (weak, nonatomic) IBOutlet UITextField *storeNameField; +@property (weak, nonatomic) IBOutlet UITextField *oldStoreNameField; +@property (weak, nonatomic) IBOutlet UIButton *cancelButton; +@property (weak, nonatomic) IBOutlet UIButton *sureButton; +@property (nonatomic, copy) void(^sureBlock)(NSString*name) ; +@property (nonatomic, copy) void(^cancelBlock)() ; +@property (nonatomic, strong) DXPopover *popover; +@property (weak, nonatomic) IBOutlet UILabel *oldLabel; +@property(nonatomic,strong) UITableView *tableView; +@property (nonatomic, strong) NSArray *titles; +@property (nonatomic, weak) UIViewController *controller; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/views/StoreNameView.m b/Ifish/views/StoreNameView.m new file mode 100644 index 0000000..b5f1ffb --- /dev/null +++ b/Ifish/views/StoreNameView.m @@ -0,0 +1,156 @@ +// +// StoreNameView.m +// Ifish +// +// Created by 祝发冬 on 2020/4/20. +// Copyright © 2020 lianlian. All rights reserved. +// + +#import "StoreNameView.h" + +@implementation StoreNameView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ +-(void)awakeFromNib +{ + [super awakeFromNib]; + self.layer.borderWidth=0.5; + self.layer.borderColor=[UIColor lightGrayColor].CGColor; + self.titleLabel.layer.borderColor=[UIColor lightGrayColor].CGColor; + self.titleLabel.layer.borderWidth=0.5; + self.storeNameField.layer.borderColor=[UIColor lightGrayColor].CGColor; + self.storeNameField.layer.borderWidth=0.5; + self.autoresizingMask=UIViewAutoresizingNone; + self.autoresizesSubviews=NO; + + + UIButton*more=[UIButton buttonWithType:UIButtonTypeCustom]; + more.frame=CGRectMake(0, 0, 30, 30); + [more setImage:[UIImage imageNamed:@"xialasanjiao"] forState:UIControlStateNormal]; + [more addTarget:self action:@selector(showStoreName:) forControlEvents:UIControlEventTouchUpInside]; + self.oldStoreNameField.layer.borderColor=[UIColor lightGrayColor].CGColor; + self.oldStoreNameField.layer.borderWidth=0.5; + self.oldStoreNameField.delegate=self; + self.oldStoreNameField.clearButtonMode=UITextFieldViewModeAlways; + self.oldStoreNameField.rightViewMode=UITextFieldViewModeAlways; + self.cancelButton.layer.borderColor=[UIColor lightGrayColor].CGColor; + self.oldStoreNameField.rightView=more; + self.cancelButton.layer.borderWidth=0.5; + self.cancelButton.layer.masksToBounds=YES; + self.sureButton.layer.borderColor=[UIColor lightGrayColor].CGColor; + self.sureButton.layer.borderWidth=0.5; + self.sureButton.layer.masksToBounds=YES; + self.sureButton.layer.cornerRadius=5; + self.cancelButton.layer.cornerRadius=5; + [self.sureButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside]; + [self.cancelButton addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside]; + NSDictionary*dict=[[DataCenter defaultDtacenter] valueForKey:@"petStores"]; + NSArray *titles=dict.allKeys; + self.titles=titles; + self.tableView = [[UITableView alloc] init]; + + self.tableView.frame = CGRectMake(0, 0, self.frame.size.width, titles.count>3?3*44:titles.count*44); + //self.tableView.frame = CGRectMake(0,12.0, self.frame.size.width, self.frame.size.height); + self.tableView.delegate = self; + self.tableView.dataSource = self; + + + +} +-(void)click:(UIButton*)buton +{ + [self.popover dismiss]; + if (buton.tag==1) + { + if (self.cancelBlock) { + self.cancelBlock(); + } + + } + else + { + if (self.sureBlock) { + NSString*name; + if (self.storeNameField.text.length) + { + name=self.storeNameField.text; + } + else if(self.oldStoreNameField.text.length) + { + name=self.oldStoreNameField.text; + } + else + { + [self makeToast:@"请输入或者选择名称!"]; + } + if (name.length) { + self.sureBlock(name); + } + + } + + } +} +-(void)showStoreName:(UIButton*)button +{ + + self.tableView.frame = CGRectMake(0, 0, self.frame.size.width-40, self.titles.count>2?2*44:self.titles.count*44); + DXPopover *popover = [DXPopover new]; + self.tableView.layer.masksToBounds=YES; + + self.popover = popover; + self.popover.backgroundColor = [UIColor lightGrayColor]; + self.popover.cornerRadius=10; + popover.arrowSize = CGSizeMake(5,5); + + + [popover showAtPoint:CGPointMake(self.oldStoreNameField.center.x, self.oldStoreNameField.center.y+15) popoverPostion:DXPopoverPositionDown withContentView:self.tableView inView:self]; + + +} + + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSString*model= self.titles[indexPath.row]; + self.oldStoreNameField.text=model; + [self.popover dismiss]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return self.titles.count; +} +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"storeName"]; + NSString*model= self.titles[indexPath.row]; + if (!cell) + { + cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"storeName"]; + } + cell.textLabel.text=model; + return cell; +} + + + + +-(BOOL)textFieldShouldClear:(UITextField *)textField +{ + + return YES; +} +-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField +{ + return NO; +} + +@end diff --git a/Ifish/views/StoreNameView.xib b/Ifish/views/StoreNameView.xib new file mode 100644 index 0000000..96fa511 --- /dev/null +++ b/Ifish/views/StoreNameView.xib @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ifish/views/mypicView/remindCyclePic.h b/Ifish/views/mypicView/remindCyclePic.h index e9fcf3e..d4f32bc 100644 --- a/Ifish/views/mypicView/remindCyclePic.h +++ b/Ifish/views/mypicView/remindCyclePic.h @@ -23,6 +23,7 @@ @property(nonatomic,copy)NSString*picViewResultString; @property(nonatomic,copy)NSString*picString; +@property (nonatomic, strong) NSString *type; - +-(instancetype)initWithFrame:(CGRect)frame type:(NSString*)type; @end diff --git a/Ifish/views/mypicView/remindCyclePic.m b/Ifish/views/mypicView/remindCyclePic.m index c2b1aad..5b00e2e 100644 --- a/Ifish/views/mypicView/remindCyclePic.m +++ b/Ifish/views/mypicView/remindCyclePic.m @@ -7,6 +7,7 @@ // #import "remindCyclePic.h" +#import "IfishDeviceInfo.h" #define CANCLE_BTN 100000100 #define SURE_BTN 100000120 @interface remindCyclePic() @@ -17,14 +18,24 @@ self=[super initWithFrame:frame]; if (self) { - [self initPic]; + [self initPictype:nil]; } return self; } --(void)initPic{ - + +-(instancetype)initWithFrame:(CGRect)frame type:(NSString*)type{ + self=[super initWithFrame:frame]; + if (self) { + + [self initPictype:type]; + + } + return self; +} +-(void)initPictype:(NSString*)type { + _type=type; CGFloat imgWid= kScreenSize.width - 40*2; CGFloat imHeight= kScreenSize.width - 60; self.backgroundColor=[UIColor colorWithWhite:0 alpha:0.5]; @@ -35,6 +46,13 @@ _picBackImg.userInteractionEnabled=YES; UILabel*title=[[UILabel alloc]initWithFrame:CGRectMake(10, 10, _picBackImg.frame.size.width-10*2, 20)]; title.text=@"换水天数选择"; + if ([self.type isEqualToString:DECICE_TYPE_XUANDUO3F]) { + title.text=@"杀菌天数选择"; + } + else if ([self.type isEqualToString:@"temp"]) { + title.text=@"恒温设置"; + } + title.textAlignment=NSTextAlignmentCenter; [_picBackImg addSubview:title]; @@ -86,6 +104,7 @@ } + -(void)dissmissView{ [self removeFromSuperview]; @@ -95,6 +114,10 @@ -(void)dataSource{ _picArr=@[@[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35",@"36",@"37",@"38",@"39",@"40",@"41",@"42",@"43",@"44",@"45",@"46",@"47",@"48",@"49",@"50"]]; + if ([self.type isEqualToString:@"temp"]) + { + _picArr=@[@[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31",@"32",@"33",@"34",@"35",@"36",@"37",@"38",@"39",@"40",@"41",@"42",@"43",@"44",@"45",@"46",@"47",@"48",@"49",@"50",@"51",@"52",@"53",@"54",@"55",@"56",@"57",@"58",@"59",@"60",@"61",@"62",@"63",@"64",@"65",@"66",@"67",@"68",@"69",@"70",@"71",@"72",@"73",@"74",@"75",@"76",@"77",@"78",@"79",@"80"]]; + } } diff --git a/Ifish/views/setViewCell/ChangeWaterCell.h b/Ifish/views/setViewCell/ChangeWaterCell.h index c4f537f..6e631ad 100644 --- a/Ifish/views/setViewCell/ChangeWaterCell.h +++ b/Ifish/views/setViewCell/ChangeWaterCell.h @@ -11,6 +11,7 @@ @interface ChangeWaterCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *huanshuiDaylabel; +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (weak, nonatomic) IBOutlet UIButton *ChangeWaterSwitch; diff --git a/Ifish/views/setViewCell/ChangeWaterCell.xib b/Ifish/views/setViewCell/ChangeWaterCell.xib index 3e9d444..38f503e 100644 --- a/Ifish/views/setViewCell/ChangeWaterCell.xib +++ b/Ifish/views/setViewCell/ChangeWaterCell.xib @@ -1,9 +1,12 @@ - - + + + + + - - + + @@ -12,26 +15,26 @@ - +